-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arc.write error #108
Comments
Also, it would be really helpful to add a |
@Saadi4469 there can be numerous causes to this issue. Here are some thoughts:
If possible, sharing a few rows of your data will allow me to provide more direct help. |
@orhuna how can I attach a zipped shapefile? |
@Saadi4469 the easiest way would be emailing it to oaydin@esri.com. If the file is too big, I can set up a OneDrive folder. |
@Saadi4469 If the file is smaller, you can also make a .zip archive and attach it as a comment here |
@orhuna I have sent you an email with the shapefile, thank you. |
@orhuna please note that the columns showing |
@Saadi4469 I tried writing the dataset to all fgdbs we support using
|
@orhuna thank you, could the |
Also is |
@orhuna I am beginning to think that the dataset is so big that that might be causing the issue. |
@Saadi4469 the data volume is not the issue as the cursor that inserts data from your R dataframe to the feature class in the GDB throws an error and exits. I think we can debug this further and get you going with your workflow. Below are some checks on the R side, that I recommend you perform on your R data frame: Steps to Take on the R/R Studio sideChecking for Different Types of missing valuesI recommend applying the below separately on the dataset to investigate if there are more than one type of missing data. Where we can handle nas in writint NaN and infinite values need to be represented with a place holder such as Would you please check for different types of missing/out of bound values with Note that if you wanted to assign a value for any na, nan or inifinte you can use the following pattern Trying to find the problematic rowI suspect that you have one row that causes a problem in writing. After trying the subset you given me, I was able to write it out successfully. Here is what I recommend: Create a for loop that loops through only up to a row and try to write it.
Note that this takes a minute with the 10 rows you gave me and you may want to search for the row may be first with a jump of 100 and then a jump of 10 etc. Searching every row range one by one may take a while for 800,000 rows. Steps to Take on the ArcGIS Pro/Desktop sideCreating a New GDBWe see write errors like to one you encountered on corrupt gdbs. One step I recommend is running the Visualizing the feature class that resulted in the errorThis step might be a replacement for the for loop I recommended above. Here you can, simply run your code that results in the error. Then in Pro Go to Catalog, right click on the gdb you wrote to and click refresh. If you can see the feature class there add it to your map and look at the Attribute Table. If the Attribute Table is populated the bottom-most row will be the row right before the problematic row that you can either remove or fix in R. I hope this helps and please reach out if it does not. |
@orhuna thank you for the detailed guidance. |
@Saadi4469 no problem. THe last issue that I can think of is that of types. Would you share the output of this function on your data frame,
|
@orhuna on a side note then how come |
Here you go.
|
@Saadi4469 thank you. As per your question on why shapefile works, shapefiles are not subject to stringent value and geometry checks that feature classes are subject to. This means it is easy to export to a Thank you for the column types. I do see some issues in the column types. I do not know details of your dataset but some columns that should be the same type are different for instance An easy solution here would be casting. You can set the types of the columns explicitly before writing it out. |
Another solution we can try is if you have shapefile you could do the following:
The above should work with the caveat that your data will be at the mercy of what we could write to a shapefile and the checks that went into creating that shapefile to start with, or lack thereof. |
@Saadi4469 Does the issue still persist? |
@orhuna thank you for the follow up, I am waiting for an updated |
I am getting the following error while writing an
sf object
dataframe
to aGDB
. The dataframe imported is a feature class from a GDB brought in via thesf
package. After some data manipulation I am trying to write thedataframe
back into the sameGDB
as anew
feature class/layer
.I read in another post that
sf
does not support writing a feature class to agdb
so I had to usearcgisbinding
. However, when I usesf::st_write
to write thedf
as ashapefile
, it works just fine.The
arc.write
works on the samplenc
dataset in thesf
package but does not work on my dataset. I don't know if it matters but mysf object
has more than700,000
rows and82
columns.How can I fix this?
Error
Code
The text was updated successfully, but these errors were encountered: