Skip to content
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

[WFS/WCS] Add support POST requests #100

Open
salvafern opened this issue Feb 1, 2023 · 3 comments
Open

[WFS/WCS] Add support POST requests #100

salvafern opened this issue Feb 1, 2023 · 3 comments

Comments

@salvafern
Copy link

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!

@eblondel
Copy link
Owner

eblondel commented Feb 1, 2023

@salvafern yes POST would be the right approach but POST is not supported yet for WxS in ows4R. It is for CSW.

@salvafern
Copy link
Author

I understand this is not trivial and would require some work. For now I just wanted to raise the issue to document. Thanks @eblondel !

@eblondel
Copy link
Owner

eblondel commented Feb 1, 2023

yes indeed it requires some work. ows4R POST request encoding is done generically. There is need to test / apply this other services than CSW. If I find some time, I'll give it a try for some basic WFS requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants