solaris
solaris copied to clipboard
[MAINT] min_area filter in sol.vector.mask.mask_to_poly_geojson drops all polygons if crs is epsg:4326: would be nice to add crs check
Maintenance request summary
the sol.vector.mask.mask_to_poly_geojson
currently has a default min_area
of 40. While this is useful if you are only using the pixel version or you are using a reference image that has a crs with units in meters, if your reference image is in lat/lng, it drops all the polygons because it is unlikely any of them will span that many degrees of lat/lng. It would be nice to add a check for this and only use the min_area if the crs units are in meters/pixels, or at least give a user warning
Task detail and notes
probably add a check for the value of the crs before doing https://github.com/CosmiQ/solaris/blob/39611db0fde7877f69b819df618801136ba65691/solaris/vector/mask.py#L798
Any additional information:
-
What other code will this impact? None probably
-
Do new tests need to be written or do existing tests need to be updated? Maybe?
-
Will this impact documentation? A little: some more additional clarification on the
min_area
param would be useful
Are you able to obtain vector files using epsg:4326 now? I have been trying to create vector masks for images with sol.vector.mask.mask_to_poly_geojson, but I only get the masks according to the pixel values. Is there a solution to getting masks according to lat/long in epsg:4326?