← 返回命令列表

Linux command

osmconvert 命令

文本

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

常用示例

Convert PBF to OSM XML

osmconvert [input.pbf] -o=[output.osm]

Convert OSM to PBF

osmconvert [input.osm] -o=[output.pbf]

Extract bounding box

osmconvert [input.pbf] -b=[lon1,lat1,lon2,lat2] -o=[output.pbf]

Filter by polygon

osmconvert [input.pbf] -B=[polygon.poly] -o=[output.pbf]

Merge files

osmconvert [file1.pbf] [file2.pbf] -o=[merged.pbf]

Show statistics

osmconvert [input.pbf] --out-statistics

说明

osmconvert converts and filters OpenStreetMap data files. It handles conversion between OSM XML, PBF, and O5M formats, and can extract regions by bounding box or polygon.

参数

-o _file_
Output file.
-b _bbox_
Bounding box filter.
-B _file_
Polygon file filter.
--drop-author
Remove author info.
--drop-version
Remove version info.
--complete-ways
Keep complete ways.
--out-statistics
Show statistics.

FAQ

What is the osmconvert command used for?

osmconvert converts and filters OpenStreetMap data files. It handles conversion between OSM XML, PBF, and O5M formats, and can extract regions by bounding box or polygon.

How do I run a basic osmconvert example?

Run `osmconvert [input.pbf] -o=[output.osm]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -o _file_ do in osmconvert?

Output file.