Friday 27 December 2019

esri geodatabase - How to update length property of feature class field in ArcGIS Desktop?


I have a feature class with a string field that I want to update the length from 10 to 25.


Is there a way or a tool to update this property without having to create a new field and using field calculator to move over the records from old to new field?




This script below does what I want, the only thing is it pushes the updated field to the end of the table (not keeping the original field order).


http://arcscripts.esri.com/details.asp?dbid=16503



Another option that seemed promissing is to use the Feature Class to Feature Class tool (access this tool by right clicking a layer in ArcCatolog and selecting Export>to Geodatabase single option) . It does create a new layer, however you can update field names and property information. It also appears that you can change the field order using the "Move Input Field Up/Down" arrows, but they seem to not work.


There has to be a solution to just edit field properties without having to create a new field.



Answer



As far as I am aware there is currently no way to make schema edits in a geodatabase without either dropping and adding fields, or deleting and reloading feature classes/tables. The latter is what I recommend in order to maintain field order.


What I normally do is:



  1. Make a backup of the original feature class

  2. Export the original feature class's schema to an XML file

  3. Modify the schema in a text editor or ArcGIS Diagrammer 10.0, 10.1 or 10.2.

  4. Delete the original feature class


  5. Import the schema back into the geodatabase

  6. Use the Append tool, Simple Data Loader or Object Loader to load the contents of the backup feature class into the newly imported feature class. See the "About loading data into existing feature classes and tables" help topic for more information.


At ArcGIS 10.1 and up there are geoprocessing tools to handle the XML import/export but at 10.0 and earlier you either have to use ArcObjects or do it manually. For an ArcObjects example see: Export XML Workspace Document


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...