Commit graph

269 commits

Author SHA1 Message Date
Paul Ramsey 9006239c0f Add variable decls to trunk :)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3750 b70326c6-7e19-0410-871a-916f4a2858ee
2009-02-19 21:12:22 +00:00
Paul Ramsey 5a578a7217 Add EOF marker, per GBT#105
git-svn-id: http://svn.osgeo.org/postgis/trunk@3749 b70326c6-7e19-0410-871a-916f4a2858ee
2009-02-19 20:59:31 +00:00
Paul Ramsey 60a6511ce2 Demote new loader code from default build for now.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3682 b70326c6-7e19-0410-871a-916f4a2858ee
2009-02-10 20:10:53 +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
Paul Ramsey 49a79bbcf6 Use "extended string" format for escaping \ and ' in insert statements.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3623 b70326c6-7e19-0410-871a-916f4a2858ee
2009-02-03 07:20:16 +00:00
Regina Obe 57d0d4bd2f Fix DBFReadDeleted logic -- should return 1 if record is deleted and 0 if it is not deleted
git-svn-id: http://svn.osgeo.org/postgis/trunk@3561 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-22 18:19:08 +00:00
Paul Ramsey 8f40b03052 Put translation_stage into descriptive MACRO names
git-svn-id: http://svn.osgeo.org/postgis/trunk@3544 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-20 18:43:50 +00:00
Paul Ramsey 6b2bb990a3 Replace hand-built pkg-config routine w/ m4 from gtk source.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3542 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-20 17:48:44 +00:00
Paul Ramsey ce54e4aadf Compile your work much?
git-svn-id: http://svn.osgeo.org/postgis/trunk@3541 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-20 07:36:49 +00:00
Paul Ramsey da27e2b70e Protect the filename setting a little bit more in case it's NULL.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3540 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-20 07:13:23 +00:00
Paul Ramsey 1893da945c First revision of the GUI. Configure using --with-gui to enable full GUI build. New core/cli will build by default. Old utilities remain in place for now.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3538 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-19 21:33:14 +00:00
Paul Ramsey e35e08942e Remove double-free problem from loader in presence of new deep-freeing lwfree calls.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3519 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-12 19:29:57 +00:00
Paul Ramsey 6744f68423 Rename lwfree_* to *_free.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3510 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-09 17:41:23 +00:00
Paul Ramsey f59409b80b Remove memory leak in standard loader.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3495 b70326c6-7e19-0410-871a-916f4a2858ee
2009-01-07 01:16:40 +00:00
Mark Cave-Ayland d017c50ee9 Remove the PostGIS LWGEOM type constants from pgsql2shp - they are no longer needed here as they are included as part of liblwgeom.h.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3451 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-19 14:59:25 +00:00
Paul Ramsey 78c109c5c4 Complete the pfree_ to lwfree_ renaming.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3450 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-18 20:42:09 +00:00
Paul Ramsey 4dc0a4cf91 Rename pfree_* memory management function lwfree_*
git-svn-id: http://svn.osgeo.org/postgis/trunk@3447 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-18 20:30:30 +00:00
Regina Obe 97f10ad866 minor comment addition
git-svn-id: http://svn.osgeo.org/postgis/trunk@3410 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-15 13:36:56 +00:00
Regina Obe 267d66e428 use strcmp for compare instead of comparing first element in projcreate
git-svn-id: http://svn.osgeo.org/postgis/trunk@3390 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-12 16:26:29 +00:00
Regina Obe 94a2c16e4a Incorporated Mark's suggestion to use PQescapeStringConn instead of building a custom function. Also fixed typo. Note using free() instead of PQfree since couldn't find a PQfree. I looked at the 8.3.5 postgresql source code base, and that's what they seem to use when releasing buffer space.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3377 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-11 15:56:18 +00:00
Regina Obe 6b076145a9 #HISTORY: #GBT:34 - .prj creation by pgsql2shp
git-svn-id: http://svn.osgeo.org/postgis/trunk@3363 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-05 13:46:50 +00:00
Mark Cave-Ayland 47029e9ebc Fix GBT#79: shp2pgsql does not honor -s (also known as Mark accidentally missed the sr_id from the geometry constructors)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3359 b70326c6-7e19-0410-871a-916f4a2858ee
2008-12-03 17:12:54 +00:00
Mark Cave-Ayland 2f34304910 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3236 b70326c6-7e19-0410-871a-916f4a2858ee
2008-11-04 10:00:39 +00:00
Mark Cave-Ayland f517878e4d 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3235 b70326c6-7e19-0410-871a-916f4a2858ee
2008-11-04 09:57:03 +00:00
Mark Cave-Ayland 4135d821fd Add missing ICONV_LDFLAGS variable to the loader Makefile. Thanks to Olivier Courtin for noticing.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3225 b70326c6-7e19-0410-871a-916f4a2858ee
2008-11-03 16:23:45 +00:00
Mark Cave-Ayland 34e9e3263c Switch pgsql2shp over to using liblwgeom.
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. 



