研究筆記 - 多類別地址地圖顯示方法

緣起

問題

可能方法

階段性目標 - 1

將台北市 AirBox 感測點與台北的寺廟,分兩類顯示在 google map 上,方法公開, code 上傳 LASS, 讓大家也能做

 利用openstreetmap 資料結取功能 

 

Data Flow

  1. raw data
  2. 地址轉經緯度  
  3. 手動存檔成 GPS 格式
    1. 格式為 group id, item name, gps info
  4. lass.py 讀入轉出 kml
    1. 根據 group id 給顏色,item name 顯示在 kml 上

快速驗證可行性

{"schemaname":"AirBoxProfile","entries":[{"device_id":"28C2DDDD3FFA","vendor":"1","ver_format":"3","fmt_opt":"1","app":"AirBox","ver_app":"1.0","device":"Aa","gps_lat":25.04,"gps_lon":121.612,"gps_fix":1,"gps_num":9,"gps_alt":2.0},{"device_id":"28C2DDDD47D5","vendor":"1","ver_format":"3","fmt_opt":"1","app":"AirBox","ver_app":"1.0","device":"MoLa","gps_lat":24.806,"gps_lon":121.01,"gps_fix":1,"gps_num":9,"gps_alt":2.0}]}

<GARDENREC>

                                                    <SNO><![CDATA[R0001]]></SNO>

                                                    <RELIGION_TYPE><![CDATA[財團法人寺廟]]></RELIGION_TYPE>

                                                    <CB_NAME><![CDATA[財團法人台北市松山慈祐宮]]></CB_NAME>

                                                    <CB_SNAME><![CDATA[媽祖廟]]></CB_SNAME>

                                                    <PTNAME1><![CDATA[松山區]]></PTNAME1>

                                                    <V_NAME><![CDATA[慈祐里]]></V_NAME>

                                                    <CB_REG_TITLE><![CDATA[道教]]></CB_REG_TITLE>

                                                    <PRESIDENT_NAME><![CDATA[陳玉峰]]></PRESIDENT_NAME>

                                                    <CB_TEL><![CDATA[27669212]]></CB_TEL>

                                                    <TOTAL_ADDR><![CDATA[八德路4段761號]]></TOTAL_ADDR>

                                                    <R_STREET><![CDATA[八德路]]></R_STREET>

                                                    <R_SECTION><![CDATA[4段]]></R_SECTION>

                                                    <R_LANE/>

                                                    <R_ALLEY/>

                                                    <R_NO><![CDATA[761號]]></R_NO>

                                                    <R_OTHER/>

                                                

                                                    <TM97_X><![CDATA[308291.278]]></TM97_X>

                                                    <TM97_Y><![CDATA[2771557.324]]></TM97_Y>

                                                    <DATA_STR><![CDATA[農曆3月23日(天上聖母聖誕)|]]></DATA_STR>

                                                    <REG_NO><![CDATA[100證他字第789號登記簿第19冊第13頁第272號]]></REG_NO>

                                        </GARDENREC>

                                        

300M 內有宗教團體與其數量

airbox "SSPSAIRBOX"監測點 周圍300M內的宗教團體

參考 中研院QGIS GIS 資訊網中 提供的openstreetmap 資料截取功能介紹

"使用Overpass API攫取OpenStreetMap的向量資料"

   在http://harrywood.co.uk/maps/uixapi/xapi.html  網頁中在node 擷取過程中將內容設定為 amenity=place_of_worship

   也可以截取出宗教團體的空間坐標資訊api  範例 ,但內容可能需要清一下。

可以透過 overpass turbo 存取 overpass api ,能匯出 geoJSON, GPX, KML

https://overpass.nchc.org.tw/overpass-turbo/?q=LyoKVGhpcyBoYcSGYmVlbiBnxI1lcmF0ZWQgYnkgdGhlIG92xJJwxIlzLXR1cmJvIHdpemFyZC7EgsSdxJ9yaWdpbmFsIHNlxLBjaMSsxIk6CsOiwoDCnGFtxI1pdHk9cGxhY2Vfb2Zfd29yc8SEcCDEuiDDpcKPwrDDp8KBwqPFiMKdCiovCltvdXQ6anNvbl1bdGnFjMWxxbMyNV07Ci8vIGZldMWCIMSwxYAgxYjCnMWkxabFqMWqxJvEq8S_xYHFg8S6Cnt7xJBvY29kZUFyxYA6xpLFp8KjfX0tPi7GmHLFgsalxYDGg8aFxI_ElMSdciDGpnN1bHRzCigKICDGt3F1xJLEmsSjcnTGh8WcOsaPxYnFi8WNxY_FkcWTxZXFl8WZxZvFncWfxarHhSBuxqJlWyLHlW7FjnkiPSLFksWUxZbFmMWaxZzFnmlwIl0oxo1hxrDFgMayaMa0YSnGg8eGd2F5x6bHqMeqx6zHrseZx7HHnMe0xZ_HuMe6xqbHvMaxxrPIlciDx6HGpsWTxbvFt8iJxYzHqcWPyIzHr8eax7LHnce1x7fHuce7x73GmciByJrImsa3cMS3bsePxr3Gv8eBCsW-xJjGonnGgz7Gg8i7c2tlxL1xdDs&c=B7C9vwsRtI&R

   成果如下 

     <node id="470241905" lat="25.0185490" lon="121.5331553">

    <tag k="addr:housenumber" v="86"/>

    <tag k="addr:street" v="新生南路三段"/>

    <tag k="amenity" v="place_of_worship"/>

    <tag k="denomination" v="lutheran"/>

    <tag k="name" v="台北真理堂"/>

    <tag k="name:en" v="Taipei Truth Lutheran Church"/>

    <tag k="name:zh" v="台北真理堂"/>

    <tag k="religion" v="christian"/>

    <tag k="wheelchair" v="yes"/>

  </node>

  <node id="698446646" lat="24.9957874" lon="121.5522614">

    <tag k="amenity" v="place_of_worship"/>

    <tag k="name" v="福安宮"/>

  </node>

  <node id="848228075" lat="24.9779788" lon="121.5926536">

    <tag k="amenity" v="place_of_worship"/>

    <tag k="name" v="指南宮大成殿"/>

    <tag k="religion" v="buddhist"/>

  </node>

  <node id="848228193" lat="24.9798780" lon="121.5866610">

    <tag k="amenity" v="place_of_worship"/>

    <tag k="name" v="指南宮"/>

    <tag k="religion" v="buddhist"/>

  </node>

  <node id="848228335" lat="24.9803640" lon="121.5886960">

    <tag k="amenity" v="place_of_worship"/>

    <tag k="name" v="指南宮凌霄寶殿"/>

    <tag k="religion" v="buddhist"/>

  </node>