4.2.4. GridPointContainer

class pyprom.lib.containers.gridpoint.GridPointContainer(gridPointList)[source]

GridPoint Container for GridPoint type lists. Storage and functions for pyprom.lib.locations.gridpoint.GridPoint

__init__(gridPointList)[source]
Parameters

gridPointList (list(pyprom.lib.locations.gridpoint.GridPoint)) – list of GridPoints

Raises

TypeError when gridPointList contains non pyprom.lib.locations.gridpoint.GridPoint

__repr__()[source]
Returns

String representation of this object

__str__()
Returns

String representation of this object

__unicode__()
Returns

String representation of this object

append(gridPoint)[source]

Append a pyprom.lib.locations.gridpoint.GridPoint to the container.

Parameters

gridPoint (pyprom.lib.locations.gridpoint.GridPoint) – GridPoint to append

Raises

TypeError if gridPoint not of pyprom.lib.locations.gridpoint.GridPoint

findClosestPoints(otherGridpointContainer)[source]

Calculates and returns The the two closest pyprom.lib.locations.gridpoint.GridPoint objects from this GridPointContainer and otherGridpointContainer and their distance.

Parameters

otherGridpointContainer – The other GridPointContainer to compare against.

Returns

This GridPointContainer and other GridPointContainer closest pyprom.lib.locations.gridpoint.GridPoint, and distance between them.

Return type

pyprom.lib.locations.gridpoint.GridPoint, pyprom.lib.locations.gridpoint.GridPoint, float

findPseudoSummits()[source]
Similiar in concept to finding summits and multipoint blobs,
but smaller in scope.

Essentially this returns locally scoped Summit points, that is,
anything that meets the effective definition of a summit with all
the available data in a GridPointContainer.
This is intended for use for finding high portions along an edge like:
[1][2][3][2][2][3][4][4][3][2]
`` ^ ^^^^``
`` PSEUDO SUMMITS (simple 1D example)``
No distinction is made between the pseudo summits. This is becasue
these points are used as a jumping off point for Saddle -> Summit
walks.
classmethod from_dict(gpcDict)[source]

Create this object from dictionary representation

Parameters

gpcDict (dict) – dict representation of GridPointContainer

Returns

a new GridPointContainer

Return type

GridPointContainer

genFastLookup()[source]

Generates a fast lookup hash of all GridPoints in this container in the format of: {x: {y: pyprom.lib.locations.gridpoint.GridPoint}}

property highest
Returns

list of highest GridPoint objects found in this container

Return type

list(pyprom.lib.locations.gridpoint.GridPoint)

iterNeighborFull(point)[source]

Iterate through existing diagonal/orthogonal pyprom.lib.locations.gridpoint.GridPoint neighbors found in this GridPointContainer.

Parameters

point (pyprom.lib.locations.gridpoint.GridPoint) – gridpoint to find neighbors of.

Return type

pyprom.lib.locations.gridpoint.GridPoint

iterNeighborOrthogonal(point)[source]

Iterate through existing orthogonal pyprom.lib.locations.gridpoint.GridPoint neighbors found in this GridPointContainer.

Parameters

point (pyprom.lib.locations.gridpoint.GridPoint) – gridpoint to find neighbors of.

Return type

pyprom.lib.locations.gridpoint.GridPoint

property lowest
Returns

list of lowest GridPoint objects found in this container

Return type

list(pyprom.lib.locations.gridpoint.GridPoint)

to_dict()[source]

Create the dictionary representation of this object.

Returns

dict() representation of GridPointContainer

Return type

dict()

to_tuples()[source]
Returns

GridPointContainer members as a list of (x, y, elevation) tuples.