[mapserver-users] Problems with getting geojson running as WFS response
Jacob Mendt
jacobmendt at googlemail.com
Mon Jul 21 23:16:58 PDT 2014
Hey List,
i am right now trying to bring get my Mapserver (Version 6.0.0) WFS running
with GeoJSON. But I always get back an empty response. I tried several
approaches and my WFS runs with a GML response. So maybe somebody could give
me hint. Here is my mapfile:
MAP
.
PROJECTION
"init=epsg:4314"
END
EXTENT 5.83333301544189 47.2000007629395 23.0000019073486 56
.
# OUTPUTFORMAT
# NAME "geojson"
# DRIVER "OGR/GEOJSON"
# MIMETYPE "application/json; subtype=geojson"
# FORMATOPTION "STORAGE=stream"
# FORMATOPTION "FORM=SIMPLE"
# END
OUTPUTFORMAT
NAME "geojson"
DRIVER "TEMPLATE"
FORMATOPTION "FILE=/home/test/messtischblatt.js"
MIMETYPE "application/json; subtype=geojson"
END
WEB
METADATA
"wfs_srs" "epsg:900913 epsg:4314 EPSG:3857 EPSG:4326
EPSG:3978"
"wfs_getfeature_formatlist" "geojson"
END
END # WEB
# geojson layer
LAYER
TEMPLATE "messtischblatt.js"
STATUS ON
NAME "test"
TYPE POLYGON
EXTENT 649304.652862922 6090078.57976033 2559975.30438738
7538210.86255982
DATA "boundingbox from (SELECT * FROM layer ORDER BY titel, time) as foo
using unique id using srid=900913"
CONNECTIONTYPE postgis
CONNECTION "dbname=*** user=*** password=*** host=*** "
#DATA "messtischblatt"
#CONNECTIONTYPE OGR
#CONNECTION "PG: dbname=*** user=*** password=*** host=***"
PROJECTION
"init=epsg:900913"
END
METADATA
"wfs_title" "Test WFS"
"wfs_srs" "EPSG:4326 EPSG:4314 EPSG:900913 "
"wfs_enable_request" "*"
"wfs_getfeature_formatlist" "geojson"
END
END
END # MAP# Tile Index
I test it with a couple of approaches. It tried both Outputformats and both
ways of defining a postgis data source. But in any case I get back an empty
response. With the template approach I used the following template:
[resultset layer=test]
{
"type": "FeatureCollection",
"features": [
[feature trimlast=","]
{
"type": "Feature",
"id": "[id]",
.
}
[/feature]
]
}
[/resultset]
I run my mapserver also with DEBUG level 5. I got the following log output:
[Mon Jul 21 18:10:21 2014].528584 msFreeMap(): freeing map at 0x19447b0.
[Mon Jul 21 18:10:22 2014].387718 CGI Request 1 on process 4362
[Mon Jul 21 18:10:22 2014].521952 mapserv request processing time (msLoadMap
not incl.): 0.134s
My test request is:
http://localhost/cgi-bin/mtbows?map=./test.map
<http://localhost/cgi-bin/mtbows?map=./test.map&SERVICE=WFS&VERSION=1.0.0&RE
QUEST=getfeature&TYPENAME=test&MAXFEATURES=100&srsname=EPSG:900913&bbox=1518
929.826549386,6766016.954331277,2693002.5808462612,7384239.639015725&outputf
ormat=geojson>
&SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=test&MAXFEATURES=100&
srsname=EPSG:900913&bbox=1518929.826549386,6766016.954331277,2693002.5808462
612,7384239.639015725&outputformat=geojson
Could somebody give me an advice?
Kind regards,
JM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140722/9ab04043/attachment.htm>
More information about the MapServer-users
mailing list