NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello everyone, I have a list of ways and I'd like to get the whole objects (ways with their nodes and coordinates). This operation, if I'm not wrong, should be done with osmium add-locations-to-ways

I can't figure out the right syntax, while I expect to have a list of ways (or an xml file), an extract containing all the geometries needed (e.g. a whole country), and an output file.

In the manual https://docs.osmcode.org/osmium/latest/osmium-add-locations-to-ways.html there are two examples, but I'm a bit confused as just two (instead of 3) file OSM are used.

Thank you, Alessandro

asked 05 Dec '22, 13:46

Ale_Zena_IT's gravatar image

Ale_Zena_IT
11114
accept rate: 0%

edited 05 Dec '22, 21:13


I think you might be after the "osmium getid" command where, from a full OSM data file, you can extract a list of ways which are given by their IDs, and if desired you can extract the required nodes too. -- The add-locations-to-ways thing only means that the node coordinates will be folded into the way object, but still the node information needed for this must be present in the same input file as the ways.

permanent link

answered 05 Dec '22, 13:51

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Hello Frederik, thanks so much for your kind and prompt reply.

Yes, I've run the osmium getid command, but reading the command name add-locations-to-ways I shifted my focus on the latter command.

Reading again the osmium getid help, I realized I missed the recursive -r option.

So, running the command "osmium getid -r -f xml somalia-latest.osm.pbf w128441129 -o way-with-nodes.osm" I've got back the full way with its nodes.

Thank you, Alessandro

permanent link

answered 05 Dec '22, 21:10

Ale_Zena_IT's gravatar image

Ale_Zena_IT
11114
accept rate: 0%

edited 05 Dec '22, 21:10

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×38

question asked: 05 Dec '22, 13:46

question was seen: 1,394 times

last updated: 05 Dec '22, 21:13

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum