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 |
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. answered 19 Sep '12, 00:20 Marqqs it should be
(17 Mar, 10:27)
dsaket
|
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" answered 04 Jun '14, 00:17 Gevork 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:
And it shows 135444 results, including duplicates. Then I grep a municipality like "Jerez de la Frontera":
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.
(30 Sep '16, 12:46)
emijrp
it's
(17 Mar, 10:19)
dsaket
|
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 answered 30 Sep '16, 14:42 emijrp |
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 ? answered 06 Jan '12, 12:08 Vincent de P... ♦ |