-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using POST requests when passing large filters #115
Comments
Interesting! So should we just switch to POST when passing any filter? |
Ideally yes! I have done this before via curl but haven't had the time to try in R |
is this actually a ows4r feature request or do you have an example? From what I see in https://github.com/eblondel/ows4R/blob/632928a100b69e1ca60f10975c38d3325016d97b/R/WFSGetFeature.R#L21, I'm not sure where one would pass "POST". |
@salvafern friendly reminder about the question above 😸 |
Yes sorry. Most likely it would be a new feature for Example with curl: Get all features that intersect with a certain polygon. I will use the EEZ layer of MarineRegions. Create a post request as XML and name as <wfs:GetFeature xmlns:wfs='http://www.opengis.net/wfs' xmlns:ogc='http://www.opengis.net/ogc' xmlns:gml='http://www.opengis.net/gml' service='WFS' version='1.0.0'>
<Query typeName='MarineRegions:eez'>
<ogc:Filter xmlns:gml="http://www.opengis.net/gml">
<Overlaps>
<PropertyName>the_geom</PropertyName>
<gml:Polygon srsName="http://www.opengis.net/gml/srs/epsg.xml#63266405">
<gml:outerBoundaryIs>
<gml:LinearRing>
<gml:coordinates>-0.258498799963897,58.4594990974729 2.76925390761733,58.4594990974729 2.76925390761733,53.7259702166065 -0.258498799963897,58.4594990974729</gml:coordinates>
</gml:LinearRing>
</gml:outerBoundaryIs>
</gml:Polygon>
</Overlaps>
</ogc:Filter>
</Query>
</wfs:GetFeature> Perform POST request with curl: curl -XPOST -d @wfsquery.xml -H "Content-type: application/xml" "http://geo.vliz.be/geoserver/MarineRegions/ows?" --output test.geojson But OGC filter are very verbose, not sure if this is something that will be solved quickly/easily. Some resources: |
@salvafern thank you! Would you mind opening a ows4r feature request then? |
@maelle Done! :) |
I have noticed when using
ows4R
that, when you pass a large filter (e.g. a complex WKT polygon), the request may fail because of the GET limitations. We could look into passing large filters via POST requests.The text was updated successfully, but these errors were encountered: