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
ffb42040c2
Remove warning about unused variable in lwgeom.c (it was a leftover from the PostgreSQL 8.3 compatibility patch)
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@2687 b70326c6-7e19-0410-871a-916f4a2858ee
2007-08-13 07:06:58 +00:00
Mark Leslie
8656724822
Added or updated debugging statements.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@2633 b70326c6-7e19-0410-871a-916f4a2858ee
2007-06-28 20:16:13 +00:00
Mark Cave-Ayland
d1a81c7b79
Add support for the upcoming release of PostgreSQL 8.3. From PostgreSQL 8.3, the internal structure of varlena datatypes has changed and so any references to the size of the varlena and its address must use the VARSIZE and SET_VARSIZE macros. Includes a #define in pgsql_compat.h so that SET_VARSIZE still works with the older PostgreSQL versions. Passes all regression tests under PostgreSQL 8.2 and PostgreSQL 8.3. Thanks to David Techer and Michael Fuhr for additional testing.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@2610 b70326c6-7e19-0410-871a-916f4a2858ee
2007-05-31 13:18:04 +00:00
Mark Leslie
5624dc6444
Added curve handling to getType, numGeometries, geometryN, dimension, exteriorRing, numInteriorRings, interiorRingN, closed (lwgeom_ogc.c) lwgeom_clone (lwgeom.c) and area. Added function ST_CurveToLine and ST_LineToCurve. Added regression tests for sql-mm geometries and related functions.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@2609 b70326c6-7e19-0410-871a-916f4a2858ee
2007-05-28 15:34:04 +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
bca9346fe1
added copyright header
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@2370 b70326c6-7e19-0410-871a-916f4a2858ee
2006-05-30 08:47:00 +00:00
Paul Ramsey
c2f4b4695a
Fix for enforceRHR to actually enforce rather than just reverse. (Note
...
that seems to be enforcing CW RHR rather than CCW RHR.)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2316 b70326c6-7e19-0410-871a-916f4a2858ee
2006-03-12 17:13:30 +00:00
Sandro Santilli
b0bd31e6f8
Fixed bug in SnapToGrid() bbox computation.
...
Previous policy (WHEN SIMPLE) turned out to be non-simple,
so this has been changed to TAINING.
Bbox will then be recomputed by scanning output coordinates
iff input had a bbox cache.
AUTOCACHE_BBOX define (the default) will still force a
computation of output box if worth it.
Regress tests added for the case reported on postgis-users
Run of regress tests do not require postgis install
anymore. The library build in source tree will be
used for this purpose.
Version bumped to 1.1.2 and CHANGES file updated.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2298 b70326c6-7e19-0410-871a-916f4a2858ee
2006-01-29 13:54:38 +00:00
Sandro Santilli
4bca418336
Moved PG_LWGEOM WKB I/O and SRID get/set funx
...
from lwgeom_api.c to lwgeom_pg.c.
Made lwgeom_from_ewkb directly invoke grammar parser rather then invoke
the PG_LWGEOM-specific function.
Cleaned up signedness-related and comments-related warnings for the files
being committed (more to do on other files)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2243 b70326c6-7e19-0410-871a-916f4a2858ee
2005-12-30 17:40:37 +00:00
Sandro Santilli
c0aaceaaf0
Fixed bug in lwgeom_as_anytype cast funcions
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@2172 b70326c6-7e19-0410-871a-916f4a2858ee
2005-12-13 18:19:34 +00:00
Sandro Santilli
321ebcaf0f
Fixed lwgeom_segmentize2d() to always return a clone
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@2115 b70326c6-7e19-0410-871a-916f4a2858ee
2005-12-01 13:53:14 +00:00
Sandro Santilli
a3e8fcf09a
Forced copy of BOX2D at deserialization time.
...
LWGEOM (sub)objects will always have their own copy, safely released
by lwgeom_release(). This will remove memory alignment problems.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2037 b70326c6-7e19-0410-871a-916f4a2858ee
2005-11-14 09:01:15 +00:00
Sandro Santilli
153b504c3b
Added shift_longitude(geometry) sql procedure and underlying
...
ptarray_longitude_shift(POINTARRAY *) and lwgeom_longitude_shift(LWGEOM *)
functions.
git-svn-id: http://svn.osgeo.org/postgis/trunk@1999 b70326c6-7e19-0410-871a-916f4a2858ee
2005-10-25 11:38:28 +00:00
Sandro Santilli
60ea69593c
Added wrappers for ewkb output
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@1926 b70326c6-7e19-0410-871a-916f4a2858ee
2005-09-23 16:43:56 +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
f1650b3817
Renamed lwgeom_to_wkt to lwgeom_to_ewkt, as it doesn't strip out non-ogc
...
extensions.
git-svn-id: http://svn.osgeo.org/postgis/trunk@1456 b70326c6-7e19-0410-871a-916f4a2858ee
2005-03-01 13:22:50 +00:00
Sandro Santilli
593a8032ac
Changed byte to uchar to avoid clashes with win32 headers.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@1415 b70326c6-7e19-0410-871a-916f4a2858ee
2005-02-21 16:16:14 +00:00
Sandro Santilli
6ce75e5f02
Changed 'char' to 'uchar' (unsigned char typedef) wherever octet is actually
...
meant to be.
git-svn-id: http://svn.osgeo.org/postgis/trunk@1390 b70326c6-7e19-0410-871a-916f4a2858ee
2005-02-10 10:52:53 +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
f6329625dc
Changed unparse_WKB interface to take an output size pointer and an HEXFORM
...
specifier. Reworked code in wktunparse to use function pointers.
git-svn-id: http://svn.osgeo.org/postgis/trunk@1311 b70326c6-7e19-0410-871a-916f4a2858ee
2005-01-18 09:32:03 +00:00
Sandro Santilli
8814c0fe25
Fixed a bug in lwgeom_dropBBOX()
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@1144 b70326c6-7e19-0410-871a-916f4a2858ee
2004-12-14 11:41:43 +00:00
Sandro Santilli
7d978124fa
Stricter syntax fixes. Reported by S�bastien NICAISE <snicaise@iciatechnologies.com>
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@1037 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-21 19:48:34 +00:00
Sandro Santilli
98df5600a6
Added endiannes specification to unparse_WKB, AsBinary, lwgeom_to_wkb.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@984 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-11 14:03:33 +00:00
Sandro Santilli
69526b4ff8
Added debug strings
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@978 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-11 10:30:44 +00:00
Sandro Santilli
f8afcfa025
Added lwgeom_addBBOX() and lwcollection_construct_empty()
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@975 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-11 09:32:44 +00:00
Sandro Santilli
163159d776
lwgeom_same new implementation
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@974 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-11 07:15:20 +00:00
Sandro Santilli
0a753c3513
segmentize2d() port and use of new LWGEOM structure.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@972 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-10 20:31:23 +00:00
Sandro Santilli
3f1700cd45
Debugging output cleanup.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@968 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-08 13:21:44 +00:00
Sandro Santilli
b6bd129246
Changed LWGEOM structure to point to an actual BOX2DFLOAT4.
...
Renamed most function to reflect a TYPE_method naming convention.
(you'll need a dump/reload for it to work)
Added more manipulation functions.
git-svn-id: http://svn.osgeo.org/postgis/trunk@967 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-08 13:20:55 +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
d745e459b8
Serialized form and WKB prepared to accept ZM flags replacing DD (dimensions)
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@923 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-04 13:53:42 +00:00
Sandro Santilli
c304b64232
Made GEOS<->LWGEOM converters keep geometry structures.
...
Fixed bug in serializers.
Added noop(geometry) for deserialize/serialize debugging.
git-svn-id: http://svn.osgeo.org/postgis/trunk@920 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-03 15:52:23 +00:00
Sandro Santilli
6550aaeed2
Added lwgeom_add(LWGEOM *to, int where, LWGEOM *what).
...
Added LWGEOM2GEOS keeping input geometry structure.
git-svn-id: http://svn.osgeo.org/postgis/trunk@919 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-01 14:49:34 +00:00
Sandro Santilli
cf7dc0a2a6
Added runtime cast functions.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@917 b70326c6-7e19-0410-871a-916f4a2858ee
2004-10-01 07:51:00 +00:00
Sandro Santilli
f3e6e82ff3
Added BBOX finders and its support in serializer.
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@915 b70326c6-7e19-0410-871a-916f4a2858ee
2004-09-30 15:42:28 +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
Sandro Santilli
271ff4b266
Added serialize function for LWGEOM
...
git-svn-id: http://svn.osgeo.org/postgis/trunk@910 b70326c6-7e19-0410-871a-916f4a2858ee
2004-09-29 15:25:21 +00:00
Sandro Santilli
904c0d5652
Big layout change.
...
lwgeom.h is public API
liblwgeom.h is private header
lwgeom_pg.h is for PG-links
lw<type>.c contains type-specific functions
git-svn-id: http://svn.osgeo.org/postgis/trunk@909 b70326c6-7e19-0410-871a-916f4a2858ee
2004-09-29 10:50:30 +00:00