[geos-devel] GEOS Questions
David Blasby
dblasby at refractions.net
Mon Jun 14 15:12:40 EDT 2004
Frank Warmerdam wrote:
> 1) Are there some sample applications I am missing demonstrating use of
> geos?
There aren't many sample applications, but GEOS is very much like JTS.
If you look at JTS code, you should see how to use GEOS.
There are a few simple programs in the GEOS archive, and you can look at
postgis.
I dont think there is a WKB reader for it. If you're interested in
learning how to do GEOS programming, this is an excellent mini-project!
Look at the GeometryFactory class. There's examples of how to use it in
the PostGIS code (NOTE: the postgis code was written before the
GeometryFactory class was in it current state, so its a bit messy).
You'll be making lists of coordinates, then throwing them at
constructors inside the GeometryFactory. There's nothing magic here, so
once you've done one geometry type, the rest should be easy.
> 2) Is there a well known binary reader and writer analygous to the
> WKTReader
> and WKTWriter already incorporated?
see above
> 3) Does geos support 2.5D geometries?
Yes and No. You can use the "standard" coordinate type (x,y,z), but
most calculations are done in (x,y). Most of the time, this does what
you want. However, when GEOS has to construct new Coordinates, it
doesnt really know what to put in for the Z value. I believe you can
somehow attach a heiristic to these functions so it can put in a Z value.
This is a bit of deep mojo, but Martin has put the ability in.
You can also use user-defined coordinates - so you can have
(x,y,m,z,z',z'',g) coordinates if you want.
> 4) How do I do the wrapping of my own geometry classes with GEOS Geometry
> objects?
I'm not sure if you really want to wrap your classes directly. You can
build coordinate sequence that are "backed" by your (non-GEOS) geometry
to save memory.
> 5) Has there been any thought to providing Python or other SWIG based
> scripting
> languages access to GEOS? Would you be interested in my doing so?
This certainly is possible, and I think it would be rather straight
forward to do.
dave
More information about the geos-devel
mailing list