Shapefile Problems

I have a few problems with the shapefile handling in GPlates (2.3, Win11). To reproduce do the following.

  1. Start with an example project, e.g. https://www.earthbyte.org/webdav/ftp/earthbyte/GPlates/GPlates2.3_GeoData/Rasters/Seafloor_Age_Grid.zip
  2. Add the world exclusive economic zones shapefile from World Maritime Boundaries v8
    → This results in two errors that are caused by empty geometries in the shapefile, and 741 warnings because the attributes are not understood. None of this is crucial, but it would be nice not to see these errors and warnings every time we open a project with this data.
  3. Save the project and re-open it. The read errors and warnings are back.
  4. Remove the shapefile from the project layer list, save the project again, and re-open. The shapefile read errors and warnings are still here. So the shapefile cannot be removed and will get loaded even though we removed it.

How do I properly remove shapefiles from a GPlates project?

Hi Dani,

You might be using Delete layer in the Layers dialog. You can instead use the unload button in the Manage Feature Collections dialog which will remove the Shapefile and also remove it from the Layers. And then save the project.

If there are only warnings (ie, no errors) then you won’t see warnings. For example, if you load the DataBundleForNovices project that comes with GPlates 2.3 then you’ll get…

…and only if you then click on the yellow triangle (in bottom-right corner) will you see the warnings…

In your case there are also errors and so the Read Errors dialog will always show upon loading…

Yes I think they are features with no geometry. In this forum topic another user had that particular error. Ultimately those features with no geometry would need to be removed from the Shapefile to avoid the pop-up errors. Alternatively you could save the Shapefile as a GPML(Z) file using Save As in the Manage Feature Collections dialog, and then save the project. Then upon reloading the project it should no longer pop-up errors.

This is because the GPGIM_TYPE or TYPE Shapefile attribute is used by GPlates (by default) to determine the type of the features being loaded. The Shapefile in question contains the TYPE attribute, but it is used for something else. When you first load the Shapefile you can instead map a different attribute to the GPlates feature type (ie, use something other than TYPE). You may first have to first delete the World_Exclusive_Economic_Zones_Boundaries.shp.gplates.xml mapping file (since it’s already been mapped). When the attribute mapping dialog then pops up (upon loading) you can set it to something like <none>. However that will just cause different warnings (because GPlates still needs to know the feature type one way or another).

Thank you for your detailed response!

Indeed, you correctly pointed out that I utilized the delete layer option in the Layers dialog. In the future, I’ll be sure to use the Manage Feature Collections instead.

The warnings associated with the Type are understandable. However, the two errors in question are somewhat open to discussion. They stem from two Line objects (out of the total 743) that have empty coordinate lists. Evidently, retaining objects that essentially shouldn’t exist is illogical. Nevertheless, tools like QGIS handle such objects – if there’s nothing to display, then nothing is displayed, without an error message.

I’m inclined to agree. I’ve changed it to a warning (instead of an error) - that will be in the next release.

1 Like