Hi!! I am a student of Engineering and I'm using OSM data for my final university project. My problem is this: Let us place ourselves in Madrid, Serrano street is defined by various 'ways' and I wonder if anyone knows any way to detect ALL Serrano street at once, without having to resort to different 'ways' that compose this street. Currently, I have downloaded the data from Madrid in SQL . THANKS!! asked 24 Feb '16, 15:51 eleena18 aseerel4c26 ♦ |
If you want to get a combined geometry out of your SQL database, you could do something like this. Instead of
write
This will combine all objects that have the same name and highway type into single lines (where possible). answered 24 Feb '16, 19:47 Frederik Ramm ♦ 2
Aha, good point. Note that some streets change type, so this heuristic still won't be 100%. See this - the street "Kochanova" starts from south as
(25 Feb '16, 09:46)
Piskvor
2
Also beware of streets with the same name but in different parts of a city. Using st_intersects and a rather more complicated query gets round this issue. You will also probably need to cast your st_union() with st_multi() so that everything becomes a multilinestring.
(25 Feb '16, 11:15)
SK53 ♦
I don't have ways defined as geometric... I have a table with the characteristics of the way, another one with the nodes that compose it and another with its tags..
(25 Feb '16, 16:13)
eleena18
2
well that doesn't technically matter: in this case you are searching for connected graphs which share the same name attribute. You may find something I wrote about building such a graph from open data for streetlights describes a solution to a similar problem: http://sk53-osm.blogspot.co.uk/2013/04/maps-for-dogs-or-lamp-posts-in-chains.html. So use your way_nodes table to find 1) all interconnected ways, and 2) build graphs from this.
(27 Feb '16, 19:09)
SK53 ♦
THANK YOU!! :)
(29 Feb '16, 14:36)
eleena18
|
No. You could theoretically map a street as a relation consisting of the various ways, but this is rare. Most streets are indeed mapped as multiple segments with the same answered 24 Feb '16, 16:03 Piskvor |
This question in Spanish.