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

Kirk Schmidt kirk at nortekresources.com
Thu Apr 25 09:01:57 PDT 2019


Hi Richard:

A simple work around is to multiply the raster by 10000 or so, generate 
the contours and then recalculate the actual value in the attribute 
table to the precision you require.

Kirk Schmidt

On 4/25/2019 11:31 AM, Richard Duivenvoorde wrote:
> 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
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

-- 
Kirk Schmidt, MScF, BScF, RPF
General Manager
Nortek Resource Solutions Inc.
RR # 1
Thorburn, NS
B0K 1W0
Tel (902) 922.3607
Email: kirk at nortekresources.com
Web: www.nortekresources.com



More information about the Qgis-user mailing list