mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-22 08:17:30 +02:00
Lower match score of generic presets (fixes #1933)
This commit is contained in:
@@ -1255,7 +1255,8 @@
|
||||
},
|
||||
"geometry": [
|
||||
"area"
|
||||
]
|
||||
],
|
||||
"matchScore": 0.1
|
||||
},
|
||||
"barrier": {
|
||||
"geometry": [
|
||||
@@ -2918,7 +2919,8 @@
|
||||
"tags": {},
|
||||
"geometry": [
|
||||
"line"
|
||||
]
|
||||
],
|
||||
"matchScore": 0.1
|
||||
},
|
||||
"man_made": {
|
||||
"fields": [
|
||||
@@ -3472,7 +3474,8 @@
|
||||
"tags": {},
|
||||
"geometry": [
|
||||
"point"
|
||||
]
|
||||
],
|
||||
"matchScore": 0.1
|
||||
},
|
||||
"power": {
|
||||
"geometry": [
|
||||
@@ -5290,7 +5293,8 @@
|
||||
"tags": {},
|
||||
"geometry": [
|
||||
"vertex"
|
||||
]
|
||||
],
|
||||
"matchScore": 0.1
|
||||
},
|
||||
"waterway": {
|
||||
"fields": [
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
"tags": {
|
||||
"area": "yes"
|
||||
},
|
||||
"geometry": ["area"]
|
||||
"geometry": ["area"],
|
||||
"matchScore": 0.1
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Line",
|
||||
"tags": {},
|
||||
"geometry": ["line"]
|
||||
"geometry": ["line"],
|
||||
"matchScore": 0.1
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Point",
|
||||
"tags": {},
|
||||
"geometry": ["point"]
|
||||
"geometry": ["point"],
|
||||
"matchScore": 0.1
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "Other",
|
||||
"tags": {},
|
||||
"geometry": ["vertex"]
|
||||
"geometry": ["vertex"],
|
||||
"matchScore": 0.1
|
||||
}
|
||||
@@ -39,4 +39,30 @@ describe("iD.presets", function() {
|
||||
expect(c.match(line, graph).id).to.eql('line');
|
||||
});
|
||||
});
|
||||
|
||||
describe("expected matches", function() {
|
||||
var presets;
|
||||
|
||||
before(function() {
|
||||
presets = iD.presets().load(iD.data.presets);
|
||||
});
|
||||
|
||||
it("prefers building to multipolygon", function() {
|
||||
var relation = iD.Relation({tags: {type: 'multipolygon', building: 'yes'}}),
|
||||
graph = iD.Graph([relation]);
|
||||
expect(presets.match(relation, graph).id).to.eql('building');
|
||||
});
|
||||
|
||||
it("prefers building to address", function() {
|
||||
var way = iD.Way({tags: {area: 'yes', building: 'yes', 'addr:housenumber': '1234'}}),
|
||||
graph = iD.Graph([way]);
|
||||
expect(presets.match(way, graph).id).to.eql('building');
|
||||
});
|
||||
|
||||
it("prefers pedestrian to area", function() {
|
||||
var way = iD.Way({tags: {area: 'yes', highway: 'pedestrian'}}),
|
||||
graph = iD.Graph([way]);
|
||||
expect(presets.match(way, graph).id).to.eql('highway/pedestrian');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user