Select to view content in your preferred language

field length limit exceeded when exporting Spatially Enabled DataFrame to feature class in file geodatabase

1720
6
Jump to solution
03-08-2023 07:05 PM
DongmeiChen
Occasional Contributor

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!

0 Kudos
1 Solution

Accepted Solutions
DongmeiChen
Occasional Contributor

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. 

View solution in original post

0 Kudos
6 Replies
jcarlson
MVP Esteemed Contributor

Can you clarify: does the target feature class already exist, or are you using the export function to create it?

- Josh Carlson
Kendall County GIS
0 Kudos
DongmeiChen
Occasional Contributor

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. 

0 Kudos
aclark_polygonsol
New Contributor

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.

aclark_polygonsol_0-1678721135306.png

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. 

 

0 Kudos
DongmeiChen
Occasional Contributor
If you export it to a shapefile, yes to 255. File geodatabase can contain much more.
0 Kudos
GrantHerbert
Frequent Contributor

I can confirm this also happens when exporting to a FGDB.

0 Kudos
NathanDahlberg
New Contributor

I can also confirm that this happens when exporting to a file geodatabase. did anyone find a workaround?

 

0 Kudos