@maplat/tin 0.14.1 → 1.0.0-rc1
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 +1 -23
- package/README.ja.md +164 -154
- package/README.md +162 -152
- package/dist/maplat_tin.js +2583 -2445
- package/dist/maplat_tin.umd.js +5 -5
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
Maplat Limited License
|
|
2
|
-
Ver. 1.1 Mar. 9 2021
|
|
3
1
|
|
|
4
|
-
残念ながら、悪質なフリーライダーの発生により、Maplat関連のライブラリはオープンソースであることを一時放棄し、制限ライセンスで公開せざるを得なくなりました。
|
|
5
|
-
本ライセンスのVer.1.1を公開した2021年3月9日以降、問題が解決し再びApache 2.0ライセンスに戻せるようになるまでの間、MaplatTin Version 0.8.0以降のバージョンを制限ライセンスで公開します。
|
|
6
|
-
制限期間のライセンス条項は以下の通りです。
|
|
7
|
-
|
|
8
|
-
1. 次項以降に記されない一般の利用者については、通常のApache 2.0に等しい条件での利用を認める。ただし、本ライセンスとApache 2.0ライセンスが矛盾する場合は、本ライセンスが優先される。
|
|
9
|
-
2. しかし、下記に記す特定のユーザについては、ライブラリの利用、コードの閲覧や再利用、また利用に伴う特許の知的財産利用権など、本ライブラリの利用に関する一切の権限を認めない。
|
|
10
|
-
* 株式会社コギト 日本、京都市中京区錦小路通烏丸西入ル占出山町311 アニマート錦5F
|
|
11
|
-
3. 本ライセンスの記載内容について日本語表記と英語表記が矛盾する場合、日本語表記での内容が優先される。
|
|
12
|
-
|
|
13
|
-
Unfortunately, due to the occurrence of malicious free riders, we have been forced to temporarily abandon the Maplat-related libraries as open source and release them under a restricted license.
|
|
14
|
-
After March 9, 2021, when we released Version 1.1 of this license, we will release MaplatTin Version 0.8.0 and later versions under a restricted license until the problem is resolved and we can revert to the Apache 2.0 license again.
|
|
15
|
-
The license terms for the restricted period are as follows:
|
|
16
|
-
|
|
17
|
-
1. For general users not listed in the next sections, the terms of the license are the same as for regular Apache 2.0 license. However, if there is any conflict between this License and the Apache 2.0 License, this License shall prevail.
|
|
18
|
-
2. However, the specific users listed below are not granted any rights related to the use of the library, including but not limited to the use of the library, viewing and reuse of the code, and the right to use any patents associated with the use of the library.
|
|
19
|
-
* COGITO Inc., 5F Animato Nishiki, 311 Uradeyamacho, Nakagyo-ku, Kyoto, Japan
|
|
20
|
-
3. In the event of any discrepancy between the Japanese and English versions of this license, the Japanese version shall prevail.
|
|
21
|
-
|
|
22
|
-
=====
|
|
23
|
-
Reference:
|
|
24
2
|
Apache License
|
|
25
3
|
Version 2.0, January 2004
|
|
26
4
|
http://www.apache.org/licenses/
|
|
@@ -209,7 +187,7 @@ Reference:
|
|
|
209
187
|
same "printed page" as the copyright notice for easier
|
|
210
188
|
identification within third-party archives.
|
|
211
189
|
|
|
212
|
-
Copyright 2019 Kohei Otsuka, Code for History
|
|
190
|
+
Copyright 2019-2026 Kohei Otsuka, Code for History / Nayuta, Inc.
|
|
213
191
|
|
|
214
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
215
193
|
you may not use this file except in compliance with the License.
|
package/README.ja.md
CHANGED
|
@@ -1,220 +1,230 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- SECTION 1: Header (logo, badges, title) -->
|
|
2
|
+
<h1 align="center">MaplatTin</h1>
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://github.com/code4history/MaplatTin/actions/workflows/ci.yml"><img src="https://github.com/code4history/MaplatTin/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
6
|
+
<a href="https://www.npmjs.com/package/@maplat/tin"><img src="https://img.shields.io/npm/v/@maplat/tin" alt="npm version" /></a>
|
|
7
|
+
<a href="LICENSE"><img src="https://img.shields.io/npm/l/@maplat/tin" alt="License" /></a>
|
|
8
|
+
</p>
|
|
4
9
|
|
|
5
|
-
2
|
|
6
|
-
|
|
10
|
+
<!-- SECTION 2: Elevator Pitch -->
|
|
11
|
+
## MaplatTin について
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
MaplatTin は制御点に基づいて2つの平面座標系間の同相変換を定義・実行する
|
|
14
|
+
JavaScript ライブラリです。非線形かつ位相を保存する(同相な)双方向写像を
|
|
15
|
+
保証し、これが [Maplat](https://github.com/code4history/Maplat) ビューアが
|
|
16
|
+
古地図を正確な現代地図へ**元の画像を歪めずに**重ね合わせるための中核特性
|
|
17
|
+
です。
|
|
9
18
|
|
|
10
|
-
|
|
19
|
+
MaplatTin は Apache License 2.0(バージョン 0.14.2 以降)のオープンソース
|
|
20
|
+
プロジェクトです。
|
|
11
21
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- **位相保存:** 変換時の同相性(トポロジー)を維持
|
|
15
|
-
- **柔軟な設定:**
|
|
16
|
-
- 通常/鳥瞰図モードの頂点処理
|
|
17
|
-
- 厳密/自動/緩和モードのトポロジーチェック
|
|
18
|
-
- Y軸の向きの制御
|
|
19
|
-
- **エッジ制約:** より正確な変換のための制約付きエッジの指定が可能
|
|
20
|
-
- **状態管理:** 変換定義の保存と復元をサポート
|
|
22
|
+
<!-- SECTION 3: Language switch link -->
|
|
23
|
+
**[英語版はこちら / Read this document in English](README.md)**
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
<!-- SECTION 4: Key Features -->
|
|
26
|
+
## 主な特徴
|
|
23
27
|
|
|
24
|
-
-
|
|
25
|
-
-
|
|
28
|
+
- **座標変換定義の生成** — 制御点とエッジ制約に基づいて座標変換定義を生成
|
|
29
|
+
- **双方向座標変換** — 2つの平面間で双方向の座標変換が可能
|
|
30
|
+
- **位相保存** — 変換時の同相性(トポロジー)を維持
|
|
31
|
+
- **柔軟な設定** — 通常/鳥瞰図モードの頂点処理・厳密/自動/緩和モードの
|
|
32
|
+
トポロジーチェック・Y 軸の向きの制御
|
|
33
|
+
- **エッジ制約** — より正確な変換のための制約付きエッジの指定が可能
|
|
34
|
+
- **状態管理** — 変換定義の保存と復元をサポート
|
|
35
|
+
- オープンソース(Apache 2.0・バージョン 0.14.2 以降)— Maplat エコシステムの一部
|
|
26
36
|
|
|
27
|
-
|
|
37
|
+
<!-- SECTION 5: Quick Start -->
|
|
38
|
+
## クイックスタート
|
|
28
39
|
|
|
29
|
-
|
|
40
|
+
> リリース依存情報(ADR-0012)。下記バージョン `1.0.0-rc1` は現在の
|
|
41
|
+
> リリースです。リリースごとに更新してください。
|
|
30
42
|
|
|
31
|
-
|
|
32
|
-
pnpm add @maplat/tin
|
|
33
|
-
```
|
|
43
|
+
### インストール
|
|
34
44
|
|
|
35
|
-
|
|
45
|
+
```bash
|
|
46
|
+
# pnpm(推奨)
|
|
47
|
+
pnpm add @maplat/tin
|
|
36
48
|
|
|
37
|
-
|
|
49
|
+
# npm
|
|
38
50
|
npm install @maplat/tin
|
|
39
51
|
```
|
|
40
52
|
|
|
53
|
+
### 最小利用例
|
|
41
54
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
### テスト
|
|
45
|
-
|
|
46
|
-
プロジェクトには、TIN変換ロジックと内部EdgeBound制約エンジンの両方に対する包括的なユニットテストが含まれています。
|
|
47
|
-
|
|
48
|
-
**すべてのテストを実行:**
|
|
49
|
-
```sh
|
|
50
|
-
pnpm test
|
|
51
|
-
```
|
|
55
|
+
```typescript
|
|
56
|
+
import Tin from '@maplat/tin';
|
|
52
57
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
# TIN変換のテスト
|
|
59
|
-
pnpm test tests/tin
|
|
60
|
-
```
|
|
58
|
+
// 基本設定でインスタンスを作成
|
|
59
|
+
const tin = new Tin({
|
|
60
|
+
wh: [500, 500], // ソース座標系の幅と高さ
|
|
61
|
+
yaxisMode: Tin.YAXIS_FOLLOW,
|
|
62
|
+
});
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
- `tests/transform.test.ts` - 座標変換テスト
|
|
64
|
+
// 制御点の設定: [ソース座標, ターゲット座標] の配列
|
|
65
|
+
tin.setPoints([
|
|
66
|
+
[[100, 100], [200, 200]],
|
|
67
|
+
[[200, 200], [400, 400]],
|
|
68
|
+
[[150, 150], [320, 350]],
|
|
69
|
+
[[200, 100], [420, 220]],
|
|
70
|
+
]);
|
|
70
71
|
|
|
71
|
-
|
|
72
|
+
// TIN ネットワークの初期化
|
|
73
|
+
tin.updateTin();
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
pnpm run build
|
|
76
|
-
```
|
|
75
|
+
// 順方向の変換(ソース → ターゲット)
|
|
76
|
+
const transformed = tin.transform([160, 160], false);
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
pnpm run build:demo
|
|
78
|
+
// 逆方向の変換(ターゲット → ソース)
|
|
79
|
+
const restored = tin.transform(transformed, true);
|
|
81
80
|
```
|
|
82
81
|
|
|
83
|
-
###
|
|
84
|
-
|
|
85
|
-
ブラウザで使用する場合:
|
|
82
|
+
### CDN(jsDelivr)
|
|
86
83
|
|
|
87
84
|
```html
|
|
88
|
-
<!--
|
|
89
|
-
<script src="https://
|
|
85
|
+
<!-- MaplatTin (UMD) -->
|
|
86
|
+
<script src="https://cdn.jsdelivr.net/npm/@maplat/tin@1.0.0-rc1/dist/maplat_tin.umd.js"></script>
|
|
90
87
|
<script>
|
|
91
|
-
|
|
92
|
-
const tin = new tin.default({
|
|
93
|
-
wh: [500, 500]
|
|
94
|
-
});
|
|
88
|
+
const tin = new maplatTin.default({ wh: [500, 500] });
|
|
95
89
|
</script>
|
|
96
90
|
```
|
|
97
91
|
|
|
98
|
-
またはES
|
|
92
|
+
または ES モジュールとして使用する場合:
|
|
99
93
|
|
|
100
94
|
```html
|
|
101
|
-
<!-- Maplat Tin (ESモジュール) -->
|
|
102
95
|
<script type="module">
|
|
103
|
-
import Tin from
|
|
104
|
-
|
|
105
|
-
const tin = new Tin({
|
|
106
|
-
wh: [500, 500]
|
|
107
|
-
});
|
|
96
|
+
import Tin from 'https://cdn.jsdelivr.net/npm/@maplat/tin@1.0.0-rc1/dist/maplat_tin.js';
|
|
97
|
+
const tin = new Tin({ wh: [500, 500] });
|
|
108
98
|
</script>
|
|
109
99
|
```
|
|
110
100
|
|
|
111
|
-
|
|
101
|
+
※最新の互換バージョンを使用してください。
|
|
112
102
|
|
|
113
|
-
|
|
114
|
-
// 基本設定でインスタンスを作成
|
|
115
|
-
const tin = new Tin({
|
|
116
|
-
wh: [500, 500], // ソース座標系の幅と高さ
|
|
117
|
-
yaxisMode: Tin.YAXIS_FOLLOW // Y軸の向きの設定
|
|
118
|
-
});
|
|
103
|
+
### API リファレンス
|
|
119
104
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
[
|
|
123
|
-
|
|
124
|
-
[[150,150], [320, 350]], // 点3
|
|
125
|
-
[[200,100], [420, 220]] // 点4
|
|
126
|
-
]);
|
|
105
|
+
- **API シグネチャ**(リリース依存): [`docs/api/`](docs/api/) を参照
|
|
106
|
+
- **概念解説**(リリース非依存):
|
|
107
|
+
[Wiki API-Reference](https://github.com/code4history/MaplatTin/wiki/API-Reference)
|
|
108
|
+
を参照
|
|
127
109
|
|
|
128
|
-
|
|
129
|
-
tin.updateTin();
|
|
110
|
+
### 開発
|
|
130
111
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
console.log('トポロジーOK: 往復変換が保証されます');
|
|
134
|
-
} else if (tin.strict_status === Tin.STATUS_LOOSE) {
|
|
135
|
-
console.log('トポロジー警告: 往復変換が保証されません');
|
|
136
|
-
}
|
|
112
|
+
#### セットアップ
|
|
113
|
+
リポジトリをクローンし依存関係をインストールします。
|
|
137
114
|
|
|
138
|
-
|
|
139
|
-
|
|
115
|
+
```bash
|
|
116
|
+
git clone https://github.com/code4history/MaplatTin.git
|
|
117
|
+
cd MaplatTin
|
|
118
|
+
pnpm install
|
|
119
|
+
```
|
|
140
120
|
|
|
141
|
-
|
|
142
|
-
|
|
121
|
+
#### 開発サーバー
|
|
122
|
+
ホットリロード付きの開発サーバーを起動します。
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pnpm dev
|
|
143
126
|
```
|
|
144
127
|
|
|
145
|
-
|
|
128
|
+
#### ビルド
|
|
146
129
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
130
|
+
```bash
|
|
131
|
+
pnpm build # ライブラリをビルド (dist/)
|
|
132
|
+
pnpm build:demo # デモサイトをビルド (dist-demo/)
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### テスト
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pnpm test # ユニットテスト (Vitest) を実行
|
|
139
|
+
pnpm typecheck # 型チェック (TypeScript) を実行
|
|
140
|
+
pnpm lint # リンター/フォーマッター (ESLint/Prettier) を実行
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
テストカバレッジ:
|
|
144
|
+
|
|
145
|
+
- `tests/edgebound/` — 内部 EdgeBound 制約エンジンのテスト(455 テスト)
|
|
146
|
+
- `tests/tin.test.ts` — 実際の地図データを使用した TIN 変換テスト
|
|
147
|
+
- `tests/transform.test.ts` — 座標変換テスト
|
|
157
148
|
|
|
158
|
-
|
|
149
|
+
<!-- SECTION 6: Prerequisites -->
|
|
150
|
+
## 動作環境
|
|
159
151
|
|
|
160
|
-
|
|
152
|
+
> `package.json` の `engines` フィールドから自動抽出(ADR-0012: リリース依存)。
|
|
161
153
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
| `setPoints(points)` | **制御点の設定** |
|
|
165
|
-
| `setEdges(edges)` | **制約付きエッジの設定** |
|
|
166
|
-
| `updateTin()` | **TINネットワークの初期化/更新** |
|
|
167
|
-
| `transform(coords, inverse)` | **座標変換の実行** |
|
|
168
|
-
| `getCompiled()` | **シリアライズ可能な状態の取得** |
|
|
169
|
-
| `setCompiled(state)` | **シリアライズされた状態からの復元** |
|
|
170
|
-
| `getFormatVersion()` | **フォーマットバージョン番号の取得** |
|
|
154
|
+
- Node.js: `>=20.0.0`(GitHub Actions で検証済みの LTS)
|
|
155
|
+
- pnpm: `>=9.0.0`(必須・`package.json` で pnpm を強制)
|
|
171
156
|
|
|
172
|
-
|
|
157
|
+
<!-- SECTION 7 Peer Dependencies: 省略(OpenLayers 依存なし) -->
|
|
173
158
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- `Tin.YAXIS_INVERT` - Y軸が反転する
|
|
159
|
+
<!-- SECTION 8: Ecosystem / Related Repositories -->
|
|
160
|
+
## エコシステム
|
|
177
161
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- `Tin.STATUS_LOOSE` - 緩和されたトポロジー(往復変換が保証されない)
|
|
162
|
+
MaplatTin は [Code for History](https://github.com/code4history) が運営する
|
|
163
|
+
Maplat エコシステムの一部です。全容は下記エコシステム図を参照してください。
|
|
181
164
|
|
|
182
|
-
|
|
183
|
-
|
|
165
|
+
📖 **エコシステム図** — *(図は現在外部非公開の計画リポジトリに保持して
|
|
166
|
+
います。下記の姉妹リポジトリ表が公開版の代替です)*
|
|
184
167
|
|
|
185
|
-
###
|
|
168
|
+
### 姉妹リポジトリ
|
|
186
169
|
|
|
187
|
-
|
|
|
188
|
-
|
|
189
|
-
|
|
|
190
|
-
|
|
|
191
|
-
|
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
| `vertexCalc(points, edgeNodes, centroid, originPoly, xy, vertexMode)` | **頂点座標の計算** |
|
|
170
|
+
| リポジトリ | ライセンス | npm | 役割 |
|
|
171
|
+
|---|---|---|---|
|
|
172
|
+
| [Maplat](https://github.com/code4history/Maplat) | Apache 2.0 | `@maplat/ui` | メインビューア |
|
|
173
|
+
| [MaplatCore](https://github.com/code4history/MaplatCore) | Apache 2.0 | `@maplat/core` | コアライブラリ |
|
|
174
|
+
| [MaplatTin](https://github.com/code4history/MaplatTin) | Apache 2.0 | `@maplat/tin` | TIN 変換 |
|
|
175
|
+
| [MaplatTransform](https://github.com/code4history/MaplatTransform) | Apache 2.0 | `@maplat/transform` | 座標変換 |
|
|
176
|
+
| [MaplatEditor](https://github.com/code4history/MaplatEditor) | Apache 2.0 | — | データ作成ツール(デスクトップ) |
|
|
195
177
|
|
|
196
|
-
|
|
178
|
+
> MaplatEditor は上記ビューアライブラリが描画する地図・POI を作成する
|
|
179
|
+
> データ作成ツールです。Maplat エコシステムはエンドツーエンド:
|
|
180
|
+
> MaplatEditor で作成し、いずれかのビューアライブラリで公開、という流れになります。
|
|
197
181
|
|
|
198
|
-
|
|
199
|
-
|
|
182
|
+
<!-- SECTION 9: Nayuta links -->
|
|
183
|
+
## リンク
|
|
200
184
|
|
|
201
|
-
|
|
185
|
+
| 対象 | リンク | 用途 |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| プロジェクト情報・機能紹介・事例 | <https://www.maplat.jp/> | 製品サイト |
|
|
188
|
+
| 支援企業・案件問い合わせ | <https://www.nayuta-inc.co.jp/> | コーポレートサイト(那由多社) |
|
|
202
189
|
|
|
203
|
-
|
|
190
|
+
> ADR-0013: Apache ライセンスのリポジトリ(本リポジトリ)は両サイトへリンクします。
|
|
191
|
+
> MIT ライセンスの姉妹リポジトリ(Weiwudi / Quyuan / Chuci)へは那由多社リンクを置きません。
|
|
192
|
+
> 英語ページへ遷移する場合は `/en/` を付与してください(例: `https://www.maplat.jp/en/`)。
|
|
204
193
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
- 逆変換が許可されていない状態での逆変換実行時
|
|
194
|
+
<!-- SECTION 10: License -->
|
|
195
|
+
## License
|
|
208
196
|
|
|
209
|
-
|
|
197
|
+
Apache License 2.0 — 詳細は [LICENSE](LICENSE) を参照。
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
Copyright 2019-2026 Kohei Otsuka, Code for History / Nayuta, Inc.
|
|
201
|
+
|
|
202
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
203
|
+
you may not use this file except in compliance with the License.
|
|
204
|
+
You may obtain a copy of the License at
|
|
205
|
+
|
|
206
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
207
|
+
|
|
208
|
+
Unless required by applicable law or agreed to in writing, software
|
|
209
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
210
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
211
|
+
See the License for the specific language governing permissions and
|
|
212
|
+
limitations under the License.
|
|
213
|
+
```
|
|
210
214
|
|
|
211
|
-
|
|
215
|
+
> **特許注記**: Maplat の座標変換技術は日本国内で特許登録されています
|
|
216
|
+
> (Patent No. 6684776)。
|
|
212
217
|
|
|
213
|
-
|
|
218
|
+
> **過去のバージョン**: 0.14.2 より前のバージョンは Maplat Limited License
|
|
219
|
+
> 1.1 の下で配布されていました。Apache 2.0 へのライセンス復帰は 0.14.2
|
|
220
|
+
> 以降に適用されます。npmjs.com 上の過去版は元の制限付きライセンス条項の
|
|
221
|
+
> まま残ります。
|
|
214
222
|
|
|
215
|
-
|
|
223
|
+
<!-- SECTION 11: Contributors / Sponsors -->
|
|
224
|
+
## Contributors
|
|
216
225
|
|
|
217
226
|
- Kohei Otsuka
|
|
218
227
|
- Code for History
|
|
219
228
|
|
|
220
|
-
あなたの貢献をお待ちしています!
|
|
229
|
+
あなたの貢献をお待ちしています!
|
|
230
|
+
[イシューやプルリクエスト](https://github.com/code4history/MaplatTin/issues)は大歓迎です。
|