libpysal.cg.
Polygon
(vertices, holes=None)[source]¶Geometric representation of polygon objects.
vertices
listReturns the vertices of the polygon in clockwise order.
len
intReturns the number of vertices in the polygon.
perimeter
floatReturns the perimeter of the polygon.
bounding_box
RectangleReturns the bounding box of the polygon.
bbox
ListReturns the bounding box of the polygon as a list
area
floatReturns the area of the polygon.
centroid
tupleReturns the centroid of the polygon
Methods
|
Build the quad tree structure for this polygon. |
|
Test if polygon contains point |
__init__
(self, vertices, holes=None)[source]¶Returns a polygon created from the objects specified.
__init__(Point list or list of Point lists, holes list ) -> Polygon
: bool – record if the quad tree structure has been built for this polygon. This quad tree structure could help speed up the contains_point test
Examples
>>> p1 = Polygon([Point((0, 0)), Point((1, 0)), Point((1, 1)), Point((0, 1))])
Methods
|
Returns a polygon created from the objects specified. |
|
Build the quad tree structure for this polygon. |
|
Test if polygon contains point |
Attributes
|
Returns the area of the polygon. |
|
Returns the bounding box of the polygon as a list |
|
Returns the bounding box of the polygon. |
|
Returns the centroid of the polygon |
|
Returns the holes of the polygon in clockwise order. |
|
Returns the number of vertices in the polygon. |
|
Returns the parts of the polygon in clockwise order. |
|
Returns the perimeter of the polygon. |
|
Returns the vertices of the polygon in clockwise order. |