[mapserver-users] LABEL-formatting options
stephan.holl at intevation.de
Wed Mar 10 03:09:14 EST 2010
pcreso at pcreso.com, [20100309 - 23:49:56]
> 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?
Yes, it is possible.
But: I think it is a feature which mapserver should deal with.
> 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.
In our case we do not have a chance to use any DB at all, since the
infrastructure permits it. The data are retrieved from caclculations,
which are itself done on a (remote) server.
> 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.
As said, the specific infrastructure (sadly) does not allow to use
PostGIS and the like (yet)....
I am after a more general approach (in
order to make MapServer a little better), for my usecase it is easy to
add a 'display'-column with the right decimal values trimmed.
> > 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
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
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100310/c34325a4/signature-0001.bin
More information about the mapserver-users