[gdal-dev] Removing trailing decimals from contour labels of shape files

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Sat May 15 09:50:28 PDT 2021


You may ask help from mapserver-users for the Mapserver side. It is possible
to format the labels by expressions. See the example in

"More advanced Expressions can be used to specify the labels. Since version
6.0, there are functions available for formatting numbers:

TEXT ("Area is: " + tostring([area],"%.2f"))"

-Jukka Rahkonen-

GDAL - Dev mailing list wrote
> I tried making shape files of pressure from netcdf files using the
> following commands using gdal:
> gdal_contour -a pressure -i 4 -off 0 pressure.nc pressure.shp
> I noticed that when displaying the graph in mapserver I get label values
> such as 1010.00000000 whereas I want the labels to be whole numbers. How
> do
> I tweak this code to get whole numbers for pressure contour labels in map
> server?
> I have noticed that in the netcdf file pressure.nc that the pressure
> values
> have three trailing decimal points after them so a pressure value in the
> netcdf file will be 1010.000 instead of 1010. I also noticed that viewing
> the dbf file. Do I need to fix the netcdf file to display intergers? If so
> how do I do this?
> Thank you for your time.
> Jason Snyder
> -- 
> Jason Snyder PhD
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev

Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html

More information about the gdal-dev mailing list