Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

hiroshiyui/youbike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

臺北市公共自行車「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*/

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages