跳至主要内容

地點

備註

本指南專注於 Overture places 資料 — 其內容、範圍、屬性和使用案例。若要解更多關於 Overture places 架構 的相關資料,請參見 架構參考文檔

概要

Overture places 主題有一個特徵類型,稱為 place,包含超過 5300 萬個真實世界實體的點表示:學校、商業、醫院、宗教組織、地標、山峰等。該主題源於 Meta 和 Microsoft 資料的合併,並在 CDLA Permissive 2.0 授權下提供。

Overture places 主題覆蓋範圍
Overture places 資料,按資料來源樣式:Meta 用紫色,Microsoft 用橙色。
主要來源特徵數量(2024 年 7 月版本)
Meta約 4800 萬
Microsoft約 550 萬

資料集描述

所有 Overture 資料,包括地點資料,都以 GeoParquet 格式分發,這是一種基於 column-based 的資料結構。以下是地點特徵類型的屬性表。特別是 categories 屬性;我們提供了可用類別的完整列表 在這裡

地點主題中 GeoParquet 檔案的架構
欄位類型描述
idVARCHAR特徵 ID。如果該特徵代表的是 GERS(全球實體參考系統)的一部分,則此 ID 可能與 GERS 關聯。
geometryBLOB地點位置的點表示。地點的幾何形狀必須是 GeoJSON schema 定義的點。
bboxSTRUCT由兩個經度和兩個緯度定義的區域:緯度為 -90.0 到 90.0 之間的十進制數;經度為 -180.0 到 180.0 之間的十進制數。
versionINTEGER特徵的版本號,在每次 Overture 版本更新中,當該特徵的幾何形狀或屬性發生變化時,版本號會遞增。
sourcesSTRUCT給定特徵屬性的源訊息數組,每個條目都是一個源對象,列出了 JSON 指標符號表示的屬性和該特定值來源的資料集。所有特徵必須有一個根級別的源,這是默認源,如果未指定特定屬性的源,則使用此默認源。
namesSTRUCT定義特徵名稱的屬性。
categoriesSTRUCT地點的類別。完整列表可在 GitHub 上找到:https://github.com/OvertureMaps/schema/blob/main/task-force-docs/places/overture_categories.csv
confidenceDOUBLE地點存在的信心程度。數值範圍是 0 到 1 之間。0 表示我們確定該地點不存在(或不再存在)。1 表示我們確定該地點存在。如果沒有任何值,代表我們還沒有任何可信的訊息。
websitesVARCHAR[]地點的網站。
socialsVARCHAR[]地點的社交媒體 URL。
emailsVARCHAR[]地點的電子郵件地址。
phonesVARCHAR[]地點的電話號碼。
brandSTRUCT地點的品牌。擁有多個品牌的位置被建模為多個獨立的地點,每個地點都有自己的品牌。
addressesSTRUCT地點的地址。

資料的存取和檢索

最新的地點資料可以從 AWS 或 Azure 獲取,格式為 GeoParquet,位於以下位置:

供應商位置
Amazon S3
s3://overturemaps-us-west-2/release/2024-07-22.0/theme=places/type=place/
Azure Blob Storage
https://overturemapswestus2.blob.core.windows.net/release/2024-07-22.0/theme=places/type=place/

更多訊息可以在本文檔的 獲取 Overture 資料 部分找到。您可以直接從上述 S3 或 Azure 位置下載整個資料集。警告:輸出將是一個非常大的檔案。

根據您的使用情況,以下方法可能更實用:

首先,請遵循 Python Command-line Tool 的設定指南

overturemaps download -f geoparquet --type=place -o places.geoparquet

資料使用指南

我們建議僅下載您需要的 Overture 資料。如果您對特定的地理區域感興趣,有幾種選擇可以使用簡單的 bounding box 來提取地點資料並輸出 GeoJSON 檔案。

要快速查看和下載適量的資料,您可以使用 Overture Maps Explorer 網站

要下載資料:移動到您感興趣的區域,關閉其他圖層,然後點擊 Download Visible

這樣將下載您螢幕上可見的區域。

資料操作與分析

按屬性查詢

這些範例使用地址、類別和信心分數列中的資料屬性,以便通過 DuckDB 以有用的方式過濾資料。

address 列可用於快速過濾資料到特定的政治單位。這個例子使用國家鍵來獲取所有在立陶宛的地址資料。區域也可以用來從較小的單位(例如美國州)中提取資料。

LOAD spatial;
LOAD httpfs;
-- Access the data on AWS in this example
SET s3_region='us-west-2';

