Presentation is loading. Please wait.

Presentation is loading. Please wait.

Important Database Concepts Introduction to GIS. How is Data Stored? People use number system with base 10 –decimal number Each digit corresponds to 10.

Similar presentations


Presentation on theme: "Important Database Concepts Introduction to GIS. How is Data Stored? People use number system with base 10 –decimal number Each digit corresponds to 10."— Presentation transcript:

1 Important Database Concepts Introduction to GIS

2 How is Data Stored? People use number system with base 10 –decimal number Each digit corresponds to 10 to some power Hence a number with 3 digits has 10 3 or 1000 possibilities (combinations) Computers use a base 2 system of storing numbers and values Bit: 0 or 1, like switch Off/On: Off: 0; On: 1 A byte is 8 bits, so 2 8 or 256 possibilities

3 How do binary numbers translate to real numbers? Switch combinations determine base ten number based on the formula: N 10 = 2 b-1 *digit+2 b-2 *digit +…2 b-b *digit Where b= number of bits storing the number Hence the binary number 11111111 2 = 2 7 *1+ 2 6 *1 + 2 5 *1 + 2 4 *1 + 2 3 *1 + 2 2 *1 + 2 1 *1 + 2 0 *1 = 255 10 And the binary number 11111110 2 = 2 7 *1+ 2 6 *1 + 2 5 *1 + 2 4 *1 + 2 3 *1 + 2 2 *1 + 2 1 *1 + 2 0 *0 = 254 10

4 Number of possible values for a unit of data is an exponential function of the number of switches 2 8 = 256eight bit data (1 byte) 2 16 = 65,536sixteen bit data (2 bytes) 2 32 = 4,294,967,296thirty two bit data ( 4 bytes) Number of Possible Values given number of bits

5 Number of bits determines data types Examples of Integer data types  Byte: 2 8 (0 to 255)  Short Integer: 2 16 (ranges from –32,767 to +32,767, the sixteenth bit determines sign)  Long Integer: 2 32 (+/- 2.147483e+09 )

6 Floating point data types The number can have a decimal, but the number of places is variable The number of bits determines not just the number of possible magnitudes but also the level of precision of the decimal, represented as number of decimal places. Fewer bits in FP numbers can lead to rounding errors Two types of FP number  Single Precision: Often 2 32  Double Precision: Usually double the bits of single precision (i.e. 2 64 )

7  Date (recognizes order in dates)  String (text)  When numbers are represented as text they have no numerical properties (e.g. zip codes)  Boolean (yes, no) Other Data Types

8 Example: Data Type for a Land Use Feature Class in ArcGIS

9 Three Classic Database Management System (DBMS) Models Hierarchical Network Relational – Most GISs use this model, to be explained in detail

10 Relational (Tabular) Database Model A design used in database systems in which relationships are created between one or more flat files or tables based on the idea that each pair of tables has a field in common, or “key”. In a relational database, the records are generally different in each table The advantages: - each table can be prepared and maintained separately - tables can remain separate until a query requires connecting, or relating them - relationships can be one to one, one to many or many to one

11 NamePhoneAddressStudent ID *** Records are the unit that the data are specific to Fields, or columns, are attribute categories Cells are where individual values of a record for a field are stored Data Tables (flat files) records fields cells Headings: are the labels for the columns

12 Course name Course number enrollmentfaculty ID *** Is a field that is common to two or more flat files; allows a query to be done across multiple tables or allows two tables to be joined Data key NamePhoneAddressfaculty ID *** Flat file: professor infoFlat file: course info

13 KeyA B 1 2 3 C 1 2 1 2 3 4 5 6 10 20 KeyA B 1 2 3 1 2 3 4 5 6 C 20 10 50 JOIN In this case we have a one to one join; here the key is unique 3 50 Join Tables Based on the values of a field that can be found in both tables The name of the field does not have to be the same The data type has to be the same

14 Join Tables NoA B 1 1 2 KeyC 1 2 1 2 3 4 5 6 10 20 KeyA B 1 1 2 1 2 3 4 5 6 C 10 20 JOIN In this case we have a one to many join; here the key is not unique

15 u Relational Database: an example: property lot info One-to-one relationship Parcel ID Street addresszoning 1115 Maple St.Residential-1 1285 Brooks AveCommercial-2 1374 Windam Ct.Residential 4 OwnerParcel IDoccupation J. Smith13lawyer R. Jones11dentist T. Flores12Real estate developer

16 u Relational database: one to many relationship One-to-many relationship Parcel ID Street addresszoning 1115 Maple St.Residential-1 1285 Brooks AveCommercial-2 1374 Windam Ct.Residential 4 OwnerParcel IDoccupation J. Smith13lawyer R. Jones11dentist J. McCann12financier T. Flores12Real estate developer In this case, several people co-own the same lot, so no longer one lot, one person

17 Assuming each owner owned several parcels, we would structure the database differently One-to-many relationship Parcel IDStreet addresszoning 1115 Maple St.Residential-1 1285 Brooks AveCommercial-2 1374 Windam Ct.Residential 4 Owneroccupation# properties owned J. Smithlawyer2 R. Jonesdentist5 J. McCannfinancier2 T. FloresReal estate developer 3 Properties owned by T. Flores OwnerParcel IDDate of transaction Flores134-15-00 Flores154-17-01 Flores193-12-99 Note: this table includes data pertinent only to Flores’ ownership of these properties


Download ppt "Important Database Concepts Introduction to GIS. How is Data Stored? People use number system with base 10 –decimal number Each digit corresponds to 10."

Similar presentations


Ads by Google