Commit graph

19 commits

Author SHA1 Message Date
Mark Cave-Ayland ffde636dc0 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2815 b70326c6-7e19-0410-871a-916f4a2858ee
2008-06-29 19:11:48 +00:00
Mark Cave-Ayland 1243c2d07f 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2797 b70326c6-7e19-0410-871a-916f4a2858ee
2008-05-31 09:56:44 +00:00
Mark Cave-Ayland cee1f271e5 Commit new build system based upon PGXS. Due to the large number of changes, please refer to http://postgis.refractions.net/pipermail/postgis-devel/2008-May/003010.html.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2774 b70326c6-7e19-0410-871a-916f4a2858ee
2008-05-14 17:10:19 +00:00
Mark Leslie c40a30b516 Added typedefs and serialization/deserialization functionality for sql-mm defined curved geometry types. Added a point_in_polygon short-circuit for contains and within functions.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2532 b70326c6-7e19-0410-871a-916f4a2858ee
2006-12-01 22:16:44 +00:00
Sandro Santilli 9e3da16025 Cleanly handled deserialization of points with non-point input by raising an error. Made other simple geoms deserializers errors of this kind be consistent. Added a check in lwgeom_typename() to avoid memory corruption when input geometrytype is out of range.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2330 b70326c6-7e19-0410-871a-916f4a2858ee
2006-04-18 10:28:48 +00:00
Sandro Santilli c303a65d49 C++ style comments removed, fixed return from void function.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2266 b70326c6-7e19-0410-871a-916f4a2858ee
2006-01-09 12:39:05 +00:00
Sandro Santilli 82adb83c59 Added SRID mismatch checks in GEOS and JTS wrappers
git-svn-id: http://svn.osgeo.org/postgis/trunk@2122 b70326c6-7e19-0410-871a-916f4a2858ee
2005-12-01 16:21:00 +00:00
Sandro Santilli d2df927adc Big API cleanup.
Bug fix in box3d computation for collections containing empty elements.


git-svn-id: http://svn.osgeo.org/postgis/trunk@1544 b70326c6-7e19-0410-871a-916f4a2858ee
2005-03-18 12:36:27 +00:00
Sandro Santilli e53e57d2ff Early memory releases on transform_geometry_recursive() and LWGEOM_asText().
Code cleanups.


git-svn-id: http://svn.osgeo.org/postgis/trunk@1538 b70326c6-7e19-0410-871a-916f4a2858ee
2005-03-16 11:41:08 +00:00
Sandro Santilli 1c531a9662 Replaced DEBUG* macros with PGIS_DEBUG*, to avoid clashes with postgresql DEBUG
git-svn-id: http://svn.osgeo.org/postgis/trunk@1374 b70326c6-7e19-0410-871a-916f4a2858ee
2005-02-07 13:21:10 +00:00
Sandro Santilli db7e4ac797 Moved getMachineEndian from parser to liblwgeom.{h,c}.
Added XDR and NDR defines.
Fixed all usage of them.


git-svn-id: http://svn.osgeo.org/postgis/trunk@1162 b70326c6-7e19-0410-871a-916f4a2858ee
2004-12-17 11:08:53 +00:00
Sandro Santilli e72eae5a31 Added a copy of GNU vsprintf.c file and compiled in.
git-svn-id: http://svn.osgeo.org/postgis/trunk@1077 b70326c6-7e19-0410-871a-916f4a2858ee
2004-11-02 16:48:54 +00:00
Sandro Santilli 57bf5a303f Added a trailing zeros trimmer
git-svn-id: http://svn.osgeo.org/postgis/trunk@1005 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-15 09:41:01 +00:00
Sandro Santilli 26e083d39f added memory allocation debugging
git-svn-id: http://svn.osgeo.org/postgis/trunk@966 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-08 13:16:58 +00:00
Sandro Santilli 1449cae461 API cleanup, more steps toward standalone library.
git-svn-id: http://svn.osgeo.org/postgis/trunk@951 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-07 10:03:23 +00:00
Sandro Santilli 60c754e691 Added newlines in standalone reporters
git-svn-id: http://svn.osgeo.org/postgis/trunk@927 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-05 15:12:18 +00:00
Sandro Santilli e2a586c10d bug fixes
git-svn-id: http://svn.osgeo.org/postgis/trunk@916 b70326c6-7e19-0410-871a-916f4a2858ee
2004-09-30 16:06:05 +00:00
Sandro Santilli 2a346e2d9a More common flags between LW<type>s.
LWGEOM_summary output made cleaner and moved to lwgeom_debug.c


git-svn-id: http://svn.osgeo.org/postgis/trunk@913 b70326c6-7e19-0410-871a-916f4a2858ee
2004-09-30 11:45:40 +00:00
Sandro Santilli 406c2623b7 Added missing liblwgeom.c file.
Made LWMPOINT, LWMLINE, LWMPOLY compatible with LWCOLLECTION.
Fixed reverse() and forcerhr() to maintain geometry structure.


git-svn-id: http://svn.osgeo.org/postgis/trunk@912 b70326c6-7e19-0410-871a-916f4a2858ee
2004-09-30 08:18:06 +00:00