@maplat/tin
Version:
JavaScript library which performs homeomorphic conversion mutually between the coordinate systems of two planes based on the control points.
101 lines (100 loc) • 2.71 kB
TypeScript
import { Feature, Point, Position } from 'geojson';
import { Transform, Compiled, Edge, EdgeSet, EdgeSetLegacy, PointSet, StrictMode, VertexMode, YaxisMode } from '@maplat/transform';
import { PointsSetBD } from "./types/tin.d";
/**
* Tinクラスの初期化オプション
*/
export interface Options {
bounds?: Position[];
wh?: number[];
vertexMode?: VertexMode;
strictMode?: StrictMode;
yaxisMode?: YaxisMode;
importance?: number;
priority?: number;
stateFull?: boolean;
points?: PointSet[];
edges?: EdgeSet[];
}
/**
* Tin (Triangulated Irregular Network) クラス
* Transformクラスを拡張し、TINネットワークの生成機能を追加
*/
export declare class Tin extends Transform {
importance: number;
priority: number;
pointsSet: PointsSetBD | undefined;
/**
* Tinクラスのインスタンスを生成します
* @param options - 初期化オプション
*/
constructor(options?: Options);
/**
* フォーマットバージョンを取得します
*/
getFormatVersion(): number;
/**
* 制御点(GCP: Ground Control Points)を設定します
*/
setPoints(points: PointSet[]): void;
/**
* エッジ(制約線)を設定します
*/
setEdges(edges?: EdgeSet[] | EdgeSetLegacy[]): void;
/**
* 境界ポリゴンを設定します
*/
setBounds(bounds: Position[]): void;
/**
* 現在の設定を永続化可能な形式にコンパイルします
*/
getCompiled(): Compiled;
/**
* 幅と高さを設定します
*/
setWh(wh?: number[]): void;
/**
* 頂点モードを設定します
*/
setVertexMode(mode: VertexMode): void;
/**
* 厳密性モードを設定します
*/
setStrictMode(mode: StrictMode): void;
/**
* 厳密なTINを計算します
*/
calcurateStrictTin(): void;
/**
* 点群セットを生成します
*/
generatePointsSet(): {
forw: Feature<Point>[];
bakw: Feature<Point>[];
edges: Edge[];
};
/**
* 入力データの検証と初期データの準備
*/
private validateAndPrepareInputs;
/**
* TINネットワークを更新し、座標変換の準備を行います
*/
updateTin(): void;
/**
* 通常の頂点を計算
*/
private calculatePlainVertices;
/**
* 鳥瞰図モードの頂点を計算
*/
private calculateBirdeyeVertices;
/**
* 頂点の位置を調整
*/
private checkAndAdjustVertices;
/**
* 点の重み付けを計算します
*/
calculatePointsWeight(): void;
}