Open hildermesmedeiros opened 2 years ago
Just to be clear, any one can automate it with arcpy, but is not that pratical.
import arcpy
arcpy.env.workspace = 'https://url_to/FeatureServer'
#assuming one feature on service (in id 0)
layer_name = arcpy.ListFeatureClasses()[0]
arcpy.AddField_management(
in_table=layer_name,
field_name='temp_col',
field_type='TEXT',
field_precision=None,
field_scale=None,
field_length=1000,
field_alias=None,
field_is_nullable=None,
field_is_required=None,
field_domain=None,
)
And from there we copy data from one colum to other, dele the correct one, use addfield again to recreate it, copy data from temp_col to the new text field with correct size, and finally - delete de temp column.
Interesting idea we will think about it and let you know.
It would be greate to be possible to control string fields length using pandas dataframe and to_featurelayer or to featureCollection With methods like numpy astype('<u1000') works, but, if I'm not wrong, in pandas it will be string or str.
Describe the solution you'd like A parameter to parse a list of tuples ('col_name', col_length)