How can I get a list of all streets and their respective street number from an input polygon (not rectangular) that is defined as langitude and longitude from a csv file? Probably would want to work with overpass api and python here.

asked 25 Jan, 22:08

montagsmodell's gravatar image

montagsmodell
11112
accept rate: 0%

Are the co-ordinates in the csv likely to vary or can you copy paste them to Overpass as a one off process?

(25 Jan, 22:31) DaveF

Pass the coordinates in as part of the query:

https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#By_polygon_.28poly.29

I usually use requests (or just urllib.request) to fetch an Overpass-API script from python, I don't rely on any extra module, so I can't say if one of them supports doing the poly filter.

permanent link

answered 25 Jan, 23:22

maxerickson's gravatar image

maxerickson
11.4k1075161
accept rate: 30%

Uncomment the out:csv line to get a list

   //[out:csv("addr:street", "addr:housenumber"; false; ", ")];
    way[highway][name](poly:"51.61268 -0.2871 51.6126 -0.2834 51.6108 -0.2834 51.6108 -0.2871");
    out geom;

    foreach->.highway(
      way[building]
        (around.highway:20)
        ["addr:housenumber"]    
      ;
      out geom;
    );

http://overpass-turbo.eu/s/Q5L

permanent link

answered 26 Jan, 01:17

DaveF's gravatar image

DaveF
1.5k566584
accept rate: 8%

edited 26 Jan, 11: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:

×375
×114
×52
×17

question asked: 25 Jan, 22:08

question was seen: 332 times

last updated: 26 Jan, 11:24

powered by OSQA