Skip to content

Commit

Permalink
allow geopandas input to shapefile to annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
bw4sz committed Dec 27, 2023
1 parent aa00ee1 commit e823400
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepforest/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ def shapefile_to_annotations(shapefile,
results: a pandas dataframe
"""
# Read shapefile
gdf = gpd.read_file(shapefile)
if isinstance(shapefile, str):
gdf = gpd.read_file(shapefile)
else:
gdf = shapefile

# Determine geometry type and report to user
if gdf.geometry.type.unique().shape[0] > 1:
Expand Down

0 comments on commit e823400

Please sign in to comment.