Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current road speed limit

I am trying to develop a Javascript program which gets the current speed limit of the current road. I have tried using using the Overpass API, but that only returns an empty XML file:

/interpreter?node(around:10, 40.7127, 74.0059)[maxspeed];out;

I haven't implemented this into my code yet, testing it on Firefox.

Why is the XML file empty, and are there any other free online resources which can be used to get the speed limit of a road at coordinates x,y?

Note: I would prefer if it supported speed limits in the UK

like image 457
Beta Decay Avatar asked Feb 25 '26 12:02

Beta Decay


1 Answers

Two reasons your query returns an empty result:

  • You are querying in a very sparsely mapped region
  • You are querying for nodes instead of ways

Try this query instead:

way
  (around:70, 51.0483, 13.7495)
  [maxspeed];
(._;>;);
out;

See the result on overpass turbo.

like image 55
scai Avatar answered Feb 28 '26 02:02

scai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!