I am trying to assign colours by the gpml:averageAge property in both shape files and VGPs, however I am not having much luck. I have made a cpt file with the age ranges I would like, however when I open the Draw Style menu and try to create a new ColourByProperty configuration with this file and the property name gpml:averageAge, everything becomes coloured black. Does anyone know how to make this work? (Also please note I have already made my own cpt file for colouring by PlateID and it works).
Thank you very much for your reply. That sample CPT file has worked for me before, however now my reconstruction is not colouring at all. Even the sample colouring schemes which I have not touched appear the same. This has happened before, but the only way I could find to fix it was make a new project and re-load all 80 of my layers into it. (See screenshot below). I don’t know why this happens, but maybe it has something to do with the colouring not working? (The colouring problem was happening before this new problem occurred). I have also attached a screenshot of my CPT file I would like to use (the file its self won’t upload unless it is an image).
there are differences how the attributes are mapped in SHP and GPML files. Depending on how you have captured the gpml:AverageAge in the shapefile attributes, you might have to use a different attribute name. GPlates in general encapsulates the shapefile attributes as gpml:shapefileAttributes:YourAttributeName. So even if your shapefile has an attribute called FromAge and GPlates has mapped it directly to the ValidTime from values you can query in the main window, you will still have to point the ColorByAttributes part to the gpml:shapefileAttributes:FromAge (This is a bad example as it might be different in the age/plateID assignment cases, but I am fairly certain that this is true for most of the other attributes - @john.cannon pls correct me if this is wrong).
So this means that for the GPML files you should be able to directly access an attribute such as your gpml:averageAge by using that attribute name in the ColorByProperty script with your CPT, whereas in the shapefile case you might have to use gpml:shapefileAttributes:averageAge (or whatever your gpml:averageAge attribute is called in your shapefile).
Ah yes, great point! I was using a GPML file (the VGPs that come with the GPlates sample data), so I was accessing the gpml:averageAge property that’s stored directly in the GPML file. As Christian noted, Shapefiles cannot directly store GPlates properties so instead the Shapefile attributes are mapped into GPlates properties. If your Shapefile does not map any attributes to gpml:averageAge then putting gpml:averageAge in the property_name field won’t work. The default Shapefile mapping doesn’t do this, so Christian’s suggestion of specifying the Shapefile attribute in the property_name field is the way to go (eg, gpml:shapefileAttributes:averageAge if your attribute is called averageAge).
That’s true. Most of the time you have to use gpml:shapefileAttributes:<attribute-name>. The cases where you can use gpml:<property-name> are typically when using a GPML file and when the GPlates property is a single number (eg, gpml:averageAge) - some GPlates properties are more complex (eg, gpml:validTime which is actually two numbers, the begin and end times) and cannot currently be accessed in the colouring dialog (eg, as gpml:validTime.begin).
Thanks, your CPT file is fine. I believe the issue is due to the point Christian made above.
That is odd. I would not expect all the ColorByProperty configurations to produce the exact same colours unless they all have the same property_name (and same palette). I’m assuming you’re using GPlates 2.2. And it sounds like you’re loading a project file (rather than a recent session). Does this only happen when the project is loaded? In other words, if you unload the project (File > Clear Session) and then load some features, or if you simply load another project, does it still happen?
Am I able to colour both Shapefiles and GPML files with one colour scheme? Or can I only specify colours for one file type at a time? As I have both Shapefiles and GPML files displayed, might this be the problem? I only really care about the colouring of the VGPs for now, but it would be nice to be able to specify colours for both VGPs and Shapefiles.
As for the ColorByPropery configurations producing the same colours, I have different palettes loaded for all the different colouring schemes. When I unload he project and load just the VGP’s, all the colouring works except for the ColorByProperty features (they make all the VGP’s appear black). When I re-load the palette for the AverageAge configuration, it turns all the VGPs grey (they all have different average ages in different age ranges). Loading other projects seems to re-set the colouring as well, but again the ColorByProperty still doesn’t work properly.
I don’t think that this will work because the GPML files use gpml:averageAge as attribute for the colouring whereas the SHP file uses gpml:shapefileAttributes:averageAge. So my suggestion would be to generate two configurations using the same cpt file but differing in the attribute name: one for the GPML files, one for the SHP files where you specify the relevant attributes you want to color. Or you convert the files to one filetype - GPML or SHP. You can do a save as using GPlates’ Feature Manager (
Is this for the SHP or GPML or both?
I struggle to follow your steps in the last paragraph, I’d suggest to start with a fresh session, make sure your coloring works with, both, GPML and SHP, and then add the remaining files. Also make sure that the attribute structure in the SHP files is all the same. Again, there are cases where it might be useful to merge the files to make file handling easier.
AFAIK, the coloring configs should be persistent between sessions.
It would be good to first get your VGPs coloured properly. Which I think they are now (except for maybe not yet working across GPML and SHP, which Christian’s suggestion should help that).
And then we can see if there’s still a problem loading/saving project files - where we will need to figure out what steps result in all ColorByProperty configurations producing the same colours (because that would probably be a bug in the loading/saving of colouring state in the project file).
Thank you! I have started a new session, and only added in my GPML VGP files. All colouring types seem to work, except my averageAge ColorByProperty configuration. This uses the CPT file I posted above, and all VGPs are grey. I have checked and all VGPs have different averageAge values, so I am still not quite sure why it isn’t working.
I’ve quickly checked the ColourByProperty styling using the GPlates sample data VGP and CPT files (the same CPT you pasted as screenshot) and all seems to work fine, the VGPs change colour as expected. Not sure what’s going on at your end that this doesn’t work as expected - maybe you could try again, step-by-step using the GPlates sample data files. One issue I could think of which the colouring doesn’t work as expected is that your averageAge is outside the range of what is specified in the CPT.
I re-did the tutorial, and it worked fine. I checked, and my average ages are all within the ranges specified.
Regarding the problem where all the colouring stopped working and I had to create a new project file, I have discovered that it occurs when I have my project open along with the Draw Style menu, and am changing a CPT file at the same time.
Another question, can I specify ages which are more than three digits long in a CPT file? ie: 1000 Ma instead of 100 Ma?