• 검색 결과가 없습니다.

Chapter 4 Spatial data & spatial DB sys 1. Introduction spatial DB sys is different from conventional DB sys stores complex data types – points, lines, polygons needs sophisticated spatial operators

N/A
N/A
Protected

Academic year: 2022

Share "Chapter 4 Spatial data & spatial DB sys 1. Introduction spatial DB sys is different from conventional DB sys stores complex data types – points, lines, polygons needs sophisticated spatial operators"

Copied!
34
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

Chapter 4 Spatial data & spatial DB sys 1. Introduction

spatial DB sys is different from conventional DB sys stores complex data types – points, lines, polygons needs sophisticated spatial operators

1

(2)

2. Definition & classification of spatial data 2.1 Spatial data & pseudo-spatial data

1) spatial data : data of spatial attributes that denote a location / near the surface two important properties : reference to a geographic space

represent at a variety of geographic scales two fundamental forms - vector & raster

vector – basic unit is the geographic object, represented by points, lines, polygons ex. Land use, transportation, forest inventories, land cover

raster – basic spatial unit is a grid cell / pixel, serve as a data store & geographical referencing size of a single pixel – resolution

2) pseudo-spatial data : describe / related to the characteristics of real world features ex. street address, demographic characteristics

conversion of pseudo-spatial data into spatial data is a very time consuming & resource intensive

2

(3)

Spatial Data

Pseudo-spatial Data

Vector Data

Street

Addresses

Scanned maps / air

photos Alpha-

numeric data

Geocoding

Digitising

Rectification

Registration

Layers of Spatial Data (See Figure 4.2) Application

Data Trans-

formation

Raster Data

Base Map

Automated vectorisation

Topographic Base

Fig 4-1 Types of spatial data

3

(4)

2. 2 A functional perspective of spatial data

four categories of spatial data in a functional classification

base map data : geodetic control + various types of topographic base data framework data : parcel layer + facilities layer + address layer

application data : spatial datasets for different DB applications

business solution : support many operations & decision making functions

4

(5)

Geodetic Control Network

Orthophotography Planimetric Detail Topography

Cadastral Fabric Street Centre-line Building Footprint Hydrology Address

Facilities Parcel

Natural Resources Geology Environment Tax District

Jurisdiction Unit

Census Tract Zoning

Election District Land Use Land Cover

Public Safety and Security

Environmental Impact Assessment Facilities

Management

Building Permits and Inspection Goods and Services

Delivery

Resource Planning and Management

Base Map DataFramework DataApplication DataBusiness Solutions

Digital Terrain Model

Fig 4-2 A functional classification of spatial data

5

(6)

3. Spatial data structure & DB models

two key aspect of spatial data – geometry + topology

3.1 The concept of a “geometry” of spatial data

geometry is to represent a spatial feature as an object

OGC geometry object model (Open GIS Simple Feature Specification for SQL) geometry : non-instantiable construct

four subclasses (point, curve, surface, geometry collection) : instantiable construct there are many geometric types – so called graphical primitives

geometries sharing the same attributes form a layer (/ feature class)

6

(7)

Geometry Spatial Reference System

Point Curve Surface Geometry Collection

Line String Polygon MultiSurface MultiCurve MultiPoint

Line Linear Ring MultiPolygon MultiLine String

Legend:

Aggregate / form Is a subclass of

Fig 4-3 The OGC geometry object model

7

(8)

Layer

Coordinates Graphical Primitives Collection Geometry

Spatial Hierarchy Examples

Roads, rivers, land parcels, land use / cover

One or more of the roads, rivers, land parcels, land use / cover polygons from a single layer

One or more of the road and river segments, parcel lines and land use / cover boundaries in a parent geometry

Individual points, lines and polygons that are used to represent a geometry

(x, y) or (latitude, longitude)

Fig 4-4 The concept of geometry and its relationship w/ other elements as

representations of spatial features 8

(9)

3.2 The concept of topology & topological data structures

topology : a field of mathematics studying the properties of geometric figures & their relationships typically studying adjacency, connectivity, containment

