Module gplately.ptt.cleanup_topologies

Clean up topologies

including:
- Removing any regular features not referenced by topologies.
- Restricting the time periods of referenced features to match the referencing topologies.

Functions

def remove_features_not_referenced_by_topologies(feature_collections, restrict_referenced_feature_time_periods=False, removed_features_collections=None)

Remove any regular features not referenced by topological features.

The results are returned as a list of pygplates.FeatureCollection (one per input feature collection).

The input feature collections should contain the topological and regular features that make up the topological model. Ensure you at least specify all topological features in the topological model, otherwise regular features referenced by the missing topologies will get removed.

Parameters

feature_collections : sequence of (str, or sequence of pygplates.Feature, or pygplates.FeatureCollection, or pygplates.Feature)
A sequence of feature collections containing both the topological features and the regular features they reference. Each collection in the sequence can be a filename, or a sequence (eg, list of tuple) or features, or a feature collection, or even a single feature.
restrict_referenced_feature_time_periods : bool
Whether to restrict the time periods of features referenced by topologies such that they are limited by the time periods of the referencing topologies.
removed_features_collections : list
If an empty list is provided then it will be filled with one feature collection for each input feature collection. And each of these will contain any removed features.

Returns

list of pygplates.FeatureCollection
The (potentially) modified feature collections. Returned list is same length as feature_collections.