[mapserver-dev] WFS Output via OGR
Lime, Steve D (DNR)
Steve.Lime at state.mn.us
Mon Oct 4 14:18:04 EDT 2010
I've been using the templating stuff a lot, works great although I'm not using WFS, rather straight
MapServer queries. My rec. compass app supports multiple query formats via templates (KML, HTML
and GeoJSON) using that mechanism. It's kinda hard to show though.
I think ideally we'd have a single presentation function for query results that would direct things
to the right driver. At the moment msReturnTemplateQuery() serves that purpose. WFS, for example,
would use the GML3 WFS writer by default and if something else is requested it would call msReturnTemplateQuery().
The name of that function is mis-leading at this point. I had planned on integrating GML into that function. I
paused because the GML3 writer is very WFS specific and I was too lazy to write a generic version. I could do
so with GML2 if that would make things clearer.
I think if you wrote a msOGRReturnQuery() or something like that which stepped through a result
set much the way the GML writers do (and msDrawQueryMap() does) then that would the critical
piece. If the output format driver is OGR then msReturnTemplateQuery() would just write the write mime-type
and hand the rest off to your writer...
From: Frank Warmerdam [warmerdam at pobox.com]
Sent: Monday, October 04, 2010 11:30 AM
To: Lime, Steve D (DNR)
Subject: Re: [mapserver-dev] WFS Output via OGR
Lime, Steve D (DNR) wrote:
> Apparently the exposure of templates via WFS is still planned for 6.0, see:
> The function int msReturnTemplateQuery() in maptemplate.c is a more general
> presentation function for query results. It already handles templates (old
> and new) plus non-text formats (e.g. png). I would think it could call an
> OGR query result writer easily too.
I've looked through RFC36, #3172 and the "trunk" documentation but I'm still
pretty confused about what is implemented and exactly how to use it. I
was unable to find any examples in msautotest of using the new templating
mechanism. Can you point me to some working examples of it?
Tentatively I'm willing to take on integration of the new templating
mechanism into the WFS GetFeature() implementation while I work on the
OGR output. Hopefully I can integrate the OGR output directly in
msReturnTemplateQuery(), though I'm not completely convinced yet how
practical that is.
Also, I get the idea from RFC 36 that there was expected to be a "GML driver"
in addition to the template driver. That does not seem to have occured
though of course most of the GML generation logic is already in mapgml.c.
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the mapserver-dev