I tried to export a Spatially Enabled DataFrame to a feature class in a fileGDB and got an error of field length limit. I could find more information on this page (https://developers.arcgis.com/python/guide/introduction-to-the-spatially-enabled-dataframe/). I thought the maximum length for a text field is 2,147,483,647 characters in geodatabases. The target field value length is only 275. What is the explanation for the error, or what is the field length limit when using the function ".spatial.to_featureclass"? I hope there is a direct solution such as setting the limit in the function, or I will try some workarounds. Thanks!
Solved! Go to Solution.
It already exists. I set overwrite=True and there was any issue before this case. The source data is from some manual input from a feature layer. I don't know what format caused the issue. I just trimmed whatever is beyond the last character by setting the text field value as value[0:len(value)], and it worked.
Can you clarify: does the target feature class already exist, or are you using the export function to create it?
It already exists. I set overwrite=True and there was any issue before this case. The source data is from some manual input from a feature layer. I don't know what format caused the issue. I just trimmed whatever is beyond the last character by setting the text field value as value[0:len(value)], and it worked.
I recently ran into this problem as well. I have a layer from AGO that contains a field with a text length of 2500. Currently there is only one row with > 255 characters in that field. That row isn't exported using to_featureclass method and generates the following error.
It doesn't matter if i overwrite or sanitize columns, i always get the error above. The field in the resulting feature class has a length of 255 which seems to be the cause of the error.
I can confirm this also happens when exporting to a FGDB.
I can also confirm that this happens when exporting to a file geodatabase. did anyone find a workaround?