[mapserver-users] Submitting filter does not filter - returns all features

Rahkonen Jukka jukka.rahkonen at mmmtike.fi
Tue Sep 24 06:50:49 PDT 2013


Hi,

Just a guess, but using units in filters is often poorly implemented. Have a try without units and by giving the distance in degrees.

-Jukka Rahkonen-

Lähettäjä: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Troy Day
Lähetetty: 24. syyskuuta 2013 16:23
Vastaanottaja: mapserver-users at lists.osgeo.org
Aihe: Re: [mapserver-users] Submitting filter does not filter - returns all features

I'm looking for advice on how to pass a GET request Filter through mapserver to an oracle spatial database connection. Although I have successfully implemented a BBOX filter, both DWithin and Intersects spatial filters seem to be ignored during the query process because all features (up to MAXFEATURES) are returned. No errors are returned with debug set to 5.

Here is a sample URL:

http://wfsd.visualapms.com/wfs.php?SERVICE=WFS&VERSION=1.1.0&REQUEST=getfeature&TYPENAME=parcels&SRSNAME=EPSG:4269&OUTPUTFORMAT=json&Filter=%3CFilter%3E%3CDWithin%3E%3CPropertyName%3ESHAPE%3C/PropertyName%3E%3Cgml:Point%3E%3Cgml:coordinates%3E-101.9378217465,36.758602636999996%3C/gml:coordinates%3E%3C/gml:Point%3E%3CDistance%20units=%27meters%27%3E200%3C/Distance%3E%3C/DWithin%3E%3C/Filter%3E&MAXFEATURES=300

Here is the filter part of that url  in xml format:

&Filter=<Filter><DWithin><PropertyName>SHAPE</PropertyName><gml:Point><gml:coordinates>-101.9378217465,36.758602636999996<gml:coordinates></gml:Point><Distance units="meters">200</Distance></DWithin></Filter>

...and here is the layer definition within the map file I'm using:

  LAYER
    NAME           "parcels"
    METADATA
      "wfs_title"                 "Parcels"
      "wfs_srs"                   "EPSG:4269"
      "gml_include_items"         "all"
      "gml_featureid"             "OBJECTID"
      "wfs_enable_request"        "*"
      "wfs_getfeature_formatlist" "gml,json,geojson"
      "gml_COUNTRY_ID_type"       "Character"
      "gml_STATE_ID_type"         "Character"
      "gml_COUNTY_ID_type"        "Character"
      "gml_PARCEL_ID_type"        "Character"
    END
    TYPE           POLYGON
    STATUS         ON
    EXTENT         -180 -90 180 90
    CONNECTIONTYPE oraclespatial
    CONNECTION     "SDE/3nz0rb4rr4g1n at ArcSDE"
    DATA           "SHAPE FROM (select OBJECTID, COUNTRY_ID, STATE_ID, COUNTY_ID, PARCEL_ID, APP_USER_G, SHAPE from PARCEL) USING FILTER"
    PROJECTION
      "init=epsg:4269"
    END
    CLASS
      NAME              "Parcels"
      STYLE
        COLOR                240 240 240
        OUTLINECOLOR           0   0   0
      END
    END
  END


Hoping others have gone down this rabbit hole...thanks for looking!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130924/1cccfe2d/attachment.html>


More information about the mapserver-users mailing list