postgis/lwgeom
Sandro Santilli 17f5c20570 Simplified clean rule
git-svn-id: http://svn.osgeo.org/postgis/trunk@1522 b70326c6-7e19-0410-871a-916f4a2858ee
2005-03-08 16:41:28 +00:00
..
.cvsignore Removed generated parser files. 2005-03-03 10:31:22 +00:00
BBOXCACHE_BEHAVIOURS Fixed GeometryFromText() to add a bbox cache FOR_COMPLEX_GEOMS 2005-02-23 09:58:16 +00:00
box2d.c Initial revision 2004-10-08 13:15:26 +00:00
compat.h Added a copy of GNU vsprintf.c file and compiled in. 2004-11-02 16:48:54 +00:00
lex.yy.c Added generated parsers to avoid FLEX/YACC requirement on release. 2005-03-03 10:29:46 +00:00
liblwgeom.c Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG 2005-02-07 13:21:10 +00:00
liblwgeom.h Renamed lwgeom_to_wkt to lwgeom_to_ewkt, as it doesn't strip out non-ogc 2005-03-01 13:22:50 +00:00
lwcollection.c Changed 'char' to 'uchar' (unsigned char typedef) wherever octet is actually 2005-02-10 10:52:53 +00:00
lwgeom.c Renamed lwgeom_to_wkt to lwgeom_to_ewkt, as it doesn't strip out non-ogc 2005-03-01 13:22:50 +00:00
lwgeom.h makeline_from_multipoint() implemented and exposed. 2004-10-15 16:21:33 +00:00
lwgeom_api.c PG_LWGEOM_construct() moved from lwgeom_api.c to lwgeom_pg.c. 2005-03-04 09:03:32 +00:00
lwgeom_box.c Big layout change. 2004-09-29 10:50:30 +00:00
lwgeom_box2dfloat4.c Dropped getbox2d_internal(). 2005-02-10 17:41:55 +00:00
lwgeom_box3d.c Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG 2005-02-07 13:21:10 +00:00
lwgeom_btree.c Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG 2005-02-07 13:21:10 +00:00
lwgeom_chip.c Changed 'char' to 'uchar' (unsigned char typedef) wherever octet is actually 2005-02-10 10:52:53 +00:00
lwgeom_debug.c Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG 2005-02-07 13:21:10 +00:00
lwgeom_dump.c Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG 2005-02-07 13:21:10 +00:00
lwgeom_estimate.c RESTRICT selectivity estimator use self->varno instead of varRelid. 2005-03-08 09:27:23 +00:00
lwgeom_functions_analytic.c SnapToGrid: Fixed minor bug in consistency check. 2005-02-25 13:42:38 +00:00
lwgeom_functions_basic.c Removed unused lwexploded_dump() function 2005-03-07 13:20:12 +00:00
lwgeom_geos.c Added missing JTSnoop prototype 2005-03-07 21:24:22 +00:00
lwgeom_geos_wrapper.cpp Syntaxes cleanups. 2005-02-17 15:54:01 +00:00
lwgeom_gist.c Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG 2005-02-07 13:21:10 +00:00
lwgeom_gml.c Dropped getbox2d_internal(). 2005-02-10 17:41:55 +00:00
lwgeom_inout.c Added missing prototype 2005-02-24 08:36:35 +00:00
lwgeom_jts.c Commented out debugging lines 2005-03-08 11:24:39 +00:00
lwgeom_jts_wrapper.cpp avoided initializzation of JvNewObjectArray with undefined pointer 2005-03-08 11:24:00 +00:00
lwgeom_nojts.c Separate stub funx file for builds w/out GEOS or JTS 2005-03-07 20:47:56 +00:00
lwgeom_ogc.c Fixed bug in StartPoint and EndPoint functions. 2005-02-24 08:32:08 +00:00
lwgeom_pg.c PG_LWGEOM_construct() moved from lwgeom_api.c to lwgeom_pg.c. 2005-03-04 09:03:32 +00:00
lwgeom_pg.h Added new indexable operators <<|, &<|, |&> and |>> to allow comparisons of bounding box positions in the Y axis 2005-01-11 14:20:41 +00:00
lwgeom_spheroid.c Cleaned up distance_sphere and updated documentation. 2005-03-04 19:31:36 +00:00
lwgeom_svg.c Dropped getbox2d_internal(). 2005-02-10 17:41:55 +00:00
lwgeom_transform.c Dropped getbox2d_internal(). 2005-02-10 17:41:55 +00:00
lwgeom_triggers.c Added cache_bbox trigger 2004-12-30 10:24:25 +00:00
lwgparse.c Changed byte to uchar to avoid clashes with win32 headers. 2005-02-21 16:16:14 +00:00
lwline.c Dropped getbox2d_internal(). 2005-02-10 17:41:55 +00:00
lwmline.c Changed 'char' to 'uchar' (unsigned char typedef) wherever octet is actually 2005-02-10 10:52:53 +00:00
lwmpoint.c Changed 'char' to 'uchar' (unsigned char typedef) wherever octet is actually 2005-02-10 10:52:53 +00:00
lwmpoly.c Changed 'char' to 'uchar' (unsigned char typedef) wherever octet is actually 2005-02-10 10:52:53 +00:00
lwpoint.c Dropped getbox2d_internal(). 2005-02-10 17:41:55 +00:00
lwpoly.c Changed 'char' to 'uchar' (unsigned char typedef) wherever octet is actually 2005-02-10 10:52:53 +00:00
lwpostgis.sql.in Cleaned up distance_sphere and updated documentation. 2005-03-04 19:31:36 +00:00
Makefile Simplified clean rule 2005-03-08 16:41:28 +00:00
measures.c Fixed some introduced misorderings of func declaration/body. 2005-02-17 15:39:17 +00:00
MISSING_OBJECTS updated 2004-11-11 09:42:26 +00:00
pgsql_compat.h Moved pgsql compatibility code into pgsql_compat.h 2005-01-07 11:50:49 +00:00
profile.h Debugging defines set to NODEBUG. 2004-09-27 08:26:03 +00:00
ptarray.c Dropped getbox2d_internal(). 2005-02-10 17:41:55 +00:00
README Added updated README file 2005-01-13 09:10:11 +00:00
stringBuffer.c header inclusion cleanup 2004-10-28 16:28:07 +00:00
stringBuffer.h Added a cstring(lwgeom) function that returns WKT! 2004-04-07 23:12:31 +00:00
test.c Renamed lwgeom_to_wkt to lwgeom_to_ewkt, as it doesn't strip out non-ogc 2005-03-01 13:22:50 +00:00
TODO updated 2005-01-18 10:09:21 +00:00
vsprintf.c Added a copy of GNU vsprintf.c file and compiled in. 2004-11-02 16:48:54 +00:00
wktparse.h Changed byte to uchar to avoid clashes with win32 headers. 2005-02-21 16:16:14 +00:00
wktparse.lex Added missing prototypes 2005-01-10 09:47:14 +00:00
wktparse.tab.c Added generated parsers to avoid FLEX/YACC requirement on release. 2005-03-03 10:29:46 +00:00
wktparse.tab.h Added generated parsers to avoid FLEX/YACC requirement on release. 2005-03-03 10:29:46 +00:00
wktparse.y Reintroduced support for '<anygeom> EMPTY' form, for OGC compliance. 2005-01-18 13:31:54 +00:00
wktunparse.c Changed byte to uchar to avoid clashes with win32 headers. 2005-02-21 16:16:14 +00:00

