pygplates.FeatureId¶
-
class
pygplates.
FeatureId
¶ Bases:
Boost.Python.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 adict
).The format of a feature ID is ‘GPlates-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx’ where each x is a hexadecimal digit (0-9, a-f).
-
__init__
()¶ Raises an exception This class cannot be instantiated from Python
Methods
__init__
Raises an exception This class cannot be instantiated 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': ...
-