Читать книгу Designing Geodatabases for Transportation - J. Allison Butler - Страница 18

Data types

Оглавление

When starting a data-modeling project, you first must understand the data you intend to place into your new geodatabase. In addition to the geometry you use to abstractly represent a real-world entity cartographically, you have the traditional forms of data that have always been part of transport databases.


Figure 2.1 Data types The ArcGIS geodatabase supports several data types for user-supplied class attributes. The primary ones you will likely use are character string, short integer, long integer, single-precision floating-point (float), double-precision floating-point (double), and date.

One of the most common kinds of data is text, which consists of a string of alphanumeric characters, like letters, numbers, and punctuation. Anything you can type on a keyboard can go into a text field. The maximum number of allowable characters defines most text fields. For example, you might see a reference like “String (30)” to define a text field with a maximum length of 30 characters.

An equally popular form of data is a number. There are many different types of number data, but to the user they all consist of a series of digits. Where they differ is how they are stored in the database. In the geodatabase, a short integer will be stored using 2 bytes of memory; a long integer requires 4 bytes. A single-precision or floating-point number is also stored using 4 bytes, while a double-precision number is stored using 8 bytes. The actual numeric range that each of these forms represents varies according to the database management system you use.

Working in concert with the type of number format you select is the way you specify it in an ArcSDE geodatabase. A number field in such a database has two characteristics that go with its type. The first is precision, which specifies the maximum number of digits that can be stored. The second characteristic is scale, which tells the database how many of those digits will fall after the decimal point.

Number type, precision, and scale interact in various ways. For example, the database will ignore scale if you specify a number type of integer, because integers consist only of whole numbers. The data type overrides the specification. Sometimes it works the other way. For instance, if you specify a floating-number (single-precision) data type but a precision of seven or more, ArcGIS will change the data type to double-precision.

Most database management systems also support date and time data types. Although stored in vendor-specific ways, ArcGIS provides a consistent representation to the user in which date and time are combined into one data type, called ‘Date’. The date portion is provided as a two-digit month, a two-digit day, and a four-digit year, with the three components separated by a forward slash character. The time portion is presented as a two-digit number representing a 24-hour clock (00-23), a two-digit minute portion (00-59), and a second component with a precision of 5 and a scale of 3. The three time components are separated using colons.

Designing Geodatabases for Transportation

Подняться наверх