ColorByProperty draw style not applying colours to shapefile layer in GPlates 2.5.0

Hello,

I am using GPlates 2.5.0 on Windows and I am trying to apply colours to a shapefile layer using the ColorByProperty draw style, but the colours are not being applied to the map.

My setup:

  • Layer: a polygon shapefile (MAA_PJM1997_pGEOG.shp)
  • The shapefile has an attribute field called “ID” with discrete integer values: 10, 20, 30, 40 and 333
  • I created a CPT file with the following content:

10 142 217 114 20 186 227 31
20 186 227 31 30 195 194 95
30 195 194 95 40 129 123 11
40 129 123 11 333 170 224 234

What I did in GPlates:

  1. Opened the layer panel and clicked “Set Draw style…”
  2. Selected ColorByProperty from the list
  3. Clicked Add… to create a new configuration
  4. Loaded the CPT file using Open…
  5. Set property_name to “ID”
  6. Clicked Reload and closed the window

The thumbnail in the Draw Style window shows the new configuration selected (blue border), but the map does not change colours at all.

My questions:

  • Is “ID” the correct value for property_name when working with shapefile attributes?
  • Is the CPT format I am using correct for GPlates 2.5.0?
  • Is there an additional step needed to apply the style to the map?

Thank you in advance.

Hello @cchan

to use the shapefile attributes you need to put in gpml:shapefileAttributes:<YourAttributeName> in the property_name field (and not just the attribute name). Then it should work. So in your case: gpml:shapefileAttributes:ID.

It’s one of those slightly quirky, unintuitive things in GPlates that you cannot put the direct attribute name in but instead need to refer to the way the file is wrapped into GPlates internal representation in GPML.

The CPT file should be continuous and not have breaks, so I can’t see why the CPT should not work. Seeing that you’re using discrete values it might even be possible to use the GMT-style categorical format for CPTs such as the example one here - but you’d need to test that.

Cheers, Christian