File tree 1 file changed +21
-3
lines changed
1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -378,6 +378,15 @@ func (c *client) tableRequests( //nolint:gocyclo
378
378
path += strings .Join (annotations , "," )
379
379
}
380
380
381
+ if config .withApproachCurb {
382
+ path += "&approaches="
383
+ approaches := make ([]string , len (resultingChunk ))
384
+ for i := 0 ; i < len (approaches ); i ++ {
385
+ approaches [i ] = "curb"
386
+ }
387
+ path += strings .Join (approaches , ";" )
388
+ }
389
+
381
390
// Set scale factor. This only has an effect on durations.
382
391
if c .scaleFactor != 1.0 {
383
392
path += fmt .Sprintf ("&scale_factor=%f" , c .scaleFactor )
@@ -440,9 +449,10 @@ type TableOptions func(*tableConfig)
440
449
441
450
// tableConfig defines options for the table configuration.
442
451
type tableConfig struct {
443
- withDistance bool
444
- withDuration bool
445
- parallelRuns int
452
+ withDistance bool
453
+ withDuration bool
454
+ parallelRuns int
455
+ withApproachCurb bool
446
456
}
447
457
448
458
// WithDuration returns a TableOptions function for composing a tableConfig with
@@ -463,6 +473,14 @@ func WithDistance() TableOptions {
463
473
}
464
474
}
465
475
476
+ // WithApproachCurb returns a TableOptions func for a tableConfig with the
477
+ // approach curb set.
478
+ func WithApproachCurb () TableOptions {
479
+ return func (c * tableConfig ) {
480
+ c .withApproachCurb = true
481
+ }
482
+ }
483
+
466
484
// ClientOption can pass options to be used with an OSRM client.
467
485
type ClientOption func (* client )
468
486
You can’t perform that action at this time.
0 commit comments