Spatial and temporal data management

Slides:



Advertisements
Similar presentations
Jan. 2014Dr. Yangjun Chen ACS Outline Spatial Databases -Theme -Map -Geographic objects -Modeling geographic data Temporal Databases - Transaction.
Advertisements

Spatial Databases: Lecture 3 DT249 Semester Pat Browne.
Raster Based GIS Analysis
Spatial queries in SQL Server 2008 SQL Bits III – 13 th September 2008.
Spatial Information Systems (SIS) COMP Spatial queries and operations.
Geographical Database
Spatio-Temporal Databases
Geographic Information Systems
Spatio-Temporal Databases. Outline Spatial Databases Temporal Databases Spatio-temporal Databases Multimedia Databases …..
Geographic Information Systems. What is a Geographic Information System (GIS)? A GIS is a particular form of Information System applied to geographical.
Oracle spatial – Creating spatial tables Object Relational Model Creating Spatial Tables.
PROCESS IN DATA SYSTEMS PLANNING DATA INPUT DATA STORAGE DATA ANALYSIS DATA OUTPUT ACTIVITIES USER NEEDS.
Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.
1 CIS / Introduction to Business GIS Winter 2005 Lecture 2 Dr. David Gadish.
GTECH 731 Lab Session 8 10/26/10 Lab 7 Geotools. Previous Labs Labs designed to gradually introduce C# and Visual Studio Started with simple, straight.
Databases, MySQL, and PHP Peterson. The Social Network The first thing we're gonna need is a lot of pictures. Unfortunately, Harvard doesn't keep a public.
What is GIS A geographic information system (GIS) is a system designed to capture, store, manipulate, analyze, manage, and present all types of geographical.
Spatial and temporal data management Nothing puzzles me more than time and space; and yet nothing troubles me less, as I never think about them Charles.
Object Relational Model Creating Spatial Tables. Concepts Describe the schema associated with a spatial layer Explain how spatial data is stored using.
Basic Concepts of GIS January 29, What is GIS? “A powerful set of tools for collecting, storing, retrieving, transforming and displaying spatial.
Spatial and temporal data management Nothing puzzles me more than time and space; and yet nothing troubles me less, as I never think about them Charles.
Rebecca Boger Earth and Environmental Sciences Brooklyn College.
Database for Location- Aware Applications Mohammad Rezaei School of Computing University of Eastern Finland
Background in geospatial data modeling Presenter: Manolis Koubarakis Extended Semantic Web Conference 2012.
GEOREFERENCING SYSTEMS
JTS Topology Suite JTS Topology Suite An API for Processing Linear Geometry Martin Davis, Senior Technical Architect
Spatial Data Models. What is a Data Model? What is a model? (Dictionary meaning) A set of plans (blueprint drawing) for a building A miniature representation.
Spatial Database Souhad Daraghma.
Spatial Query Language Group No.15 Dhruv Dhokalia Yash Khandelwal Course Relation- Chapter 11- Object and Object-Relational Databases.
Database for Location- Aware Applications Mohammad Rezaei School of Computing University of Eastern Finland
6. Simple Features Specification Background information UML overview Simple features geometry.
How to Spatially Enable Your IBM Informix Database Chris Bosch.
Chapter 3 Digital Representation of Geographic Data.
8. Geographic Data Modeling. Outline Definitions Data models / modeling GIS data models – Topology.
Chapter 4 Introduction to MySQL. MySQL “the world’s most popular open-source database application” “commonly used with PHP”
Tables tables are rows (across) and columns (down) common format in spreadsheets multiple tables linked together create a relational database entity equals.
1 Spatial Data Models and Structure. 2 Part 1: Basic Geographic Concepts Real world -> Digital Environment –GIS data represent a simplified view of physical.
PostGIS and Spatial Queries Steve Signell, Instructor Robert Poirier, TA School of Science Rensselaer Polytechnic Institute.
Spatial DBMS Spatial Database Management Systems.
John Pickford IBM H11 Wednesday, October 4, :30. – 14:30. Platform: Informix Practical Applications of IDS Extensibility (Part 2 of 2)
URBDP 422 URBAN AND REGIONAL GEO-SPATIAL ANALYSIS Lecture 3: Building a GeoDatabase; Projections Lab Session: Exercise 3: vector analysis Jan 14, 2014.
CS 338The Relational Model2-1 The Relational Model Lecture Topics Overview of SQL Underlying relational model Relational database structure SQL DDL and.
A Quick Introduction to GIS
Geographic Data in GIS. Components of geographic data Three general components to geographic information Three general components to geographic information.
Proximity Spider Project by Ganesh Naikare Project Advisor: Professor Scott Spetka.
What is GIS? “A powerful set of tools for collecting, storing, retrieving, transforming and displaying spatial data”
1 The T4SQL Temporal Query Language Presented by 黃泰豐 2007/12/26.
Spatial Data Models Geography is concerned with many aspects of our environment. From a GIS perspective, we can identify two aspects which are of particular.
Oracle Spatial Extension of the RDBMS Oracle by spatial data types and operations –introduced in version 8 (current version.
Get Familiar with Spatial Data. Slava Murygin – SQL SlavaSQL.BlogSpot.com.
Introduction to GIS Programming Final Project Submitted by Todd Lenkin Geography 375 Spring of 2011 American River College.
Spatial and temporal data management Nothing puzzles me more than time and space; and yet nothing troubles me less, as I never think about them Charles.
Jeffery S. Horsburgh Hydroinformatics Fall 2014
Geocoding and Georeferencing
Get Familiar with Spatial Data
GIS Analysis Queries Operations Non-spatial Spatial Vector Raster
Introduction to GIS David R. Maidment
Physical Structure of GDB
Prepared by : Moshira M. Ali CS490 Coordinator Arab Open University
Spatial Database Systems
Introduction to Spatial Databases (2)
Geographic Information Systems
Spatial Data Models Raster uses individual cells in a matrix, or grid, format to represent real world entities Vector uses coordinates to store the shape.
Spatial Concepts and Data Models
JTS Topology Suite An API for Processing Linear Geometry
Modeling geographic data Temporal Databases
Geography 413/613 Lecturer: John Masich
Database Systems Instructor Name: Lecture-3.
Spatial Databases SpatiaLite & PostGIS.
Chapter 4 Introduction to MySQL.
Presentation transcript:

Spatial and temporal data management Nothing puzzles me more than time and space; and yet nothing troubles me less, as I never think about them Charles Lamb, 1810

Data management developments Location-based services Time-varying data

MySQL spatial extensions Follow the specifications of the Open Geospatial Consortium Implements a subset of the proposed extensions

Spatial data Managing spatially-referenced data Theme Map Geographic information systems (GIS) Theme The spatial counterpart of an entity River, road, scenic lookout Map A set of themes represented on paper or a screen Geographic object An instance of a theme

Generic spatial data types Dimensions Example Point Scenic lookout Line 1 River Region 2 County

Spatial Reference Support System (SRS) A coordinate-based system for geographic locations Projected A projection of a globe on a flat surface Each point is a place on the globe A length unit rather than longitude and latitude Geographic Coordinates are longitude and latitude Cartesian An infinite flat plane with no specified units

Spatial Reference Identifier (SRID) SRID identifies the coordinate space of a geometry An integer SRID 0 is an infinite flat plane with no units assigned to its axes For geographic (latitude and longitude), the SRID is 4326

Data model for political units

SQL/MM Spatial The ISO standard to manage spatial data in relational database systems It uses the prefix ST_ for all tables, views, data types, and function names Originally stood for Spatial and Temporal Spatial and temporal standards development later separated Think of ST as Spatial Type

MySQL geometric data types Representation Description Point POINT(x y) A point in space (e.g., a city) LineString LINESTRING(x1 y1,x2 y2,…) A sequence of points with linear interpolation between points (e.g., a road) Polygon POLYGON((x1 y1,x2 y2,…), (x1 y1,x2 y2,…)) A polygon (e.g., a boundary), which has a single exterior boundary and zero or more interior boundaries ( i.e., holes)

Create tables CREATE TABLE political_unit ( unitname VARCHAR(30) NOT NULL, unitcode CHAR(2), unitpop DECIMAL(6,2), PRIMARY KEY(unitcode)); CREATE TABLE boundary ( boundid INTEGER, boundpath POLYGON NOT NULL SRID 0, PRIMARY KEY(boundid), CONSTRAINT fk_boundary_polunit FOREIGN KEY(unitcode) REFERENCES political_unit(unitcode)); CREATE TABLE city ( cityname VARCHAR(30), cityloc POINT NOT NULL SRID 0, PRIMARY KEY(unitcode,cityname), CONSTRAINT fk_city_polunit FOREIGN KEY(unitcode)

Insert rows INSERT INTO political_unit VALUES ('Republic of Ireland','ie', 3.9); INSERT INTO political_unit VALUES ('Northern Ireland','ni', 1.7); INSERT INTO boundary VALUES (1,ST_GeomFROMText('POLYGON((9 8, 9 3, 4 1, 2 2, 1 3, 3 5, 3 6, 2 6, 2 9, 5 9, 5 10, 6 11, 7 11, 7 10, 6 9, 7 8, 7 9, 8 9, 8 8, 9 8))', 0),'ie'); (2,ST_GeomFROMText('POLYGON((7 11, 9 11, 10 9, 10 8, 8 8, 8 9, 7 9, 7 8, 6 9, 7 10, 7 11))', 0),'ni'); INSERT INTO city VALUES ('Dublin',ST_GeomFROMText('POINT(9 6)', 0),'ie'); INSERT INTO city VALUES ('Cork',ST_GeomFROMText('POINT(5 2)', 0),'ie'); INSERT INTO city VALUES ('Limerick',ST_GeomFROMText('POINT(4 4)', 0),'ie'); INSERT INTO city VALUES ('Galway',ST_GeomFROMText('POINT(4 6)', 0),'ie'); INSERT INTO city VALUES ('Sligo',ST_GeomFROMText('POINT(5 8)', 0),'ie'); INSERT INTO city VALUES ('Tipperary',ST_GeomFROMText('POINT(5 3)', 0),'ie'); INSERT INTO city VALUES ('Belfast',ST_GeomFROMText('POINT(9 9)', 0),'ni'); INSERT INTO city VALUES ('Londonderry',ST_GeomFROMText('POINT(7 10)', 0),'ni'); SRID SRID

Reviewing the boundary

Some MySQL geometry functions Description ST_X(Point) The x-coordinate of a point ST_Y(Point) The y-coordinate of a point ST_Length(LineString) The length of a linestring ST_NumPoints(LineString) The number of points in a linestring ST_Area(Polygon) The area of a polygon ST_Distance(Point,Point) Distance between two points The SRID value for a column determines the formula used for calculating area or distance.

Area What is the area of the Republic of Ireland? SELECT ST_Area(boundpath)*1406 AS 'Area (km^2)' from political_unit JOIN boundary ON political_unit.unitcode = boundary.unitcode WHERE unitname = 'Republic of Ireland'; Area(km^2) 71706 One unit on the map is 37.5 km so the area of one grid unit is 1406 km2

Exercises What is the area of Northern Ireland in square kilometers? How close is the computed value to that reported in Wikipedia? Wikipedia gives 13,840 km²

Distance How far, as the crow flies, is it from Sligo to Dublin? SELECT ST_Distance(orig.cityloc,dest.cityloc)*37.5 AS "Distance (kms)" FROM city orig, city dest WHERE orig.cityname = 'Sligo' AND dest.cityname = 'Dublin'; Distance (kms) 167.71

Closest What is the closest city to Limerick? cityname Tipperary SELECT dest.cityname FROM city orig, city dest WHERE orig.cityname = 'Limerick' AND ST_Distance(orig.cityloc,dest.cityloc)= (SELECT MIN(ST_Distance(orig.cityloc,dest.cityloc)) FROM city orig, city dest WHERE orig.cityname = 'Limerick' AND dest.cityname <> 'Limerick'); cityname Tipperary

Westernmost What is the westernmost city in Ireland? SELECT west.cityname FROM city west WHERE NOT EXISTS (SELECT * FROM city other WHERE ST_X(other.cityloc) < ST_X(west.cityloc)); cityname Limerick Galway

Exercise What is the eastern most city in Northern Ireland?

Geometry collections A geometry collection is a data type for one more other geometries MultiPoint MultiLineString MultiPolygon geometrycollection

MultiPoint A collection of points Data type is MULTIPOINT Bus stops on a campus Data type is MULTIPOINT MULTIPOINT(9.0 6.1, 8.9 6.0)

MultiLineString A collection of line strings Bus routes on a campus Data type is MULTILINESTRING MULTILINESTRING((9 6, 4 6), (9 6, 5 2))

MultiPolygon A collection of polygons Buildings on a campus Data type is MULTIPOLYGON MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((5 5,7 5,7 7,5 7, 5 5)))

GeometryCollection A collection of geometries Bus route and its bus stops Data type is GEOMETRYCOLLECTION GEOMETRYCOLLECTION(LINESTRING(15 15, 20 20), POINT(10 10), POINT(30 30))

Inserting data Example INSERT INTO table VALUES ST_GeomCollFromText('GEOMETRYCOLLECTION(POINT(1 1),LINESTRING(0 0,1 1,2 2,3 3,4 4))');

Exercise Modify the example database design to include: Historic buildings in a city Walking paths in a city Use of the MULTIPOLYGON data type to indicate a political region’s boundary

R-tree Used to store n-dimensional data (n>=2) Minimum bounding rectangle concept A B C D E X Y S e q u n c s t I d x

R-tree searching Search for the object covered by the shaded region A X

Temporal data Data have an associated time When valid When stored Different database states recorded Larger databases

Times Transaction time Valid time Timestamp applied when data are entered Valid time Time when value is valid or true

Times

Modeling temporal data

TSQL Need additional features for Data definition Constraint specification Data manipulation Querying TSQL (temporal structured query language) is designed to provide these features

Conclusions The need to maintain spatial data will increase as location-based services become more common Temporal data management will become more common so that companies and customers have a complete historical record New data types creates a need for new functions