SlideShare une entreprise Scribd logo
1  sur  70
Télécharger pour lire hors ligne
Turf.js
地理資訊的分析與地圖視覺化
Kuro Hsu @ JSDC 2015
Kuro Hsu
前端工程師 @ 永慶房產集團
❤ HTML / CSS / JavaScript

❤ D3.js / GIS / Visualization

http://kuro.tw

kurotanshi [at] gmail.com
⾃自我介紹
地理空間的視覺化 ?
「利⽤用圖像視覺化

來呈現有意義的空間資訊」
地理空間統計與分析
• 空間統計是⽤用來描述地/物的地理特性
• 地物的分佈
• 群聚的位置
地理空間的資料模型
• 向量資料
• 點: 地點 / 位置
• 線: 路徑
• ⾯面: 邊界 / 範圍
• 網格資料
空間資訊的視覺化
• 以地點位置為主題
• 點圖
• 航線圖
• 以地區統計為主題
• 等值線圖
• 熱圖
空間資訊分析
• 地理空間分析的流程
• 擬定問題
• 資料探索
• ⽅方法選擇
• 統計計算
• 解釋結果
source: https://www.youtube.com/watch?t=6&v=TFakcRqGB4M


























































• 由 MapBox 開發
• 輕量且⾼高速的 Web-GIS JS Library
• 可在 Client 及 Server (node) 端執⾏行
• 提供各種 地理空間分析 API
• Open Source, MIT-licensed
• http://turfjs.org
Install turf.js
基礎知識
「給我⼀一個 Box」
	
  	
  //	
  [座標A(lng,	
  lat),	
  座標B(lng,	
  lat)]

	
  	
  var	
  bbox	
  =	
  [0,	
  0,	
  10,	
  10];	
  
	
  	
  var	
  poly	
  =	
  turf.bboxPolygon(bbox);

「給我⼀一個 Box」
「給我⼀一個 Box」
「給我⼀一個 Box」
全都是 GeoJSON !
點
線
全都是 GeoJSON !
⾯面
全都是 GeoJSON !
複合型態

(太⻑⾧長了下略)
GeoJSON
• Turf.js 以 GeoJSON 作為資料處理媒介
• 僅⽀支援 WGS84 格式座標
• 與多種主流電⼦子地圖平台相容
• 要注意經緯座標順序 (lng, lat)
• http://geojson.org/
Raw Data GeoJSON
Google Map / OpenStreetMap / leaflet …
「給我⼀一個 Box」
Mapbox Google Map Leaflet
將 GeoJson 送到地圖
Helpers
Data - 資料處理
aggregation - 集合與統計
DEMO - 台北市⾏行政區界圖
Measurement - 測量
DEMO - GPS 追蹤與街景
Transformation - 轉換
 	
  //	
  turf.intersect

	
  	
  var	
  poly	
  =	
  turf.intersect(poly1,	
  poly2);

DEMO - 找尋附近的 u-bike站點
Interpolation - 補間, 插值
DEMO - 台北市停⾞車場分佈
台北市降⾬雨淹⽔水模擬圖
http://kurotanshi.github.io/TPEDisasterSummary/rain/rain_tp_map.html
sheethub - 台北市3D建築物
https://github.com/sheethub/tpe3d
http://sheethub.github.io/tpe3d/3dtaipei4347-2.html
https://www.mapbox.com/blog/mapbox-courier/
https://www.mapbox.com/blog/heatmaps-and-grids-with-turf/
https://www.mapbox.com/blog/dc-bikeshare-revisited/
官⽅方 API ⽂文件是你的好朋友
Thanks!
Demos: https://github.com/kurotanshi/turfjs-examples
#認同請分享#我們在徵人

Contenu connexe

Tendances

오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초HaNJiN Lee
 
Cartographie et SIG 2016 - Partie 3
Cartographie et SIG 2016 - Partie 3Cartographie et SIG 2016 - Partie 3
Cartographie et SIG 2016 - Partie 3Ibrahima Sylla
 
Indexes: The neglected performance all rounder
Indexes: The neglected performance all rounderIndexes: The neglected performance all rounder
Indexes: The neglected performance all rounderMarkus Winand
 
第一次Elasticsearch就上手
第一次Elasticsearch就上手第一次Elasticsearch就上手
第一次Elasticsearch就上手Aaron King
 
MySQL Index Cookbook
MySQL Index CookbookMySQL Index Cookbook
MySQL Index CookbookMYXPLAIN
 
