English

FAQ: How are item types defined for shapefiles and file geodatabases?

Question

How are item types defined for shapefiles and file geodatabases?

Answer

To answer this question, it is important to understand the strength and agility of data stored in shapefiles, when compared to file geodatabases (FGDBs). This is due to general technological improvements in data storage since the creation of the shapefile data model by Esri. In general, if working with data outside of ArcGIS, it is recommended to use shapefiles to store data. Read the geoprocessing considerations for shapefiles to learn more.

Outlined below are some of the technical definitions and differences in the file format and precision/scale of shapefiles, DBFs, and file geodatabases.

What are the allowed field data types?

Below are the allowed field types for file geodatabases:

  • ObjectID
  • Geometry
  • Short Integer
  • Long Integer
  • Float
  • Double
  • Text
  • Date
  • Binary large object (BLOB)
Below are the allowed field types for shapefiles:
  • ObjectID
  • Shape
  • Short Integer
  • Long Integer
  • Float
  • Double
  • Text
  • Date

How is numeric data stored?

Numerical data can be stored as one of the four data types below:

  • Short Integer
  • Long Integer
  • Float (single-precision floating-point numbers)
  • Double (double-precision floating-point numbers)
Warning:   
Values in numeric fields in a geodatabase and shapefile are stored in the binary format. Converting to number for viewing may result in values that are less exact than expected.

It is important to select the right numeric data type to store data. Factors such as range and fractional values must be considered.

The table below describes the storable range, applications, precision (field length), scale (decimal places), and size (bytes) for each of the numeric data types:

Data TypeStorable RangeApplicationsPrecision (field length)Scale (decimal places)Size (Bytes)
Short Integer-32,768 to 32,767Numeric values without fractional values within specific range; coded values1–5 (Oracle, SQL Server, PostgreSQL, Netezza); 5 (DB2, Informix)02
Long integer-2,147,483,648 to 2,147,483,647Numeric values without fractional values within specific range6–10 (Oracle and PostgreSQL); 6–9 (DB2, Informix, Netezza, and SQL Server)04
Floatapproximately -3.4E38 to 1.2E38Numeric values with fractional values within specific range1–61–64
Doubleapproximately -2.2E308 to 1.8E308Numeric values with fractional values within specific range1–191–118

The following table provides examples on how numeric data can be stored in an enterprise, workgroup, or desktop geodatabase.

* Negative numbers require additional precision to store the negative sign.

RangeData typePrecision (field length)Scale (decimal places)
0 to 99Short integer20
-99 to 99*Short integer30
0 to 32,767Short integer50
32,768 to 99,999Long integer50
0.001 to 0.999Float43
1,000.00 to 9,999.99Float62
-123,456.78 to 0*Double92
0 to 1,234.56789Double95


How are Date (time) values stored, and what are the supported formats?

It is recommended to store time values in a Date field, which is a special database field type specifically for storing time and date information. The default format of the Date field is mm/dd/yyyy hh:mm:ss, with a specification of AM or PM.

Time values can also be stored in string or numeric field types. When specifying time values in these field data types, the Time field must be specified.

The supported data format for time values are described in the following documentation, Supported field formats.

What are the supported geometry data types for shapefiles and file geodatabases?

Geometry Types
Point
Point M
Point Z
Polyline
Polyline M
Polyline Z
Polygon
Polygon M
Polygon Z
Multipoint
Multipoint M
Multipoint Z
Multipatch

Related Information