This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Getting way-id from its nodes id

1

Hi,

I need to get the id of a "way" when I only have the way's node IDs, at least two such nodes that are given to be associated with, or sit exactly on that way.

What would you recommend as the procedure to achieve this? I'm in-familiar with OSM's API and couldn't find an answer here.

Thanks!

asked 23 Jan '13, 08:20

Boaz's gravatar image

Boaz
26112
accept rate: 0%


One Answer:

1

Try "ways for node" perhaps.

Edit: Sorry, I read "in-familiar" as familiar. So, for example, for node 1818806301

http://api.openstreetmap.org/api/0.6/node/1818806301/ways

answered 23 Jan '13, 08:29

EdLoach's gravatar image

EdLoach ♦
19.5k16156280
accept rate: 22%

edited 23 Jan '13, 08:31

1

that's great, but i'll need locally run, best performance solution. What schema do you recommend for installation and what API package would you use? Also, given the way-id i'll need to create/update a tag for the way. maybe that has implications on the API package. Thanks!

(23 Jan '13, 08:40) Boaz

I saw your discussion on the #osm IRC channel, where I think pgsnapshot schema was recommended. That's beyond me at the moment though as I've not tried it.

(23 Jan '13, 10:18) EdLoach ♦
1

Gotcha. Indeed, that was me on the IRC. I'm going to give the recommendations given through IRC a shot. Thanks!

(23 Jan '13, 12:56) Boaz

Source code available on GitHub .