libpysal.cg.
Chain
(vertices)[source]¶Geometric representation of a chain, also known as a polyline.
__init__
(self, vertices)[source]¶Returns a chain created from the points specified.
__init__(Point list or list of Point lists) -> Chain
Examples
>>> c = Chain([Point((0, 0)), Point((1, 0)), Point((1, 1)), Point((2, 1))])
Methods
|
Returns a chain created from the points specified. |
Attributes
Returns the geometric length of the chain computed using arcdistance (meters). |
|
Returns the bounding box of the chain. |
|
Returns the geometric length of the chain. |
|
Returns the parts of the chain. |
|
Returns the segments that compose the Chain |
|
Returns the vertices of the chain in clockwise order. |
arclen
¶Returns the geometric length of the chain computed using arcdistance (meters).
len -> number
bounding_box
¶Returns the bounding box of the chain.
bounding_box -> Rectangle
Examples
>>> c = Chain([Point((0, 0)), Point((2, 0)), Point((2, 1)), Point((0, 1))])
>>> c.bounding_box.left
0.0
>>> c.bounding_box.lower
0.0
>>> c.bounding_box.right
2.0
>>> c.bounding_box.upper
1.0
len
¶Returns the geometric length of the chain.
len -> number
Examples
>>> c = Chain([Point((0, 0)), Point((1, 0)), Point((1, 1)), Point((2, 1))])
>>> c.len
3.0
>>> c = Chain([[Point((0, 0)), Point((1, 0)), Point((1, 1))],[Point((10,10)),Point((11,10)),Point((11,11))]])
>>> c.len
4.0
parts
¶Returns the parts of the chain.
parts -> Point list
Examples
>>> c = Chain([[Point((0, 0)), Point((1, 0)), Point((1, 1)), Point((0, 1))],[Point((2,1)),Point((2,2)),Point((1,2)),Point((1,1))]])
>>> len(c.parts)
2
segments
¶Returns the segments that compose the Chain
vertices
¶Returns the vertices of the chain in clockwise order.
vertices -> Point list
Examples
>>> c = Chain([Point((0, 0)), Point((1, 0)), Point((1, 1)), Point((2, 1))])
>>> verts = c.vertices
>>> len(verts)
4