From ab9ba0a6325fa49011ecceabee80d3bf80dfc7fb Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 9 Apr 2018 16:06:58 -0400 Subject: [PATCH] Several changes * Proper Case all the things * Remove the `trailblazing_` fields, which require special knowledge to use * Fix the icon on `trail_riding_station` preset * Make the `horse_` checkboxes more consistent (yes/no) * Remove `watering_place` field, remove it from `amenity=fountain` preset * Update build script to not include "undefined" values in `taginfo.json` --- build_data.js | 1 + data/presets.yaml | 49 ++++++++++++++ data/presets/fields.json | 66 +++++++++++++++++++ data/presets/fields/distance.json | 3 +- data/presets/fields/horse_dressage.json | 8 ++- data/presets/fields/horse_riding.json | 8 ++- data/presets/fields/horse_stables.json | 10 ++- data/presets/fields/trailblazing_osmc.json | 5 -- data/presets/fields/trailblazing_text.json | 5 -- data/presets/fields/trailblazing_wiki.json | 5 -- data/presets/fields/watering_place.json | 5 -- data/presets/presets.json | 37 ++++++++++- data/presets/presets/amenity/fountain.json | 3 +- .../presets/tourism/trail_riding_station.json | 4 +- data/presets/presets/type/route/hiking.json | 5 +- data/presets/presets/type/route/horse.json | 7 +- data/taginfo.json | 58 ++++++++++++++-- dist/locales/en.json | 40 +++++++++++ 18 files changed, 267 insertions(+), 52 deletions(-) delete mode 100644 data/presets/fields/trailblazing_osmc.json delete mode 100644 data/presets/fields/trailblazing_text.json delete mode 100644 data/presets/fields/trailblazing_wiki.json delete mode 100644 data/presets/fields/watering_place.json diff --git a/build_data.js b/build_data.js index d77cae01f..7ed3f53bc 100644 --- a/build_data.js +++ b/build_data.js @@ -359,6 +359,7 @@ function generateTaginfo(presets, fields) { if (field.strings && field.strings.options) { var values = Object.keys(field.strings.options); values.forEach(function(value) { + if (value === 'undefined' || value === '*' || value === '') return; var tag = { key: key, value: value }; if (field.label) { tag.description = [ field.label ]; diff --git a/data/presets.yaml b/data/presets.yaml index 05e9794df..28ef3fd4e 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -493,6 +493,9 @@ en: display: # display=* label: Display + distance: + # distance=* + label: Total Distance dock: # dock=* label: Type @@ -669,6 +672,48 @@ en: label: Hoops # hoops field placeholder placeholder: '1, 2, 4...' + horse_dressage: + # sport=* + label: Dressage Riding + options: + # sport=equestrian + equestrian: 'Yes' + # sport=undefined + undefined: 'No' + horse_riding: + # leisure=* + label: Horseback Riding + options: + # leisure=horse_riding + horse_riding: 'Yes' + # leisure=undefined + undefined: 'No' + horse_scale: + # horse_scale=* + label: Horseback Riding Difficulty + options: + # horse_scale=common + common: 'Easy: No problems or difficulties. (default)' + # horse_scale=critical + critical: 'Borderline: Passable only for experienced riders and horses. Major obstacles. Bridges should be examined carefully.' + # horse_scale=dangerous + dangerous: 'Dangerous: Passable only for very experienced riders and horses and only in good weather. Dismount.' + # horse_scale=demanding + demanding: 'Use with caution: Uneven way, occasional difficult passages.' + # horse_scale=difficult + difficult: 'Difficult: Way narrow and exposed. May contain obstacles to step over and narrow passages.' + # horse_scale=impossible + impossible: 'Impassable: Way or bridge not passable for horses. Too narrow, insuffient support, obstacles like ladders. Danger of life.' + # horse_scale field placeholder + placeholder: 'Difficult, Dangerous...' + horse_stables: + # amenity=* + label: Riding Stable + options: + # amenity=stables + stables: 'Yes' + # amenity=undefined + undefined: 'No' iata: # iata=* label: IATA @@ -5620,6 +5665,10 @@ en: # tourism=theme_park name: Theme Park terms: '' + tourism/trail_riding_station: + # tourism=trail_riding_station + name: Trail Riding Station + terms: '' tourism/viewpoint: # tourism=viewpoint name: Viewpoint diff --git a/data/presets/fields.json b/data/presets/fields.json index a0ff0836b..ac5e0dada 100644 --- a/data/presets/fields.json +++ b/data/presets/fields.json @@ -671,6 +671,11 @@ "unorthodox" ] }, + "distance": { + "key": "distance", + "type": "text", + "label": "Total Distance" + }, "dock": { "key": "dock", "type": "combo", @@ -925,6 +930,67 @@ "label": "Hoops", "placeholder": "1, 2, 4..." }, + "horse_dressage": { + "key": "sport", + "type": "check", + "label": "Dressage Riding", + "strings": { + "options": { + "undefined": "No", + "equestrian": "Yes" + } + }, + "reference": { + "key": "sport", + "value": "equestrian" + } + }, + "horse_riding": { + "key": "leisure", + "type": "check", + "label": "Horseback Riding", + "strings": { + "options": { + "undefined": "No", + "horse_riding": "Yes" + } + }, + "reference": { + "key": "leisure", + "value": "horse_riding" + } + }, + "horse_scale": { + "key": "horse_scale", + "type": "combo", + "label": "Horseback Riding Difficulty", + "placeholder": "Difficult, Dangerous...", + "strings": { + "options": { + "common": "Easy: No problems or difficulties. (default)", + "demanding": "Use with caution: Uneven way, occasional difficult passages.", + "difficult": "Difficult: Way narrow and exposed. May contain obstacles to step over and narrow passages.", + "critical": "Borderline: Passable only for experienced riders and horses. Major obstacles. Bridges should be examined carefully.", + "dangerous": "Dangerous: Passable only for very experienced riders and horses and only in good weather. Dismount.", + "impossible": "Impassable: Way or bridge not passable for horses. Too narrow, insuffient support, obstacles like ladders. Danger of life." + } + } + }, + "horse_stables": { + "key": "amenity", + "type": "check", + "label": "Riding Stable", + "strings": { + "options": { + "undefined": "No", + "stables": "Yes" + } + }, + "reference": { + "key": "amenity", + "value": "stables" + } + }, "iata": { "key": "iata", "type": "text", diff --git a/data/presets/fields/distance.json b/data/presets/fields/distance.json index 0f8077bfa..4619784a6 100644 --- a/data/presets/fields/distance.json +++ b/data/presets/fields/distance.json @@ -1,6 +1,5 @@ { "key": "distance", "type": "text", - "label": "Total distance", - "placeholder": "0" + "label": "Total Distance" } diff --git a/data/presets/fields/horse_dressage.json b/data/presets/fields/horse_dressage.json index c1df84053..5c4653b39 100644 --- a/data/presets/fields/horse_dressage.json +++ b/data/presets/fields/horse_dressage.json @@ -1,11 +1,15 @@ { "key": "sport", "type": "check", - "label": "Dressage riding", + "label": "Dressage Riding", "strings": { "options": { "undefined": "No", - "equestrian": "Offered" + "equestrian": "Yes" } + }, + "reference": { + "key": "sport", + "value": "equestrian" } } diff --git a/data/presets/fields/horse_riding.json b/data/presets/fields/horse_riding.json index 375283f79..88c7f9045 100644 --- a/data/presets/fields/horse_riding.json +++ b/data/presets/fields/horse_riding.json @@ -1,11 +1,15 @@ { "key": "leisure", "type": "check", - "label": "Horseback riding", + "label": "Horseback Riding", "strings": { "options": { "undefined": "No", - "horse_riding": "Offered" + "horse_riding": "Yes" } + }, + "reference": { + "key": "leisure", + "value": "horse_riding" } } diff --git a/data/presets/fields/horse_stables.json b/data/presets/fields/horse_stables.json index 1600a3cf6..57dd3804b 100644 --- a/data/presets/fields/horse_stables.json +++ b/data/presets/fields/horse_stables.json @@ -1,11 +1,15 @@ { "key": "amenity", "type": "check", - "label": "Riding stable", + "label": "Riding Stable", "strings": { "options": { - "stables": "Riding stable", - "undefined": "No" + "undefined": "No", + "stables": "Yes" } + }, + "reference": { + "key": "amenity", + "value": "stables" } } diff --git a/data/presets/fields/trailblazing_osmc.json b/data/presets/fields/trailblazing_osmc.json deleted file mode 100644 index 4ce2b4557..000000000 --- a/data/presets/fields/trailblazing_osmc.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "key": "osmc:symbol", - "type": "text", - "label": "Machine readable trailblazing" -} diff --git a/data/presets/fields/trailblazing_text.json b/data/presets/fields/trailblazing_text.json deleted file mode 100644 index 289a1dae1..000000000 --- a/data/presets/fields/trailblazing_text.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "key": "symbol", - "type": "textarea", - "label": "Trailblazing description" -} diff --git a/data/presets/fields/trailblazing_wiki.json b/data/presets/fields/trailblazing_wiki.json deleted file mode 100644 index 4e2b93e7d..000000000 --- a/data/presets/fields/trailblazing_wiki.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "key": "wiki:symbol", - "type": "text", - "label": "OSM Wiki name of trailblazing graphic" -} diff --git a/data/presets/fields/watering_place.json b/data/presets/fields/watering_place.json deleted file mode 100644 index 0210294d7..000000000 --- a/data/presets/fields/watering_place.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "key": "watering_place", - "type": "defaultCheck", - "label": "Accessible for horses" -} diff --git a/data/presets/presets.json b/data/presets/presets.json index ab8c515c4..c0fb05fb9 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -1691,6 +1691,9 @@ }, "amenity/fountain": { "icon": "poi-fountain", + "fields": [ + "name" + ], "geometry": [ "point", "area" @@ -7698,6 +7701,7 @@ "mtb/scale", "mtb/scale/uphill", "mtb/scale/imba", + "horse_scale", "ref" ], "geometry": [ @@ -8273,7 +8277,8 @@ "smoothness", "mtb/scale", "mtb/scale/uphill", - "mtb/scale/imba" + "mtb/scale/imba", + "horse_scale" ], "geometry": [ "line" @@ -19366,6 +19371,28 @@ }, "name": "Theme Park" }, + "tourism/trail_riding_station": { + "icon": "horse-riding", + "fields": [ + "name", + "horse_stables", + "horse_riding", + "horse_dressage", + "address", + "phone", + "website", + "description" + ], + "geometry": [ + "point", + "area" + ], + "tags": { + "tourism": "trail_riding_station" + }, + "name": "Trail Riding Station", + "matchScore": 2 + }, "tourism/viewpoint": { "icon": "poi-binoculars", "geometry": [ @@ -19910,7 +19937,9 @@ "name", "ref_route", "operator", - "network_foot" + "network_foot", + "description", + "distance" ], "geometry": [ "relation" @@ -19927,7 +19956,9 @@ "name", "ref_route", "operator", - "network_horse" + "network_horse", + "description", + "distance" ], "geometry": [ "relation" diff --git a/data/presets/presets/amenity/fountain.json b/data/presets/presets/amenity/fountain.json index a41ee82f3..27afc73ac 100644 --- a/data/presets/presets/amenity/fountain.json +++ b/data/presets/presets/amenity/fountain.json @@ -1,8 +1,7 @@ { "icon": "poi-fountain", "fields": [ - "name", - "watering_place" + "name" ], "geometry": [ "point", diff --git a/data/presets/presets/tourism/trail_riding_station.json b/data/presets/presets/tourism/trail_riding_station.json index 660e732b2..a825d8608 100644 --- a/data/presets/presets/tourism/trail_riding_station.json +++ b/data/presets/presets/tourism/trail_riding_station.json @@ -1,5 +1,5 @@ { - "icon": "horse_riding", + "icon": "horse-riding", "fields": [ "name", "horse_stables", @@ -17,6 +17,6 @@ "tags": { "tourism": "trail_riding_station" }, - "name": "Trail riding station", + "name": "Trail Riding Station", "matchScore": 2.0 } diff --git a/data/presets/presets/type/route/hiking.json b/data/presets/presets/type/route/hiking.json index 3917b8eba..7a84fbfe5 100644 --- a/data/presets/presets/type/route/hiking.json +++ b/data/presets/presets/type/route/hiking.json @@ -6,10 +6,7 @@ "operator", "network_foot", "description", - "distance", - "trailblazing_text", - "trailblazing_osmc", - "trailblazing_wiki" + "distance" ], "geometry": [ "relation" diff --git a/data/presets/presets/type/route/horse.json b/data/presets/presets/type/route/horse.json index 551be6747..06e903933 100644 --- a/data/presets/presets/type/route/horse.json +++ b/data/presets/presets/type/route/horse.json @@ -4,12 +4,9 @@ "name", "ref_route", "operator", + "network_horse", "description", - "distance", - "trailblazing_text", - "trailblazing_osmc", - "trailblazing_wiki", - "network_horse" + "distance" ], "geometry": [ "relation" diff --git a/data/taginfo.json b/data/taginfo.json index a4b2dcfd3..5fd93c8e6 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -4308,7 +4308,7 @@ { "key": "leisure", "value": "horse_riding", - "description": "Horseback Riding Facility", + "description": "Horseback Riding Facility, Horseback Riding", "object_types": [ "node", "area" @@ -4467,7 +4467,7 @@ { "key": "sport", "value": "equestrian", - "description": "Riding Arena", + "description": "Riding Arena, Dressage Riding", "object_types": [ "node", "area" @@ -7806,6 +7806,16 @@ ], "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/amusement-park-15.svg?sanitize=true" }, + { + "key": "tourism", + "value": "trail_riding_station", + "description": "Trail Riding Station", + "object_types": [ + "node", + "area" + ], + "icon_url": "https://raw.githubusercontent.com/mapbox/maki/master/icons/horse-riding-15.svg?sanitize=true" + }, { "key": "tourism", "value": "viewpoint", @@ -9043,6 +9053,10 @@ "key": "display", "description": "Display" }, + { + "key": "distance", + "description": "Total Distance" + }, { "key": "dock", "description": "Type" @@ -9276,6 +9290,41 @@ "key": "hoops", "description": "Hoops" }, + { + "key": "horse_scale", + "value": "common", + "description": "Horseback Riding Difficulty" + }, + { + "key": "horse_scale", + "value": "demanding", + "description": "Horseback Riding Difficulty" + }, + { + "key": "horse_scale", + "value": "difficult", + "description": "Horseback Riding Difficulty" + }, + { + "key": "horse_scale", + "value": "critical", + "description": "Horseback Riding Difficulty" + }, + { + "key": "horse_scale", + "value": "dangerous", + "description": "Horseback Riding Difficulty" + }, + { + "key": "horse_scale", + "value": "impossible", + "description": "Horseback Riding Difficulty" + }, + { + "key": "amenity", + "value": "stables", + "description": "Riding Stable" + }, { "key": "iata", "description": "IATA" @@ -9634,11 +9683,6 @@ "key": "note", "description": "Note" }, - { - "key": "oneway", - "value": "undefined", - "description": "One Way" - }, { "key": "oneway", "value": "yes", diff --git a/dist/locales/en.json b/dist/locales/en.json index 9dfb67330..cf6d57bf1 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -1785,6 +1785,9 @@ "display": { "label": "Display" }, + "distance": { + "label": "Total Distance" + }, "dock": { "label": "Type" }, @@ -1939,6 +1942,39 @@ "label": "Hoops", "placeholder": "1, 2, 4..." }, + "horse_dressage": { + "label": "Dressage Riding", + "options": { + "undefined": "No", + "equestrian": "Yes" + } + }, + "horse_riding": { + "label": "Horseback Riding", + "options": { + "undefined": "No", + "horse_riding": "Yes" + } + }, + "horse_scale": { + "label": "Horseback Riding Difficulty", + "placeholder": "Difficult, Dangerous...", + "options": { + "common": "Easy: No problems or difficulties. (default)", + "demanding": "Use with caution: Uneven way, occasional difficult passages.", + "difficult": "Difficult: Way narrow and exposed. May contain obstacles to step over and narrow passages.", + "critical": "Borderline: Passable only for experienced riders and horses. Major obstacles. Bridges should be examined carefully.", + "dangerous": "Dangerous: Passable only for very experienced riders and horses and only in good weather. Dismount.", + "impossible": "Impassable: Way or bridge not passable for horses. Too narrow, insuffient support, obstacles like ladders. Danger of life." + } + }, + "horse_stables": { + "label": "Riding Stable", + "options": { + "undefined": "No", + "stables": "Yes" + } + }, "iata": { "label": "IATA" }, @@ -6288,6 +6324,10 @@ "name": "Theme Park", "terms": "" }, + "tourism/trail_riding_station": { + "name": "Trail Riding Station", + "terms": "" + }, "tourism/viewpoint": { "name": "Viewpoint", "terms": ""