[geos-devel] createEmptyGeometry() creates instance ofGeometryCollection

Martin Davis mbdavis at VividSolutions.com
Thu Mar 30 11:54:55 EST 2006


Yes.  The spec doesn't cover this, but I chose to use an empty GeometryCollection as a "typeless" empty geometry, for methods which need to return one.  The createEmptyGeometry method is just a convenience method for this convention.

Anyway, what else could that method return that would make sense (given that it has no type information)?

Martin Davis, Senior Technical Architect
Vivid Solutions Inc.      www.vividsolutions.com
Suite #1A-2328 Government Street Victoria, B.C. V8T 5G5
Phone: (250) 385 6040 - Local 308 Fax: (250) 385 6046


> -----Original Message-----
> From: geos-devel-bounces at geos.refractions.net 
> [mailto:geos-devel-bounces at geos.refractions.net] On Behalf Of 
> Mateusz Loskot
> Sent: March 30, 2006 2:51 AM
> To: GEOS Development List
> Subject: [geos-devel] createEmptyGeometry() creates instance 
> ofGeometryCollection
> 
> 
> Hi,
> 
> Simple question, is this intentional to return empty 
> GeometryCollection instance from createEmptyGeometry() 
> function? Currently, this function does the same as 
> createGeometryCollection().
> 
> GeometryCollection*
> GeometryFactory::createGeometryCollection() const
> {
>    return new GeometryCollection(NULL,this);
> }
> 
> Geometry*
> GeometryFactory::createEmptyGeometry() const
> {
>    return new GeometryCollection(NULL,this);
> }
> 
> Cheers
> -- 
> Mateusz Łoskot
> http://mateusz.loskot.net
> 
> _______________________________________________
> 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