@maplat/tin 1.1.2-rc.1 → 1.1.2-rc.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.
package/README.ja.md CHANGED
@@ -37,7 +37,7 @@ MaplatTin は Apache License 2.0(バージョン 0.14.2 以降)のオープ
37
37
  ## クイックスタート
38
38
 
39
39
  <!-- release-pinned:start -->
40
- > **現在のリリース: `1.1.2-rc.1`**。このブロックは本リポジトリで唯一
40
+ > **現在のリリース: `1.1.2-rc.2`**。このブロックは本リポジトリで唯一
41
41
  > リリース版数を持つ場所です。ブロックの外はすべて 1.0 正式版を前提に
42
42
  > 書かれています。
43
43
  > npm: [`@maplat/tin`](https://www.npmjs.com/package/@maplat/tin)
@@ -86,7 +86,7 @@ const restored = tin.transform(transformed, true);
86
86
 
87
87
  ```html
88
88
  <!-- MaplatTin (UMD) -->
89
- <script src="https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.1/dist/maplat_tin.umd.js"></script>
89
+ <script src="https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.2/dist/maplat_tin.umd.js"></script>
90
90
  <script>
91
91
  const tin = new maplatTin.default({ wh: [500, 500] });
92
92
  </script>
@@ -96,7 +96,7 @@ const restored = tin.transform(transformed, true);
96
96
 
97
97
  ```html
98
98
  <script type="module">
99
- import Tin from 'https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.1/dist/maplat_tin.js';
99
+ import Tin from 'https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.2/dist/maplat_tin.js';
100
100
  const tin = new Tin({ wh: [500, 500] });
101
101
  </script>
102
102
  ```
package/README.md CHANGED
@@ -40,7 +40,7 @@ MaplatTin is open-source under the Apache License 2.0 (from version 0.14.2).
40
40
  ## Quick Start
41
41
 
42
42
  <!-- release-pinned:start -->
43
- > **Current release: `1.1.2-rc.1`**. This block is the only place in
43
+ > **Current release: `1.1.2-rc.2`**. This block is the only place in
44
44
  > this repository that carries a release version; everything outside it is
45
45
  > written against the 1.0 release.
46
46
  > npm: [`@maplat/tin`](https://www.npmjs.com/package/@maplat/tin)
@@ -89,7 +89,7 @@ const restored = tin.transform(transformed, true);
89
89
 
90
90
  ```html
91
91
  <!-- MaplatTin (UMD) -->
92
- <script src="https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.1/dist/maplat_tin.umd.js"></script>
92
+ <script src="https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.2/dist/maplat_tin.umd.js"></script>
93
93
  <script>
94
94
  const tin = new maplatTin.default({ wh: [500, 500] });
95
95
  </script>
@@ -99,7 +99,7 @@ Or using ES modules:
99
99
 
100
100
  ```html
101
101
  <script type="module">
102
- import Tin from 'https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.1/dist/maplat_tin.js';
102
+ import Tin from 'https://cdn.jsdelivr.net/npm/@maplat/tin@1.1.2-rc.2/dist/maplat_tin.js';
103
103
  const tin = new Tin({ wh: [500, 500] });
104
104
  </script>
105
105
  ```
@@ -0,0 +1,27 @@
1
+ import { Position } from 'geojson';
2
+ /** [紙の面の位置, 地理面の位置, 折れ線の全長に対する比] */
3
+ export type EdgeNodeItem = [Position, Position, number];
4
+ /**
5
+ * 両面の折れ点を「同じ位置」とみなす累積長比の許容幅。
6
+ *
7
+ * 比は 0 以上 1 以下なので絶対許容幅で足りる。`Math.sqrt` と加算・除算の丸めだけで
8
+ * 生じる比のずれは理論上 (2n+12)×Number.EPSILON(n は片側のセグメント数、実測では
9
+ * 最大 2×Number.EPSILON)に収まるため、実測値の 128 倍・理論値(n=122)を覆う
10
+ * 256×Number.EPSILON を採る。正当に別の位置にある折れ点の比の間隔は実データで
11
+ * 6.9e-3 以上(合成の悪条件でも 1e-11)あるため、この幅では誤って結びつかない。
12
+ */
13
+ export declare const RATIO_MATCH_TOLERANCE: number;
14
+ /**
15
+ * 必須エッジの中継点を作る。両面の折れ線(端点を含む)を、累積長の比で突き合わせ、片方の面の折れ点を
16
+ * 相手の面へ写す。比の順に並べて返す。
17
+ *
18
+ * 比が許容幅内に一致する折れ点同士は 1 つの中継点へまとめ、どちらの面の折れ点の位置もそのまま使う。
19
+ * 一致する相手が無ければ、相手面の該当する区間を線形補間する。丸めで比がわずかにずれただけの
20
+ * 対応する折れ点を 2 つに分けて作らせないため、範囲チェックより前に許容幅内の最寄りを探す。
21
+ *
22
+ * `Tin#generatePointsSet` がこの関数を使う。
23
+ *
24
+ * @param illstNodes 紙の面の折れ線(始点・折れ点・終点)
25
+ * @param mercNodes 地理面の折れ線(始点・折れ点・終点)
26
+ */
27
+ export declare function interpolateEdgeNodes(illstNodes: Position[], mercNodes: Position[]): EdgeNodeItem[];