4.2.5. Linker¶
-
class
pyprom.lib.containers.linker.Linker(summit, saddle, id=None)[source]¶ A Linker links one single
pyprom.lib.locations.summit.Summitwith one singlepyprom.lib.locations.saddle.Saddle-
__hash__()[source]¶ Produces the hash representation of this object.
- Returns
Hash representation of this object
- Return type
str
-
__init__(summit, saddle, id=None)[source]¶ - Parameters
summit (
pyprom.lib.locations.summit.Summit) – Summit this linker links.saddle (
pyprom.lib.locations.saddle.Saddle) – Saddle this linker links.id (str) – id for this object.
-
__str__()¶ - Returns
String representation of this object
-
__unicode__()¶ - Returns
String representation of this object
-
__weakref__¶ list of weak references to the object (if defined)
-
_help_exclude_self(linker, excludeSelf)[source]¶ Determine if this
Linkeris to be included in list.- Parameters
linker –
LinkerexcludeSelf (bool) – exclude self from results.
- Returns
If this linker is to be included in a list.
- Return type
bool
-
add_to_remote_saddle_and_summit(ignoreDuplicates=True)[source]¶ Safely adds this linker to the remote
pyprom.lib.locations.saddle.Saddleandpyprom.lib.locations.summit.Summit- Parameters
ignoreDuplicates (bool) – if True, will not add self to feature if already present.
-
classmethod
from_dict(linkerDict, saddlesContainer, summitsContainer)[source]¶ Create this object from dictionary representation
- Returns
a new Linker
- Return type
-
linkers_to_saddles_connected_via_summit(excludeSelf=True, skipDisqualified=True)[source]¶ Returns linkers linking Saddles to the Summit this linker links.
- Parameters
exclude (bool) – exclude this linker from results.
skipDisqualified (bool) – If true, do not return disqualified linkers
- Returns
list of linkers to saddles connected to the summit this linker links
- Return type
list(
Linker)
-
linkers_to_summits_connected_via_saddle(excludeSelf=True, skipDisqualified=True)[source]¶ Returns linkers linking Summits to the Saddle this linker links.
- Parameters
exclude (bool) – exclude this linker from results.
skipDisqualified (bool) – If true, do not return disqualified linkers
- Returns
list of linkers to summits connected to the saddle this linker links
- Return type
list(
Linker)
-
property
prom¶ Calculates how much higher the summit is than the Saddle in meters
- Returns
altitude difference between saddle and summit in meters.
- Return type
float, int
-
property
prom_ft¶ Calculates how much higher the summit is than the Saddle in feet
- Returns
altitude difference between saddle and summit in feet.
- Return type
float, int
-
saddles_connected_via_summit(skipDisqualified=True, exemptLinkers={})[source]¶ Returns all saddles connected to the
pyprom.lib.locations.summit.Summitthat thisLinkerlinks.- Parameters
skipDisqualified (bool) – If true, disregard disqualified remote linkers.
exemptLinkers (dict(linker.id: bool)) – hash of linkers regarded as dead.
- Returns
list of Saddles
:rtype list(
pyprom.lib.locations.saddle.Saddle)
-
property
shape¶ - Returns a line representation of this linker as a
shapely.geometry.LinestringThis does not include the summit or saddle, just the line connecting them.
- Returns
shapely.geometry.Linestring
-
summits_connected_via_saddle(skipDisqualified=True, exemptLinkers={})[source]¶ Returns all summits connected to the
pyprom.lib.locations.saddle.Saddlethat thisLinkerlinks.- Parameters
skipDisqualified (bool) – If true, disregard disqualified remote linkers.
exemptLinkers (dict(linker.id: bool)) – hash of linkers regarded as dead.
- Returns
list of Summits
- Return type
-