Show Navigation | Hide Navigation
You are here:
Building a geodatabase > Creating new items in geodatabases

ArcGIS data types

Release 9.1
Last modified April 26, 2005
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Creating new items in geodatabases"


Related Topics

When creating tables, you will need to select a data type for each field in your table. The available types include a variety of number types, text, date, binary large objects (BLOBs), or globally unique identifiers (GUIDs). Choosing the correct data type allows you to correctly store the data and will facilitate your analysis, data management, and business needs.
View a table

Numeric data types

Numeric fields can be stored as one of four numeric data types: short integers; long integers; single-precision floating point numbers, often referred to as floats; and double-precision floating point numbers, commonly called doubles. Each of these numeric data types varies in the size and method of storing a numeric value.

In numeric data storage, it is important to understand the difference between decimal and binary numbers. The majority of people are accustomed to decimal numbers, which are a series of digits between zero and nine with negative or positive values and the possible placement of a decimal point. On the other hand, computers store numbers as binary numbers. A binary number is simply a series of 0s and 1s. In the different numeric data types, these 0s and 1s represent different coded values, including the positive or negative nature of the number, the actual digits involved, and the placement of a decimal point. Understanding this type of number storage will help you make the correct decision in choosing numeric data types.

In choosing the numeric data type, there are two things to consider. First, it is always best to use the smallest byte size data type needed. This will not only minimize the amount of storage required for your geodatabase but will also improve the performance. You should also consider the need for exact numbers versus approximate numbers. For example, if you need to express a fractional number, and seven significant digits will suffice, use a float. However, if the number must be more precise, choose a double. If the field values will not include fractional numbers, choose either a short or long integer.

Integers


The most basic numeric data type is the short integer. This type of numeric value is stored as a series of 16 0s or 1s, commonly referred to as 16 bits. Eight bits are referred to as a byte; thus, a short integer takes up two bytes of data. One bit states if the number is positive or negative and the remaining 15 translate to a numeric value with five significant digits. The actual numeric value for a short integer is approximately between -32,000 and +32,000. A long integer is a four-byte number. Again, one bit stores the positive or negative nature of the number while the remaining bits translate to a numeric value with 10 significant digits. The actual range for a long integer is approximately between -2 billion and +2 billion. Both short and long integers can store only real numbers. In other words, you cannot have fractions or numbers to the right of the decimal place. To store data with decimal values, you will need to use either a float or a double.

Floats


Floats and doubles are both binary number types that store the positive or negative nature of the number, a series of significant digits, and a coded value to define the placement of a decimal point. This is referred to as the exponent value. Floats and doubles are coded in a format similar to scientific notation. For example, if you wanted to represent the number -3,125 in scientific notation, you would say -3.125x103 or -3.125E3. The binary code would break this number apart and assign one bit to state that it is a negative number; another series of bits would define the significant digits 3125; another bit would indicate whether the exponent value is positive or negative; and the final series of bits would define the exponent value of 3. A float is a four-bit number and can store up to seven significant digits, producing an approximate range of values between -3.4E-38 to -1.2E38 for negative numbers and from 3.4E-38 to 1.2E38 for positive numbers. A double is an eight-byte number and can store up to 15 significant digits, producing an approximate range of values between -2.2E-308 and -1.8E308 for negative numbers and 2.2E-308 and 1.8E308 for positive numbers.

It is important to note, however, that floats and doubles are approximate numbers. This is due to two factors. First, the number of significant digits is a limiting factor. For example, you could not express the number 1,234,567.8 as a float because this number contains more than the permissible seven digits. To store the number as a float, it will be rounded to 1,234,568, a number containing the permissible seven digits. This number could easily be expressed as a double, since it contains less than the permissible 15 significant digits.

There are also some limitations to numbers a binary value can represent. One analogy that can be made would be in expressing fractions versus decimals. The fraction 1/3 represents a particular value. However, if you try to express this number as a decimal, the number will need to be rounded at some point. It could be expressed as 0.3333333, however, this is still an approximation of the actual value. Just as fractions cannot always be expressed as decimals, some numbers cannot be exactly expressed in binary code, and these numbers are replaced by approximate values. One example of such a number is 0.1. This number cannot be expressed as a binary number. However, the number 0.099999 can be expressed in binary. Thus, 0.1 would be replaced with an approximate value of 0.099999.

Text fields

A text field represents a series of alphanumeric symbols. This can include street names, attribute properties, or other textual descriptions. An alternative to using repeating textual attributes is to establish a coded value. A textual description would be coded with a numeric value. For example, you might code road types with numeric values assigning a 1 to paved improved roads, a 2 to gravel roads, and so on. This has the advantage of using less storage space in the geodatabase; however, the coded values must be understood by the data user. If you define your coded values in a coded value domain in the geodatabase and associate the domain with the integer field storing your codes, the geodatabase will display the textual description when the table is viewed in ArcMap or ArcCatalog.
Learn more about subtypes and attribute domains

Date fields

The date data type can store dates, times, or dates and times. The default format in which the information is presented is mm/dd/yyyy hh:mm:ss and a specification of AM or PM. When you enter date fields in the table, they will be converted to this format.

BLOB fields

A BLOB, or binary large object, is simply some data stored in the geodatabase as a long sequence of binary numbers. Items such as images, multimedia, or bits of code can be stored in this type of field.

Global identifier fields

GlobalID and GUID data types store registry style strings that uniquely identify a feature or table row within a geodatabase and across geodatabases. Developers can use them in relationships or in any application requiring globally unique identifiers. In a relationship, if a GlobalID field is the origin key, a GUID field must be the destination key. You must add the GlobalID field programmatically; however, once you add it, ArcGIS maintains its values. You can create the GUID field in ArcCatalog, but you must maintain its values.

Data types outside ArcGIS

The data types explained in this section include all the data types available when creating a table using ArcMap or ArcCatalog and storing the table in a personal geodatabase. However, you might choose to store your tables in another DBMS, such as Oracle or dBASE. When this is done, the data types between ArcGIS and your DBMS might not match directly. The types are matched to the closest data type available in the DBMS. This process is referred to as data type mapping. In this process, it is possible that the values will be stored in the DBMS as a different type, applying different criteria to the data attribute. To learn more about the data type mapping process with your database management system, see the Configuration and Tuning Guide for <DBMS> PDF file.

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.