bbecquet / Leaflet.PolylineOffset

Apply a relative pixel offset to polylines without changing their coordinates.
MIT License
152 stars 32 forks source link

Merging parallel ways that are part of the same street using GeoJSON leaflet #20

Open arsilb1 opened 5 years ago

arsilb1 commented 5 years ago

I am using leaflet, for routing transit GeoJSON routes, and one thing I've noticed is that often, in major routes polylines are divided into two separate Inbound and Outbound routes, parallel ways - one way for each direction. This behavior is not desirable for the particular program I'm writing, so I want parallel ways to be merged into a single way running down the center of the street. It seems like a fairly simple problem, but I'm having a trouble getting the program to identify ways that need to be merged and then merge them properly.

Right now I'm using "https://github.com/bbecquet/Leaflet.PolylineOffset" this library for showing transit bus routes screenshot_6