populārākās grafiskās datu bāzes sistēmas · web view(a set of two or more coordinates,...

42
Vektoru grafika. Grafisko datu pamattipi 1. Point. Geometric aspect of an object, for which only its location in space, but not the extent, is relevant. city 2. Line (polyline). Moving through space, connections in space. river cable highway 3. Region. Abstraction of an object with extent. forest lake city 4. Partitions. 5. Networks (graphs). 1

Upload: truongdat

Post on 12-Mar-2018

226 views

Category:

Documents


7 download

TRANSCRIPT

32

Vektoru grafika. Grafisko datu pamattipi

1. Point. Geometric aspect of an object, for which only its location

in space, but not the extent, is relevant.

city

2. Line (polyline). Moving through space, connections in space.

river

cable

highway

3. Region. Abstraction of an object with extent.

forest

lake

city

4. Partitions.

5. Networks (graphs).

Grafisko datu pamattipu (spatial data types) lietotie nosaukumi angu valod

GEOMETRY (abstract superclass)

POINT (a single coordinate, usually but not necessarily 2 dimensional)

LINESTRING (a set of two or more coordinates, with a linear interpretation of the path between the coordinates)

LINEARRING (a linestring of three or more coordinates in which the start and end points are the same, usually not instantiable, but used to build polygons)

POLYGON (a set of one or more closed linearrings, one exterior ring that defines a bounded area, and a set of interior rings that define exceptions (holes) to the bounded areas)

MULTIPOINT (a set of points)

MULTILINESTRING (a set of linestrings)

MULTIPOLYGON (a set of polygons)

GEOMETRYCOLLECTION (a heterogeneous set of geometries)

Simpleksi un veidoli (simplexes and faces)

d-simplex - minimal object of dimension d

d-simplex consists of d+1 simplices of dimension d-1

Finite set of simplices such that the intersection of any two simplices is a face (veidols).

eometriju grafiskie primitvi datu bz

Relciju datu modelis

2D punkts un klasteris. 2D punktu elementi ir elementi, kas sastv no divm koordintm X un Y, kas tiek lietoti garuma un platuma nordanai.

2D lniju virknes. Lniju virknes sastv no viena vai vairkiem punktu priem, kas defin lniju segmentus.

2D n-punktu daudzstri.

Daudzstri sastv no savienotm lniju virknm, kas veido aizvrtu gredzenu. Daudzstri, kas prklj cits citu, nav pielietojami. Lai iegtu nepiecieamo veidu, lieto lniju virknes, kas krustojas. Ja lnijas krustojas paas ar sevi, tad tas nenozm, ka veidojas daudzstris.

eometriju grafiskie primitvi datu bz

Relciju-objektu datu modea tipi

2D lniju loku virknes.

2D loku daudzstri.

2D savienojamie daudzstri.

2D savienojams lniju virknes.

2D rii.

2D optimiztie taisnstri.

DBVS Oracle11g grafikas pamatstruktras

eometrisko datu modea hierarhisk struktra

eometrisko datu modelis ir hierarhiska struktra, kura sastv no elementiem, eometrijas, sliem, kuri atbilst telpisko datu attlojumiem (ceu slnis, ku slnis); koordintu sistmas (x un y) un precizittes. Sli tiek veidoti no eometrijas, kura tiek veidotas no elementiem.

elementi

eometrijas

sli(layers)

koordintu sistma

precizitte

Elements ir eometrijas pamata bloks. Atbalsttie elementu tipi ir atkargi no izvlt modea tipa, piemram, relciju modeli tie ir punkti, lniju virknes, un daudzstri. Katra koordinta element tiek glabta k X un Y pris, bet punkta dati satur tikai vienu koordintu pri,. lnijas divus prus. rjais un iekjais daudzstra gredzens ir divi dadi elementi, kas veido komplicto daudzstri. Daudzstra dati satur koordintu vrtbu prus, katrs pris vienam daudzstra segmentam.

eometrija ir lietojuma telpisks pabas attlojums, kas ir modelta k primitvo elementu kopa. eometrija relciju un relciju-objektu modeos ir atirga.

Slnis ir eometriju heterogna kolekcija, kas sastv no eometrijm, kurm ir vienda atribtu kopa. Piemram, viens IS slnis satur informciju par ceiem, otrs par km utt., slu skaits nav ierobeots.

Koordintu sistma jeb telpisk raksturojuma sistma ir koordintu sasaiste, kas auj interprett veidoto objekti pozcijas. Koordintu sistma var bt eogrfiska rakstura, kad standarta mrvienba ir metri, un neeogrfiska, kad lietotjam ir iespja lietot savas mrvienbas.

Precizitte tiek lietota, lai asocitu precizittes lmeni ar telpiskajiem datiem. Ts vrtba ir pozitvs skaitlis, kas lielks par nulli. Precizittes vrtba ir metrisks skaitlis.

Sli

Sli (layers):

za zona (lniju virknes);

cei (lniju virknes);

kas (n-punktu daudzstri);

brvs zemes gabals (poligons).

(kasceiza zonabrvs zemes gabals)

Lmeu izmantoanas piemrs

Oracle Spatial eometrijas objektu modelis

eometrisko objektu tips SDO_GEOMETRY un t elementi (tiek izmantot ar Oracle Spatial)

SDO_ELEM_INFO SDO_ORDINATES

SDO_ SDO_ SDO_

GTYPE SRID POINT SDO_STARTING_OFFSET X1, Y1, X2, Y2, . . .

SDO_ETYPE

SDO_INTERPRETATION

create type SDO_GEOMETRY as object( SDO_GTYPE number, SDO_SRID number, SDO_POINT SDO_POINT_TYPE, SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY, SDO_ORDINATES SDO_ORDINATE_ARRAY);

create type SDO_POINT_TYPE as object( X number, Y number, Znumber);

create type SDO_ELEM_INFO_ARRAY as varray(1048576) of number;

create type SDO_ORDINATE_ARRAY as varray(1048576) of number;

IBM DB2 Spatial Extender eometrijas objektu modelis

MS SQL Server eometrijas objektu modelis

Iekautie grafikas datu tipi DBVS PostgreSQL

PostgreSQL grafisko datu apstrdes iekauts funkcijas

Grafisks informcijas meklana (vaicjumu realizana)

Parkljumu veidi (types of intersections)

eometriju predikti (geometric predicates)

Vaicjumu realizanas metodes grafiskajs datu bzs

1. Neprtraukts aproksimcijas (continuous approximations).

2. Rea tipa aproksimcijas (grid approximations).

One-Dimensional Embedding of Grid Approximations

Basic idea:

1) find a linear order for the cells of the grid preserving proximity;

