Skip to content

Commit

Permalink
Add more deprecated tag data from https://wiki.openstreetmap.org/wiki…
Browse files Browse the repository at this point in the history
…/Deprecated_features

Run deprecated_tag validation on modified as well as created features
  • Loading branch information
quincylvania committed Jan 24, 2019
1 parent b21dd1d commit a259a9a
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 7 deletions.
65 changes: 64 additions & 1 deletion data/deprecated.json
Expand Up @@ -76,14 +76,25 @@
"old": {"craft": "optician"},
"replace": {"shop": "optician"}
},
{
"old": {"drinkable": "*"},
"replace": {"drinking_water": "$1"}
},
{
"old": {"escalator": "*"},
"replace": {"highway": "steps", "conveying": "$1"}
},
{
"old": {"fenced": "yes"},
"replace": {"barrier": "fence"}
},
{
"old": {"highway": "ford"},
"replace": {"ford": "*"}
},
{
"old": {"highway": "no"}
},
{
"old": {"highway": "stile"},
"replace": {"barrier": "stile"}
Expand All @@ -104,13 +115,37 @@
"old": {"landuse": "farm"},
"replace": {"landuse": "farmland"}
},
{
"old": {"landuse": "field"},
"replace": {"landuse": "farmland"}
},
{
"old": {"landuse": "pond"},
"replace": {"natural": "water", "water": "pond"}
},
{
"old": {"landuse": "wood"},
"replace": {"landuse": "forest", "natural": "wood"}
"replace": {"natural": "wood"}
},
{
"old": {"leisure": "beach"},
"replace": {"natural": "beach"}
},
{
"old": {"leisure": "club"},
"replace": {"club": "*"}
},
{
"old": {"man_made": "jetty"},
"replace": {"man_made": "pier"}
},
{
"old": {"man_made": "water_tank"},
"replace": {"man_made": "storage_tank", "content": "water"}
},
{
"old": {"man_made": "well"},
"replace": {"man_made": "water_well"}
},
{
"old": {"natural": "marsh"},
Expand All @@ -120,6 +155,14 @@
"old": {"office": "administrative"},
"replace": {"office": "government"}
},
{
"old": {"place_name": "*"},
"replace": {"name": "$1"}
},
{
"old": {"pole": "transition"},
"replace": {"location:transition": "yes"}
},
{
"old": {"power": "sub_station"},
"replace": {"power": "substation"}
Expand All @@ -132,17 +175,37 @@
"old": {"power_rating": "*"},
"replace": {"generator:output": "$1"}
},
{
"old": {"route": "ncn"},
"replace": {"route": "bicycle", "network": "ncn"}
},
{
"old": {"shop": "organic"},
"replace": {"shop": "supermarket", "organic": "only"}
},
{
"old": {"shop": "fish"},
"replace": {"shop": "seafood"}
},
{
"old": {"shop": "fishmonger"},
"replace": {"shop": "seafood"}
},
{
"old": {"shop": "furnace"},
"replace": {"shop": "fireplace"}
},
{
"old": {"shop": "gallery"},
"replace": {"shop": "art"}
},
{
"old": {"shop": "perfume"},
"replace": {"shop": "perfumery"}
},
{
"old": {"tourism": "bed_and_breakfast"},
"replace": {"tourism": "guest_house"}
}
]
}
11 changes: 5 additions & 6 deletions modules/validations/deprecated_tag.js
@@ -1,4 +1,3 @@
import _isEmpty from 'lodash-es/isEmpty';
import _clone from 'lodash-es/clone';
import { t } from '../util/locale';
import {
Expand All @@ -19,12 +18,12 @@ import {
export function validationDeprecatedTag(context) {

var validation = function(changes) {
var issues = [];
for (var i = 0; i < changes.created.length; i++) {
var change = changes.created[i];
var edited = changes.created.concat(changes.modified),
issues = [];
for (var changeIndex in edited) {
var change = edited[changeIndex];
var deprecatedTagsArray = change.deprecatedTags();

if (!_isEmpty(deprecatedTagsArray)) {
if (deprecatedTagsArray.length > 0) {
for (var deprecatedTagIndex in deprecatedTagsArray) {
var deprecatedTags = deprecatedTagsArray[deprecatedTagIndex];
var tagsLabel = utilTagText({ tags: deprecatedTags.old });
Expand Down

0 comments on commit a259a9a

Please sign in to comment.