You are on page 1of 48

SPATIAL DATA ANALYSIS

By
Dr. Vandita Srivastava
vandita@iirs.gov.in
Geoinformatics Department,
Indian Institute of Remote Sensing,
Dehradun, India

15th Satellite Based Training Programme on RS-GIS-GPS


Module 3-GIS, 07 October 2015

Coverage

Introduction to Spatial Data Analysis

Why Spatial Analysis


What it is
What is special about spatial analysis
Spatial and non-spatial queries
Classification of Spatial Functions
General Operations

Spatial Analysis Functions & Tools

Retrieval & Selection


Measurement & (Re) Classification
Overlay Operations
Neighborhood & Connectivity
Dr. Vandita Srivastava,
Geoinformatics Department,
RSGG/IIRS, ISRO/DOS/GOI

Agenda Item 1
Introduction to Spatial Data Analysis

Why Spatial Analysis?


What is special about Spatial Analysis?
Spatial and non-spatial queries
Various types of spatial analyses
Classification of Spatial Analysis Functions
Steps involved in a Spatial Analysis Project
An example- site suitability analysis

Why spatial analysis?

To study and understand the real world


processes by developing and applying
manipulation and analysis criteria.
To
reveal
new
or
previously
unidentified information
To carryout integrated modeling.

Dr. Vandita Srivastava,


Geoinformatics Department,
RSGG/IIRS, ISRO/DOS/GOI

Integration and modelling of spatial data

Spatial modeling involves cyclical processing, retrieving one or more


maps from the data base which are used to create a new map. The new
map then becomes part of the data base and is available for subsequent
processing.
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

What is special about spatial


analysis in GIS Domain ?

Analytical capabilities that use spatial


and non-spatial data to answer
questions (4 Ws & 1H) and solve
problems that are of spatial relevance!

What are Most suitable locations of a dam?


(prescriptive model)
How will fire spread in next 2 days?
(predictive model)
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

Classification of Spatial Functions

Retrieval, Selection & Measurement,


(re) Classification
Overlay operations
Neighborhood & Connectivity functions

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

Generic Operations useful in GIS

Query

Spatial and Non Spatial

Arithmetic Operations
Relational Operations
Logical Operations

Querying the GIS


Spatial analysis in GIS involves three types of
operations
Attribute Query
Spatial Query
Generation of new data sets from original
data base
The scope of spatial analysis ranges from a simple query about the spatial
phenomenon to complicated combinations of attribute queries, spatial
queries, and alterations of original data.
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

Attribute Query
Requires the processing of attribute data exclusive of spatial
information.
Parcel No.
102
103
104
105
A sample parcel map

Size
7,500
7,500
9,000
6,600

Value
200,000
160,000
250,000
125,000

Land Use
Commercial
Residential
Commercial
Residential

Attribute table of the sample parcel map

Listing of Parcel No. And value with landuse = commercial

is an attribute query
Dr. Vandita Srivastava,

Geoinformatics Department,
RSGG/IIRS, ISRO/DOS/GOI

10

Spatial Query
Involves selecting features based on location or spatial
relationships, which require processing of spatial information.
Parcels identified through
spatial query
Parcels not selected
Parcels within a specified distance identified through spatial query

Identification of all parcels within 10 m distance is a spatial query


Dr. Vandita Srivastava,
Geoinformatics Department,
RSGG/IIRS, ISRO/DOS/GOI

11

Useful Operators

Query

Spatial and Non Spatial

Arithmetic Operations
Relational Operations
Logical Operations

Arithmetic operators

+, -, *, /
MOD (modulo division)
DIV (integer division)
goniometric operatos: sin, cos, tan, asin, acos,
atan.
Raster2 := Raster1 * 5
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

13

Relational/ Comparison operators


EQ
GT
LT
GE
LE
NE

=
>
<
>=
<=
#, <

Equal to
Greater than
Less than
Greater than or equal to
Less than or equal to
> Not equal to

C:=A<>B is true when the cells value in A differs from the


cells value in B. It is false if they are the same.
Field
Area

Value
<
< 400,000

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

14

Relational operator
Area < 400,000

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

15

Logical Operators
AND
OR NOT
XOR

Logical Operators

The logical conditions are specified with

operands (data elements)


operators (relationships among data elements)
the cell values of the output raster is either true or
false

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

17

Logical functions
Set Theory
A

AND

intersection

OR

union

XOR

exclusion

NOT

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

negation
18

Agenda Item 2
Spatial Analysis Functions and Tools
Retrieval & Selection
Measurement & (Re) Classification
Overlay Operations

Neighborhood & Connectivity

Retrieval & Selection


pixel information
spatial selection

Interactive spatial selection


Selection by attributes
Selection using spatial relationships

Data retrieval and selection


Data

retrieval

involves
the
selective
search,
manipulation and output of data without the
requirement to modify the geographic location of the
features involved.

(linked) Spatial and attribute data are retrieved.


No changes are made to the location of spatial elements, and
No new spatial elements are created
To find out what exist at a particular location. What is at... ?
Retrieval of spatial data (points, lines, polygons or mapping units in a
raster map), which are an answer to the question Where is ....?
Retrieval of information using conditional, logical and arithmetical
operators.
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

21

Data retrieval (raster model)


Rock

PIXEL INFORMATION

Slope

Row
Column Value
6
7
2
x: 10300
y: 56456

Soil

Map 1 Soil 2
Table Soil
Soil:
Silt
Thickness:
5

