libpysal.cg.Polygon(vertices, holes=None)[source]¶Geometric representation of polygon objects.
verticeslistReturns the vertices of the polygon in clockwise order.
lenintReturns the number of vertices in the polygon.
perimeterfloatReturns the perimeter of the polygon.
bounding_boxRectangleReturns the bounding box of the polygon.
bboxListReturns the bounding box of the polygon as a list
areafloatReturns the area of the polygon.
centroidtupleReturns 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. |