Opened 12 years ago
Closed 5 years ago
#4516 closed enhancement (wontfix)
polygonize: add option to avoid rounding of values in float rasters
Reported by: | lutra | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | closed_because_of_github_migration |
Component: | Utilities | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
That's it, the result would be a grid where every polygon had an attribute with the exact value of the underlying float raster.
Attachments (1)
Change History (4)
comment:1 by , 8 years ago
comment:2 by , 7 years ago
I've attached a modified gdal_polygonize.py script, which adds the "-p"/"--float" option to run the process through GDALFPolygonize() instead of the integer-using GDALPolygonize. I can confirm that it works as expected.
comment:3 by , 5 years ago
Milestone: | → closed_because_of_github_migration |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.
It seems that gdal_polygonize.py https://trac.osgeo.org/gdal/browser/trunk/gdal/swig/python/scripts/gdal_polygonize.py is calling GDAL algorithm gdal.polygonize as
gdal.Polygonize( srcband, maskband, dst_layer, dst_field, options, callback = prog_func )
From https://trac.osgeo.org/gdal/browser/trunk/gdal/alg/polygonize.cpp I can read that there exists an variant "GDALFPolygonize()" which seems to do what is desired in this ticket:
If I am right we could close this ticket as fixed because "GDALFPolygonize()" exists. However, most users run polygonize throught gdal_polygonize.py and it does not mention anything about this option. Also the comments in polygonize.cpp give more information about the usage than http://www.gdal.org/gdal_polygonize.html even the latter does have a link to the doxygen document of the algorithm.