[postgis-users] integrated EMPTY GeometryCollections to postgis (in CVS)

David Blasby dblasby at refractions.net
Fri Aug 8 09:17:08 PDT 2003


> I hadn't heard of this before.  Where would I find this documented?  (which
> simple features spec)  Is there anything special about empty WKB 
> collections?
> 
> I would like to incorporate proper support for this in OGR.

This isnt a very big change.

Before postgis didnt allow for empty geometries.  This was mostly just 
because they're hard to index because they dont have a bounding box!

I've fixed this, but I had to change some functions to be aware of these 
empty geometries.  All the in/out functions (WKT->postgis geometry, 
postgis geometry->WKT, WKB->postgis, postgis->WKB, postgis->geos, 
geos->postgis) had to be changed, plus several support functions.

You'll see reference to empty geometries in the OGC SF SQL spec.  Also 
the multi* and geometrycollection description say its a set of 0 or more 
geometrys.

The only thing we dont support are funny geometries like:

LINESTRING(EMPTY)   {use MULTILINESTRING(EMPTY) instead}
POINT(EMPTY)   {use MULTIPOINT(EMPTY) instead}
POLYGON((EMPTY))   {use MULTIPOLYGON(EMPTY) instead}

Postgis still doesnt support GEOMETRYCOLLECTIONS with other geometry 
collections (or multi*) in them.  They get converted like this:
GEOMETRYCOLLECTION( LINSTRING(0 0, 1 1), MULTIPOINT(0 0, 1 1))  -->
GEOMETRYCOLLECTION( LINSTRING(0 0, 1 1), POINT(0 0),POINT(1 1) )

dave
ps. did you see I changed WKB's 3d flag to 0x8000000?




More information about the postgis-users mailing list