[mapserver-users] Use STYLEITEM to style individual features?
Tamas Szekeres
szekerest at gmail.com
Thu Nov 29 13:36:19 PST 2012
Alex,
This is indeed a bug in mapserver, symbol indexes are not resolved from
symbol names when updating a style from string. You might want to file a
ticket and assign that to me in the github issue
tracker<https://github.com/mapserver/mapserver/issues/new>
.
Best regards,
Tamas
2012/11/29 Alexander Schenkel <aschenkel at kadenpartner.ch>
> Dear all,
>
> We have the following setup:
>
> Our features come as DB records out of a PostGIS 1.5 database, which
> contains a column "mapserver_style" besides other data columns. We want
> to use that column to style the individual features.
>
> Since MapServer 6.0 (we use 6.0.2), the Mapserver LAYER config knows the
> "STYLEITEM" configuration attribute, which takes the name of an
> item (DB column, in our case), and, according to the documentation,
> should contain a STYLE ...END string.
>
> This seems not to be working or we use it the wrong way. Our Mapfile's
> LAYER definition looks as follows (cleaned out
> all irrelevant information):
>
>
> ######
> LAYER
> NAME layername
> DATA "wkb_geometry from (SELECT
> wkb_geometry,mapserver_style,some_other_data) as foo using SRID=21781,
> using unique ogc_fid"
>
> TYPE POINT
> STATUS ON
> OPACITY 100
> DUMP TRUE
> STYLEITEM "mapserver_style"
>
> CLASS
> END
> END
> ######
>
> while "mapserver_style" corresponds to the database column containing
> the "STYLE .... END" string.
>
> As an example, the "mapserver_style" column for a single feature contains:
>
> STYLE
> SIZE 10
> COLOR 135 255 135
> OUTLINEWIDTH 2
> OUTLINECOLOR 0 0 0
> SYMBOL 'filled square'
> END
>
> which does NOT draw any visible feature on the map.
>
> If we just surround this example with "CLASS .... END", it basically
> works, BUT the class(es) then match every single feature, leading to
> overlapping feature symbols
> for every single feature appearing after the class has been defined:
>
> CLASS
> STYLE
> SIZE 10
> COLOR 135 255 135
> OUTLINEWIDTH 2
> OUTLINECOLOR 0 0 0
> SYMBOL 'filled square'
> END
> END
>
> So can anybody tell us how we can style features on a per-feature basis
> using the STYLEITEM config? Or is this the wrong way?
>
> Many thanks for your support,
>
> alex
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121129/bacb5250/attachment.htm>
More information about the MapServer-users
mailing list