[mapserver-dev] WFS RAW POST data
Alexandre Busquets
abusquets at gmail.com
Sat Jan 24 04:43:56 PST 2015
Hi,
I installed mapserver-6.2.2 and python mapscript in a Openshift gear (Red
Hat cloud).
But I can't work with WFS RAW POST data.
This is my configure line
./configure --prefix=$OPENSHIFT_DATA_DIR --with-proj=$OPENSHIFT_DATA_DIR \
--with-ogr=$OPENSHIFT_DATA_DIR/bin/gdal-config
--with-gdal=$OPENSHIFT_DATA_DIR/bin/gdal-config \
--with-postgis=/usr/bin/pg_config --with-wfs --with-gif=no
--with-fastcgi=no \
--enable-python-mapscript --with-wmsclient --with-wfsclient
Is there any mean to load the post data data?
I tried to set owsrequest.postdata manually but it not works.
This is my code
@app.route('/wxs', methods=['GET', 'POST'])
def wxs():
#Todo: falta posar el directori de cache
import mapscript
path_map = os.environ['OPENSHIFT_REPO_DIR'] + "maps/prova.map"
sld_url = request.url_root + '/sld/arbre.sld'
if not request.args and not request.data:
return 'no arguments'
ows_req = mapscript.OWSRequest()
if not request.args:
ows_req.setParameter('SLD', sld_url)
for v in request.args:
ows_req.setParameter(v, request.args[v])
if request.data and len(request.data)>0:
ows_req.postdata = request.data
map = mapscript.mapObj(path_map)
mapscript.msIO_installStdoutToBuffer()
map.OWSDispatch(ows_req)
content_type = mapscript.msIO_stripStdoutBufferContentType()
content = mapscript.msIO_getStdoutBufferBytes()
return Response(content, mimetype=content_type)
A sample of WFS RAW POST is:
<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
version="1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd
http://provagdal-sigte.rhcloud.com
http://provagdal-sigte.rhcloud.com/wxs?service=WFS&request=DescribeFeatureType&version=1.1.0&typeName=espaiverd"><wfs:Query
typeName="feature:espaiverd" srsName="EPSG:25831" xmlns:feature="
http://provagdal-sigte.rhcloud.com"/></wfs:GetFeature>
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20150124/712862fd/attachment.html>
More information about the mapserver-dev
mailing list