postgis/lwgeom
Paul Ramsey 05162d3ef7 Reduce p-i-p memory leak by 50%
git-svn-id: http://svn.osgeo.org/postgis/trunk@2993 b70326c6-7e19-0410-871a-916f4a2858ee
2008-09-23 19:07:03 +00:00
..
.cvsignore jdbc2 works: 2005-04-15 14:04:34 +00:00
BBOXCACHE_BEHAVIOURS added snaptogrid behavior 2006-02-06 11:09:02 +00:00
compat.h Estrapolated SERIALIZED_FORM doc from liblwgeom.h and put it into 2005-11-28 15:06:06 +00:00
DEBUG Provide a new text file called DEBUG explaining how to use the new debug system. 2008-05-31 10:35:04 +00:00
long_xact.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
long_xact.sql.in Switch all SQL and PL/PGSQL stored procedures over to use dollar quoting instead of apostrophes for function bodies. At last, most of the stored procedures actually become readable 2008-06-05 12:09:48 +00:00
lwgeom_box.c Since PGXS compiles libraries with -Wall, attempt to remove as many warnings as possible. Most of these are missing function prototypes at the top of each file. 2008-05-22 20:43:00 +00:00
lwgeom_box2dfloat4.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
lwgeom_box3d.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
lwgeom_btree.c Blast away the huge amounts of legacy C code related to PostgreSQL versions < 8.1. Next step will be to work on the SQL script files too. 2008-06-05 10:19:01 +00:00
lwgeom_chip.c Since PGXS compiles libraries with -Wall, attempt to remove as many warnings as possible. Most of these are missing function prototypes at the top of each file. 2008-05-22 20:43:00 +00:00
lwgeom_debug.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
lwgeom_dump.c Split the basic geometry accessors into a separate static library liblwgeom.a; this potentially allows re-use of the liblwgeom functions from within PostGIS, or could be extended at a later date to include databases other than MySQL. This patch includes a change to the liblwgeom handler functions; instead of sprinkling init_pg_func()s around the source, I have changed the default liblwgeom handlers to make use of a callback to allow linked libraries to set their own handlers the first time any of them are called. I have also tidied up the parser API a little in liblwgeom.h, which means wktparse.h can be removed from all of the headers in the lwgeom/ directory, plus renamed wktunparse.c to lwgunparse.c to keep things similar to lwgparse.c. Finally, I renamed liblwgeom.c to lwutil.c to avoid confusion within the new interface. TODO: the liblwgeom Makefile has some gcc-specific options, but these can be fixed later - it seemed more important to make the warnings visible to developers. 2008-06-29 19:11:48 +00:00
lwgeom_estimate.c Fix for segfault in ANALYZE due to incorrect use of legacy BOX type within compute_geometry_stats() (Fixes GBT#43). Thanks to Landon Fuller for the bug report and fix. 2008-07-16 08:42:34 +00:00
lwgeom_functions_analytic.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
lwgeom_functions_basic.c More work on improving the EWKT/B parser; remove all references to allocator functions from outside of liblwgeom by generating wrapper functions with more meaningful names. As well as cleaning up the API, it also makes the code much more readable 2008-07-13 10:50:56 +00:00
lwgeom_functions_lrs.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
lwgeom_geojson.c Apply GeoJSON patch from Olivier Courtin. 2008-07-13 23:47:54 +00:00
lwgeom_geos_c.c More work on improving the EWKT/B parser; remove all references to allocator functions from outside of liblwgeom by generating wrapper functions with more meaningful names. As well as cleaning up the API, it also makes the code much more readable 2008-07-13 10:50:56 +00:00
lwgeom_gist.c Allow a flags parameter to be passed into the WKT parser to determine which consistency checks are performed out of polygon ring closure, minimum number of points and odd number of points. 2008-09-09 21:10:46 +00:00
lwgeom_gml.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
lwgeom_inout.c Allow a flags parameter to be passed into the WKT parser to determine which consistency checks are performed out of polygon ring closure, minimum number of points and odd number of points. 2008-09-09 21:10:46 +00:00
lwgeom_kml.c Fixed up KML patch from Eduin Carillo. 2008-03-28 21:31:57 +00:00
lwgeom_ogc.c Allow a flags parameter to be passed into the WKT parser to determine which consistency checks are performed out of polygon ring closure, minimum number of points and odd number of points. 2008-09-09 21:10:46 +00:00
lwgeom_pg.c Allow a flags parameter to be passed into the WKT parser to determine which consistency checks are performed out of polygon ring closure, minimum number of points and odd number of points. 2008-09-09 21:10:46 +00:00
lwgeom_pg.h Move some PostgreSQL compatibility macros from lwgeom_pg.h into pgsql_compat.h which is their proper home 2008-06-29 19:19:06 +00:00
lwgeom_rtree.c Reduce p-i-p memory leak by 50% 2008-09-23 19:07:03 +00:00
lwgeom_rtree.h Added a 1D rtree for polygon segment indexing, and tied the index into the point in polygon short-circuit of the contains, within, intersects and disjoint methods. Added an index cache to the comparitor methods to save index build times. 2007-06-28 20:21:32 +00:00
lwgeom_spheroid.c Commit new PostGIS debugging infrastructure. These changes unify all the debug logging to use a new set of macros: LWDEBUG()/LWDEBUGF() for LWGEOM functions, and POSTGIS_DEBUG()/POSTGIS_DEBUGF() for PostgreSQL functions. To enable debugging, run configure with --enable-debug and then remake the entire project. If --enable-debug is omitted during configure, the above macros evaluate to (void)0, and hence should be removed by the compiler during optimisation. Also: contains minor warning cleanups and a fix for the ST_Dwithin SQL definition. 2008-05-31 09:56:44 +00:00
lwgeom_sqlmm.c Move the LWGEOM-specific functions from lwgeom_sqlmm.c into liblwgeom/lwsegmentize.c to ensure that liblwgeom can exist as a standalone library. 2008-09-16 18:44:49 +00:00
lwgeom_svg.c Enhanced speed _ST_DWithin(g,g,d) that returns as soon as g and g are within d of each other, rather than using distance naively. Change ST_DWithin to use enhanced op. (Issue 20) 2008-05-28 23:03:11 +00:00
lwgeom_transform.c Blast away the huge amounts of legacy C code related to PostgreSQL versions < 8.1. Next step will be to work on the SQL script files too. 2008-06-05 10:19:01 +00:00
lwgeom_triggers.c Added cache_bbox trigger 2004-12-30 10:24:25 +00:00
lwpostgis.sql.in.c Update PostGIS SVN trunk to use the new 8.4 GiST API (where RECHECK is now specified within the consistent function, rather than being supplied as part of the operator class definition). This allows PostGIS to compile and pass regression tests on the latest PostgreSQL 8.4 CVS HEAD. 2008-08-21 10:56:10 +00:00
Makefile.in Alter the lwgeom Makefile so that liblwgeom.a is linked directly, rather than using the -L...-l options on the command line. This is to prevent problems on OSX where PGXSadds the PostgreSQL $libdir to the PostGIS link line, causing it to link to liblwgeom.so produced by older versions of PostGIS rather than the static liblwgeom.a. 2008-08-21 08:45:07 +00:00
MISSING_OBJECTS updated 2004-11-11 09:42:26 +00:00
pgsql_compat.h Move some PostgreSQL compatibility macros from lwgeom_pg.h into pgsql_compat.h which is their proper home 2008-06-29 19:19:06 +00:00
profile.h ISO C90 comments (finished in lwgeom/) 2006-01-09 15:55:55 +00:00
README Added updated README file 2005-01-13 09:10:11 +00:00
SERIALIZED_FORM Updated with curved geometry definitions. 2006-12-06 02:00:26 +00:00
sqldefines.h.in Remove the HAS_SCHEMA #define and all related #else code since we now guarantee to be using PostgreSQL > 7.2 2008-06-05 11:19:29 +00:00
sqlmm.sql.in Got rid pf superfluous redirection to deprecated functions of ST_GeomFromWkb and ST_GeomFromText - now they just point directly to the c functions. Changed all FromWKB, FromText variants to point to the non-deprecated ST_GeomFrom, ST_BuildArea etc. (before they were pointing at deprecated functions) 2008-07-30 11:41:23 +00:00
stringBuffer.c ISO C90 comments (finished in lwgeom/) 2006-01-09 15:55:55 +00:00
stringBuffer.h ISO C90 comments (finished in lwgeom/) 2006-01-09 15:55:55 +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 jdbc2 works: 2005-04-15 14:04:34 +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.