API Documentation | All Packages | All Classes | Index | Frames No Frames |
Class LinearRing

Package | org.openscales.core.geometry
Class | public class LinearRing
Inheritance | LinearRing LineString MultiPoint Collection Geometry

A Linear Ring is a special LineString which is closed. It closes itself automatically on every addPoint/removePoint by adding a copy of the first point as the last point. Also, as it is the first in the line family to close itself, an area getter is defined to calculate the enclosed area of the linearRing.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined by
--- | --- | ---
|  | area : Number [read-only] Calculate the approximate area enclosed by this LinearRing (the projection and the geodesic are not managed). | LinearRing
|  | bounds : Bounds | Geometry
|  | components : Array Setter of the components (children) of this collection. | Collection
|  | componentsLength : int Number of components in the collection | Collection
|  | componentsString : String Get a string representing the components for this collection | Collection
|  | componentTypes : Array Getter and setter of the authorized types for the components (children) of this collection | Collection
|  | id : String | Geometry
|  | length : Number Length getter which iterates through the vertices summing the distances of each edges. | LineString
|  | parent : Geometry | Geometry

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined by
--- | --- | ---
|  | _bounds : Bounds = null The bounds of this geometry | Geometry

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined by
--- | --- | ---
|  | LinearRing(points:Array = null) | LinearRing
|  | addComponent(point:Geometry, index:Number):Boolean | LinearRing
|  | addComponents(vertices:Array):void Add vertices to the end of the LineString | LineString
|  | addPoint(point:Point, index:Number):void Component of the specified index, casted to the Point type | MultiPoint
|  | atPoint(lonlat:LonLat, toleranceLon:Number, toleranceLat:Number):Boolean Determines if the feature is placed at the given point with a certain tolerance (or not). | Geometry
|  | calculateBounds():void Recalculate the bounds by iterating through the components and calling extendBounds() on each item. | Collection
|  | clearBounds():void Clear the geometry's bounds | Geometry
|  | clone():Geometry To get this geometry clone | LinearRing
|  | componentByIndex(i:int):Geometry Component of the specified index, casted to the Geometry type | Collection
|  | contains(geom:Geometry, assertIntersection:Boolean = false):Boolean Determine if the input geometry is fully contained in this one. | Geometry
|  | containsMultiPoint(mp:MultiPoint):Boolean Test if a MultiPoint (and so a LineString or a LinearRing) is inside a linear ring or not. | LinearRing
|  | containsPoint(p:Point):Boolean Test if a point is inside a linear ring. | LinearRing
|  | destroy():void Destroy the collection. | Collection
|  | distanceTo(geom:Geometry):Number Calculate the closest distance between two geometries (on the x-y plane). | Geometry
|  | extendBounds(newBounds:Bounds):void Extends geometry's bounds If bounds are not defined yet, it initializes the bounds. | Geometry
|  | getcomponentsClone():Array TO get component clone | Collection
|  | getLastPoint():Point | LineString
|  | getPointAt(index:Number):Point | LineString
|  | intersects(geom:Geometry):Boolean Test for instersection between this LinearRing and a geometry. | LinearRing
|  | isLeftOrRight(p:Point, p0:Point, p1:Point):Number [static] Test if a point is at the left, at the right or on an infinite line. | Geometry
|  | removeComponent(vertex:Geometry):void Remove a vertex of the LineString. | LineString
|  | removeComponents(components:Array):void Remove components from this geometry. | Collection
|  | removePoint(point:Point):void | MultiPoint
|  | replaceComponent(index:int, component:Geometry):Boolean replace the component of specified index by the input geometry. | Collection
|  | segmentsIntersect(seg1:Array, seg2:Array, tolerance:Number = 0.0):Boolean [static] Determine whether two line segments intersect or not. | Geometry
|  | toShortString():String | MultiPoint
|  | toVertices():Array Return an array of all the vertices (Point) of this geometry | Collection
|  | transform(source:ProjProjection, dest:ProjProjection):void Method to convert the multipoint (x/y) from a projection system to an other. | MultiPoint
|  | transformLineString(source:ProjProjection, dest:ProjProjection):void Method to convert the multipoint (x/y) from a projection system to an other. | LineString

Property detail

area | property

`area:Number` [read-only]

Calculate the approximate area enclosed by this LinearRing (the projection and the geodesic are not managed). The auto-intersection of edges of the LinearRing is not managed yet.

Implementation
`public function get area():Number`
Constructor detail

LinearRing | () | constructor

`public function LinearRing(points:Array = null)`Parameters

| `points:Array` (default = `null`)``

Method detail

addComponent | () | method

`public override function addComponent(point:Geometry, index:Number):Boolean` Parameters

| `point:Geometry`
| `index:Number`

Returns

| `Boolean`

clone | () | method |

`public override function clone():Geometry`

To get this geometry clone

Returns

| `Geometry`

containsMultiPoint | () | method |

`public function containsMultiPoint(mp:MultiPoint):Boolean`

Test if a MultiPoint (and so a LineString or a LinearRing) is inside a linear ring or not.

Parameters

| `mp:MultiPoint`

Returns

| `Boolean`

containsPoint | () | method |

`public override function containsPoint(p:Point):Boolean`

Test if a point is inside a linear ring. Two major methods are used for this test : "crossing number" or "winding number". There are both discussed at http://softsurfer.com/Archive/algorithm_0103/algorithm_0103.htm This function is an implementation of the "winding number" algorithm that uses the Geometry.isLeftOrRigh function.

Parameters

| `p:Point` — the point to test

Returns

| `Boolean` — a boolean defining if the point is inside or outside this geometry

intersects | () | method |

`public override function intersects(geom:Geometry):Boolean`

Test for instersection between this LinearRing and a geometry.

Parameters

| `geom:Geometry` — the geometry (of any type) to intersect with

Returns

| `Boolean` — a boolean defining if an intersection exist or not