Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds parameter oneway-without-direction-value #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/commands/match.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
Expand Down Expand Up @@ -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']) {
Expand Down Expand Up @@ -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;
Expand Down