[geos-devel] Dimension and Coordinate Sequences

Frank Warmerdam warmerdam at pobox.com
Tue May 18 15:38:57 EDT 2010


Folks,

In followup on the dimension support front, I have made a quick pass
through the CoordinateArraySequence and related classes as well as WKTReader
so that I can preserve dimension in a GEOS geometry, at least to some extent.

Rather than ask for permission, I've just gone ahead and applied the changes.
We can always tweak as needed.  They are documented in:

     http://trac.osgeo.org/geos/ticket/345

I will note that the common idiom "CoordinateSequenceFactory->create(0,3)" to
create a 3D coordinate sequence no longer exactly works since I have added
dimension as an argument in the create() method that takes a coordinate vector.
This means that "0" can be interpreted as NULL or a count.  To disambiguate
I have had to cast the zero to size_t in the tests and a couple other places.
Hopefully this isn't going to cause other people heartache.

Future directions might include preserve dimension carefully through geometry
operations, and having the WKT and WKB Writer classes produce output based
on the dimension of the geometry.  I haven't checked WKBWriter, but WKTWriter
is (annoyingly) only supporting 3D output based on a build time choice, rather
than dynamically based on the input geometry.

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 geos-devel mailing list