<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.E-MailFormatvorlage18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hey List,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>MAP<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> …<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>PROJECTION<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span lang=EN-US>"init=epsg:4314"<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>END<o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>EXTENT 5.83333301544189 47.2000007629395 23.0000019073486 56<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US>…<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US># OUTPUTFORMAT<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US># NAME "geojson"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US># DRIVER "OGR/GEOJSON"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US># MIMETYPE "application/json; subtype=geojson"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US># FORMATOPTION "STORAGE=stream"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US># FORMATOPTION "FORM=SIMPLE"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US># END<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>OUTPUTFORMAT<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> NAME "geojson"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> DRIVER "TEMPLATE"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'> FORMATOPTION "FILE<span style='color:black'>=/home/test</span>/messtischblatt.js"<o:p></o:p></p><p class=MsoNormal style='margin-left:35.4pt'> <span lang=EN-US>MIMETYPE "application/json; subtype=geojson"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>END<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>WEB<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> METADATA<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> "wfs_srs" "epsg:900913 epsg:4314 EPSG:3857 EPSG:4326 EPSG:3978"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> "wfs_getfeature_formatlist" "geojson"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US> END<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US>END # WEB<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> # geojson layer<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> LAYER<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> TEMPLATE "messtischblatt.js"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> STATUS ON<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> NAME "test"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> TYPE POLYGON<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> EXTENT 649304.652862922 6090078.57976033 2559975.30438738 7538210.86255982<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> DATA "boundingbox from (SELECT * FROM layer ORDER BY titel, time) as foo using unique id using srid=900913"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> CONNECTIONTYPE postgis<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> CONNECTION "dbname=*** user=*** password=*** host=*** "<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> #DATA "messtischblatt"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> #CONNECTIONTYPE OGR<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> #CONNECTION "PG: dbname=*** user=*** password=*** host=***"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US> PROJECTION<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "init=epsg:900913"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> END<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> METADATA<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "wfs_title" "Test WFS"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "wfs_srs" "EPSG:4326 EPSG:4314 EPSG:900913 "<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "wfs_enable_request" "*"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> "wfs_getfeature_formatlist" "geojson"<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> END<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> END<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>END # MAP# Tile Index<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>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:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>[resultset layer=test]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> “type”: “FeatureCollection”,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> “features”: [<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> [feature trimlast=”,”]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> {<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> “type”: “Feature”,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> “id”: “[id]”,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> …<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> }<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> [/feature]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US> ]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>[/resultset]<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I run my mapserver also with DEBUG level 5. I got the following log output:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>[Mon Jul 21 18:10:21 2014].528584 msFreeMap(): freeing map at 0x19447b0.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>[Mon Jul 21 18:10:22 2014].387718 CGI Request 1 on process 4362<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US>[Mon Jul 21 18:10:22 2014].521952 mapserv request processing time (msLoadMap not incl.): 0.134s<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>My test request is:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><a href="http://localhost/cgi-bin/mtbows?map=./test.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=test&MAXFEATURES=100&srsname=EPSG:900913&bbox=1518929.826549386,6766016.954331277,2693002.5808462612,7384239.639015725&outputformat=geojson">http://localhost/cgi-bin/mtbows?map=./test.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=getfeature&TYPENAME=test&MAXFEATURES=100&srsname=EPSG:900913&bbox=1518929.826549386,6766016.954331277,2693002.5808462612,7384239.639015725&outputformat=geojson</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Could somebody give me an advice?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Kind regards, <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>JM<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>