Tuesday, August 4, 2009

Increasing the length of a text field in a File Geodatabase

I was recently working on a job where I needed to increase the length of a text field of a feature class in a File Geodatabase. Similarly to changing the type of a field, this was not as straightforward as you might think. The process I went through was:
  1. Create a temporary field to store the values of existing features
  2. Delete the original field
  3. Create a new field, with the increased length (using the same name as the original)
  4. Copy the values from the temp field into this new field
  5. Delete the temp field

So basically, a lot of work to make a very minor change. I ended up using Model Builder and writing a Python script to automate the process. Being the nice people that we are, we uploaded it to ArcScripts so anyone can download it.

If you are interested, you can download the script here.

Interested in finding out more about Model Builder? Stay tuned, RIA is currently in the process of developing an Introduction to Model Builder training course.

No comments: