Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/gtfs format #19

Merged
merged 5 commits into from
Dec 3, 2024
Merged

Fix/gtfs format #19

merged 5 commits into from
Dec 3, 2024

Conversation

munterfi
Copy link
Member

@munterfi munterfi commented Dec 3, 2024

This update ensures that the GTFS feed export aligns with the reference standard.

All test cases have been validated using the Canonical GTFS Schedule Validator provided by MobilityData:

image

Note: The number_out_of_range errors are caused by coordinates that are outside the valid range (latitude: -90 to 90, longitude: -180 to 180). The converter defaults to using the screen coordinates of the editor when no custom repository is provided. These errors can be safely ignored for this validation but should be addressed by providing coordinates through a custom infrastructure repository.

Details

Converter GTFS export: all_test_cases.zip

Validation results:

{
  "summary": {
    "validatorVersion": "6.0.0",
    "validatedAt": "2024-12-03T16:32:36Z",
    "gtfsInput": "file:/tmp/gtfs-validator-temp12006023303745815515/11af1a04-816b-458c-93de-ff78628c905516861096993667774576.zip",
    "threads": 1,
    "outputDirectory": "/tmp/gtfs-validator-temp11af1a04-816b-458c-93de-ff78628c90552805458220861180914",
    "systemErrorsReportName": "system_errors.json",
    "validationReportName": "report.json",
    "htmlReportName": "report.html",
    "countryCode": "ZZ",
    "dateForValidation": "2024-12-03",
    "feedInfo": {
      "publisherName": "Netzgrafik Editor Converter",
      "publisherUrl": "https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-converter",
      "feedLanguage": "English",
      "feedStartDate": "N/A",
      "feedEndDate": "2099-12-31",
      "feedEmail": "",
      "feedServiceWindowStart": "",
      "feedServiceWindowEnd": ""
    },
    "agencies": [
      {
        "name": "Netzgrafik Editor",
        "url": "https://github.com/SchweizerischeBundesbahnen/netzgrafik-editor-frontend",
        "phone": "N/A",
        "email": "N/A"
      }
    ],
    "files": [
      "agency.txt",
      "calendar.txt",
      "feed_info.txt",
      "routes.txt",
      "stop_times.txt",
      "stops.txt",
      "trips.txt"
    ],
    "validationTimeSeconds": 0.153758732,
    "memoryUsageRecords": [
      {
        "key": "GtfsFeedLoader.loadTables",
        "totalMemory": 3095396352,
        "freeMemory": 1484125384,
        "maxMemory": 12884901888,
        "diffMemory": -50988720
      },
      {
        "key": "GtfsFeedLoader.executeMultiFileValidators",
        "totalMemory": 3095396352,
        "freeMemory": 1471542512,
        "maxMemory": 12884901888,
        "diffMemory": -12582872
      },
      {
        "key": "org.mobilitydata.gtfsvalidator.table.GtfsFeedLoader.loadAndValidate",
        "totalMemory": 3095396352,
        "freeMemory": 1471542512,
        "maxMemory": 12884901888,
        "diffMemory": -63571592
      },
      {
        "key": "ValidationRunner.run",
        "totalMemory": 3095396352,
        "freeMemory": 1468058880,
        "maxMemory": 12884901888,
        "diffMemory": -223373456
      }
    ],
    "counts": {
      "Shapes": 0,
      "Stops": 0,
      "Routes": 13,
      "Trips": 1030,
      "Agencies": 1,
      "Blocks": 0
    },
    "gtfsFeatures": [
      "Feed Information",
      "Headsigns"
    ]
  },
  "notices": [
    {
      "code": "duplicate_route_name",
      "severity": "WARNING",
      "totalNotices": 6,
      "sampleNotices": [
        {
          "csvRowNumber1": 3,
          "routeId1": "CYCLE_RANDOM_ORDER",
          "csvRowNumber2": 5,
          "routeId2": "CYCLE_SMALL",
          "routeShortName": "A - A",
          "routeLongName": "S: A - A",
          "routeTypeValue": 2,
          "agencyId": "nge"
        },
        {
          "csvRowNumber1": 3,
          "routeId1": "CYCLE_RANDOM_ORDER",
          "csvRowNumber2": 7,
          "routeId2": "CYCLE",
          "routeShortName": "A - A",
          "routeLongName": "S: A - A",
          "routeTypeValue": 2,
          "agencyId": "nge"
        },
        {
          "csvRowNumber1": 4,
          "routeId1": "SIMPLE_PASS",
          "csvRowNumber2": 8,
          "routeId2": "SIMPLE_DOUBLE_PASS",
          "routeShortName": "A - D",
          "routeLongName": "IC: A - D",
          "routeTypeValue": 2,
          "agencyId": "nge"
        },
        {
          "csvRowNumber1": 9,
          "routeId1": "SIMPLE_RANDOM_ORDER",
          "csvRowNumber2": 10,
          "routeId2": "SIMPLE",
          "routeShortName": "D - A",
          "routeLongName": "IC: D - A",
          "routeTypeValue": 2,
          "agencyId": "nge"
        },
        {
          "csvRowNumber1": 9,
          "routeId1": "SIMPLE_RANDOM_ORDER",
          "csvRowNumber2": 11,
          "routeId2": "SIMPLE_DWELL_TIME_CONFLICT",
          "routeShortName": "D - A",
          "routeLongName": "IC: D - A",
          "routeTypeValue": 2,
          "agencyId": "nge"
        },
        {
          "csvRowNumber1": 2,
          "routeId1": "SELF_OVERLAY_RANDOM_ORDER",
          "csvRowNumber2": 13,
          "routeId2": "SELF_OVERLAY",
          "routeShortName": "C - A",
          "routeLongName": "RE: C - A",
          "routeTypeValue": 2,
          "agencyId": "nge"
        }
      ]
    },
    {
      "code": "missing_feed_contact_email_and_url",
      "severity": "WARNING",
      "totalNotices": 1,
      "sampleNotices": [
        {
          "csvRowNumber": 2
        }
      ]
    },
    {
      "code": "number_out_of_range",
      "severity": "ERROR",
      "totalNotices": 16,
      "sampleNotices": [
        {
          "filename": "stops.txt",
          "csvRowNumber": 2,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -192
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 2,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 384
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 3,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -192
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 3,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 1280
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 4,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -192
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 4,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 2304
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 5,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -192
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 5,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 3008
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 6,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -1216
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 6,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 3008
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 7,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -1216
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 7,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 2304
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 8,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -1216
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 8,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 1280
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 9,
          "fieldName": "stop_lat",
          "fieldType": "latitude within [-90, 90]",
          "fieldValue": -1216
        },
        {
          "filename": "stops.txt",
          "csvRowNumber": 9,
          "fieldName": "stop_lon",
          "fieldType": "longitude within [-180, 180]",
          "fieldValue": 384
        }
      ]
    }
  ]
}

- Rename agency_time_zone to agency_timezone.
- Name files agency.txt and calendar.txt correctly.
- Format date in calendar.txt correctly, use sensible limits.
- The concept of a gtfs trip corresponds to a route departure in sense of the converter. So for each departure a new trip has to be added.
- Write calendar availability as integers.
- Set default calendar to a week with all days active.
- Escape " and enclose delimiter with " if it occurs on a CSV value.
- Create route short and long name.
- Set default values in gtfs data model.
- Adjust all integration tests to use the extension.
- Each test case will have a directory structured by the fully specified class path and the method name. Nested tests will create subdirectories.
@munterfi munterfi requested a review from aiAdrian December 3, 2024 16:40
@munterfi munterfi self-assigned this Dec 3, 2024
@munterfi munterfi merged commit 32b70f4 into main Dec 3, 2024
3 checks passed
@munterfi munterfi deleted the fix/gtfs-format branch December 3, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant