[geos-devel] GEOS and Mapserver

Frank Warmerdam warmerdam at POBOX.COM
Thu Oct 7 10:41:02 PDT 2004


Godwin, Elizabeth wrote:
> What I'd like to be able to do though, is take a feature from WMS
> getFeatureInfo or WFS and be able to buffer that.  As a test of this, I
> took the GML from a getFeatureInfo request and parsed it manually to be
> a WKT string.  Then used PostGIS to run the buffer.  Apart from slight
> precision differences, it appeared to be close to what PostGIS would
> have done with it's own feature (the WMS request was done against the
> same feature through MapServer).
>
> Now that I confirmed this is all possible, what I am missing is that I'd
> like to be able to
> a.. do the conversion from GML to WKT with some script/library
> b.. do this with a GML stream
> c.. ultimately do this without PostGIS database dependancy.
>
> I figure that GEOS can do the geometry format conversions, is this right?
> Has anyone written a library for linux/windows that will let me talk to
> it with PHP?
>
> I'm prodding these lists in hopes of finding out what else is going on
> out there in this area. It would be fabulous if this was all built into
> Mapserver, but from what I can tell, it's just a thought right now.

Liz,

Steve Lime is doing some work to add GEOS support within MapServer itself.
I'm not clear on exactly what he plans or how he will expose it for use.
Hopefully he will respond as well.

The OGR library has also recently added support for a variety of GEOS
operations.  Currently these are exposed to the OGR Python bindings, but
not to the OGR PHP bindings which are not really being actively maintained.

OGR can also consume GML files and return them as OGR features on which
you can invoke GEOS operations.  I will however note that the OGR GML support
is a bit flakey.  It might be fine if you are working against well known
WFS or WMS servers with well behaved GML.

The GML handling in OGR includes support for whole GML files as a layer of
features as well as low level support for turning a single GML geometry
definition into an OGR geometry object.

If you are interested in having the OGR PHP bindings extended to support
the GEOS operations, we could talk about that.  It is possible that DM
Solutions would be willing to do the update (they wrote those bindings), or
I might even get past my current PHP phobia and do it myself.  Or better
yet, someone in your organization!

Another possibility would be to switch some of your work to Python, but
I know that mixed scripting environments can be quite a mess.

One final note, I understand the there is work going on for an AsGML()
operator for PostGIS.  I am not sure if they are planning a corresponding
operator to read in a GML geometry and convert it to PostGIS format.  If
they did that, you could stay focused on doing the operations within PostGIS.

Best regards,
--
---------------------------------------+--------------------------------------
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-users mailing list