I’m putting this in the Worldbuilding section because I’m using this for worldbuilding purposes, and can’t think of a real-world reconstruction project where someone would make many features with the wrong age data, but I suppose it’s not strictly a worldbuilding question.
Is there a way to batch edit the ages of all features within a project or feature collection? I realized that, with no “negative” ages, I left myself very little breathing room in my project and have maybe 40-50 date-specified features, and it would be tedious (not to mention easy to mess up) to individually backdate every feature using the edit tool. I’d rather not start from scratch either, but probably will if there’s no straightforward solution.
To clarify, the animation starts at a reconstruction time of 1000Mya, and I want to change the dates of everything such that the animation starts at 2500Mya, making every feature in the project have a new date of n+1500Mya.
A small pyGPlates script might be the easiest (I haven’t tested this though):
import pygplates
filenames = [ 'file1.gpml', 'file2.gpml' ]
for filename in filenames:
# Read file into features.
feature_collection = pygplates.FeatureCollection(filename)
# Add 1500 to feature begin times.
for feature in feature_collection:
begin_time, end_time = feature.get_valid_time()
begin_time += 1500
feature.set_valid_time(begin_time, end_time)
# Write modified features back out to the same file.
feature_collection.write(filename)
After much headscratching because I did not realize the python environment in GPlates is not fully implemented, I can confirm that this works! Time to do this on the rest of my feature collections and stop fretting about the timeline so much. Thank you!
Ah yes, sorry, I should’ve mentioned that. The internal model was changed quite significantly to support an external pyGPlates library (ie, outside of GPlates). But those model changes need to be integrated into GPlates itself, which is non-trivial due to things like undo-redo. One day when I have some time I will do that.