Welcome to the Initial version of LWGEOM.

More information is available on the PostGIS user's mailing list and 
the PostGIS developer's mailing list.  

Differences
-----------

The LWGEOM is very much like the original PostGIS GEOMETRY type.  The 
main differences are:

a) LWGEOMs are much smaller than the PostGIS GEOMETRY
b) LWGEOMs natively support 2d, 3d, and 4d points
c) LWGEOMs are indexed using single-precision bounding boxes.  This
   make the indexes significantly smaller than PostGIS GEOMETRY
   indexes.
d) LWGEOMs are internally very similar to OGC WKB   
e) The "normal" view of LWGEOMs is OGC WKB - PostGIS GEOMETRY is OGC WKT
f) PostGIS geometries have a built-in BOX3D.  LWGEOMs have an *optional*
   BOX2D (see below).


Also included with the LWGEOMs is a type called 'box2d'.  This is
very similar to PostGIS BOX3D type:

a) BOX2Ds are 2D - BOX3D is 3D
b) BOX2Ds are represented by single-precision floating point numbers,
   while BOX3Ds are double-precision floating point numbers.
c) BOX2Ds will sometimes be slightly larger than you might expect.
   This is because the conversion from double-precision to 
   single-precision is inexact.  When this happens, the BOX2D will
   automatically expand itself.
   

Bounding Boxes
--------------

<this section for advanced users.  Ignore it if you don't understand
 what its saying.>

Bounding boxes are optional in LWGEOMs.  By not having one, you are
saving a small amount of space per LWGEOM geometry (16 bytes).

Bounding boxes are attached to any non-POINT geometry by default.

You can disable this automatic addition setting AUTOCACHE_BBOX to 0
in the top-builddir Makefile.config and read BBOXCACHE_BEHAVIOURS
for function-by-function behaviour explanation.

Manual control of bbox cache is available using DropBBOX() and AddBBOX().

UPDATE <table> SET <geomcol> = DropBBOX(<geomcol>);
UPDATE <table> SET <geomcol> = AddBBOX(<geomcol>);

Note that if you don't cache a BBOX spatial operators will be much slower,
as they'll need to compute all the boxes at every invokation.
If you use GiST indexes you will still note a slow down as a RECHECK
clause is specified for GiST operators. Also, GiST index updating
will be slower w/out a BBOX cache.


Space Saving
------------

LWGEOM indexes are approximately 40% smaller than PostGIS indexes.

A LWGEOM 'POINT(0 0)' takes up 21 bytes, a POSTGIS 'POINT(0 0)' takes
up 140 bytes.  This shows that LWGEOMs have a much smaller overhead.

LWGEOMs will store 2D points as 2 double precision numbers (16 bytes) -
PostGIS will store 2D points with 3 numbers (24 bytes).   This can be 
another big savings.