How to change "Clicked geometry" from gpml:UnclassifiedGeometry to gpml:centerLineOf

Hi All,

I am currently working on a reconstruction model and I am looking to plot subduction zones and closed topologies over time. I am using Simon William’s codes to plot subduction teeth using PyGMT and GPlatesReconstructionModel. However, I’ve encountered an issue where some of my subduction zones are not being plotted. The only difference between these unplotted zones and the others is that they are coded as “gpml: UnclassifiedGeometry,” while the others are “gpml: CenterLineOf.” I believe this to be the problem. The code I am using seems unable to detect those unclassified geometries. I’ve tried to modify it, but nothing worked. Would anyone happen to know a solution or workaround for this issue? Thank you very much!

Moloud

Hi Moloud,

I did a quick test and was able to reproduce the same behaviour.
The issue seems to stem from different way that gplates creates ‘resolved_boundary_segments’ depending on the geometry type.
If the subduction zone is defined as gpml:CenterLineOf, then running the pygplates command resolved_boundary_segments.get_geometry() returns the geometry.
If the subduction zone is defined as gpml:UnclassifiedGeometry, then get_geometry() returns ‘None’, instead we have to do ‘get_all_geometries’ which returns a list of geometries (even when there is only one geometry).
The existing code assumed that all subduction zones are defined as line geometries, the unclassified geometries were silently skipped. I’ve modified the code in the GPlatesReconstructionModel repo on GitHub to handle these cases, you may try this and see if it fixes your problem.

This has been a bit of a problematic area around the GPlates Geological Information Model, so I’ve just changed Feature.get_geometry() in pyGPlates to always return a geometry when a feature contains a single geometry, regardless of how that geometry is defined.

So, for example, getting a geometry from a subduction zone will first look for a geometry under gpml:CenterLineOf (the default geometry for a subduction zone), and if not found will look for any geometry instead of returning None (in this case returning gpml:UnclassifiedGeometry).

I wish I’d thought of this years ago because it’s more useful when you are expecting a single geometry but don’t know which property it has been imported into (in this case it has somehow ended up in a gpml:UnclassifiedGeometry) and hence you’re leaving property_query unspecified…