Rename major_roads -> traffic_roads, minor_roads -> service_roads

This commit is contained in:
Bryan Housel
2016-03-05 23:58:09 -05:00
parent 3ef05cad79
commit c4fbacd625
4 changed files with 36 additions and 35 deletions

View File

@@ -290,10 +290,10 @@ en:
points:
description: Points
tooltip: "Points of Interest"
major_roads:
traffic_roads:
description: Traffic Roads
tooltip: "Highways, Streets, etc."
minor_roads:
service_roads:
description: Service Roads
tooltip: "Service Roads, Parking Aisles, Tracks, etc."
paths:

View File

@@ -350,11 +350,11 @@
"description": "Points",
"tooltip": "Points of Interest"
},
"major_roads": {
"traffic_roads": {
"description": "Traffic Roads",
"tooltip": "Highways, Streets, etc."
},
"minor_roads": {
"service_roads": {
"description": "Service Roads",
"tooltip": "Service Roads, Parking Aisles, Tracks, etc."
},

View File

@@ -1,5 +1,5 @@
iD.Features = function(context) {
var major_roads = {
var traffic_roads = {
'motorway': true,
'motorway_link': true,
'trunk': true,
@@ -11,12 +11,12 @@ iD.Features = function(context) {
'tertiary': true,
'tertiary_link': true,
'residential': true,
'unclassified': true
'unclassified': true,
'living_street': true
};
var minor_roads = {
var service_roads = {
'service': true,
'living_street': true,
'road': true,
'track': true
};
@@ -76,12 +76,12 @@ iD.Features = function(context) {
return geometry === 'point';
}, 200);
defineFeature('major_roads', function isMajorRoad(entity) {
return major_roads[entity.tags.highway];
defineFeature('traffic_roads', function isTrafficRoad(entity) {
return traffic_roads[entity.tags.highway];
});
defineFeature('minor_roads', function isMinorRoad(entity) {
return minor_roads[entity.tags.highway];
defineFeature('service_roads', function isServiceRoad(entity) {
return service_roads[entity.tags.highway];
});
defineFeature('paths', function isPath(entity) {
@@ -128,8 +128,8 @@ iD.Features = function(context) {
!!entity.tags.railway ||
entity.tags.landuse === 'railway'
) && !(
major_roads[entity.tags.highway] ||
minor_roads[entity.tags.highway] ||
traffic_roads[entity.tags.highway] ||
service_roads[entity.tags.highway] ||
paths[entity.tags.highway]
);
});
@@ -141,8 +141,8 @@ iD.Features = function(context) {
// contains a past/future tag, but not in active use as a road/path/cycleway/etc..
defineFeature('past_future', function isPastFuture(entity) {
if (
major_roads[entity.tags.highway] ||
minor_roads[entity.tags.highway] ||
traffic_roads[entity.tags.highway] ||
service_roads[entity.tags.highway] ||
paths[entity.tags.highway]
) { return false; }

View File

@@ -13,7 +13,7 @@ describe('iD.Features', function() {
it('returns feature keys', function() {
var keys = features.keys();
expect(keys).to.include(
'points', 'major_roads', 'minor_roads', 'paths',
'points', 'traffic_roads', 'service_roads', 'paths',
'buildings', 'landuse', 'boundaries', 'water', 'rail',
'power', 'past_future', 'others'
);
@@ -71,8 +71,8 @@ describe('iD.Features', function() {
expect(stats.boundaries).to.eql(1);
expect(stats.buildings).to.eql(1);
expect(stats.landuse).to.eql(0);
expect(stats.major_roads).to.eql(1);
expect(stats.minor_roads).to.eql(0);
expect(stats.traffic_roads).to.eql(1);
expect(stats.service_roads).to.eql(0);
expect(stats.others).to.eql(1);
expect(stats.past_future).to.eql(1);
expect(stats.paths).to.eql(0);
@@ -92,7 +92,7 @@ describe('iD.Features', function() {
iD.Node({id: 'point_generator', tags: {power: 'generator'}, version: 1}),
iD.Node({id: 'point_old_rail_station', tags: {railway: 'station', disused: 'yes'}, version: 1}),
// Major Roads
// Traffic Roads
iD.Way({id: 'motorway', tags: {highway: 'motorway'}, version: 1}),
iD.Way({id: 'motorway_link', tags: {highway: 'motorway_link'}, version: 1}),
iD.Way({id: 'trunk', tags: {highway: 'trunk'}, version: 1}),
@@ -104,12 +104,12 @@ describe('iD.Features', function() {
iD.Way({id: 'tertiary', tags: {highway: 'tertiary'}, version: 1}),
iD.Way({id: 'tertiary_link', tags: {highway: 'tertiary_link'}, version: 1}),
iD.Way({id: 'residential', tags: {highway: 'residential'}, version: 1}),
// Minor Roads
iD.Way({id: 'service', tags: {highway: 'service'}, version: 1}),
iD.Way({id: 'living_street', tags: {highway: 'living_street'}, version: 1}),
iD.Way({id: 'road', tags: {highway: 'road'}, version: 1}),
iD.Way({id: 'unclassified', tags: {highway: 'unclassified'}, version: 1}),
iD.Way({id: 'living_street', tags: {highway: 'living_street'}, version: 1}),
// Service Roads
iD.Way({id: 'service', tags: {highway: 'service'}, version: 1}),
iD.Way({id: 'road', tags: {highway: 'road'}, version: 1}),
iD.Way({id: 'track', tags: {highway: 'track'}, version: 1}),
// Paths
@@ -231,36 +231,37 @@ describe('iD.Features', function() {
});
it("matches major roads", function () {
features.disable('major_roads');
it("matches traffic roads", function () {
features.disable('traffic_roads');
features.gatherStats(all, graph, dimensions);
doMatch([
'motorway', 'motorway_link', 'trunk', 'trunk_link',
'primary', 'primary_link', 'secondary', 'secondary_link',
'tertiary', 'tertiary_link', 'residential', 'inner3'
'tertiary', 'tertiary_link', 'residential', 'living_street',
'unclassified', 'inner3'
]);
dontMatch([
'point_bar', 'service', 'path', 'building_yes',
'point_bar', 'service', 'road', 'track', 'path', 'building_yes',
'forest', 'boundary', 'water', 'railway', 'power_line',
'motorway_construction', 'fence'
]);
});
it("matches minor roads", function () {
features.disable('minor_roads');
it("matches service roads", function () {
features.disable('service_roads');
features.gatherStats(all, graph, dimensions);
doMatch([
'service', 'living_street', 'road', 'unclassified', 'track'
'service', 'road', 'track'
]);
dontMatch([
'point_bar', 'motorway', 'path', 'building_yes',
'forest', 'boundary', 'water', 'railway', 'power_line',
'motorway_construction', 'fence'
'point_bar', 'motorway', 'unclassified', 'living_street',
'path', 'building_yes', 'forest', 'boundary', 'water',
'railway', 'power_line', 'motorway_construction', 'fence'
]);
});