Lightbulb moment: the fix for GBT#21: locate_along_measure: wrong values, invalid data required extra work as floating point errors could still be introduced by the removal of the memcpy(). In fact it was the clipping logic that was wrong, so this patch re-adds the memcpy() in the correct place(s) and corrects the clipping flags to remove this floating point error. With thanks to Stephen Davies.
Regina Obe [Thu, 27 Nov 2008 18:31:12 +0000 (18:31 +0000)]
Document new ST_IsValidReason function. I suppose this may be the last time I can successfully create invalid geometries before Mark ruins all the fun.
Regina Obe [Wed, 26 Nov 2008 12:11:00 +0000 (12:11 +0000)]
Correct install docs to agree with README. Not sure if this is necessary since this is partially for already installed postgis. Are we going to have an lwgeom folder in contrib?
Mark Cave-Ayland [Mon, 24 Nov 2008 11:04:44 +0000 (11:04 +0000)]
Fix for GBT#73: ST_Force_Collection crashes with CIRCULARSTRING. This is basically the same fix for GBT#66: ST_Dump kills backend when fed CIRCULAR STRING except that it occurs in a different place.
Mark Cave-Ayland [Thu, 20 Nov 2008 15:00:57 +0000 (15:00 +0000)]
Switch GEOS profiling over to use conditional macros, much in the same way as LWDEBUG(F) has been implemented. This improves code readability by not having constant #if...#endif sections throughout the code. I've also changed the variable that indicates whether profiling has been enabled to POSTGIS_PROFILE, and integrated it into the autoconf configuration. Hence profiling can be enabled by running configure with the --enable-profile option, or setting POSTGIS_PROFILE in postgis_config.h to 1 and re-compiling.
Regina Obe [Sat, 8 Nov 2008 14:43:04 +0000 (14:43 +0000)]
Document affine functions now work with curves. Though I don't have a tool to verify correctness, so my assumption - it returns something that sounds sort of right.
After a quick sanity grep, I noticed that ST_Transform() was also susceptible to crashing on curve types in the same way as the previous two fixes. Hence I'm committing a fix now before Regina finds it and logs another bug report :)
The GEOS 2.2 series "geos_c.h" is missing header guards, so including the header multiple times as is done in lwgeom_geos.h and lwgeom_geos_prepared.h causes compilation to fail with multiple definition errors. This patch fixes this problem allowing GEOS 2.2 to work with PostGIS once again, although of course it can easily be removed when it is decided that GEOS 2.2 support is no longer required.
Change configure to check for the existence of the PGXS Makefile, even if pg_config can be found. This is become distributions such as Debian install pg_config as part of libpq-dev but this package doesn't contain the required Makefile. Per bug report from strk.
Fix for GBT#68 - ST_Shift_Longitude doesn't work with MULTIPOINT. Looks like this was just a simple mistake in the code. I've also improved the error message to return the proper type name instead of just a number.
Fix for GBT#65: ST_AsGML kills the backend when fed a CIRCULAR STRING. The default code attempts to inspect any unknown geometry which fails on CIRCULARSTRING. A longer term fix may be to fix CIRCULARSTRING so that it can be inspected, however the fix here is to throw an ERROR for unknown types just as the other As_*() functions do.
Change ST_GeomFromText() to GeomFromText() for older hwgeom (-w) support - looks like I was a little bit to eager in my earlier conversion to use the new ST_ calling convention.
Alter loader Makefile to add liblwgeom.a dependency, so people who just want to build the shapefile loaders can do "make" within the loader subdirectory and liblwgeom.a will automagically get build first.
Kevin Neufeld [Mon, 3 Nov 2008 17:00:01 +0000 (17:00 +0000)]
updated url in comments to the documentation on the implemented point-in-polygon algorithm to http://softsurfer.com/Archive/algorithm_0103/algorithm_0103.htm#Winding%20Number. Old link was dead.
There are few commits that can be as satisfying as one which involves the removal of ~1200 lines of code. By using the liblwgeom parser instead of the in-built parser, we have now achieved the following:
i) all parsers within PostGIS, shp2pgsql and pgsql2shp are now the same which means they all follow the same rules. Also extended error reporting information including error text and position information is available.
ii) the complexity of the shp2pgsql/pgsql2shp is considerably reduced.
The slightly unfortunate cost is the overall executable size is larger, since we are linking with liblwgeom. However, from both a consistency and maintainability point of view, this is a big win. Note that while there may be a difference in behaviour in some corner cases, all regression tests pass here.
Mark Cave-Ayland [Thu, 30 Oct 2008 23:13:13 +0000 (23:13 +0000)]
Fix regression test differences between different platforms in the AsGeoJSON regression code. There were two issues: firstly, the original regression tests included precision information > 15 significant figures, and secondly the GeoJSON code was exposing BOX2DFLOAT4 information to the client instead of calculating the true bounding box. With thanks to Olivier Courtin.
Mark Cave-Ayland [Thu, 30 Oct 2008 17:10:44 +0000 (17:10 +0000)]
Switch shp2pgsql over to use liblwgeom instead of its own internal parser. Some notes from looking at the code:
i) I've abstracted the I/O formatting functions into a new OutputGeometry() function since it allow the logic concerning output formatting to kept in one place, rather than sprinkled throughout all the other Insert* functions.
ii) InsertPoint() and InsertMultiPoint() have been combined, since it seems that the same code will work for both - all that is required is to know whether to produce a MULTIPOINT collecton or a POINT at the end.
iii) I've added additional comments within the Insert* functions to help clarify what is going on in places
iv) It appears some corner cases were missing within the conversion code with respect to Z/M coordinates, so in theory the new code should do a better job.
All in all, the source code is slightly reduced in size (although of course the binary is larger after linking with liblwgeom), and seems a lot more readable to my eyes. A quick TODO is to go through the file and replace the #if...#endif sections related to debugging with LWDEBUG(F) options.
NOTE: I've had to change the Makefile to allow linking against the maths library and liblwgeom.a, so some manual intervention on the automated build may be required ;)