[postgis-devel] Re: NULL geometries

David Blasby dblasby at refractions.net
Mon Jun 7 10:15:19 PDT 2004


I'm not sure why people are having problems (crashes) with geometries 
like 'POINT()' - there are tests in the regression files that test 
inputs like this.  I didnt have any crashes.

This is probably a problem with people's FLEX/BISON.  Thats why I put 
the actual output file in CVS so everyone would have a common source in 
stead of relying on everyones different version of flex/bison to work.



Its a bit ambigeous if the SFSQL spec supports things like "POINT()" or 
"POINT(EMPTY)":

2.1.3 Point
A Point is a 0-dimensional geometry and represents a single location in 
coordinate space. A Point has a xcoordinate
value and a y-coordinate value.
The boundary of a Point is the empty set.
2.1.3.1 Methods
X( ):Double —The x-coordinate value for this Point.
Y( ):Double —The y-coordinate value for this Point.



PostGIS supports empty geometries like:

lwgeom_reg=# select 'GEOMETRYCOLLECTION(EMPTY)'::geometry;
              geometry
-----------------------------------
  SRID=-1;GEOMETRYCOLLECTION(EMPTY)
(1 row)

lwgeom_reg=# select 'MULTIPOINT(EMPTY)'::geometry;
          geometry
---------------------------
  SRID=-1;MULTIPOINT(EMPTY)
(1 row)

PostGIS does NOT support geometries "POINT(EMPTY)" - only 
GEOMETRYCOLLECTION and MULTI* geometries.  The actual representation is, 
say, a MULTIPOINT with 0 geometries in it.

Currently, LWGEOM isnt supporting this - its should be simple addition 
to handle it.

Things like "POINT(EMPTY)" maybe valid WKT, but I dont think they are 
actually valid geometries.  NOTE: there is no WKB representation for 
"POINT(EMPTY)".

dave









More information about the postgis-devel mailing list