Skip to content

Commit 150bab1

Browse files
Various fixes
1 parent bba4765 commit 150bab1

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

docs/areas.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Example of a process_way function:
7676
```lua
7777
function process_way(profile, way, result, relations)
7878
...
79-
if way:get_value_by_key('highway') == 'pedestrian' then
79+
if way:get_value_by_key('highway') == 'pedestrian' and way:get_value_by_key('area') == 'yes' then
8080
-- register the way
8181
area_manager:way(way)
8282
end
@@ -86,6 +86,7 @@ function process_way(profile, way, result, relations)
8686
-- we have to set at least one defining tag
8787
local rel = relations:relation(rel_id)
8888
data.highway = rel:get_value_by_key('highway')
89+
WayHandlers.names(profile, rel, result, data)
8990
end
9091
...
9192
end

features/foot/area_mesh.feature

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Feature: Foot - Pedestrian areas
44
Background:
55
Given the profile "foot_area"
66
Given a grid size of 50 meters
7-
Given the extract extra arguments "--verbosity DEBUG"
7+
# Given the extract extra arguments "--verbosity DEBUG"
88
Given the query options
99
| annotations | nodes |
1010

@@ -31,6 +31,29 @@ Feature: Foot - Pedestrian areas
3131
| h | f | hdbf |
3232
| f | h | fbdh |
3333

34+
Scenario: Foot - Do not route across a closed way w/o area
35+
Given the node map
36+
"""
37+
e-a---b-f
38+
| |
39+
h-d---c-g
40+
"""
41+
42+
And the ways
43+
| nodes | highway |
44+
| abcda | pedestrian |
45+
| ea | pedestrian |
46+
| bf | pedestrian |
47+
| hd | pedestrian |
48+
| cg | pedestrian |
49+
50+
When I route I should get
51+
| from | to | a:nodes |
52+
| e | g | eabcg |
53+
| g | e | gcbae |
54+
| h | f | hdabf |
55+
| f | h | fbadh |
56+
3457
Scenario: Foot - Route across a multipolygon area
3558
Given the node map
3659
"""

include/util/coordinate.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
#include <boost/numeric/conversion/cast.hpp>
3434

3535
#include <cstdint>
36+
#include <osmium/osm/location.hpp>
3637
#include <type_traits>
3738

3839
namespace osrm
3940
{
4041

41-
constexpr const double COORDINATE_PRECISION = 1e6;
42+
constexpr const double COORDINATE_PRECISION = 1e6; // (double)osmium::detail::coordinate_precision;
4243

4344
namespace util
4445
{

profiles/foot_area.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function process_way(profile, way, result, relations)
195195
public_transport = way:get_value_by_key('public_transport')
196196
}
197197

198-
if data.highway == 'pedestrian' then
198+
if data.highway == 'pedestrian' and way:get_value_by_key('area') == 'yes' then
199199
area_manager:way(way)
200200
end
201201

src/extractor/extractor.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "util/timing_util.hpp"
3636

3737
// Keep debug include to make sure the debug header is in sync with types.
38-
// NOLINTNEXTLINE(unused-includes)
3938
#include "util/debug.hpp"
4039

4140
#include <boost/assert.hpp>

0 commit comments

Comments
 (0)