Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close #511, replaced convert_to_boxes with geometry_type #514

Merged
merged 4 commits into from
Oct 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Complies with style tests and improved docsting consistency
JSpencerPittman committed Oct 16, 2023
commit 78c6ec59b3dfe723c700969e21edd23ce9cf7b04
5 changes: 3 additions & 2 deletions deepforest/utilities.py
Original file line number Diff line number Diff line change
@@ -262,14 +262,15 @@ def shapefile_to_annotations(shapefile,
rgb: Path to the RGB image on disk
savedir: Directory to save csv files
buffer_size: size of point to box expansion in map units of the target object, meters for projected data, pixels for unprojected data. The buffer_size is added to each side of the x,y point to create the box.
geometry_type (bbox): Specifies the spatial representation used in the shapefile; can be "bbox" or "point"
geometry_type: Specifies the spatial representation used in the shapefile; can be "bbox" or "point"
Returns:
results: a pandas dataframe
"""

# Verify the geometry_type is valid
if geometry_type not in ["bbox", "point"]:
raise ValueError(f"Invalid argument for 'geometry_type'. Expected 'point' or 'bbox'.")
raise ValueError(
"Invalid argument for 'geometry_type'. Expected 'point' or 'bbox'.")

# Read shapefile
gdf = gpd.read_file(shapefile)