Reconstruct regular geological features, motion paths or flowlines to a specific geological time.
OpenFileForReadingError if any input file is not readable (when filenames specified)
OpenFileForWritingError if reconstructed_geometries is a filename and it is not writeable
FileFormatNotSupportedError if any input file format (identified by any reconstructable and rotation filename extensions) does not support reading (when filenames specified)
The following optional keyword arguments are supported by output_parameters:
Group reconstructed geometries with their feature.
This can be useful when a feature has more than one geometry and hence more than one reconstructed geometry.
reconstructed_geometries then becomes a list of tuples where each tuple contains a feature and a list of reconstructed geometries.
Only applies when reconstructed_geometries is a list because exported files are always grouped with feature.
Any ReconstructType can be grouped.
Wrap/clip reconstructed geometries to the dateline (currently ignored unless exporting to an ESRI Shapefile format file).
Only applies when exporting to a file (ESRI Shapefile).
Only the features, in reconstructable_features, that match the optional keyword argument reconstruct_type (see output_parameters table) are reconstructed. This also determines the type of reconstructed geometries output in reconstructed_geometries which are either reconstructed feature geometries (default) or reconstructed motion paths or reconstructed flowlines.
The reconstructed_geometries are output in the same order as that of their respective features in reconstructable_features (the order across feature collections is also retained). This happens regardless of whether reconstructable_features and reconstructed_geometries include files or not.
The following export file formats are currently supported by GPlates:
|Export File Format||Filename Extension|
rotation_model can be either a RotationModel or a rotation FeatureCollection or a rotation filename or a sequence (eg, list or tuple) containing rotation FeatureCollection instances or filenames (or a mixture of both). When a RotationModel is not specified then a temporary one is created internally (and hence is less efficient if this function is called multiple times with the same rotation data).
If any filenames are specified then FeatureCollectionFileFormatRegistry is used internally to read feature collections from those files.
Reconstructing a file containing regular reconstructable features to a shapefile at 10Ma:
pygplates.reconstruct('volcanoes.gpml', 'rotations.rot', 'reconstructed_volcanoes_10Ma.shp', 10)
Reconstructing multiple files containing regular reconstructable features to a list of reconstructed feature geometries at 10Ma:
reconstructed_feature_geometries =  pygplates.reconstruct(['continent_ocean_boundaries.gpml', 'isochrons.gpml'], rotation_model, reconstructed_feature_geometries, 10)
reconstructed_features =  pygplates.reconstruct(['continent_ocean_boundaries.gpml', 'isochrons.gpml'], rotation_model, reconstructed_features, 10, group_with_feature=True) for feature, feature_reconstructed_geometries in reconstructed_features: # Note that 'feature' is the same as 'feature_reconstructed_geometry.get_feature()'. for feature_reconstructed_geometry in feature_reconstructed_geometries: ...
Reconstructing a file containing flowline features to a shapefile at 10Ma:
pygplates.reconstruct('flowlines.gpml', rotation_model, 'reconstructed_flowlines_10Ma.shp', 10, reconstruct_type=pygplates.ReconstructType.flowline)
Reconstructing a file containing flowline features to a list of reconstructed flowlines at 10Ma:
reconstructed_flowlines =  pygplates.reconstruct('flowlines.gpml', rotation_model, reconstructed_flowlines, 10, reconstruct_type=pygplates.ReconstructType.flowline)
Reconstructing regular reconstructable features to a shapefile at 10Ma:
pygplates.reconstruct(pygplates.FeatureCollection([feature1, feature2]), rotation_model, 'reconstructed_features_10Ma.shp', 10)
Reconstructing a list of regular reconstructable features to a shapefile at 10Ma:
pygplates.reconstruct([feature1, feature2], rotation_model, 'reconstructed_features_10Ma.shp', 10)
Reconstructing a single regular reconstructable feature to a list of reconstructed feature geometries at 10Ma:
reconstructed_feature_geometries =  pygplates.reconstruct(feature, rotation_model, reconstructed_feature_geometries, 10) # assert(reconstructed_feature_geometries.get_feature().get_feature_id() == feature.get_feature_id())