COPY (
SELECT
-- we can parse addresses into columns to make further filtering of the data simpler
addresses[1].freeform as street,
addresses[1].locality as locality,
addresses[1].postcode as postcode,
addresses[1].region as region,
addresses[1].country as country,
*
FROM read_parquet('s3://overturemaps-us-west-2/release/2024-07-22.0/theme=places/*/*')
WHERE
addresses[1].country = 'LT'
) TO 'lithuania_places.parquet';

進階範例

這些範例展示了一些將地點資料與其他資料集結合的使用案例。

Overture Places 可以作為一個有價值的來源,用於與您現有的資料集進行結合或增強。

在這個例子中,假設我們希望使用 OpenStreetMap 的 POI 進行一個項目,但希望用 Overture Places 的資料填補任何缺失的屬性,如地址或電話號碼。

通過一些基本的匹配邏輯,我們可以將這兩個資料集連接在一起,以創建一個更全面的最終產品。通過將 GERS ID 也連接到我們的輸出資料集,我們可以輕鬆地將現在合併的資料集與未來的 Overture 發行版本保持同步。

要自己執行此範例,可以從 Geofabrik 獲取 Oregon 的 PBF 檔案。

注意:將具有 CDLA Permissive 2.0 許可證的資料與 OSM 進行結合是被允許的,但結果資料可能需要遵循 Open Database License (ODbL) 如果它是一個衍生資料庫。請參閱 OSM Collective Database Guideline 瞭解更多訊息。

Query
LOAD spatial;
LOAD httpfs;
-- Access the data on AWS in this example
SET s3_region='us-west-2';

COPY (
-- We'll first select OSM data from Oregon with amenity = restaurant
WITH osm AS (
SELECT kind,
id,
tags->>'name' AS name,
tags->>'addr:housenumber' AS housenumber,
tags->>'addr:street' AS street,
tags->>'addr:postcode' AS postcode,
tags->>'addr:city' AS city,
tags->>'website' AS website,
tags->>'phone' AS phone,
lat,
lon,
tags
FROM st_readosm(
'oregon-latest.osm.pbf'
)
WHERE tags->>'amenity' = 'restaurant'
),
-- Then select Overture data with any category containing the word restauarant in Oregon.
overture AS (
SELECT id,
names.primary AS "names.primary",
websites[1] AS website,
socials[1] AS social,
emails[1] AS email,
phones[1] AS phone,
addresses[1].freeform AS freeform,
addresses[1].locality AS locality,
addresses[1].postcode AS postcode,
addresses[1].region AS region,
addresses[1].country AS country,
ST_GeomFromWKB(geometry) AS geometry
FROM read_parquet('s3://overturemaps-us-west-2/release/2024-07-22.0/theme=places/*/*')
WHERE region = 'OR'
AND country = 'US'
AND categories.primary ilike '%restaurant%'
)
-- Now that we have our input data we will join them together.
SELECT
-- With the GERS id joined to the final result this dataset can be quickly synced to future Overture releases
overture.id AS GERS_id,
osm.name,
-- Using CASE statements, we'll favor OSM data when it is present but use Overture data wherever there are gaps
CASE
WHEN osm.housenumber IS NOT NULL
OR osm.street IS NOT NULL THEN concat(osm.housenumber, ' ', osm.street)
ELSE overture.freeform
END AS address,
CASE
WHEN osm.city IS NOT NULL THEN osm.city
ELSE overture.locality
END AS city,
CASE
WHEN osm.postcode IS NOT NULL THEN osm.postcode
ELSE overture.postcode
END AS postcode,
CASE
WHEN osm.website IS NOT NULL THEN osm.website
ELSE overture.website
END AS website,
CASE
WHEN osm.phone IS NOT NULL THEN osm.phone
ELSE overture.phone
END AS phone,
overture.social,
overture.email,
ST_AsWKB(st_point(osm.lon, osm.lat)) AS geometry
FROM osm
-- To join the data, we'll first match features that have the same OR similar names
LEFT JOIN overture ON (
osm.name = overture."names.primary"
OR osm.name ilike concat('%', overture."names.primary", '%')
OR overture."names.primary" ilike concat('%', osm.name, '%')
OR damerau_levenshtein(osm.name, overture."names.primary") < 3
)
-- Then use a small buffer to match features that are nearby to each other
AND st_intersects(
st_buffer(overture.geometry::geometry, 0.003),
st_point(osm.lon, osm.lat)
)
) TO 'oregon_restaurants_combined.parquet';

套件和工具

Rapid

Rapid 是一個 OpenStreetMap 編輯器,能夠通過參考 此處的指南 顯示地點資料作為參考圖層。

該授權與 OSM 兼容,這些資料可用於製作地圖。