Skip to content

Commit

Permalink
update transects.py and common.py to fix the broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
2320sharon committed Jun 26, 2024
1 parent 5921c75 commit cf0d4a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/coastseg/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,8 @@ def convert_points_to_linestrings(gdf, group_col='date', output_crs='epsg:4326')
return gpd.GeoDataFrame(columns=['geometry'])
# Recreate the groups as a geodataframe
grouped_gdf = gpd.GeoDataFrame(filtered_groups, geometry='geometry')
linestrings = grouped_gdf.groupby(group_col).apply(lambda g: LineString(g.geometry.tolist()))
linestrings = grouped_gdf.groupby(group_col,group_keys=False).apply(lambda g: LineString(g.geometry.tolist()))

# Create a new GeoDataFrame from the LineStrings
linestrings_gdf = gpd.GeoDataFrame(linestrings, columns=['geometry'],)
linestrings_gdf.reset_index(inplace=True)
Expand Down
3 changes: 1 addition & 2 deletions src/coastseg/transects.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ def load_intersecting_transects(
else:
rectangle = rectangle.copy().set_crs(crs)
# get the bounding box of the rectangle
bbox = rectangle.bounds.iloc[0].tolist()

bbox = tuple(rectangle.bounds.iloc[0].tolist())
# Create a list to store the GeoDataFrames
gdf_list = []
# Iterate over each transect file and select the transects that intersect with the rectangle
Expand Down

0 comments on commit cf0d4a5

Please sign in to comment.