[geos-devel] Is empty LinearRing closed?

Mateusz Łoskot mateusz at loskot.net
Fri Mar 31 03:03:07 EST 2006


strk at refractions.net wrote:
> On Thu, Mar 30, 2006 at 02:42:19PM -0800, Martin Davis wrote:
>> I'm not sure why strk is making this comment.  JTS/GEOS supports 
>> empty geometries of all types (as per the OGC SFS).
> 
> I'm a bit PostGIS oriented. There's no support for EMPTY whatever in
>  PostGIS except GEOMETRYCOLLECTION. As always I'd follow JTS, so if 
> the plan is to support any kind of empty geom we should drop the 
> ::createEmptyGeometry() and ensure no memory violation is triggered 
> by EMPTY types *and* results are semantically correct.

Hi,

Another idea, possible and simple way to handle empty geometries would
be to add a boolean flag to the Geometry class - bool empty;

Then, if this flag is set, the geometry is empty.

Drawback:
This approach requires to keep this flag synchronized with state of
geometry to avoid situation when geometry is a non-empty set of points
but the empty flag is set to true ;-)

Cheers
-- 
Mateusz Łoskot
http://mateusz.loskot.net



More information about the geos-devel mailing list