[geos-devel] CoordSeq ADT and fine-grained ctors for C-API (was: GEOS C API Suggestions)

strk at refractions.net strk at refractions.net
Fri Oct 21 10:57:36 EDT 2005

About performance and isolation, do we really want
all the copies to happen ?

Consider a multipolygon construction, you'll have copies:
	- of CoordSeq objects of the shell and each hole
	  at each of the corresponding object construction/copy
	- of shell and hole geometry for each polygon 
	- of each polygon geometry at collection construction
In practice it would take 3 copies of each involved CoordinateSequence.

I'm thinking about making constructors take ownership of argument,
and extractors (GetGeometryN, getExteriorRing, getCoordSeq..) return
resources owned by the argument object...

These changes would also allow changing any Ordinate value
of any Geometry ...

	GEOSGeom g1 = GEOSGetGeometryN(g, 2);
	GEOSGeom hole3 = GEOSGetInteriorRingN(g1, 3);
	GEOSCoordSeq s = GEOSGetCoordSeq(hole3);
	GEOSCoordSeq_setX(s, 4);

What do you think, is the advantage worth the danger ?


On Fri, Oct 21, 2005 at 02:16:18PM +0200, strk at refractions.net wrote:
> I've committed support for GEOSCoordSeq abstract data type,
> fine-grained construction and inspection.
> The geostest binary contains testing for it (deconsctruction
> and re-construction of input geometry).
> All extractors and constructors perform object copies.
> The GEOSmakeCollection function has been renamed to
> GEOSGeom_createCollection (to conform with other constructors).
> See geos_c.h for new function signatures.
> Comments welcome.
> --strk;
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel

More information about the geos-devel mailing list