entur / netex-gtfs-converter-java

Convert a NeTEx dataset into a GTFS dataset
European Union Public License 1.2
5 stars 3 forks source link

document extended route_type scheme as GTFS proposal/extension? #115

Open derhuerst opened 1 year ago

derhuerst commented 1 year ago

When attempting to import Entur's Norway-wide GTFS feed into a DB using gtfs-via-postgres, I noticed that it uses route_type values specified neither a) in the core GTFS spec (both Google's and MobilityData's version) and b) not in Google's extended GTFS route types extension.

For example, it contains this this route:

agency_id route_id route_short_name route_long_name route_type route_desc
ATB:Authority:2|ATB:Line:2_800|800|Trondheim - Brekstad - Kristiansund|1014`

When talking to @hannesj and searching for 1014, I came across a proposal from 2008 to adopt the TPEG-PTI values.

The two ID schemes differ in some aspects:

diff --git a/tpeg-pti.txt b/google-extended-route-types.txt
index b0e6b2a..a659672 100644
--- a/tpeg-pti.txt
+++ b/google-extended-route-types.txt
@@ -26,14 +26,12 @@
 207 Tourist Coach Service
 208 Commuter Coach Service
 209 All Coach Services
-300 Suburban Railway Service
 400 Urban Railway Service
 401 Metro Service
 402 Underground Service
 403 Urban Railway Service
 404 All Urban Railway Services
-500 Metro Service
-600 Underground Service
+405 Monorail
 700 Bus Service
 701 Regional Bus Service
 702 Express Bus Service
@@ -60,44 +58,9 @@
 905 Shuttle Tram Service
 906 All Tram Services
 1000 Water Transport Service
-1001 International Car Ferry Service
-1002 National Car Ferry Service
-1003 Regional Car Ferry Service
-1004 Local Car Ferry Service
-1005 International Passenger Ferry Service
-1006 National Passenger Ferry Service
-1007 Regional Passenger Ferry Service
-1008 Local Passenger Ferry Service
-1009 Post Boat Service
-1010 Train Ferry Service
-1011 Road-Link Ferry Service
-1012 Airport-Link Ferry Service
-1013 Car High-Speed Ferry Service
-1014 Passenger High-Speed Ferry Service
-1015 Sightseeing Boat Service
-1016 School Boat
-1017 Cable-Drawn Boat Service
-1018 River Bus Service
-1019 Scheduled Ferry Service
-1020 Shuttle Ferry Service
-1021 All Water Transport Services
 1100 Air Service
-1101 International Air Service
-1102 Domestic Air Service
-1103 Intercontinental Air Service
-1104 Domestic Scheduled Air Service
-1105 Shuttle Air Service
-1106 Intercontinental Charter Air Service
-1107 International Charter Air Service
-1108 Round-Trip Charter Air Service
-1109 Sightseeing Air Service
-1110 Helicopter Air Service
-1111 Domestic Charter Air Service
-1112 Schengen-Area Air Service
-1113 Airship Service
-1114 All Air Services
 1200 Ferry Service
-1300 Telecabin Service
+1300 Aerial Lift ServiceRoosevelt Island Tramway (US)
 1301 Telecabin Service
 1302 Cable Car Service
 1303 Elevator Service
@@ -106,8 +69,6 @@
 1306 Small Telecabin Service
 1307 All Telecabin Services
 1400 Funicular Service
-1401 Funicular Service
-1402 All Funicular Service
 1500 Taxi Service
 1501 Communal Taxi Service
 1502 Water Taxi Service
@@ -116,9 +77,5 @@
 1505 Licensed Taxi Service
 1506 Private Hire Service Vehicle
 1507 All Taxi Services
-1600 Self Drive
-1601 Hire Car
-1602 Hire Van
-1603 Hire Motorbike
-1604 Hire Cycle
-1605 All Self-Drive Vehicles
+1700 Miscellaneous Service
+1702 Horse-drawn Carriage

Which scheme does Entur intend to use? The TPEG-PTI one, the Google one, or a custom combination of both?

vpaturet commented 1 year ago

We use a custom combination of both. We map for example the NeTEx vehicle mode "lift" to "telecabin service" (1300, TPEG-PTI), and the NeTEx vehicle mode "other" to "miscellaneous Service" (1700, Google)

derhuerst commented 1 year ago

I think it would be great do document the ID scheme you're using! Entur seems to be a significant player in the GTFS-* and open mobility space, so having this written down as an extension, with Entur's name behind it, would help others not to make up (more) ad-hoc ID schemes, but just re-use Entur's.

Or, a more ambitious path forward might be to agree on an ID scheme that combines Google's IDs with the TPEG-PTI ones. 🚀

vpaturet commented 1 year ago

A first step would be to document here the mapping we use, to make it more visible. It is currently buried deep in the code: https://github.com/entur/netex-gtfs-converter-java/blob/2ae22f219290acab48d58643a80d929074afea94/src/main/java/org/entur/netex/gtfs/export/util/TransportModeUtil.java#L123

vpaturet commented 1 year ago

Documented here: https://github.com/entur/netex-gtfs-converter-java#route-type-mapping

derhuerst commented 1 year ago

Thanks, that already helps a lot!

As I explained, this depends on how much you want (and have time) to contribute to the GTFS ecosystem, but having this as a linkable extension, maybe a separate README.md or a separate repo would also other GTFS/NeTex users to says they're using it too.