0

OTP 1.4.0 will return all of the stops in the GTFS feed but will not return nearby stops when provided with lat/lon and radius. Does anyone know why this is happening and how to resolve it?

http://{my-otp-server}/otp/routers/default/index/stops?&lat={double}&lon={-double}&radius=.25
    RETURNS []
http://{my-otp-server}/otp/routers/default/index/stops
    RETURNS 3078 ROWS
Steve Vinoski
  • 19,847
  • 3
  • 31
  • 46
Damion
  • 21
  • 5
  • I think the main problem is that the documentation for this endpoint does not specify the units used in the radius parameter. I assumed it was miles (.25) and got nothing. I get 44 results when I use the same distance in feet (1320). But that doesn't mean it's feet; it could be meters or something else. http://dev.opentripplanner.org/apidoc/1.4.0/resource_IndexAPI.html#resource_IndexAPI_getStopsInRadius_GET – Damion Oct 07 '19 at 16:38

1 Answers1

2

I found out through trial and error and by comparing results with a different API that the units for radius are meters.

Damion
  • 21
  • 5
  • @scai OTP was developed in Oregon so I figured miles would be a safe bet (given that they don't specify units in the docs). I guess we'll have to convert miles from users into meters for the API until the USA converts to metric… – Damion Oct 08 '19 at 13:21