Description
Hello there! 👋
An issue I have faced using ows4R is that CQL/OGC (or viewParams via vendor params) filters fail if you try to perform a spatial query with a very detailed feature. See lifewatch/eurobis#16
This is because URLs have a limit in the number of characters they can have in GET requests. Hence a possible solution is to allow POST and pass polygons there.
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
xmlquery.xml
. Contains the name of the layer (MarineRegions:eez), the name of the geometry column (the_geom), the instructions to intersect and the polygon to intersect with as gml<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
From EMODnet/emodnet.wfs#115 (comment)
Is this something feasible? Is there another approach we are overlooking?
Thanks!