Regina Obe [Sun, 6 Jul 2008 07:22:51 +0000 (07:22 +0000)]
fixed ST_Dimension example, flipped order of conditions in WHERE on some examples (in later versions of PostgreSQL since we don't have our costs right - the planner may choose to process in order of conditions
Add the parser build rules back into the liblwgeom Makefile, so now any changes to either the lexer or parser source files will automatically invoke a rebuild of the relevant output files during make
Fix liblwgeom requiring gcc to compile. By using macros and variables supplied by libtool, we can now detect the PIC flags and whether the compiler will accept additional gcc warning flags for developers
Mark Cave-Ayland [Sun, 29 Jun 2008 19:11:48 +0000 (19:11 +0000)]
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.
Remove JTS support from liblwpostgis; native GCJ-compiled JTS code is reported not to be reliable enough within a production environment, so well stick with GEOS.
Some more updates to lwpostgis.sql.in.c; correct a couple of missing conversions from OPAQUE_TYPE to internal (how on earth did regression tests pass with this still in place??), plus remove the UPDATE on pg_opclass to change the OID of the index storage type since we can do this by specifying a STORAGE clause instead.
Update copyrights for configure.ac (rewritten from scratch, and now renamed from the deprecated form configure.in) and also the PROJ.4 version detection macro
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
Mark Cave-Ayland [Sat, 31 May 2008 09:56:44 +0000 (09:56 +0000)]
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.
Paul Ramsey [Wed, 28 May 2008 23:03:11 +0000 (23:03 +0000)]
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)
Mark Cave-Ayland [Thu, 22 May 2008 20:43:00 +0000 (20:43 +0000)]
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.
Mark Cave-Ayland [Wed, 14 May 2008 17:19:50 +0000 (17:19 +0000)]
Fixes for previous commit: Alter GNUmakefile to understand that Makefile.config no longer exists, plus remove lwgeom/sqldefines.h as it is generated by autoconf
Mark Cave-Ayland [Wed, 14 May 2008 17:10:19 +0000 (17:10 +0000)]
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.
Paul Ramsey [Thu, 10 Apr 2008 14:44:26 +0000 (14:44 +0000)]
Reduce FTDate field size to 8 bytes from 10. Matches other calls in the file
now, no good explanation in code why it was 10 to start with.
http://postgis.refractions.net/pipermail/postgis-users/2008-April/019169.html
Mark Cave-Ayland [Thu, 10 Apr 2008 06:40:33 +0000 (06:40 +0000)]
Another round of PostgreSQL 8.3 fixes, this time related to arrays. Make sure that we use the supplied ArrayType pointer macros, instead of attempting to access to cast directly to ArrayType. This resolved GBT#13 where a "corrupted histogram" error is thrown when using using ST_EstimatedExtent() under 8.3.
Paul Ramsey [Mon, 7 Apr 2008 19:47:05 +0000 (19:47 +0000)]
Allow conditional regression tests based on GEOS_VERNUM and move the
cover/prepared tests into the appropriate buckets. Fix the AT_AsKML
regression tests.
Mark Cave-Ayland [Mon, 31 Mar 2008 11:16:54 +0000 (11:16 +0000)]
Remove the code that adds share/contrib/nad to the PROJ.4 search path for PostgreSQL < 8.0 since the mechanism for determining the path has changed from earlier versions, and this was mainly for Win32 users. Also rename nad/ directory to proj/ to keep it inline with an existing PROJ.4 installation.
Mark Cave-Ayland [Fri, 28 Mar 2008 18:55:17 +0000 (18:55 +0000)]
Fix crash caused by double-free in LWGEOM_same - we were accidentally freeing the 1st parameter twice instead of freeing the second parameter. Thanks to Cliff Wright for the bug report.
Mark Cave-Ayland [Thu, 27 Mar 2008 21:18:16 +0000 (21:18 +0000)]
Fix bug with |>> and <<| operators - the BOX2D overabove and overbelow functions were actually wrong, causing index scans to return the wrong results. Per bug report from Tomas Karlsson.
Mark Cave-Ayland [Fri, 21 Mar 2008 08:17:49 +0000 (08:17 +0000)]
Resolve GBT bugs #2,#3 and #9 related to crashes when calling aggregate functions under PostgreSQL 8.3 (all earlier versions would not see the error). This was due to missing more VARSIZE macros in the PostgreSQL 8.3 conversion. The complete list of affected functions under PostgreSQL 8.3 is: ST_force_2d(), ST_force_3dz(), ST_force_3dm(), ST_force_4d(), ST_Collect(), ST_MakeLine(), ST_Polygonize(), ST_Union()/ST_GeomUnion(), ST_MakePolygon()/ST_Polygon().
Ben Jubb [Tue, 29 Jan 2008 01:24:34 +0000 (01:24 +0000)]
Changed the interface for the GEOS prepared predicates.
ST_contains, ST_containsProperly, ST_covers, and ST_intersects are now overloaded.
The new arguments style is ( geometry, geometry, integer). The third argument is used to determine when the first argument changes. The assumption is that when the third argument changes, the first argument is assumed to have changed too. This side-steps the issue of determining when the identity of the first geometry changes.
Ben Jubb [Fri, 18 Jan 2008 00:59:13 +0000 (00:59 +0000)]
Tests for the prepared geometry predicates.
The tests were copied from regress_ogc, and modified.
Most of the tests use a pattern where the same function is invoked three times with the same argument.
This tests the prepared geometry caching mechanism.
This testfile haven't been added to regress/Makefile yet, as it fails for one case. This
probably due to a bug in GEOS.
Mark Cave-Ayland [Fri, 11 Jan 2008 15:04:05 +0000 (15:04 +0000)]
Rewrite the pgsql2shp connection string code so that it uses a connection string, rather than setting environment variables. MingW-compiled and MSVC-compiled apps seem to have great problems passing the variables to each other, causing regression to fail. With this fix (and a Makefile tweak), it is now possible to run a MingW-compiled PostGIS against an MSVC compiled PostgreSQL and pass all regression tests.
Commit updated versions of the ChangeLog and README.postgis (also change some references in README.postgis from "run as root" to "run as postgres", and correct the --with-pgsql and --with-geos documentation)
Mark Cave-Ayland [Fri, 30 Nov 2007 13:04:39 +0000 (13:04 +0000)]
Fix the (E)WKB parser so that it performs validation checks in the same way as the WKT parser, e.g. ensure POLYGON rings are closed, LINESTRINGs consist of at least 2 points and that curves have at least 3 points. As discovered when looking simplify() bug submitted by Ivan Mincik.
Mark Cave-Ayland [Tue, 27 Nov 2007 22:39:06 +0000 (22:39 +0000)]
Rename the existing get_int32() and get_uint32() functions to lw_get_int32() and lw_get_uint32() respectively in order to avoid a collision with functions of the same name in newer versions of OS X. This should resolve the problem with PostGIS crashing on some OS X installations. Many thanks to William Kyngesburye and others for resolving this issue.
Mark Cave-Ayland [Tue, 27 Nov 2007 22:19:30 +0000 (22:19 +0000)]
Extend the PROJ.4 search path to include $sharedir/contrib/postgis/nad when looking for grid files. This is mainly to allow Win32 builds to find grid files without having to use a PROJ.4 DLL compiled containing a fixed path.