git-svn-id: http://svn.osgeo.org/postgis/trunk@3224 b70326c6-7e19-0410-871a-916f4a2858ee
2008-11-03 16:17:57 +00:00
Mark Cave-Ayland 38babbcb8f Some more shp2pgsql clearups; remove some dead commented code and switch over to use the LWDEBUG(F) debugging framework.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3222 b70326c6-7e19-0410-871a-916f4a2858ee
2008-10-31 10:04:58 +00:00
Mark Cave-Ayland bfb072826b 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 ;)



git-svn-id: http://svn.osgeo.org/postgis/trunk@3217 b70326c6-7e19-0410-871a-916f4a2858ee
2008-10-30 17:10:44 +00:00
Mark Cave-Ayland e83d625fe1 After several discussions at PGDay, it seems that the only use-case for the PGXS PROGRAM clause is for programs that wish to link with the backend libraries. Hence create a new Makefile for the loader directory which uses the new autoconf infrastructure, based upon library and dependency lists from the original 1.3 branch.
git-svn-id: http://svn.osgeo.org/postgis/trunk@3143 b70326c6-7e19-0410-871a-916f4a2858ee
2008-10-19 14:52:29 +00:00
Mark Cave-Ayland 244c935729 Alter the lwgeom Makefile so that liblwgeom.a is linked directly, rather than using the -L...-l options on the command line. This is to prevent problems on OSX where PGXSadds the PostgreSQL $libdir to the PostGIS link line, causing it to link to liblwgeom.so produced by older versions of PostGIS rather than the static liblwgeom.a.
Also change the PGXS CPP/LIB equivalent variables to use += so that extra compile/link options can be supplied. Per report from Robert Rainthorpe, with thanks to William Kyngesburye.



