將基於Object Storage Service的傾斜攝影專案(OSGB格式)匯入到資料庫中。
文法
boolean ST_ImportOSGB(cstring table_name, cstring url, cstring options default '{}');參數
參數名稱 | 描述 |
table_name | osg表名及其瓦片表首碼。 |
url | 基於Object Storage Service服務的路徑。 說明 為保證資料可訪問性,請確保叢集與OSS所在Region相同,並使用internal地址進行訪問。更多資訊,請參見Object Storage Service服務路徑。 |
options | 匯入選項:
|
描述
將基於Object Storage Service的OSGB檔案匯入到資料庫中。
匯入限制說明:
僅支援OSGB格式的檔案。
指定目錄下需要存在一個名為
metadata.xml的檔案,檔案可以位於根目錄或任意子目錄下。需要匯入完整的OSGB檔案,否則將丟失相關資訊。
當資料量較大,且使用用戶端串連資料庫進行OSGB檔案匯入時,請適當調整用戶端逾時限制,避免因逾時終止而導致的資料匯入失敗。
匯入成功後會在資料庫內產生兩張表:
如果並行度不為1,將不支援自動建表,需要您預先手動建立,建表語句如下:
# 以在預設schema下建立一個名為test_osgb的表為例
# 建立主表
CREATE TABLE IF NOT EXISTS test_osgb(
project_id uuid primary key,
project_name text,
srid integer,
ref_point geometry,
extent geometry,
aux text,
tiletable varchar(64) NOT null
);
# 建立瓦片表
CREATE TABLE IF NOT EXISTS test_osgb_tile(
project_id uuid NOT NULL,
project_name text,
uid uuid NOT NULL,
lod integer,
precision float8,
parent uuid,
children uuid[],
aux jsonb,
tile scene NOT NULL,
PRIMARY KEY(project_id, uid)
);樣本
-- 常規匯入
SELECT ST_ImportOSGB('test_osgb', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_oblique_project/');
---------
t
-- 並行匯入
SELECT ST_ImportOSGB('test_osgb', 'OSS://<ak>:<ak_secret>@oss-cn-beijing-internal.aliyuncs.com/mybucket/path_to_oblique_project/', '{"parallel": 4}');
---------
t