<< Click to Display Table of Contents >>

SuperGIS Server JavaScript API

 

new sg.geometry.LinearRing()

 

 

Description

建立linearRing 物件

 

Position

Geometry.js

 

 

Properties

 

Properties

Type

Description

extent

sg.geometry.Extent

幾何資料範圍

length

Nmber

線段長度

path

Array.<sg.geometry.Point>

線段路徑點陣列

type

String

幾何資料的類型

 

 

Methods

 

Methods

Type

Description

addPoint(pt)

sg.geometry.Point

加入路徑點

Name

Type

Description

pt

sg.geometry.Point

路徑點

toWkt()

Returns:

String

轉換成wkt字串

Returns:

Type

Description

String

wkt字串

getExtent()

Returns:

sg.geometry.Extent

取得幾何資料範圍

Returns:

Type

Description

sg.geometry.Extent

幾何範圍

getLength()

Returns:

Nmber

取得線的長度

Returns:

Type

Description

Nmber

長度

getMidPoint()

Returns:

sg.geometry.Point

取得線條中點

Returns:

Type

Description

sg.geometry.Point

線條中點

setPath(path)

Array.<sg.geometry.Point>

設定線的路徑

Name

Type

Description

path

Array.<sg.geometry.Point>

路徑點陣列

update()


更新線的屬性

getCentroid()

Returns:

sg.geometry.Point

取得環幾何的重心

Returns:

Type

Description

sg.geometry.Point

重心點

Clone()

Returns:

sg.geometry.LineRing

複製環幾何物件並回傳

Returns:

Type

Description

sg.geometry.LineRing

環幾何物件

transform(a,b,c,d,e,f,g,h,i)

Nmber

透過轉換參數,對線環幾何物件進行座標轉換

Name

Type

Description

a,b,c,d,e,f,g,h,i

Nmber

轉換矩陣元素轉換矩陣M=[[a, b, c], [d, e, f], [g, h, i]]

forEachVertex(callback)

function

透過callback方法,回傳環幾何物件的所有頂點資料

callback(context)

{

  //頂點資料 (sg.geometry.Point)

  Context.point;

  //頂點資料索引值

  Context.pointIndex;

}

getFirstPoint_

Returns:

sg.geometry.Point

取得環幾何物件的第一個點位

Return:

Type

Description

sg.geometry.Point

環幾何物件的第一個點位

 

 

Example

 

 

<script type="text/javascript" src="scripts/Geometry.js"></script>

                         

var ring = new sg.geometry.LinearRing;

ring.path.push(new sg.geometry.Point(1528256, 5628329));

ring.path.push(new sg.geometry.Point(2001868, 5663128));

ring.path.push(new sg.geometry.Point(2174538, 5446056));

ring.path.push(new sg.geometry.Point(1841530, 5458390));

 

 

See live example

 


©2015 Supergeo Technologies Inc.