What is the best source and way to get a list of all intersections in a major city?
相关问题
- How do you change the color of the dotted line on
- Google places autocomplete suggestion without coun
- Free Silverlight mapping with Bing maps and OpenSt
- draw polylines with different colors on v2 maps
- Google Maps event listeners not working properly i
相关文章
- Avoiding “Sorry, we have no imagery here” with Goo
- Custom Marker performance iOS, crash with result “
- Google Map Gradient Polylines for Android?
- Angular 6 - @types/googlemaps/index.d.ts' is n
- Google Maps - Get Polygon border of zones/neighbor
- Google Map Marker Clickable Area
- getSupportFragmentManager().findFragmentById retur
- MapActivity cannot be resolved to a type
You can do it using OpenStreetMap data.
Download the data for the city (use the export link: http://www.openstreetmap.org/export or get the data from here: http://metro.teczno.com/; there are other sources but this isn't the place to list them).
Find all the elements with appropriate values for the 'highway' tag (http://wiki.openstreetmap.org/wiki/Key:highway).
For each such way, get the node IDs that make it up.
Create an array containing entries consisting of the highway information (name, etc.) and a node, one for every node.
Sort the array on node IDs. That groups entries by the node, so that a set of entries with duplicate nodes represents an intersection.
Traverse the array, extracting each group of entries with more than one entry in it and adding a new entry to your list of intersections. At this point you can extract the highway information so that an intersection can be characterised by the highways which meet there.
This is a short summary, I know. But I know it works, because it is the system I use in my map rendering library to identify intersections when creating routing data.
If one doesn't mind a few false positives the following Overpass API script gets road intersections out of OpenStreetMap data pretty easily:
http://overpass-turbo.eu/s/QD
(the script can't detect false intersections – where only two lines meet, though, e.g. when a road is represented by multiple way objects in the OSM data)
In case that the script goes offline a more readable version directly here:
Sample Script: