You are on page 1of 21

IIRS Outreach Program

Demonstration of QGIS
Software Session 04:
Attribtue and Spatial
Queries
Prasun Kumar Gupta
Geoinformatics Department, Indian Institute of Remote Sensing
09-October-2015

Overview
Table of Content

Page 2

www.qgis.org

Non-Spatial Query
Spatial Query
Linking Spatial & Non-Spatial Data

Data & Software for todays demo

Natural Earth Data


- www.naturalearthdata.com

Software
- QGIS 2.4 Chugiak
- www.qgis.org

Page 3

Distance measurements
1

Page 4

1. Using
measurement tool
2. Using VectorGeometry toolsExport/Add
Geometry columns
3. Using VectorAnalysis-Distance
matrix

Distance measurements (2)

Page 5

2. Using VectorGeometry toolsExport/Add


Geometry columns

Distance measurements (3)

Page 6

3. Using VectorAnalysis-Distance
matrix

Selection of features - manual

1. Select Feature by
icon on menu bar (5
variants)
2. Open attribute table,
press Ctrl and select
required rows

Page 7

Selection of features manual (2)

1. Save selected
features as new
shapefile
2. Deselect features

Page 8

Selection of features by querying

3
2

Page 9

1. For simple query


click on layer and click
on Layer-Query
2. For complex query
open attribute table,
click on Show All
Features button and
select Advanced Filter
(expression)
3. You may also click on
icon shown with 3

Selection of features by non-spatial querying


Objective: To filter countries
having population greater than
100mil and GDP greater than
2000000 mil USD
1.
2.

Open example01.qgs file


Click on the layer
ne_50m_admin_0_countrie
s and click on Layer-Query
3. Type following in provider
specific filter expression
box:
"POP_EST" > 100000000 AND
"GDP_MD_EST" > 2000000
4. Click on OK

Result
Page 10

Note: IIRS / ISRO does not endorse the international boundaries shown in the image

Selection of features by non-spatial querying (text)


Objective: To filter
countries having LAND in
their name
3

Page 11

1. Open example01.qgs
file
2. Right click on the layer
and click on attribute
table
3. Click on Advanced Filter
and type following in
Expression box:
"NAME" ILIKE '%LAND%'
4. Click on OK

Selection of features by spatial querying


Objective: To find all cities
within 10000 meters from
rivers

1.Open example02.qgs file


2.To create a 10km buffer
shapefile: Click on VectorGeoprocessing ToolsBuffer(s)
3.To perform spatial query:
Click on Vector-Spatial
Query-Spatial Query
3
Page 12

Selection of features by spatial querying (2)


1. Select Indian-Cities in
the Source features
dropdown
2. Select Within in the
where dropdown
3. Select River-Buffer in
the Reference features
dropdown
4. Click Apply
5. Click on Create layer
with selected icon to
create new layer from
results

1
2

Page 13

Selection of features by spatial querying (Result)

Page 14

Linking Spatial and Non-Spatial Data


(with Geometry)

Page 15

example03-data.csv

Linking Spatial and Non-Spatial Data (2)


(with Geometry)

Page 16

Linking Spatial and Non-Spatial Data


(without Geometry)

Open example03.qgs
Click on Layer-Add Delimited Text Layer
Add well-data.csv
Select No Geometry (attribute only
table)
Right click on VILLAGES layer goto
properties
On the left pane, click on Joins
Click on the [+] icon select options as
shown
The additional attributes will be added to
the point shape file

Page 17

Spatial Analysis - Vector Based

More QGIS Functions


for Spatial Analysis

Page 18

Spatial Analysis - Raster Based

Page 19

QGIS has MORE!


Network Analysis
Building Topology
Terrain Analysis
All functions of GRASS
All functions of SAGA
All functions of ORFEO

Page 20

Model builder
Customization using C++
& Python
And more

THANK YOU
Q&A

PRASUN @ IIRS . GOV .IN

Page 21