From e40e0541586755ddf2459d9b6c03d479068e370b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Tue, 18 Aug 2026 10:43:00 -0400 Subject: [PATCH 1/3] GTFS Static > add stop timezone (FF) --- src/main/java/org/mtransit/commons/FeatureFlags.kt | 3 +++ src/main/java/org/mtransit/commons/GTFSCommons.kt | 3 +++ src/main/java/org/mtransit/commons/gtfs/data/Stop.kt | 2 +- src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/mtransit/commons/FeatureFlags.kt b/src/main/java/org/mtransit/commons/FeatureFlags.kt index dc6f1a9..7feace9 100644 --- a/src/main/java/org/mtransit/commons/FeatureFlags.kt +++ b/src/main/java/org/mtransit/commons/FeatureFlags.kt @@ -71,5 +71,8 @@ object FeatureFlags { // const val F_EXPORT_DIRECTION_STOP_LAST = false const val F_EXPORT_DIRECTION_STOP_LAST = true + const val F_EXPORT_STOP_TIMEZONE_ID = false + // const val F_EXPORT_STOP_TIMEZONE_ID = true + // @formatter:on } diff --git a/src/main/java/org/mtransit/commons/GTFSCommons.kt b/src/main/java/org/mtransit/commons/GTFSCommons.kt index 17b9480..be04fea 100644 --- a/src/main/java/org/mtransit/commons/GTFSCommons.kt +++ b/src/main/java/org/mtransit/commons/GTFSCommons.kt @@ -174,6 +174,7 @@ object GTFSCommons { const val T_STOP_K_LNG = "lng" const val T_STOP_K_ACCESSIBLE = "a11y" const val T_STOP_K_ORIGINAL_ID_HASH = "o_id_hash" + const val T_STOP_K_TIMEZONE_ID = "tz" @JvmField val T_STOP_STRINGS_COLUMN_IDX = intArrayOf(2) @@ -187,6 +188,7 @@ object GTFSCommons { appendColumn(T_STOP_K_LNG, SQLUtils.REAL) appendColumn(T_STOP_K_ACCESSIBLE, SQLUtils.INT) appendColumn(T_STOP_K_ORIGINAL_ID_HASH, SQLUtils.INT) + appendColumn(T_STOP_K_TIMEZONE_ID, SQLUtils.TXT) }.build() @JvmStatic @@ -198,6 +200,7 @@ object GTFSCommons { appendColumn(T_STOP_K_LNG) appendColumn(T_STOP_K_ACCESSIBLE) appendColumn(T_STOP_K_ORIGINAL_ID_HASH) + appendColumn(T_STOP_K_TIMEZONE_ID) }.build() @JvmStatic diff --git a/src/main/java/org/mtransit/commons/gtfs/data/Stop.kt b/src/main/java/org/mtransit/commons/gtfs/data/Stop.kt index 692c636..6350c50 100644 --- a/src/main/java/org/mtransit/commons/gtfs/data/Stop.kt +++ b/src/main/java/org/mtransit/commons/gtfs/data/Stop.kt @@ -14,7 +14,7 @@ data class Stop( val stopUrl: Url?, val locationType: Int?, // TODO Enum val parentStationId: StopId?, - // stop_timezone + val stopTimezone: String?, val wheelchairBoarding: Int?, // TODO Enum 0 1 2 // level_id // val platformCode: Text?, // TODO useful! diff --git a/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt b/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt index a4dcaac..ba8b313 100644 --- a/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt +++ b/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt @@ -40,6 +40,7 @@ object StopSQL : CommonSQL(), TableSQL { const val T_STOP_K_STOP_URL = "stop_url" const val T_STOP_K_LOCATION_TYPE = "location_type" const val T_STOP_K_PARENT_STATION_ID_INT = "parent_station_id_int" + const val T_STOP_K_STOP_TIMEZONE = "stop_timezone" const val T_STOP_K_WHEELCHAIR_BOARDING = "wheelchair_boarding" override fun getMainTable() = SQLTableDef( @@ -53,6 +54,7 @@ object StopSQL : CommonSQL(), TableSQL { SQLColumDef(T_STOP_K_STOP_URL, SQLUtils.TXT), SQLColumDef(T_STOP_K_LOCATION_TYPE, SQLUtils.INT), SQLColumDef(T_STOP_K_PARENT_STATION_ID_INT, SQLUtils.INT, foreignKey = SQLForeignKey(T_STOP_IDS, T_STOP_IDS_K_ID_INT)), + SQLColumDef(T_STOP_K_STOP_TIMEZONE, SQLUtils.TXT), SQLColumDef(T_STOP_K_WHEELCHAIR_BOARDING, SQLUtils.INT), ), insertAllowReplace = false, @@ -68,6 +70,7 @@ object StopSQL : CommonSQL(), TableSQL { stopUrl?.quotesEscape(), locationType, parentStationId?.let { getOrInsertIdInt(statement, it) }, + stopTimezone, wheelchairBoarding, ) } @@ -105,6 +108,7 @@ object StopSQL : CommonSQL(), TableSQL { stopUrl = getString(T_STOP_K_STOP_URL), locationType = getInt(T_STOP_K_LOCATION_TYPE), parentStationId = getString(getAlias(T_STOP_K_PARENT_STATION_ID_INT, T_STOP_IDS_K_ID)), + stopTimezone = getString(T_STOP_K_STOP_TIMEZONE), wheelchairBoarding = getInt(T_STOP_K_WHEELCHAIR_BOARDING), ) } From fa16cd42717302af855c5ac5b32a53a33ea7e157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Tue, 18 Aug 2026 11:30:59 -0400 Subject: [PATCH 2/3] fix --- src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt b/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt index ba8b313..f997740 100644 --- a/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt +++ b/src/main/java/org/mtransit/commons/gtfs/sql/StopSQL.kt @@ -70,7 +70,7 @@ object StopSQL : CommonSQL(), TableSQL { stopUrl?.quotesEscape(), locationType, parentStationId?.let { getOrInsertIdInt(statement, it) }, - stopTimezone, + stopTimezone?.quotesEscape(), wheelchairBoarding, ) } From dbee26192bbb3ca7b7f872139e1c60d4f714fc96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathieu=20M=C3=A9a?= Date: Tue, 18 Aug 2026 14:23:51 -0400 Subject: [PATCH 3/3] wip --- src/main/java/org/mtransit/commons/GTFSCommons.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/mtransit/commons/GTFSCommons.kt b/src/main/java/org/mtransit/commons/GTFSCommons.kt index be04fea..374e4f9 100644 --- a/src/main/java/org/mtransit/commons/GTFSCommons.kt +++ b/src/main/java/org/mtransit/commons/GTFSCommons.kt @@ -188,7 +188,9 @@ object GTFSCommons { appendColumn(T_STOP_K_LNG, SQLUtils.REAL) appendColumn(T_STOP_K_ACCESSIBLE, SQLUtils.INT) appendColumn(T_STOP_K_ORIGINAL_ID_HASH, SQLUtils.INT) - appendColumn(T_STOP_K_TIMEZONE_ID, SQLUtils.TXT) + if (FeatureFlags.F_EXPORT_STOP_TIMEZONE_ID) { + appendColumn(T_STOP_K_TIMEZONE_ID, SQLUtils.TXT) + } }.build() @JvmStatic @@ -200,7 +202,9 @@ object GTFSCommons { appendColumn(T_STOP_K_LNG) appendColumn(T_STOP_K_ACCESSIBLE) appendColumn(T_STOP_K_ORIGINAL_ID_HASH) - appendColumn(T_STOP_K_TIMEZONE_ID) + if (FeatureFlags.F_EXPORT_STOP_TIMEZONE_ID) { + appendColumn(T_STOP_K_TIMEZONE_ID) + } }.build() @JvmStatic