0
3

Hi, I am in a need to extract a street list of a given city in a csv format, with some lon/lat data, to focus on the map on the street, when a person is searching it in the app. What is the easyest way/tool to make it?

asked 05 Jan '12, 11:10

Gevork's gravatar image

Gevork
189121319
accept rate: 0%


The CSV option of osmconvert will help you generating the required list.

First, use osmfilter with --keep="highway=residential =primary =secondary =tertiaty =unclassified", etc., to get all streets, then use osmconvert with --all-to-nodes and --csv="@lon @lat name etc." to get the CSV list.

permanent link

answered 19 Sep '12, 00:20

Marqqs's gravatar image

Marqqs
433510
accept rate: 22%

edited 19 Sep '12, 00:24

osmfilter city.osm --keep="addr:country= and addr:city= and addr:street=" --ignore-depemdencies --drop-relations --drop-ways |osmconvert - --csv="@oname @id @lon @lat addr:country addr:city addr:street"

permanent link

answered 04 Jun '14, 00:17

Gevork's gravatar image

Gevork
189121319
accept rate: 0%

Thank you. I used your command line and it worked but it doesn't show all the streets.

I am working on Spain map data.[1] I did this:

  • osmconvert spain-latest.osm.pbf -o=spain-latest.osm.o5m
  • osmfilter spain-latest.osm.o5m --keep="addr:country= and addr:city= and addr:street=" --ignore-depemdencies --drop-relations --drop-ways | osmconvert - --csv="@oname @id @lon @lat addr:country addr:city addr:street"

And it shows 135444 results, including duplicates. Then I grep a municipality like "Jerez de la Frontera":

  • osmfilter spain-latest.osm.o5m --keep="addr:country= and addr:city= and addr:street=" --ignore-depemdencies --drop-relations --drop-ways | osmconvert - --csv="@oname @id @lon @lat addr:country addr:city addr:street" | cut -f6-7 | grep "Jerez de la Frontera" | sort | uniq

And it shows only 2 streets, which is obvious wrong:

Jerez de la Frontera Calle Perú Jerez de la Frontera Matadero

That municipality has names for many streets in OpenStreetMap.

https://www.openstreetmap.org/relation/342097#map=14/36.6805/-6.1285

What is the problem? Thank you.

[1] http://download.geofabrik.de/europe/spain.html

(30 Sep '16, 12:46) emijrp

I reply to myself. It shows few streets because not all the streets have a defined "addr:city" parameter.

So I used this solution:

Now you have a .osm file for the municipality. Inside it is all the information (streets, buildings, monuments, etc) for that city.

You can use osmfilter or grep to extract the info your want.

Regards

permanent link

answered 30 Sep '16, 14:42

emijrp's gravatar image

emijrp
111
accept rate: 0%

edited 01 Oct '16, 00:36

Maposmatic will give you a csv of the streets, but it shows a local grid reference instead of an exact lat-long. Maybe you can reverse that reference to get the approximate lat/lon, since you know the bounding box and the size of the grid ?

permanent link

answered 06 Jan '12, 12:08

Vincent%20de%20Phily's gravatar image

Vincent de P... ♦
17.0k15147243
accept rate: 19%

@Vincent-de-phily Thank you, but it's not an easy way...

(11 Jan '12, 11:17) Gevork
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:

×510
×108
×69

question asked: 05 Jan '12, 11:10

question was seen: 22,269 times

last updated: 01 Oct '16, 00:37

powered by OSQA