<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)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
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;}
p
{mso-style-priority:99;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.msochpdefault, li.msochpdefault, div.msochpdefault
{mso-style-name:msochpdefault;
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Times New Roman","serif";}
span.e-mailformatvorlage17
{mso-style-name:e-mailformatvorlage17;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.e-mailformatvorlage18
{mso-style-name:e-mailformatvorlage18;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.E-MailFormatvorlage21
{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 style='color:#1F497D'>Hi Jukka,<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>yes i tried this. But the behavior stays the same.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:#1F497D'>JM<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>Von:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Rahkonen Jukka (Tike) [mailto:jukka.rahkonen@mmmtike.fi] <br><b>Gesendet:</b> Dienstag, 22. Juli 2014 09:30<br><b>An:</b> Jacob Mendt; mapserver-users@lists.osgeo.org<br><b>Betreff:</b> Re: [mapserver-users] Problems with getting geojson running as WFS response<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>Hi,<br><br>Have you tried to request geojson with its MIMETYPE as &format=</span><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>application/json; subtype=geojson ?<br><br>-Jukka Rahkonen-</span><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'><o:p></o:p></span></p><div><div class=MsoNormal align=center style='text-align:center'><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'><hr size=2 width="100%" align=center></span></div><div id=divRpF729656><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:black'>Jacob Mendt wrote:</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif";color:black'><o:p></o:p></span></p></div><div><div><p class=MsoNormal><span lang=EN-US style='color:black'>> Hey List,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>> 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:</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>MAP</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> …</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US style='color:black'>PROJECTION</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt;text-indent:35.4pt'><span lang=EN-US style='color:black'>"init=epsg:4314"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US style='color:black'>END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US style='color:black'>EXTENT 5.83333301544189 47.2000007629395 23.0000019073486 56</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='text-indent:35.4pt'><span lang=EN-US style='color:black'>…</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'># OUTPUTFORMAT</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'># NAME "geojson"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'># DRIVER "OGR/GEOJSON"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'># MIMETYPE "application/json; subtype=geojson"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'># FORMATOPTION "STORAGE=stream"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'># FORMATOPTION "FORM=SIMPLE"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'># END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'>OUTPUTFORMAT</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> NAME "geojson"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> DRIVER "TEMPLATE"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span style='color:black'> FORMATOPTION "FILE=/home/test/messtischblatt.js"<o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span style='color:black'> </span><span lang=EN-US style='color:black'>MIMETYPE "application/json; subtype=geojson"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'>END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'>WEB</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> METADATA</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> "wfs_srs" "epsg:900913 epsg:4314 EPSG:3857 EPSG:4326 EPSG:3978"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> "wfs_getfeature_formatlist" "geojson"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'> END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal style='margin-left:35.4pt'><span lang=EN-US style='color:black'>END # WEB</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> # geojson layer</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> LAYER</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> TEMPLATE "messtischblatt.js"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> STATUS ON</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> NAME "test"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> TYPE POLYGON</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> EXTENT 649304.652862922 6090078.57976033 2559975.30438738 7538210.86255982</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> DATA "boundingbox from (SELECT * FROM layer ORDER BY titel, time) as foo using unique id using srid=900913"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> CONNECTIONTYPE postgis</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> CONNECTION "dbname=*** user=*** password=*** host=*** "</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> #DATA "messtischblatt"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> #CONNECTIONTYPE OGR</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> #CONNECTION "PG: dbname=*** user=*** password=*** host=***"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> PROJECTION</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> "init=epsg:900913"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> METADATA</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> "wfs_title" "Test WFS"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> "wfs_srs" "EPSG:4326 EPSG:4314 EPSG:900913 "</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> "wfs_enable_request" "*"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> "wfs_getfeature_formatlist" "geojson"</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> END</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>END # MAP# Tile Index</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>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:</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>[resultset layer=test]</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>{</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> “type”: “FeatureCollection”,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> “features”: [</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> [feature trimlast=”,”]</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> {</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> “type”: “Feature”,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> “id”: “[id]”,</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> …</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> }</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> [/feature]</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> ]</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>}</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>[/resultset]</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>I run my mapserver also with DEBUG level 5. I got the following log output:</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>[Mon Jul 21 18:10:21 2014].528584 msFreeMap(): freeing map at 0x19447b0.</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>[Mon Jul 21 18:10:22 2014].387718 CGI Request 1 on process 4362</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>[Mon Jul 21 18:10:22 2014].521952 mapserv request processing time (msLoadMap not incl.): 0.134s</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>My test request is:</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'><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" target="_blank">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></span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>Could somebody give me an advice?</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>Kind regards, </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'>JM</span><span style='color:black'><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='color:black'> </span><span style='color:black'><o:p></o:p></span></p></div></div></div></div></div></body></html>