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.
Mark Cave-Ayland [Fri, 23 Nov 2007 10:42:09 +0000 (10:42 +0000)]
Apply Tom Glancy's patch to shp2pgsql which corrects an off-by-one error in the field_width calculation when determining which SQL numeric type is required depending upon the length of the corresponding shapefile field. This should eliminate various out of range error messages that may have appeared when attempting to load a converted shapefile into PostgreSQL.
Mark Cave-Ayland [Fri, 23 Nov 2007 10:24:00 +0000 (10:24 +0000)]
Commit a first attempt at an Ant build.xml file for the PostGIS JDBC driver so finally all the Java drivers build with Ant for consistency, plus we eliminate numerous cross platform problems. As it stands, the build.xml file supports only the standard JDBC driver - if you wish to use a JTS-enabled JDBC driver or run the online regression tests then you must still use the Makefile. Any help porting the remaining parts of the Makefile would be appreciated.
Mark Cave-Ayland [Mon, 29 Oct 2007 16:29:58 +0000 (16:29 +0000)]
Apply parts of Charlie Savage's MSVC patch - mainly tidying up variable allocations so they appear at the start of functions, but also making better use of the pj_get_errno_ref() which gets rid of the auto-import warnings on MingW.
Mark Cave-Ayland [Mon, 29 Oct 2007 14:22:26 +0000 (14:22 +0000)]
Remove version numbers from liblwgeom references in lwpostgis.sql as per http://postgis.refractions.net/pipermail/postgis-devel/2007-September/002764.html. This should help make upgrades a lot easier for people since it removes the need to change the SQL function definitions when upgrading version. Note that this is a quick and dirty fix as I didn't want to change Makefile.shlib too much - as soon as we remove support for PostgreSQL < 8.0, we can use PGXS instead and thus remove the redundant shared library code from PostGIS.
Mark Cave-Ayland [Mon, 29 Oct 2007 13:44:29 +0000 (13:44 +0000)]
Commit Charlie Savage's patches (with additional comments) to the bounding box/envelope functions to ensure that valid geometries are always returned; in more specific terms, if a bounding box is a point then a POINT is returned, and if a bounding box is 1-dimensional a LINESTRING is returned. Otherwise a POLYGON is returned as per the old behaviour. For details see the thread in the postgis-users archives Sept 2007 'How to get the centroid of an bounding box using st_extent'.
Mark Cave-Ayland [Mon, 29 Oct 2007 12:34:17 +0000 (12:34 +0000)]
Fix broken error message when attempting to deserialise a type other than a point; the message should now correctly show the name of the offending type. Patch supplied by Charlie Savage.
Mark Cave-Ayland [Fri, 28 Sep 2007 10:18:23 +0000 (10:18 +0000)]
Fix a mistake in my refactoring of the AsGML() patch for GML3 support - the detoasted geometry is now the second argument rather than the first. Per report from Olivier Courtin.
Mark Cave-Ayland [Tue, 21 Aug 2007 23:02:41 +0000 (23:02 +0000)]
Fix crash when calling ST_EndPoint caused by a double-free in LWGEOM_endpoint_linestring. This bug has been there for a while - thanks to Eric Francois for the bug report.
Mark Leslie [Thu, 2 Aug 2007 19:58:46 +0000 (19:58 +0000)]
Added PreparedGeometry and caching support to the intersects function in the jts connector. Created wrapper functions for the PreparedGeometry functionality.
Mark Cave-Ayland [Thu, 12 Jul 2007 20:33:23 +0000 (20:33 +0000)]
Add missing methods to the PROJ.4 cache memory context to prevent a backend crash caused by a NULL pointer dereference when PostgreSQL is trying to clean up memory contexts. Per report from Tom Lane.
Stephen Frost [Mon, 9 Jul 2007 02:20:00 +0000 (02:20 +0000)]
- Added print-print function for norm_addy type (norm_addy -> varchar)
- Restructured geocode(), accept address in parsed norm_addy form
as well as unparsed varchar form. Return norm_addy type instead of
varchar (use pprint_addy() if you want a varchar result instead)
Stephen Frost [Sun, 8 Jul 2007 21:56:47 +0000 (21:56 +0000)]
- City names are 90 characters (this matters more than you might
think because it affects the types returned from the various
calls and if they don't match subsequent geocode() queries in
the same session may complain about the planned record type not
matching across calls)
Stephen Frost [Tue, 3 Jul 2007 21:32:50 +0000 (21:32 +0000)]
Add in initial import scripts for importing the TIGER/Line
data into a PostGIS system. Could probably be improved to
accept more arguments/etc and require less direct script
modification to make it work. Also, not sure the polygons
are done perfectly yet. :/
Stephen Frost [Tue, 3 Jul 2007 21:30:34 +0000 (21:30 +0000)]
Add in broken out/updated normalize/geocode functions
- create_geocode.sql:
Main creation script for pulling in all the other
.sql files to create all the functions and whatnot
- normalize/
Normalization routines, includes mapping 'North' -> 'N',
'Virginia' -> 'VA', etc, etc.
- geocode/
Actual geocoding routines to find the point geometry of the
address. Includes interpolation across the linestring found
for the location (perhaps not the best), and fallbacks to
zip-code and city, state matches using the associated lookup
tables for those. Also currently returns a set rather than
a cursor, that's up for some debate but the cursor makes it
difficult to do things like fallback, imv. Especially since
references to it from another pl/pgsql function require it to
be a specific record type across multiple calls. That's
currently a problem. :/
Stephen Frost [Tue, 3 Jul 2007 21:19:54 +0000 (21:19 +0000)]
tables/- New scripts for roads_local/tiger_geocode_roads, clean up lookup_tables
- roads_local.sql:
Script to create the road_local table from the completechain
table which is created by ogr2ogr. Mainly handles type
conversions. Also creates the tlid, cfcc, and geometry
indexes.
- tiger_geocode_roads.sql:
Script to create the tiger_geocode_roads table which breaks
down the roads_local to just the street name, etc, much
smaller than roads_local but has the pointers to get back
to the full roads_local for address number matching, etc.
Also creates the appropriate indexes using soundex().
- lookup_tables.sql:
- Add 'drop if exists' to make script easily re-runnable
- Add primary keys, good thing to have, and creates indexes
- Add st_code (TIGER/Line state code) to state_lookup
- Remove dup in street_type_lookup
- Add in building of:
place_lookup
county_lookup
countysub_lookup
zip_lookup_all
zip_lookup
Mark Leslie [Thu, 28 Jun 2007 22:46:08 +0000 (22:46 +0000)]
Added ST_Covers and ST_CoveredBy functions, as discussed at http://lin-ear-th-inking.blogspot.com. Added regression tests and documention for the new functions.
Mark Leslie [Thu, 28 Jun 2007 20:21:32 +0000 (20:21 +0000)]
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.
Applied Michael Fuhr's patch to use explicit text casts where required. Required for PostgreSQL 8.3 where many of the implicit casts to text have been removed.
Mark Leslie [Mon, 4 Jun 2007 23:06:28 +0000 (23:06 +0000)]
Added versions of functions with standard ST (Spatial Type) prefixes to any functions that were lacking them. Updated the regression tests to include the new functions.
Reduce 'LWGEOM_gist_joinsel called with arguments that are not column references' warning to DEBUG1; it's not really a problem, and in cases where people a lot of these types of queries, the logs get flooded with these NOTICEs. Per email from Flavio Perri.
Fixed bug #145 - RemovePoint Failure in the bugtracker. It was an off-by-one error in ptarray.c which caused the penultimate point to not be copied to the new geometry.
Fix broken docbook stylesheet search. AC_ARG_WITH only calls its contents when a --with-* option is specified, so the search would never be invoked in its current position. Moved the search into the second macro argument, so it is now invoked if no --with-xsl argument is specified, which I believe was the intended behaviour.
Mark Cave-Ayland [Thu, 31 May 2007 13:18:04 +0000 (13:18 +0000)]
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.
Mark Leslie [Mon, 28 May 2007 15:34:04 +0000 (15:34 +0000)]
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.
Mark Cave-Ayland [Mon, 14 May 2007 17:51:32 +0000 (17:51 +0000)]
Remove GEOS C++ API support from PostGIS HEAD; it's been broken since 1.2.0 and so we require a minimum of GEOS 2.2.0 to compile and run PostGIS. Includes alterations to autoconf to display an error message during configure if the GEOS version is incorrect. Passes all regression tests with GEOS 2.2.3 and GEOS 3.0.0rc4 using GEOS CAPI.