NAV Navbar
cURL

台灣圖霸 | Map8 Platform

歡迎使用 Logo 28x28 台灣圖霸 | Map8 Platform 地圖平台

有任何技術疑難,或其他疑問,都歡迎您 跟我們聯絡 喔!!!

Authentication (認證與授權)

要能取用 Map8 平台的 API,請於 URL query string 中以 key 參數帶入您的 API key :

https://api.map8.zone/place/geocode?address=台北市內湖區新湖三路189號&key=<您的 key>

請務必將上例 <您的 key> 替換成您的 API key 喔!!!

台灣圖霸平台 | Map8 Platform 的 API 透過 API key 來讓您使用平台的 API。您可以 點此申請試用

台灣圖霸平台 | Map8 Platform 的 API 預期來自 client 端的所有 API 請求於 URL 的 query string 中夾帶 API key 以認證並取得使用,例如 :

https://api.map8.zone/place/geocode?address=台北市內湖區新湖三路189號&key=<您的 key>

Notation

  1. 左右鍵符號 (大於、小於符號, 也就是 < >) 所描述的是一個變數 (variable) 的 formal parameter 形式。本文件底下若提及參數部分,使用到此表示法時,請讀者將之代換成實際的內容 (也就是代換為 actual parameter,並且,不留下 < > 符號)。例如, https://api.map8.zone/find?keyword=<關鍵詞> 若實際關鍵詞為 taiwan,則實際呼叫時,應代換為 https://api.map8.zone/find?keyword=taiwan
  2. 位於 API 欄位內格式的 <參數>,為標準的 URL 之 query string 格式編碼 (i.e., name=value 以 URL % 編碼, 並以 & 連接)
  3. 除非另有指定,否則,地理經緯度座標 (lat 或 latitude 均指經度,lng 或 longitude 均指緯度) 以 WGS84 / EPSG:3857 為地理座標系統

Version

API Index

[Places] 地點搜尋

功能 : 搜尋台灣圖霸地圖內的地點

搜尋地點 API (Find Place API)

Syntax

https://api.map8.zone/place/findplacefromtext/json?key=<您的 key>
    &input=<input>
    &locationbias=<緯度>,<經度>

Example

curl -X GET "https://api.map8.zone/place/findplacefromtext/json?key=<您的 key>&input=研鼎智能&locationbias=25.06102,121.58790"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "candidates" : [
      {
        "formatted_address" : "台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "研鼎智能股份有限公司",
        "tel" : "02-87921567",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "公司行號",
        "distance" : "0.3"
      }
    ],
    "status" : "OK"
}

Example : 搜尋地點,並要求若搜尋結果有地址則附帶三碼郵遞區號

curl -X GET "https://api.map8.zone/place/findplacefromtext/json?key=<您的 key>&input=研鼎智能&locationbias=25.06102,121.58790&postcode"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "candidates" : [
      {
        "formatted_address" : "台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "研鼎智能股份有限公司",
        "tel" : "02-87921567",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "公司行號",
        "distance" : "0.3"
        "postcode" : "114",
      }
    ],
    "status" : "OK"
}

Example : 搜尋地點,並要求若搜尋結果有地址則附帶三碼郵遞區號內嵌於 formatted_address 欄位

curl -X GET "https://api.map8.zone/place/findplacefromtext/json?key=<您的 key>&input=研鼎智能&locationbias=25.06102,121.58790&postcode&formatted_address_embed_postcode"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "candidates" : [
      {
        "formatted_address" : "114 台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "研鼎智能股份有限公司",
        "tel" : "02-87921567",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "公司行號",
        "distance" : "0.3"
      }
    ],
    "status" : "OK"
}

給定關鍵字,搜尋地點

搜尋周遭 API (Nearby Search API)

Syntax

https://api.map8.zone/place/findplacefromtext/json?key=<您的 key>
    &location=<緯度>,<經度>
    &radius=<範圍 (km)>

Example

