[mapserver-users] LABEL-formatting options

pcreso at pcreso.com pcreso at pcreso.com
Wed Mar 10 02:49:56 EST 2010


Hi Stephan,

Can you not add an appropriate column automatically as the shapefile is generated?

Tools such as dbfscript (http://www.whitetown.com/dbf-script/) or perhaps script something with the shapelib libraries or tools or the ogr tools?

I have found that using Postgis rather than shapefiles gives you the ability to easily manage such issues as the data retrieved by mapserver is derived from an SQL query which allows the creation of virtual "columns" for labels on the fly.

Treating this sort of problem as a data management problem, in terms of supplying the desired data derived on the fly from the stored data, allows a tool such a Postgis to do what a database is designed for. A script using shp2pgsql or ogr2ogr to automatically turn your shapefile into a Postgis table, and render this using mapserver instead of the shapefile should fix your problem.


Cheers,

  Brent Wood

> On Behalf Of Stephan Holl [stephan.holl at intevation.de]
> Sent: Tuesday, March 09, 2010 7:54 AM
> To: mapserver-users at lists.osgeo.org
> Subject: [mapserver-users] LABEL-formatting options
> 
> Hello mapservers,
> 
> we are using MapServer for visualizing shapefiles with
> double entries
> inside.
> 
> Mainly this are contour-lines from waterdepth. The double
> values have
> 32 decimal places and mapserver tries to render them _all_
> along a
> contourline.
> This does not look nice...
> 
> Is there an option to trim the values with a dedicated
> mapfile-parameter, e.g. where a prinft-syntax can be used
> to format the
> values?
> 
> The shapefiles are generated automatically so adding
> another column with
> trunc()ed or round()ed values is no option.
> 
> Are there any options to format label-values/strings? I
> have not found
> anything in the docs.
> 
> TIA
> 
>         Stephan
> 
> --
> Stephan Holl <stephan.holl at intevation.de>
> | Tel.: +49 (0)541-33 508 3663
> Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG
> Osnabrück - HR B 18998
> Geschäftsführer:  Frank Koormann, Bernhard Reiter,
> Dr. Jan-Oliver Wagner
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 


More information about the mapserver-users mailing list