git-svn-id: http://svn.osgeo.org/postgis/trunk@2918 b70326c6-7e19-0410-871a-916f4a2858ee
2008-08-21 08:45:07 +00:00
Mark Cave-Ayland 4eec27c992 Allow Makefile substitutions for PGCONFIG which are required if pg_config is not located in the path. Note that as part of this fix, we now need to generate topology/Makefile using autoconf. Thanks to Jorgen Austvik for the report and partial patch.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2885 b70326c6-7e19-0410-871a-916f4a2858ee
2008-07-28 10:03:31 +00:00
Mark Cave-Ayland e3af7ccce5 Update new Makefile copyrights, also remove compat.h from the loader/ directory since it is now no longer needed.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2805 b70326c6-7e19-0410-871a-916f4a2858ee
2008-06-05 14:47:31 +00:00
Mark Cave-Ayland efad7bcb9e Remove PQunescapeBytea hack from pgsql2shp which is no longer needed, as it was only required for versions of PostgreSQL < 7.3
git-svn-id: http://svn.osgeo.org/postgis/trunk@2801 b70326c6-7e19-0410-871a-916f4a2858ee
2008-06-05 11:07:40 +00:00
Mark Cave-Ayland 020c2c5314 Remove extra warnings related to the shp2pgsql deleted records patch
git-svn-id: http://svn.osgeo.org/postgis/trunk@2785 b70326c6-7e19-0410-871a-916f4a2858ee
2008-05-27 15:08:20 +00:00
Mark Cave-Ayland c8c98e13ab Update new build system to include iconv detection for shp2pgsql
git-svn-id: http://svn.osgeo.org/postgis/trunk@2784 b70326c6-7e19-0410-871a-916f4a2858ee
2008-05-27 14:47:06 +00:00
Paul Ramsey c003fcb382 Fix for DBF files with deleted records. (#29)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2783 b70326c6-7e19-0410-871a-916f4a2858ee
2008-05-27 03:00:12 +00:00
Mark Cave-Ayland cee1f271e5 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2774 b70326c6-7e19-0410-871a-916f4a2858ee
2008-05-14 17:10:19 +00:00
Paul Ramsey dda4f481e0 New -n switch to support DBF-only loading of attributes without shapes.
Submitted by Regina Obe.


git-svn-id: http://svn.osgeo.org/postgis/trunk@2764 b70326c6-7e19-0410-871a-916f4a2858ee
2008-04-12 16:44:55 +00:00
Paul Ramsey 15f227436b 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


git-svn-id: http://svn.osgeo.org/postgis/trunk@2762 b70326c6-7e19-0410-871a-916f4a2858ee
2008-04-10 14:44:26 +00:00
Paul Ramsey 479d0b8054 Change sr_id into an integer, per mca's suggestion.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2760 b70326c6-7e19-0410-871a-916f4a2858ee
2008-04-09 19:52:19 +00:00
Paul Ramsey 9a06f4b121 Fix string literal comparison warnings: "comparison with string literal results in
unspecified behaviour"


git-svn-id: http://svn.osgeo.org/postgis/trunk@2759 b70326c6-7e19-0410-871a-916f4a2858ee
2008-04-08 21:36:50 +00:00
Paul Ramsey 6c6a4e3bee Rename all occurances of getopt to pgis_getopt to work around
OS/X 10.5 system function name collision.


git-svn-id: http://svn.osgeo.org/postgis/trunk@2758 b70326c6-7e19-0410-871a-916f4a2858ee
2008-04-07 20:09:48 +00:00
Mark Cave-Ayland 55bb8de2d3 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2726 b70326c6-7e19-0410-871a-916f4a2858ee
2008-01-11 15:04:05 +00:00
Mark Cave-Ayland 723938663d 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2717 b70326c6-7e19-0410-871a-916f4a2858ee
2007-11-23 10:42:09 +00:00
Mark Cave-Ayland d6d58efee5 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.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2715 b70326c6-7e19-0410-871a-916f4a2858ee
2007-10-29 16:29:58 +00:00
Mark Leslie 369b892a5a Updated the loader to create the index after the data has been loaded.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2667 b70326c6-7e19-0410-871a-916f4a2858ee
2007-07-23 16:29:40 +00:00
Mark Leslie c0f439fc1c Upgraded the escaping of quotes from the deprecated backslashing to the doubling of quotes.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2662 b70326c6-7e19-0410-871a-916f4a2858ee
2007-07-16 18:06:32 +00:00
Mark Cave-Ayland ec2bcb7231 Rollback experimental shp2pgsql escaping change that accidently got included in the last commit :(
git-svn-id: http://svn.osgeo.org/postgis/trunk@2657 b70326c6-7e19-0410-871a-916f4a2858ee
2007-07-13 05:48:32 +00:00
Mark Cave-Ayland e03234e557 Correct previous commit for older PostgreSQL versions - the order of the methods in PROJ4SRSCacheContextMethods is not consistent between versions.
git-svn-id: http://svn.osgeo.org/postgis/trunk@2656 b70326c6-7e19-0410-871a-916f4a2858ee
2007-07-13 05:42:46 +00:00
Markus Schaber 80ec5d842c sanitized usage info output on loader/dumper
git-svn-id: http://svn.osgeo.org/postgis/trunk@2513 b70326c6-7e19-0410-871a-916f4a2858ee
2006-10-14 14:22:10 +00:00