「數字地球」「數字國土」帶來海量地學空間數據。傳統全量加載導致瀏覽緩慢、記憶體壓力大。分層管理器依元數據動態載入所需層級圖元,實現大範圍快速瀏覽與專題圖疊加。
Definition Table
Type Native Charset "WindowsLatin1"
Fields 3
Key Char(32); -- 關鍵字
Level Char(32); -- 層級
Label Char(32); -- 標籤
begin_metadata
"\IsDrilldown" = "TRUE"
"\DDMap\ComponentMaps\One\File" = "PROVINCE.TAB"
"\DDMap\ComponentMaps\One\LevelID" = "PROVINCE"
"\DDMap\ComponentMaps\One\FeatureIDCol" = "3"
"\DDMap\ComponentMaps\One\FeatureCaptionCol" = "1"
"\DDMap\ComponentMaps\Two\File" = "CITY.TAB"
"\DDMap\ComponentMaps\Two\LevelID" = "CITY"
"\DDMap\ComponentMaps\Two\FeatureIDCol" = "3"
"\DDMap\ComponentMaps\Two\FeatureCaptionCol" = "1"
...
"\DDMap\HierarchyManager\IsDLL" = "TRUE"
"\DDMap\HierarchyManager\ID" = "DrillDownMgr.dll"
"\DDMap\HierarchyManager\InitialLevel" = "PROVINCE"
end_metadata
ToolUsed 事件。DrilldownAddFeatures 加入臨時表。DrilldownRemoveFeatures 移除父層圖元 → 畫面平滑切換。ToolUsed 事件。' VB + MapX 範例
Private Sub Map1_ToolUsed(ByVal Tool As Long)
If Tool = customDrilldownExpandTool Then
' 1. 取得點擊位置對應圖元
Dim fID As String
fID = Map1.SearchAtPoint(Map1.MouseX, Map1.MouseY)
' 2. 依層級決定下層組件表
Dim nextLayer As String, sql As String
Select Case CurrentLevel
Case "PROVINCE": nextLayer = "CITY"
Case "CITY": nextLayer = "COUNTY"
...
End Select
' 3. 空間查詢 Oracle
sql = "SELECT GEOM FROM " & nextLayer & " WHERE PARENT_ID = '" & fID & "'"
Set rs = OraDatabase.CreateDynaset(sql, 0)
' 4. 加入子圖元、移除父圖元
Map1.DrilldownAddFeatures nextLayer, rs
Map1.DrilldownRemoveFeatures CurrentLevel, fID
CurrentLevel = nextLayer
End If
End Sub
SDO_INDEX)。SDO_FILTER 一級過濾 + SDO_RELATE 二級精確。分層管理器結合 Oracle 數據倉庫儲存能力與 GIS 動態載入機制,以元數據驅動實現海量空間數據「所見即所載」,大幅提升瀏覽效能與使用者體驗。