-b=<x1>,<y1>,<x2>,<y2>
If you want to limit the geographical region, you can define a bounding box. To do this, enter the
southwestern and the northeastern corners of that area. For example: -b=-0.5,51,0.5,52
-B=<border_polygon>
Alternatively to a bounding box you can use a border polygon to limit the geographical region.
The format of a border polygon file can be found in the OSM Wiki:
https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format
You do not need to strictly follow the format description, you must ensure that every line of
coordinates starts with blanks.
--complete-ways
If applying a border box or a border polygon, all nodes the borders are excluded; even then if
they belong to a way which is not entirely excluded because it has some nodes inside the borders.
This option will ensure that every way stays complete, even it it intersects the borders. This
will result in slower processing, and the program will loose its ability to read from standard
input. It is recommended to use .o5m format as input format to compensate most of the speed
disadvantage.
--complex-multipolygons, --complex-boundaries
Same as before, but multipolygons resp. boundaries will not be cut at the borders too.
--all-to-nodes
Some applications do not have the ability to process ways or relations, they just accept nodes as
input. However, more and more complex object are mapped as ways or even relations in order to get
all their details into the database. Apply this option if you want to convert ways and relations
to nodes and thereby make them available to applications which can only deal with nodes. For each
way a node is created. The way's id is increased by 10^15 and taken as id for the new node. The
node's longitude and latitude are set to the way's geographical center. Same applies to relations,
however they get 2*10^15 as id offset.
--add-bbox-tags
This option adds a tag with a bounding box to each object. The tag will contain the border
coordinates in this order: min Longitude, min Latitude, max Longitude , max Latitude. e.g.: <tag
k="bBox" v="-0.5000,51.0000,0.5000,52.0000"/>
--add-bboxarea-tags
A tag for an estimated area value for the bbox is added to each way and each relation. The unit is
square meters. For example: <tag k="bBoxArea" v="33828002"/>
--add-bboxweight-tags
This option will add the binary logarithm of the bbox area of each way and each relation. For
example: <tag k="bBoxWeight" v="20"/>
--add-bboxwidth-tags
A tag for an estimated width value for the bbox is added to each way and each relation. The unit
is meters. For example: <tag k="bBoxWidth" v="825"/>
--add-bboxwidthweight-tags
This option will add the binary logarithm of the bbox width of each way and each relation. For
example: <tag k="bBoxWidthWeight" v="10"/>
--object-type-offset=<id offset>
If applying the --all-to-nodes option as explained above, you may adjust the id offset. For
example: --object-type-offset=4000000000
By appending "+1" to the offset, the program will create ids in a sequence with step 1. This might
be useful if the there is a subsequently running application which cannot process large id
numbers. Example:
--object-type-offset=1900000000+1
--drop-broken-refs
Use this option if you need to delete references to nodes which have been excluded because lying
outside the borders (mandatory for some applications, e.g. Map Composer, JOSM).
--drop-author
For most applications the author tags are not needed. If you specify this option, no author
information will be written: no changeset, user or timestamp.
--drop-version
If you want to exclude not only the author information but also the version number, specify this
option.
--drop-nodes--drop-ways--drop-relations
According to the combination of these parameters, no members of the referred section will be
written.
--modify-tags=<tag_modification_list>
The tag modification list determines which tags will be modified. The example --modify-tags="highway=primaryto=secondary" will change every "primary" highway into "secondary". You
can also use comparisons or add additional tags: --modify-way-tags="maxspeed>200addhighspeed=yes"--modify-node-tags=TAG_MODIFICATION_LIST--modify-way-tags=TAG_MODIFICATION_LIST--modify-relation-tags=TAG_MODIFICATION_LIST--modify-node-way-tags=TAG_MODIFICATION_LIST--modify-node-relation-tags=TAG_MODIFICATION_LIST--modify-way-relation-tags=TAG_MODIFICATION_LIST
Same as above, but just for the specified object types.
--diff
Calculate difference between two files and create a new .osc or .o5c file. There must be TWO
input files and borders cannot be applied. Both files must be sorted by object type and id.
Created objects will appear in the output file as "modified", unless having version number 1.
--diff-contents
Similar to --diff, this option calculates differences between two OSM files. Here, to determine
the differences complete OSM objects are consulted, not only the version numbers. Unfortunately,
this option strictly requires both input files to have .o5m format.
--subtract
The output file will not contain any object which exists in one of the input files following this
directive. For example: osmconvert input.o5m --subtract minus.o5m -o=output.o5m
--pbf-granularity=<val>
Rarely .pbf files come with non-standard granularity. osmconvert will recognize this and suggest
to specify the abnormal lon/lat granularity using this command line option. Allowed values are:
100 (default), 1000, 10000, ..., 10000000.
--emulate-osmosis--emulate-pbf2osm
In case of .osm output format, the program will try to use the same data syntax as Osmosis, resp.
pbf2osm.
--fake-author
If you have dropped author information (--drop-author) that data will be lost, of course. Some
programs however require author information on input although they do not need that data. For this
purpose, you can fake the author information. osmconvert will write changeset 1, timestamp 1970.
--fake-version
Same as --fake-author, but - if .osm xml is used as output format - only the version number will
be written (version 1). This is useful if you want to inspect the data with JOSM.
--fake-lonlat
Some programs depend on getting longitude/latitude values, even when the object in question shall
be deleted. With this option you can have osmconvert to fake these values:
... lat="0" lon="0" ...
Note that this is for XML files only (.osc and .osh).
-h
Display a short parameter overview.
--help
Display this help.
--merge-versions
Some .osc files contain different versions of one object. Use this option to accept such
duplicates on input.
--out-osm
Data will be written in .osm format. This is the default output format.
--out-osc
The OSM Change format will be used for output. Please note that OSM objects which are to be
deleted will be represented by their ids only.
--out-osh
For every OSM object, the appropriate 'visible' tag will be added to meet 'full planet history'
specification.
--out-o5m
The .o5m format will be used. This format has the same structure as the conventional .osm format,
but the data are stored as binary numbers and are therefore much more compact than in .osm format.
No packing is used, so you can pack .o5m files using every file packer you want, e.g. lzo, bz2,
etc.
--out-o5c
This is the change file format of .o5m data format. All <delete> tags will not be performed as
delete actions but converted into .o5c data format.
--out-pbf
For output, PBF format will be used.
--out-csv
A character separated list will be written to output. The default separator is Tab, the default
columns are: type, id, name. You can change both by using the options --csv-separator= and --csv=--csv-headline
Choose this option to print a headline to csv output.
--csv-separator=<sep>
You may change the default separator (Tab) to a different character or character sequence. For
example: --csv-separator="; "
--csv=<columns>
If you want to have certain columns in your csv list, please specify their names as shown in this
example: --csv="@id name ref description" There are a few special column names for header data:
@otype (object type 0..2), @oname (object type name), @id @lon, @lat, @version, @timestamp,
@changeset, @uid, @user
--out-none
This will be no standard output. This option is for testing purposes only.
--timestamp=<date_and_time> --timestamp=NOW<seconds_relative_to_now>
If you want to set the OSM timestamp of your output file, supply it with this option. Date and
time must be formatted according OSM date/time specifications. For example:
--timestamp=2011-01-31T23:59:30ZYoualsocansupplyarelativetimeinseconds,e.g.24hago:--timestamp=NOW-86400--out-timestamp
With this option set, osmconvert prints just the time stamp of the input file, nothing else.
--statistics
This option activates a statistics counter. The program will print statistical data to stderr.
--out-statistics
Same as --statistics, but the statistical data will be written to standard output.
-o=<outfile>
Standard output will be rerouted to the specified file. If no output format has been specified,
the program will rely on the file name extension.
-t=<tempfile>
If borders are to be applied or broken references to be eliminated, osmconvert creates and uses
two temporary files. This parameter defines their name prefix. The default value is
"osmconvert_tempfile".
--parameter-file=FILE
If you want to supply one ore more command line arguments by a parameter file, please use this
option and specify the file name. Within the parameter file, parameters must be separated by empty
lines. Line feeds inside a parameter will be converted to spaces. Lines starting with "// " will
be treated as comments.
-v--verbose
With activated 'verbose' mode, some statistical data and diagnosis data will be displayed. If -v
resp. --verbose is the first parameter in the line, osmconvert will display all input parameters.