[Gdal-dev] Append two shapefiles

Ed McNierney ed at topozone.com
Mon Dec 5 15:19:12 EST 2005


Alex -

The "2 additional fields" means that the DBF file (attributes) has two
columns in one file that aren't in the other.  The DBF file can be
edited by itself using any DBF editor (Microsoft Excel will work on
Windows).  Add two columns to the "short" DBF file and save the edited
version.  You should then have two matching shapefiles that you can
concatenate.

	- Ed

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
ed at topozone.com
(978) 251-4242  

-----Original Message-----
From: gdal-dev-bounces at lists.maptools.org
[mailto:gdal-dev-bounces at lists.maptools.org] On Behalf Of Alex Mandel
Sent: Monday, December 05, 2005 2:27 PM
To: gdal-dev at lists.maptools.org
Subject: [Gdal-dev] Append two shapefiles

Goal: Append two shapefiles together. One of the shapefiles has 2
additional fields(shp2).

Current attempt to get ogr2ogr to work on the commandline as an interem
solution fails. I can't seem to get the syntax right; ogr2ogr -update
-append -f "ESRI Shapefile" 
"C:\Boxes\sandbox\one\shp1.shp" "C:\Boxes\sandbox\two\shp2.shp"
Fails to create file
Fails to open Shapefile

ogr2ogr -update -append "C:\Boxes\sandbox\three\rapix3.shp" 
"C:\Boxes\sandbox\two\rapix2.shp" -nln "C:\Boxes\sandbox\three\rapix3" 
"C:\Boxes\sandbox\two\rapix2"
Exits with no error, but doesn't do anything either.

Preferable solution is to hook into a python module in the FWtools or
GDAL but I haven't figured out how to import ogr.py yet it since import
gdal returns an error Numeric not found and I havne't quite fiqured out
how to import from the FWtools, I tried copying the pymod folder to my
sites-packages but I guess that doesn't work because there's no
__init__.py, maybe I should just make one?

Thanks,
Alex

PS: Everything must work on a windows machine, the only compilers I have
access to are Cygwin & MinGW not that I know how work them right.
_______________________________________________
Gdal-dev mailing list
Gdal-dev at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/gdal-dev




More information about the Gdal-dev mailing list