[Gdal-dev] Append two shapefiles

Dylan Beaudette dylan.beaudette at gmail.com
Mon Dec 5 20:10:24 EST 2005


hi Alex!

didn't know you were lurking here!

welcome the GDAL land --

lots of good stuff here.


here is how i do it:

ogr2ogr -update -append $merge_file $this_file_to_append -nln $merge_layer 
$this_file_to_append_layer

where the 2nd set of 'layers' are missing the '.shp' suffix.

cheers,

Dylan

On Monday 05 December 2005 11:26 am, Alex Mandel wrote:
> 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

-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341



More information about the Gdal-dev mailing list