You are not logged in.
- Topics: Active | Unanswered
Announcement
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***
Pages: 1
#1 2019-10-29 22:22:18
- Nguyenhuy1607
- New Member
- Registered: 2019-10-29
- Posts: 1
How to get all street names of city
Hi all,
Please share for me, How to get all street names of city
Offline
#2 2019-10-30 03:12:48
- luisforte
- Member
- Registered: 2017-09-03
- Posts: 7
Re: How to get all street names of city
The most usual tool to extract data from OSM is by using Overpass (https://overpass-turbo.eu/).
A simple way to get all street names from a place, "Brinches" in the example bellow, consists of a query to the database with something like
[out:csv(highway,name)];
area
[name="Brinches"];
way(area)[highway][name];
out;
Just copy and paste this code to the text area on the left side of the Overpass page, change the name of the place to the place you pretend to evaluate, run the query and select the folder "Data" on the upper right side of the page to see the results.
Last edited by luisforte (2019-10-30 12:54:38)
Offline
#3 2021-09-13 12:40:54
- augustofagioli
- New Member
- Registered: 2021-09-13
- Posts: 1
Re: How to get all street names of city
Cool feature.
When asking for Rome (Italy), a "quota limit" comes out.
What to do?
Offline
#4 2021-09-15 15:08:46
- luisforte
- Member
- Registered: 2017-09-03
- Posts: 7
Re: How to get all street names of city
I ran the query now for area[name="Roma"], it seems to works fine on my computer, I got more than 40,000 street names.
Perhaps the server was busy with other requests at the time you tried to run the query.
But keep in mind that I haven't found any city limits with that name ("Roma"), only the district is named "Roma", so you'll probably get more information than you want, like suburban streets or neighboring villages.
Offline
#5 2021-09-15 17:06:48
- Marek-M
- Member
- From: [PL] Banino
- Registered: 2017-01-24
- Posts: 308
Re: How to get all street names of city
Try to use this query in overpass:
[out:csv ("name")][timeout:2500];
{{geocodeArea:Roma}}->.searchArea;
(
way["highway"]["name"](area.searchArea);
);
for (t["name"])
{
make street name=_.val;
out;
}
https://overpass-turbo.eu/s/1bcc
This query extracts street names list from area without duplicates. This query returns 16715 records for Roma instead of 40000.
Marek-M
Offline
#6 2021-09-18 16:41:43
- niceboshka
- Member
- Registered: 2021-09-18
- Posts: 3
Re: How to get all street names of city
I do
[out:csv ("name")][timeout:2500];
{{geocodeArea:Kaliningrad}}->.searchArea;
(
way["highway"]["name"](area.searchArea);
);
for (t["name"])
{
make street name=_.val;
out;
}
I did not receive the entire list, for example there is no Moscow avenue
Offline
#7 2021-09-18 19:30:03
- Marek-M
- Member
- From: [PL] Banino
- Registered: 2017-01-24
- Posts: 308
Re: How to get all street names of city
Is there a street with this name in Kaliningrad? I can't find it on Opensteetmap. Could you send way ID of this street in OSM?
Last edited by Marek-M (2021-09-18 19:34:23)
Marek-M
Offline
#8 2021-09-18 21:42:05
- niceboshka
- Member
- Registered: 2021-09-18
- Posts: 3
Re: How to get all street names of city
way 297727234
Offline
#9 2021-09-18 21:56:43
- niceboshka
- Member
- Registered: 2021-09-18
- Posts: 3
Re: How to get all street names of city
It's kind of the only street left, because now my list is longer than it was. Thanks for the sample code. I wonder if it is possible to compose a query to get the streets and their geometries? Because now it's like this
I have an array of streets
$response = json_decode(curl('https://nominatim.openstreetmap.org/search?format=json&q=' . urlencode($f['city'] . ', ' . $f['street']) . '&polygon_geojson=1'), true);
Offline
#10 2021-09-18 22:39:53
- Marek-M
- Member
- From: [PL] Banino
- Registered: 2017-01-24
- Posts: 308
Re: How to get all street names of city
way 297727234
Using your query for Kaliningrad I did found 'Московский проспект' on street names list. You should try again. Copy whole list and paste content to notepad, than use find function.
Marek-M
Offline
#11 2021-09-19 10:44:08
- Marek-M
- Member
- From: [PL] Banino
- Registered: 2017-01-24
- Posts: 308
Re: How to get all street names of city
Here is search result on image:
Marek-M
Offline
#12 2021-10-18 08:17:50
- elieSoued
- New Member
- Registered: 2021-10-18
- Posts: 1
Re: How to get all street names of city
Hello,
I am building an app where I should display all the street names in a drop down when the user selects a city.
Is there a way to include the overpass Api in my code?
I am using javascript.
Thanks
Offline
#13 2021-12-07 14:33:44
- rg500
- New Member
- Registered: 2021-12-07
- Posts: 1
Re: How to get all street names of city
Hi,
@
Marek-M
Is there a way to add a column representing the city name and another with the postal code?
Thank you
Offline
#14 2022-01-26 20:56:56
- PABLO VARELA CUERVAS MONS
- New Member
- Registered: 2022-01-26
- Posts: 1
Re: How to get all street names of city
Hi, is it posible to obtain in the same file the ID of the street?
Offline
#15 2022-01-27 06:07:12
- stephan75
- Member
- Registered: 2008-05-28
- Posts: 2,918
Re: How to get all street names of city
Hi, is it posible to obtain in the same file the ID of the street?
Are you aware that one street in real life CAN exist in the OSM database by a chain of many single way elements?
So you want to have the OSM object ID number of a single element, or of all elements of a street?
Offline
#16 2022-02-08 12:25:57
- jerrybravo
- New Member
- Registered: 2022-02-08
- Posts: 1
Re: How to get all street names of city
[out:csv ("name")][timeout:2500];
{{geocodeArea:Roma}}->.searchArea;
(
way["highway"]["name"](area.searchArea);
);
for (t["name"])
{
make street name=_.val;
out;
Offline
Pages: 1