使用者工具

網站工具


tech:osmapi

OpenStreetMap(OSM) API 使用整理

使用情境

  • 取得特定 mapper 資料(Details of a user) Exp.
    curl https://www.openstreetmap.org/api/0.6/user/1903826
    <?xml version="1.0" encoding="UTF-8"?>
    <osm version="0.6" generator="OpenStreetMap server">
      <user id="1903826" display_name="Jonathan Tsai" account_created="2014-01-26T14:32:26Z">
        <description></description>
        <contributor-terms agreed="true"/>
        <img href="https://www.gravatar.com/avatar/58295402de78b371f3f4075902416fd5.jpg?s=256&amp;d=https%3A%2F%2Fwww.openstreetmap.org%2Fassets%2Fusers%2Fimages%2Flarge-82d94ac521dc6dc7a27fee5c8aa13901.png"/>
        <roles>
        </roles>
        <changesets count="219"/>
        <traces count="34"/>
        <blocks>
          <received count="0" active="0"/>
        </blocks>
      </user>
    </osm>
  • 取得特定 mapper 編輯紀錄(changeset) Exp.
    curl https://www.openstreetmap.org/api/0.6/changesets?user="1903826"
    <?xml version="1.0" encoding="UTF-8"?>
    <osm version="0.6" generator="OpenStreetMap server" copyright="OpenStreetMap and contributors" attribution="http://www.openstreetmap.org/copyright" license="
    http://opendatacommons.org/licenses/odbl/1-0/">
      <changeset id="22582796" user="Jonathan Tsai" uid="1903826" created_at="2014-05-27T14:23:29Z" closed_at="2014-05-27T14:23:31Z" open="false" min_lat="25.057
    6384" min_lon="121.5489041" max_lat="25.0616915" max_lon="121.5544624">
        <tag k="comment" v="補充民生社區巷弄步行道"/>
        <tag k="created_by" v="iD 1.3.10"/>
        <tag k="imagery_used" v="Bing"/>
      </changeset>
    :
    :
      <changeset id="20999057" user="Jonathan Tsai" uid="1903826" created_at="2014-03-09T04:09:04Z" closed_at="2014-03-09T04:09:06Z" open="false" min_lat="25.0003655" min_lon="121.4999766" max_lat="25.0044982" max_lon="121.508175">
        <tag k="imagery_used" v="Bing;OpenStreetMap GPS traces"/>
        <tag k="created_by" v="iD 1.3.7"/>
        <tag k="comment" v="增加中和廟口附近新增道路"/>
      </changeset>
    </osm>

參考網址

tech/osmapi.txt · 上一次變更: 2014/05/27 22:49 由 jonathan