[Qgis-user] QGIS, gdal_contour and numerical label formatting...

Richard Duivenvoorde rdmailings at duif.net
Thu Apr 25 07:31:05 PDT 2019


Hi List,

I have a (smoke dispersion) raster model output of which I want to have
contour lines.
One special/strange condition: contours should be on 0.0001 (1.0E-4)...
(apparently gdal)

QGIS/gdal_contour to the rescue:

http://duif.net/temp/labelnumbers.png

But as I demo'ed this to somebody, some things came up:

- if you use gdal_contour in processing in QGIS  with a temporary layer,
then you create a SHAPE file with (default) column type 10/3 so all
values are show as 0.000 ????
BUT, if you let processing save to geopackage (as in screendump), you do
NOT have this limit.

Question: would it be feasible to move to geopackage as intermediate
format in processing (at least for gdal_contour)? Is this easy to do?

- if you open the attribute table of the contours, there is an ELEV
column with type 'real' but the values you see in the labels in the
image are the same as you see in the attribute table
While if you open the geopackage in slqitebrowser, you see values like
ordered: 0.0001, 0.0002, .... etc without the trailing 10 numbers..
Going to geojson, it looks good too (and saving that one to gpkg... is
ok too)?

- the (number) labels look.... awfull?

Question: how determines QGIS how to show floats/reals in the attribute
table? Is that something we could influence? Or is that 'not done', and
should I create a text column from the real column?

Question2: for what I can see you can influence the format of TEXT in
the label tools, but you cannot influence the format of NUMBERS, am I right?

Would be a nice feature I think? (or is this overkill, and should I go
the number->text way)?

Thanks for any input or pointers.

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

Regards,

Richard Duivenvoorde


More information about the Qgis-user mailing list