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

888
7
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
7 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
AlanVincent
New Contributor

Hi Benjamin,

Just an update on this, unsure how helpful it is though. I have confirmed that this error is isolated to my work environment and not a personal one. I am able to get arc.write to write a sf object to GDB on my personal computer.

I have attempted some debugging with my IT support team and we have been unable to isolate what causes the "Unknown error" issue. We tested a local C: drive folder with full read/write permissions and the error still occurred. At this point its not clear to me what is different between that setup and a setup on a personal computer.

Cheers,
Alan

0 Kudos
MihaRobar
New Contributor III

Hi, guys i have simmilar problem. i am unable to write to filegeodatabase using arc.write, unles the .gdb is not on temp folder. Have anyone idea what could be the problem?

I can only write into a filegeodatabase that is located on C:/temp/*

 

Thanks.

 

0 Kudos
BenjaminDorsey
New Contributor II

Can you share your code? It could be some finicky coding issues. Do you have spaces in your paths?

I know it is 2024 and that shouldn't be a problem these days... Or it could be an operating system issue. Is this a work or school computer?

0 Kudos