Skip to content

Commit

Permalink
Improve differentiation between different types of crossings
Browse files Browse the repository at this point in the history
  • Loading branch information
7h30n3 committed Apr 12, 2024
1 parent f5e89de commit 0e0e7b4
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 23 deletions.
95 changes: 92 additions & 3 deletions assets/question_catalog/definition.json
Original file line number Diff line number Diff line change
Expand Up @@ -2809,23 +2809,40 @@
"!parent": [
{
"osm_tags": {
"highway": "footway",
"footway": "crossing"
}
},
{
"osm_tags": {
"highway": "cycleway",
"cycleway": "crossing"
}
},
{
"osm_tags": {
"highway": "path",
"path": "crossing"
}
}
],
"parent": [
{
"osm_tags": {
"highway": "footway",
"bicycle": ["designated", "dismount", "yes"]
}
},
{
"osm_tags": {
"highway": "cycleway",
"foot": ["designated", "yes"]
}
},
{
"osm_tags": {
"bicycle": ["designated", "dismount", "yes"],
"foot": ["designated", "yes"]
}
}
],
"osm_element": "Node"
},
{
Expand Down Expand Up @@ -2967,6 +2984,42 @@
],
"osm_element": "Node"
},
{
"osm_tags": {
"highway": "crossing",
"crossing": [false, "island", "traffic_signals"],
"crossing:markings": false,
"bicycle": [false, "no"]
},
"!parent": [
{
"osm_tags": {
"footway": "crossing"
}
},
{
"osm_tags": {
"cycleway": "crossing"
}
},
{
"osm_tags": {
"path": "crossing"
}
}
],
"parent": [
{
"osm_tags": {
"highway": "footway"
},
"!osm_tags": {
"bicycle": ["yes", "dismount", "designated"]
}
}
],
"osm_element": "Node"
},
{
"osm_tags": {
"highway": "path",
Expand Down Expand Up @@ -3073,6 +3126,42 @@
],
"osm_element": "Node"
},
{
"osm_tags": {
"highway": "crossing",
"crossing": [false, "island", "traffic_signals"],
"crossing:markings": false,
"foot": [false, "no"]
},
"!parent": [
{
"osm_tags": {
"footway": "crossing"
}
},
{
"osm_tags": {
"cycleway": "crossing"
}
},
{
"osm_tags": {
"path": "crossing"
}
}
],
"parent": [
{
"osm_tags": {
"highway": "cycleway"
},
"!osm_tags": {
"foot": ["yes", "designated"]
}
}
],
"osm_element": "Node"
},
{
"osm_tags": {
"highway": "path",
Expand Down
58 changes: 38 additions & 20 deletions lib/models/map_features/map_features.dart
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,25 @@ final _globalDefinitions = <MapFeatureDefinition>[
]),
}),
]),
ElementCondition([
TagsSubCondition({
'highway': StringValueMatcher('crossing'),
}),
ParentSubCondition([
ElementCondition([
TagsSubCondition({
'highway': StringValueMatcher('footway')
}),
NegatedSubCondition(TagsSubCondition({
'bicycle': MultiValueMatcher([
StringValueMatcher('yes'),
StringValueMatcher('designated'),
]),
}))
])
]),
ElementTypeSubCondition([OSMElementType.node])
])
],
),
MapFeatureDefinition(
Expand Down Expand Up @@ -667,38 +686,37 @@ final _globalDefinitions = <MapFeatureDefinition>[
}),
ElementTypeSubCondition([OSMElementType.openWay])
]),
],
),
MapFeatureDefinition(
label: (locale, _) => locale.mapFeatureCurb,
icon: TemakiIcons.kerbRaised,
conditions: const [
ElementCondition([
TagsSubCondition({
'barrier': StringValueMatcher('kerb'),
'highway': StringValueMatcher('crossing'),
}),
ParentSubCondition([
ElementCondition([
TagsSubCondition({
'highway': StringValueMatcher('cycleway')
}),
NegatedSubCondition(TagsSubCondition({
'foot': MultiValueMatcher([
StringValueMatcher('yes'),
StringValueMatcher('designated'),
]),
}))
])
]),
ElementTypeSubCondition([OSMElementType.node])
]),
],
),
MapFeatureDefinition(
label: (locale, _) => locale.mapFeaturePedestrianLights,
icon: TemakiIcons.trafficSignals,
label: (locale, _) => locale.mapFeatureCurb,
icon: TemakiIcons.kerbRaised,
conditions: const [
ElementCondition([
TagsSubCondition({
'highway': StringValueMatcher('crossing'),
'crossing': StringValueMatcher('traffic_signals'),
}),
ElementTypeSubCondition([OSMElementType.node, OSMElementType.openWay])
]),
ElementCondition([
TagsSubCondition({
'highway': StringValueMatcher('crossing'),
'crossing:signals': StringValueMatcher('yes'),
'barrier': StringValueMatcher('kerb'),
}),
ElementTypeSubCondition([OSMElementType.node, OSMElementType.openWay])
ElementTypeSubCondition([OSMElementType.node])
]),
],
),
)
];

0 comments on commit 0e0e7b4

Please sign in to comment.