Skip to content

Commit

Permalink
draft: create fewer intersection variations
Browse files Browse the repository at this point in the history
Just like with venues, adding many alt names can create scoring
penalties(pelias/pelias#862) or
boosts(pelias/openstreetmap#507) that are
undesirable.

Unfortunately we don't currently have a great way to handle all
intersection searches without _some_ alt-names, but this change tests
removing some of them to see if we can stabilize scoring a bit.
  • Loading branch information
orangejulius committed Jun 24, 2020
1 parent 9c8379d commit c99fb61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 7 additions & 7 deletions post/intersections.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function intersections( doc ){
// ensure both street & cross street props are set
let street = doc.getAddress(ADDRESS_STREET_PROP);
if( !_.isString(street) || _.isEmpty(street) ){ return; }

let cross_street = doc.getAddress(ADDRESS_CROSS_STREET_PROP);
if( !_.isString(cross_street) || _.isEmpty(cross_street) ){ return; }

Expand All @@ -21,15 +21,15 @@ function intersections( doc ){

// corner of A & B
doc.setNameAlias('default', `${street} & ${cross_street}`);
doc.setNameAlias('default', `${street} @ ${cross_street}`);
//doc.setNameAlias('default', `${street} @ ${cross_street}`);
doc.setNameAlias('default', `${street} at ${cross_street}`);
doc.setNameAlias('default', `Corner of ${street} & ${cross_street}`);
//doc.setNameAlias('default', `Corner of ${street} & ${cross_street}`);

// corner of B & A
doc.setNameAlias('default', `${cross_street} & ${street}`);
doc.setNameAlias('default', `${cross_street} @ ${street}`);
//doc.setNameAlias('default', `${cross_street} @ ${street}`);
doc.setNameAlias('default', `${cross_street} at ${street}`);
doc.setNameAlias('default', `Corner of ${cross_street} & ${street}`);
//doc.setNameAlias('default', `Corner of ${cross_street} & ${street}`);
}

module.exports = intersections;
module.exports = intersections;
6 changes: 1 addition & 5 deletions test/post/intersections.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports.tests = {};
module.exports.tests.functional = function(test) {
test('functional', function(t) {
var doc = new Document('mysource','intersection','myid');

// street and cross_street not set
intersections(doc);
t.deepEqual(doc.getNameAliases('default'), [], 'no names set');
Expand All @@ -28,13 +28,9 @@ module.exports.tests.functional = function(test) {
// intersection aliases defined
t.deepEqual(doc.getNameAliases('default'), [
'Example Street & Cross Street',
'Example Street @ Cross Street',
'Example Street at Cross Street',
'Corner of Example Street & Cross Street',
'Cross Street & Example Street',
'Cross Street @ Example Street',
'Cross Street at Example Street',
'Corner of Cross Street & Example Street'
]);

t.end();
Expand Down

0 comments on commit c99fb61

Please sign in to comment.