Individual styling of features not working when using STYLEITEM #4534

Closed
bylexus opened this Issue Nov 30, 2012 · 2 comments

Projects

None yet

2 participants

@bylexus
bylexus commented Nov 30, 2012

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

As Tamas Szekeres szekerest@gmail.com mentioned, this seems to be a bug:

"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.

Best regards,

Tamas"

Unfortunately, even if we use the symbol index, this does not help.

Many thanks for your support,

alex

@szekerest szekerest was assigned Dec 9, 2012
@szekerest
Member

Issue is now fixed in branch 6-2, hopefully

@szekerest szekerest closed this Dec 9, 2012
@bylexus
bylexus commented Dec 10, 2012

Dear Tamas,

Unfortunately not: Just pulled the 6-2 branch and tested it. What
happens now is that it does not cause a Mapfile error, but just outputs
an empty image instead.

Our relevant Mapfile section looks as follows:

LAYER
  CONNECTIONTYPE postgis
  TYPE POINT
  STYLEITEM "mapserver_style"

  CLASS
  END
END

while the "mapserver_style" column on each feature record contains
something like:

STYLE
    SIZE 20
    COLOR 255 255 44
    OUTLINEWIDTH 4
    OUTLINECOLOR 0 0 0
    SYMBOL 'filled circle'
END

The "filled circle" symbol is defined in an external symbol set file.

Hm.... Perhaps we just do it the wrong way? Any suggestions?

Am 09.12.12 21:23, schrieb Tamas Szekeres:

Issue is now fixed in branch 6-2, hopefully


Reply to this email directly or view it on GitHub:
#4534 (comment)

@mkofahl mkofahl pushed a commit to faegi/mapserver that referenced this issue Apr 9, 2013
@szekerest szekerest Fix problems with STYLEITEM (#4534) 9f4c866
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment