4.2.7. Perimeter¶
-
class
pyprom.lib.containers.perimeter.Perimeter(pointList=None, pointIndex=None, datamap=None, mapEdge=False, mapEdgePoints=None)[source]¶ Container for
Perimetertype lists. A Perimeter is all points Diagonally or Orthogonally neighboring a member of apyprom.lib.containers.multipoint.MultiPoint-
__getitem__(idx)[source]¶ Gives Perimeter list like get capabilities
- Parameters
idx (int) – index value
- Returns
pyprom.lib.locations.gridpoint.GridPointself.point at idx
-
__init__(pointList=None, pointIndex=None, datamap=None, mapEdge=False, mapEdgePoints=None)[source]¶ - Parameters
pointList (list(tuple(x, y, elevation))) – tuple(x, y, elevation) which make up the Perimeter.
pointIndex (dict({X: { Y: tuple(x, y, elevation)}}) – Members as a dict().
datamap (
pyprom.lib.datamap.DataMapobject.) – datamap which thisPerimeteruses.mapEdge (bool) – is this a map edge?
mapEdgePoints (list(tuple(x, y, ele))) – list of Points (tuple) on the map edge.
-
__setitem__(idx, point)[source]¶ Gives Perimeter list like set capabilities
- Parameters
idx (int) – index value
point (tuple(x, y, elevation)) – GridPoint or tuple for setitem.
-
__str__()¶ - Returns
String representation of this object
-
__unicode__()¶ - Returns
String representation of this object
-
_check_and_return_incoming_point_type(point)[source]¶ Make sure incoming point type is a tuple with length 3, or explicitly a
pyprom.lib.locations.gridpoint.GridPoint- Parameters
point – tuple, or
pyprom.lib.locations.gridpoint.GridPoint- Raises
TypeError if point not of
pyprom.lib.locations.gridpoint.GridPointor tuple- Raises
Exception if tuple length != 3
- Returns
tuple(x, y, elevation)
-
append(point)[source]¶ Add a
pyprom.lib.locations.gridpoint.GridPointor tuple(x, y, elevation) to this container.- Parameters
point (tuple(x, y, elevation)) – GridPoint or tuple to append.
-
findHighEdges(elevation)[source]¶ Finds all points that are higher than passed in elevation and returns them as a list of contiguous point lists
- Returns
list of lists of points containing perimeter member points higher than elevation
- Return type
list(list(tuples)))
-
findHighPerimeter(elevation)[source]¶ This function returns all points higher than the passed in elevation and returns them in a list of tuples
- Parameters
elevation (int, float) –
- Returns
List of points as tuples
- Return type
list(tuple(x, y, elevation))
-
classmethod
from_dict(perimeterDict, datamap=None)[source]¶ Create this object from dictionary representation
- Parameters
perimeterDict (dict) – dict() representation of this object.
datamap (
pyprom.lib.datamap.DataMapobject.) – datamap which this Perimeter uses.
- Returns
a new Perimeter object.
- Return type
-