I am trying to understand the meaning of this error. I created spatial data using the sf package in R and wrote out the data as a GeoPackage (i.e. a .gpkg). However, whenever I add the data into ArcMap, I receive the following error.

enter image description here

Unfortunately, my reproducible R example works and my real example still does not, thus something must be wrong with my code. And I cannot figure out what it is. The real code is too long and cannot be copied here.

The weird thing is that when I write the data in R out as a shapefile, there is no error and the data is correctly spatially referenced, etc. What does this error mean? And why would it produce as a .gpkg and not as a .shp?

A similar error message was seen here, but it is a little different.

closed as off-topic by BERA, Vince, whyzar, Jochen Schwarze, csk Apr 25 at 17:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – BERA, Vince, whyzar, Jochen Schwarze, csk
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Maybe you have some invalid field name? When you export to shapefile the field names are truncated and maybe the error is being truncated away – BERA Apr 23 at 15:55
  • Which version of ArcMap? Unlikely; but maybe an older version not understanding the contents of the package? – KHibma Apr 23 at 17:06
  • @KHibma, ArcGIS Desktop 10.6.1. – Phil Apr 23 at 17:40
  • @BERA, I think that maybe an issue as one of my fields is called "Unique.ID". Can geopackage file types not accept "."s in field names? – Phil Apr 23 at 17:40
  • 1
    @BERA, thank you for the help! It has a worked. I replaced a "." with "_" and my geopackage could be read into ArcMap. Thank you! – Phil Apr 24 at 15:39

For clarification, @BERA's comment was correct. There were invalid field names. In my R Script, I simply added the below line of code to remove .'s and to replace them with _'s. Assuming your dataframe or sf object is called df:

# Remove dots from column (field) names and replace with _
colnames(df) <- gsub("\\.", "_", colnames(df))

should do it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.