Monthly Archives: April 2009

Unraveling the Four-Digit ZIP Code Mystery


Map of New England

Since the U.S. Post Office standardizes to five digits and ZIP+4, having a great many four-digit ZIP Codes in the 2008 student dataset was a problem. After comparing the “short” ZIP Codes to each student’s city and state, I discovered the problem. All the four-digit ZIP Codes were in New England, where many ZIP Codes start with 0—and our native student database drops leading zeros.

The ZIP Code data was stored in a string field (Customer_Zipcode), which would not sort in a way to make the four-digit ZIP Codes stand out (and so be easily selectable). To fix this, I created a new short integer field called ZIPasNum, then used the Field Calculator to populate the ZIP Codes from the string field into the new one: [ZIPasNum]= [Customer_Zipcode].

An interesting note on the short integer field is that ZIP Codes interpreted as being higher than the value 32,767 were rejected (given null values). This was OK because I was only interested in finding four-digit ZIP Code records anyway.

With the ZIP Codes in number format, I could:

  • Sort the data to find and select values less than 10,000, which would be any records that were missing the first digit (or two in a few cases).
  • Use the Field Calculator on the selected set to add 0 to the beginning of each ZIP Code (“0” ++ [Customer_Zipcode]).
  • Copy the corrected ZIP Codes back to the string field, Customer_Zipcode.


Posted in Uncategorized | Leave a comment

Spring Reading Suggestions for GIS Users


In the current edition of ArcUser Online a couple of articles caught my eye. In The Top Nine Reasons to Use a File Geodatabase, Colin Childs, an instructor with ESRI Educational Services, makes the case that the file geodatabase is a better choice for storing geospatial data than shapefiles and the Microsoft Access-based personal geodatabase (.MDB format).

Colin includes several tables with key information about the file geodatabase and tips for data migration and storage. Colin also clarifies the difference between compacting a geodatabase and compressing a geodatabase. If you haven’t yet used the file geodatabase, this article may persuade you to give it a try. Continue reading

Posted in Uncategorized | Tagged , , , | 1 Comment