[geos-devel] createEmptyGeometry()
createsinstance ofGeometryCollection
Martin Davis
mbdavis at VividSolutions.com
Fri Mar 31 12:00:10 EST 2006
Well, geometrically I agree with you, but practically speaking I suspect it simplifies calling code if you return an expected type (where such a type exists).
This also allows you to have nice invariants such as "buffer always returns a Polygonal geometry".
Remember: floating point <> real numbers, and Geometry <> geometry
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
> strk at refractions.net
> Sent: March 30, 2006 11:59 PM
> To: GEOS Development List
> Subject: Re: [geos-devel] createEmptyGeometry()
> createsinstance ofGeometryCollection
>
>
> On Fri, Mar 31, 2006 at 12:04:39AM +0200, Mateusz £oskot wrote:
> > Martin Davis wrote:
> > > 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.
> >
> > OK, I understant it.
> >
> > > Anyway, what else could that method return that would make sense
> > > (given that it has no type information)?
> >
> > It depends on the idea behind "empty geometry" or "null
> geometry" [1].
> > As I know, OGC Simple Feature Spec. explains that empty geometry
> > represents empty point set (empty set of coordinates).
> According to my
> > understanding: Point is empty if it contains "uninitialized"
> > coordinates MultiPoint is empty if it contains no points in its set.
> > etc.
> >
> > There is also a distinction between empty and null.
> > NULL means something undefined, uninitialized - something unsafe.
> > EMPTY means something well constructor but with empty set
> of points.
> > In some case, NULL object can be compared to EMPTY object with true
> > result.
>
> But what's defined in an EMPTY set of points ?
> It's the points themself giving semantic of a geometry type.
> What distinguish an EMPTY point from an EMPTY line from an
> EMPTY collection ? It's the exactly same topological space:
> the NO space at all. How can you say that NOTHING is a point
> or a line or an area ?
>
> --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