Skip to content

Instantly share code, notes, and snippets.

@nachouve
Last active August 29, 2015 14:19
Show Gist options
  • Save nachouve/c59a85e04e8f234c5152 to your computer and use it in GitHub Desktop.
Save nachouve/c59a85e04e8f234c5152 to your computer and use it in GitHub Desktop.
Using cURL to test WFS with filter as a file
== request.txt (with no spaces,returns,etc.) ==
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0" maxFeatures="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"> <wfs:Query typeName="Viticola_Viticola_SIXPAC14_WFS:Recintos_2014" xmlns:Viticola_Viticola_SIXPAC14_WFS="http://idegintranet.xunta.es/arcgis/services/Viticola/Viticola_SIXPAC14_WFS/MapServer/WFSServer"> <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc"> <ogc:And> <ogc:PropertyIsEqualTo> <ogc:PropertyName>provincia</ogc:PropertyName> <ogc:Literal>32</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>municipio</ogc:PropertyName> <ogc:Literal>039</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>poligono</ogc:PropertyName> <ogc:Literal>004</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>parcela</ogc:PropertyName> <ogc:Literal>00059</ogc:Literal> </ogc:PropertyIsEqualTo> <ogc:PropertyIsEqualTo> <ogc:PropertyName>zona</ogc:PropertyName> <ogc:Literal>1</ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:And> </ogc:Filter> </wfs:Query> </wfs:GetFeature>
== cURL sentence ==
curl -i -XPOST "http://idegintranet.xunta.es/arcgis/services/Viticola/Viticola_SIXPAC14_WFS/MapServer/WFSServer" -d @request.txt -H "Content-Type: application/xml"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment