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

Extract (lat, long) of nodes surrounding a building through API call

0

Hi

I am trying to find a way to automatically export the (lat, long) of the nodes associated with the perimeter of a given building without using the UI, completely through API. The ideal solution would be given an address of a building (way with tag building in OSM terms) to fetch the (lat, long)s of the associated nodes in an XML or plain text file.

Any insights? Kris

asked 09 May '18, 14:11

hectorlavoe's gravatar image

hectorlavoe
21112
accept rate: 0%


One Answer:

2

The standard API call

http://api.openstreetmap.org/api/0.6/way/put_way_id_here/full

returns an XML containing the way and all its nodes, though the order of the nodes in the response might be different from the order in which they have to be traversed to form the line (i.e. you will have to traverse them in the right order as given in the way object).

answered 09 May '18, 14:48

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Thanks Frederik! That seems to be really helpful! However, the link gives me a 404 error. Could you please re-post?

Many thanks, Kris

(14 May '18, 15:03) hectorlavoe

You need to replace put_way_id_here with the way ID of your building.

(14 May '18, 15:05) scai ♦

Great, that's super neat! Thank you.

(30 May '18, 10:16) hectorlavoe