Getting Started with PostGIS
Getting Started with PostGISGetting Started with PostGIS
Getting Started with PostGISEDB
 
Hive User Meeting August 2009 Facebook
Hive User Meeting August 2009 FacebookHive User Meeting August 2009 Facebook
Hive User Meeting August 2009 Facebookragho
 
Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBMongoDB
 
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander ZaitsevClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander ZaitsevAltinity Ltd
 
Parboiled explained
Parboiled explainedParboiled explained
Parboiled explainedPaul Popoff
 
전자해도세미나
전자해도세미나전자해도세미나
전자해도세미나Jiyoon Kim
 
2 years with python and serverless
2 years with python and serverless2 years with python and serverless
2 years with python and serverlessHector Canto
 
HBase Advanced - Lars George
HBase Advanced - Lars GeorgeHBase Advanced - Lars George
HBase Advanced - Lars GeorgeJAX London
 
Spark streaming , Spark SQL
Spark streaming , Spark SQLSpark streaming , Spark SQL
Spark streaming , Spark SQLYousun Jeong
 
RaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheRaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheAlluxio, Inc.
 
Cassandra by example - the path of read and write requests
Cassandra by example - the path of read and write requestsCassandra by example - the path of read and write requests
Cassandra by example - the path of read and write requestsgrro
 
OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQLLuca Garulli
 

Tendances (20)

오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초오픈소스GIS 개론 과정 - OpenLayers 기초
오픈소스GIS 개론 과정 - OpenLayers 기초
 
Cartographie et SIG 2016 - Partie 3
Cartographie et SIG 2016 - Partie 3Cartographie et SIG 2016 - Partie 3
Cartographie et SIG 2016 - Partie 3
 
Indexes: The neglected performance all rounder
Indexes: The neglected performance all rounderIndexes: The neglected performance all rounder
Indexes: The neglected performance all rounder
 
第一次Elasticsearch就上手
第一次Elasticsearch就上手第一次Elasticsearch就上手
第一次Elasticsearch就上手
 
MySQL Index Cookbook
MySQL Index CookbookMySQL Index Cookbook
MySQL Index Cookbook
 
Getting Started with PostGIS
Getting Started with PostGISGetting Started with PostGIS
Getting Started with PostGIS
 
Hive User Meeting August 2009 Facebook
Hive User Meeting August 2009 FacebookHive User Meeting August 2009 Facebook
Hive User Meeting August 2009 Facebook
 
Webinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDBWebinar: Working with Graph Data in MongoDB
Webinar: Working with Graph Data in MongoDB
 
Developing iOS apps with Swift
Developing iOS apps with SwiftDeveloping iOS apps with Swift
Developing iOS apps with Swift
 
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander ZaitsevClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
ClickHouse in Real Life. Case Studies and Best Practices, by Alexander Zaitsev
 
Parboiled explained
Parboiled explainedParboiled explained
Parboiled explained
 
전자해도세미나
전자해도세미나전자해도세미나
전자해도세미나
 
2 years with python and serverless
2 years with python and serverless2 years with python and serverless
2 years with python and serverless
 
HBase Advanced - Lars George
HBase Advanced - Lars GeorgeHBase Advanced - Lars George
HBase Advanced - Lars George
 
Spark streaming , Spark SQL
Spark streaming , Spark SQLSpark streaming , Spark SQL
Spark streaming , Spark SQL
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
RaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cacheRaptorX: Building a 10X Faster Presto with hierarchical cache
RaptorX: Building a 10X Faster Presto with hierarchical cache
 
Cassandra by example - the path of read and write requests
Cassandra by example - the path of read and write requestsCassandra by example - the path of read and write requests
Cassandra by example - the path of read and write requests
 
OrientDB introduction - NoSQL
OrientDB introduction - NoSQLOrientDB introduction - NoSQL
OrientDB introduction - NoSQL
 
How to Use JSON in MySQL Wrong
How to Use JSON in MySQL WrongHow to Use JSON in MySQL Wrong
How to Use JSON in MySQL Wrong
 

En vedette

[朝陽科大] D3.js 資料視覺化入門
[朝陽科大] D3.js 資料視覺化入門 [朝陽科大] D3.js 資料視覺化入門
[朝陽科大] D3.js 資料視覺化入門 Kuro Hsu
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]Kuro Hsu
 
Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3Kuro Hsu
 
Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3Kuro Hsu
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具andyyou
 
