How to find isochrones?

667 views
Skip to first unread message

Edgar

unread,
Jun 3, 2017, 3:38:03 AM6/3/17
to OpenTripPlanner Users
Hi, I've been looking around for a bit and I can't seem to find a way to generate isochrones using OpenTripPlanner. I have a built graph of Boston that handles finding routes just fine.

I first tried using the OpenTripPlanner Analyst in the web interface and it gave me the following error:
03:11:01.933 ERROR (OTPExceptionMapper.java:16) Unhandled exception
org.opentripplanner.routing.error.VertexNotFoundException: vertices not found: [from]
at org.opentripplanner.routing.core.RoutingContext.check(RoutingContext.java:350) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.routing.core.RoutingRequest.setRoutingContext(RoutingRequest.java:835) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.api.resource.SurfaceResource.createSurface(SurfaceResource.java:75) ~[otp-1.1.0-shaded.jar:1.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.run(AbstractJavaResourceMethodDispatcher.java:144) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider.doDispatch(JavaResourceMethodDispatcherProvider.java:160) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.ServerRuntime.run(ServerRuntime.java:308) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.call(Errors.java:271) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.call(Errors.java:267) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:375) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.grizzly.http.server.HttpHandler.run(HttpHandler.java:224) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.grizzly.threadpool.AbstractThreadPool.doWork(AbstractThreadPool.java:565) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.grizzly.threadpool.AbstractThreadPool.run(AbstractThreadPool.java:545) [otp-1.1.0-shaded.jar:1.1]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]


This is what the Analyst looked like in the browser:


I then tried the following HTTP requests with that lat,long and got the following responses:

Request: http://localhost:8100/otp/routers/default/isochrone?batch=true&mode=WALK&maxTimeSec=600&fromPlace=42.36571,-71.056246&toPlace=none&output=EDGES
Response: {"type":"FeatureCollection","features":[]}
Output:
03:24:36.126 INFO (SPTWalker.java:169) SPTWalker: Generated 6084 points (0 dup edges, 0 no geometry) from 1164 vertices / 1540 states.
03:24:36.127 INFO (AccumulativeGridSampler.java:152) Added 39 closing samples to get a total of 88.
03:24:36.128 INFO (SampleGridRenderer.java:102) Computed SPT in 55msec, 32msec for sampling (87 msec total)
03:24:36.128 INFO (IsoChroneSPTRendererAccSampling.java:114) Computed 0 isochrones in 0msec

Response: java.lang.NullPointerException null
Output:
03:30:06.400 ERROR (OTPExceptionMapper.java:16) Unhandled exception
java.lang.NullPointerException: null
at org.opentripplanner.routing.algorithm.strategies.EuclideanRemainingWeightHeuristic.initialize(EuclideanRemainingWeightHeuristic.java:56) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.routing.algorithm.AStar.startSearch(AStar.java:123) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.routing.algorithm.AStar.startSearch(AStar.java:103) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.routing.algorithm.AStar.getShortestPathTree(AStar.java:307) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.routing.algorithm.AStar.getShortestPathTree(AStar.java:90) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.api.resource.SIsochrone.getIsochrone(SIsochrone.java:219) ~[otp-1.1.0-shaded.jar:1.1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121]
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.invoke(ResourceMethodInvocationHandlerFactory.java:81) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.run(AbstractJavaResourceMethodDispatcher.java:144) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:161) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider.doDispatch(JavaResourceMethodDispatcherProvider.java:205) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:99) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:389) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:347) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:102) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.ServerRuntime.run(ServerRuntime.java:308) ~[otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.call(Errors.java:271) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.call(Errors.java:267) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.process(Errors.java:315) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.process(Errors.java:297) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.internal.Errors.process(Errors.java:267) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:375) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.grizzly.http.server.HttpHandler.run(HttpHandler.java:224) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.grizzly.threadpool.AbstractThreadPool.doWork(AbstractThreadPool.java:565) [otp-1.1.0-shaded.jar:1.1]
at org.glassfish.grizzly.threadpool.AbstractThreadPool.run(AbstractThreadPool.java:545) [otp-1.1.0-shaded.jar:1.1]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121]


