How to programmatically get the Latency and longitude of US interstate exits?

Is there a way to do this using the open source map / API (Google Maps API, Microsoft Live Map API)?

Or is there a way to cross roads and navigate from map files? (if I get commercial card details)

Thanks.

Edit: either open source or API

+4
source share
1 answer

A possible solution based on openstreetmap depending on the quality of OSM data in the USA.

As described here, โ€œOutput ramps / tracks must be marked as highway = motorway_link or highway = primary_linkโ€ , if you import map data for the USA (using osm2pgsql) you can select all the links to the motorways.

eg. (selects based on my own data, i.e. very outside the US)

openmapdb=# select osm_id, name, ref from planet_osm_roads where highway='motorway_link'; osm_id | name | ref ----------+------+----- 23683997 | | 26436348 | | [..] 

23683997 and 26436348 are OSM ids - if you click on the links, you will see that they are really entry / exit ramps.

Once you have identified a method, you can access latitude and logic:

 openmapdb=# select astext(st_transform(way, 4326)) from planet_osm_roads where osm_id = '23683997'; LINESTRING(24.8757131412186 44.8730730514894,[..] (1 row) 
+2
source

All Articles