[mapserver-users] WFS Server Layer styles not displaying

Murad Jamal muradj at omnilink.com.au
Wed Mar 27 21:30:03 PDT 2013


Thanks Jukka,

So It seems like, MAPSERVER CLASS styling can be used for WMS server but not
WFS.
For WFS you have to do client side styling - something like SLD,

So I found a php mapscript here

http://mapserver.org/ogc/sld.html#php-mapscript-example-that-generates-an-sl
d-from-a-mapfile

which can create sld based on mapfile class styles.

I think I would I use this to create SLD's for all my layers and then apply
it on client side.

Murad

-----Original Message-----
From: Rahkonen Jukka [mailto:jukka.rahkonen at mmmtike.fi] 
Sent: Wednesday, 27 March 2013 4:25 PM
To: Murad Jamal; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] WFS Server Layer styles not displaying

Hi,

If I understood right you are using Mapserver as a WFS server and and you
await that your WFS client, for example QGis, shows the layer with similar
styles than it shows the same Mapserver layer through WMS.

WMS and WFS are very different things. WFS sends pure data in XML format and
there are attributes and coordinates but no colors nor line widths.
Something like this
http://188.64.1.61/cgi-bin/tinyows?service=WFS&version=1.1.0&request=GetFeat
ure&typeName=lv:mml_paikannimet20&maxFeatures=20

For the client WFS is a vector layer and you must define the styles on the
client side. However, automatic styling of WFS layers might be possible by
utilising the OGR feature style system
http://fi.search.yahoo.com/search?p=ogr+feature+style+support&ei=UTF-8&fr=mo
z35
Currently Mapserver can convert OGR styles from the source data into
Mapserver classes.
http://www.mapserver.org/input/vector/ogr.html#styleitem-auto-rendering-laye
rs-using-style-information-from-the-ogr-file

If Mapserver could do it in an opposite way and populate an additional
OGR_STYLES field of WFS Feature Type from layer styles and if the WFS client
could utilize OGR_STYLES automatically for rendering it might work. Perhaps
an idea for the Google Summer of Code?

-Jukka Rahkonen-
________________________________
Lähettäjä: mapserver-users-bounces at lists.osgeo.org
[mapserver-users-bounces at lists.osgeo.org] käyttäjän Murad Jamal
[muradj at omnilink.com.au] puolesta
Lähetetty: 27. maaliskuuta 2013 5:58
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: [mapserver-users] WFS Server Layer styles not displaying

Hello,

I have been recently testing mapserver with WFS layer.

The wfs layer appears – however it completely ignores my CLASS Styles. I
used WMS before – it worked without any issue.
Anything I am doing wrong here? Or Does mapserver doesn’t support styling
for WFS layers through CLASS definitions?

Here is my Layer Definition in map file . Using mapserver ver 6.0.2

LAYER
    NAME "bldg"
    METADATA
      "wfs_title"         "Building Footprints" ##REQUIRED
      "wfs_srs"           "EPSG:28356" ## REQUIRED
      "gml_include_items" "all" ## Optional (serves all attributes for
layer)
      "gml_featureid"     "ID" ## REQUIRED
      "wfs_enable_request" "*"
  END
    TYPE polygon
    STATUS OFF
    #DATA "site/bldg_region"
   CONNECTIONTYPE PLUGIN
                                                PLUGIN
"C:/ms4w/Apache/specialplugins/msplugin_mssql2008.dll"
    CONNECTION "server=abc;uid= abc;pwd= abc;database= abc;Integrated
Security=false"
    DATA "geom from bldg USING SRID=28356"

    TRANSPARENCY 100
    PROJECTION
      "init=epsg:28356"
    END
    CLASS
      NAME 'Building Footprints'
      STYLE
        COLOR 255 128 000
        OUTLINECOLOR 255 255 255
        WIDTH 2
      END
    END #class
  END #layer


Regards

Murad



-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2240 / Virus Database: 2641/5706 - Release Date: 03/26/13





More information about the MapServer-users mailing list