2) define this order recursively for a grid corresponding to a hierachical subdivision of space.

z-order, Morton-order

Represent any shape by a set of bit strings, called z-elements

1. Put z-elements as spatial keys into a B-tree B.

2. Containment query with rectangle r:

- determine z-elements for r;

- for each z-element z scan a part of the leaf sequence of B having z as a prefix;

- check theses candidates for actual containment, avoid

duplicate reports.

Universlo DBS indeksi

Grafisko indeksu veidoana (indexes of graphic)

Grafisko objektu telpa (space of graphics)

eometrisko datu indeksu (spatial indexes) tipi

1) Grid (spatial index);

2) Z-order (curve);

3) Quadtree;

4) Octree;

5) UB-tree;

6) R-tree: Typically the preferred method for indexing spatial data. Objects (shapes, lines and points) are grouped using the minimum bounding rectangle (MBR). Objects are added to an MBR within the index that will lead to the smallest increase in its size.

7) R+ tree;

8) R* tree;

9) Hilbert R-tree;

10) X-tree;

11) kd-tree;

12) m-tree - an m-tree index can be used for the efficient resolution of similarity queries on complex objects as compared using an arbitrary metric.

Aproksimjoie taisnstri (bounding boxes)

R tree tipa indeksi

The figure above illustrates an R-Tree configuration with 4 sequences.The MBR that covers the spatial data is D to M and MBR created for indexing is A to C.

Lets create an example where spatial data, which includes a random point, is searched. If the point is in a within relationship with D, G or M, then the root to leaf node can be found immediately.If the point is in the area F and J intersects, then in the root node, A will be visited first then return F, then move to root node, select C and return J.This is where the problem lies. The example in Figure 2 only has two tree levels. However, it will take a lot of time to search the tree if there is a lot of data.

These problems have been resolved in R+-Tree.

R+ - tree tipa indeksi

In the figure above, the spatial data configuration from D to M is the same as in R Tree configuration. However, the A and C MBR area is different. In R+-Tree, if needed, the overlapping areas in the same level can be brought from different nodes. You can see that J and D are redundant.

When such redundancies occur, when looking for the area F and J are intersecting, you need only to search in A MBR and do not have to search C.

Prklans noteikana (find intersecting shapes)

(2) (1)

(4) (3)

Grafisko datu datu bzes sistma

Populrks grafisks datu bzes sistmas

1. Oracle RDBMS with Spatial or Locator.

3. PostgreSQL with PostGIS.

4. IBM DB2 with Spatial Extender.

5. IBM Informix with Spatial Blade.

2. SQL Server 2008 with Spatial.

Standartu realizcija grafiskajs datu bzes sistmas

Part 2 of Simple Feature Access is implemented to varying degrees in:

1) MySQL Spatial Extensions, although "All of the functions that calculate relations between geometries are implemented using bounding boxes not the actual geometries." MySQL DBMS implements the datatype geometry plus some spatial functions that have been implemented according to the OpenGIS specifications. However, in MySQL version 5.5 and earlier, functions that test spatial relationships are limited to working with minimum bounding rectangles rather than the actual geometries. MySQL versions earlier than 5.0.16 only supported spatial data in MyISAM tables. As of MySQL 5.0.16, InnoDB,