1. 程式人生 > >[Bug]使用ST_Intersection函式報:ORA-06530: Reference to uninitialized composite

[Bug]使用ST_Intersection函式報:ORA-06530: Reference to uninitialized composite

導語

今天測試一個ST_Geometry的試驗,使用了ST_Intersection函式,獲得兩個圖層的相交部分,在執行過程中報:ORA-06530: Reference to uninitialized composite

分析

查找了Esri的官方技術文章,竟然是一個bug。

 

Bug NIM-101461

Bug Number  NIM101461
Submitted  May 7, 2014 2:55 PM
Severity  Medium
Applies To  No Product Found
Version Found  10.2
Prog Language  N/A
Server Platform  
Client Platform  
Database  All
Locale  N/A
Status  Open: Assigned
Version Fixed  N/A
SP Fixed  N/A

Synopsis

When feature classes with different SRIDs are used in an ST_intersection query, it fails with the message “ORA-06530: Reference to uninitialized composite.”

Additional Status Information

N/A

Alternate Solution

Manually use ‘st_transform':

SQL> SELECT SDE.ST_AsText(SDE.ST_Intersection(sde.st_transform(a.shape,300003), b.shape)) FROM ani3 a, ani4 b;

SDE.ST_ASTEXT(SDE.ST_INTERSECTION(SDE.ST_TRANSFORM(A.SHAPE,300003),B.SHAPE))
——————————————————————————–
POINT ( -117.38861502 34.41554692)

但是我的資料明明是同一個投影資訊啊,通過資料庫查詢,結果發現不一致,具體原因詳見
為什麼相同的投影座標系儲存在ArcSDE中獲得SRID不一致

結論

通過這個bug可以看出,目前ST_Intersection函式還不支援投影不一致的情況,嚴格意義上講,ArcSDE裡面的要素類的SRID必須一致才可以。

問題出來了,我們就把他解決掉吧!

如果是出現我上面連結的問題,你可以將這兩個資料放在一個數據集下,這樣肯定可以保證投影一致。

要麼進行手動的投影轉換,保證一致即可。