[mapserver-users] Mapserver as a WMS server and as a WFS-client + SLD problem

Jaakko Kahkonen jaakko.kahkonen at fgi.fi
Tue Feb 23 09:24:01 EST 2010


Hello list,

I'm trying to upgrade MapServer 5.4.2 => 5.6.1, but my
WMS+SLD/WFS-client combination does not work after upgrading. WFS data
is fetched from GeoServer.

This is an obvious explanation from MapServer log:
msEvalRegex(): Regular expression error. String failed expression test.

But why - and how do I get over it?

Note that If I do not use SLD, Mapserver 5.6.1 works fine (see result:
MS561_noSLD_osm_2010.png).


Example request (with SLD parameter):
*************************************

http://10.0.36.146/cgi-bin/osm_2010?LAYERS=planet_osm_line&FORMAT=image%2Fpng&SLD=http://10.0.36.146/sld/osm.xml&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4258&BBOX=24.808341477283,60.151299935951,25.017877068694,60.360835527361&WIDTH=265&HEIGHT=265

Request returns SLD -styled map with MapServer 5.4.2 (see
MS542SLD_osm_2010.png)


nc10 cgi-bin # ./mapserv -v:

MapServer version 5.4.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS
INPUT=TIFF INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

ms_error.txt (mapserver-5.4.2, OK):
***********************************
[Tue Feb 23 14:38:58 2010].64730 CGI Request 1 on process 31103
[Tue Feb 23 14:38:58 2010].229172 msApplySLD(): Map file after SLD was
applied
/var/www/localhost/htdocs/mapserver_oma/4b83cc62_797f_1._sld.map[Tue Feb
23 14:39:05 2010].854165 msDrawMap(): Layer 0 (planet_osm_line), 4.998s
[Tue Feb 23 14:39:05 2010].854241 msDrawMap(): Drawing Label Cache, 0.000s
[Tue Feb 23 14:39:05 2010].854281 msDrawMap() total time: 7.624s
[Tue Feb 23 14:39:06 2010].6693 msSaveImage() total time: 0.152s
[Tue Feb 23 14:39:06 2010].7107 mapserv request processing time
(msLoadMap not incl.): 7.942s
[Tue Feb 23 14:39:06 2010].7164 msFreeMap(): freeing map at 0x819be20.


With MapServer 5.6.1 request returns an empty map (see
MS561SLD_osm_2010.png).
**********************************************

nc10 cgi-bin # ./mapserv -v:

MapServer version 5.6.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG
SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI
SUPPORTS=THREADS SUPPORTS=GEOS INPUT=TIFF INPUT=EPPL7 INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE



ms_error.txt (mapserver-5.6.1 NOT OK!!!):
***************************************

[Tue Feb 23 14:42:34 2010].837252 CGI Request 1 on process 994
[Tue Feb 23 14:42:37 2010].405972 msEvalRegex(): Regular expression
error. String failed expression test.
[Tue Feb 23 14:42:37 2010].410682 msApplySLD(): Map file after SLD was
applied
/var/www/localhost/htdocs/mapserver_oma/4b83cd3d_3e2_3._sld.map[Tue Feb
23 14:42:40 2010].296531 msDrawMap(): Layer 0 (planet_osm_line), 1.610s
[Tue Feb 23 14:42:40 2010].296619 msDrawMap(): Drawing Label Cache, 0.000s
[Tue Feb 23 14:42:40 2010].296661 msDrawMap() total time: 2.864s
[Tue Feb 23 14:42:40 2010].448987 msSaveImage() total time: 0.152s
[Tue Feb 23 14:42:40 2010].449291 mapserv request processing time
(msLoadMap not incl.): 5.612s
[Tue Feb 23 14:42:40 2010].449331 msFreeMap(): freeing map at 0x81c9de0.

MapFile:
********
MAP
  NAME OSM_2010
  IMAGETYPE      PNG
  #EXTENT 57842.59 6622010.94 735699.26 7780000
  EXTENT -380688 6247443 1347312 8227443
  SIZE           600 600
  UNITS METERS

  CONFIG "MS_ERRORFILE"
"/var/www/localhost/htdocs/mapserver_oma/ms_error.txt"
  DEBUG 5

  OUTPUTFORMAT
        NAME PNG
        DRIVER AGG/PNG
        MIMETYPE "image/png"
        EXTENSION "png"
        IMAGEMODE RGBA
        FORMATOPTION INTERLACE=ON
        FORMATOPTION QUALITY=100
  END

  WEB
        IMAGEPATH "/var/www/localhost/htdocs/mapserver_oma/"
        IMAGEURL  "/mapserver_oma/"
        LOG "/var/www/localhost/htdocs/mapserver_oma/"
        METADATA
          "ows_encoding" "UTF-8"
          "ows_abstract" "Test"
          "ows_title" "test2"
          "ows_accessconstraints" "free"
          "ows_srs" "EPSG:3067 EPSG:4258 EPSG:4326 EPSG:900913"
          "ows_onlineresource"   "http://10.0.36.146/cgi-bin/osm_2010?"
        END
  END

  PROJECTION
        "init=epsg:3067"
  END

  LAYER
    NAME "planet_osm_line"
    TYPE LINE
    STATUS OFF
    CONNECTIONTYPE WFS
    CONNECTION "http://localhost:8080/geoserver/ows?"
    METADATA
      "ows_title"             "Planet_osm_line"
      "wfs_typename"          "osm_suomi:planet_osm_line"
      "wfs_version"           "1.0.0"
      "wfs_request_method"    "GET"
      "wfs_connectiontimeout" "30"
    END
    PROJECTION
      "init=epsg:3067"
    END

    CLASS
      NAME "residential"
      STYLE
        COLOR 255 0 0
        SIZE 10
      END
    END

  END

END


SLD (osm.xml):
*************

<?xml version="1.0" encoding="utf-8"?>
<sld:StyledLayerDescriptor version="1.1.0"
schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:se="http://www.opengis.net/se"
xmlns:xlink="http://www.w3.org/1999/xlink"
xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sld="http://www.opengis.net/sld">
  <sld:NamedLayer>
    <se:Name>planet_osm_line</se:Name>
    <sld:UserStyle>
      <se:Name>Test</se:Name>
      <se:Title>Test style</se:Title>
      <se:FeatureTypeStyle>
        <se:Rule>
          <se:Name>Residential</se:Name>
          <se:Title>Island</se:Title>
          <ogc:Filter>
            <ogc:PropertyIsEqualTo>
              <ogc:PropertyName>highway</ogc:PropertyName>
              <ogc:Literal>residential</ogc:Literal>
            </ogc:PropertyIsEqualTo>
          </ogc:Filter>
           <se:LineSymbolizer>
            <se:Stroke>
              <se:SvgParameter name="stroke">#9C9C9C</se:SvgParameter>
              <se:SvgParameter name="stroke-width">2</se:SvgParameter>
            </se:Stroke>
          </se:LineSymbolizer>
        </se:Rule>
      </se:FeatureTypeStyle>
    </sld:UserStyle>
  </sld:NamedLayer>
</sld:StyledLayerDescriptor>


-- 
Jaska K.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MS542SLD_osm_2010.png
Type: image/png
Size: 4505 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100223/d1b8f747/MS542SLD_osm_2010-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MS561_noSLD_osm_2010.png
Type: image/png
Size: 10246 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100223/d1b8f747/MS561_noSLD_osm_2010-0001.png
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MS561SLD_osm_2010.png
Type: image/png
Size: 353 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100223/d1b8f747/MS561SLD_osm_2010-0001.png


More information about the mapserver-users mailing list