Contenu connexe
Similaire à JavaScript GIS ライブラリ turf.js 入門 (20)
JavaScript GIS ライブラリ turf.js 入門
- 4. できる事:空間計測・関係
• 重心・中心点の算出 :Centroids and centers
• 集合・統計関数 :Aggregation & stastics functions
• バッファ分析:Buffer analysis
• TIN(不整三角形網):Triangulated irregular networks
• クラスタリング:Data classification
• 距離計算:Distance calculations
(一部抜粋)
- 5. できる事:空間編集処理
• 簡略化:Simplify features
• 結合・併合:Union ・Merge
• 凹・凸包処理 :Concave & convex hulls
• 補間:Interpolation
• 矩形・六角形 グリッド出力:Grids・Hexagonal binning
• フィルタリング・選択:Filter / select by attribute
(一部抜粋)
- 9. 1.GeoJSONの作成
//新宿駅のGeoJSONデータ
var point1 = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [139.70058739185333,35.68956144849349]
}
};
//代々木駅のGeoJSONデータ
var point2 = {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [139.7020572423935,35.683975674120234]
}
};
- 16. 3.バッファの作成
//単位を表現する文字列を変数に入力
var buffered = turf.buffer( point1 , 500 , units );
//地図に追加
L.geoJson(buffered).addTo(map);
turf.buffer関数
• 第1引数:地物型 / 複合地物型(点、線、面、複合型)
• 第2引数 : 数値型 半径
• 第3引数 : 文字列型 単位('miles', 'feet', 'kilometers', 'meters', or 'degrees')
• 戻り値:地物型 / 複合地物型(面)