@idm-plugin/geo 2.1.3 → 2.1.5
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/dist/index.d.ts +1 -0
- package/dist/index.js +649 -487
- package/dist/index.umd.cjs +6 -6
- package/dist/json/src/index.d.ts +80 -0
- package/dist/lane/src/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as turf from '@turf/turf';
|
|
2
|
+
export interface GeoJsonOptions {
|
|
3
|
+
/** 圆的边数,默认64 */
|
|
4
|
+
steps?: number;
|
|
5
|
+
/** 半径单位,默认 'nauticalmiles'。可选:'meters' | 'kilometers' | 'miles' | 'nauticalmiles' */
|
|
6
|
+
units?: turf.Units;
|
|
7
|
+
/** GeoJSON id */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** GeoJSON name */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** GeoJSON request id */
|
|
12
|
+
requestId?: string;
|
|
13
|
+
/** GeoJSON properties */
|
|
14
|
+
properties?: Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
export declare class GeoJsonHelper {
|
|
17
|
+
/**
|
|
18
|
+
* 基于turf画圆,返回GeoJSON Feature<Polygon>
|
|
19
|
+
* @param lng 圆心经度
|
|
20
|
+
* @param lat 圆心纬度
|
|
21
|
+
* @param radius 半径
|
|
22
|
+
* @param options 步数、单位等选项
|
|
23
|
+
*/
|
|
24
|
+
static drawCircle(lng: number, lat: number, radius: number, options?: GeoJsonOptions): turf.Feature<turf.Polygon>;
|
|
25
|
+
/**
|
|
26
|
+
* 基于turf画矩形,返回GeoJSON Feature<Polygon>
|
|
27
|
+
* @param start 对角线起点 [lng, lat]
|
|
28
|
+
* @param end 对角线终点 [lng, lat]
|
|
29
|
+
* @param options 选项
|
|
30
|
+
*/
|
|
31
|
+
static drawRect(start: number[], end: number[], options?: GeoJsonOptions): turf.Feature<turf.Polygon>;
|
|
32
|
+
/**
|
|
33
|
+
* 基于turf画线,返回GeoJSON Feature<LineString>
|
|
34
|
+
* 需要注意跨180度的情况
|
|
35
|
+
* @param start
|
|
36
|
+
* @param end
|
|
37
|
+
* @param options
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
static drawLine(start: number[], end: number[], options?: GeoJsonOptions): turf.Feature<turf.LineString>;
|
|
41
|
+
/**
|
|
42
|
+
* 基于turf画多边形,返回GeoJSON Feature<Polygon>
|
|
43
|
+
* @param coordinates
|
|
44
|
+
* @param options
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
static drawPolygon(coordinates: number[][], options?: GeoJsonOptions): turf.Feature<turf.Polygon>;
|
|
48
|
+
/**
|
|
49
|
+
* 解析ORM GeoJSON Feature (圆), 返回FeatureCollection
|
|
50
|
+
* @param feature
|
|
51
|
+
* @param options
|
|
52
|
+
* @returns
|
|
53
|
+
* 如果feature是圆,则返回圆的中心、端点、半径线 和 边线四个Feature
|
|
54
|
+
*/
|
|
55
|
+
static parseCircle(feature: turf.Feature<turf.Polygon>, options?: GeoJsonOptions): turf.FeatureCollection<any>;
|
|
56
|
+
/**
|
|
57
|
+
* 解析ORM GeoJSON Feature (矩形), 返回FeatureCollection
|
|
58
|
+
* @param feature
|
|
59
|
+
* @param options
|
|
60
|
+
* @returns
|
|
61
|
+
* 如果feature是矩形,则返回矩形的四个顶点和矩形Feature
|
|
62
|
+
*/
|
|
63
|
+
static parseRect(feature: turf.Feature<turf.Polygon>, options?: GeoJsonOptions): turf.FeatureCollection<any>;
|
|
64
|
+
/**
|
|
65
|
+
* 解析ORM GeoJSON Feature (线), 返回FeatureCollection
|
|
66
|
+
* @param feature
|
|
67
|
+
* @param options
|
|
68
|
+
* @returns
|
|
69
|
+
* 如果feature是线,则返回线的起点和终点以及线Feature
|
|
70
|
+
*/
|
|
71
|
+
static parseLine(feature: turf.Feature<turf.LineString>, options?: GeoJsonOptions): turf.FeatureCollection<any>;
|
|
72
|
+
/**
|
|
73
|
+
* 解析ORM GeoJSON Feature (多边形), 返回FeatureCollection
|
|
74
|
+
* @param feature
|
|
75
|
+
* @param options
|
|
76
|
+
* @returns
|
|
77
|
+
* 如果feature是多边形,则返回多边形的顶点和多边形Feature
|
|
78
|
+
*/
|
|
79
|
+
static parsePolygon(feature: turf.Feature<turf.Polygon>, options?: GeoJsonOptions): turf.FeatureCollection<any>;
|
|
80
|
+
}
|
package/dist/lane/src/index.d.ts
CHANGED
|
@@ -367,8 +367,8 @@ export declare class LaneHelper {
|
|
|
367
367
|
* @param waypoints 途径点
|
|
368
368
|
* @see https://cirm.org/rtz-xml-schemas
|
|
369
369
|
*/
|
|
370
|
-
static waypoints2RTZ10(name: string, waypoints: Coordinate[]): string;
|
|
371
|
-
static toRTZWaypoints(waypoints: Coordinate[], precision?: number): string[];
|
|
370
|
+
static waypoints2RTZ10(name: string, waypoints: Coordinate[], withExtensions?: boolean): string;
|
|
371
|
+
static toRTZWaypoints(waypoints: Coordinate[], precision?: number, withExtensions?: boolean): string[];
|
|
372
372
|
/**
|
|
373
373
|
* 路径转通用CSV (纯十进制度数、无厂商头、RFC 4180标准)
|
|
374
374
|
* 大部分海图设备/导航软件均可导入此格式
|