Tile Server
v1.0API 文件
API Reference
HK GeoTiles 提供 DOP1000 歷史航空影像及多款底圖的 XYZ 磚服務,相容 Leaflet、MapLibre、QGIS 等主流工具。
概覽Overview
HK GeoTiles 提供標準 XYZ 磚服務(Slippy Map Tilenames),相容所有主流地圖函式庫,包括 Leaflet、MapLibre GL JS、OpenLayers 及 QGIS。圖磚以 Web Mercator(EPSG:3857)投影發布,格式為 PNG,256×256 像素。DOP1000 歷史航空影像磚由本站伺服器提供,圖源為香港地政總署開放數據;其餘底圖為外部第三方服務,請直接使用各圖源的 XYZ URL。
存取方式Access
所有圖磚端點均為公開存取,無需 API 金鑰。外部底圖(OSM、ESRI、LANDSD、OpenTopoMap)請直接使用各圖源的 XYZ URL,本站不作代理。
圖層總覽All Layers
LandsD historical orthophoto raster tiles
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
戰爭部地段War Department Lot (WDL)
本站伺服器英國殖民時期由戰爭部(War Department)持有的土地地段圖層,以 XYZ 地圖磚格式呈現其歷史邊界及位置。由本站伺服器提供圖磚服務。
香港地政總署 LANDSD ↗英國戰爭部地圖資料 WO78/5358
地政總署底圖LANDSD Base Maps
外部服務香港地政總署地圖 API 提供的底圖與衛星影像,直接使用地政總署 XYZ 端點,本站不作代理或轉發。圖源:香港地政總署(mapapi.hkmapservice.gov.hk)。
香港地政總署 LANDSD ↗地政總署官方底圖,包含道路、建築、地名
地政總署高解析度衛星影像底圖
CSDI 開放數據 — LandsD XYZ APICSDI Open Data
香港地政總署透過 CSDI 開放數據平台提供免費 XYZ 地圖磚 API,無需 API key,可直接用於 QGIS、Leaflet、OpenLayers 等工具。座標系統:WGS84(EPSG:4326)。
香港地政總署 CSDI 開放數據平台 ↗Raster XYZ — PNGURL 順序:{z}/{x}/{y}
地形底圖 Topographic Basemap · z10–20
航空影像底圖 Imagery Basemap · z0–20
地名疊加層 繁中 Label Overlay TC
地名疊加層 English Label Overlay EN
地名疊加層 简中 Label Overlay SC
Vector Tiles — PBF原生 zoom 9–15注意:URL 順序為 {z}/{y}/{x},與 Raster 相反
向量底圖 Vector Basemap
向量地名疊加層 繁中 Vector Label TC
向量地名疊加層 English Vector Label EN
向量地名疊加層 简中 Vector Label SC
Style JSON將 {lang} 替換為 tc / en / sc
第三方底圖Third-Party Base Maps
外部服務以下底圖為外部第三方服務,本站直接在地圖頁面引用其 XYZ URL,不作代理或轉發。使用時請遵守各圖源的服務條款。
圖源:© OpenTopoMap contributors
圖源:© Esri, Maxar, Earthstar Geographics
圖源:© Esri, HERE, Garmin, USGS
圖源:© Esri, HERE, Garmin, Intermap, USGS, NGA
本地 MBTiles 資料集Local MBTiles Datasets
https://hkgeotiles.com/api/tiles/dataset/:datasetId/:z/:x/:y從本地 MBTiles 檔案提供 XYZ 地圖磚。一個 dataset 可包含多個 MBTiles 分段,伺服器根據請求的 zoom 層級自動選擇最合適的分段。支援 PNG、JPEG 及 gzip PBF 格式。
| 參數 | 類型 | 說明 |
|---|---|---|
| :datasetId | string | Dataset 識別碼,例如 victoriacity-1889 |
| :z | integer | Zoom 層級 |
| :x | integer | 磚列(XYZ 坐標) |
| :y | integer | 磚行(XYZ 坐標,自動轉換 TMS Y-flip) |
英國戰爭部地圖資料 WO78/5358
LandsD historical orthophoto raster tiles
1889 年維多利亞城歷史地圖,呈現殖民地時期香港島北岸市區街道、碼頭及建築佈局。
LandsD historical orthophoto raster tiles
LandsD historical orthophoto raster tiles
1904 年沙田歷史地圖,由 historicalwalkhk.com 數位化,呈現 20 世紀初沙田地貌、村落分佈及農業用地格局。
1918 年大嶼山大澳一帶歷史地圖,呈現漁村聚落、水道及周邊地貌。
LandsD historical orthophoto raster tiles
LandsD historical orthophoto raster tiles
1938 年香港島山頂一帶歷史地圖,呈現二戰前太平山周邊住宅、纜車路線及山地地貌。
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
1947 年灣仔區歷史地圖,比例尺 1:7,920,呈現二戰後灣仔地區街道、碼頭及建築分佈。
LandsD historical orthophoto raster tiles
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
1954 年鯉魚門至清水灣一帶地形圖,比例尺 1:4,800,呈現海岸地貌與村落分佈。
LandsD historical orthophoto raster tiles
1958 年荃灣一帶歷史地圖,呈現工業化前荃灣市區、海岸線及周邊鄉村地貌。
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
LandsD historical orthophoto raster tiles
LandsD historical orthophoto raster tiles
LandsD historical orthophoto raster tiles
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
LandsD historical orthophoto raster tiles
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
LandsD historical orthophoto raster tiles
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
LandsD historical orthophoto raster tiles
Official digital orthophoto; release year is not photography year. See hk_geotiles_orthophoto and source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
INCOMPLETE COVERAGE; Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Historical survey composite; edition years and priority in hk_geotiles_composite. See source report.
Official digital orthophoto; release year is not photography year. See hk_geotiles_orthophoto and source report.
Official digital orthophoto; release year is not photography year. See hk_geotiles_orthophoto and source report.
LandsD historical orthophoto raster tiles
LandsD historical orthophoto raster tiles
回應代碼Response Codes
| 代碼 | 狀態 | 說明 |
|---|---|---|
| 200 | OK | 磚圖像成功返回 |
| 404 | Not Found | 該座標無磚資料(邊界外、低縮放或端點不存在) |
| 400 | Bad Request | 無效的 z/x/y 參數 |
| 429 | Too Many Requests | 超出速率限制 |
| 500 | Server Error | 伺服器內部錯誤 |
速率限制Rate Limits
超出限制將返回 HTTP 429。如需更高配額,請聯絡我們。
程式碼範例Code Examples
// Leaflet exampleXYZ 磚座標公式
標準 Web Mercator XYZ 磚座標計算方式,適用於所有相容 Slippy Map 的地圖函式庫。
function latLngToTile(lat, lng, zoom) { const x = Math.floor((lng + 180) / 360 * Math.pow(2, zoom)); const y = Math.floor((1 - Math.log(Math.tan(lat * Math.PI / 180) + 1 / Math.cos(lat * Math.PI / 180)) / Math.PI) / 2 * Math.pow(2, zoom)); return { x, y, z: zoom }; }WMTS 服務OGC WMTS 1.0.0
HK GeoTiles 提供符合 OGC WMTS 1.0.0 標準的地圖磚服務,可直接在 QGIS、ArcGIS、MapInfo 等 GIS 軟件中載入歷史航空照片及地形圖層,無需手動輸入 XYZ URL。服務分為兩個獨立入口點,按資料來源分拆。
MBTiles Archive 入口
本地 MBTiles 檔案資料集(DOP1000、地形圖、歷史地圖、WDL 等),由 HK GeoTiles 伺服器直接提供磚片。
KVP(QGIS / ArcGIS 推薦)
REST
磚片端點
External Map API 入口
外部 API 資料集(LANDSD GeoData Portal 等),磚片由 HK GeoTiles 伺服器代理轉發至原始來源。
KVP(QGIS / ArcGIS 推薦)
REST
磚片端點
磚片端點參數
兩個入口點的磚片端點使用相同的參數格式。:tileMatrix 接受純數字(如 14)或帶前綴格式(如 GoogleMapsCompatible:14)。所有 quota 及速率限制與 XYZ 端點相同。
| 參數 | 說明 |
|---|---|
| :layer | Dataset 識別碼,與 GetCapabilities 中的 Layer Identifier 相同 |
| :tileMatrix | Zoom 層級,接受 "14" 或 "GoogleMapsCompatible:14" |
| :tileRow | TileRow(Y 坐標) |
| :tileCol | TileCol(X 坐標),可帶副檔名如 .png |
在 QGIS 中使用 WMTS
兩個入口點均可獨立加入 QGIS,步驟相同:
- 1開啟 QGIS → 瀏覽器面板 → 右鍵「WMS/WMTS」→「新增連線」
- 2輸入名稱(如「HK GeoTiles MBTiles」或「HK GeoTiles External」)
- 3貼上對應入口點的 KVP URL(見上方)
- 4點擊「確定」→ 展開連線 → 選擇所需圖層 → 拖入地圖
快速複製 KVP URL:
MBTiles已啟用 WMTS 的本地資料集(0 個)
External已啟用 WMTS 的外部 API 資料集(0 個)
本地 WFS 服務OGC WFS 2.0.0
HK GeoTiles 提供符合 OGC WFS 2.0.0 標準的向量要素服務,提供本地上傳的 GeoJSON 數據集(如郊野公園界線)。 可直接在 QGIS、ArcGIS、MapInfo 等 GIS 軟件中載入,支援 GeoJSON 及 GML 3.2 輸出格式,並支援 BBOX 空間過濾及分頁。
- 開啟 QGIS → 瀏覽器面板 → 右鍵「WFS / OGC API - Features」→「新增連線」
- URL 填入:https://hkgeotiles.com/wfs?SERVICE=WFS&REQUEST=GetCapabilities
- 版本選「WFS 2.0」→ 測試連線 → 確定
- 展開連線 → 雙擊「hkgeotiles:country_parks」即可載入郊野公園界線
CSDI 向量資料存取OGC WFS 2.0 / ArcGIS FeatureServer
香港空間數據共享平台(CSDI)提供向量地理數據,可透過兩種標準介面查詢。經全面掃描 1,129 個資料集後確認:只有漁農自然護理署(AFCD)的 WFS 端點有完整 FeatureTypeList(31 個圖層)。其餘所有部門(地政總署、屋宇署、運輸署、環保署等)的 WFS 端點均返回空白 FeatureTypeList,必須改用 FeatureServer(ArcGIS REST)存取。
全面掃描結果(2026-11-29)
掃描 60 個部門共 1,129 個 CSDI 資料集。WFS FeatureTypeList 非空:31 個,全屬漁農自然護理署(AFCD)。其餘 1,098 個資料集 WFS 端點存在但 FeatureTypeList 為空,只能用 FeatureServer。
OGC WFS 2.0 — 僅 AFCD
標準 OGC WFS 2.0,輸出 GeoJSON,座標 EPSG:4326。只適用於 AFCD 31 個已驗證圖層。
GetFeature(bbox 篩選)
⚠️ bbox 軸序:minLon,minLat,maxLon,maxLat(x,y,x,y)。需帶 Origin 標頭(CORS)。
ArcGIS FeatureServer — 所有部門
ArcGIS REST API,適用於全部 1,129 個 CSDI 資料集,包括所有無 WFS 的部門。
GeoJSON 查詢(bbox 篩選)
人工魚礁投放地點
Artificial Reef Sites
csdi:F_ARSITE_GPolygon郊野公園
Country Parks
csdi:CTRY_PARKPoint生態重要溪流
Ecologically Important Stream
csdi:AFCD_ECO_IMPORTANT_STREAMMultiLineString紅潮情況
Red Tide Situation
csdi:RTIPoint雀鳥園界線
Aviary Boundary
csdi:AFCD_AVIARY_BOUNDARYPolygon郊野公園燒烤場
Barbecue Sites in Country Parks
csdi:BarbecueSitesincludeWheelchairSite_BarbecueSites_Ext_GDBPoint郊野公園遊客中心
Country Park Visitor Centres
csdi:CountryParkVisitorCentres_VisitorCentres_Ext_GDBPoint海岸公園遊客中心
Marine Park Visitor Centres
csdi:geotaggingPoint郊野公園食水補給站
Country Park Water Filling Stations
csdi:WaterFillingStation_WaterFillingStation_Ext_GDBPoint海岸公園食水補給站
Marine Parks Water Filling Stations
csdi:geotaggingPoint地質公園遊客中心
Geopark Visitor Centres
csdi:geotaggingPoint農藥持牌人
Pesticide Licensees
csdi:geotaggingPoint持牌牲畜農場
Licensed Livestock Farms
csdi:LicensedLivestockFarmsPoint遠足徑距離柱
Hiking Trail Distance Posts
csdi:DistancePosts_DistancePosts_Ext_GDBPoint郊野公園廁所
Toilets in Country Parks
csdi:Toilets_Toilets_Ext_GDBPoint山地單車徑
Mountain Bike Trails
csdi:MountainBikeTrails_MountainBikeTrails_Ext_GDBLineString小食亭
Refreshment Kiosks
csdi:RefreshmentKiosk_RefreshmentKiosk_Ext_GDBPoint郊野公園涼亭
Shelters in Country Parks
csdi:Shelters_Shelters_Ext_GDBPoint觀景台
Viewing Points
csdi:ViewingPoints_ViewingPoints_Ext_GDBPoint陸地生境圖(21 類)
Terrestrial Habitat Map (21 types)
csdi:Woody_shrubland (+ 20 more)Polygon遠足徑
Hiking Trails
csdi:HikingTrails_HikingTrails_Ext_GDBLineString香港濕地公園
Hong Kong Wetland Park
csdi:geotaggingPoint物種出現格網(2002–2026)
Species Occurrence Grid
csdi:grid (+ 25 年份層)Polygon塱原自然保育管理區
Long Valley Nature Park
csdi:geotaggingPoint地質公園陸上遊覽路線
Geopark Land Excursion Routes
csdi:Geopark_visiting_routesLineString漁業船隻分佈(2021)
Fisheries Vessel Distribution
csdi:fisheries_port_survey_2021Polygon漁業捕獲產量(2021)
Fisheries Capture Production
csdi:fisheries_port_survey_production_2021Polygon塱原自然保育中心
Long Valley Nature Centre
csdi:geotaggingPoint政府批發食品市場
Government Wholesale Food Markets
csdi:geotaggingPoint動物管理中心
Animal Management Centres
csdi:geotaggingPoint郊野公園景點
Attractions in Country Parks
csdi:Attractions_in_Country_ParksPoint圖源:香港地政總署開放數據(Creative Commons Attribution 4.0)
https://www.map.gov.hk