跳至主要內容 / Skip to main content
穿越老香港!HK GeoTiles圖磚API結合QGIS實戰
教學

穿越老香港!HK GeoTiles圖磚API結合QGIS實戰

HK GeoTiles約 3 分鐘閱讀90 次閱讀
想一睹1963年的老香港?無須下載龐大檔案,只需在 QGIS 貼上 HK GeoTiles 圖磚網址,即可將歷史航拍與現代底圖疊加。跟著實戰教學調整透明度,輕鬆對比今昔街道,親手發掘城市地景的歲月變遷。
90

封面:香港地政總署 1963 年航空正射影像實際圖磚,經裁切、調暗及加上標題;圖磚服務:HK GeoTiles。

想知道今天的中環,六十多年前是甚麼模樣?不用下載數十 GB 的航拍影像,也不用寫程式:只要在 QGIS 加入 HK GeoTiles 的圖磚網址,就可以把 1963 年航拍和現代地圖疊在一起,開始探索香港的地景變遷。

這篇文章由建立連線開始,帶你逐步完成圖層疊加、透明度調整及地圖輸出,最後再介紹如何尋找其他歷史圖層。

hkgeotiles 1963 map

hkgeotiles 1963 map
在此輸入說明文字

圖 1|HK GeoTiles 網站實際畫面,1963 年航拍疊加於底圖,並非 QGIS 畫面。部分區域顯示底圖或空白;圖源:香港地政總署,服務:HK GeoTiles。截圖日期:2026-11-16。

適合對象:QGIS 初學者、地方歷史愛好者及教師。
準備:已安裝的 QGIS 桌面版、網絡連線。加入 XYZ 圖層不需要安裝外掛。介面名稱會因 QGIS 版本及語言略有不同。

完成後你會得到甚麼?

  • 在 QGIS 顯示地政總署現代底圖及 HK GeoTiles 1963 年歷史航拍。
  • 利用圖層次序和透明度,觀察同一地點的今昔變化。
  • 儲存 QGIS 專案,並匯出一張用於分享的地圖圖片。
  • 學會從資料集目錄尋找其他年份和地圖。

先認識:甚麼是 XYZ 圖磚?

想像把一幅大地圖切成許多小方塊。當你拖動或放大地圖,QGIS 只向伺服器請求畫面需要的小圖;網址中的 {z} 是縮放級別,{x} 和 {y} 是圖磚位置。

HK GeoTiles 的歷史資料儲存在伺服器的 MBTiles 檔案,透過 XYZ API 提供圖磚。本站文件說明,歷史圖磚以 Web Mercator(EPSG:3857)發布;服務會處理 MBTiles 的 TMS Y 方向轉換,所以 QGIS 連線保留 {z}/{x}/{y} 原樣即可。歷史圖層網址毋須自行加 .png。服務目前公開使用、毋須 API 金鑰;實際規格及限制請以最新文件為準。 HK GeoTiles API 文件

重要:XYZ 連線是線上服務,不等於把整份 MBTiles 下載到電腦;開啟專案查看圖磚時通常需要網絡。

