@idm-plugin/geo 2.1.0 → 2.1.2

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.
@@ -368,18 +368,40 @@ export declare class LaneHelper {
368
368
  * @see https://cirm.org/rtz-xml-schemas
369
369
  */
370
370
  static waypoints2RTZ10(name: string, waypoints: Coordinate[]): string;
371
+ static toRTZWaypoints(waypoints: Coordinate[], precision?: number): string[];
371
372
  /**
372
- * 路径转CSV (JRC ECDIS ROUTE SHEET格式)
373
- * @param name 路径名称
373
+ * 路径转通用CSV (纯十进制度数、无厂商头、RFC 4180标准)
374
+ * 大部分海图设备/导航软件均可导入此格式
374
375
  * @param waypoints 途径点
376
+ * @param options.precision 经纬度小数位数,默认6
375
377
  */
376
- static waypoints2CSV(name: string, waypoints: Coordinate[], format?: string): string;
378
+ static waypoints2CSV(waypoints: Coordinate[], options?: {
379
+ precision?: number;
380
+ }): string;
377
381
  /**
378
- * 路径转XLSX (Excel 2003 SpreadsheetML格式,可直接被Excel打开)
379
- * @param name 路径名称
382
+ * RFC 4180 CSV字段转义:含逗号、双引号、换行时用双引号包裹,内部双引号翻倍
383
+ */
384
+ static csvEscapeField(value: any): string;
385
+ /**
386
+ * 十进制度数转NMEA度分格式 (DDMM.MM / DDDMM.MM)
387
+ * @param value 十进制度数
388
+ * @param isLat true为纬度,false为经度
389
+ */
390
+ static decimalToNmeaDm(value: number, isLat: boolean): {
391
+ dm: string;
392
+ dir: string;
393
+ };
394
+ /**
395
+ * 计算NMEA 0183校验和 ($与*之间所有字符的异或,两字符十六进制大写)
396
+ * @param sentence $与*之间的字符串
397
+ */
398
+ static nmeaChecksum(sentence: string): string;
399
+ /**
400
+ * 路径转NMEA 0183 WPL航点语句
380
401
  * @param waypoints 途径点
402
+ * @returns 多条$GPWPL语句,以\r\n分隔
381
403
  */
382
- static waypoints2XLSX(name: string, waypoints: Coordinate[], format?: string): string;
404
+ static waypoints2NMEA(waypoints: Coordinate[]): string;
383
405
  /**
384
406
  * 路径摘要
385
407
  * @param coordinates 已排序的坐标
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@idm-plugin/geo",
3
3
  "private": false,
4
- "version": "2.1.0",
4
+ "version": "2.1.2",
5
5
  "description": "idm plugin for geo in browser",
6
6
  "type": "module",
7
7
  "keywords": [