[gdal-dev] ogr2ogr and wfs driver with POST requests

umbertofilippo umbertofilippo at tiscali.it
Wed Dec 26 08:56:48 PST 2018


Is it possible to use the WFS driver of ogr2ogr with POST reuqests?

I am actually creating my Getfeature requests with OpenLayers using the
function  ol/format/WFS~WFS/writeGetFeature
<https://openlayers.org/en/latest/apidoc/module-ol_format_WFS-WFS.html#writeGetFeature> 
.

This returns the Node of my getFeature request, but I don't know if I can
use it along with ogr2ogr.

So far I've tested ogr2ogr successfully with GET requests but I would need
to use it with POST possibly.

In my code I usually to use the resulting Node from writeGetFeature to fetch
my WFS url with POST method and the result in the body parameter (with
JavaScript):

var featureRequest = new WFS().writeGetFeature({
    featureNS: 'http://www.qgis.org/gml',
    featureTypes: [typename],
    filter: filter,
});

// then post the request and add the received features to a layer
var response = await fetch(url, {
    method: 'POST',
    body: new XMLSerializer().serializeToString(featureRequest),
});



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list