OSMIUM-ADD-LOCATIONS-TO-WAYS(1) | OSMIUM-ADD-LOCATIONS-TO-WAYS(1) |
osmium-add-locations-to-ways - add node locations to ways in OSM file
osmium add-locations-to-ways [OPTIONS] OSM-FILE...
Usually only nodes have locations and the ways refer to those locations via the IDs of the nodes. This program will copy the input file(s) to the output, taking the locations from the nodes and adding them to the ways. This makes it easier for other programs to assemble the way geometries.
The input file must contain all nodes needed for the ways, otherwise there will be an error. You can change this behaviour using the --ignore-missing-nodes option.
Nodes without any tags will not be copied (unless the --keep-untagged-nodes/-n option is used). The size of the output file will be similar or a bit smaller than the input file (unless the --keep-untagged-nodes/-n option is used in which case it will be a lot bigger).
Note that the OSM files generated by this command use a non-standard format extension.
The osmium add-locations-to-ways command has to keep an index of the node locations in memory or in a temporary file on disk while doing its work. There are several different ways it can do that which have different advantages and disadvantages. The default is good enough for most cases, but see the osmium-index-types(5) man page for details.
If the --keep-untagged-nodes/-n option is used, files created by this command can be updated with the apply-changes command using the --locations-on-ways option.
This command will not work on full history files.
The command will work with negative IDs. The index types for positive IDs and negative IDs are set separately with the --index-type/-i and --index-type-neg options, respectively.
This commands reads its input file(s) only once and writes its output file in one go so it can be streamed, ie. it can read from STDIN and write to STDOUT.
osmium add-locations-to-ways exits with exit code
osmium add-locations-to-ways will usually keep all node locations in memory. For larger data files, this can need several tens of GBytes of memory. See the osmium-index-types(5) man page for details.
Add node locations to an extract keeping all nodes:
osmium add-locations-to-ways -n -o germany-low.osm.pbf germany.osm.pbf
Add node locations to a planet file (without untagged nodes):
osmium add-locations-to-ways -i dense_mmap_array -o planet-low.osm.pbf planet.osm.pbf
Copyright (C) 2013-2021 Jochen Topf <jochen@topf.org>.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
If you have any questions or want to report a bug, please go to https://osmcode.org/contact.html
Jochen Topf <jochen@topf.org>.
1.13.1 |