[gdal-dev] gdal_contour -p options no attributes and interval < 1 strange results?

Richard Duivenvoorde rdmailings at duif.net
Mon Apr 29 11:27:39 PDT 2019


Hi,

If I use gdal_contour (in QGIS/processing) to generate contours of a
rasterset you get a call like:

gdal_contour -b 1 -a ELEV -i 0.0001 -f "ESRI Shapefile" /tmp/smoke.asc
/tmp/OUTPUT.shp

The column ELEV will contain the contour 'height'

But when using the -p option (to create polygons instead of lines) this
column ELEV is just empty.
Is this a bug? Or suppoosed to be... if you want to create labels it
would be handier if this column is filled.

Another thingie:

When using interal values like above (0.0001) the contours *look* ok,
but the values in the dbf/shp file all show 0.001  ??

But when you do output a geopackage
gdal_contour -b 1 -a ELEV -i 0.0001 -f "GPKG" /tmp/smoke.asc
/tmp/OUTPUT.gpkg

The values are OK (well, showing 0.0011 and 0.00090000000 so 'precision'
is handled a little strange...), also when you use 1.0E-4 or 1.00000E-4

Is this something because it is supposed to work with values > 1?
In this case it is modeloutput: a cloud so very small values...

Thanks for any info,
And let me know if this is worth creating one or two? issues.


Wanne play/try?
http://duif.net/temp/smoke.zip is an example epsg:4326
raster smoke plume.

Regards,

Richard Duivenvoorde


More information about the gdal-dev mailing list