Git Product home page Git Product logo

youbike's Introduction

臺北市公共自行車「YouBike 微笑單車」租賃站資料轉換程式

這是一個用 Ruby 寫的小程式,可將 YouBike 微笑單車租賃站資料轉換為 JOSM file format, CSV, JSON 三種檔案格式,以便後續再利用。

我寫這個程式的動機是想要最新、最正確的租賃站名稱、座標,以便不定時(譬如有新設的租賃點時)匯入 OpenStreetMap。如果您的用途是想要取得即時可借車輛數(耗費持續的資料傳輸流量)開發相關應用,請去申請介接臺北市即時交通資訊

使用方法

本程式遵循一般常見 Ruby 程式的部署方法,使用 Bundler 與 Gemfile 自動安裝必要元件。

執行 youbike.rb --help 可獲取程式使用說明。

參考資料

運用 Overpass API 取得臺灣的 OpenStreetMap 自行車租賃點資料

運用 Overpass API 取得臺灣的 OpenStreetMap 自行車租賃點資料:

使用 Overpass API Query Form

<bbox-query s="21.53" n="25.18" w="120.01" e="121.59"/>
<query type="node">
  <item/>
  <has-kv k="amenity" v="bicycle_rental"/>
</query>
<print/>

使用 overpass turbo

/*
This has been generated by the overpass-turbo wizard.
The original search was:
“amenity=bicycle_rental”
*/
[out:xml][timeout:25];
// gather results
(
  // query part for: “amenity=bicycle_rental”
  node["amenity"="bicycle_rental"]({{bbox}});
  way["amenity"="bicycle_rental"]({{bbox}});
  relation["amenity"="bicycle_rental"]({{bbox}});
);
// print results
out meta;/*fixed by auto repair*/
>;
out meta qt;/*fixed by auto repair*/

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.