<br><font size=2 face="sans-serif">Hi Steve (and others)</font>
<br>
<br><font size=2 face="sans-serif">Finally I got GeoJSON output from MapServer.
I have used the newest ms4w. The point is - I have already tried with this
one, but probably didn't use FORMATOPTION or something like this. Now it
works correctly.</font>
<br>
<br><font size=2 face="sans-serif">A note - I had to use backslash notation
for template FILE (on Windows of course)</font>
<br>
<br><font size=2 face="sans-serif">That's it for now,</font>
<br>
<br><font size=2 face="sans-serif">Thanks very much</font>
<br>
<br><font size=2 face="sans-serif">regards, dejan</font>
<br>
<br><tt><font size=2>mapserver-users-bounces@lists.osgeo.org wrote on 06.07.2009
18:00:03:<br>
<br>
&gt; Two things:<br>
&gt; <br>
&gt; 1) TEMPLATE is a keyword and must be quoted at the moment, so use
<br>
&gt; DRIVER 'TEMPLATE'<br>
&gt; <br>
&gt; 2) The file to be used in the OUTPUTFORMAT is given like this:<br>
&gt; <br>
&gt; &nbsp; FORMATOPTION 'FILE=/some/template/file/...'<br>
&gt; <br>
&gt; 3) You're call to MapServer needs to be a query. For example:<br>
&gt; <br>
&gt; &nbsp; http://localhost/cgi-bin/mapserv.exe?<br>
&gt; map=/ms4w/apps/pmapper/pmapper-3.2.0/config/default/geojson_demo.<br>
&gt; map&amp;layer=countries&amp;mode=nquery&amp;qformat=geojson<br>
&gt; <br>
&gt; This call will use all the default EXTENT value in the mapfile to
<br>
&gt; query all eligible layers and run the<br>
&gt; results through the geojson driver.<br>
&gt; <br>
&gt; I'm doing this to produce javascript code that gets executed by an
<br>
&gt; Ext.JS component. Not purely<br>
&gt; GeoJSON but it works similarly.<br>
&gt; <br>
&gt; Steve<br>
&gt; <br>
&gt; &gt;&gt;&gt; On 7/2/2009 at 4:15 PM, in message<br>
&gt; &lt;OFA82DFB5F.67E53647-ONC12575E7.0073E271-C12575E7.0074CA4C@pula.hr&gt;,<br>
&gt; &lt;Dejan.Gambin@pula.hr&gt; wrote:<br>
&gt; &gt; Steve,<br>
&gt; &gt; <br>
&gt; &gt; Is there any GeoJSON example I can see? I must be missing something
<br>
&gt; &gt; trivial,<br>
&gt; &gt; <br>
&gt; &gt; When I put:<br>
&gt; &gt; <br>
&gt; &gt; OUTPUTFORMAT<br>
&gt; &gt; &nbsp; NAME 'geojson'<br>
&gt; &gt; &nbsp; DRIVER TEMPLATE<br>
&gt; &gt; &nbsp; MIMETYPE 'application/json; subtype=geojson'<br>
&gt; &gt; &nbsp; TEMPLATE 'myTemplate.js'<br>
&gt; &gt; END<br>
&gt; &gt; <br>
&gt; &gt; in my.map file and call for example <br>
&gt; &gt; &quot;http://localhost/cgi-bin/mapserv.exe?<br>
&gt; map=/ms4w/apps/pmapper/pmapper-3.2.0/con <br>
&gt; &gt; fig/default/geojson_demo.map&amp;layer=countries&quot; <br>
&gt; &gt; (this works correctly without geojson part), I get: getString():
Symbol <br>
&gt; &gt; definition error. Parsing error near (TEMPLATE):(line 74) <br>
&gt; &gt; <br>
&gt; &gt; If I put DRIVER 'TEMPLATE' then I get: loadOutputFormat(): Unknown
<br>
&gt; &gt; identifier. Parsing error near (TEMPLATE):(line 76) <br>
&gt; &gt; <br>
&gt; &gt; Finally, putting FORMATOPTION 'FILE=myTemplate.js' instead of
TEMPLATE <br>
&gt; &gt; gives me: loadOutputFormat(): General error message. OUTPUTFORMAT
clause <br>
&gt; &gt; references driver TEMPLATE, but this driver isn't configured.
<br>
&gt; &gt; <br>
&gt; &gt; So, I am obviously doing something wrong regardless the myTemplate.js
<br>
&gt; &gt; file? (anyway, can you give me an example .js file, anything
that could <br>
&gt; &gt; help :-)<br>
&gt; &gt; <br>
&gt; &gt; regards, dejan<br>
&gt; &gt; &quot;Steve Lime&quot; &lt;Steve.Lime@dnr.state.mn.us&gt; wrote
on 02.07.2009 15:35:28:<br>
&gt; &gt; <br>
&gt; &gt;&gt; What does myTemplate.js look like?<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; &gt;&gt;&gt; &lt;Dejan.Gambin@pula.hr&gt; 07/02/09 5:33 AM
&gt;&gt;&gt;<br>
&gt; &gt;&gt; Thanks Fabio,<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; As I said in my last post, I can't get GeoJSON output using
this <br>
&gt; &gt;&gt; outputformat:<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; OUTPUTFORMAT<br>
&gt; &gt;&gt; &nbsp; NAME 'geojson'<br>
&gt; &gt;&gt; &nbsp; DRIVER 'TEMPLATE'<br>
&gt; &gt;&gt; &nbsp; MIMETYPE 'application/json; subtype=geojson'<br>
&gt; &gt;&gt; &nbsp; FORMATOPTION 'FILE=myTemplate.js'<br>
&gt; &gt;&gt; END<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; :-(<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; regards, dejan<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; Fabio D'Ovidio &lt;fabiodovidio@gmail.com&gt; wrote on 02.07.2009
09:28:06:<br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; &gt; Hi,<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; Dejan.Gambin@pula.hr ha scritto:<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt; Fabio,<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt; Glad to here you are here too :-)<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt; I can certainly use both GeoServer and MapServer
but this is not <br>
&gt; &gt;&gt; &gt; &gt; something I would like at the end. Since I am still
investigating <br>
&gt; &gt; all <br>
&gt; &gt;&gt; &gt; &gt; this, I am not in such a hurry to get it working
with my data ASAP. <br>
&gt; &gt;&gt; &gt; &gt; So, I would rather go with one of your Mapserver
solutions.<br>
&gt; &gt;&gt; &gt; It is not so difficult...just 2, 3 minutes to load your
layer in <br>
&gt; &gt;&gt; &gt; GeoServer ;-)<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt; My first question, to be sure - so MapOl reads/gets
the GeoJSON data <br>
&gt; &gt; <br>
&gt; &gt;&gt; &gt; &gt; from Geoserver WFS and outputs GeoJSON data to
WebClient? If I <br>
&gt; &gt;&gt; &gt; &gt; understand Steve correctly, there is no way currently
to get GeoJSON <br>
&gt; &gt; <br>
&gt; &gt;&gt; &gt; &gt; output from MapServer WFS, only with CGI? So we
come to your <br>
&gt; &gt; solution <br>
&gt; &gt;&gt; 2.<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; If you want to use the second solution you must create
the HTTP string <br>
&gt; &gt; <br>
&gt; &gt;&gt; &gt; to get GeoJSON from CGI-MapServer and than you must
change MapOl <br>
&gt; &gt; request <br>
&gt; &gt;&gt; <br>
&gt; &gt;&gt; &gt; to receive data and read them.<br>
&gt; &gt;&gt; &gt; If you want send me the URL and I'll send you the new
MapOl as soon as <br>
&gt; &gt; <br>
&gt; &gt;&gt; &gt; possbile!<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; -- <br>
&gt; &gt;&gt; &gt; Fabio D'Ovidio<br>
&gt; &gt;&gt; &gt; Geospatial solutions<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; &gt; Inova S.r.l.<br>
&gt; &gt;&gt; &gt; Web : http://www.inovaos.it <br>
&gt; &gt;&gt; &gt; GeoBI Blog: www.geobi.org <br>
&gt; &gt;&gt; &gt; Tel.: 081 197 57 600<br>
&gt; &gt;&gt; &gt; mail: fabiodovidio@gmail.com, f.dovidio@inovaos.it <br>
&gt; &gt;&gt; &gt; skype: dovidio_fa<br>
&gt; &gt;&gt; &gt; <br>
&gt; &gt;&gt; <br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; mapserver-users mailing list<br>
&gt; mapserver-users@lists.osgeo.org<br>
&gt; http://lists.osgeo.org/mailman/listinfo/mapserver-users<br>
</font></tt>