curl -X GET "https://api.map8.zone/place/nearbysearch/json?key=<您的 key>&location=25.06102,121.58790"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "台北市內湖區南京東路六段465號",
        "geometry" : {
            "location" : {
                "lat" : 25.060955,
                "lng" : 121.587635
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "南京東路六段465號",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
        "chain" : "", 
        "branch" : "",
        "cat" : "",
        "distance" : 0.028
      },
      {
        "formatted_address" : "台北市內湖區南京東路六段463號",
        "geometry" : {
            "location" : {
                "lat" : 25.060904,
                "lng" : 121.587504
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "光屋攝影工作室",
        "tel" : "02-87919199",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "購物商場",
        "distance" : 0.0419
      }, 
      {
        "formatted_address" : "台北市內湖區南京東路六段463號",
        "geometry" : {
            "location" : {
                "lat" : 25.060904,
                "lng" : 121.587504
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "南京東路六段463號",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
        "chain" : "", 
        "branch" : "",
        "cat" : "",
        "distance" : 0.0419
      },
      {
        "formatted_address" : "台北市內湖區南京東路六段487號",
        "geometry" : {
            "location" : {
                "lat" : 25.061352,
                "lng" : 121.588254
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "南京東路六段465號",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
        "chain" : "", 
        "branch" : "",
        "cat" : "",
        "distance" : 0.0513
      },
      {
        "formatted_address" : "南京東路六段489號",
        "geometry" : {
            "location" : {
                "lat" : 25.060955,
                "lng" : 121.587635
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "南京東路六段489號",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
        "chain" : "", 
        "branch" : "",
        "cat" : "",
        "distance" : 0.0534
      }, 
      {
        "formatted_address" : "台北市內湖區南京東路六段461號",
        "geometry" : {
            "location" : {
                "lat" : 25.060904,
                "lng" : 121.587504
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "108 CUSTOM",
        "tel" : "02-27908383",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "租車公司",
        "distance" : 0.055
      }
    ],
    "status" : "OK"
}

給定座標,搜尋周遭

任意關鍵字搜尋 API (Text Search API)

Syntax

https://api.map8.zone/place/textsearch/json?key=<您的 key>
    &query=<關鍵字 (可空白分隔)>
    &location=<緯度>,<經度>

Example : 搜尋 加油站 內湖 台北

curl -X GET "https://api.map8.zone/place/textsearch/json?key=<您的 key>&query=加油站 內湖 台北&location=25.06102,121.58790"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "台北市內湖區新明路92號",
        "geometry" : {
            "location" : {
                "lat" : 25.059615,
                "lng" : 121.589523
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "統一速邁樂加油站內湖一站",
        "tel" : "02-27929031",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "統一速邁樂加油站", 
        "branch" : "內湖一站",
        "cat" : "加油站",
        "distance" : 0.226
      },
      {
        "formatted_address" : "台北市內湖區南京東路六段463號",
        "geometry" : {
            "location" : {
                "lat" : 25.060904,
                "lng" : 121.587504
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "中油加油站協記站",
        "tel" : "02-27915409",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "中油加油站", 
        "branch" : "協記站",
        "cat" : "加油站",
        "distance" : 0.543
      }, 
      {
        "formatted_address" : "台北市內湖區新明路305號",
        "geometry" : {
            "location" : {
                "lat" : 25.05699,
                "lng" : 121.584842
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "台灣宅配通-中油加油站協記站-代收店",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "台灣宅配通", 
        "branch" : "中油加油站協記站-代收店",
        "cat" : "貨運站",
        "distance" : 0.0544
      },
      {
        "formatted_address" : "台北市南港區南港路三段49號",
        "geometry" : {
            "location" : {
                "lat" : 25.053272,
                "lng" : 121.590197
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "全國加油站南港站",
        "tel" : "02-27828306",
        "city" : "台北市", 
        "town" : "南港區", 
        "type" : "景點",
        "chain" : "全國加油站", 
        "branch" : "南港站",
        "cat" : "加油站",
        "distance" : 0.892
      },
      {
        "formatted_address" : "台北市內湖區民權東路六段50號",
        "geometry" : {
            "location" : {
                "lat" : 25.068355,
                "lng" : 121.583351
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "gogoro電池交換站中油內湖加油站",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "gogoro充電站", 
        "branch" : "中油內湖加油站",
        "cat" : "充電站",
        "distance" : 0.934
      }, 
      {
        "formatted_address" : "台北市內湖區民權東路六段50號",
        "geometry" : {
            "location" : {
                "lat" : 25.068355,
                "lng" : 121.583351
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "中油加油站內湖站",
        "tel" : "02-27920678",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "中油加油站", 
        "branch" : "內湖站",
        "cat" : "加油站",
        "distance" : 0.936
      }
    ],
    "status" : "OK"
}

以任意的關鍵字組合進行搜尋

地點自動完成 API (Place Autocomplete API)

Syntax

https://api.map8.zone/place/textsearch/json?key=<您的 key>
    &input=<關鍵字 (可空白分隔)>
    &location=<緯度>,<經度>
    &radius=<範圍 (km)>

Example

curl -X GET "https://api.map8.zone/place/autocomplete/json?key=<您的 key>&input=明美&location=25.06102,121.58790"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "台北市內湖區南京東路六段北側",
        "geometry" : {
            "location" : {
                "lat" : 25.060834,
                "lng" : 121.587175
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "明美公園",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "公園",
        "distance" : 0.075, 
      }, 
      {
        "formatted_address" : "",
        "geometry" : {
            "location" : {
                "lat" : 25.028364,
                "lng" : 121.587175
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "YouBike微笑單車明美公園",
        "tel" : "",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "景點",
        "chain" : "YouBike微笑單車", 
        "branch" : "明美公園",
        "cat" : "租車公司",
        "distance" : 0.252, 
      },
      {
        "formatted_address" : "台北市松山區新東街28號之1",
        "geometry" : {
            "location" : {
                "lat" : 25.059238,
                "lng" : 121.566031
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "明美",
        "tel" : "02-27628939",
        "city" : "台北市", 
        "town" : "松山區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "購物商場",
        "distance" : 2.21, 
      },
      {
        "formatted_address" : "台北市信義區松德路40號",
        "geometry" : {
            "location" : {
                "lat" : 25.038958,
                "lng" : 121.576684
            },
        },
        "id" : "R625AYXZ38324999QP10236182",
        "place_id" : "R625AYXZ38324999QP10236182",
        "name" : "明美精品名店",
        "tel" : "02-27584348",
        "city" : "台北市", 
        "town" : "信義區", 
        "type" : "景點",
        "chain" : "", 
        "branch" : "",
        "cat" : "購物商場",
        "distance" : 2.7, 
      }
    ],
    "status" : "OK"
}

讓使用者邊輸入,便邊回應出推測的可能清單 -- 運用在逐字逼近搜尋目標物的場景上。

[Places] 地址定位與反定位

功能 : - 地址定位 (geocoding, 也就是將 地址 / 門牌 轉為地理座標 經緯度) - 與 - 反地址定位 (reverse geocoding, 反過來將地理座標 經緯度 轉為 地址 / 門牌)

Geocoding API

Syntax

https://api.map8.zone/place/textsearch/json?key=<您的 key>
    &address=<關鍵字 (可空白分隔)>
    &latlng=<緯度>,<經度>

Example : 地址定位 (帶入 address 參數)

curl -X GET "https://api.map8.zone/place/geocode/json?key=<您的 key>&address=台北市內湖區新湖三路189號"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "新湖三路189號",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
      }
    ],
    "status" : "OK"
}

Example : 反地址定位 (帶入 latlng 參數)

curl -X GET "https://api.map8.zone/place/geocode/json?key=<您的 key>&latlng=25.065089,121.580056"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "新湖三路189號",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
      }
    ],
    "status" : "OK"
}

Example : 反地址定位 (帶入 latlng 參數,並要求三碼郵遞區號)

curl -X GET "https://api.map8.zone/place/geocode/json?key=<您的 key>&latlng=25.065089,121.580056&postcode"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "新湖三路189號",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
        "postcode":"114"
      }
    ],
    "status" : "OK"
}

Example : 反地址定位 (帶入 latlng 參數,並要求三碼郵遞區號直接內嵌於 formatted_address 欄位)

curl -X GET "https://api.map8.zone/place/geocode/json?key=<您的 key>&latlng=25.065089,121.580056&postcode&formatted_address_embed_postcode"
{
    "html_attributions" : [
        "台灣圖霸", 
        "研鼎智能", 
        "PAPAGO!"
    ],
    "results" : [
      {
        "formatted_address" : "114 台北市內湖區新湖三路189號6樓",
        "geometry" : {
            "location" : {
                "lat" : 25.065089,
                "lng" : 121.580056
            },
        },
        "id" : "R625AYXZ38324999QP10236181",
        "place_id" : "R625AYXZ38324999QP10236181",
        "name" : "新湖三路189號",
        "city" : "台北市", 
        "town" : "內湖區", 
        "type" : "地址",
      }
    ],
    "status" : "OK"
}

[Maps] 嵌入動態地圖

功能 : 在您的網站中嵌入互動地圖

Maps Embed API

Example (請於瀏覽器直接打開;或透過本文主說明示範之 iframe)

https://maps.map8.zone/?key=<您的 key>&title=研鼎智能&address=台北市內湖區新湖三路189號6樓&description=台灣圖霸,有口皆碑#15.6/25.065089/121.580056

Example : 加上 optional 的地圖視角 (請於瀏覽器直接打開;或透過本文主說明示範之 iframe)

https://maps.map8.zone/?key=<您的 key>&title=研鼎智能&address=台北市內湖區新湖三路189號6樓&description=台灣圖霸,有口皆碑#15.6/25.065089/121.580056/0/50

您也可以使用 iframe 方式來將台灣圖霸的地圖嵌入您的網站 -- 如下示範,只要將上述網址格式直接填入底下 <iframe> 標籤內的 src 欄位即可 :

<iframe src="https://maps.map8.zone/?key=<您的 key>&title=研鼎智能&address=台北市內湖區新湖三路189號6樓&description=台灣圖霸,有口皆碑#15.6/25.065089/121.580056/0/50" width="640" height="480"></iframe>

Maps embed api iframe example 7

讓您在網站或其他任何素材中嵌入互動地圖

[Maps] 地圖靜態圖片

功能 : 在您的網站中嵌入靜態地圖 (圖片)

Maps Static API

Example (請於瀏覽器直接打開)

https://api.map8.zone/maps/static?key=<您的 key>&center=25.03745%2C121.547428&zoom=17&size=1024x768&format=jpg

Maps static api demo

製作顯示地圖的圖檔,讓您在網站或其他任何素材中嵌入靜態地圖

[Routes] 路徑規劃與道路屬性

功能 : 依據起訖點與中途點進行路徑規劃、取得道路屬性

路徑規劃 API (Directions API)

Syntax

https://api.map8.zone/routes/<交通工具>/<起訖點座標組>.json?key=<您的 key>

Example : 此例以 car (汽車) 作為交通工具 (請於瀏覽器直接打開)

curl -X GET "https://api.map8.zone/route/car/121.579839,25.065064;121.576499,25.068178;121.579343,25.068134.json?key=<您的 key>"
{
  "code": "Ok",
  "waypoints": [
    {
      "hint": "OoYNgOj2GYAeAAAALQAAAAAAAAA0AAAArL0IQlE9RUIAAAAAAndlQh4AAAAtAAAAAAAAADQAAABGAAAAPyk_B2h2fgE_KT8HaHZ-AQAAvwOihj1l",
      "distance": 0,
      "location": [
        121.579839,
        25.065064
      ],
      "name": "新湖三路"
    },
    {
      "hint": "908JgAEBGIA8AAAAVAAAAAAAAAAAAAAAAWmFQlN8uUIAAAAAAAAAADwAAABUAAAAAAAAAAAAAABGAAAAMxw_B5KCfgEzHD8HkoJ-AQAAbxaihj1l",
      "distance": 0,
      "location": [
        121.576499,
        25.068178
      ],
      "name": "瑞湖街"
    },
    {
      "hint": "fWUSgOPYE4A_AAAAJQAAAAAAAABXAAAAPjeOQvpcIkIAAAAAUdK_Qj8AAAAlAAAAAAAAAFcAAABGAAAATyc_B2aCfgFPJz8HZoJ-AQAAzwaihj1l",
      "distance": 0,
      "location": [
        121.579343,
        25.068134
      ],
      "name": "民權東路六段15巷"
    }
  ],
  "routes": [
    {
      "legs": [
        {
          "steps": [
            {
              "intersections": [
                {
                  "out": 0,
                  "entry": [
                    true
                  ],
                  "location": [
                    121.579839,
                    25.065064
                  ],
                  "bearings": [
                    240
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.579839,
                    25.065064
                  ],
                  [
                    121.579546,
                    25.064909
                  ]
                ],
                "type": "LineString"
              },
              "duration": 4.8,
              "distance": 34.2,
              "name": "新湖三路",
              "weight": 4.8,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 240,
                "bearing_before": 0,
                "type": "depart",
                "location": [
                  121.579839,
                  25.065064
                ]
              }
            },
            {
              "intersections": [
                {
                  "out": 3,
                  "in": 0,
                  "entry": [
                    false,
                    true,
                    true,
                    true
                  ],
                  "location": [
                    121.579546,
                    25.064909
                  ],
                  "bearings": [
                    60,
                    150,
                    240,
                    330
                  ]
                },
                {
                  "out": 3,
                  "in": 1,
                  "entry": [
                    true,
                    false,
                    false,
                    true
                  ],
                  "location": [
                    121.578805,
                    25.06596
                  ],
                  "bearings": [
                    60,
                    150,
                    240,
                    345
                  ]
                },
                {
                  "out": 3,
                  "in": 1,
                  "entry": [
                    false,
                    false,
                    true,
                    true
                  ],
                  "location": [
                    121.578781,
                    25.06604
                  ],
                  "bearings": [
                    60,
                    165,
                    240,
                    345
                  ]
                },
                {
                  "out": 4,
                  "in": 1,
                  "entry": [
                    true,
                    false,
                    false,
                    false,
                    true
                  ],
                  "location": [
                    121.578521,
                    25.066659
                  ],
                  "bearings": [
                    75,
                    159,
                    248,
                    256,
                    339
                  ]
                },
                {
                  "out": 3,
                  "in": 1,
                  "entry": [
                    false,
                    false,
                    true,
                    true
                  ],
                  "location": [
                    121.578467,
                    25.066786
                  ],
                  "bearings": [
                    75,
                    165,
                    255,
                    345
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.579546,
                    25.064909
                  ],
                  [
                    121.578805,
                    25.06596
                  ],
                  [
                    121.578781,
                    25.06604
                  ],
                  [
                    121.578521,
                    25.066659
                  ],
                  [
                    121.578507,
                    25.066692
                  ],
                  [
                    121.578494,
                    25.066722
                  ],
                  [
                    121.578468,
                    25.066785
                  ],
                  [
                    121.578467,
                    25.066786
                  ],
                  [
                    121.578353,
                    25.067059
                  ],
                  [
                    121.578264,
                    25.067271
                  ],
                  [
                    121.578195,
                    25.067422
                  ],
                  [
                    121.57813,
                    25.067532
                  ]
                ],
                "type": "LineString"
              },
              "duration": 32.7,
              "distance": 326.5,
              "name": "行愛路",
              "weight": 32.7,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 326,
                "location": [
                  121.579546,
                  25.064909
                ],
                "type": "turn",
                "bearing_before": 239,
                "modifier": "right"
              }
            },
            {
              "intersections": [
                {
                  "out": 2,
                  "in": 1,
                  "entry": [
                    true,
                    false,
                    true
                  ],
                  "location": [
                    121.57813,
                    25.067532
                  ],
                  "bearings": [
                    30,
                    150,
                    270
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.57813,
                    25.067532
                  ],
                  [
                    121.576516,
                    25.067576
                  ]
                ],
                "type": "LineString"
              },
              "duration": 16.3,
              "distance": 162.7,
              "name": "民權東路六段11巷",
              "weight": 16.3,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 271,
                "location": [
                  121.57813,
                  25.067532
                ],
                "type": "end of road",
                "bearing_before": 336,
                "modifier": "left"
              }
            },
            {
              "intersections": [
                {
                  "out": 0,
                  "in": 1,
                  "entry": [
                    true,
                    false,
                    true
                  ],
                  "location": [
                    121.576516,
                    25.067576
                  ],
                  "bearings": [
                    0,
                    90,
                    270
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.576516,
                    25.067576
                  ],
                  [
                    121.576499,
                    25.068178
                  ]
                ],
                "type": "LineString"
              },
              "duration": 6,
              "distance": 67,
              "name": "瑞湖街",
              "weight": 6,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 357,
                "location": [
                  121.576516,
                  25.067576
                ],
                "type": "turn",
                "bearing_before": 271,
                "modifier": "right"
              }
            },
            {
              "intersections": [
                {
                  "in": 0,
                  "entry": [
                    true
                  ],
                  "location": [
                    121.576499,
                    25.068178
                  ],
                  "bearings": [
                    179
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.576499,
                    25.068178
                  ],
                  [
                    121.576499,
                    25.068178
                  ]
                ],
                "type": "LineString"
              },
              "duration": 0,
              "distance": 0,
              "name": "瑞湖街",
              "weight": 0,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 0,
                "bearing_before": 359,
                "type": "arrive",
                "location": [
                  121.576499,
                  25.068178
                ]
              }
            }
          ],
          "weight": 59.8,
          "distance": 590.3,
          "summary": "行愛路, 民權東路六段11巷",
          "duration": 59.8
        },
        {
          "steps": [
            {
              "intersections": [
                {
                  "out": 0,
                  "entry": [
                    true
                  ],
                  "location": [
                    121.576499,
                    25.068178
                  ],
                  "bearings": [
                    359
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.576499,
                    25.068178
                  ],
                  [
                    121.576476,
                    25.069015
                  ]
                ],
                "type": "LineString"
              },
              "duration": 12.9,
              "distance": 93.1,
              "name": "瑞湖街",
              "weight": 12.9,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 359,
                "bearing_before": 0,
                "type": "depart",
                "location": [
                  121.576499,
                  25.068178
                ]
              }
            },
            {
              "intersections": [
                {
                  "out": 1,
                  "in": 2,
                  "entry": [
                    true,
                    true,
                    false,
                    true
                  ],
                  "location": [
                    121.576476,
                    25.069015
                  ],
                  "bearings": [
                    0,
                    105,
                    180,
                    285
                  ]
                },
                {
                  "out": 1,
                  "in": 3,
                  "entry": [
                    true,
                    true,
                    true,
                    false
                  ],
                  "location": [
                    121.578674,
                    25.068336
                  ],
                  "bearings": [
                    30,
                    105,
                    210,
                    285
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.576476,
                    25.069015
                  ],
                  [
                    121.57716,
                    25.068802
                  ],
                  [
                    121.578674,
                    25.068336
                  ],
                  [
                    121.579343,
                    25.068134
                  ]
                ],
                "type": "LineString"
              },
              "duration": 27.4,
              "distance": 305,
              "name": "民權東路六段15巷",
              "weight": 27.4,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 108,
                "location": [
                  121.576476,
                  25.069015
                ],
                "type": "turn",
                "bearing_before": 357,
                "modifier": "right"
              }
            },
            {
              "intersections": [
                {
                  "in": 0,
                  "entry": [
                    true
                  ],
                  "location": [
                    121.579343,
                    25.068134
                  ],
                  "bearings": [
                    288
                  ]
                }
              ],
              "driving_side": "right",
              "geometry": {
                "coordinates": [
                  [
                    121.579343,
                    25.068134
                  ],
                  [
                    121.579343,
                    25.068134
                  ]
                ],
                "type": "LineString"
              },
              "duration": 0,
              "distance": 0,
              "name": "民權東路六段15巷",
              "weight": 0,
              "mode": "driving",
              "maneuver": {
                "bearing_after": 0,
                "bearing_before": 108,
                "type": "arrive",
                "location": [
                  121.579343,
                  25.068134
                ]
              }
            }
          ],
          "weight": 40.3,
          "distance": 398.1,
          "summary": " 瑞湖街, 民權東路六段15巷",
          "duration": 40.3
        }
      ],
      "weight_name": "routability",
      "geometry": {
        "coordinates": [
          [
            121.579839,
            25.065064
          ],
          [
            121.579546,
            25.064909
          ],
          [
            121.578805,
            25.06596
          ],
          [
            121.57813,
            25.067532
          ],
          [
            121.576516,
            25.067576
          ],
          [
            121.576499,
            25.068178
          ],
          [
            121.576476,
            25.069015
          ],
          [
            121.579343,
            25.068134
          ]
        ],
        "type": "LineString"
      },
      "weight": 100.1,
      "distance": 988.4,
      "duration": 100.1
    }
  ]
}

路徑規劃功能 : 依據所給定之起點、中途點 (零或多個)、與目的地之地理座標,依 Map8 的圖資與演算法來規劃路徑

道路屬性 API (Roads API)

Syntax

https://api.map8.zone/route/road?key=<您的 key>
    &latlng=<緯度>,<經度>
    &additional_fields

Example

curl -X GET "https://api.map8.zone/route/road?key=<您的 key>&latlng=25.073294,121.540346&additional_fields=speed,elevated,height,bridge"
{
    "html_attribution": [
        "台灣圖霸",
        "研鼎智能",
        "PAPAGO!"
    ],
    "results": [
        {
            "formatted_address": "台北市中山區 - 中山高速公路",
            "id": "NT0qAAYGRRwKW1pTQQ9gMCw0LiEMA1lJOQldfw53UjoDPzhzDltBEg==",
            "place_id": "NT0qAAYGRRwKW1pTQQ9gMCw0LiEMA1lJOQldfw53UjoDPzhzDltBEg==",
            "name": "中山高速公路",
            "city": "台北市",
            "town": "中山區",
            "type": "道路",
            "distance": 0.028,
            "speed": "100",
            "elevated": 0,
            "bridge": "",
            "height": ""
        },
        {
            "formatted_address": "台北市中山區 - 濱江街199巷",
            "id": "NT0qAAYGRRkGV1NTQz9XNzQcSgFwTht+HwZOd3BEC0o/CyUJV100Eg==",
            "place_id": "NT0qAAYGRRkGV1NTQz9XNzQcSgFwTht+HwZOd3BEC0o/CyUJV100Eg==",
            "name": "濱江街199巷",
            "city": "台北市",
            "town": "中山區",
            "type": "道路",
            "distance": 0.044,
            "speed": "30",
            "elevated": 0,
            "bridge": "",
            "height": ""
        },
        {
            "formatted_address": "台北市中山區 - 濱江街199巷",
            "id": "NT0qAAYGRx8KVlJTQQJwEFQ+CThveBNEXDIDBklsKAgwQER0QAosEg==",
            "place_id": "NT0qAAYGRx8KVlJTQQJwEFQ+CThveBNEXDIDBklsKAgwQER0QAosEg==",
            "name": "濱江街199巷",
            "city": "台北市",
            "town": "中山區",
            "type": "道路",
            "distance": 0.051,
            "speed": "30",
            "elevated": 0,
            "bridge": "",
            "height": ""
        }
    ],
    "status": "OK"
}

對道路進行反定址 (也就是由輸入之地理座標轉為道路),並獲取道路屬性。



https://map8.zone

HTTP Status Code

以上 API,可能回傳的 HTTP status code 如后 :

Error Code 意義
400 Bad Request -- 表示您的 requset 解析有誤。通常是給入的參數多了或少了,或是格式有錯誤,或必要參數卻沒給,等等
401 Unauthorized -- 表示您未給定您的 key,或是您給的 key 並非有效。請跟我們聯絡
503 Service Unavailable -- 表示您的 request 已經超出與我們約定的 QoS (服務品質) 等級。通常過一會兒 (QoS 上限解除) 再重發一次即可成功。如果持續發生,請跟我們聯絡

"status" 欄位

以上 API,可能回傳之 status 欄位的意義為 :

status 意義
OK 無發生任何錯誤;該地點被成功偵測,並且至少回傳一則結果
ZERO_RESULTS 表示搜尋雖然完成,但未得到任何有效結果。此狀況譬如可能發生在您對本 API 發出的 request 所給定的中心座標在一個偏遠地區
OVER_QUERY_LIMIT 表示您已經超出您的配額。請跟我們聯絡
REQUEST_DENIED 表示您的 request 無法進行;一般來說是您未給定您的 key,或是您給的 key 並非有效。請跟我們聯絡
INVALID_REQUEST 表示您的 requset 解析有誤。通常是給入的參數多了或少了,或是格式有錯誤,或必要參數卻沒給,等等
UNKNOWN_ERROR 表示是我們的伺服器端的錯誤;再重試一次可能就會成功。如果持續發生此問題,請跟我們聯絡