[Gdal-dev] Append two shapefiles

Alex Mandel tech_dev at wildintellect.com
Mon Dec 5 14:26:56 EST 2005


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.



More information about the Gdal-dev mailing list