.TH "OSMIUM-RENUMBER" "1" "1.5.1" "" "" .SH NAME .PP osmium\-renumber \- renumber object IDs .SH SYNOPSIS .PP \f[B]osmium renumber\f[] [\f[I]OPTIONS\f[]] \f[I]OSM\-DATA\-FILE\f[] .SH DESCRIPTION .PP The objects (nodes, ways, and relations) in an OSM file often have very large IDs. This can make some kinds of postprocessing difficult. This command will renumber all objects using IDs starting at 1. Referential integrity will be kept. All objects which appear in the source file will be in the same order in the output file. IDs of objects which are not in the file but referenced from ways or relations are not guaranteed to be in the correct order. .PP This command expects the input file to be ordered in the usual way: First nodes in order of ID, then ways in order of ID, then relations in order of ID. The input file will be read twice, so it will not work with STDIN. .PP Currently this command can not renumber negative IDs. .PP You must never upload the data generated by this command to OSM! This would really confuse the OSM database because it knows the objects under different IDs. .SH OPTIONS .TP .B \-i, \-\-index\-directory=DIR Directory where the index files for mapping between old and news IDs are read from and written to, respectively. Use this if you want to map IDs in several OSM files. Without this option, the indexes are not read from or written to disk. The directory must exist. Use \[aq].\[aq] for the current directory. The files written will be named \f[C]nodes.idx\f[], \f[C]ways.idx\f[], and \f[C]relations.idx\f[]. See also the \f[B]INDEX FILES\f[] section below. .RS .RE .TP .B \-t, \-\-object\-type=TYPE Renumber only objects of given type (\f[I]node\f[], \f[I]way\f[], or \f[I]relation\f[]). By default all objects of all types are renumbered. This option can be given multiple times. .RS .RE .SH COMMON OPTIONS .TP .B \-h, \-\-help Show usage help. .RS .RE .TP .B \-v, \-\-verbose Set verbose mode. The program will output information about what it is doing to \f[I]stderr\f[]. .RS .RE .TP .B \-\-progress Show progress bar. Usually a progress bar is only displayed if STDERR is detected to be a TTY. With this option a progress bar is always shown. Note that a progress bar will never be shown when reading from STDIN or a pipe. .RS .RE .TP .B \-\-no\-progress Do not show progress bar. Usually a progress bar is displayed if STDERR is detected to be a TTY. With this option the progress bar is suppressed. Note that a progress bar will never be shown when reading from STDIN or a pipe. .RS .RE .SH INPUT OPTIONS .TP .B \-F, \-\-input\-format=FORMAT The format of the input file(s). Can be used to set the input format if it can\[aq]t be autodetected from the file name(s). This will set the format for all input files, there is no way to set the format for some input files only. See \f[B]osmium\-file\-formats\f[](5) or the libosmium manual for details. .RS .RE .SH OUTPUT OPTIONS .TP .B \-f, \-\-output\-format=FORMAT The format of the output file. Can be used to set the output file format if it can\[aq]t be autodetected from the output file name. See \f[B]osmium\-file\-formats\f[](5) or the libosmium manual for details. .RS .RE .TP .B \-\-fsync Call fsync after writing the output file to force flushing buffers to disk. .RS .RE .TP .B \-\-generator=NAME The name and version of the program generating the output file. It will be added to the header of the output file. Default is "\f[I]osmium/\f[]" and the version of osmium. .RS .RE .TP .B \-o, \-\-output=FILE Name of the output file. Default is \[aq]\-\[aq] (STDOUT). .RS .RE .TP .B \-O, \-\-overwrite Allow an existing output file to be overwritten. Normally \f[B]osmium\f[] will refuse to write over an existing file. .RS .RE .TP .B \-\-output\-header=OPTION Add output header option. This option can be given several times. See the \f[I]libosmium manual\f[] for a list of allowed header options. .RS .RE .SH INDEX FILES .PP When the \f[C]\-i\f[] or \f[C]\-\-index\-directory\f[] option is used, index files named \f[C]nodes.idx\f[], \f[C]ways.idx\f[], and \f[C]relations.idx\f[] are read from and written to the given directory. This can be used to force consistent mapping over several invocations of \f[C]osmium\ renumber\f[], for instance when you want to remap an OSM data file and a corresponding OSM change file. .PP The index files are in binary format, but you can use the following command line to convert them into something readable: .IP .nf \f[C] od\ \-An\ \-td8\ \-w8\ TYPE.idx\ |\ cat\ \-n \f[] .fi .SH DIAGNOSTICS .PP \f[B]osmium renumber\f[] exits with exit code .TP .B 0 if everything went alright, .RS .RE .TP .B 1 if there was an error processing the data, or .RS .RE .TP .B 2 if there was a problem with the command line arguments. .RS .RE .SH MEMORY USAGE .PP \f[B]osmium renumber\f[] needs quite a bit of main memory to keep the mapping between old and new IDs. It is intended for small to medium sized extracts. You will need more than 32 GB RAM to run this on a full planet. .PP Memory use is at least 8 bytes per node, way, and relation ID in the input file. .SH EXAMPLES .PP Renumber a PBF file and output to a compressed XML file: .IP .nf \f[C] osmium\ renumber\ \-o\ ch.osm.bz2\ germany.osm.pbf \f[] .fi .PP Renumbering Germany currently (spring 2016) takes less than three minutes and needs about 3 GB RAM. .PP Renumber an OSM file storing the indexes on disk: .IP .nf \f[C] osmium\ renumber\ \-i.\ \-o\ renumbered.osm\ data.osm \f[] .fi .PP then rewrite a change file, too: .IP .nf \f[C] osmium\ renumber\ \-i.\ \-o\ renumbered.osc\ changes.osc \f[] .fi .SH SEE ALSO .IP \[bu] 2 \f[B]osmium\f[](1), \f[B]osmium\-file\-formats\f[](5) .IP \[bu] 2 Osmium website (http://osmcode.org/osmium-tool/) .SH COPYRIGHT .PP Copyright (C) 2013\-2017 Jochen Topf . License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH CONTACT .PP If you have any questions or want to report a bug, please go to http://osmcode.org/contact.html .SH AUTHORS Jochen Topf .