relationship can be defined by 3 primitives – nodes(0cell), edges(1cell), polygons(2cell) one & two dimensional topology : 1D - network topology by nodes + edges

2D – planar topology by closed polygons terms definition

node : 0D, one / more edges (ex. arcs, chains, lines) connect to form a topological junction edge : 1D, formed by a directed, non-branching line segments bounded by a from & to node polygon : 2D, closed by connected & directed edges

usually, arc-node topology is built to enforce the topological relationship ex. geo-relational data model of an Arc/Info coverage – AAT, PAT tables advantage of topological data structure

automatic detection & correction of digitizing & editing errors, artifacts

reduction of storage requirements (ex. boundaries shared by adjacent polygons are stored once) enables sophisticated spatial analysis & applications

9

(10)

(a) Non-topological (cartographic) data structure (b) Topological data structure

A B

Polygon A = (403600, 275700), (403000, 275700), (403000, 275000), (403300, 275000), (403600, 275700)

Polygon B = (403600, 275700), (403300, 275000), (404000, 275700), (404000, 275700)

Vertice_ID X Y

b 403000 275700 c 403000 275000 e 404000 270500 f 404000 275700 Poly_ID Arcs

A 1, 2 B 2, 3 Polygon File

Node File

Node_ID X Y

a 403600 275700 d 403300 275000

A B

b a f

c d e

1

2

3

Arc File

Arc_ID Vertices

1 b,c 2 - 3 e,f

Coordinate File

Network Topology File Arc_ID F_node T_node

1 a d 2 d a 3 d a

Polygon Topology File Arc_ID L_Poly R_Poly

1 A World 2 A B 3 B World

Fig 4-5 Topological enforcement & topological data structure

10

(11)

3.3 Non-topological data structure

shapefile – non topological data structure, by ESRI

open data model w/ full-polygon data structure

limitations

limited cartographic rendering capability

incompatibility w/ relational DB management principles & techniques not efficient spatial analysis

lack of support for transferring metadata

11

(12)

3.4 The geo-relational model

conventional data model for spatial data

spatial data are abstracted into a series of independently defined layers

each layer represents a selected set of associated spatial features (ex. road, soil type)

spatial features on each layer are the same type of graphical primitives – points, lines, polygons attributes are stored in separate relational tables – attribute tables

attribute tables are logically linked by the unique feature identifiers (FID) best example – arc node model (of ESRI coverage)

12

(13)

Roads / highways Soil types Land cover Land parcels Drainage

1 e,f 2 f,g 3 a,b 뀉..

뀉..

10 f,j 11 j,o 12 j,k,l,m,n Arc File

Arc # Coordinate list

1

2 4

5 3 6

7 8

9

12

10 11

a

c b d

e

f

h g

i

j k

l

m n

o

Coordinates File

Point # X Y

a 10480 67324

b 10495 67221

c 10321 67230

뀉. 뀉. m 11084 68030

n 11012 68090

o 11907 67230

ID Class No. of Lanes 1 1 4

2 1 4

3 2 2

4 2 2

뀉. 뀉. 11 2 2

12 2 2

ID Maintenance date 1 2005 May 06 2 2005 Dec 02 3 2005 Aug 15 4 2006 Jan 10 뀉.

뀉.

11 2005 Jun 27 12 2004 Nov 10 Road attribute table

Pavement Management Table Roads / highways

Storing of spatial data by breaking down features into graphical primitives

Creating a line feature from stored point coordinates

Linking spatial and text-based data by a common feature identifier (FID)

Linking different text-based tables using a common feature identifier (FID)

Attribute data stored in a relational database

Fig 4-6 The geo-relational model

13

(14)

3.5 The geodatabase model

allows a user to define spatial data as specific abstract data types

→ making it possible to store spatial data w/ their associated attribute data in a single DB advantages (compare to geo-relational model)

take full advantage of the available indexing, transaction management DB constraint mechanisms to maintain the integrity of the spatial data cost effective

