4.2.6. MultiPoint

class pyprom.lib.containers.multipoint.MultiPoint(points, elevation, datamap, perimeter=None)[source]
A MultiPoint Container. This is a special kind of feature which contains
multiple :class:`pyprom.lib.locations.base_gridpoint.BaseGridPoint`s.
These points are all of equal elevation and neighbor each other
Orthogonally or Diagonally.

[4][3][4][6][4]
[3][5][5][5][6]
[2][3][5][6][3]
[3][5][4][3]
[6][7][6]

In the above example, all [5] points represent a valid MultiPoint.
All non [5] points are Perimeter Points, that is, they neighbor
MultiPoint members Diagonally or Orthogonally.

[5][5][5]
[5]   <- Without Perimeter
[5]


[4][3][4][6][4]
[3]         [6] <- Just the Perimeter.
[2][3]   [6][3]
[3]   [4][3]
[6][7][6]
__eq__(other)[source]

Determines if this object is equal to another.

Parameters

other – other MultiPoint to check.

Type

MultiPoint

Returns

equality

Return type

bool

Raises

TypeError if other not of MultiPoint

__getitem__(idx)[source]

Gives MultiPoint list like get capabilities

Parameters

idx (int) – index value

Returns

pyprom.lib.locations.base_gridpoint.BaseGridPoint self.point at idx

__init__(points, elevation, datamap, perimeter=None)[source]
Parameters
__iter__()[source]
Returns

self.points as iterator

__len__()[source]
Returns

number of items in self.points

Return type

int

__ne__(other)[source]

Determines if this object is not equal to another.

Parameters

other – other MultiPoint to check.

Type

MultiPoint

Returns

inequality

Return type

bool

Raises

TypeError if other not of MultiPoint

__repr__()[source]
Returns

String representation of this object

__setitem__(idx, point)[source]

Gives MultiPoint list like set capabilities

Parameters
  • idx (int) – index value

  • point (tuple()) – BaseGridPoint or tuple for setitem.

__str__()
Returns

String representation of this object

__unicode__()
Returns

String representation of this object

__weakref__

list of weak references to the object (if defined)

_check_and_return_incoming_point_type(point)[source]

Make sure incoming point type is a tuple with length 2, or explicitly a pyprom.lib.locations.base_gridpoint.BaseGridPoint

Parameters

point – tuple, or :class:`pyprom.lib.locations.base_gridpoint.BaseGridPoint

Raises

TypeError if point not of pyprom.lib.locations.base_gridpoint.BaseGridPoint or tuple

Raises

Exception if tuple length != 2

Returns

tuple(x,y)

append(point)[source]

Add a BaseGridPoint to this container.

Parameters

point (tuple) – BaseGridPoint or tuple to add.

Raises

TypeError if point not of BaseGridPoint or tuple

Raises

Exception if tuple length != 2

closestPoint(gridPoint, asSpotElevation=False)[source]

Returns the closest point in this container to the GridPoint passed in.

Parameters
Returns

GridPoint if asSpotElevation == False SpotElevation if asSpotElevation == True

:rtype pyprom.lib.locations.gridpoint.GridPoint,

pyprom.lib.locations.spot_elevation.SpotElevation

classmethod from_dict(multipointDict, datamap=None)[source]

Create this object from dictionary representation

Parameters
Returns

a new Multipoint.

Return type

MultiPoint

property pointsLatLong

Returns list() of Container pyprom.lib.locations.base_gridpoint.BaseGridPoint as pyprom.lib.locations.base_coordinate.BaseCoordinate

Returns

List of All blob points with lat/long instead of x/y

Return type

list(pyprom.lib.locations.base_coordinate.BaseCoordinate)

points_with_elevation()[source]

Returns list of tuples of member points with (x, y, elevation)

Returns

list(tuple(x, y, ele)))

to_dict()[source]

Create the dictionary representation of this object.

Returns

dict() representation of MultiPoint

Return type

dict()