colawater.lib.layer#

Functions for working with layers.

Examples

path = path(layer) # Returns "path/to/layer".
workspace = workspace(layer) # Returns "path/to/workspace.
                             # This is the same as the value in ``path``,
                             # but without the layer name.

kind = kind(layer)
if kind == LayerKind.Casing:
    do_something()
Note:

Layer names include the groups of which they are a part. Nested groups appear in parent-child order. E.g., layer “foo” in subgroup “bar” in group “baz” has a layer name of “bazbarfoo”

Module Contents#

Classes#

LayerKind

Enumerates layer variants with a payload containing their affix template and parameter index.

Functions#

name(→ str)

Returns the layer's base name.

path(→ str)

Returns the absolute path to a layer.

workspace(→ str)

Returns the absolute path to a layer's workspace.

kind(→ Optional[LayerKind])

Returns the type of a layer

colawater.lib.layer.name(layer: arcpy._mp.Layer) str#

Returns the layer’s base name.

Parameters:

layer (arcpy._mp.Layer) – A layer object.

Returns:

The layer’s name.

Return type:

str

colawater.lib.layer.path(layer: arcpy._mp.Layer) str#

Returns the absolute path to a layer.

Parameters:

layer (arcpy._mp.Layer) – A layer object.

Returns:

The absolute path to the layer.

Return type:

str

colawater.lib.layer.workspace(layer: arcpy._mp.Layer) str#

Returns the absolute path to a layer’s workspace.

Parameters:

layer (arcpy._mp.Layer) – A layer object.

Returns:

The absolute path to the layer’s workspace.

Return type:

str

class colawater.lib.layer.LayerKind#

Bases: enum.Enum

Enumerates layer variants with a payload containing their affix template and parameter index.

Use the parameter index with a contiguous slice into the relevant part of your parameter list that contains the layer kinds in alphabetical order.

Casing#
ControlValve#
Fitting#
Hydrant#
ServiceLine#
Structure#
SystemValve#
WaterMain#
colawater.lib.layer.kind(layer: arcpy._mp.Layer) LayerKind | None#

Returns the type of a layer

Parameters:

layer (arcpy._mp.Layer) – A layer object.

Returns:

The kind of layer.

Return type:

LayerKind