Loading in 5 sec....

Guofeng Cao CyberInfrastructure and Geospatial Information Laboratory Department of GeographyPowerPoint Presentation

Guofeng Cao CyberInfrastructure and Geospatial Information Laboratory Department of Geography

- By
**lars** - Follow User

- 78 Views
- Uploaded on

Download Presentation
## PowerPoint Slideshow about ' Guofeng Cao CyberInfrastructure and Geospatial Information Laboratory Department of Geography' - lars

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

Geog 480: Principles of GIS

Guofeng Cao

CyberInfrastructure and Geospatial Information Laboratory

Department of Geography

National Center for Supercomputing Applications (NCSA)

University of Illinois at Urbana-Champaign

What we have learned

- Euclidean Space
- Point, polyline, polygon
- Monotone chain
- Convex polygon, semi-convex polygon, concave polygon, monotone polygon
- Triangulation, Art Gallery Problem

- Set-based Geometry of Space
- Convexity
- Convex Hull

- Topology of Space
- Define a topology, topological invariants
- Euler formula

- Network Spaces
- Planar Graph

What we have learned

- Metric Space
- Fractal Space
- Koch snowflake

- SQL
- Join, create view

Ontology

- Ontology: the study of general classifications of, and relationships between, those things that exist in the world
- A basic ontological distinction is the division of the world into entities that have identities (objects) and entities that occur in time (events)
- Objects or continuants, may be categorized as substances, parts of substances, aggregates of substances, locations for substances, and properties of substances
- The Earth constitutes a substance; the surface of the Earth is part of the Earth; the solar system is an aggregate of planets; the USA is a location; and the Earth’s total land area is a property of the Earth

- A philosophical discipline
- Example: Fiat and bona fide boundaries

Modeling

- We are interested in modeling parts of the geographic world
- An understanding of basic ontological distinctions can help us avoid some basic modeling mistakes such as:
- Failing to distinguish real-world entities from information system entities
- Failing to distinguish substances from their properties

Example

A forest, the location of the forest, and the land-cover type “forested” fall in distinct ontological categories

Ontology vs. Modeling

- Key distinctions:
- Ontology aims to develop general taxonomies of what exists
- Data modeling aims to develop classifications within a particular application domain

- Examples:
- The distinction between substance and property is not a data modeling issue
- The decision to represent a road in a navigation system as a polyline or as an area is a data modeling question

Models

- Model: an artificial construction in which parts of one domain, the source domain, are represented in another domain, the target domain
- Purpose is to simplify and abstract away from the source domain
- Constituents of the source domain are translated by the model into the target domain
- Insight, results and computations in the target domain may then be interpreted in the source domain.
- Usefulness is determined by how closely the model can simulate the source domain, and how easy it is to move between the two domains

Morphism

- Morphism: a function from one domain to another that preserves some of the structure in the translation

Example

- Cartography and wayfinding:
- The geographic world is the source domain, modeled by a map (target domain)

Types of models

- Field-based model: treats geographic information as collections of spatial distributions
- Distribution may be formalized as a mathematical function from a spatial framework to an attribute domain
- Patterns of topographic altitudes, rainfall, and temperature fit neatly into this view.

- Object-based model: treats the space as populated by discrete, identifiable entities each with a geospatial reference
- Buildings or roads fit into this view

Relational model

- Tuples recording annual weather conditions at different locations

- The field-based and object-based approaches are attempts to impose structure and pattern on such data.

Field-based approach

- Treats information as a collection of fields
- Each field defines the spatial variation of an attribute as a function from the set of locations to an attribute domain

Object-based approach

- Clumps a relation as single or groups of tuples
- Certain groups of measurements of climatic variables can be grouped together into a finite set of types

Spatial Point Pattern

- series of point locations with recorded “events", e.g., locations of trees, locations of tweets, disease or crime incidents
- point locations correspond to all possible events (mapped point pattern), or to subsets (sampled point pattern)
- attribute values also possible at same locations, e.g., tree diameter, magnitude of earthquakes (marked point pattern)

Spatial framework

