Draw route on the map - wrong straight line

293 views
Skip to first unread message

spoksss

unread,
Oct 19, 2014, 5:25:31 PM10/19/14
to opentrippl...@googlegroups.com
Hi,

I want to ask you about OTP and drawing a route on the map.
I have similar problem to the below topic:

https://groups.google.com/forum/#!searchin/opentripplanner-users/draw/opentripplanner-users/MjK00rYqgro/FJApZK2IxBkJ

I have GTFS data with only two stops, one shape with 6 rows (just for testing).
OTP instance works and find connection but the line of the route
is wrong. When I add in detail shape is better but still the route is not connected to the street network,
I think that if there is only one street from one point (shape row) to another the OPT will use street network,
instead of drawing straight line.

I have tested it with current devel version and with version 0.11, both draw line in the same way.
I have also tried to use --useStreetsForLinking flag but line is still wrong.

My question is: Should OTP use street network for drawing the line, or I should care about that using
very detailed shapes.txt file?

# shapes.txt
shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence
1,50.3169442,18.7674898,1
1,50.313974,18.767499,2
1,50.311468,18.767545,3
1,50.311180,18.770874,4
1,50.310802,18.772301,5
1,50.310745,18.769514,6
1,50.310096,18.767573,7
1,50.306755,18.766156,8

# stops.txt
stop_id,stop_code,stop_name,stop_desc,stop_lat,stop_lon,zone_id,stop_url,location_type,parent_station,direction,position
1,1,Fran,Franciszkanska,50.3169442,18.7674898,,http://mydomain.pl/stop-1,0,,Zabrze-Centrum,Centrum
2,2,Troc,Trocera,50.306828,18.766170,,http://mydomain.pl/stop-2,0,,Zabrze-Centrum,Centrum

# stop_times.txt
trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_type,drop_off_type,timepoint,continuous_stops
1,20:00:00,18:01:00,1,1,Fran,0,0,0.0,0
1,20:05:00,18:06:00,2,2,Trocka,0,0,0.0,0

# OSM data
https://s3.amazonaws.com/metro-extracts.mapzen.com/katowice_poland.osm.pbf

Should shape_dist_traveled data help somehow in this case?
In the attachment I have pointed correct path using red dots.

Thanks in advance

otp_shape.png

Matt Conway

unread,
Oct 19, 2014, 7:30:00 PM10/19/14
to opentrippl...@googlegroups.com
---------- Forwarded message ----------
From: "Matt Conway" <mattw...@gmail.com>
Date: Oct 19, 2014 7:27 PM
Subject: Re: Draw route on the map - wrong straight line
To: "spoksss" <lukasz...@gmail.com>

Hello,

OTP draws routes by connecting stops with straight lines, or using shapes.txt if it is available. The street network is not used (which makes sense, as transit vehicles don't always follow it). So if you want to have accurately-drawn routes, shapes.txt is the way to go.

Matt

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Marko Burjek

unread,
Oct 20, 2014, 4:25:09 PM10/20/14
to opentripplanner-users
It should create stops, routes and shapes from OSM bus routes data.
It's C# .Net application but I couldn't get it to work correctly in Mono.

Then you have this:http://bmander.com/makeshapes/ (I don't know how is then with legality because you are using data from Google map)

Here is one web based GTFS editor which I haven't tried:
https://github.com/conveyal/gtfs-editor

Here is web app for creating transit maps:
http://www.transitmix.net/
I'm not sure how to export them if it is even possible.

One way to create shape file is to use some trip planner that exports GPX (like http://map.project-osrm.org/)
You add start stop and middle points where bus drives. You gen path. And then write some script that writes latitude and longitude from GPX to CSV format of shapes.txt.

Hannes Junnila

unread,
Oct 25, 2014, 7:40:43 AM10/25/14
to opentrippl...@googlegroups.com
We are currently using https://github.com/tru-hy/gtfs_shape_mapfit/tree/fastmapmatch for matching between (poor) shapes.txt and OSM data in order to get shapes nicely aligned to was in OSM. It sounds exactly like the issue you are havng.

/Hannes
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-users+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-users+unsub...@googlegroups.com.

Marko Burjek

unread,
Oct 25, 2014, 8:14:40 AM10/25/14
to opentripplanner-users
There is actually GraphBuilder in OTP: https://github.com/opentripplanner/OpenTripPlanner/blob/master/src/main/java/org/opentripplanner/graph_builder/impl/map/MapBuilder.java which finds OSM edges closest to shapes. It apparently uses this edges to connect bus stops to roads on which bus actually travels. But As far as I can see this isn't used in linker https://github.com/opentripplanner/OpenTripPlanner/blob/master/src/main/java/org/opentripplanner/routing/edgetype/loader/NetworkLinkerLibrary.java .

But could be used to make nicer shapes. And fix weird ones. But it probably wouldn't work if shapes are too much different.

To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages