← 返回命令列表

Linux command

ogrmerge.py 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Merge shapefiles

ogrmerge.py -o [output.shp] [input1.shp] [input2.shp]

Merge to GeoPackage

ogrmerge.py -f GPKG -o [output.gpkg] [*.shp]

Merge with single layer

ogrmerge.py -single -o [output.shp] [*.shp]

Overwrite output

ogrmerge.py -overwrite_ds -o [output.shp] [input*.shp]

Assign coordinate reference system

ogrmerge.py -a_srs [EPSG:4326] -o [output.shp] [*.shp]

Merge with source layer name as field

ogrmerge.py -single -src_layer_field_name [source] -o [output.gpkg] [*.shp]

说明

ogrmerge.py merges vector datasets. Combines multiple files into one. The script consolidates geospatial data. Part of GDAL Python utilities.

参数

-o _FILE_
Output file.
-f _FORMAT_
Output format.
-single
Merge into single layer.
-overwrite_ds
Overwrite existing output.
-a_srs _SRS_
Assign coordinate reference system.
-src_layer_field_name _NAME_
Add a field with the source layer name (useful with -single).
-src_layer_field_content _CONTENT_
Specify content for the source layer field.
-nln _NAME_
Name for the merged output layer (used with -single).
--help
Display help information.

FAQ

What is the ogrmerge.py command used for?

ogrmerge.py merges vector datasets. Combines multiple files into one. The script consolidates geospatial data. Part of GDAL Python utilities.

How do I run a basic ogrmerge.py example?

Run `ogrmerge.py -o [output.shp] [input1.shp] [input2.shp]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _FILE_ do in ogrmerge.py?

Output file.