Recurring issues with basic arc.write() function in R: "Unknown Error"

832
4
05-11-2023 10:36 PM
Labels (1)
AlanVincent
New Contributor

Hi all,

I've been using R to perform some spatial analyses on point and polygon data, and wish to export my products to a local .gdb as feature layers. My data types i'm attempting to write are sf class of spatial objects (as part of Simple Features package) and basic data frames. 

I'm having some recurring issues using the arc.write() functions basic use case, in which issues with the arc.write() generating an "unknown error" or an "unspecified error" depending on the combination of arguments.

eg:
     "Error in .call_proxy("arc_write", path, pairlist(data = data, coords = coords, :
      unknown error"

I've previously had similar errors when specifying the path as "C:/project.gdb/" without a name for the feature layer, and had  solved by running the code as set out below.

arc.check_product()
arc.write(path = "C:/project.gdb/layer_name", data = data_sf, overwrite = T, validate = T)

I have tried including and excluding all combinations of the above arguments, as well as including
"coords = sf$geometry". The sf data has not changed since it was last functional. 

product: ArcGIS Pro (12.8.7.29751)
license: Advanced
version: 1.0.1.305

R version 4.1.3

arcgisbinding version is 1.0.1.305

The lack of detail in the error messages in the package are making diagnosing issues rather difficult. Is there plans to have this fixed in the near future? Can anyone help solve this problem? 

Cheers,
Alan

0 Kudos
4 Replies
BenjaminDorsey
New Contributor II

I suggest a test - does st_write work on the data ? I know you will need to write it to a shapefile... but this helps eliminate some possible reasons for your issue.

0 Kudos
AlanVincent
New Contributor

Hi Benjamin,

Thanks for your reply! st_write is functioning and I have no issues writing or mapping the data within R. Currently my workaround has been exporting my data as shapefiles and loading into a ArcPro project.  However, this requires some manually handling due to small character limit in shapefile column names, so I'm hoping to automatic this process in the long term. I've got several projects that would benefit from a functioning R-GIS bridge, so quite keen to make this work if possible. 

Cheers,
Alan

0 Kudos
BenjaminDorsey
New Contributor II

No problem 🙂 Ok, so in my way of thinking it is either a) your environment or b) the data. What if I send you a little working example - and you test it in your environment. let me put that together and I will attach it here.

0 Kudos
AlanVincent
New Contributor

Thanks for putting this together. 

Still getting the same error. Which suggests to me that the issue is perhaps with my organisations ICT setup, rather than how I'm using the package. I'll try the same test a personal computer to confirm this.

For a bit of context, I have access to both OneDrive storage, and a remote desktop on a Network Addressable Storage. Having test.gdb on either of these results in the same error. I had previously ruled out this being an issue, as it was working on this system previously.

Cheers,
Alan

0 Kudos