Closed Danishswag closed 7 months ago
hi @Danishswag thanks for raising the issue and proposing a solution. The latest version of the package incorporates the sorting by shape_pt_sequence
.
I should definitely work on a contribution guide as the input of the community would be very helpful.
I'll close the issue for now. Hopefully when you find the next issue the contribution guide will be up.
Hello! Thank you for putting together such a wonderful and easy to use package. At the transit agency I work at, the shapes.txt files our GTFS feed archive aren't pre-sorted on the
shape_pt_sequence
column. This means thatfeed.shapes
winds up connecting points in the wrong order unless I manually extract shapes.txt, sort it, and recreate the GTFS bundle before using the package to import it.I believe the issue is in
get_shapes(self)
in theFeed
class:https://github.com/Bondify/gtfs_functions/blob/b7caea628c681a41b42b922042afbe565e133038/gtfs_functions/gtfs_functions.py#L691C15-L691C15
At a quick glance, I think something like changing this code block:
to something like:
should fix it. Technically
shape_pt_sequence
is required in the spec^1, so theif
block might be unnecessary.If you think this is a good solution, I'd be happy to submit a pull request - didn't see a contribution guide so didn't want to presume.