From 683a174095eea127de3ce7271e9071287692518b Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Fri, 10 Feb 2023 18:12:39 +0100 Subject: [PATCH 1/7] Add OSM node id into BSS info --- proto/common.proto | 1 + src/mjolnir/pbfgraphparser.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/proto/common.proto b/proto/common.proto index 994397d520..41093efa29 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -149,6 +149,7 @@ message BikeShareStationInfo { string operator = 5; float rent_cost = 6; float return_cost = 7; + float osm_node_id= 8; } message TransitPlatformInfo { diff --git a/src/mjolnir/pbfgraphparser.cc b/src/mjolnir/pbfgraphparser.cc index c280df592a..3c839522d4 100644 --- a/src/mjolnir/pbfgraphparser.cc +++ b/src/mjolnir/pbfgraphparser.cc @@ -1456,6 +1456,7 @@ struct graph_callback : public OSMPBF::Callback { n.set_latlng(lng, lat); n.set_type(NodeType::kBikeShare); valhalla::BikeShareStationInfo bss_info; + bss_info.set_osm_node_id(osmid); for (auto& key_value : *results) { if (key_value.first == "name") { From 5aa26e6db34ffbd95646eed1bc6bfb962946e62f Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Fri, 10 Feb 2023 18:20:33 +0100 Subject: [PATCH 2/7] reapply pr2 and pr3 --- proto/common.proto | 2 +- src/mjolnir/pbfgraphparser.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/common.proto b/proto/common.proto index 41093efa29..02d8dd2dcf 100644 --- a/proto/common.proto +++ b/proto/common.proto @@ -149,7 +149,7 @@ message BikeShareStationInfo { string operator = 5; float rent_cost = 6; float return_cost = 7; - float osm_node_id= 8; + string osm_node_id= 8; } message TransitPlatformInfo { diff --git a/src/mjolnir/pbfgraphparser.cc b/src/mjolnir/pbfgraphparser.cc index 3c839522d4..c2b8515fd1 100644 --- a/src/mjolnir/pbfgraphparser.cc +++ b/src/mjolnir/pbfgraphparser.cc @@ -1456,7 +1456,7 @@ struct graph_callback : public OSMPBF::Callback { n.set_latlng(lng, lat); n.set_type(NodeType::kBikeShare); valhalla::BikeShareStationInfo bss_info; - bss_info.set_osm_node_id(osmid); + bss_info.set_osm_node_id("poi:osm:node:" + std::to_string(osmid)); for (auto& key_value : *results) { if (key_value.first == "name") { From 18736777c586ee4bf6d0086807c07e8547fb5019 Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Fri, 9 Jun 2023 15:54:30 +0200 Subject: [PATCH 3/7] minor fix --- locales/fr-FR.json | 96 +++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/locales/fr-FR.json b/locales/fr-FR.json index 21af70509e..ab7e4eb9bc 100644 --- a/locales/fr-FR.json +++ b/locales/fr-FR.json @@ -45,7 +45,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -85,7 +85,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -143,7 +143,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -175,7 +175,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "metric_lengths": [ " kilomètres", @@ -229,7 +229,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -366,7 +366,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "ferry_label": "Ferry", "example_phrases": { @@ -395,7 +395,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "ferry_label": "Ferry", "example_phrases": { @@ -448,7 +448,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -545,7 +545,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -725,7 +725,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -753,7 +753,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -902,7 +902,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -949,7 +949,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -984,7 +984,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -1023,7 +1023,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -1076,7 +1076,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -1116,7 +1116,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -1163,7 +1163,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "metric_lengths": [ " kilomètres", @@ -1399,7 +1399,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -1439,7 +1439,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -1495,7 +1495,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ @@ -1583,7 +1583,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "metric_lengths": [ " kilomètres", @@ -1958,7 +1958,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -1998,7 +1998,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -2040,7 +2040,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -2088,7 +2088,7 @@ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "relative_directions": [ "gauche", @@ -2175,83 +2175,83 @@ }, "elevator": { "phrases": { - "0": "Take the elevator.", - "1": "Take the elevator to ." + "0": "Prenez l'ascenseur.", + "1": "Prenez l'ascenseur jusqu'au niveau ." }, "example_phrases": { "0": [ - "Take the elevator." + "Prenez l'ascenseur." ], "1": [ - "Take the elevator to Level 1." + "Prenez l'ascenseur jusqu'au niveau 1." ] } }, "steps": { "phrases": { - "0": "Take the stairs.", - "1": "Take the stairs to ." + "0": "Prenez les escaliers.", + "1": "Prenez les escaliers jusqu'au niveau ." }, "example_phrases": { "0": [ - "Take the stairs." + "Prenez les escaliers." ], "1": [ - "Take the stairs to Level 2." + "Prenez les escaliers jusqu'au niveau 1." ] } }, "escalator": { "phrases": { - "0": "Take the escalator.", - "1": "Take the escalator to ." + "0": "Prenez l'escalator.", + "1": "Prenez l'escalator jusqu'au niveau ." }, "example_phrases": { "0": [ - "Take the escalator." + "Prenez l'escalator." ], "1": [ - "Take the escalator to Level 3." + "Prenez l'escalator jusqu'au niveau 1." ] } }, "enter_building": { "phrases": { - "0": "Enter the building.", - "1": "Enter the building, and continue on ." + "0": "Entrez dans le bâtiment.", + "1": "Entrez dans le bâtiment et continuez sur ." }, "empty_street_name_labels": [ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ - "Enter the building." + "Entrez dans le bâtiment." ], "1": [ - "Enter the building, and continue on the walkway." + "Entrez dans le bâtiment et continuez sur le passage protégé." ] } }, "exit_building": { "phrases": { - "0": "Exit the building.", - "1": "Exit the building, and continue on ." + "0": "Sortez du bâtiment.", + "1": "Sortez du bâtiment et continuez sur ." }, "empty_street_name_labels": [ "l'allée", "la piste cyclable", "la piste de vélo de montagne", - "the crosswalk" + "le passage protégé" ], "example_phrases": { "0": [ - "Exit the building." + "Sortez du bâtiment." ], "1": [ - "Exit the building, and continue on the walkway." + "Sortez du bâtiment et continuez sur le passage protégé." ] } } From 8b360f46456b81bbaa5b312a0aece999ca744df1 Mon Sep 17 00:00:00 2001 From: "patrick.qian" Date: Tue, 8 Aug 2023 23:45:01 +0200 Subject: [PATCH 4/7] fix crash in bss matrix --- src/thor/timedistancebssmatrix.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/thor/timedistancebssmatrix.cc b/src/thor/timedistancebssmatrix.cc index 84b5ffb7a5..2198cc570b 100644 --- a/src/thor/timedistancebssmatrix.cc +++ b/src/thor/timedistancebssmatrix.cc @@ -99,8 +99,7 @@ void TimeDistanceBSSMatrix::Expand(GraphReader& graphreader, const DirectedEdge* opp_edge = nullptr; if (!FORWARD) { // Get opposing edge Id and end node tile - graph_tile_ptr t2 = - directededge->leaves_tile() ? graphreader.GetGraphTile(directededge->endnode()) : tile; + t2 =directededge->leaves_tile() ? graphreader.GetGraphTile(directededge->endnode()) : tile; if (t2 == nullptr) { continue; } From 3adfe0c82c483057482842728bc5d328e1f6fca1 Mon Sep 17 00:00:00 2001 From: Patrick Qian Date: Wed, 9 Aug 2023 09:18:16 +0200 Subject: [PATCH 5/7] Update src/thor/timedistancebssmatrix.cc --- src/thor/timedistancebssmatrix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thor/timedistancebssmatrix.cc b/src/thor/timedistancebssmatrix.cc index 2198cc570b..75fdf40a3a 100644 --- a/src/thor/timedistancebssmatrix.cc +++ b/src/thor/timedistancebssmatrix.cc @@ -99,7 +99,7 @@ void TimeDistanceBSSMatrix::Expand(GraphReader& graphreader, const DirectedEdge* opp_edge = nullptr; if (!FORWARD) { // Get opposing edge Id and end node tile - t2 =directededge->leaves_tile() ? graphreader.GetGraphTile(directededge->endnode()) : tile; + t2 = directededge->leaves_tile() ? graphreader.GetGraphTile(directededge->endnode()) : tile; if (t2 == nullptr) { continue; } From 042c8d860f7876b7a2ea8e0534ee2d65fdd27218 Mon Sep 17 00:00:00 2001 From: Patrick Qian Date: Tue, 19 Sep 2023 09:31:15 +0200 Subject: [PATCH 6/7] use tobler's function to adjust grade based speed factor --- src/sif/pedestriancost.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/sif/pedestriancost.cc b/src/sif/pedestriancost.cc index 690a8b1ae4..8288299c11 100644 --- a/src/sif/pedestriancost.cc +++ b/src/sif/pedestriancost.cc @@ -186,14 +186,24 @@ const BaseCostingOptionsConfig kBaseCostOptsConfig = GetBaseCostOptsConfig(); // instead up the values of ascent/descent, e.g. 400/800 better matches // intermediate hikers. This will bring the uphill values quite close to the // ones from the exponential while still keeping downhill speed below flat speed. +// +// For negative angles(downhill), according to the DIN 33466, the speed decrease +// rapidly as it goes steeper, which could be true for moutain hikers because of +// the unpaved paths. However, we found it's against common sense that the speed +// factor goes under 1.0 (walk speed on a flat terrain) on a slight downhill slope, +// especially for city walkers. Thus, a modified Tobler's function is used here to +// correct the factor for negative angles. Hence, the walk speed increase slightly +// (faster than on a flat terrain) when the angle is between 0% and -5%, then +// decrease as shown by DIN 33466. +// see https://gist.github.com/xlqian/0b25c8db6f45fb2c8bf68494e1ea54f1 constexpr float kGradeBasedSpeedFactor[] = { - 1.40f, // -10.0% - 0.67 - 1.32f, // -8.0% - 0.73 - 1.26f, // -6.5% - 0.77 - 1.20f, // -5.0% - 0.82 - 1.12f, // -3.0% - 0.89 - 1.06f, // -1.5% - 0.94 + 1.33f, // -10.0% - 0.67 + 1.22f, // -8.0% - 0.73 + 1.08f, // -6.5% - 0.77 + 0.97f, // -5.0% - 0.82 + 0.88f, // -3.0% - 0.89 + 0.92f, // -1.5% - 0.94 1.00f, // 0.0% - 1.00 1.10f, // 1.5% - 1.06 1.20f, // 3.0% - 1.13 From 9a76354aaf3751d65bd5bbf044b5538bf05146a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 19 Jan 2025 00:15:44 +0000 Subject: [PATCH 7/7] bumped tz to 2025a --- third_party/tz | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/tz b/third_party/tz index 380c07cef0..a8e2fcd87b 160000 --- a/third_party/tz +++ b/third_party/tz @@ -1 +1 @@ -Subproject commit 380c07cef01c71c1f93e9709d9f8c79b91cff063 +Subproject commit a8e2fcd87bc5f83fec0a76652095e8d7881b0763