SLD TextSymbolizer issue

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Fri Nov 19 12:19:27 EST 2004


Hi,

We've been doing some testing of MapServer with SLD for labelling layers
and have seem to run into issues.  Orginally, we had issues with
specifying fonts, however, upon deeper investigation, the problem may be
elsewhere.

Use case:

Here's a GetMap on a simple layer:

http://devgeo.cciw.ca/cgi-bin/mapserv/ecows?SERVICE=WMS&VERSION=1.1.1&RE
QUEST=GetMap&SRS=EPSG%3A4326&BBOX=-102.9742339843798,32.85352653562978,-
58.474233982194,60.66602653699591&WIDTH=560&HEIGHT=350&LAYERS=obs&STYLES
=&FORMAT=image%2Fpng&BGCOLOR=0xFFFFFF&TRANSPARENT=FALSE&EXCEPTIONS=appli
cation/vnd.ogc.se_xml&

Here's the same GetMap with an SLD:

http://devgeo.cciw.ca/ms_tmp/obs1.sld

..which was copied from the example at:

http://www2.dmsolutions.ca/msapps/world_testdata/tests/sld_tests/sld_tex
t_annotation.xml

..and tweaked for the layer on my server:

http://devgeo.cciw.ca/cgi-bin/mapserv/ecows?SERVICE=WMS&VERSION=1.1.1&RE
QUEST=GetMap&SRS=EPSG%3A4326&BBOX=-102.9742339843798,32.85352653562978,-
58.474233982194,60.66602653699591&WIDTH=560&HEIGHT=350&LAYERS=obs&STYLES
=&FORMAT=image%2Fpng&BGCOLOR=0xFFFFFF&TRANSPARENT=FALSE&EXCEPTIONS=appli
cation/vnd.ogc.se_xml&SLD=http://devgeo.cciw.ca/ms_tmp/obs1.sld

..which gives us back what we are expecting.  However, this is not a
valid SLD document.  When I create a valid SLD document:

http://devgeo.cciw.ca/ms_tmp/obs2.sld

And run the same GetMap with this SLD:

http://devgeo.cciw.ca/cgi-bin/mapserv/ecows?SERVICE=WMS&VERSION=1.1.1&RE
QUEST=GetMap&SRS=EPSG%3A4326&BBOX=-102.9742339843798,32.85352653562978,-
58.474233982194,60.66602653699591&WIDTH=560&HEIGHT=350&LAYERS=obs&STYLES
=&FORMAT=image%2Fpng&BGCOLOR=0xFFFFFF&TRANSPARENT=FALSE&EXCEPTIONS=appli
cation/vnd.ogc.se_xml&SLD=http://devgeo.cciw.ca/ms_tmp/obs2.sld

I get an Exception to the effect of:

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM
"http://schemas.opengeospatial.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
<ServiceException>
msDrawMap(): Image handling error. Failed to draw layer named
&#39;obs&#39;.
msDBFGetItemIndex(): DBASE file error. Item &#39;PropertyName&#39; not
found.
</ServiceException>
</ServiceExceptionReport>

In addition, GetLegendGraphic requests do not work (for any
TextSymbolizer types, actually).

Looking at the two SLD documents in question, the working SLD (which is
not valid) looks for the label property as:

/StyledLayerDescriptor/NamedLayer/UserStyle/FeatureTypeStyle/TextSymboli
zer/Label

Whereas the spec defines it like:

/StyledLayerDescriptor/NamedLayer/UserStyle/FeatureTypeStyle/TextSymboli
zer/Label/ogc:PropertyName

Comments?

..Tom



More information about the mapserver-dev mailing list