From 00c3d23ad049a14250b2aae3420a20482a4dcb15 Mon Sep 17 00:00:00 2001 From: Holger Bruch Date: Fri, 27 Dec 2019 07:51:49 +0100 Subject: [PATCH] Adds parameter oneway-without-direction-value Signed-off-by: Holger Bruch --- src/commands/match.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/commands/match.ts b/src/commands/match.ts index 8b1d353..bea6d27 100644 --- a/src/commands/match.ts +++ b/src/commands/match.ts @@ -55,6 +55,7 @@ export default class Match extends Command { 'direction-field': flags.string({description: 'name of optional line properity describing segment directionality, use the related "one-way-*-value" and "two-way-value" properties'}), 'one-way-with-direction-value': flags.string({description: 'name of optional value of "direction-field" indicating a one-way street with line direction'}), 'one-way-against-direction-value': flags.string({description: 'name of optional value of "direction-field" indicating a one-way street against line direction'}), + 'one-way-without-direction-value': flags.string({description: 'name of optional value of "direction-field" indicating a one-way street without specified line direction. Only matches one direction based on best score.'}), 'two-way-value': flags.string({description: 'name of optional value of "direction-field" indicating a two-way street'}), 'bearing-field': flags.string({description: 'name of optional point property containing bearing in decimal degrees', default:'bearing'}), 'search-radius': flags.integer({description: 'search radius for for snapping points, lines and traces (in meters)', default:10}), @@ -114,7 +115,7 @@ export default class Match extends Command { if(flags['direction-field']) - console.log(chalk.bold.keyword('green')(' Filtering one-way and two-way streets using field "' + flags['direction-field'] + '" with values: ' + ' "' + flags['one-way-with-direction-value'] + '", "' + flags['one-way-against-direction-value'] + '", "' + flags['two-way-value'] + '"')); + console.log(chalk.bold.keyword('green')(' Filtering one-way and two-way streets using field "' + flags['direction-field'] + '" with values: ' + ' "' + flags['one-way-with-direction-value'] + '", "' + flags['one-way-against-direction-value'] + '", "' +flags['one-way-without-direction-value'] + '", "' + flags['two-way-value'] + '"')); if(flags['match-bike'] || flags['match-pedestrian']) { if(flags['match-bike']) { @@ -847,6 +848,9 @@ async function matchLines(outFile, params, lines, flags) { else if(lineDirectionValue == '' + flags['two-way-value']) { matchDirection = MatchDirection.BOTH; } + else if(lineDirectionValue == '' + flags['one-way-without-direction-value']) { + matchDirection = MatchDirection.BEST; + } else { // TODO handle lines that don't match rules matchDirection = MatchDirection.BOTH;