Basic Editing Geoprocessing Tools in QGIS
How to remove the overlapping part of polygons?
Merge Shapefile polygons using Quantum GIS
Merge shape files
ogr2ogr -lco ENCODING=UTF-8 -f 'ESRI Shapefile' merge.shp ne_10m_admin_0_countries.shp
next merge another shape file with merge.shp
ogr2ogr -f 'ESRI Shapefile' -update -append merge.shp ne_10m_admin_0_disputed_areas.shp -nln merge
Where
output file format name, some possible values are:
-f "ESRI Shapefile" -f "TIGER" -f "MapInfo File" -f "GML" -f "PostgreSQL"
Append to existing layer instead of creating new
Delete the output layer and recreate it empty
Open existing output datasource in update mode rather than trying to create a new one
Comma-delimited list of fields from input layer to copy to the new layer. A field is skipped if mentioned previously in the list even if the input layer has duplicate field names. (Defaults to all; any field is skipped if a subsequent field with same name is found.) Starting with OGR 1.11, geometry fields can also be specified in the list.
Assign an alternate name to the new layer
#!/bin/bash
file="./final/merge.shp"
for i in $(ls *.shp)
do
if [ -f "$file" ]
then
echo "creating final/merge.shp"
ogr2ogr -f 'ESRI Shapefile' -update -append $file $i -nln merge
else
echo "merging……"
ogr2ogr -f 'ESRI Shapefile' $file $i -lco ENCODING=UTF-8
fi
done
ogr2ogr -f "GeoJSON" w.geojson merge.shp
select only required fields
ogr2ogr -select NAME,ISO_A2 -f "GeoJSON" world_with_ant.geojson merge.shp
select and where
ogr2ogr -select NAME,ISO_A2 -where 'ISO_A2!="AQ"' -f "GeoJSON" world_without_ant.geojson merge.shp
geo2topo input.geojson > output.topojson