incyclist-services 1.3.19 → 1.3.21
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/lib/activities/base/model/index.d.ts +4 -0
- package/lib/activities/base/repo/db.js +3 -0
- package/lib/activities/base/repo/types.d.ts +1 -0
- package/lib/activities/base/utils/index.js +2 -2
- package/lib/activities/ride/service.js +10 -2
- package/lib/maps/ways/MapArea.d.ts +110 -0
- package/lib/maps/ways/MapArea.js +1194 -0
- package/lib/maps/ways/consts.d.ts +6 -0
- package/lib/maps/ways/consts.js +9 -0
- package/lib/maps/ways/service.d.ts +51 -0
- package/lib/maps/ways/service.js +561 -0
- package/lib/maps/ways/types.d.ts +81 -0
- package/lib/maps/ways/types.js +2 -0
- package/lib/maps/ways/utils.d.ts +60 -0
- package/lib/maps/ways/utils.js +619 -0
- package/lib/routes/base/parsers/incyclist.d.ts +3 -0
- package/lib/routes/base/parsers/incyclist.js +50 -1
- package/lib/routes/base/parsers/types.d.ts +5 -0
- package/lib/routes/base/types/index.d.ts +4 -4
- package/lib/routes/base/types/index.js +1 -0
- package/lib/routes/download/service.js +5 -1
- package/lib/settings/user/service.js +1 -1
- package/lib/utils/geo.d.ts +1 -0
- package/lib/utils/geo.js +57 -1
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/merge.js +3 -0
- package/lib/utils/time.d.ts +1 -0
- package/lib/utils/time.js +9 -0
- package/lib/utils/vector.d.ts +23 -0
- package/lib/utils/vector.js +201 -0
- package/lib/utils/xml.d.ts +1 -0
- package/lib/utils/xml.js +9 -2
- package/package.json +2 -2
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { LatLng } from "../../utils/geo";
|
|
2
|
+
export type Boundary = {
|
|
3
|
+
southwest: LatLng;
|
|
4
|
+
northeast: LatLng;
|
|
5
|
+
};
|
|
6
|
+
export interface CrossingInfo extends LatLng {
|
|
7
|
+
distance: number;
|
|
8
|
+
}
|
|
9
|
+
export type OverpassElementType = 'way' | 'node';
|
|
10
|
+
export type OverpassTags = {};
|
|
11
|
+
export type OverpassBounds = {
|
|
12
|
+
minlat: number;
|
|
13
|
+
minlon: number;
|
|
14
|
+
maxlat: number;
|
|
15
|
+
maxlon: number;
|
|
16
|
+
};
|
|
17
|
+
export type OverpassElement = {
|
|
18
|
+
type: OverpassElementType;
|
|
19
|
+
id: number;
|
|
20
|
+
tags?: Record<string, string>;
|
|
21
|
+
lat?: number;
|
|
22
|
+
lon?: number;
|
|
23
|
+
};
|
|
24
|
+
export interface OverpassNode extends OverpassElement {
|
|
25
|
+
type: 'node';
|
|
26
|
+
}
|
|
27
|
+
export interface OverpassWay extends OverpassElement {
|
|
28
|
+
type: 'way';
|
|
29
|
+
bounds: OverpassBounds;
|
|
30
|
+
nodes?: Array<number>;
|
|
31
|
+
geometry?: Array<{
|
|
32
|
+
lat: number;
|
|
33
|
+
lon: number;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export type OverpassResult = {
|
|
37
|
+
version: number;
|
|
38
|
+
generator?: string;
|
|
39
|
+
elements?: Array<OverpassElement>;
|
|
40
|
+
};
|
|
41
|
+
export type IncyclistNode = {
|
|
42
|
+
id: string;
|
|
43
|
+
lat: number;
|
|
44
|
+
lng: number;
|
|
45
|
+
ways?: Array<string>;
|
|
46
|
+
tags?: Record<string, string>;
|
|
47
|
+
};
|
|
48
|
+
export type FreeRideDataSet = {
|
|
49
|
+
nodesLookup: Record<string, IncyclistNode>;
|
|
50
|
+
ways: Array<IncyclistWay>;
|
|
51
|
+
waysLookup: Record<string, IncyclistWay>;
|
|
52
|
+
typeStats: Record<string, number>;
|
|
53
|
+
};
|
|
54
|
+
export type IncyclistWay = {
|
|
55
|
+
id: string;
|
|
56
|
+
path: Array<IncyclistNode>;
|
|
57
|
+
type: string;
|
|
58
|
+
name: string;
|
|
59
|
+
tags: Record<string, string>;
|
|
60
|
+
bounds: OverpassBounds;
|
|
61
|
+
onewayReverse?: boolean;
|
|
62
|
+
originalId?: string;
|
|
63
|
+
};
|
|
64
|
+
export type PartialWay = {
|
|
65
|
+
id: string;
|
|
66
|
+
path: Array<IncyclistNode>;
|
|
67
|
+
};
|
|
68
|
+
export type IncyclistWaySplit = {
|
|
69
|
+
way: PartialWay;
|
|
70
|
+
branches: Array<PartialWay>;
|
|
71
|
+
};
|
|
72
|
+
export type SplitPointInfo = {
|
|
73
|
+
point: IncyclistNode;
|
|
74
|
+
idx: number;
|
|
75
|
+
branches: Array<string>;
|
|
76
|
+
};
|
|
77
|
+
export type WaySplitInfo = {
|
|
78
|
+
id: string;
|
|
79
|
+
path: Array<IncyclistNode>;
|
|
80
|
+
onewayReverse?: boolean;
|
|
81
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Vector } from "../../utils";
|
|
2
|
+
import { LatLng } from "../../utils/geo";
|
|
3
|
+
import { Boundary, CrossingInfo, IncyclistNode, IncyclistWay, FreeRideDataSet, SplitPointInfo, WaySplitInfo } from "./types";
|
|
4
|
+
export declare function addNode(node: number, nodesLookup: Record<string, IncyclistNode>, id: number, path: Array<IncyclistNode>): void;
|
|
5
|
+
export declare function addWay(w: IncyclistWay, ways: Array<IncyclistWay>, waysLookup: Record<string, IncyclistWay>): void;
|
|
6
|
+
export declare function updateTypeStats(types: Record<string, number>, type: string): void;
|
|
7
|
+
export declare function parseMapData(str: JSON | string, filter: any): FreeRideDataSet;
|
|
8
|
+
export declare function splitAtPointInfo(way: IncyclistWay, pointInfo: SplitPointInfo): Array<Array<IncyclistNode>>;
|
|
9
|
+
export declare function getUntilFirstBranch(w: WaySplitInfo, props?: {
|
|
10
|
+
reverse?: boolean;
|
|
11
|
+
ignore?: string;
|
|
12
|
+
}): WaySplitInfo;
|
|
13
|
+
export declare function isRoundabout(w: any, strictCheck?: boolean): boolean;
|
|
14
|
+
export declare function splitAtIndex(way: any, idxSplit: any): any[][];
|
|
15
|
+
export declare function removeDuplicates(options: any): any;
|
|
16
|
+
export declare function splitAtPoint(way: IncyclistWay, point: IncyclistNode): Array<WaySplitInfo>;
|
|
17
|
+
export declare function generateID(ways: any): any;
|
|
18
|
+
export declare function buildQuery(template: any, boundary: Boundary): string;
|
|
19
|
+
export declare function generateQuery(location: LatLng, radius: number): string;
|
|
20
|
+
export declare function boundaryToString(boundary: Boundary): string;
|
|
21
|
+
export declare function pointEquals(p1: any, p2: any): boolean;
|
|
22
|
+
export declare function isWay(p: any): boolean;
|
|
23
|
+
export declare function isNode(p: any): boolean;
|
|
24
|
+
export declare function isAllowed(way: any, from: any, to: any): boolean;
|
|
25
|
+
export declare function isOneWay(way: IncyclistWay): boolean;
|
|
26
|
+
export declare function getFirstBranch(way: IncyclistWay, ignore?: string): SplitPointInfo;
|
|
27
|
+
export declare function findAdditional(a1: any, a2: any, id3: any, fn: any): any[];
|
|
28
|
+
export declare function _getPointOnLine(point: LatLng, p1: LatLng, p2: LatLng): CrossingInfo;
|
|
29
|
+
export declare function isBetween(point: LatLng, p1: LatLng, p2: LatLng): {
|
|
30
|
+
between: boolean;
|
|
31
|
+
offset: number;
|
|
32
|
+
};
|
|
33
|
+
export declare function distanceToPath(point: LatLng, way: any): any;
|
|
34
|
+
export declare function getNearestPath(point: any, ways: any): {
|
|
35
|
+
path: any;
|
|
36
|
+
distance: any;
|
|
37
|
+
way: any;
|
|
38
|
+
};
|
|
39
|
+
export declare function isWithinRange(distance: any): boolean;
|
|
40
|
+
export declare function getCrossing(A: LatLng, B: LatLng, C: LatLng, D: LatLng, exact?: boolean): CrossingInfo;
|
|
41
|
+
export declare function getPointCrossingPath(point: any, path: any, closest?: boolean): any;
|
|
42
|
+
export declare function getCrossingInfo(way1: any, way2: any): any;
|
|
43
|
+
export declare function getVector(p1: LatLng, p2: LatLng): Vector;
|
|
44
|
+
export declare function getBounds(lat: number, lng: number, offset: number): {
|
|
45
|
+
northeast: {
|
|
46
|
+
lat: any;
|
|
47
|
+
lng: any;
|
|
48
|
+
};
|
|
49
|
+
southwest: {
|
|
50
|
+
lat: any;
|
|
51
|
+
lng: any;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export declare function isWithinBoundary(location: LatLng, boundary: Boundary): boolean;
|
|
55
|
+
export declare function initialBearingTo(p1: LatLng, p2: LatLng): number;
|
|
56
|
+
export declare function alongTrackDistanceTo(point: LatLng, pathStart: LatLng, pathEnd: LatLng, radius?: number): number;
|
|
57
|
+
export declare function destinationPoint(start: LatLng, distance: number, bearing: number, radius?: number): {
|
|
58
|
+
lat: number;
|
|
59
|
+
lng: number;
|
|
60
|
+
};
|