Hi im as new as can be to OSM im looking for a way to divide up a city into four parts and get all the street names of each area, from googling around i can see there is a way but i have no idea how to use OSM so its not so helpfull (remember go easy im a newbie) pls be nice to the rookie and help out. Thanks

asked 09 Jul, 19:33

zgivod's gravatar image

zgivod
112
accept rate: 0%

1

Is this a one time task for a specific city or do you need a reproducible approach?

How do you want to divide up the city? By drawing a cross (so basically by coordinates) or along certain features (rivers, suburb boundaries)?

(10 Jul, 09:32) TZorn

@TZorn it would be with coordinates and just a one time task. thanks so much

(10 Jul, 18:31) zgivod

You can use Overpass Turbo to generate a list of all mapped streets in an area.

This code would for example return all named highways meant for traffic with all their attributes in the city of Kiel:

[out:json][timeout:25];
// fetch area “Kiel” to search in
{{geocodeArea:Kiel}}->.searchArea;
// gather results
(
 way[highway~"^(motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|pedestrian)$"][name](area.searchArea);
);
// print results
out body;
>;
out skel qt;

Klick on the data button on the top right hand side to see the data. You would have to extract all the "name": "xyz street" to get your list of names. Maybe someone more Overpass savvy can find a leaner approach for just extracting the names.

You could use a slightly different query to define your quadrants:

[out:json][timeout:25]
// define area:
[bbox:50.6,7.0,50.7,7.1];
// gather results
(  way[highway~"^(motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|pedestrian)$"];
);
// print results
out body;
>;
out skel qt;
permanent link

answered 10 Jul, 21:18

TZorn's gravatar image

TZorn
2.2k21450
accept rate: 9%

edited 10 Jul, 21:27

that helps a little bit thanks! i can always copy and paste the code to a code that i am familiar with and using my own coding experience i can get every word that follows name: now i am wondering is there a way to get actual home addresses in a coordinates area is that possible?

(11 Jul, 00:59) zgivod

There is a csv mode:

[out:csv(name)][timeout:25]
// define area:
[bbox:50.6,7.0,50.7,7.1];
// gather results
(     way[highway~"^(motorway|trunk|primary|secondary|tertiary|unclassified|residential|living_street|pedestrian)$"];
);
// print results
out;

It doesn't deal with duplicate names though.

For addresses, you'd search on addr:housenumber.

(11 Jul, 03:00) maxerickson

@maxerickson that works amazing. Thanks! since im very new and not familler with the code where to i search addr:housenumber ?

(11 Jul, 15:03) zgivod

House numbers are mostly on the buildings, POIs, entrances or pure address nodes but can also be in a combination of way/node (interpolation). Sometimes numbers and streets are associated through a "associated street" relation. Have a look a the Addresses wiki page to get familiar on how house numbers are mapped in OSM. You can extract the data similarly as with the streets but it depends a on what you want to do with the data how to do it exactly.

(11 Jul, 15:12) TZorn

i see.... but im still very unfamiller with the code, what would be an example code with addr:housenumber with @maxerickson code above?

(11 Jul, 17:12) zgivod

What is it you want to achieve? Surely not just a list of all house numbers? I guess you want at least all addresses including street name and house number. You have to be a bit more precise for anyone to help.

(11 Jul, 17:35) TZorn

yes sorry for being unprecise im looking for all addresses including street name and house number in specific coordinates

(11 Jul, 17:56) zgivod

replace the way[highway... part with nwr["addr:housenumber"];. nwr is a shortcut to search on all types of osm objects.

Then replace the out:csv(name) part with something like out:csv("addr:street","addr:housenumber"). You also may want to include some more tags, take a look at https://wiki.openstreetmap.org/wiki/Proposed_features/House_numbers/Karlsruhe_Schema#Tags .

(12 Jul, 03:15) maxerickson
showing 5 of 8 show 3 more comments
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:

×261
×179
×111
×91

question asked: 09 Jul, 19:33

question was seen: 116 times

last updated: 12 Jul, 03:15

powered by OSQA