- Spatial framework: a partition of a region of space, forming a finite tessellation of spatial objects
- In the plane, the elements of a spatial framework are polygons
- Must be a finite structure for computational purposes
- Often the application domain will not be finite and sampling is necessary
- Imprecision is introduced by the sampling process

Layers

- Layer: the combination of the spatial framework and the field that assigns values for each location in the framework
- There may be many layers in a spatial database

Imagine placing a square grid over a region and measuring aspects of the climate at each node of the grid. Different fields would then associate locations with values from each of the measured attribute domains.

Spatial fields- If the spatial framework is a Euclidean plane and the attribute domain is a subset of the set of real numbers;
- The Euclidean plane plays the role of the horizontal xy-plane
- The spatial field values give the z-coordinates, or “heights” above the plane

Properties of the attribute domain

- The attribute domain may contain values which are commonly classified into four levels of measurement
- Nominal attribute: simple labels; qualitative; cannot be ordered; and arithmetic operators are not permissible
- Ordinal attribute: ordered labels; qualitative; and cannot be subjected to arithmetic operators, apart from ordering
- Interval attributes: quantities on a scale without any fixed point; can be compared for size, with the magnitude of the difference being meaningful; the ratio of two interval attributes values is not meaningful
- Ratio attributes: quantities on a scale with respect to a fixed point; can support a wide range of arithmetical operations, including addition, subtraction, multiplication, and division

Continuous and differentiable fields

- Continuous field: small changes in location leads to small changes in the corresponding attribute value
- Differentiable field: rate of change (slope) is defined everywhere
- Spatial framework and attribute domain must be continuous for both these types of fields
- Every differentiable field must also be continuous, but not every continuous field is differentiable

One dimensional examples

- Fields may be plotted as a graph of attribute value against spatial framework

Continuous and differentiable; the slope of the curve can be defined at every point

One dimensional examples

The field is continuous (the graph is connected) but not everywhere differentiable. There is an ambiguity in the slope, with two choices at the articulation point between the two straight line segments.

Continuous and not differentiable; the slope of the curve cannot be defined at one or more points

One dimensional examples

The graph is not connected and so the field in not continuous and not differentiable.

Not continuous and not differentiable

Two dimensional examples

- The slope is dependent on the particular location and on the bearing at that location

Isotropic fields

- A field whose properties are independent of direction is called an isotropic field
- Consider travel time in a spatial framework
- The time from X to any point Y is dependent only upon the distance between X and Y and independent of the bearing of Y from X

Anisotropic fields

- A field whose properties are dependent on direction is called an anisotropic field.
- Suppose there is a high speed link AB
- For points near B it would be better, if traveling fromX, to travel to A, take the link,and continue on from B to the destination
- The direction to the destination is important

Spatial autocorrelation

- Spatial autocorrelation is a quantitative expression of Tobler’s first law of geography (1970)
- “Everything is related to everything else, but near things are more related than distant thing”
- Spatial autocorrelation measures the degree of clustering of values in a spatial field

- Also termed as spatial dependency, spatial pattern, spatial context, spatial similarity, spatial dissimilarity…

Autocorrelation

If there is no apparent relationship between attribute value and location then there is zero spatial autocorrelation

If like values tend to be located away from each other, then there is negative spatial autocorrelation

If like values tend to cluster together, then the field exhibits high positive spatial autocorrelation

Example

- Spatial patterns can make HUGE differences

Operations on fields

- A field operation takes as input one or more fields and returns a resultant field
- The system of possible operations on fields in a field-based model is referred to as map algebra
- Three main classes of operations
- Local
- Focal
- Zonal

Neighborhood function

- Given a spatial framework F, a neighborhood functionn is a function that associates with each location x a set of locations that are “near” to x

Local operations

- Local operation: acts upon one or more spatial fields to produce a new field
- The value of the new field at any location is dependent on the values of the input field function at that location
● is any binary operation

Focal operations

- Focal operation: the attribute value derived at a location x may depend on the attributes of the input spatial field functions at x and the attributes of these functions in the neighborhood n(x) of x

Zonal operations

- Zonal operation: aggregates values of a field over a set of zones (arising in general from another field function) in the spatial framework
- For each location x:
- Find the Zone Zi in which xis contained
- Compute the values of the field function f applied to each point in Zi
- Derive a single value ζ(x) of the new field from the values computed in step 2

