"rainbow lines" for overlapping polylines - leaflet plugin

1,244 views
Skip to first unread message

Aaron Antrim

unread,
Apr 10, 2014, 3:53:42 PM4/10/14
to transit-d...@googlegroups.com
Hello Transit Developers!

You may be familiar with this problem.  Showing overlapping transit routes in "slippy maps" cover each other, and it is hard to see all the routes and a full view of the system.

I have looked for some leaflet plugins to solve this problem, but I do not think they exist yet.  The best option, I think, would be a leaflet plugin that automatically offsets overlapping polylines to show classic transit "rainbow lines" (BART map example, https://www.bart.gov/stations).

Have I overlooked any resources?

Would anyone be interested in collaborating on or co-funding the development of an open source "rainbow lines" plugin for leaflet?

-Aaron

-- 
Aaron Antrim
www.trilliumtransit.com
Portland, Oregon
503.567.8422

Richard Kendall Wolf

unread,
Apr 10, 2014, 4:13:57 PM4/10/14
to transit-d...@googlegroups.com
On Apr 10, 2014, at 2:53 PM, Aaron Antrim <aa...@trilliumtransit.com> wrote:
>
> Hello Transit Developers!
>
> You may be familiar with this problem. Showing overlapping transit routes in "slippy maps" cover each other, and it is hard to see all the routes and a full view of the system.

Aaron,

I do not know if this is helpful at all, but you reminded me of a question I once asked the MapKit folks when I was at Apple's WWDC (I lost the lottery this year ... 19 consecutive WWDCs, this year would have been my 20th anniversary).

Anywho, I said that I was drawing a polyline on a map view from GTFS data, but wanted to know what the best way would be to offset that polyline, given that transit lines often overlap (Chicago Loop, in my case). I was especially concerned because of the way Apple rescales map views when a user zooms in/out of a view (I couldn't, say, fudge the latitudes and longitudes of the polylines to offset them because that won't scale).

The clever answer I got from Apple was to apply an affine transform to the drawing layer as I was in the process of drawing the polyline. That way, when a user zooms in/out, the polylines remain offset a number of points from one another in a consistent way. Dunno if you can do the same thing ... but I thought I'd throw it out there. :)



Andrew Byrd

unread,
Apr 11, 2014, 5:33:59 AM4/11/14
to transit-d...@googlegroups.com
On 04/10/2014 09:53 PM, Aaron Antrim wrote:
> I have looked for some leaflet plugins to solve this problem, but I do
> not think they exist yet. The best option, I think, would be a
> leaflet plugin that automatically offsets overlapping polylines to
> show classic transit "rainbow lines" (BART map
> example, https://www.bart.gov/stations).
>
> Have I overlooked any resources?

Hi Aaron. Conveyal is working on a library that is in many ways similar
to what you want. Check out https://github.com/conveyal/transitive.js .
It's intended to find a compromise between geographically accurate and
schematic transit maps. David Emory should be able to provide further
information if you're interested.

-Andrew

Sean Barbeau

unread,
Apr 17, 2014, 1:21:45 PM4/17/14
to transit-d...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages