Adds presets for Traffic Sign, Speed Limit Sign, and City Limit Sign, each with point/vertex variants to account for different direction fields

Makes the maxspeed field compatible with node entities
This commit is contained in:
Quincy Morgan
2018-09-26 19:35:44 -07:00
parent 85383c314d
commit cd8be8b5b4
13 changed files with 227 additions and 1 deletions
+33
View File
@@ -1730,6 +1730,9 @@ en:
traffic_calming:
# traffic_calming=*
label: Type
traffic_sign:
# traffic_sign=*
label: Traffic Sign
traffic_signals:
# traffic_signals=*
label: Type
@@ -6079,6 +6082,36 @@ en:
name: Speed Table
# 'terms: flat top,hump,speed,slow'
terms: '<translate with synonyms or related terms for ''Speed Table'', separated by commas>'
traffic_sign:
# traffic_sign=*
name: Traffic Sign
# 'terms: road,highway'
terms: '<translate with synonyms or related terms for ''Traffic Sign'', separated by commas>'
traffic_sign/city_limit:
# traffic_sign=city_limit
name: City Limit Sign
# 'terms: town,village,hamlet,boundary,edge,border,road,highway'
terms: '<translate with synonyms or related terms for ''City Limit Sign'', separated by commas>'
traffic_sign/city_limit_vertex:
# traffic_sign=city_limit
name: City Limit Sign
# 'terms: town,village,hamlet,boundary,edge,border,road,highway'
terms: '<translate with synonyms or related terms for ''City Limit Sign'', separated by commas>'
traffic_sign/maxspeed:
# traffic_sign=maxspeed
name: Speed Limit Sign
# 'terms: max speed,maximum speed,road,highway'
terms: '<translate with synonyms or related terms for ''Speed Limit Sign'', separated by commas>'
traffic_sign/maxspeed_vertex:
# traffic_sign=maxspeed
name: Speed Limit Sign
# 'terms: max speed,maximum speed,road,highway'
terms: '<translate with synonyms or related terms for ''Speed Limit Sign'', separated by commas>'
traffic_sign_vertex:
# traffic_sign=*
name: Traffic Sign
# 'terms: road,highway'
terms: '<translate with synonyms or related terms for ''Traffic Sign'', separated by commas>'
type/boundary:
# type=boundary
name: Boundary
+1
View File
@@ -301,6 +301,7 @@
"tracktype": {"key": "tracktype", "type": "combo", "label": "Track Type", "placeholder": "Solid, Mostly Solid, Soft...", "strings": {"options": {"grade1": "Solid: paved or heavily compacted hardcore surface", "grade2": "Mostly Solid: gravel/rock with some soft material mixed in", "grade3": "Even mixture of hard and soft materials", "grade4": "Mostly Soft: soil/sand/grass with some hard material mixed in", "grade5": "Soft: soil/sand/grass"}}},
"trade": {"key": "trade", "type": "typeCombo", "label": "Type"},
"traffic_calming": {"key": "traffic_calming", "type": "typeCombo", "label": "Type"},
"traffic_sign": {"key": "traffic_sign", "type": "typeCombo", "label": "Traffic Sign"},
"traffic_signals": {"key": "traffic_signals", "type": "combo", "label": "Type", "default": "signal"},
"traffic_signals/direction": {"key": "traffic_signals:direction", "type": "combo", "label": "Direction", "strings": {"options": {"forward": "Forward", "backward": "Backward", "both": "Both / All"}}},
"trail_visibility": {"key": "trail_visibility", "type": "combo", "label": "Trail Visibility", "placeholder": "Excellent, Good, Bad...", "strings": {"options": {"excellent": "Excellent: unambiguous path or markers everywhere", "good": "Good: markers visible, sometimes require searching", "intermediate": "Intermediate: few markers, path mostly visible", "bad": "Bad: no markers, path sometimes invisible/pathless", "horrible": "Horrible: often pathless, some orientation skills required", "no": "No: pathless, excellent orientation skills required"}}},
+5
View File
@@ -0,0 +1,5 @@
{
"key": "traffic_sign",
"type": "typeCombo",
"label": "Traffic Sign"
}
+6
View File
@@ -926,6 +926,12 @@
"traffic_calming/island": {"icon": "temaki-diamond", "geometry": ["vertex"], "terms": ["circle", "roundabout", "slow"], "tags": {"traffic_calming": "island"}, "name": "Traffic Island"},
"traffic_calming/rumble_strip": {"icon": "temaki-diamond", "fields": ["direction_vertex"], "geometry": ["vertex", "line"], "terms": ["audible lines", "sleeper lines", "growlers"], "tags": {"traffic_calming": "rumble_strip"}, "name": "Rumble Strip"},
"traffic_calming/table": {"icon": "temaki-diamond", "fields": ["surface"], "geometry": ["vertex"], "tags": {"traffic_calming": "table"}, "terms": ["flat top", "hump", "speed", "slow"], "name": "Speed Table"},
"traffic_sign_vertex": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction_vertex"], "geometry": ["vertex"], "tags": {"traffic_sign": "*"}, "terms": ["road", "highway"], "name": "Traffic Sign"},
"traffic_sign": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction"], "geometry": ["point"], "tags": {"traffic_sign": "*"}, "terms": ["road", "highway"], "name": "Traffic Sign"},
"traffic_sign/city_limit_vertex": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction_vertex", "name"], "geometry": ["vertex"], "tags": {"traffic_sign": "city_limit"}, "terms": ["town", "village", "hamlet", "boundary", "edge", "border", "road", "highway"], "name": "City Limit Sign"},
"traffic_sign/city_limit": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction", "name"], "geometry": ["point"], "tags": {"traffic_sign": "city_limit"}, "terms": ["town", "village", "hamlet", "boundary", "edge", "border", "road", "highway"], "name": "City Limit Sign"},
"traffic_sign/maxspeed_vertex": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction_vertex", "maxspeed"], "geometry": ["vertex"], "tags": {"traffic_sign": "maxspeed"}, "terms": ["max speed", "maximum speed", "road", "highway"], "name": "Speed Limit Sign"},
"traffic_sign/maxspeed": {"icon": "maki-square-stroked", "fields": ["traffic_sign", "direction", "maxspeed"], "geometry": ["point"], "tags": {"traffic_sign": "maxspeed"}, "terms": ["max speed", "maximum speed", "road", "highway"], "name": "Speed Limit Sign"},
"type/multipolygon": {"icon": "iD-multipolygon", "geometry": ["area", "relation"], "tags": {"type": "multipolygon"}, "removeTags": {}, "name": "Multipolygon", "searchable": false, "matchScore": 0.1},
"type/boundary": {"icon": "iD-boundary", "fields": ["name", "boundary"], "geometry": ["relation"], "tags": {"type": "boundary"}, "name": "Boundary"},
"type/boundary/administrative": {"icon": "iD-boundary", "fields": ["name", "admin_level"], "geometry": ["relation"], "tags": {"type": "boundary", "boundary": "administrative"}, "reference": {"key": "boundary", "value": "administrative"}, "name": "Administrative Boundary"},
+18
View File
@@ -0,0 +1,18 @@
{
"icon": "maki-square-stroked",
"fields": [
"traffic_sign",
"direction"
],
"geometry": [
"point"
],
"tags": {
"traffic_sign": "*"
},
"terms": [
"road",
"highway"
],
"name": "Traffic Sign"
}
@@ -0,0 +1,25 @@
{
"icon": "maki-square-stroked",
"fields": [
"traffic_sign",
"direction",
"name"
],
"geometry": [
"point"
],
"tags": {
"traffic_sign": "city_limit"
},
"terms": [
"town",
"village",
"hamlet",
"boundary",
"edge",
"border",
"road",
"highway"
],
"name": "City Limit Sign"
}
@@ -0,0 +1,25 @@
{
"icon": "maki-square-stroked",
"fields": [
"traffic_sign",
"direction_vertex",
"name"
],
"geometry": [
"vertex"
],
"tags": {
"traffic_sign": "city_limit"
},
"terms": [
"town",
"village",
"hamlet",
"boundary",
"edge",
"border",
"road",
"highway"
],
"name": "City Limit Sign"
}
@@ -0,0 +1,21 @@
{
"icon": "maki-square-stroked",
"fields": [
"traffic_sign",
"direction",
"maxspeed"
],
"geometry": [
"point"
],
"tags": {
"traffic_sign": "maxspeed"
},
"terms": [
"max speed",
"maximum speed",
"road",
"highway"
],
"name": "Speed Limit Sign"
}
@@ -0,0 +1,21 @@
{
"icon": "maki-square-stroked",
"fields": [
"traffic_sign",
"direction_vertex",
"maxspeed"
],
"geometry": [
"vertex"
],
"tags": {
"traffic_sign": "maxspeed"
},
"terms": [
"max speed",
"maximum speed",
"road",
"highway"
],
"name": "Speed Limit Sign"
}
@@ -0,0 +1,18 @@
{
"icon": "maki-square-stroked",
"fields": [
"traffic_sign",
"direction_vertex"
],
"geometry": [
"vertex"
],
"tags": {
"traffic_sign": "*"
},
"terms": [
"road",
"highway"
],
"name": "Traffic Sign"
}
+20
View File
@@ -6073,6 +6073,26 @@
"object_types": ["node", "way"],
"icon_url": "https://raw.githubusercontent.com/bhousel/temaki/master/icons/diamond.svg?sanitize=true"
},
{
"key": "traffic_sign",
"description": "Traffic Sign",
"object_types": ["node"],
"icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/square-stroked-15.svg?sanitize=true"
},
{
"key": "traffic_sign",
"value": "city_limit",
"description": "City Limit Sign",
"object_types": ["node"],
"icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/square-stroked-15.svg?sanitize=true"
},
{
"key": "traffic_sign",
"value": "maxspeed",
"description": "Speed Limit Sign",
"object_types": ["node"],
"icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/square-stroked-15.svg?sanitize=true"
},
{
"key": "type",
"value": "multipolygon",
+27
View File
@@ -2903,6 +2903,9 @@
"traffic_calming": {
"label": "Type"
},
"traffic_sign": {
"label": "Traffic Sign"
},
"traffic_signals": {
"label": "Type"
},
@@ -6749,6 +6752,30 @@
"name": "Speed Table",
"terms": "flat top,hump,speed,slow"
},
"traffic_sign_vertex": {
"name": "Traffic Sign",
"terms": "road,highway"
},
"traffic_sign": {
"name": "Traffic Sign",
"terms": "road,highway"
},
"traffic_sign/city_limit_vertex": {
"name": "City Limit Sign",
"terms": "town,village,hamlet,boundary,edge,border,road,highway"
},
"traffic_sign/city_limit": {
"name": "City Limit Sign",
"terms": "town,village,hamlet,boundary,edge,border,road,highway"
},
"traffic_sign/maxspeed_vertex": {
"name": "Speed Limit Sign",
"terms": "max speed,maximum speed,road,highway"
},
"traffic_sign/maxspeed": {
"name": "Speed Limit Sign",
"terms": "max speed,maximum speed,road,highway"
},
"type/multipolygon": {
"name": "Multipolygon",
"terms": ""
+7 -1
View File
@@ -49,8 +49,14 @@ export function uiFieldMaxspeed(field, context) {
.on('change', change)
.on('blur', change);
var childNodes = context.graph().childNodes(context.entity(entity.id)),
var loc;
if (entity.type === 'node') {
loc = entity.loc;
}
else {
var childNodes = context.graph().childNodes(context.entity(entity.id));
loc = childNodes[~~(childNodes.length/2)].loc;
}
isImperial = _some(dataImperial.features, function(f) {
return _some(f.geometry.coordinates, function(d) {