Isochrones API and OTP master branch

866 views
Skip to first unread message

Phoebe M

unread,
Jan 8, 2015, 11:11:19 PM1/8/15
to opentrippl...@googlegroups.com
Hello,

I'm working on creating walk-time isochrones using OSM data.

I have successfully created a Graph.obj using the master branch of OTP. I've also run the server and plotted a walking route using the local web-app (all following the "Minimal Introduction to OTP"). 

The next step, creating a shapefile of isochrone polygons, is where I'm having difficulty. My LIsochrones API request successfully returns a zipped shapefile, but the shapefile (called "null") has no polygons. 

I used this command in the terminal:
java -Xmx2G -jar otp-latest-master.jar -p 9090 -a --server

And this API request in the browser:
What needs to be fixed in order to get an accurate isochrones shapefile using the OTP master branch? (Not sure if this is relevant, but I'm using a Windows machine.)

Thanks so much.

Laurent Gregoire

unread,
Jan 9, 2015, 3:37:16 AM1/9/15
to opentrippl...@googlegroups.com
Hi Phoebe,

On 09/01/15 05:11, Phoebe M wrote:
> The next step, creating a shapefile of isochrone polygons, is where I'm
> having difficulty. My LIsochrones API request successfully returns a zipped
> shapefile, but the shapefile (called "null") has no polygons.

The shapefile name (null) is a known "feature". This should be harmless
though.

> I used this command in the terminal:
> java -Xmx2G -jar otp-latest-master.jar -p 9090 -a --server
> And this API request in the browser:
> http://localhost:9090/otp/routers/default/isochrone?&fromPlace=25.59302,85.15076&date=2015/01/09&time=12:00:00&mode=WALK&&walkSpeed=5&cutoffSec=600&cutoffSec=900&cutoffSec=1800&cutoffSec=3600
> What needs to be fixed in order to get an accurate isochrones shapefile
> using the OTP master branch? (Not sure if this is relevant, but I'm using a
> Windows machine.)

You have in your request "?&fromPlace=..." which looks suspicious, it
should read "?fromPlace=...&date=...". That can be the cause of the
issue, not sure.

Otherwise everything looks good, if the latter does not solve your issue
I would suggest you to check if you can plan a route using the exact
same request (adding a "toPlace" and replacing isochrone by plan).

HTH,

--Laurent

Laurent Gregoire

unread,
Jan 9, 2015, 11:55:00 AM1/9/15
to Phoebe M, OpenTripPlanner Users
On 09/01/15 17:39, Phoebe M wrote:
> INFO (SPTWalker.java.166) SPTWalker: Generated 20990 points (428 dup edges,
> 0 no geometry) from 3080 states.
> I'm wondering if the "no geometry" has something to do with it.

No, it should be fine, it just says that the walking process skipped 0
edges due to no geometry. This is fine.

> The "Plan" API request returns an XML which looks correct (lists the
> different roads needed, and total time to get from "fromPoint" to
> "toPoint").

That's strange. I have no clue about what's going on. Can you set a
breakpoint in the LIsochrone class to see if the various parameters
seems OK?

--Laurent

Laurent Gregoire

unread,
Jan 13, 2015, 5:45:03 AM1/13/15
to Phoebe M, opentripplanner-dev, OpenTripPlanner Users
On 13/01/15 10:21, Laurent Gregoire wrote:
> On 12/01/15 21:51, Phoebe M wrote:
>> It appears that when the OTP server is run from an IDE, LIsochrone works
>> perfectly. The API request returns a GeoJSON (with all polygons included).
>> But when run from the command line, the same API request returns a
>> shapefile (with no polygons).
>
> Indeed the API can return the isochrone in two format: GeoJSON and
> Shapefile. But apparently the Shapefile generation seems to be broken
> indeed, it may be due to a recent upgrade of GeoTools (I've seen similar
> complain on the web). I'll check that out. In the meantime, if you can
> use GeoJSON that's fine.

There was a bug indeed in the shapefile generation, it could have been
caused by an upgrade of GeoTools library. Isochrone shapefiles are not
use that often, you are the first one to stumble upon this issue. I've
made a fix and submitted a PR here:

https://github.com/opentripplanner/OpenTripPlanner/pull/1688

HTH,

--Laurent

Reply all
Reply to author
Forward
0 new messages