Wednesday, 13 November 2019

qgis - Using open source software to merge large shapefiles?


Some background: I have 2 polygon shape files with approximately 500,000 records each. The two files are identical in terms of field structure.


Using ArcGIS 10.0 I can'nt merge these two files using Geoprocessing / Merge. ArcMap allways crashes somewhere in the middle of the process.


Is there any open source software that can do this job? QGIS has the function: Vector/ Merging shape file into one , but there was a reported bug with this function in the current version 1.7. I know GDAL can do a lot of things and wonder if GDAL or some other opensource software can do this properly.



Answer



From the GDAL manual:



A merge of two shapefiles 'file1.shp' and 'file2.shp' into a new file 'file_merged.shp' is performed like this:


% ogr2ogr file_merged.shp file1.shp
% ogr2ogr -update -append file_merged.shp file2.shp -nln file_merged

The second command is opening file_merged.shp in update mode, and trying to find existing layers and append the features being copied.


The -nln option sets the name of the layer to be copied to.


http://www.gdal.org/ogr/drv_shapefile.html


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...