[mapserver-users] Use STYLEITEM to style individual features?

Alexander Schenkel aschenkel at kadenpartner.ch
Thu Nov 29 22:31:01 PST 2012


Dear Tamas,

Thanks, I will do so. So if I understand correctly, it should work if we
use the SYMBBOL index instead of the name?

so e.g.:

STYLE
    SIZE 10
    COLOR 135 255 135
    OUTLINEWIDTH 2
    OUTLINECOLOR 0 0 0
    SYMBOL 2 # ('filled square' is the 2nd symbon in our symboldef file)
END

instead of 

STYLE
    SIZE 10
    COLOR 135 255 135
    OUTLINEWIDTH 2
    OUTLINECOLOR 0 0 0
    SYMBOL 'filled square'
END

Unfortunately, this is also not working. And, as also written in my first post, it IS indeed working on class level, so if we surround our style definition with a CLASS ... END tag, but, yeah, this is not what we want as all those classes then gets defined and applied to all features.

So I will file a bug, but perhaps this is not the root of the problem?

Thanks
alex



Am 29.11.12 22:36, schrieb Tamas Szekeres:
> 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
>>



More information about the mapserver-users mailing list