Code Monkey home page Code Monkey logo

taiwan.topojson's Introduction

Taiwan.TopoJSON

本專案旨在提供方便視覺化的臺灣行政區域與村里界線圖資。

為了減輕讀取負擔與減小單一檔案大小,本專案會將政府資料開放平台提供的原始圖資(Shapefile 格式,.shp)轉檔為 TopoJSON 格式,並切割成三個層級:

  • topojson/counties.json:全國各直轄市與縣市邊界。
  • topojson/towns/*.json:各直轄市與縣市獨立一份檔案,檔名為其行政區代碼。包含其轄區下的各個鄉鎮市區邊界。
  • topojson/villages/*.json:各鄉鎮市區獨立一份檔案,檔名為其行政區代碼。包含其轄區下的各個村里邊界。

若是想要自行填入各行政區與村里對應的資料,僅需修改 csv/ 目錄下的檔案,並自行添加所需欄位。再修改 Makefile 檔,在 SPLIT_COUNTIES_OPTSSPLIT_TOWNS_OPTSSPLIT_VILLAGES_OPTS-filter-fields 後加上要包含的欄位名稱(以逗號隔開)。最後重新生成 TopoJSON 檔即可(建置方法請見下節)。

註:欲查詢行政區域與村里代碼請參考這裡

建置方式

topojson/ 目錄下已有預建置好的基本圖資(資料僅有行政區/村里代碼與名稱)。

要重新生成 TopoJSON 檔,請先從下節「資料來源」下載所需的原始檔案,並解壓縮到 raw/ 目錄中。

接著,安裝 mapshaper,並執行以下命令:

$ make split-all topojson-all

也可以將 -all 改成 -counties-towns-villages,僅生成特定層級的圖資。如:

$ make split-towns topojson-towns

僅會生成各直轄市與縣市的 TopoJSON 檔。

若是僅需特定行政區域或村里的 TopoJSON 檔,則直接指定生成的檔案名稱。舉例來說,如欲生成臺北市中正區(代碼 6300500)的各村里邊界檔,則需執行:

$ make villages/villages-6300500.json

資料來源

taiwan.topojson's People

Watchers

James Cloos avatar 歐陽毅 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.