grote / osm2gtfs

Turn OpenStreetMap data and schedule information into GTFS
GNU General Public License v3.0
98 stars 31 forks source link

Fixed some functions in StandardTripsCreator #126

Closed ialokim closed 6 years ago

ialokim commented 6 years ago

While working on the countrywide NicaraguaCreator, I've found some issues with the current TripsCreator implementation. See the inline comments for the specific issues.

ialokim commented 6 years ago

Tested it with Managua

As Estelí and Managua are currently the only regions that use the standard creator's implementation (please correct me if I am wrong), I think this is ready to be merged too.

Skippern commented 6 years ago

I don’t think multiple dicts like this should have a negative impact on the end result.

Aun Johnsen

On Feb 27, 2018, at 01:06, ialokim notifications@github.com wrote:

@ialokim commented on this pull request.

In osm2gtfs/creators/trips_creator.py https://github.com/grote/osm2gtfs/pull/126#discussion_r170777621:

@@ -88,7 +88,8 @@ def _prepare_trips(self, feed, schedule, itinerary): if input_fr == itinerary.fr and input_to == itinerary.to: trip_services = trip["services"] for service in trip_services:

  • services.append(service)
  • if service not in services: I'm referring to the case when there are two or more dict items inside the line's list for the same line, which present different times but using the same service period. See this example:
"lines": {
    "E-MAN-EST": [
        {
            "exeptions": [],
            "from": "Mercado Mayoreo",
            "services": [
                "Mo-Su"
            ],
            "stations": [
                "Mercado Mayoreo",
                "COTRAN Sur"
            ],
            "times": [
                [
                    "05:45",
                    "08:15"
                ],
                [
                    "08:15",
                    "10:45"
                ],
                [
                    "09:15",
                    "11:45"
                ],
                [
                    "10:45",
                    "13:15"
                ],
                [
                    "11:45",
                    "14:15"
                ]
            ],
            "to": "COTRAN Sur"
        },
        {
            "exeptions": [],
            "from": "Mercado Mayoreo",
            "services": [
                "Mo-Su"
            ],
            "stations": [
                "Mercado Mayoreo",
                "COTRAN Sur"
            ],
            "times": [
                [
                    "13:15",
                    "15:45"
                ],
                [
                    "15:15",
                    "17:45"
                ],
                [
                    "13:45",
                    "16:15"
                ],
                [
                    "15:45",
                    "18:15"
                ]
            ],
            "to": "COTRAN Sur"
        },
        ...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/grote/osm2gtfs/pull/126#discussion_r170777621, or mute the thread https://github.com/notifications/unsubscribe-auth/AAw_XEmIH-SoTxLG0l5dCwwPpTnV9wETks5tY0brgaJpZM4SHUS0.

grote commented 6 years ago

Maybe let's get reviews from others whose creators rely on this?

pantierra commented 6 years ago

So far I think only the Nicaraguan providers rely on the standard trips creator.