source: trunk/docs/api/zoo-geometry-polygon.txt @ 437

Last change on this file since 437 was 348, checked in by neteler, 13 years ago

set correctly svn propset

  • Property svn:eol-style set to native
  • Property svn:keywords set to HeadURL Date Author Id Rev
  • Property svn:mime-type set to text/plain
File size: 2.4 KB
Line 
1.. _api-zoo-geometry-polygon:
2
3ZOO.Geometry.Polygon
4====================
5
6Polygon is a collection of :ref:`ZOO.Geometry.LinearRing <api-zoo-geometry-linearring>`.
7
8Inherits from
9
10- :ref:`ZOO.Geometry.Collection <api-zoo-geometry-collection>`
11
12Functions       
13---------
14
15.. list-table::
16   :widths: 15 50
17   :header-rows: 1
18
19   * - NAME
20     - DESCRIPTION   
21   * - :ref:`ZOO.Geometry.Polygon <ZOO.Geometry.Polygon>`
22     - Constructor for a Polygon geometry.   
23   * - :ref:`getArea <getArea>`
24     - Calculated by subtracting the areas of the internal holes from the area of the outer hole. 
25   * - :ref:`containsPoint <containsPoint>`
26     - Test if a point is inside a polygon. 
27   * - :ref:`createRegularPolygon <createRegularPolygon>`
28     - Create a regular polygon around a radius.       
29     
30.. _ZOO.Geometry.Polygon:
31
32ZOO.Geometry.Polygon   
33  Constructor for a Polygon geometry.  The first ring (*this.component[0]*) is the outer
34  bounds of the polygon and all subsequent rings (*this.component[1-n]*) are internal holes.
35
36  *Parameters*
37 
38  ``components`` {Array(:ref:`ZOO.Geometry.LinearRing <api-zoo-geometry-linearring>`)} 
39
40.. _getArea: 
41 
42getArea
43  ::
44 
45    getArea: function()
46
47  Calculated by subtracting the areas of the internal holes from the area of the outer hole.
48
49  *Returns*
50
51  ``{float}`` The area of the geometry 
52 
53.. _containsPoint:   
54 
55containsPoint   
56  ::
57 
58    containsPoint: function(point)
59
60  Test if a point is inside a polygon.  Points on a polygon edge are considered inside.
61
62  *Parameters*
63 
64  ``point`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>`
65
66  *Returns*
67
68  ``{Boolean | Number}`` The point is inside the polygon.  Returns 1 if the point is on an edge.  Returns boolean otherwise. 
69
70.. _createRegularPolygon:     
71 
72createRegularPolygon   
73  ::
74 
75    ZOO.Geometry.Polygon.createRegularPolygon = function( origin,
76                                                          radius,
77                                                          sides,
78                                                          rotation      )
79
80  Create a regular polygon around a radius.  Useful for creating circles and the like.
81
82  *Parameters*
83 
84  | ``origin`` :ref:`{ZOO.Geometry.Point} <api-zoo-geometry-point>` center of polygon.
85  | ``radius {Float}`` distance to vertex, in map units.
86  | ``sides {Integer}`` Number of sides.  20 approximates a circle.
87  | ``rotation {Float}`` original angle of rotation, in degrees.
Note: See TracBrowser for help on using the repository browser.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png