三維立體圖徵
三維立體圖徵
在三維立體空間中,資料也可以帶有高程數值,而從二維轉換而來的資訊並無高程資訊,因此在繪製時取其二維坐標,並伏貼於地表DTM上,這樣的呈現模式無法展現資料實際所在的高度與位置。利用三維立體圖徵相關功能,即可使線面圖徵資訊界尤其設定的高程值,正確繪製該圖徵在三維空間中的位置,並隨著圖台操作、視點改變,而呈現不同的形狀,營造出完全立體的視覺效果。
不論線圖徵或面圖徵,在建置時都是由三維點資料結構組成,三維點資料結構支援高程值紀錄,因此在XY坐標後,僅需加入高程值,即可在資料繪製成圖徵時顯示。這些圖徵於沒有設定高度值的圖徵一樣,可以設定框線、填色顏色、透明度、粗細等屬性,改變其視覺樣式。
function online3DClick()
{
var path = []; //建立路徑
path[0] = new TGOS.TEPoint(121.543794, 25.041626, 1000); //組成路徑的三維點資料
path[1] = new TGOS.TEPoint(121.543794, 25.041626, 3000);
path[2] = new TGOS.TEPoint(121.540794, 25.044626, 2500);
path[3] = new TGOS.TEPoint(121.546794, 25.044626, 2500);
path[4] = new TGOS.TEPoint(121.546794, 25.044626, 3500);
var lineStr = new TGOS.TELineString(path);
var testline3D = new TGOS.TELine(tg3dEarth,lineStr,{ //繪製線圖徵
strokeWeight:300,
strokeColor:'#ff3300',
AltitudeMode : TGOS.TEAltitudeModeType.RelativeToGround
});
TGOS.TEEvent.addListener(testline3D, "click", function (tEvent) {
alert('立體線圖徵');
});
}
function onfill3DClick()
{
var path = []; //建立路徑
path[0] = new TGOS.TEPoint(121.48633, 25.16105,2000); //組成路徑的三維點資料
path[1] = new TGOS.TEPoint(121.56735, 25.24617,5000);
path[2] = new TGOS.TEPoint(121.59070, 25.10386,3000);
path[3] = new TGOS.TEPoint(121.51585, 25.06469,5000);
path[4] = new TGOS.TEPoint(121.42453, 25.12718,4000);
path[5] = new TGOS.TEPoint(121.48633, 25.16105,2000);
var lineStr = new TGOS.TELineString(path);
var ring = new TGOS.TELinearRing(lineStr);
var polygon = new TGOS.TEPolygon([ring]);
var testFill = new TGOS.TEFill(tg3dEarth,polygon,{ //繪製面圖徵
fillColor:"#cccc00",
fillOpacity:0.6,
strokeColor:"#ffcc00",
strokeWeight:10000,
strokeOpacity:0.8,
AltitudeMode : TGOS.TEAltitudeModeType.Absolute
});
}