Response: {"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[-108.7809,-89.9974],[-108.7809,-89.9974],[-108.7809,-89.9974],[-108.7809,-89.9974], (the same point repeating many, many times)
Output: OTP stopped responding after this request and there was no output. It also would not respond to any requests future made by curl or the web interface, but the Java process was still running.

The last request was processing for a very long time in case that is useful information.

I'm very stuck - I've looked at the documentation at http://dev.opentripplanner.org/apidoc/1.0.0/resource_LIsochrone.html, https://web.archive.org/web/20130727130702/http://www.opentripplanner.org/apidoc/0.9.2/resource_IsoChrone.html, and looked through the opentripplanner-users and opentripplanner-dev Google groups, but I can't seem to put together a request that works. I think I might be missing something, but I'm not sure what. Help would be greatly appreciated! Thanks in advance

Laurent Grégoire

unread,
Jun 3, 2017, 5:14:04 AM6/3/17
to OpenTripPlanner Users
Hi Edgard,

Apparently your router can't compute a path from the origin ("vertices not found: [from]"). You should first test with a route plan from the exact same origin to some destination nearby to make sure your router works fine.

Apart from that, about your isochrone request, you use "none" for "toPlace", but this parameter should simply be skipped. Specify "none" may have fancy side effects (OTP may consider it a vertex label in some situation).

HTH,

--Laurent

Edgar

unread,
Jun 3, 2017, 5:35:01 AM6/3/17
to OpenTripPlanner Users
Hi, thank you for the quick reply! I actually did test the route first and copied the lat,long from the Multimodal Trip Planner web interface.

I tried removing the toPlace parameter and got the same results for the Analyst web interface /isochrone, but I got the following new error for /isochroneOld:
05:29:28.922 ERROR (OTPExceptionMapper.java:16) Unhandled exception
java.lang.ClassCastException: org.opentripplanner.routing.vertextype.SampleVertex cannot be cast to org.opentripplanner.routing.location.StreetLocation
at org.opentripplanner.api.resource.SIsochrone.getIsochrone(SIsochrone.java:220) ~[otp-1.1.0-shaded.jar:1.1]


Additionally, I got a new response from /simpleIsochrone: java.lang.IllegalArgumentException: Angle 433,622,187,028,613.2 is too high. Angle 433,622,187,028,613.2 is too high.
And corresponding output:
05:30:30.498 ERROR (OTPExceptionMapper.java:16) Unhandled exception
java.lang.IllegalArgumentException: Angle 433,622,187,028,613.2 is too high.
at org.geotools.measure.AngleFormat.format(AngleFormat.java:703) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.measure.AngleFormat.format(AngleFormat.java:940) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.measure.AngleFormat.format(AngleFormat.java:862) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.measure.Angle.toString(Angle.java:165) ~[otp-1.1.0-shaded.jar:1.1]
at java.text.MessageFormat.subformat(MessageFormat.java:1280) ~[na:1.8.0_121]
at java.text.MessageFormat.format(MessageFormat.java:865) ~[na:1.8.0_121]
at java.text.Format.format(Format.java:157) ~[na:1.8.0_121]
at org.geotools.resources.IndexedResourceBundle.getString(IndexedResourceBundle.java:491) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.resources.i18n.Errors.format(Errors.java:77) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.referencing.operation.projection.MapProjection.verifyGeographicRanges(MapProjection.java:501) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.referencing.operation.projection.MapProjection.access/bin/bash00(MapProjection.java:87) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:1052) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.referencing.operation.projection.MapProjection.transform(MapProjection.java:1091) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:80) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.referencing.operation.transform.ConcatenatedTransformDirect.transform(ConcatenatedTransformDirect.java:81) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.geometry.jts.DefaultCoordinateSequenceTransformer.transform(DefaultCoordinateSequenceTransformer.java:123) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer.projectCoordinateSequence(GeometryCoordinateSequenceTransformer.java:247) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer.transformLineString(GeometryCoordinateSequenceTransformer.java:210) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer.transformPolygon(GeometryCoordinateSequenceTransformer.java:256) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.geometry.jts.GeometryCoordinateSequenceTransformer.transform(GeometryCoordinateSequenceTransformer.java:169) ~[otp-1.1.0-shaded.jar:1.1]
at org.geotools.geometry.jts.JTS.transform(JTS.java:437) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.api.resource.SimpleIsochrone.makeContours(SimpleIsochrone.java:239) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.api.resource.SimpleIsochrone.makeContourFeatures(SimpleIsochrone.java:262) ~[otp-1.1.0-shaded.jar:1.1]
at org.opentripplanner.api.resource.SimpleIsochrone.geoJsonGet(SimpleIsochrone.java:283) ~[otp-1.1.0-shaded.jar:1.1]

This time I was using the coordinates (42.36449,-71.0564)

Laurent Grégoire

unread,
Jun 3, 2017, 5:53:30 AM6/3/17
to OpenTripPlanner Users
Hi Edgard,

You did not specify the cuttoffSec parameter for the isochrone request, that may be a reason. Here is a sample request you can base yours on:

Edgar

unread,
Jun 3, 2017, 1:12:37 PM6/3/17
to OpenTripPlanner Users
Thank you very much!! It's working now. Thank you for the help
Reply all
Reply to author
Forward
0 new messages