Class: GeoPolygonSet

GeoPolygonSet

幾何物件:複合多邊形,內部包含外圍(Bounds)與洞(Holes)兩組Polygon

new GeoPolygonSet(obj)

common/geometry/GeoPolygonSet.js, line 6

建立複合多邊形

Name Type Description
obj GeoPolygonSet | GeoPolygon | GeoBoundary optional

欲複製的GeoPolygonSet;欲轉換的GeoPolygon;欲轉換的GeoBoundary。

Example

var a = new GeoPolygonSet();//預設建構子
var b = new GeoPolygonSet(a);//使用欲複製的GeoPolygonSet建立GeoPolygonSet
var c = new GeoPolygonSet(new GeoPolygon());//使用欲轉換的GeoPolygon建立GeoPolygonSet
var d = new GeoPolygonSet(new GeoBoundary());//使用欲轉換的GeoBoundary建立GeoPolygonSet

Extends

Members

readonlyBoundary

此幾何的範圍

Properties:
Name Type Description
Boundary GeoBoundary

範圍

Bounds

放置外圍Polygon的Buffer

Properties:
Name Type Description
Bounds Array.<GeoPolygon>

點位陣列

readonlyCenter

此幾何的中心點

Properties:
Name Type Description
Center GeoPoint

中心點

HolesArray.<GeoPolygon>

放置洞Polygon的Buffer

PointCount

內含點位的數量

Properties:
Name Type Description
PointCount number

點位的數量

readonlytype

物件型態,值為GEO_TYPE.POLYGONSET

Properties:
Name Type Description
type GEO_TYPE

物件型態

Methods

Clone(){GeoPolygonSet}

common/geometry/GeoPolygonSet.js, line 125

產生一份新的自己。

Returns:
Type Description
GeoPolygonSet 傳回複製的新的自己。

CombinPolygonSet(polygonSet, retPolygonSet, combineType){boolean}

common/geometry/GeoPolygonSet.js, line 161

將自己與傳入的PolygonSet做合併運算。

Name Type Description
polygonSet GeoPolygonSet

運算的PolygonSet資料。

retPolygonSet GeoPolygonSet

此為out參數,需先在外面配好變數,合併後的結果。

combineType GEO_CB_TYPE

運算類型。

Returns:
Type Description
boolean 傳回運算是否成功

CopyFrom(obj){GeoPolygonSet}

common/geometry/GeoPolygonSet.js, line 133

複製。

Name Type Description
obj GeoPolygon | GeoPolygonSet

複製的資料源。

Returns:
Type Description
GeoPolygonSet this。

Distance(obj){number}

common/geometry/GeoPolygonSet.js, line 469

計算自己與傳入幾何的距離。

Name Type Description
obj GeoPoint | GeoLine | GeoPolyline | GeoPolygon | GeoPolygonSet

要計算距離的幾何資料。

Returns:
Type Description
number 傳回距離。

FromGeoJSON(src){boolean}

common/geometry/GeoPolygonSet.js, line 637

讀入GeoJSON數值。

Name Type Description
src GeoJSON.GeoJsonObject | string

GeoJSON物件或字串 。

Returns:
Type Description
boolean 回傳讀取是否成功。

GetArea(){number}

common/geometry/GeoPolygonSet.js, line 184

計算此PolygonSet的面積。

Returns:
Type Description
number 傳回計算的面積。

Include(obj, bound){boolean}

common/geometry/GeoPolygonSet.js, line 363

判斷傳入的幾何資料是否被自己包含。

Name Type Description
obj GeoPoint | GeoLine | GeoPolyline | GeoPolygon | GeoPolygonSet

判斷的幾何資料。

bound boolean

只用於Polygon與PolygonSet,指示相交於邊上是否算包含。

Returns:
Type Description
boolean 傳回是否包含。

IsIntersect(obj, slice){boolean}

common/geometry/GeoPolygonSet.js, line 254

判斷自己與傳入幾何是否相交。

Name Type Description
obj GeoPolyline | GeoPolygon | GeoPolygonSet

判斷的幾何資料。

slice boolean

指定若只交在節點上,算不算相交。

Returns:
Type Description
boolean 傳回是否相交。

MakeBuffer(distance, polygonSet){boolean}

common/geometry/GeoPolygonSet.js, line 536

做出環域的PolygonSet。

Name Type Description
distance number

環域的距離。

polygonSet GeoPolygonSet

out參數,環域計算的答案。

Returns:
Type Description
boolean 回傳是否成功。

Offset(p)

common/geometry/GeoPolygonSet.js, line 517

位移p。

Name Type Description
p GeoPoint

欲位移的距離。

PtInPolygonSet(p, obj){boolean}

common/geometry/GeoPolygonSet.js, line 492

檢查傳入的點p是否位於此PolygonSet內。

Name Type Description
p GeoPoint

欲檢查的點。

obj Object

此為out參數,需在執行前先配置好,執行後,Obj.InBound=true|false代表是否位於邊緣上。

Returns:
Type Description
boolean 傳回是否位於PolygonSet內。

RemoveAll()

common/geometry/GeoPolygonSet.js, line 150

移除所有的點位資料。

ToGeoBuffer(){Array}

common/geometry/GeoPolygonSet.js, line 716

輸出成緩衝區物件。

Returns:
Type Description
Array 回傳多邊形集合緩衝區陣列。

ToGeoJSON(toString, includeZ){GeoJSON.PolygonSet|string}

common/geometry/GeoPolygonSet.js, line 567

將幾何輸出成GeoJSON物件或字串。

Name Type Default Description
toString boolean

是否把物件轉成JSON字串。

includeZ boolean false

是否包含Z,標準GeoJSON不包含Z(可不給,預設false)。

Returns:
Type Description
GeoJSON.PolygonSet | string 輸出轉換結果。