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:


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) (6.7 KB ) - added by Flewellyn 8 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 by Jukka Rahkonen, 9 years ago

It seems that is calling GDAL algorithm gdal.polygonize as

gdal.Polygonize( srcband, maskband, dst_layer, dst_field, options, callback = prog_func )

From I can read that there exists an variant "GDALFPolygonize()" which seems to do what is desired in this ticket:

  • The source pixel band values are read into a 32bit float buffer. If you want
  • to use a (probably faster) version using signed 32bit integer buffer, see
  • GDALPolygonize().

If I am right we could close this ticket as fixed because "GDALFPolygonize()" exists. However, most users run polygonize throught and it does not mention anything about this option. Also the comments in polygonize.cpp give more information about the usage than even the latter does have a link to the doxygen document of the algorithm.

by Flewellyn, 8 years ago

Attachment: added


comment:2 by Flewellyn, 8 years ago

I've attached a modified 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 Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

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 if it is not already reported there.

Note: See TracTickets for help on using tickets.