Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support writing text fields which are longer than 255 characters. #14

Closed
scw opened this issue Aug 2, 2017 · 2 comments
Closed

Support writing text fields which are longer than 255 characters. #14

scw opened this issue Aug 2, 2017 · 2 comments

Comments

@scw
Copy link
Member

scw commented Aug 2, 2017

As reported by Andrew Gilbert, currently if writing a text field, writing will fail if any of the values exceed 255 characters in length. Here's a quick example, with a String field that'll fit in 1024 characters:

data_type_test.csv

OBJECTID,OBJECTID_1,Shape_Length,StringField,Number,Boolean,LongString
,1,457754.519544604641851,,,TRUE,"This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string, This is a very long string."

Now, try to write this input using arcgisbinding:

library(arcgisbinding)
arc.check_product()

# you'll need to set a location with setwd(), here I use a location with an
# existing `r_test.gdb` file.
# setwd()

d <- arc.open("data_type_test.csv")
dr <- arc.select(d)
arc.write("r_test.gdb/long_string_write", dr)
# fails with:
# Error in .call_proxy("arc_export2dataset", path, data, coords, shape_info) : 
#  The row contains a bad value. [LongString]

I discussed this with @dpavlushko, he said it's because of how we create the output. We basically do this in two steps, initializing an output dataset, and then later writing it. At initialization, we don't know the structure of the data, so it is initialized to the default length for a text field currently.

@matthewpaulking
Copy link

Just wanted to chime in and say that this would be extremely helpful to me in my work to increase the character limit. I'm using FileGDBs every day, and the ability to write out to .gdb inside of R is fantastic, but I do end up having to truncate some of my text fields. Appreciate all the work on this package!

@dpavlushko
Copy link
Contributor

Fixed in 1.0.1.229

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants