new GeoPolygon(Obj)
幾何物件:多邊形,內部的點位順序需為順時針
| Name | Type | Description | 
|---|---|---|
| Obj | GeoPolyline | GeoPolygon | GeoBoundary | Array.<GeoPoint> | undefined | 複製的資料源。 | 
Example
var a = new GeoPolygon(polygon);
var b = new GeoPolyline();
Members
- 
    readonlyBoundary
- 
    
    此幾何的範圍 Properties:Name Type Description BoundaryGeoBoundary 範圍 
- 
    BufferArray.<GeoPoint>
- 
    
    放置點位的Buffer 
- 
    readonlyCenter
- 
    
    此幾何的中心點 Properties:Name Type Description CenterGeoPoint 中心點 
- 
    DistanceInBound
- 
    
    計算傳入的點到Polygon邊緣上的距離。 
- 
    length
- 
    
    內含點位的數量 Properties:Name Type Description lengthNumber 點位的數量 
- 
    readonlytype
- 
    
    物件型態,值為GEO_TYPE.POLYGON Properties:Name Type Description typeGEO_TYPE 物件型態 
Methods
- 
    ClipLine(s, result){Boolean}common/Geometry.js, line 6314
- 
    
    
    將傳入的Line用此Polygon來切除,只剩在Polygon內的線。 Name Type Description sGeoLine 欲處理的線段資料。 resultGeoLine 此為out參數,須在執行前先配置好,執行後,此為處理後的答案。 Returns:Type Description Boolean 傳回值行是否成功。 
- 
    ClipPolygon(s, result){Boolean}common/Geometry.js, line 6359
- 
    
    
    將傳入的Polygon用此Polygon來切除,只剩在Polygon內的範圍。 Name Type Description sGeoPolygon 欲處理的線段資料。 resultGeoPolygon 此為out參數,須在執行前先配置好,執行後,此為處理後的答案。 Returns:Type Description Boolean 傳回值行是否成功。 
- 
    Clone(){GeoPolygon}common/Geometry.js, line 5997
- 
    
    
    產生一份新的自己。 Returns:Type Description GeoPolygon 傳回複製的新的自己。 
- 
    CombinPolygon(Polygon, PolygonSet, CombinType){Boolean}common/Geometry.js, line 6484
- 
    
    
    將自己與傳入的Polygon做合併運算。 Name Type Description PolygonGeoPolygon 運算的Polygon資料。 PolygonSetGeoPolygonSet 此為out參數,需先在外面配好變數,合併後的結果。 CombinTypeGEO_CB_TYPE 運算類型。 Returns:Type Description Boolean 傳回運算是否成功。 
- 
    ConvertToPolyline(){GeoPolyline}common/Geometry.js, line 7256
- 
    
    
    將此Polygon轉為Polyline。 Returns:Type Description GeoPolyline 傳回轉換後的Polyline。 
- 
    CopyFrom(Obj){GeoPolygon}common/Geometry.js, line 6006
- 
    
    
    複製。 Name Type Description ObjGeoLine | GeoPolyline | Array.<GeoPoint> 複製的資料源。 Returns:Type Description GeoPolygon this。 
- 
    Distance(Obj){Number}common/Geometry.js, line 7130
- 
    
    
    計算自己與傳入幾何的距離。 Name Type Description ObjGeoPoint | GeoLine | GeoPolyline | GeoPolygon | GeoPolygonSet 要計算距離的幾何資料。 Returns:Type Description Number 傳回距離。 
- 
    FromGeoJSON(src){Boolean}common/Geometry.js, line 7285
- 
    
    
    讀入GeoJSON數值。 Name Type Description srcObject | String GeoJSON物件或字串。 Returns:Type Description Boolean 回傳讀取是否成功。 
- 
    GetArea(){Number}common/Geometry.js, line 6122
- 
    
    
    計算此Polygon的面積。 Returns:Type Description Number 傳回計算的面積。 
- 
    GetAt(index){GeoPoint}common/Geometry.js, line 6075
- 
    
    
    取第index個點。 Name Type Description indexNumber 索引。 Returns:Type Description GeoPoint 第index個點。 
- 
    Include(Obj, bound){Boolean}common/Geometry.js, line 7039
- 
    
    
    判斷傳入的幾何資料是否被自己包含。 Name Type Description ObjGeoPoint | GeoLine | GeoPolyline | GeoPolygon | GeoPolygonSet 判斷的幾何資料。 boundBoolean 只用於Polygon與PolygonSet,指示相交於編上是否算包含。 Returns:Type Description Boolean 傳回是否相交。 
- 
    IsConvex(){Boolean}common/Geometry.js, line 6141
- 
    
    
    判定此Polygon是否為凸多邊形。 Returns:Type Description Boolean 傳回判斷結果。 
- 
    IsGood(){Boolean}common/Geometry.js, line 6193
- 
    
    
    判定此Polygon是否為好的Polygon(順序對,沒自己相交,有面積...)。 Returns:Type Description Boolean 傳回判斷結果。 
- 
    IsIntersect(判斷的幾何資料。, slice){Boolean}common/Geometry.js, line 6461
- 
    
    
    判斷自己與傳入幾何是否相交。 Name Type Description 判斷的幾何資料。GeoPolyline | GeoPolygon | GeoPolygonSet sliceBoolean 指定若只交在節點上,算不算相交。 Returns:Type Description Boolean 傳回是否相交。 
- 
    MakeBuffer(Distance, PolygonSet){Boolean}common/Geometry.js, line 7191
- 
    
    
    做出環域的PolygonSet。 Name Type Description DistanceNumber 環域的距離。 PolygonSetGeoPolygonSet out參數,環域計算的答案。 Returns:Type Description Boolean 回傳是否成功。 
- 
    Offset(p)common/Geometry.js, line 7178
- 
    
    
    位移p。 Name Type Description pGeoPoint 欲位移的距離。 
- 
    PtInPolygon(p, Obj){Boolean}common/Geometry.js, line 6094
- 
    
    
    檢查傳入的點p是否位於此Polygon內。 Name Type Description pGeoPoint 欲檢查的點。 ObjObject 此為out參數,需在執行前先配置好,執行後,Obj.InBound=true|false代表是否位於邊緣上。 Returns:Type Description Boolean 傳回是否位於Polygon內。 
- 
    RemoveAll()common/Geometry.js, line 6032
- 
    
    
    移除所有的點位資料。 
- 
    SetAt(index, Obj)common/Geometry.js, line 6084
- 
    
    
    設定第index個點。 Name Type Description indexNumber 索引。 ObjGeoPoint 要設定的值。 
- 
    SetGeoData(Buffer){Boolean}common/Geometry.js, line 6041
- 
    
    
    設定幾何資料,會檢查順逆時針,將其調整成正確的順序,若已知順序,可直接將點位資料Copy進Buffer變數,以增進效能。 Name Type Description BufferArray.<GeoPoint> 要Copy的點位資料。 Returns:Type Description Boolean 是否Copy成功。 
- 
    SimplifyByPointCount(Count){Number}common/Geometry.js, line 7237
- 
    
    
    給定指定點數(希望簡約化後的點數),計算簡約化。 Name Type Description CountNumber 簡約化後希望的點數。 Returns:Type Description Number 傳回簡約化後,剩餘的點數。 
- 
    SimplifyByTolerance(MaxErr, Polylines){Number}common/Geometry.js, line 7209
- 
    
    
    給定誤差值,計算簡約化 Name Type Description MaxErrNumber 簡約化的誤差值。 PolylinesArray.<GeoPolyline> | undefined 簡約化過程中,要避免與這些Polyline相交。 Returns:Type Description Number 傳回簡約化後,剩餘的點數。 
- 
    SplitByLine(Line, RightAnswer, LeftAnswer){Boolean}common/Geometry.js, line 6511
- 
    
    
    將自己用傳入的Line來切成右與左兩部分的Polygon。 Name Type Description LineGeoLine 切割的Line。 RightAnswerArray.<GeoPolygon> 此為out參數,需在執行前先配置好,執行後,傳回右邊的Polygon。 LeftAnswerArray.<GeoPolygon> 此為out參數,需在執行前先配置好,執行後,傳回左邊的Polygon。 Returns:Type Description Boolean 傳回運算是否成功 
- 
    SplitByPolygon(Polygon, Inside, Outside){Boolean}common/Geometry.js, line 6906
- 
    
    
    將自己用傳入的Polygon來切成內部與外部兩部分的PolygonSet。 Name Type Description PolygonGeoPolygon 切割的Polygon。 InsideArray.<GeoPolygonSet> 此為out參數,需在執行前先配置好,執行後,傳回內部的PolygonSet。 OutsideArray.<GeoPolygonSet> 此為out參數,需在執行前先配置好,執行後,傳回外部的PolygonSet。 Returns:Type Description Boolean 傳回運算是否成功。 
- 
    SplitByPolyline(Line, RightAnswer, LeftAnswer){Boolean}common/Geometry.js, line 6736
- 
    
    
    將自己用傳入的Polyline來切成右與左兩部分的Polygon。 Name Type Description LineGeoPolyline 切割的Line。 RightAnswerArray.<GeoPolygon> 此為out參數,需在執行前先配置好,執行後,傳回右邊的Polygon。 LeftAnswerArray.<GeoPolygon> 此為out參數,需在執行前先配置好,執行後,傳回左邊的Polygon。 Returns:Type Description Boolean 傳回運算是否成功。 
- 
    ToGeoBuffer(){Float64Array}common/Geometry.js, line 7302
- 
    
    
    輸出成緩衝區物件。 Returns:Type Description Float64Array 回傳多邊形點位陣列。 
- 
    ToGeoJSON(toString){Object|String}common/Geometry.js, line 7270
- 
    
    
    將幾何輸出成GeoJSON物件或字串。 Name Type Description toStringBoolean 是否把物件轉成JSON字串。 Returns:Type Description Object | String 輸出轉換結果。