第 1 步|開啟 QGIS 的瀏覽器面板

  • 啟動 QGIS,建立新的空白專案。

  • 找到左側 Browser/瀏覽器面板。如果沒有顯示,在上方選單選擇 View → Panels → Browser(檢視 → 面板 → 瀏覽器)。

  • 在 Browser 面板尋找 XYZ Tiles。下一步會在這裏建立連線。
  • 第 2 步|加入地政總署現代底圖

  • 在 XYZ Tiles 按右鍵,選擇 New Connection…/新增連線。

  • 在名稱欄輸入 LANDSD 現代底圖。

  • 將以下完整網址貼到 URL 欄:
  • https://mapapi.hkmapservice.gov.hk/gs/api/v1.0.0/xyz/basemap/WGS84/{z}/{x}/{y}.png

  • 若對話框提供最小及最大 Zoom,可先按 HK GeoTiles 教學示例填 0 和 20;實際可用縮放級別及服務政策應以底圖供應者的最新資料為準。

  • 按 OK/確定。展開 XYZ Tiles,雙擊剛建立的 LANDSD 現代底圖,或將它拖進地圖畫布。

  • 等待圖磚載入,並將畫面移到香港。這是地政總署的獨立服務,不是 HK GeoTiles 的歷史圖磚;公開使用時應分別核對服務條款。HK GeoTiles 教學|API 文件
  • 第 3 步|加入 1963 年歷史航拍

    hkgeotiles datasets

    hkgeotiles datasets
    在此輸入說明文字

    圖 2|QGIS 4.2.3 實際 XYZ 連線視窗,使用 HK GeoTiles 1963 年航拍的真實網址及 z0–19 設定。畫面以 QGIS 自動化操作擷取;連線視窗用於示範,非儲存確認畫面。

  • 再次在 XYZ Tiles 按右鍵,選 New Connection…/新增連線。

  • 名稱輸入 HK GeoTiles 1963 航拍。

  • 在 URL 欄貼上:
  • https://hkgeotiles.com/api/tiles/dataset/mbtiles-dop1000-1963/{z}/{x}/{y}

  • 如果可設定 Zoom,按撰稿時目錄為這個資料集列出的範圍填入 最小 0、最大 19。個別圖層的數值不同,日後請以目錄的 zoommin 和 zoommax 為準;設定範圍不代表每個位置和縮放級別都有影像。

  • 按 OK/確定,然後雙擊或拖入 HK GeoTiles 1963 航拍。

  • 在 Layers/圖層面板,確認兩個圖層均已勾選,並把航拍拖到現代底圖的上方。

  • 把畫面移到中環附近,再逐步放大。若暫時看不到航拍,先放大到街區範圍,並參考下方排查步驟。
  • 核對網址:花括號和斜線必須保留;不要把 {y} 改成 {-y},也不要把 .png 加到上面的 HK GeoTiles 歷史圖層網址。地政總署底圖是另一個端點,其網址本身已有 .png。

    第 4 步|調整座標系統及透明度

    qgis transparency hkgeotiles real

    qgis transparency hkgeotiles real
    在此輸入說明文字

    圖 3|QGIS 4.2.3 實際圖層屬性視窗:以 HK GeoTiles 1963 航拍 XYZ 圖層示範 Global Opacity 50%。畫面以 QGIS 自動化操作擷取。

  • 在 QGIS 視窗右下角找到專案座標系統,點擊目前的 EPSG 代碼,搜尋並選擇 EPSG:3857 — WGS 84 / Pseudo-Mercator,按確定。這是本教學的起點;QGIS 可以按圖層座標系統作即時轉換,並非所有資料都必須改成 EPSG:3857。

  • 在圖層面板右鍵點擊 HK GeoTiles 1963 航拍,選 Properties/屬性。

  • 找到 Transparency/透明度,把整體不透明度調到約 50%,按 Apply/套用及 OK/確定。如果介面顯示的是「透明度」而非「不透明度」,可先設 50%,再按視覺效果微調。

  • 試着勾選及取消勾選航拍,或調整透明度,觀察海岸線、街道與建築位置的變化。
  • 如何解讀?歷史圖像可能有覆蓋缺口、原圖變形、地形及配準誤差;疊合後略有偏移,不一定是操作錯誤。放大不會增加原圖細節,視覺比較不能代替精確測量、界址判定或歷史考證。若使用多年份合成圖層,先查看資料集說明及來源報告,不要把整層當作單一年份。

    第 5 步|儲存專案與匯出圖片

    儲存可繼續編輯的專案

  • 選 Project → Save As…/專案 → 另存新檔。

  • 選擇資料夾,儲存為例如 HKGeoTiles-1963.qgz。

  • 日後重新開啟專案即可保留圖層與設定;但它保存的是線上服務連線,不是完整離線地圖。來源服務仍需可用及連網。
  • 匯出圖片

  • 先調整地圖範圍、圖層順序及透明度。

  • 選 Project → Import/Export → Export Map to Image…(專案 → 匯入/匯出 → 匯出地圖為影像;選單名稱依版本可能略有差異)。

  • 選擇輸出範圍、尺寸及解析度,儲存 PNG 或其他可用格式。

  • 在圖片或 附帶文字中清楚標示圖層名稱、年份、原始資料提供者與圖磚服務;按原始資料和各服務的最新條款加入所需署名。需要標題、比例尺及完整來源說明時,可使用 QGIS 的 Print Layout/列印版面製作。
  • 第 6 步|尋找其他歷史圖層

    qgis xyz hkgeotiles real

    qgis xyz hkgeotiles real
    在此輸入說明文字

    圖 4|HK GeoTiles 資料集目錄的網站實際畫面;數量和可用狀態會更新。截圖日期:2026-11-16。

  • 開啟 HK GeoTiles 資料集目錄 或 API 文件,選擇你感興趣的資料集,確認其狀態為「可用」。

  • 開啟 機器可讀資料集目錄,搜尋資料集名稱或 ID;查看 tileurl、zoommin、zoom_max 及說明。

  • 若 tile_url 以 /api/ 開頭,在前面加上 https://hkgeotiles.com,再依第 3 步新增 XYZ 連線;若已是完整 https:// 網址,直接使用,不要重複加上網域。

  • 為新圖層設定資料集所列 Zoom 範圍,並前往其實際覆蓋區域。目錄中的「即將推出」、覆蓋不完整、跨年份合成等提示都值得先看。
  • 例如,API 文件列出的 1922 年舊測量圖 1:600:

    https://hkgeotiles.com/api/tiles/dataset/mbtiles-old600-1922/{z}/{x}/{y}

    撰稿時該圖層列為 z10–20,但並非香港每個位置都有圖磚。服務內容及縮放範圍會更新,請以最新資料集資訊為準。HK GeoTiles API 文件

    看不到地圖?依次排查

  • 兩層都空白:確認網絡正常、連線網址完整;先只開現代底圖,移到香港並放大,確認底圖服務是否可用。

  • 只有航拍空白:確認航拍已勾選、位於底圖上方,透明度不是 100%;核對資料集狀態、網址、縮放範圍與地理覆蓋。試中環附近及街區尺度。

  • 有些位置空白:可能沒有對應圖磚。API 文件說明 MBTiles 端點的 204 No Content 可表示該座標沒有圖磚;一般回應代碼表亦列出 404 可能是無圖磚或端點不存在,需結合實際網址與回應判斷。

  • 載入時斷時續:每個可見圖層都會產生請求;先關閉不需要的圖層,避免快速、反覆大範圍移動。文件目前列出每分鐘 300 次及每日 50,000 次的限制,超出可能返回 429;配額與條款可能變更。

  • 位置看起來不吻合:核對專案和來源資料的座標系統,確認 QGIS 有正確識別圖層 CRS;再考慮歷史資料的配準與精度限制。不要因外部網址含 WGS84 就假定它與另一服務的圖磚規格完全一樣。
  • 小提示|XYZ 與 WMTS 有甚麼分別?

    本教學使用 XYZ Tiles:一個連線對應一個圖層,初學容易掌握。HK GeoTiles 的 API 文件也列出 WMTS 入口及 QGIS 的 WMS/WMTS 連線方式;撰稿時文件顯示兩個入口均有 0 個已啟用圖層。能否透過 WMTS 瀏覽實際圖層,請以最新服務能力文件及網站狀態為準;因此這裏以 XYZ 為主要做法。HK GeoTiles API 文件

    結語|從熟悉的地方開始

    選一個你熟悉的街區,切換 1963 年航拍與現代底圖,記下三個變化,再找一個仍需要其他史料佐證的問題。歷史地圖不只是一張舊照片;它也可以成為重新認識香港的入口。

    參考資料與使用提醒

    EN

    English Summary

    Exploring the historical urban evolution of Hong Kong no longer requires downloading gigabytes of archival aerial imagery or possessing advanced programming skills. A recent practical guide demonstrates how international geographic information system professionals and history enthusiasts can easily travel back in time to observe the mid-twentieth-century landscape of Hong Kong. By leveraging modern open-source mapping software, users can seamlessly overlay historical imagery onto contemporary basemaps. The article specifically focuses on the transformation of Central, Hong Kong, since 1963, providing a step-by-step tutorial on using QGIS to visually bridge the gap between the city’s past and present. This approach democratizes access to historical geography, making it highly accessible for educators, researchers, and local history aficionados who wish to study spatial changes over the last six decades without managing cumbersome offline files.

    At the core of this accessible workflow is the implementation of XYZ tile web services, a technology that efficiently manages and serves large spatial datasets. Instead of rendering a massive single image file, the map is divided into a grid of small, manageable square tiles. As the user navigates or zooms within the QGIS canvas, the software dynamically requests only the specific image tiles required for the current viewing area, defined by zoom level and coordinate parameters. The historical datasets are hosted on servers as MBTiles files and distributed via an application programming interface in the Web Mercator projection. Because the service automatically handles necessary spatial directions and coordinate conversions, users can directly input the tile uniform resource locators into their mapping software without requiring additional plugins or complex configurations. This lightweight, on-demand data retrieval method significantly lowers the technical barrier to entry for historical spatial analysis.

    The HK GeoTiles platform serves as the crucial enabler for this comparative mapping exercise by providing direct, open access to these historical tile sets. The tutorial outlines a straightforward methodology, beginning with establishing an XYZ connection to the modern digital basemap provided by the Hong Kong Lands Department. Following this, users create a secondary connection to the HK GeoTiles application programming interface to load the 1963 aerial orthophotos. By layering the historical imagery directly on top of the modern street map and adjusting the global opacity to approximately fifty percent, users can perform a direct visual cross-examination of the landscape. This technique vividly highlights dramatic alterations in the city's topography, including extensive land reclamation, shifting coastlines, and the complete redevelopment of historical street blocks. Furthermore, the platform's machine-readable dataset catalog allows users to easily discover and integrate other historical layers, such as high-resolution legacy survey maps from 1922, simply by updating the endpoint addresses and zoom parameters in their software.

    Beyond the technical setup, the guide offers essential practical takeaways and methodological caveats for researchers and mapping enthusiasts. It emphasizes that while overlaying historical tiles provides profound visual insights, users must remain acutely aware of inherent historical data limitations. Slight spatial offsets or misalignments are common due to original image distortion, topographical variations, and the technological constraints of legacy geospatial registration. Therefore, visual synthesis should inspire further historical investigation rather than serve as a substitute for precise cadastral surveying or boundary determination. The article also provides robust troubleshooting strategies for common connection issues, advising users to verify coordinate reference systems, check zoom level availability, and remain mindful of server request limits to avoid rate-throttling. Ultimately, by mastering these straightforward layer manipulation and export techniques, international users can easily generate compelling, properly attributed comparative maps, transforming static archival records into interactive tools for spatial storytelling and historical discovery.

    QGIS
    LANDSD
    HKgeotiles
    90
    H

    HK GeoTiles

    HK GeoTiles 撰稿人

    致力於整理及分享香港歷史地圖磚資源,讓公眾更容易取用珍貴的地理資訊。

    載入附件中…

    相關文章

    查看全部