Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

calculating curvature on routes - Google maps

There is an API for getting heatmap and gradient on the Google Maps API.

But is there any way to calculate curvature of the road of certain route on Google Maps?

Like this one in here: roadcurvature.com

like image 421
MBH Avatar asked Nov 10 '17 14:11

MBH


People also ask

How do you calculate the curvature of a road?

Where degree of curvature is based on 100 units of arc length, the conversion between degree of curvature and radius is Dr = 18000/π ≈ 5729.57795, where D is degree and r is radius.

How do you find the radius of a curve on Google Maps?

Google Maps does not support the radius functionality, which means that you can't determine the radius around a given location. But you can measure the distance between two or more points. As a quick reminder, the radius of a circle is the distance from its edge to its center.

How does Google Maps calculate a route?

GPS data from individual phones is now used by Google Maps to estimate movement and speed of traffic in real time. This data informs Google's travel time estimates by reducing the average speeds in its calculations during periods of high traffic, or increasing the average speed when conditions are clear.


1 Answers

There's no way to calculate the curvature of all roads using the Google Maps API, but you can certainly calculate the curvature of a route that you've found using the Directions API / Service.

The JavaScript API's DirectionsService response will include an overview_path with a series of LatLngs that make up the path. From that point, it's just a question of taking those points and applying the same sort of analysis documented here by the RoadCurvature project. The project uses OSM to simplify the collection and analyze large swaths of data, but if you want to just analyze a specific route the math is still the same. In particular, I would look at the curvature/post_processors/add_* files which appear to do the heavy lifting.

like image 162
bamnet Avatar answered Oct 12 '22 15:10

bamnet