lundi 2 mars 2015

How can i filter on ID's through WFS Post request?


I want to select a set of features from my GeoServer (its Running 2.0.0) and use a query using multiple ID's to get their values. For this i send XML in a post message to the Geoserver:



<wfs:GetFeature xmlns:wfs="http://ift.tt/1m4nTUG" xmlns:ogc="http://ift.tt/KDbkOK" service="WFS" version="1.0.0" xmlns:xsi="http://ift.tt/ra1lAU" xsi:schemaLocation="http://ift.tt/1m4nTUG http://ift.tt/1G0zNrB" maxFeatures= "7000" >
<wfs:Query typeName="*:MyFeatures_df16" xmlns:feature="http://ift.tt/1hi9Vqb">
<ogc:Filter>
<ogc:And>
<ogc:OR>
<PropertyIsEqualTo>
<PropertyName>ID</PropertyName>
<Literal>98400005701</Literal>
</PropertyIsEqualTo>
<PropertyIsEqualTo>
<PropertyName>ID</PropertyName>
<Literal>-1</Literal>
</PropertyIsEqualTo>
</ogc:OR>
<ogc:And>
<ogc:PropertyIsLessThanOrEqualTo>
<ogc:PropertyName>MH_DATUM_INGANG</ogc:PropertyName>
<ogc:Literal>2015-02-27T00:00:00Z</ogc:Literal>
</ogc:PropertyIsLessThanOrEqualTo>
<ogc:Or>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>MH_DATUM_EINDE</ogc:PropertyName>
<ogc:Literal>2015-02-27T00:00:00Z</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyIsNull>
<ogc:PropertyName>MH_DATUM_EINDE</ogc:PropertyName>
</ogc:PropertyIsNull>
</ogc:Or>
</ogc:And>
</ogc:And>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>


The filter based on the date (MH_DATUM_BEGIN/MH_DATUM_EIND) is working as expected. But the filter using is completly ignored. One of the returns includes:



<gml:featureMember>
<ws_df16:MyFeatures_df16 fid="MyFeatures_df16.fid--7d7f79e6_14bcb33c65d_161">
<ws_df16:GEOMETRIE>
<gml:Polygon srsName="http://ift.tt/1G0zPzE">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates decimal="." cs="," ts=" ">197089.235,393933.984 197059.285,393941.753 197057.851,393936.587 197061.768,393935.646 197059.436,393926.758 197062.756,393925.888 197062.109,393923.534 197071.095,393921.174 197072.634,393927.002 197074.054,393932.378 197084.891,393929.538 197087.87,393928.757 197089.235,393933.984</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</ws_df16:GEOMETRIE>
<ws_df16:ID>98400007766</ws_df16:ID>
<ws_df16:MH_DATUM_INGANG>2010-01-01</ws_df16:MH_DATUM_INGANG>
<ws_df16:GIS_ID>288830</ws_df16:GIS_ID>
</ws_df16:MyFeatures_df16>
</gml:featureMember>


In this part of the response, the Date is correct(like all of the answers) but it returns all of the thousands of features in GeoServer. I want to select that specific ID because it is used in other parts of a larger application.


How can i make sure that my filter query is used as well?





Aucun commentaire:

Enregistrer un commentaire