I'm trying to extract the street name of a city from an osm file (converted from pbf) that I got from geofabrik. I used osmfilter and osmconvert for the extraction, using this command:
this is the result:
The problem is, those 3 streets are the only ones extracted in the csv. Is there something wrong with my command or is it the source data? Are there any alternative ways for extraction? asked 19 Sep '20, 03:21 ceeslt |
I know very little about osmosis, but from a data perspective: You appear to be searching for addresses rather than the names of the streets themselves. In most parts of the world OSM has far better coverage of street names than they do addresses. Street names are usually recorded as If you actually want the list of streets that have at least one address then you are being a little too restrictive in your query. The answered 19 Sep '20, 12:00 InsertUser how do you call the name of the street? I tried osmfilter indonesia-latest.osm --keep="addr:city=Bandung and addr:street amd name= highway=*" |osmconvert64 - --csv="@id @name" --csv-separator="|" > streetlist.csv but it doesn't seem to work. (sorry, I'm new with these)
(01 Oct '20, 12:40)
ceeslt
2
You might benefit from looking at examples of the underlying data and considering whether your query would find them. Here are the details of a street (or rather a segment of a street) in Bandung: https://www.openstreetmap.org/way/319194433 If you look at the tags, you can see that it is mapped as highway=primary, and the name is in the "name=" field. There are no addr: tags, which is normal - we would expect addr: tags to apply to buildings and other things located on the street, not the street itself (like this hotel for example: https://www.openstreetmap.org/way/372063342#map=19/-6.92049/107.60480). So if you are looking for highway= objects, you should not have any addr: tags in the query. You would need to restrict the are to Bandung in a different way, but I don't know enough about the tools you are using to say how.
(01 Oct '20, 16:38)
alan_gr
Thank you, now I can understand what I'm looking for data-wise, though since there doesn't seem to be a property that signifies the region(city, province, etc) of the street I'm still looking for ways to filter it.
(05 Oct '20, 04:38)
ceeslt
Ok, I managed to slice the osm file to contain just the city I'm extracting so there's no need for the addr tag, but I still can't call the name tag. I've tried @name, name, name=*. and highway:name but still can't get anything.
(08 Oct '20, 02:15)
ceeslt
I am not sure what you mean by "call the name tag". Do your mean you want to filter by name? I am not clear why, as I thought you wanted all names on highway= objects? When you say you can't get anything, do you mean that nothing is written to the csv file, or that the name tag is missing?
(08 Oct '20, 08:05)
alan_gr
Sorry for my wording, I meant extract the name tag of the streets to write in the csv output, to produce a list of street names. So far the things I've tried have only returned empty results.
(08 Oct '20, 08:29)
ceeslt
showing 5 of 6
show 1 more comments
|
What data are you hoping to obtain? The OSM information for the street itself? The OSM information for things which have an address on that street? Something else?
I was just looking for the names of the street. Sorry I missed your comment all this time.