best example – geodatabase (of ESRI) – from personal geoDB to enterprise geoDB spatial data that share the same attributes are stored in a single table

table has two sets of fields – predefined fields : FID, geometry, area

custom fields : attribute data associated w/ spatial data

values can be updated by transaction processing topology is implemented by using integrity rules stored in a topology tables

enforce topological relationship to feature class in a single table ex. adjacency, connectivity, containment

14

(15)

FEATURE DATA SET NON-SPATIAL DATA TABLES

SURVEY DATA SET Feature Class

PF FK Other Keys

Feature Class Rules / Constraints Topology

Obj-ID Geometry Connectivity Rules Geometric Network

Obj-ID Geometry User-Defined-Fields Obj-ID User-Defined-Fields Attribute Data Table

Point-ID N E Control Points

Point-ID N E Coordinate List

RASTER DATA SET

METADATA DOCUMENT

Georeferencing

Georeferencing Metadata Extraction

Metadata Extraction

Metadata ExtractionMetadata Extraction

Graphics-attribute link

Relations Table

External link

Fig 4-7 Structure of a spatial DB using a DBMS for the storage of spatial data & topological relationships

15

(16)

SIN Address Telephone 004334125 90 Highview Avenue 519-0909 200298900 450 Kingsway East 690-0808 434222234 1234 Hamilton Road 690-2234 421004009 400 Hunt Club Drive 417-8485 334222090 1185 University Street 680-9121

FID Geometry Shp-area Owner SIN Zoning Frontage Date reg.

100 6000.5 VanDamme 004334125 1a 50.0 2003 05 12 102 5600.0 McGrath 200298900 1a 48.5 2003 09 20 124 7200.0 Henderson 434222234 a 60.5 2002 12 12 137 10800.0 Thornley 421004009 1b 200.0 2003 06 01 166 8400.5 Valade 334222090 1a 80.5 2001 05 20

Predefined fields Custom fields

1a Single-family residential 1b Multi-family residential 2 Commercial

3 Industrial 4 Institutional Code Description

Linking to another relational table using a unique key Linking to a lookup table using a classification code

Fig 4-8 Table structure of a geodatabase

16

(17)

Lot 65

Lot 66 Building

Lot line

Lot line

Feature Class Rule Feature Class

Lot_lines Must not have dangles Lots Must not overlap Owner_parcel Must be closed

Lot_lines Must be covered by Lots

Buildings Must be covered by Owner-parcel Buildings Must be covered by Lots

Buildings Must not overlap Lot_lines Lots Must be formed by Lot-lines Lot_lines Must not overlap Buildings

Topology File

Fig 4-9 Storing topological relationships using an integrity rule

17

(18)

4. Spatial DB systems

4.1 Definition & classification of spatial DB systems

three characteristics : a sort of DB sys

offers spatial data type (SDT) & query language

provides at least spatial indexing & efficient algorithms for spatial joins spatial DB sys works as the underlying technology of GIS

many spatial DBs are now developed as spatial data warehouse → supply GIS users w/ timely & relevant spatial data

spatial DB sys vs. GIS → Table 4-1

18

(19)

GIS Tools and Data Engine

Data File

Proprietary GIS API

Proprietary GIS Data Format

GIS Applications

GIS Applications GIS Tools

Proprietary GIS API

Spatial Applications

Extended SQL

Extended SQL

Generic DBMS User

Interface

GIS Data Engine GIS Applications GIS Tools

RDBMS GIS

Data Engine

Proprietary GIS API

Proprietary

GIS API Standard

SQL

(a) Data file-based spatial data processing using a GIS before the mid-1990s

(b) DBMS-based spatial data processing using a GIS in the late 1990s

(c) Today 뭩 spatial data processi

ORDBMS

Stored Spatial Data Processing

Procedures Spatial Index

Corporate Database /

Data Warehouse

Data integration / sharing Data integration / sharing

Fig 4-10 Evolution of spatial data processing

19

(20)

20

(21)

4.2 Characteristics of spatial DB systems

4.2.1 Spatial data types (user-defined / abstract data types)

