pygplates.FeatureId

class pygplates.FeatureId

Bases: instance

A feature ID acts as a persistent unique identifier for a feature.

Feature IDs are equality (==, !=) comparable and hashable (can be used as a key in a dict).

The format of a feature ID is ‘GPlates-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’ where each x is a hexadecimal digit (0-9, a-f).

A FeatureId can also be pickled.

Changed in version 0.42: Added pickle support.

__init__()

You cannot directly instantiate this class from Python.

Note

This constructor is only provided for pickle support.

Methods

__init__

You cannot directly instantiate this class from Python.

create_unique_id()

[staticmethod] Create a unique FeatureId by generating a unique string identifier.

get_string()

Returns the feature identifier as a string.

static create_unique_id()

[staticmethod] Create a unique FeatureId by generating a unique string identifier.

Return type:

FeatureId

feature_id = pygplates.FeatureId.create_unique_id()

Note

You cannot generate a feature ID using a specific string - it must be randomly generated. You can however compare an existing feature ID with a specific string - see get_string().

get_string()

Returns the feature identifier as a string.

Return type:

string

To determine if a feature has a particular feature ID:

if feature.get_feature_id().get_string() == 'GPlates-63b81b91-b7a0-4ad7-908d-16db3c70e6ed':
  ...