開放資料暨資料視覺化 (D3.js)
開放資料暨資料視覺化 (D3.js)開放資料暨資料視覺化 (D3.js)
開放資料暨資料視覺化 (D3.js)維佋 唐
 
資料視覺化之理論、賞析與實作
資料視覺化之理論、賞析與實作資料視覺化之理論、賞析與實作
資料視覺化之理論、賞析與實作台灣資料科學年會
 
Vue js 大型專案架構
Vue js 大型專案架構Vue js 大型專案架構
Vue js 大型專案架構Hina Chen
 
D3.js 讓你的資料活起來
D3.js 讓你的資料活起來D3.js 讓你的資料活起來
D3.js 讓你的資料活起來oxxo studio
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Wen-Tien Chang
 
郵遞公文追蹤系統操作說明
郵遞公文追蹤系統操作說明郵遞公文追蹤系統操作說明
郵遞公文追蹤系統操作說明小四 曾
 
以 Leaflet 濫用^H^H呈現開放街圖資料
以 Leaflet 濫用^H^H呈現開放街圖資料以 Leaflet 濫用^H^H呈現開放街圖資料
以 Leaflet 濫用^H^H呈現開放街圖資料Rex Tsai
 
廣告學投影片
廣告學投影片廣告學投影片
廣告學投影片Ernie Chang
 
資料視覺化閃電秀-咖啡地圖徒手話
資料視覺化閃電秀-咖啡地圖徒手話資料視覺化閃電秀-咖啡地圖徒手話
資料視覺化閃電秀-咖啡地圖徒手話Mooon Chang
 
AngularJS training in Luster
AngularJS training in LusterAngularJS training in Luster
AngularJS training in LusterJason Chung
 
使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用
使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用
使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用Amazon Web Services
 
天猫后端技术架构优化实践
天猫后端技术架构优化实践天猫后端技术架构优化实践
天猫后端技术架构优化实践drewz lin
 
Sublime text 極速應用教學
Sublime text 極速應用教學Sublime text 極速應用教學
Sublime text 極速應用教學Amos Lee
 
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》鍾誠 陳鍾誠
 

En vedette (19)

[朝陽科大] D3.js 資料視覺化入門
[朝陽科大] D3.js 資料視覺化入門 [朝陽科大] D3.js 資料視覺化入門
[朝陽科大] D3.js 資料視覺化入門
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
 
Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 1/3
 
Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3
Rails Girls Weekly - 初探前端網頁技術 JavaScript 3/3
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
 
開放資料暨資料視覺化 (D3.js)
開放資料暨資料視覺化 (D3.js)開放資料暨資料視覺化 (D3.js)
開放資料暨資料視覺化 (D3.js)
 
資料視覺化之理論、賞析與實作
資料視覺化之理論、賞析與實作資料視覺化之理論、賞析與實作
資料視覺化之理論、賞析與實作
 
Vue js 大型專案架構
Vue js 大型專案架構Vue js 大型專案架構
Vue js 大型專案架構
 
D3.js 讓你的資料活起來
D3.js 讓你的資料活起來D3.js 讓你的資料活起來
D3.js 讓你的資料活起來
 
Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門Ruby on Rails : 簡介與入門
Ruby on Rails : 簡介與入門
 
郵遞公文追蹤系統操作說明
郵遞公文追蹤系統操作說明郵遞公文追蹤系統操作說明
郵遞公文追蹤系統操作說明
 
以 Leaflet 濫用^H^H呈現開放街圖資料
以 Leaflet 濫用^H^H呈現開放街圖資料以 Leaflet 濫用^H^H呈現開放街圖資料
以 Leaflet 濫用^H^H呈現開放街圖資料
 
廣告學投影片
廣告學投影片廣告學投影片
廣告學投影片
 
資料視覺化閃電秀-咖啡地圖徒手話
資料視覺化閃電秀-咖啡地圖徒手話資料視覺化閃電秀-咖啡地圖徒手話
資料視覺化閃電秀-咖啡地圖徒手話
 
AngularJS training in Luster
AngularJS training in LusterAngularJS training in Luster
AngularJS training in Luster
 
使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用
使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用
使用 Amazon Rekognition 打造以深度學習為基礎的圖片辨識應用
 
天猫后端技术架构优化实践
天猫后端技术架构优化实践天猫后端技术架构优化实践
天猫后端技术架构优化实践
 
Sublime text 極速應用教學
Sublime text 極速應用教學Sublime text 極速應用教學
Sublime text 極速應用教學
 
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》
 

[JSDC 2015] Turf.js - 地理資訊的分析與地圖視覺化