OGC geometry object model provides a conceptual standards-based framework for ADT different SW vendors implement the concept in different ways

Oracle Spatial – 9 SDT called geometric primitive types

IBM DB2 Spatial Extender – geometry type to describe its ADT ESRI geodatabase – feature geometry

21

(22)

(a) Geometry types used in the object-oriented model of Oracle Spatial

(b) Geometry types and sub-types of DB2 Spatial Extender

(c) Feature geometry of ArcGIS Geodatabase

Point Line string Polygon

Arc-line string Arc polygon Compound polygon

Compound line string Circle Rectangle

Super-type

Polygon

Rectangle

Square

Ellipse

Circle Sub-type of geometry

Point

Multi-point

Line String

Multi- linestring

Multi- polygon

Sub-type of polygon

Sub-type of rectangle

Sub-type of ellipse

Points Lines Polygons

Multipoint

Point

Multipart polyline

Single-part polyline

Path

Multipart polygone

Single-part polygon

Ring

Line Circular arc Elliptic arc Bezier curve Segments

Fig 4-11 Spatial data type used Oracle Spatial, IBM DB2 Spatial Extender & ESRI Geodatabases

22

(23)

4.2.2 Spatial data indexing & access method

spatial indexing – expedite access to & return of data to a user from a DB

more complicated than table indexing – it deals w/ 2D space not linear array in tables

concept is the use of approximation to gradually narrow its search area until objects are found numerous indexing methods – R tree, B tree, quadtree

R-tree : more commonly adopted method

multi-level tree that stores a set of rectangles in each node * the rectangle - minimum bounding rectangle (MBR)

index stores the reference numbers of the MBRs + coordinates of its 4 corners + object IDs

23

(24)

R1 R2

R3 R4 R5 R6 R7 R8

R9 R10 R11 R12 R13 R14 R15 R16 R17 R18 R19 R20 R21

Root page

Branch pages

Leaf pages

R1

R2

R3

R4

R5

R6

R7

R8 R9

R10

B

R11 C

R12

R13

R15 R14

R16

R17

R18

R19 R20

R21 A

(a) The R-tree indexing hierarchy

(b) Spatial relationships among bounding boxes in a R-tree index

Fig 4-12 The R-tree index

24

(25)

4.2.3 Spatial data integrity & constraints

integrity constraints - business rules to protect the data by ensuring accuracy, correctness, validity six classes of spatial data integrity constraints (Cockcroft’s view)

static topological int conts – ex. all polygons must be closed

transition topological int conts – ex. if a polygon boundary is modified, all the conjugate polygons must be updated simultaneously

static semantic int conts – ex. area of land parcel must not be negative

transition semantic int conts – ex. subdivided land parcels must have the same sum area as the original land parcel

static user-defined int conts – ex. rivers wider than 2m must be stored as polygons

transition user-defined int conts – ex. after re-zoning a land parcel, the land use status must be updated within 2 days

cf. data modeling & DB operations case (in Chapter 2)

: domain constraints, key& relation constraints, semantic constraints

25

(26)

4.2.4 Long transaction management

DB transaction - involves movement of data in & out of DB + recording of the process spatial DB transaction is different from the conventional DB transactions

need to handle long transactions (ex. road fabric update – takes several days, not seconds)

different vendors use different solutions to the long transactions problem ex. Oracle – workspace manager

: support multiple versions of all records in a table

users can change these versions independently & share w/ others

26

(27)

4.3 Spatial data processing

4.3.1 Classification of spatial operators

a spatial query is formulated using one / more operators

OGC classification of spatial operators (→ Table 4-2)

basic operators – allow to access the general properties of a geometry topological operators – express spatial relationship between geometries

spatial analysis operators – allow to construct analytical spatial queries using a single /multiple geometries

27

(28)

28

(29)

4.3.2 Spatial operations & filtering

large size of a typical spatial DB + complexity of spatial operations → requires filtering example solution : Oracle Spatial : two-tier approach

primary filter – reduce the number of candidate geometries by the spatial index of DB secondary filter – made up of one /more spatial operators

