gjw80
gjw80

Reputation: 1078

How to determine if a vehicle is speeding? (google mapsv3 api)

I am working on a GPS app that reads in a vehicle's speed at a given location. Based on that current speed I would like to determine whether or not the vehicle is driving over the speed limit. Are there any API's available (for free or otherwise) that provide speed limits for a given coordinate on a google road map?

Upvotes: 1

Views: 1909

Answers (1)

Floris
Floris

Reputation: 46365

A quick google search turned up the following page

https://groups.google.com/forum/#!topic/wikispeedia/Th0aI4Hby-c

which says it can be done with a query like this:

http://www.wikispeedia.org/speedlimit/geo.php?accuracy=25&latlng=37.425890,-122.1547464&altitude=null&altitude_accuracy=null&heading=null&speed=2

I hope this helps.

EDIT the people responsible for this data have a wiki at

http://en.wikipedia.org/wiki/Wikispeedia

There I found another link of the form

http://www.wikispeedia.org/a/marks_bb2.php?name=all&nelat=35.198676&swlat=35.194676&nelng=-89.56558&swlng=-89.56958

which did indeed return something that looked like speed data in the vicinity:

<markers>
<marker label="" lat="35.19800509" lng="-89.56761047" mph="45" kph="0" cog="180" alt_meters="0.00"/>
<marker label="prasad" lat="35.19800509" lng="-89.56761047" mph="45" kph="0" cog="45" alt_meters="0.00"/>
<marker label="prasad" lat="35.19800509" lng="-89.56761047" mph="45" kph="0" cog="45" alt_meters="0.00"/>
<marker label="prasad" lat="35.19800509" lng="-89.56761047" mph="0" kph="0" cog="45" alt_meters="0.00"/>
<marker label="durga prasad" lat="35.19800509" lng="-89.56761047" mph="90" kph="0" cog="45" alt_meters="0.00"/>
<marker label="" lat="35.19786153" lng="-89.56760511" mph="45" kph="0" cog="180" alt_meters="0.00"/>
<marker label="" lat="35.19636122" lng="-89.56752062" mph="60" kph="0" cog="180" alt_meters="0.00"/>
</markers>

It will take some parsing... but I hope this gets you started.

The best solution is the complete code given at

https://code.google.com/p/speedlimit/

for an app that computes the speed limit where you are... they make the source code available, so that should be pretty easy.

Upvotes: 1

Related Questions