[mapserver-users] GeoJSON output from MapServer

Dejan.Gambin at pula.hr Dejan.Gambin at pula.hr
Wed Jul 1 18:31:57 EDT 2009


Fabio, 

Glad to here you are here too :-)

I can certainly use both GeoServer and MapServer but this is not something 
I would like at the end. Since I am still investigating all this, I am not 
in such a hurry to get it working with my data ASAP. So, I would rather go 
with one of your Mapserver solutions.

My first question, to be sure - so MapOl reads/gets the GeoJSON data from 
Geoserver WFS and outputs GeoJSON data to WebClient? If I understand Steve 
correctly, there is no way currently to get GeoJSON output from MapServer 
WFS, only with CGI? So we come to your solution 2.

I have tried getting GeoJSON outuput from MapServer using CGI, but I 
didn't succeed. There is little written about this. I have tried setting 
something like:

OUTPUTFORMAT
  NAME 'geojson'
  DRIVER 'TEMPLATE'
  MIMETYPE 'application/json; subtype=geojson'
  FORMATOPTION 'FILE=myTemplate.js'
END

but I got errors (using the newest MS4W beta with MapServer 5.4.1)?

Regarding my geometries - I am planning to analyze some cadastral data 
(that's why I was so interested in your "italian" example). This will be 
points and polygons mostly. We have our cadastral data vectorized but 
still in dwg/multyline. We can identfy parcels as points with parcel IDs, 
but in near future we'll make polygons for all of them.

regards, dejan

mapserver-users-bounces at lists.osgeo.org wrote on 01.07.2009 23:39:19:

> Hello,
> sorry ...but i read also this mailing list :-)
> 
> Well,  our project wants to be indipendent from web application used
> to transfer GeoJson because GeoBI is compliant to the OGC standards 
> such as WFS, WMS, SLD, etc...
> 
> Now, about this first implementation of GeoReport we used GeoServer 
> because it gives the possibilitiy to use in append to the WFS HTTP 
> request "outputformat=geojson" instead of GML.
> 
> Anyway MapOl makes a WFS request and reads the output by using 
> mapfish-geojson-lib...so there are 3 ways to use MapServer to do the 
same:
> 1. use a GeoJSON template for WFS output
> 2. use a GeoJSON template for mapserver CGI output
> 3. GeoReport must do the conversion from WFS-GML to GeoJSON
> At the moment we have choosen GeoServer but this is not exclusive 
> respect other WFS service implementations! 
> Anyway I think you can use at the moment both MapServer and 
> GeoServer: you must serve with GeoServer only the LAYER on which you
> want to do BI analysis (so...one, two layers...not all cartographic 
> levels)...while you can display your layers by using MapFish Client 
> and OpenLayers as WMS, WFS or MapServer Layers!
> 
> PS:  what kind of geometries you want to analyze (by using GeoJSON)?
> POINTS, POLYGONS....MULTIGEOMETRIES?
> 
> Thank you very much!
> 
> Fabio D'Ovidio

> 2009/7/1 <Dejan.Gambin at pula.hr>
> 
> Steve, 
> 
> Here are more details, I am sure you'll have some further suggestions: 
> 
> There is a project called GeoReport, part of GeoBI suite, that 
> integrates the data coming from Business Intelligence processes 
> (Pentaho BI) with their cartographic representation. Since I am 
> pretty much involved in both areas (WebGIS, BI), this seems very 
> interesting to me, although I first saw it yesterday :-( 
> 
> Here are the main informations about GeoReport: http://www.geobi.
> org/2009/01/georeport-module.html 
> 
> As I can see, basically, there is a MapOL module that runs BI 
> process in order to get resultset, join it with geometries coming 
> from GeoServer (WFS) and returns GeoJSON data to WebGIS client 
> (MapFish and OpenLayers + Geostat widgets) which displays it on the map. 

> 
> I have been in contact with Fabio (he is "responsible" for all 
> this). Based on what he said, I understood (maybe wrongly) that WFS 
> server needs to return GeoJSON, and GeoServer can do it. Now, as I 
> write this to you, it seems like MapOL is responsible for creating 
> GeoJSON data ?! 
> 
> Anyway, I am new to this almost as you and if you can take a look on
> above link, I would appreciate it very much. I "only" want to use 
> MapServer instead of GeoServer. If I can't do it, then I'll rather 
> do nothing as I have no intentions to use anything but MapServer :-) 
> 
> thanks very much 
> 
> regards, dejan 

> "Steve Lime" <Steve.Lime at dnr.state.mn.us> wrote on 01.07.2009 16:36:48:
> 
> 
> > Depends on how you need to access it. You certainly can create a 
> > template that will output GeoJSON. However,
> > at the moment you can only access that output though calls to the 
> > CGI and (probably) MapScript. WMS and WFS
> > do not recognize the template output format although there are plans
> > to do so in the upcoming release.
> > 
> > Let me know if I can help further...
> > 
> > Steve
> > 
> > >>> On 7/1/2009 at 7:44 AM, in message
> > <OF425313EF.2215E677-ONC12575E6.004595DF-C12575E6.00460800 at pula.hr>,
> > <Dejan.Gambin at pula.hr> wrote:
> > > Hi,
> > > 
> > > Is it possible to use GeoJSON template for getting GeoJSON output 
from 
> > > MapServer? I have tried using outputformat as described in:
> > > 
> > > http://mapserver.org/development/rfc/ms-rfc-36.html and
> > > http://mapserver.org/development/rfc/ms-rfc-56.html 
> > > 
> > > Is it supported at all? I have a project where I need a GeoJSON 
output. 
> > > This project originally uses GeoServer whcih has a plugin for this. 
Is 
> > > this possible with MapServer? I am using MapServer 5.4.1
> > > 
> > > thanks very much
> > > 
> > > regards, dejan
> > 
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090702/eefaf126/attachment.html


More information about the mapserver-users mailing list