advantages - expedite the process of accessing the DB

29

(30)

Primary Filter - Spatial Index Large input

data source

Smaller input data source

Secondary Filter - Spatial operators

Results of Spatial queries

Fig 4-13 Spatial query using the method of two-tier filtering

30

(31)

4.3.3 Topological relations & predicates

among many spatial operators, topological operators play a significant role in spatial queries topological relations are used w/ predicates

* predicates = Boolean function, return 1(TRUE) if a comparison meets the function criteria 0(FALSE) otherwise

basic problem w/ the use of topological predicates is to define all possible relationships DE-9IM (Dimensionally Extended 9 Intersection Model) – define 52 topological relationships → too many to be implemented in a spatial DB sys !

thus, most spatial sys include a subset of the possible topological relations (Fig 4-14)

31

(32)

x

1

x

2

Disjoin (x

1

, x

2

)

x

2

x

2

x

1

x

1

x

1

x

2

x

1

/ x

2

x

1

x

2

x

2

x

1

x

2

x

1

Meet (x

1

, x

2

) Overlay (x

1

, x

2

) Cover (x

1

, x

2

)

Covered-by (x

1

, x

2

) Inside (x

1

, x

2

) Contain (x

1

, x

2

)

Equal (x

1

, x

2

)

Fig 4-14 The most common topological relations in spatial systems

32

(33)

4.3.4 Spatial joins

spatial join : a spatial query that compares two / more geometries

4.3.5 Spatial SQL

standard SQL is extended by spatial operators (from 1980s)

spatially extended SQL consists of 2 parts : query language + presentation language query language – define what data to retrieve

presentation language – specify how the results of a query are displayed many spatial extensions to conventional DB sys

ex. Oracle Spatial, IBM DB2 Spatial Extender

33

(34)

SELECT parcel.name FROM parcel, subdivision

WHERE within (parcel.loc, subdivision.loc) AND subdivision.name=봠ranebrook?

(a) Preservation of the basic SQL SELECT-FROM-WHERE construct

CREATE TABLE parcel

(parcel.ID char(20)

geometry ST_polygon)

(b) Defining a spatial object type 뱎arcel?as a spatial data _polygon?

SELECT city FROM ontario.city

WHERE geometry = PICK;

SELECT city FROM ontario.city

WHERE city.name = 밯aterloo?

(c) Query by location 밣ICK?(by means of a mouse) and by attribute value 밯aterlo SET CONTEXT

FOR parcel.geometry

SELECT parcel.geomemtry, building.geometry, road.geometry, easement geometry FROM parcel, building, road, easement

WHERE parcel.ID = 밚ONDON00221122145678”

(d) Setting the background information (building, road, easement) for a spatial object 뱎a SET LEGEND

COLOUR green LINE.TYPE dashed FOR SELECT boundary.geometry FROM parcel

(e) Setting the property of a legend SELECT parcel

FROM parcel.layer

WHERE geometry = ZOOM.WINDOW;

SELECT parcel FROM parcel.layer WHERE geometry = PICK

(f) Restricting a query to a specific area

Fig 4-15 Examples of using spatial SQL

34

참조

관련 문서

Field : Spatial distribution of scalar and vector quantity Electric field and magnetic field.. 3-1

data mining - process of applying machine learning, visualization, statistical analysis. knowledge discovery & construction - evaluation & interpretation of the extracted

Data standards and metadata in spatial database systems. 5.1 Issues with implementing standards and metadata in

middleware : communication SW tools that support data transmission & data processing over networks DBMS : composed of DB, DB engine, user interface,

XML - basic foundation, provides a language for defining data & method of processing them SOAP(Simple Object Access Protocol) - a collection of XML based rules

„ Group-spatial reuse: different parts of the program access the same cache line.... „ Generally takes

ƒ Define a type Department with a field name and a field head which is a reference to the type Person, with table people as scope:. create type Department ( create

Can be directly or indirectly linked to Operational data  Possible to extracts data from an operational database and then stores it in a multidimensional structure for