[geos-devel] Dimension of EMPTY geoms

strk at refractions.net strk at refractions.net
Thu Jan 4 19:45:38 EST 2007


On Mon, Dec 04, 2006 at 03:18:54PM +0100, Mateusz Loskot wrote:
> strk at refractions.net wrote:

> > 2) Should CAPI's GEOSCoordSeq_create() raise an error if requested to
> > create anything but a 3d geom ? (the only one supported)
> 
> I think that if it can detect unsupported request, then the fact
> should be reported with an error code.

I tried implementhing this by having CoordinateArraySequence throwing
an UnsupportedOperationException (the rest would be automatic).

Problem here is that the WKB parser really wants to create a 2d
coordinatesequence, not a 3d one, so we *need* to support 2 dimensions
somehow.

Another approach could be storing the dimensionality information in the
CoordinateSequence class. That would be completely logical and could
open the door for future use of a Coordinate2D class (a polymorphic
Coordinate is probably going to take performance even worst though).

--strk;



More information about the geos-devel mailing list