Open youngdjn opened 2 weeks ago
I agree that shp
is a bad format to use and it wasn't my goal to use it initially. It looks like if you the path you provide to geopandas.save_file
doesn't have an extension, it interprets it as shp
. I think there's a couple documentation changes that could make this a little better. The first is already done, since @amrithasp02 clarified the output file should be a geofile here. I can also update the documentation of RegionDetections.save
(here) to be a little more explicit that a file path with a geospatial extension is requested.
I see the reasoning for per-raster outputs, but that was not the way I initially thought of this working. I was thinking we'd provide a folder of rasters only if they were overlapping or otherwise needed to be processed together. In this case, I don't think we'd necessarily want per-raster outputs, and for the overlapping case, this might not even be clearly defined. But I can see an alternative workflow where you just want to conveniently run on a folder of independent rasters.
If we do want to do some sort of default naming, I think the generate_predictions function would be a good place for that logic.
Oh thanks, I think I misunderstood a few things before, but everything you say makes sense and I don't think there's a need for any change, except maybe the documentation change you suggest (so I won't close this issue yet).
Currently,
RegionDetections.save
saves an ESRI shapefile of namename.shp
(plus ancillary files namedname.xyz
) into a folder namedname
, wherename
is provided by the user via the argumentsave_path
, or the entrypoint arg--predictions-save-path
.It would be better to default to
.gpkg
output file format (see here). Also, I think it would be best for the output filename to be the same as the input raster used for predictions (probably with a timestamp suffix, so multiple preds can be made without overwriting). This way, if they user specifies to perform predictions for multiple rasters (i.e. the input folder contains multiple rasters), predictions from each one can be saved and associated with their source.It looks like this could be accomplished simply by changing
save_path
to a file path instead of a folder path, and specifically of the formatpath/to/preds/folder/{input_rastername}_preds_{timestamp}.gpkg
. I'm open to input on any of this, especially the inclusion of the timestamp.