Recnr
1
2
3

Soil Thickness
Sand 10
Silt
5
Clay
15

Map 2 Rock 3
Table Rock
Rock:
Granite
Strenght: High
Map 3 Slope 2
Table Slope
Slope:
Gentle

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

22

Data retrieval in ILWIS

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

23

Data retrieval by attribute values


Attribute table: Attribute map:
City blocks
Land use

Map: city blocks


006
004 005
003
001 002
011 012
010
009
007 008
019
017 018
016
015
013 014
025 026
024
022 023
020 021
032 033
030 031
029
027 028
038 039
037
036
034 035
044 045
043
042
040 041
046 047 048

Landuse
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
etc.

Residential
Residential
Residential
Commercial
Commercial
Recreational
Residential
Residential
Residential
Residential
Residential
Commercial
Residential
Residential
Institutional
Residential
Residential
Residential
Commercial
Residential
Residential
Institutional

Landuse:
Commercial
Institutional
Recreational
Residential

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

24

Spatial selection queries

Interactive
Spatial Selection by Attribute conditions
Relational operators
Logical operators
Combining attribute conditions
Spatial selection using topological relationships
Selecting features that are inside selection objects
Selecting features that intersect
Selecting features adjacent to selection objects
Selecting features based on their distance
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

25

Interactive

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

26

Spatial Selection by Attribute conditions


Define a selection condition on the features
attributes in a query language, such as SQL.
Display the result both on the map and in the
attribute table.
Answers questions : Where are the features
with ?

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

27

Logical operators on Attributes


AND
OR
NOT

(returns true if both expressions a and b are true)


(returns true if one or both of the expressions a
and b is true)
(returns true if expression is false)

Area < 400,000


(Area < 400,000) AND (landuse =80)
(Area < 400,000) OR (landuse = 80)
NOT (landuse = 80)
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

28

Combining attribute conditions


(Area < 400,000)AND (Landuse = 80)

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

29

Selection using Spatial Relationships


disjoint

meet

equal

overlap
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

covered by

covers

inside

contains
30

Selecting features inside selected


objects

Cities as points

Select ward 241

Select all cities in ward


241

Attribute selection

Spatial selection

Wards as polygons
Highways as lines

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

Spatial relationship inside


31

Selecting features that are


inside selected objects

2
Select all cities that are located in the state Georgia. (INSIDE RELATIONSHIP)
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

32

Selecting features that


intersect
Select the highways that run (partly) through the state Georgia. (OVERLAP)

2
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

33

Select features adjacent to


selected objects
Select all the states that are neighbors of the state Georgia.
(MEET RELATIONSHIP)

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

34

Selecting features based on


their distance
Select all cities within a distance of 100 miles of Atlanta

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

35

Assignment
Combining various selection techniques
Given road layer and building layer, how will you select all major roads
that are located within a distance of 200 meter from a hospital?

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

36

Measurement

Measurement on Vector Data

Point, Line Polygon

Measurement on Raster Data

Measurement - Vector

Distance between two points


Pythagorean distance
function:
dist ( p, q) ( x p xq ) 2 ( y p yq ) 2

If one or both features are


not a point minimal

distance

Bounding box computation


Support function
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

38

Measurement - Raster

Raster measurements
include: location, distance
and area size
Location of an individual cell
derived from anchor point
and resolution
Area size number of cells
* cell size
Distance standard
distance function applied to
the locations of their midpoints

Cell size: 30 m X 30 m
900 * 5 = 4500 m2

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

39

(re)Classification
M:N
User controlled vs. Automatic
Equal Interval vs. Equal Frequency

Classification
Classification involves the selection and presentation of a selected
layer of data based on the classes or values of a specific attribute. It
involves looking at an attribute, or a series of attributes, for a single
data layer and classifying the data layer based on the range of values
of the attribute.
Remove detail from an input dataset to reveal important spatial
patterns.
Reduce the number of classes and eliminate details.
If the input dataset itself is the result of a classification we call it a
reclassification
Reclassify data in different systems for different purposes.
Assign codes based on specific attributes.
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

41

Classification Types

Classification - Reclassification
Post processing
User controlled classification

Classification table

Automatic classification

Equal interval technique


Equal frequency technique
Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

42

(Re) Classifications
Based on the number of classes before and after the classification, three
types of classifications can be differentiated:
a) one to one (1:1)
b)

many to one (M:1)

c)

one to many (1:M)

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

43

Example: 1:M
Attribute map: Land Use

Attribute table:
City blocks

Map: City blocks

Cityblocks Landuse
001
002
003
004
005
006
007
008
009
010
011
012
013
014
015

Institutional
Commercial
Commercial
Residential
Residential
Residential
Industrial
Residential
Industrial
Industrial
Residential
Industrial
Residential
Residential
Residential

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

44

Example: M:1
Geological map reclassified in
7 classes based on geological
age

Geological map reclassified in


3 classes based on type of
lithology

Dr. Vandita Srivastava, Geoinformatics


Department, RSGG/IIRS, ISRO/DOS/GOI

45

Example: 1:1
High
Above Average
Average
Below average
Low

Classification

Reclassification

0-50,000

0-25,000

50,000-100,000

25,000-50,000

100,000-125,000

50,000-75,000

125,000-150,000

75,000-100,000

More than 150,000

More than 100,000


Dr. Vandita Srivastava, Geoinformatics
Department, RSGG/IIRS, ISRO/DOS/GOI

46

Thankyou for your attention!

Interactive Session