@iwpnd/valhalla-ts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/decode-polyline.d.ts +22 -0
- package/dist/decode-polyline.d.ts.map +1 -0
- package/dist/decode-polyline.js +68 -0
- package/dist/decode-polyline.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/types/base.d.ts +15 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +3 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/costing.d.ts +232 -0
- package/dist/types/costing.d.ts.map +1 -0
- package/dist/types/costing.js +3 -0
- package/dist/types/costing.js.map +1 -0
- package/dist/types/error.d.ts +7 -0
- package/dist/types/error.d.ts.map +1 -0
- package/dist/types/error.js +3 -0
- package/dist/types/error.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +26 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/languages.d.ts +3 -0
- package/dist/types/languages.d.ts.map +1 -0
- package/dist/types/languages.js +3 -0
- package/dist/types/languages.js.map +1 -0
- package/dist/types/locations.d.ts +56 -0
- package/dist/types/locations.d.ts.map +1 -0
- package/dist/types/locations.js +3 -0
- package/dist/types/locations.js.map +1 -0
- package/dist/types/maneuver.d.ts +110 -0
- package/dist/types/maneuver.d.ts.map +1 -0
- package/dist/types/maneuver.js +46 -0
- package/dist/types/maneuver.js.map +1 -0
- package/dist/types/request.d.ts +120 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/request.js +3 -0
- package/dist/types/request.js.map +1 -0
- package/dist/types/response.d.ts +92 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +3 -0
- package/dist/types/response.js.map +1 -0
- package/dist/types/tracing.d.ts +15 -0
- package/dist/types/tracing.d.ts.map +1 -0
- package/dist/types/tracing.js +3 -0
- package/dist/types/tracing.js.map +1 -0
- package/dist/valhalla.d.ts +76 -0
- package/dist/valhalla.d.ts.map +1 -0
- package/dist/valhalla.js +117 -0
- package/dist/valhalla.js.map +1 -0
- package/package.json +86 -0
- package/readme.md +81 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { BSSManeuverType, TravelMode, TravelType } from './base';
|
|
2
|
+
export declare enum ManeuverType {
|
|
3
|
+
kNone = 0,
|
|
4
|
+
kStart = 1,
|
|
5
|
+
kStartRight = 2,
|
|
6
|
+
kStartLeft = 3,
|
|
7
|
+
kDestination = 4,
|
|
8
|
+
kDestinationRight = 5,
|
|
9
|
+
kDestinationLeft = 6,
|
|
10
|
+
kBecomes = 7,
|
|
11
|
+
kContinue = 8,
|
|
12
|
+
kSlightRight = 9,
|
|
13
|
+
kRight = 10,
|
|
14
|
+
kSharpRight = 11,
|
|
15
|
+
kUturnRight = 12,
|
|
16
|
+
kUturnLeft = 13,
|
|
17
|
+
kSharpLeft = 14,
|
|
18
|
+
kLeft = 15,
|
|
19
|
+
kSlightLeft = 16,
|
|
20
|
+
kRampStraight = 17,
|
|
21
|
+
kRampRight = 18,
|
|
22
|
+
kRampLeft = 19,
|
|
23
|
+
kExitRight = 20,
|
|
24
|
+
kExitLeft = 21,
|
|
25
|
+
kStayStraight = 22,
|
|
26
|
+
kStayRight = 23,
|
|
27
|
+
kStayLeft = 24,
|
|
28
|
+
kMerge = 25,
|
|
29
|
+
kRoundaboutEnter = 26,
|
|
30
|
+
kRoundaboutExit = 27,
|
|
31
|
+
kFerryEnter = 28,
|
|
32
|
+
kFerryExit = 29,
|
|
33
|
+
kTransit = 30,
|
|
34
|
+
kTransitTransfer = 31,
|
|
35
|
+
kTransitRemainOn = 32,
|
|
36
|
+
kTransitConnectionStart = 33,
|
|
37
|
+
kTransitConnectionTransfer = 34,
|
|
38
|
+
kTransitConnectionDestination = 35,
|
|
39
|
+
kPostTransitConnectionDestination = 36,
|
|
40
|
+
kMergeRight = 37,
|
|
41
|
+
kMergeLeft = 38
|
|
42
|
+
}
|
|
43
|
+
export type TransitStopType = 0 | 1;
|
|
44
|
+
export interface TransitStops {
|
|
45
|
+
type: TransitStopType;
|
|
46
|
+
onestop_id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
arrival_date_time: string;
|
|
49
|
+
departure_date_time: string;
|
|
50
|
+
is_parent_stop: boolean;
|
|
51
|
+
assumed_schedule: boolean;
|
|
52
|
+
lat: number;
|
|
53
|
+
lon: number;
|
|
54
|
+
}
|
|
55
|
+
export interface TransitInfo {
|
|
56
|
+
onestop_id: string;
|
|
57
|
+
short_name: string;
|
|
58
|
+
long_name: string;
|
|
59
|
+
headsign: string;
|
|
60
|
+
color: string;
|
|
61
|
+
text_color: string;
|
|
62
|
+
description: string;
|
|
63
|
+
operator_ones_top_id: string;
|
|
64
|
+
operator_name: string;
|
|
65
|
+
operator_url: string;
|
|
66
|
+
transit_stops: TransitStops;
|
|
67
|
+
}
|
|
68
|
+
export interface ManeuverSignElement {
|
|
69
|
+
text: string;
|
|
70
|
+
consecutive_count?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface ManeuverSign {
|
|
73
|
+
exit_number_elements: ManeuverSignElement[];
|
|
74
|
+
exit_branch_elements: ManeuverSignElement[];
|
|
75
|
+
exit_toward_elements: ManeuverSignElement[];
|
|
76
|
+
exit_name_elements: ManeuverSignElement[];
|
|
77
|
+
}
|
|
78
|
+
export interface Maneuver {
|
|
79
|
+
type: ManeuverType;
|
|
80
|
+
street_names: string[];
|
|
81
|
+
time: number;
|
|
82
|
+
length: number;
|
|
83
|
+
begin_shape_index: number;
|
|
84
|
+
end_shape_index: number;
|
|
85
|
+
travel_mode: TravelMode;
|
|
86
|
+
travel_type: TravelType;
|
|
87
|
+
bss_maneuver_type?: BSSManeuverType;
|
|
88
|
+
sign?: ManeuverSign;
|
|
89
|
+
toll?: boolean;
|
|
90
|
+
highway?: boolean;
|
|
91
|
+
rough?: boolean;
|
|
92
|
+
gate?: boolean;
|
|
93
|
+
ferry?: boolean;
|
|
94
|
+
roundabout_exit_count?: number;
|
|
95
|
+
}
|
|
96
|
+
export interface ManeuverWithInstructions extends Maneuver {
|
|
97
|
+
instruction: string;
|
|
98
|
+
verbal_succinct_transition_instruction: string;
|
|
99
|
+
verbal_pre_transition_instruction: string;
|
|
100
|
+
verbal_post_transition_instruction: string;
|
|
101
|
+
depart_instruction?: string;
|
|
102
|
+
verbal_depart_instruction?: string;
|
|
103
|
+
arrive_instruction?: string;
|
|
104
|
+
verbal_arrive_instruction?: string;
|
|
105
|
+
verbal_multi_cue?: boolean;
|
|
106
|
+
}
|
|
107
|
+
export interface ManeuverWithInstructionsForTransit extends ManeuverWithInstructions {
|
|
108
|
+
transit?: TransitInfo;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=maneuver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maneuver.d.ts","sourceRoot":"","sources":["../../src/types/maneuver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEjE,oBAAY,YAAY;IACpB,KAAK,IAAI;IACT,MAAM,IAAI;IACV,WAAW,IAAI;IACf,UAAU,IAAI;IACd,YAAY,IAAI;IAChB,iBAAiB,IAAI;IACrB,gBAAgB,IAAI;IACpB,QAAQ,IAAI;IACZ,SAAS,IAAI;IACb,YAAY,IAAI;IAChB,MAAM,KAAK;IACX,WAAW,KAAK;IAChB,WAAW,KAAK;IAChB,UAAU,KAAK;IACf,UAAU,KAAK;IACf,KAAK,KAAK;IACV,WAAW,KAAK;IAChB,aAAa,KAAK;IAClB,UAAU,KAAK;IACf,SAAS,KAAK;IACd,UAAU,KAAK;IACf,SAAS,KAAK;IACd,aAAa,KAAK;IAClB,UAAU,KAAK;IACf,SAAS,KAAK;IACd,MAAM,KAAK;IACX,gBAAgB,KA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ManeuverType) {
|
|
6
|
+
ManeuverType[ManeuverType["kNone"] = 0] = "kNone";
|
|
7
|
+
ManeuverType[ManeuverType["kStart"] = 1] = "kStart";
|
|
8
|
+
ManeuverType[ManeuverType["kStartRight"] = 2] = "kStartRight";
|
|
9
|
+
ManeuverType[ManeuverType["kStartLeft"] = 3] = "kStartLeft";
|
|
10
|
+
ManeuverType[ManeuverType["kDestination"] = 4] = "kDestination";
|
|
11
|
+
ManeuverType[ManeuverType["kDestinationRight"] = 5] = "kDestinationRight";
|
|
12
|
+
ManeuverType[ManeuverType["kDestinationLeft"] = 6] = "kDestinationLeft";
|
|
13
|
+
ManeuverType[ManeuverType["kBecomes"] = 7] = "kBecomes";
|
|
14
|
+
ManeuverType[ManeuverType["kContinue"] = 8] = "kContinue";
|
|
15
|
+
ManeuverType[ManeuverType["kSlightRight"] = 9] = "kSlightRight";
|
|
16
|
+
ManeuverType[ManeuverType["kRight"] = 10] = "kRight";
|
|
17
|
+
ManeuverType[ManeuverType["kSharpRight"] = 11] = "kSharpRight";
|
|
18
|
+
ManeuverType[ManeuverType["kUturnRight"] = 12] = "kUturnRight";
|
|
19
|
+
ManeuverType[ManeuverType["kUturnLeft"] = 13] = "kUturnLeft";
|
|
20
|
+
ManeuverType[ManeuverType["kSharpLeft"] = 14] = "kSharpLeft";
|
|
21
|
+
ManeuverType[ManeuverType["kLeft"] = 15] = "kLeft";
|
|
22
|
+
ManeuverType[ManeuverType["kSlightLeft"] = 16] = "kSlightLeft";
|
|
23
|
+
ManeuverType[ManeuverType["kRampStraight"] = 17] = "kRampStraight";
|
|
24
|
+
ManeuverType[ManeuverType["kRampRight"] = 18] = "kRampRight";
|
|
25
|
+
ManeuverType[ManeuverType["kRampLeft"] = 19] = "kRampLeft";
|
|
26
|
+
ManeuverType[ManeuverType["kExitRight"] = 20] = "kExitRight";
|
|
27
|
+
ManeuverType[ManeuverType["kExitLeft"] = 21] = "kExitLeft";
|
|
28
|
+
ManeuverType[ManeuverType["kStayStraight"] = 22] = "kStayStraight";
|
|
29
|
+
ManeuverType[ManeuverType["kStayRight"] = 23] = "kStayRight";
|
|
30
|
+
ManeuverType[ManeuverType["kStayLeft"] = 24] = "kStayLeft";
|
|
31
|
+
ManeuverType[ManeuverType["kMerge"] = 25] = "kMerge";
|
|
32
|
+
ManeuverType[ManeuverType["kRoundaboutEnter"] = 26] = "kRoundaboutEnter";
|
|
33
|
+
ManeuverType[ManeuverType["kRoundaboutExit"] = 27] = "kRoundaboutExit";
|
|
34
|
+
ManeuverType[ManeuverType["kFerryEnter"] = 28] = "kFerryEnter";
|
|
35
|
+
ManeuverType[ManeuverType["kFerryExit"] = 29] = "kFerryExit";
|
|
36
|
+
ManeuverType[ManeuverType["kTransit"] = 30] = "kTransit";
|
|
37
|
+
ManeuverType[ManeuverType["kTransitTransfer"] = 31] = "kTransitTransfer";
|
|
38
|
+
ManeuverType[ManeuverType["kTransitRemainOn"] = 32] = "kTransitRemainOn";
|
|
39
|
+
ManeuverType[ManeuverType["kTransitConnectionStart"] = 33] = "kTransitConnectionStart";
|
|
40
|
+
ManeuverType[ManeuverType["kTransitConnectionTransfer"] = 34] = "kTransitConnectionTransfer";
|
|
41
|
+
ManeuverType[ManeuverType["kTransitConnectionDestination"] = 35] = "kTransitConnectionDestination";
|
|
42
|
+
ManeuverType[ManeuverType["kPostTransitConnectionDestination"] = 36] = "kPostTransitConnectionDestination";
|
|
43
|
+
ManeuverType[ManeuverType["kMergeRight"] = 37] = "kMergeRight";
|
|
44
|
+
ManeuverType[ManeuverType["kMergeLeft"] = 38] = "kMergeLeft";
|
|
45
|
+
})(ManeuverType || (exports.ManeuverType = ManeuverType = {}));
|
|
46
|
+
//# sourceMappingURL=maneuver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maneuver.js","sourceRoot":"","sources":["../../src/types/maneuver.ts"],"names":[],"mappings":";;;AAEA,IAAY,YAwCX;AAxCD,WAAY,YAAY;IACpB,iDAAS,CAAA;IACT,mDAAU,CAAA;IACV,6DAAe,CAAA;IACf,2DAAc,CAAA;IACd,+DAAgB,CAAA;IAChB,yEAAqB,CAAA;IACrB,uEAAoB,CAAA;IACpB,uDAAY,CAAA;IACZ,yDAAa,CAAA;IACb,+DAAgB,CAAA;IAChB,oDAAW,CAAA;IACX,8DAAgB,CAAA;IAChB,8DAAgB,CAAA;IAChB,4DAAe,CAAA;IACf,4DAAe,CAAA;IACf,kDAAU,CAAA;IACV,8DAAgB,CAAA;IAChB,kEAAkB,CAAA;IAClB,4DAAe,CAAA;IACf,0DAAc,CAAA;IACd,4DAAe,CAAA;IACf,0DAAc,CAAA;IACd,kEAAkB,CAAA;IAClB,4DAAe,CAAA;IACf,0DAAc,CAAA;IACd,oDAAW,CAAA;IACX,wEAAqB,CAAA;IACrB,sEAAoB,CAAA;IACpB,8DAAgB,CAAA;IAChB,4DAAe,CAAA;IACf,wDAAa,CAAA;IACb,wEAAqB,CAAA;IACrB,wEAAqB,CAAA;IACrB,sFAA4B,CAAA;IAC5B,4FAA+B,CAAA;IAC/B,kGAAkC,CAAA;IAClC,0GAAsC,CAAA;IACtC,8DAAgB,CAAA;IAChB,4DAAe,CAAA;AACnB,CAAC,EAxCW,YAAY,4BAAZ,YAAY,QAwCvB"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { DateTime, DirectionsType, OuterPolygonRing, ShapeMatchType, StringBool, UnitsOfDistance } from './base';
|
|
2
|
+
import { BicycleCostingOptions, CostingModels, CostingOptions, MotorScooterCostingOptions, MotorcycleCostingOptions, MotorizedVehicleCostingOptions, PedestrianCostingOptions, TruckCostingOptions } from './costing';
|
|
3
|
+
import { SupportedLanguageAlias, SupportedLanguageTags } from './languages';
|
|
4
|
+
import { LatLng, RequestLocation } from './locations';
|
|
5
|
+
import { TraceAttributesFilter, TraceOptions } from './tracing';
|
|
6
|
+
export interface DirectionsOptions {
|
|
7
|
+
units?: UnitsOfDistance;
|
|
8
|
+
language?: SupportedLanguageTags | SupportedLanguageAlias;
|
|
9
|
+
}
|
|
10
|
+
export interface MapMatchingBaseRequest {
|
|
11
|
+
costing: Extract<CostingModels, 'auto' | 'bicycle' | 'bus' | 'pedestrian'>;
|
|
12
|
+
shape_match: ShapeMatchType;
|
|
13
|
+
costing_options?: CostingOptions;
|
|
14
|
+
directions_options?: DirectionsOptions;
|
|
15
|
+
directions_type?: DirectionsType;
|
|
16
|
+
begin_time?: number;
|
|
17
|
+
duration?: number[];
|
|
18
|
+
use_timestamps?: boolean;
|
|
19
|
+
trace_options?: TraceOptions;
|
|
20
|
+
filter?: TraceAttributesFilter;
|
|
21
|
+
}
|
|
22
|
+
export interface MapMatchingShapeRequest extends MapMatchingBaseRequest {
|
|
23
|
+
shape: LatLng[];
|
|
24
|
+
}
|
|
25
|
+
export interface MapMatchingPolylineRequest extends MapMatchingBaseRequest {
|
|
26
|
+
encoded_polyline: string;
|
|
27
|
+
}
|
|
28
|
+
export interface BaseRouteRequest {
|
|
29
|
+
locations: RequestLocation[];
|
|
30
|
+
costing_options?: CostingOptions;
|
|
31
|
+
directions_options?: DirectionsOptions;
|
|
32
|
+
directions_type?: DirectionsType;
|
|
33
|
+
id?: string;
|
|
34
|
+
exclude_locations?: RequestLocation[];
|
|
35
|
+
exclude_polygons?: OuterPolygonRing[];
|
|
36
|
+
date_time?: DateTime;
|
|
37
|
+
out_format?: 'json' | 'pbf';
|
|
38
|
+
linear_references?: StringBool;
|
|
39
|
+
prioritize_bidirectional?: StringBool;
|
|
40
|
+
}
|
|
41
|
+
export interface BicycleRouteRequest extends BaseRouteRequest {
|
|
42
|
+
costing: 'bicycle';
|
|
43
|
+
costing_options?: {
|
|
44
|
+
bicycle: BicycleCostingOptions;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export interface PedestrianRouteRequest extends BaseRouteRequest {
|
|
48
|
+
costing: 'pedestrian';
|
|
49
|
+
costing_options?: {
|
|
50
|
+
pedestrian: PedestrianCostingOptions;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface AutoRouteRequest extends BaseRouteRequest {
|
|
54
|
+
costing: 'auto';
|
|
55
|
+
costing_options?: {
|
|
56
|
+
auto: MotorizedVehicleCostingOptions;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface BusRouteRequest extends BaseRouteRequest {
|
|
60
|
+
costing: 'bus';
|
|
61
|
+
costing_options?: {
|
|
62
|
+
bus: MotorizedVehicleCostingOptions;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface TaxiRouteRequest extends BaseRouteRequest {
|
|
66
|
+
costing: 'taxi';
|
|
67
|
+
costing_options?: {
|
|
68
|
+
taxi: MotorizedVehicleCostingOptions;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface TruckRouteRequest extends BaseRouteRequest {
|
|
72
|
+
costing: 'truck';
|
|
73
|
+
costing_options?: {
|
|
74
|
+
truck: TruckCostingOptions;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface MotorCycleRouteRequest extends BaseRouteRequest {
|
|
78
|
+
costing: 'motorcycle';
|
|
79
|
+
costing_options?: {
|
|
80
|
+
motorcycle: MotorcycleCostingOptions;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface MotorScooterRouteRequest extends BaseRouteRequest {
|
|
84
|
+
costing: 'motor_scooter';
|
|
85
|
+
costing_options?: {
|
|
86
|
+
motor_scooter: MotorScooterCostingOptions;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export interface MultiModalRouteRequest extends BaseRouteRequest {
|
|
90
|
+
costing: 'multimodal';
|
|
91
|
+
}
|
|
92
|
+
export interface BikeShareRouteRequest extends BaseRouteRequest {
|
|
93
|
+
costing: 'bikeshare';
|
|
94
|
+
}
|
|
95
|
+
export type TurnByTurnRouteRequest = BicycleRouteRequest | PedestrianRouteRequest | AutoRouteRequest | BusRouteRequest | TaxiRouteRequest | TruckRouteRequest | MotorCycleRouteRequest | MotorScooterRouteRequest | BikeShareRouteRequest | MultiModalRouteRequest;
|
|
96
|
+
export type OptimizedRouteRequest = AutoRouteRequest | BicycleRouteRequest | PedestrianRouteRequest;
|
|
97
|
+
export interface IsochroneBaseContour {
|
|
98
|
+
color?: string;
|
|
99
|
+
}
|
|
100
|
+
export interface IsochroneTimeContour extends IsochroneBaseContour {
|
|
101
|
+
time?: number;
|
|
102
|
+
}
|
|
103
|
+
export interface IsochroneDistanceContour extends IsochroneBaseContour {
|
|
104
|
+
distance?: number;
|
|
105
|
+
}
|
|
106
|
+
export type IsochroneBaseRequest = (AutoRouteRequest | BicycleRouteRequest | PedestrianRouteRequest | MultiModalRouteRequest) & {
|
|
107
|
+
date_time?: DateTime;
|
|
108
|
+
id?: string;
|
|
109
|
+
polygons?: boolean;
|
|
110
|
+
denoise?: number;
|
|
111
|
+
generalize?: number;
|
|
112
|
+
show_locations?: boolean;
|
|
113
|
+
};
|
|
114
|
+
export type IsochroneTimeRequest = IsochroneBaseRequest & {
|
|
115
|
+
contours: IsochroneTimeContour[];
|
|
116
|
+
};
|
|
117
|
+
export type IsochroneDistanceRequest = IsochroneBaseRequest & {
|
|
118
|
+
contours: IsochroneDistanceContour[];
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=request.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/types/request.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,eAAe,EAClB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACH,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,EAC9B,wBAAwB,EACxB,mBAAmB,EACtB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,MAAM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|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/types/request.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type * as GeoJSON from 'geojson';
|
|
2
|
+
import { UnitsOfDistance } from './base';
|
|
3
|
+
import { SupportedLanguageAlias, SupportedLanguageTags } from './languages';
|
|
4
|
+
import { ResponseLocation } from './locations';
|
|
5
|
+
import { Maneuver } from './maneuver';
|
|
6
|
+
export interface Summary {
|
|
7
|
+
has_time_restrictions: boolean;
|
|
8
|
+
min_lat: number;
|
|
9
|
+
min_lon: number;
|
|
10
|
+
max_lat: number;
|
|
11
|
+
max_lon: number;
|
|
12
|
+
time: number;
|
|
13
|
+
length: number;
|
|
14
|
+
cost: number;
|
|
15
|
+
has_toll?: boolean;
|
|
16
|
+
has_highway?: boolean;
|
|
17
|
+
has_ferry?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface Leg {
|
|
20
|
+
summary: Summary;
|
|
21
|
+
shape: string;
|
|
22
|
+
}
|
|
23
|
+
export interface LegWithManeuvers<T extends Maneuver = Maneuver> extends Leg {
|
|
24
|
+
maneuvers: T[];
|
|
25
|
+
}
|
|
26
|
+
export interface Trip<T extends Leg = Leg> {
|
|
27
|
+
locations: ResponseLocation[];
|
|
28
|
+
legs: T[];
|
|
29
|
+
status: number;
|
|
30
|
+
status_message: string;
|
|
31
|
+
language: SupportedLanguageAlias | SupportedLanguageTags;
|
|
32
|
+
units: UnitsOfDistance;
|
|
33
|
+
summary: Summary;
|
|
34
|
+
warnings?: object;
|
|
35
|
+
}
|
|
36
|
+
export interface TripResponse<T extends Leg = Leg> {
|
|
37
|
+
trip: Trip<T>;
|
|
38
|
+
}
|
|
39
|
+
export interface IsochroneResponseProperties {
|
|
40
|
+
fill: string;
|
|
41
|
+
fillOpacity: number;
|
|
42
|
+
'fill-opacity': number;
|
|
43
|
+
fillColor: string;
|
|
44
|
+
color: string;
|
|
45
|
+
contour: number;
|
|
46
|
+
opacity: number;
|
|
47
|
+
metric: 'time' | 'distance';
|
|
48
|
+
}
|
|
49
|
+
export interface IsochroneResponseLocationProperties {
|
|
50
|
+
location_index: number;
|
|
51
|
+
type: 'snapped' | 'input';
|
|
52
|
+
}
|
|
53
|
+
export type Isochrone = GeoJSON.Feature<GeoJSON.MultiPoint | GeoJSON.LineString | GeoJSON.Polygon, IsochroneResponseProperties>;
|
|
54
|
+
export type IsochroneResponse = GeoJSON.FeatureCollection<GeoJSON.Polygon | GeoJSON.LineString | GeoJSON.MultiPoint, IsochroneResponseProperties>;
|
|
55
|
+
export type MapMatchingTraceRouteResponse<T extends Leg> = TripResponse<T>;
|
|
56
|
+
export interface MatchedPoints {
|
|
57
|
+
lat: number;
|
|
58
|
+
lon: number;
|
|
59
|
+
type: 'matched' | 'interpolated' | 'unmatched';
|
|
60
|
+
edge_index: number;
|
|
61
|
+
begin_route_discontinuity?: boolean;
|
|
62
|
+
end_route_discontinuity?: boolean;
|
|
63
|
+
distance_along_edge: number;
|
|
64
|
+
distance_from_trace_point?: number;
|
|
65
|
+
}
|
|
66
|
+
export interface MapMatchingTraceAttributesResponse {
|
|
67
|
+
units: UnitsOfDistance;
|
|
68
|
+
osm_changeset: number;
|
|
69
|
+
shape: string;
|
|
70
|
+
confidence_score: number;
|
|
71
|
+
raw_score: number;
|
|
72
|
+
admins: {
|
|
73
|
+
country_text: string;
|
|
74
|
+
state_text: string;
|
|
75
|
+
country_code?: string;
|
|
76
|
+
state_code?: string;
|
|
77
|
+
}[];
|
|
78
|
+
edges: object[];
|
|
79
|
+
matched_points: MatchedPoints[];
|
|
80
|
+
}
|
|
81
|
+
export interface StatusResponse {
|
|
82
|
+
version: string;
|
|
83
|
+
tileset_last_modfied: number;
|
|
84
|
+
}
|
|
85
|
+
export interface ExtendedStatusResponse extends StatusResponse {
|
|
86
|
+
has_tiles?: boolean;
|
|
87
|
+
has_admin?: boolean;
|
|
88
|
+
has_timezones?: boolean;
|
|
89
|
+
has_live_traffic?: boolean;
|
|
90
|
+
bbox?: object;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=response.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../src/types/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,OAAO;IACpB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,GAAG;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ,CAAE,SAAQ,GAAG;IACxE,SAAS,EAAE,CAAC,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,IAAI,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACrC,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,IAAI,EAAE,CAAC,EAAE,CAAC;IAKV,MAAM,EAAE,MAAM,CAAC;IACf,cA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;IAMnB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IAKpC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAOlC,mBAAmB,EAAE,MAAM,CAAC;IAM5B,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,kCAAkC;IAC/C,KAAK,EAAE,eAAe,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IAItB,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QACJ,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;IACJ,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,cAAc,EAAE,aAAa,EAAE,CAAC;CACnC;AAUD,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,oBAAoB,EAAE,MAAM,CAAC;CAChC;AAUD,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC1D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../src/types/response.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TracingOtherFilterKeys = 'osm_changeset' | 'shape' | 'admin.country_code' | 'admin.country_text' | 'admin.state_code' | 'admin.state_text' | 'matched.point' | 'matched.type' | 'matched.edge_index' | 'matched.begin_route_discontinuity' | 'matched.end_route_discontinuity' | 'matched.distance_along_edge' | 'matched.distance_from_trace_point';
|
|
2
|
+
export type TracingNodeFilterKeys = 'node.intersecting_edge.begin_heading' | 'node.intersecting_edge.from_edge_name_consistency' | 'node.intersecting_edge.to_edge_name_consistency' | 'node.intersecting_edge.driveability' | 'node.intersecting_edge.cyclability' | 'node.intersecting_edge.walkability' | 'node.intersecting_edge.use' | 'node.intersecting_edge.road_class' | 'node.intersecting_edge.lane_count' | 'node.elapsed_time' | 'node.admin_index' | 'node.type' | 'node.fork' | 'node.time_zone';
|
|
3
|
+
export type TracingEdgeFilterKeys = 'edge.names' | 'edge.length' | 'edge.speed' | 'edge.road_class' | 'edge.begin_heading' | 'edge.end_heading' | 'edge.begin_shape_index' | 'edge.end_shape_index' | 'edge.traversability' | 'edge.use' | 'edge.toll' | 'edge.unpaved' | 'edge.tunnel' | 'edge.bridge' | 'edge.roundabout' | 'edge.internal_intersection' | 'edge.drive_on_right' | 'edge.surface' | 'edge.sign.exit_number' | 'edge.sign.exit_branch' | 'edge.sign.exit_toward' | 'edge.sign.exit_name' | 'edge.travel_mode' | 'edge.vehicle_type' | 'edge.pedestrian_type' | 'edge.bicycle_type' | 'edge.transit_type' | 'edge.id' | 'edge.indoor' | 'edge.way_id' | 'edge.weighted_grade' | 'edge.max_upward_grade' | 'edge.max_downward_grade' | 'edge.mean_elevation' | 'edge.lane_count' | 'edge.cycle_lane' | 'edge.bicycle_network' | 'edge.sac_scale' | 'edge.shoulder' | 'edge.sidewalk' | 'edge.density' | 'edge.speed_limit' | 'edge.truck_speed' | 'edge.truck_route';
|
|
4
|
+
export interface TraceAttributesFilter {
|
|
5
|
+
attributes: (TracingNodeFilterKeys | TracingEdgeFilterKeys | TracingOtherFilterKeys)[];
|
|
6
|
+
action: 'include' | 'exclude';
|
|
7
|
+
}
|
|
8
|
+
export interface TraceOptions {
|
|
9
|
+
turn_penalty_factor?: number;
|
|
10
|
+
search_radius?: number[];
|
|
11
|
+
gps_accuracy?: number[];
|
|
12
|
+
breakage_distance?: number;
|
|
13
|
+
interpolation_distance?: number;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=tracing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracing.d.ts","sourceRoot":"","sources":["../../src/types/tracing.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAC5B,eAAe,GACf,OAAO,GACP,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,cAAc,GACd,oBAAoB,GACpB,mCAAmC,GACnC,iCAAiC,GACjC,6BAA6B,GAC7B,mCAAmC,CAAC;AAE1C,MAAM,MAAM,qBAAqB,GAC3B,sCAAsC,GACtC,mDAAmD,GACnD,iDAAiD,GACjD,qCAAqC,GACrC,oCAAoC,GACpC,oCAAoC,GACpC,4BAA4B,GAC5B,mCAAmC,GACnC,mCAAmC,GACnC,mBAAmB,GACnB,kBAAkB,GAClB,WAAW,GACX,WAAW,GACX,gBAAgB,CAAC;AAEvB,MAAM,MAAM,qBAAqB,GAC3B,YAAY,GACZ,aAAa,GACb,YAAY,GACZ,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,GAClB,wBAAwB,GACxB,sBAAsB,GACtB,qBAAqB,GACrB,UAAU,GACV,WAAW,GACX,cAAc,GACd,aAAa,GACb,aAAa,GACb,iBAAiB,GACjB,4BAA4B,GAC5B,qBAAqB,GACrB,cAAc,GACd,uBAAuB,GACvB,uBAAuB,GACvB,uBAAuB,GACvB,qBAAqB,GACrB,kBAAkB,GAClB,mBAAmB,GACnB,sBAAsB,GACtB,mBAAmB,GACnB,mBAAmB,GACnB,SAAS,GACT,aAAa,GACb,aAAa,GACb,qBAAqB,GACrB,uBAAuB,GACvB,yBAAyB,GACzB,qBAAqB,GACrB,iBAAiB,GACjB,iBAAiB,GACjB,sBAAsB,GACtB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IAClC,UAAU,EAAE,CACN,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,CAC3B,EAAE,CAAC;IACJ,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAI7B,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAIzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAIxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAI3B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/types/tracing.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { RequestOptions, RestClient } from '@iwpnd/rip-ts';
|
|
2
|
+
import { ExtendedStatusResponse, IsochroneDistanceRequest, IsochroneResponse, IsochroneTimeRequest, Leg, MapMatchingPolylineRequest, MapMatchingShapeRequest, MapMatchingTraceRouteResponse, OptimizedRouteRequest, StatusResponse, Trip, TripResponse, TurnByTurnRouteRequest } from './types';
|
|
3
|
+
export declare class Valhalla extends RestClient {
|
|
4
|
+
constructor(url?: string, options?: RequestOptions);
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
* Get a turn by turn route
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
* @remarks
|
|
11
|
+
* Returns a turn by turn route based on
|
|
12
|
+
* the input {@link TurnByTurnRouteRequest}
|
|
13
|
+
*
|
|
14
|
+
* @param query - {@link TurnByTurnRouteRequest}
|
|
15
|
+
*
|
|
16
|
+
* @returns {@link Trip}
|
|
17
|
+
*/
|
|
18
|
+
route<T extends Leg = Leg>(query: TurnByTurnRouteRequest): Promise<Trip<T>>;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* Get an optimized route
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
* @remarks
|
|
25
|
+
* Get an optimized route, a route between two or more locations,
|
|
26
|
+
* based on the input {@link OptimizedRouteRequest}.
|
|
27
|
+
*
|
|
28
|
+
* @param query - {@link OptimizedRouteRequest}
|
|
29
|
+
*
|
|
30
|
+
* @returns {@link TripResponse}
|
|
31
|
+
*/
|
|
32
|
+
optimizedRoute<T extends Leg>(query: OptimizedRouteRequest): Promise<TripResponse<T>>;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* Get one or more Isochrone(s) around an input location.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
* @remarks
|
|
39
|
+
* Get one or more Isochrones based on the input {@link IsochroneRouteRequest}.
|
|
40
|
+
*
|
|
41
|
+
* @param query - {@link IsochroneRouteRequest}
|
|
42
|
+
*
|
|
43
|
+
* @returns {@link IsochroneResponse}
|
|
44
|
+
*/
|
|
45
|
+
isochrone(query: IsochroneTimeRequest | IsochroneDistanceRequest): Promise<IsochroneResponse>;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* Mapmatch an input route to the road network
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
* @remarks
|
|
52
|
+
* Match an input route to the road network,
|
|
53
|
+
* based on the input {@link MapMatchingShapeRequest} | {@MapMatchingPolylineRequest}.
|
|
54
|
+
*
|
|
55
|
+
* @param query - {@link MapMatchingShapeRequest} | {@link MapMatchingPolylineRequest}
|
|
56
|
+
*
|
|
57
|
+
* @returns {@link MapMatchingTraceRouteResponse}
|
|
58
|
+
*/
|
|
59
|
+
mapmatching<T extends Leg>(query: MapMatchingShapeRequest | MapMatchingPolylineRequest): Promise<MapMatchingTraceRouteResponse<T>>;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* Get the valhalla server status
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
* @remarks
|
|
66
|
+
* Get the valhalla service status,
|
|
67
|
+
* If service_limits.status.allow_verbose is set to true, will also
|
|
68
|
+
* return addtional information if verbose is set to true.
|
|
69
|
+
*
|
|
70
|
+
* @param verbose (boolean): default false
|
|
71
|
+
*
|
|
72
|
+
* @returns {@link StatusResponse} | {@link ExtendedStatusResponse}
|
|
73
|
+
*/
|
|
74
|
+
status(verbose?: boolean): Promise<StatusResponse | ExtendedStatusResponse>;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=valhalla.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valhalla.d.ts","sourceRoot":"","sources":["../src/valhalla.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3D,OAAO,EACH,sBAAsB,EACtB,wBAAwB,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,GAAG,EACH,0BAA0B,EAC1B,uBAAuB,EACvB,6BAA6B,EAC7B,qBAAqB,EACrB,cAAc,EACd,IAAI,EACJ,YAAY,EACZ,sBAAsB,EACzB,MAAM,SAAS,CAAC;AAEjB,qBAAa,QAAS,SAAQ,UAAU;gBACxB,GAAG,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc;IAUlD;;;;;;;;;;;;OAYG;IACG,KAAK,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,EAC3B,KAAK,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAUnB;;;;;;;;;;;;OAYG;IACG,cAAc,CAAC,CAAC,SAAS,GAAG,EAC9B,KAAK,EAAE,qBAAqB,GAC7B,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAS3B;;;;;;;;;;;OAWG;IACG,SAAS,CACX,KAAK,EAAE,oBAAoB,GAAG,wBAAwB,GACvD,OAAO,CAAC,iBAAiB,CAAC;IAS7B;;;;;;;;;;;;OAYG;IACG,WAAW,CAAC,CAAC,SAAS,GAAG,EAC3B,KAAK,EAAE,uBAAuB,GAAG,0BAA0B,GAC5D,OAAO,CAAC,6BAA6B,CAAC,CAAC,CAAC,CAAC;IAY5C;;;;;;;;;;;;;OAaG;IACG,MAAM,CACR,OAAO,UAAQ,GAChB,OAAO,CAAC,cAAc,GAAG,sBAAsB,CAAC;CAMtD"}
|
package/dist/valhalla.js
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Valhalla = void 0;
|
|
4
|
+
const rip_ts_1 = require("@iwpnd/rip-ts");
|
|
5
|
+
class Valhalla extends rip_ts_1.RestClient {
|
|
6
|
+
constructor(url, options) {
|
|
7
|
+
super(url || process.env.VALHALLA_URL, {
|
|
8
|
+
...options,
|
|
9
|
+
headers: {
|
|
10
|
+
Accept: 'application/json',
|
|
11
|
+
...options?.headers,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* Get a turn by turn route
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
* @remarks
|
|
21
|
+
* Returns a turn by turn route based on
|
|
22
|
+
* the input {@link TurnByTurnRouteRequest}
|
|
23
|
+
*
|
|
24
|
+
* @param query - {@link TurnByTurnRouteRequest}
|
|
25
|
+
*
|
|
26
|
+
* @returns {@link Trip}
|
|
27
|
+
*/
|
|
28
|
+
async route(query) {
|
|
29
|
+
const options = {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
body: query,
|
|
32
|
+
};
|
|
33
|
+
const { trip } = await this.request('/route', options);
|
|
34
|
+
return trip;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* Get an optimized route
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
* @remarks
|
|
42
|
+
* Get an optimized route, a route between two or more locations,
|
|
43
|
+
* based on the input {@link OptimizedRouteRequest}.
|
|
44
|
+
*
|
|
45
|
+
* @param query - {@link OptimizedRouteRequest}
|
|
46
|
+
*
|
|
47
|
+
* @returns {@link TripResponse}
|
|
48
|
+
*/
|
|
49
|
+
async optimizedRoute(query) {
|
|
50
|
+
const options = {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
body: query,
|
|
53
|
+
};
|
|
54
|
+
return this.request('/optimized_route', options);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
* Get one or more Isochrone(s) around an input location.
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
* @remarks
|
|
62
|
+
* Get one or more Isochrones based on the input {@link IsochroneRouteRequest}.
|
|
63
|
+
*
|
|
64
|
+
* @param query - {@link IsochroneRouteRequest}
|
|
65
|
+
*
|
|
66
|
+
* @returns {@link IsochroneResponse}
|
|
67
|
+
*/
|
|
68
|
+
async isochrone(query) {
|
|
69
|
+
const options = {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
body: query,
|
|
72
|
+
};
|
|
73
|
+
return this.request('/isochrone', options);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
*
|
|
77
|
+
* Mapmatch an input route to the road network
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
* @remarks
|
|
81
|
+
* Match an input route to the road network,
|
|
82
|
+
* based on the input {@link MapMatchingShapeRequest} | {@MapMatchingPolylineRequest}.
|
|
83
|
+
*
|
|
84
|
+
* @param query - {@link MapMatchingShapeRequest} | {@link MapMatchingPolylineRequest}
|
|
85
|
+
*
|
|
86
|
+
* @returns {@link MapMatchingTraceRouteResponse}
|
|
87
|
+
*/
|
|
88
|
+
async mapmatching(query) {
|
|
89
|
+
const options = {
|
|
90
|
+
method: 'POST',
|
|
91
|
+
body: query,
|
|
92
|
+
};
|
|
93
|
+
return this.request('/trace_route', options);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* Get the valhalla server status
|
|
98
|
+
*
|
|
99
|
+
* @public
|
|
100
|
+
* @remarks
|
|
101
|
+
* Get the valhalla service status,
|
|
102
|
+
* If service_limits.status.allow_verbose is set to true, will also
|
|
103
|
+
* return addtional information if verbose is set to true.
|
|
104
|
+
*
|
|
105
|
+
* @param verbose (boolean): default false
|
|
106
|
+
*
|
|
107
|
+
* @returns {@link StatusResponse} | {@link ExtendedStatusResponse}
|
|
108
|
+
*/
|
|
109
|
+
async status(verbose = false) {
|
|
110
|
+
return this.request('/status', {
|
|
111
|
+
method: 'GET',
|
|
112
|
+
...(verbose && { query: { verbose: JSON.stringify(verbose) } }),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
exports.Valhalla = Valhalla;
|
|
117
|
+
//# sourceMappingURL=valhalla.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"valhalla.js","sourceRoot":"","sources":["../src/valhalla.ts"],"names":[],"mappings":";;;AAAA,0CAA2D;AAiB3D,MAAa,QAAS,SAAQ,mBAAU;IACpC,YAAY,GAAY,EAAE,OAAwB;QAC9C,KAAK,CAAC,GAAG,IAAK,OAAO,CAAC,GAAG,CAAC,YAAuB,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE;gBACL,MAAM,EAAE,kBAAkB;gBAC1B,GAAG,OAAO,EAAE,OAAO;aACtB;SACJ,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,KAAK,CACP,KAA6B;QAE7B,MAAM,OAAO,GAAG;YACZ,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,KAAK;SACd,CAAC;QAEF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAkB,QAAQ,EAAE,OAAO,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,cAAc,CAChB,KAA4B;QAE5B,MAAM,OAAO,GAAG;YACZ,MAAM,EAAE,MAAM;YACd,IAAI,E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