meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tectonicwaters:gplates_coloring_features_by_absolute_age [2017/01/09 15:59] – created christian | tectonicwaters:gplates_coloring_features_by_absolute_age [2019/08/24 09:06] (current) – Discussion status changed christian | ||
---|---|---|---|
Line 4: | Line 4: | ||
When making reconstructions in [[http:// | When making reconstructions in [[http:// | ||
+ | |||
+ | ===== ===== | ||
This workaround requires to have the '' | This workaround requires to have the '' | ||
Line 10: | Line 12: | ||
- Now, copy the below file '' | - Now, copy the below file '' | ||
- Close GPlates | - Close GPlates | ||
- | - In your GIS application of choice, open the shapefile containing the feature collection which you want to colour and add a new attribute column. As example, I am using [[http:// | + | - In your GIS application of choice, open the shapefile containing the feature collection which you want to colour and add a new attribute column. As example, I am using [[http:// |
- Open GPlates again, load your feature collections | - Open GPlates again, load your feature collections | ||
- In the GPlates Layers window, click on '' | - In the GPlates Layers window, click on '' | ||
- | - Finally, add a '' | + | - Finally, add a '' |
+ | |||
+ | When you now start reconstructing your feature data, the colouring should remain static at any moment in your reconstruction. See this absolute reconstruction sequence for the western Pacific area at 0, 50, 100 and 150 Ma: | ||
+ | |||
+ | {{gallery>: | ||
+ | |||
+ | ==== Update ==== | ||
+ | |||
+ | After [[http:// | ||
+ | |||
+ | <file python AbsoluteAge.py> | ||
+ | ''' | ||
+ | Script sent to gplates-discuss mailinglist by John Cannon on 2017-01-11. | ||
+ | See: http:// | ||
+ | |||
+ | ''' | ||
+ | |||
+ | import pygplates | ||
+ | |||
+ | class AbsoluteAge: | ||
+ | def __init__(self): | ||
+ | pass | ||
+ | |||
+ | def get_style(self, | ||
+ | absolute_age = feature.begin_time() | ||
+ | style.colour = self.cfg[' | ||
+ | |||
+ | def get_config(self): | ||
+ | self.cfg_dict = {} | ||
+ | self.cfg_dict[' | ||
+ | return self.cfg_dict | ||
+ | |||
+ | def set_config(self, | ||
+ | self.cfg = config | ||
+ | |||
+ | |||
+ | def register(): | ||
+ | pygplates.Application().register_draw_style(AbsoluteAge()) | ||
+ | |||
+ | </ | ||
- | When you now start reconstructing your feature data, the colouring should remain static at any moment in your reconstruction. See here: | + | ==== Color by property ==== |
- | {{gallery>: | + | Copy the file below into your GPlates user script directory. |
- | {{gallery>: | + | |
- | {{gallery>: | + | |
- | {{gallery>: | + | |
<file python ColorByProperty.py> | <file python ColorByProperty.py> | ||
Line 75: | Line 114: | ||
</ | </ | ||
- | {{tag> GPlates features colour "plate tectonics" | + | {{tag> GPlates features colour "plate tectonics" |
- | ~~DISCUSSION~~ | + | ~~DISCUSSION:closed~~ |