[mapserver-users] Union layers and WFS requests

Michel.Dastous at bentley.com Michel.Dastous at bentley.com
Thu Jan 22 12:03:16 PST 2015


Hi All,

We are actually testing the capabilities of the UNION layers especially in a WFS server context.  We were able to perform WFS GetFeature request against a union layer, however as soon as we add a  filtering criteria to our request It starts returns empty response.  Performing the same request on the underlying request works perfectly.

Here is the details about our map file definition and also sample WFS requests made.

LAYER
  NAME 'unioned'
  TYPE POLYGON
  STATUS DEFAULT
  CONNECTIONTYPE UNION
  CONNECTION "layer1,layer2"
  PROCESSING "ITEMS=PKEY,PROJ_NAME"
   EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214
   METADATA
     "gml_featureid"        "PKEY"
     "ows_enable_request"        "*"
     "ows_extent"        "815927.781772741 639558.864791513 1248160.81380272 917014.748839214"
     "ows_srs"        "EPSG:2234"
     "ows_title"        "unioned"
     "gml_include_items"        "all"
     "gml_types"        "auto"
    END # METADATA
STYLEITEM "AUTO"
  # Define an empty class that will be filled at runtime from the color and
  # styles read from each source layer.
  CLASS
  END
END

  LAYER
    CONNECTION "layer1.shp"
    CONNECTIONTYPE OGR
    EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214
    METADATA
      "gml_featureid"        "PKEY"
      "ows_enable_request"        "*"
      "ows_extent"        "815927.781772741 639558.864791513 1248160.81380272 917014.748839214"
      "ows_srs"        "EPSG:2234"
      "ows_title"        "layer1"
      "gml_include_items"        "all"
      "gml_types"        "auto"
    END # METADATA
    NAME "layer1"
    PROJECTION
      "init=epsg:2234"
    END # PROJECTION
    STATUS ON
    TILEITEM "location"
    TYPE POLYGON
    UNITS METERS
    CLASS
      NAME "01 STIP"
      EXPRESSION ('[PROJ_CURRE]' eq '01_STIP')
      STYLE
        COLOR "#ffc80066"
        OPACITY 40
        OUTLINECOLOR "#ffc80066"
        WIDTH 3
      END # STYLE
    END # CLASS
  END # LAYER

  LAYER
    CONNECTION "layer2.shp"
    CONNECTIONTYPE OGR
    EXTENT 815927.781772741 639558.864791513 1248160.81380272 917014.748839214
    METADATA
      "gml_featureid"        "PKEY"
      "ows_enable_request"        "*"
      "ows_extent"        "815927.781772741 639558.864791513 1248160.81380272 917014.748839214"
      "ows_srs"        "EPSG:2234"
      "ows_title"        "layer2"
      "gml_include_items"        "all"
      "gml_types"        "auto"
    END # METADATA
    NAME "layer2"
    PROJECTION
      "init=epsg:2234"
    END # PROJECTION
    STATUS ON
    TILEITEM "location"
    TYPE POLYGON
    UNITS METERS
    CLASS
      NAME "01 STIP"
      EXPRESSION ('[PROJ_CURRE]' eq '01_STIP')
      STYLE
        COLOR "#ffc80066"
        OPACITY 40
        OUTLINECOLOR "#ffc80066"
        WIDTH 3
      END # STYLE
    END # CLASS
  END # LAYER



Request against Layer1, return correct data.
http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>PROJ_NAME</ogc:PropertyName><ogc:Literal>0172-0417</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>&RESULTTYPE=results&TYPENAME=layer1&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map
Layer2 works, return correct data.:
http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>PROJ_NAME</ogc:PropertyName><ogc:Literal>0172-0417</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>&RESULTTYPE=results&TYPENAME=layer2&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map
Unioned with filter returns empty answer:
http://localhost/ms/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&FILTER=<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyIsEqualTo><ogc:PropertyName>PROJ_NAME</ogc:PropertyName><ogc:Literal>0172-0417</ogc:Literal></ogc:PropertyIsEqualTo></ogc:Filter>&RESULTTYPE=results&TYPENAME=unioned&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map

Unioned without filter returns correct data.:
http://localhost/MapRenderingEngine/Mapserv.exe?SERVICE=WFS&REQUEST=GetFeature&VERSION=1.1.0&RESULTTYPE=results&TYPENAME=unioned&PROPERTYNAME=(PROJ_NAME)&MAP=Internal/mastermap.map

So is this a known limitation or maybe a bug?  Does anyone have any suggestion to work around this?


Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20150122/e519bc56/attachment.htm>


More information about the MapServer-users mailing list