I love the feature of seeing polygon in the OpenStreetMap. Firstly I like to say, I appreciate it:)

My question is, is there any possibility extracting the lat-long variables of each corner of the polygon?

alt text

asked 31 May '19, 12:46

donniedarko123's gravatar image

donniedarko123
31335
accept rate: 0%

hey i want to get the polygon of some cities in a country how can i do that eny help please

(26 May, 18:21) assia

Hi @assia. What of those answers given here have you tried already? If you still got questions please create a new question with a bit more details.

(26 May, 19:37) TZorn

@TZorn hi, i have the osm of full morocco , and i want to keep only the cities in this country, but i couldn't find, any help please i'm stuck here for days

(28 May, 11:18) assia

What do you mean by "extracting" exactly? Do you want to get the coordinates of this one building? Then all you have to do is click on the nodes listed on the bottom of the left hand side panel and you see the coordinates there.

If you want to do it more regularly you are probably looking for a more automated solution. You have to know that the database does not store coordinates for the polygons. Only references to the nodes that make up the polygon are stored and the coordinates are then stored for the nodes. Click on the download XML links at the left hand bottom of the building's and its nodes' pages and you see what I mean.

Depending on your needs and skills you can for example directly query the OSM API, use Overpass Turbo or use JOSM to export the object into a gpx file.

permanent link

answered 31 May '19, 13:23

TZorn's gravatar image

TZorn
10.3k552191
accept rate: 13%

@TZorn thank you, overpass api solved my question. Just if someone will have the same question, here is links that I used for it: link1, link2

(04 Jun '19, 16:38) donniedarko123

Yes, you have to use an API call for that:

https://www.openstreetmap.org/api/0.6/way/111659641/full

permanent link

answered 31 May '19, 13:09

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
77.5k886901200
accept rate: 24%

Your answer
toggle preview

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:

×85
×40
×12

question asked: 31 May '19, 12:46

question was seen: 4,124 times

last updated: 28 May, 12:23

powered by OSQA