Entity and literals

- Object-based models decompose an information space into objects or entities
- An entity must be:
- Identifiable
- Relevant (be of interest)
- Describable (have characteristics)

- The frame of spatial reference is provided by the entities themselves
- Literals have an immutable state that cannot be created, changed, or destroyed

House object

Has several attributes, such as registration date, address, owner and boundary, which are themselves objects

House object

The actual values of these attributes are literals

- If the house is registered to a new owner, we may change the registration attribute to a new date, however, the date November 5th, 1994” still exists as a date

Spatial objects

- Spatial objects are called “spatial” because they exist inside “space”, called the embedding space
- A set of primitive objects can be specified, out of which all others in the application domain can be constructed, using an agreed set of operations
- Point-line-polygon primitives are common in existing systems

GIS analysis

- For Italy’s capital city, Rome, calculate the total length of the River Tiber which lies within 2.5 km of the Colosseum
- First we need to model the relevant parts of Rome as objects
- Operation length will act on arc, and intersect will apply to form the piece of the arc in common with the disc

GIS analysis

- A process of discretization must convert the objects to types that are computationally tractable
- A circle may be represented as a discrete polygonal area, arcs by chains of line segments, and pointsmay be embedded in some discrete space

Spatial object types in the Euclidean plane

- The most general spatial object type spatial is at the top of the hierarchy

- Spatialtype is the disjoint union of types pointandextent

- Class extent may be specialized by dimension into types 1- extentand2- extent

- Two sub types of the one dimensional extents are described asarcandloop, specializing tosimple arcandsimple loopwhen there are no self-crossings

Spatial object types in the Euclidean plane

- The fundamental areal object is area
- A connected areais aregion
- Aregionthat is simply connected is a cell

Topological spatial operations

- Object types with an assumed underlying topology are point, arc, loop and area
- Operations:
- boundary, interior, closure and connected are defined in the usual manner
- components returns the set of maximal connected components of an area
- extremes acts on each object of type arc and returns the pair of points of the arc that constitute its end points
- is within provides a relationship between a point and a simple loop, returning true if the point is enclosed by the loop

Topological spatial operations for areas

- XmeetsY if X and Y touch externally in a common portion of their boundaries
- XoverlapsY if X and Y impinge into each other’s interiors

Topological spatial operations for areas

- Xis insideY if X is a subset of Y and X, Y do not share a common portion of boundary
- XcoversY if Y is a subset of X and X, Y touch externally in a common portion of their boundaries

Topological spatial operations

- There are an infinite number of possible topological relationships that are available between objects of type cell

Euclidean spatial operations

- Operation centroid returns the center of gravity of an areal object as an object of type point
- Distances and angles are defined between the point elements of the space

Measurements between objects of different dimensions

Some ambiguities exist in finding the distance of a town form a motorway.

Do we mean the town center or the town as an area? Are we measuring distance along roads, as the crow flies, or by some other means?

These ambiguities must be resolved before the question can be answered properly.

Operations on spatial objects

- All of these spatial operations can be thought of as operations on spatial literals. The operands are not affected by the application of the operation
- For example, calculating the length of an arc cannot affect the arc itself

- Another class of spatial operation acts upon spatially referenced objects, and alters the state of those objects
- Create
- Destroy
- Update

Formal theories of spatial objects

- It is possible to provide formal theories for spatial relationships that have very general interpretations
- Set in a logical framework, with definition of terms, well-formed formulas, and axioms
- E.G.: Clarks calculus of individuals
- Focus is a binary connection relation between regions
- C(X,Y) = “region X is connected to region Y”
- The connection relation satisfies the following axioms:
- For each region X, C(X,X)
- For each pair of regions X,Y, if C(XY) then C(Y,X)

- Many of the set-oriented and topological relations between spatial objects may be constructed using just these two axioms

The Modified Areal Unit Problem (MAUP)

