Skip to content

Commit

Permalink
iride_csk?frame_grid.py - Updated - erroneous identation at line 164 …
Browse files Browse the repository at this point in the history
…fixed.
  • Loading branch information
eciraci committed Jan 17, 2024
1 parent bee5ee8 commit a3ede35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions iride_csk_frame_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ def OBSOLETE_2_get_frame_grid(input_frame_shp, grid_output_shp, buffer_dist=2000
grid_centroid = (grid_gdf_dissolve["geometry"].centroid.x, grid_gdf_dissolve["geometry"].centroid.y)
centroid_x_offset = centroid[0] - grid_centroid[0]
centroid_y_offset = centroid[1] - grid_centroid[1]
grid_gdf = grid_gdf.translate(xoff=float(centroid_x_offset), yoff=float(centroid_y_offset))
# grid_gdf = grid_gdf.translate(xoff=centroid_x_offset, yoff=centroid_y_offset)
grid_gdf = grid_gdf.translate(xoff=float(centroid_x_offset), yoff=float(centroid_y_offset))
# grid_gdf = grid_gdf.translate(xoff=centroid_x_offset, yoff=centroid_y_offset)

# Append to the list
grid_gdf_list.append(grid_gdf)
Expand Down
2 changes: 0 additions & 2 deletions iride_csk_frame_grid_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ def get_frame_grid(input_frame_shp, grid_output_shp, buffer_dist=None, x_frame_s
grid_gdf = gpd.read_file(get_fishnet_grid(f"fishnet_{idx}_{os.path.basename(grid_output_shp)}", xmin, ymin, xmax, ymax, gridWidth=x_spacing,gridHeight=y_spacing))

# Step 9: Rotate back and reproject the grid with the original tilt and coordinate reference system

rotated_geometries = [rotate(geometry, angle, origin=centroid) for geometry in grid_gdf['geometry']]
grid_gdf['geometry'] = rotated_geometries

# Step 10: Shift the grid polygons to the center of the original frame polygon
grid_gdf_dissolve = grid_gdf.dissolve()
grid_centroid = (grid_gdf_dissolve["geometry"].centroid.x, grid_gdf_dissolve["geometry"].centroid.y)
Expand Down

0 comments on commit a3ede35

Please sign in to comment.