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

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 '20, 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 '20, 22:31) DaveF

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 '20, 01:17

DaveF's gravatar image

DaveF
3.3k8498133
accept rate: 16%

edited 26 Jan '20, 11:24

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 '20, 23:22

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

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:

×483
×132
×78
×24

question asked: 25 Jan '20, 22:08

question was seen: 3,401 times

last updated: 26 Jan '20, 11:24

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