- The same basic data yield different results when aggregated in different ways
- First studied by Gehlke and Biehl (1934)
- Applies where data are aggregated to areal units which could take many forms, e.g., postcode sectors, congressional district, local government units and grid squares.
- Affects many types of spatial analysis, including clustering, correlation and regression analysis, and even Presidential election results
- Two aspects of this problem: scale effect and zoning (aggregation)effect

MAUP: Scale Effect (I)

- Scale effect
- Analytical results depending on the size of units used (generally, bigger units lead to stronger correlation)

MAUP: Scale Effect (II)

- Scale effect
- Analytical results depending on the size of units used (generally, bigger units lead to stronger correlation)

MAUP: Zone Effect (1)

- Zone effect
- Analytical results depending on how the study area is divided up, even at the same scale

Ecology Fallacy (I)

- relationships established at a specific level of aggregation do not hold at more detailed levels (spatial version of Simpson’s paradox )

Ecology Fallacy (II)

- relationships established at a specific level of aggregation do not hold at more detailed levels (spatial version of Simpson’s paradox )

Connecting to Database

- psql -U username -d database_name
- username = geog480
- database_name = tutorial
- Enter passwd when prompted (same as username)

- Postgres Commands
- \l List all accessible databases
- \dt List all the tables in current DB
- \? Help
- \q Quite

Table Creation

- SQL CREATE TABLE Syntax
- CREATE TABLE table_name(column_name1 data_type,column_name2 data_type,column_name3 data_type,....)

- Table Creation Example:
- create table count (key int, item varchar(20),count int);
- create table price (key int, item varchar(20),price float);

- Copy from a CSV file (postgres specific)
- \COPY count FROM ‘/srv/cigi/code/test.csv' with CSV HEADER

Table Insertion

- SQL CREATE TABLE Syntax
- INSERT INTO table_nameVALUES (value1, value2, value3,...)

- Insertion Example:
- insert into count values(1, ‘item0', 100);
- insert into count values(2, ‘item1', 101);
- insert into count values(3, ‘item2, 102);

- Copy from a CSV file (postgres specific)
- \COPY count FROM ‘/srv/cigi/code/test.csv' with CSV HEADER

Select Table Syntax

- Used for queries on single or multiple tables
- Clauses of the SELECT statement: (Sequence!!)
- SELECT
- List the columns (and expressions) that should be returned from the query

- FROM
- Indicate the table(s) or view(s) from which data will be obtained

- WHERE
- Indicate the conditions under which a row will be included in the result

- GROUP BY
- Indicate categorization of results

- HAVING
- Indicate the conditions under which a category (group) will be included

- ORDER BY
- Sorts the result according to specified criteria

- SELECT

Select Table Examples

- List contents of table
- select * from count;
- select * from count where item =‘item1';
- Select * from count order by key asc;
- select key, count from count limit 5;

- Counting
- selectcount(*) from count;
- selectcount(*) from count where item like '%1';

- Max/Min/Avg
- selectmax(count) from count;
- select avg(count) from countwhere item like '%1%';

Update Tables

- SQL UPDATE Syntax
- UPDATE table_nameSET column1=value, column2=value2,...WHERE some_column=some_value

- Update table Examples:
- update count set item =‘item1' where key =1;
- update count set count =105 where key=1;

- Delete Rows
- delete from count where key=1;

Join Tables

- SQL JOIN Syntax
- SELECT column_name(s)FROM table_name1JOIN table_name2ON table_name1.column_name=table_name2.column_name

- Example: Join
- select count.key, count.item, count.count, price.price fromcount join price oncount.item = price.item;

Using and Defining Views

- Views provide users controlled access to tables
- Base Table–table containing the raw data
- Concepts of View
- A “virtual table” created dynamically upon request by a user
- No data actually stored; instead data from base table made available to user
- Based on SQL SELECT statement on base tables or other views

Create View

- SQL Syntax
- CREATE VIEW view_name ASSELECT column_name(s)FROM table_nameWHERE condition

- Example: Create view:
- Create view stock_your_netid asselect count.key, count.item, count.count, price.price fromcount join price oncount.item = price.item;

View Operations

- Very similar to table operations
- Multiply two columns
- Select count*price as value from stock_your_netid

- Drop view
- Drop view stock_your_netid

Download Presentation

Connecting to Server..