Commit graph

30 commits

Author SHA1 Message Date
Paul Ramsey 1ca9049cde Some function renaming: lwgeom_typename => lwtype_name. The internal float/up/down functions get slightly better names. Make collection types re-sizable: added maxgeoms to all collections, and created lwcollection_add_lwgeom() function. Remove all *_add functions. Revized homogenize function to use the new _add_lwgeom and variants.
git-svn-id: http://svn.osgeo.org/postgis/trunk@5439 b70326c6-7e19-0410-871a-916f4a2858ee
2010-03-16 03:13:33 +00:00
Olivier Courtin 049a0e262a make astyle session
git-svn-id: http://svn.osgeo.org/postgis/trunk@5274 b70326c6-7e19-0410-871a-916f4a2858ee
2010-02-21 12:36:27 +00:00
Paul Ramsey 8cabdcf81f 1.5 astyle pass
git-svn-id: http://svn.osgeo.org/postgis/trunk@5181 b70326c6-7e19-0410-871a-916f4a2858ee
2010-02-01 17:35:55 +00:00
Mark Leslie 38518df9a3 First swing at ticket 212.
git-svn-id: http://svn.osgeo.org/postgis/trunk@4231 b70326c6-7e19-0410-871a-916f4a2858ee
2009-06-30 07:35:37 +00:00
Paul Ramsey cfb44a749f astyle --style=ansi --indent=tab (#133)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4168 b70326c6-7e19-0410-871a-916f4a2858ee
2009-06-11 16:44:03 +00:00
Mark Cave-Ayland 709784580a Further fix for #156, and also #167 it seems. Looks like I forgot to apply the fix to the WKB routines aswell.
git-svn-id: http://svn.osgeo.org/postgis/trunk@4165 b70326c6-7e19-0410-871a-916f4a2858ee
2009-06-11 13:28:39 +00:00
Mark Cave-Ayland 2c9c365a5c Remove a double-free bug caused if the unparser finds an invalid geometry (fixes #168)
git-svn-id: http://svn.osgeo.org/postgis/trunk@4078 b70326c6-7e19-0410-871a-916f4a2858ee
2009-05-09 12:34:55 +00:00
Mark Cave-Ayland f7de53897c More cleanup work based upon Mateusz's MSVC patches; remove references to unistd.h and sys/param.h since they are no longer required for determining endian-ness.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3877 b70326c6-7e19-0410-871a-916f4a2858ee
2009-03-16 23:06:58 +00:00
Mark Cave-Ayland 7cbd1b301d More MSVC fixes from Mateusz related to ISO C++ vs. C99 variable initialisation.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3848 b70326c6-7e19-0410-871a-916f4a2858ee
2009-03-10 21:29:14 +00:00
Mark Cave-Ayland 7172fef0d5 Augment comment related to Paul's fix for GBT#130 as I'm bound to forget why we decided to do this at a later date...
git-svn-id: http://svn.osgeo.org/postgis/trunk@3831 b70326c6-7e19-0410-871a-916f4a2858ee
2009-03-10 16:26:09 +00:00
Mark Cave-Ayland b5b6d21a4e Remove some GCC-isms from the unparser related to setting array sizes at run-time rather than compile time. Per report from Mateusz Loskot.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3828 b70326c6-7e19-0410-871a-916f4a2858ee
2009-03-10 16:18:52 +00:00
Paul Ramsey 3ce0132d1e Fix for GBT #130, remove bdpoly regression failure.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3826 b70326c6-7e19-0410-871a-916f4a2858ee
2009-03-10 15:12:11 +00:00
Mark Leslie 488d11cba9 Moving parser changes from spike/mleslie/parser to allow the proper nesting of compound curves within curve polygons and the validation of compound curve continuity. This also resolves GBT#124.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3821 b70326c6-7e19-0410-871a-916f4a2858ee
2009-03-10 00:29:32 +00:00
Paul Ramsey cdfcc4e366 Propset Author Id Keyword Revision on all files.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3639 b70326c6-7e19-0410-871a-916f4a2858ee
2009-02-04 00:28:37 +00:00
Mark Cave-Ayland ce6b5889c8 Commit for GBT#97: Rename LWCURVE to LWCIRCSTRING (also know as restoring balance to the universe).
Having gone through and re-read sections of the CIRCULARSTRING code, it is amazing how much easier the code is to read without the confusion of a curve being either a CIRCULARSTRING or LINESTRING as per the SQL-MM spec. The resulting commit compiles & installs cleanly for me, passes "make check" and also Regina's torture script. Please let me know if I accidentally broke anything :)


git-svn-id: http://svn.osgeo.org/postgis/trunk@3520 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-13 12:27:39 +00:00
Mark Cave-Ayland 6d5f842d1f Errr.... unsigned *what* exactly??! If you'd have asked me yesterday if I thought this would compile, I would have said no...
git-svn-id: http://svn.osgeo.org/postgis/trunk@3460 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-22 11:38:04 +00:00
Mark Cave-Ayland 1d40f4e51d #HISTORY: Really fix what was broken in r3431/3432. See the notes there for the full detail.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3436 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-17 19:37:32 +00:00
Mark Cave-Ayland aa91cc32b8 Undo r3431/3432: this isn't ready for the primetime yet as it breaks a couple of the regression tests.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3433 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-17 16:03:31 +00:00
Mark Cave-Ayland b78c5c500d Fix for one of Regina's torture failures as posted to the -devel list here: http://postgis.refractions.net/pipermail/postgis-devel/2008-December/004362.html. A CurvePolygon has a "standard header" and so must be passed through a function that understands the optional existence of SRIDs/BBOXes etc. in the header.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3431 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-17 15:01:50 +00:00
Mark Cave-Ayland 8e173fb266 Update the LWGEOM parser to provide error HINTs when being called from PostgreSQL, and update regression tests accordingly.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3113 b70326c6-7e19-0410-871a-916f4a2858ee
2008-10-15 15:03:54 +00:00
Mark Cave-Ayland e28c430e58 Nearly finish work on the new parser API. The key part of this patch is to alter the behaviour of the parser so that instead of generating errors directly, it returns an error code, error location and an error message. Hence the caller is now in charge of the behaviour when parsing invalid geometries, and so can ignore errors or proceed onto the next geometry if required. The regression test change is due to a change in an error message, since the error is now returned from the unparser before it even gets to GEOS.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3106 b70326c6-7e19-0410-871a-916f4a2858ee
2008-10-14 19:51:24 +00:00
Mark Cave-Ayland 2f63d64292 Rename parser_check_flags to current_parser_check_flags and unparser_check_flags to current_unparser_check_flags to clarify that these status variables only reflect the checks enabled for the current parse.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3095 b70326c6-7e19-0410-871a-916f4a2858ee
2008-10-13 13:16:14 +00:00
Mark Cave-Ayland 74949bc755 Update LWGEOM unparser to (E)WKT/WKB to resturn a LWGEOM_UNPARSER_RESULT structure instead of just the WKT/WKB character array. This is the same work done for r3023 but applied to the unparser instead.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3026 b70326c6-7e19-0410-871a-916f4a2858ee
2008-09-28 19:48:17 +00:00
Mark Cave-Ayland ddc7e96a1d Rename parser_check_flags to unparser_check_flags for the unparser to prevent linking error under OS X. Also add missing function prototype to silence compiler warning in the PiP code.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3021 b70326c6-7e19-0410-871a-916f4a2858ee
2008-09-27 08:19:18 +00:00
Mark Cave-Ayland a6a0bbc574 Add parser flags to the LWGEOM to (E)WKB/WKT parsers, similar to has already been done for the (E)WKB/WKT to LWGEOM parsers.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3012 b70326c6-7e19-0410-871a-916f4a2858ee
2008-09-25 21:50:19 +00:00
Mark Cave-Ayland 442d938075 Revert commit 2990: the real bug was that the LWDEBUG statement was incorrect rather than the code - the additional read_int() was causing an off-by-one error when outputting WKB causing several regression tests to fail.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2996 b70326c6-7e19-0410-871a-916f4a2858ee
2008-09-23 19:53:12 +00:00
Paul Ramsey 2b6e3d5b0b Add cnt declaration where missing.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2990 b70326c6-7e19-0410-871a-916f4a2858ee
2008-09-22 22:59:47 +00:00
Mark Cave-Ayland 248a9bcb69 Update the code for unparsing LWGEOMs to WKB/WKT so that it includes the standard simple checks: LINESTRINGs must have > 2 points, POLYGONs must have closed rings and CIRCULARSTRINGs must have > 2 points and the number of points must be odd. There is still a little more work to do to allow flags to be passed into the parser to specify which checks should be enforced, much like has already been done for the parsing from WKB/WKT to LWGEOM.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2983 b70326c6-7e19-0410-871a-916f4a2858ee
2008-09-18 13:54:05 +00:00
Mark Cave-Ayland 49b827c8d6 Add some additional LWDEBUG(F) statements for debugging that I missed the first time around with the new debugging infrastructure
git-svn-id: http://svn.osgeo.org/postgis/trunk@2840 b70326c6-7e19-0410-871a-916f4a2858ee
2008-07-13 11:09:34 +00:00
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
Renamed from lwgeom/wktunparse.c (Browse further)