conveyal / gtfs-editor

A web-based GTFS editing framework. THIS PROJECT IS DEPRECATED. See https://github.com/ibi-group/datatools-ui for current version.
https://github.com/ibi-group/datatools-ui
MIT License
134 stars 63 forks source link

Roundtrips through google encoded polyline format add a duplicate coordinate to the end of the line #244

Closed mattwigway closed 8 years ago

mattwigway commented 8 years ago

e.g. in the shapes. This was causing problems because we also couldn't snap correctly to parts of lines with duplicated coordinate.s

mattwigway commented 8 years ago

Line 94 of Leafelt.encoded-polyline is thr problem: // close polyline encoded_points += this._encodePoint(plat, plng, coords[0][0], coords[0][1]);

coords[0][0] and coords[0][1] are undefined (they would be coords[0].lng and coords[0].lat) so this just adds another point at the end with delta 0.