1. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Geographic
Information System
QGIS Introduction(2)
microbase.LLC
http://microgeodata.com/
2. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Agenda
1st
2nd
3rd
What’s QGIS?
Basic usage
Basic data management
Spatial Analysis
Spatial data andling
Geocording
Create Vector data
About coordi nate system
Create KML data
Utilize OSM data
3. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Contents Today
2nd session
1 Spatial Analysis
2 Spatial Data handling
Homework
4. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Lecture data
lecture1_data
tokyo23
homework2
6. Copyright (C) 2013 microbase.LLC All Rights Reserved.
1.1 Buffering
A buffer in GIS is a zone around a map feature measured in units of distance
or time.A buffer is often used for spatial analysis.
make 200m
buffer polygons
from a highway.
7. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Add railway.shp in “tokyo23” folder and make 100m buffer
polygons from the railways.tokyo23.
2 Input “100” in the form.
3) Check the checkbox of “Dissolve buffer results”.
->An optional dissolve can be performed to
combine overlapping buffers.
1) Choose railway.shp as a vector data.
Vector > GeoprocessingTool > Clip
8. Copyright (C) 2013 microbase.LLC All Rights Reserved.
A buffer polygon can be created from not only poline data but
also point data and polygon data.
9. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Exercise 1
Create 250m buffer polygon data from each station and
save it as “station_buffer250.shp”.
11. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Integrate features which locate in same extent.
seven elevenセブ
ンイレブンの影
響圏
population in
Meguro city seven eleven’s market scale
1.2 Overlay
12. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Various kinds of Overlay
Intersect Union Clip
Input
Output
Inersect
feature
Union
feature
Clip
feature
Output features have each attribute table of input features Just clip features
13. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Meguro city can be selected by “Select layer by attribute” or “Select
Features” from “ku.shp”.
Add “library.shp” and “ku.shp”. Clip libraries only in Meguro city.
Check the check box of “Use only selected
features” and you can clip the target layer based on
a clip layer which is selected.
Clip
feature
Overlay1: Clip
Vector > GeoprocessingTool > Clip
14. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Libraries in only Meguro city are clipped.
15. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Intersect railways in Meguro ward using “library.shp” and “ku.shp”.
Inersect
feature
Overlay1: Intersect
Vector > GeoprocessingTool > Intersection
Check the check box of “Use only selected
features” and you can clip the target layer based on
a clip layer which is selected.
16. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Railways in only Meguro city are intersected.
17. Copyright (C) 2013 microbase.LLC All Rights Reserved.
1) Choose following features only in Setagaya ward.
• dentist.shp
• station.shp
• road.shp
2) Create following features in Setagaya ward.
• 250m buffer polygons from each station.
Exercise2
18. Copyright (C) 2013 microbase.LLC All Rights Reserved.
dentist station road
ANSWER
1)Clip(or intersect) a dentist, a station and a road using
“ku.shp” selecting Setagaya ward.
19. Copyright (C) 2013 microbase.LLC All Rights Reserved.
ANSWER
2) Dentists in the buffers are shown.
20. Copyright (C) 2013 microbase.LLC All Rights Reserved.
2 Spatial Data Handling
21. Copyright (C) 2013 microbase.LLC All Rights Reserved.
2.1Select Layer By Location
Features can be selected by not only an attribute but also location.
Example
Select a dentist within
500m from a station
Select a ward which a
highway go through.
Select a ward which
borders on Meguro ward
Select a seven eleven
in Meguro ward
22. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Add “station.shp” and “dentist.shp” in “tokyo23” folder into layer.
Choose a dentist within 500m from a station inTokyo special
districts.
23. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Create 500m buffer polygons from each station.
24. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Select a dentist within the buffers.
Choose a target layer in “selected
features” and an overlapped layer in
“intersect features”.
Vector > ResearchTool > Select by location “Select by location” covers the following
spatial relationship among features.
- within
- contain
25. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Selected features color yellow.
The result show about 70%
dentists locate in the place within
500m from station.
5129 in 6985 are selected. It may take a
little while to select features.
Selected rows color blue in the attribute table.
26. Copyright (C) 2013 microbase.LLC All Rights Reserved.
If more advanced search methods than “Contains” and “Within” are
required, the plugin “Spatial Query Plugin” will be useful.
- “Spatial Query Plugin” will appear if the checkbox in “QGIS Plugin
Manager” is checked.
- Intersects A intersects B
- Contains A contains B
- Is disjoint
- Equals A equals B
- Overlaps A overlaps B
- Crosses A crosses B
- Touches A touches B
- Within A within B
Vector > Spatial Query
27. Copyright (C) 2013 microbase.LLC All Rights Reserved.
1) Search the ward which intersect the highway.
2) Count the number of a supermarket within 250m from each station
using “station_buffer250.shp” created at Exercise1.
Exercise3
28. Copyright (C) 2013 microbase.LLC All Rights Reserved.
ANSWER
1) the borders which intersect highways.
29. Copyright (C) 2013 microbase.LLC All Rights Reserved.
467 shops
ANSWER
2) Count the number of a supermarket within 250m from each station.
30. Copyright (C) 2013 microbase.LLC All Rights Reserved.
2.2 Spatial Join
Joins attributes from one feature to another based on the spatial
relationship.The target features and the joined attributes from the join
features are written to the output feature class.
a
A city
shop
a
b
c
shop city
a C
b A
c B
B city
C city
b
c
31. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Add “convenience.shp” in “tokyo23” and save only “seven eleven” as
“seven_eleven.shp”.Then join the attribute from “ku.shp” to it.
Check the checkbox of “Take attributes of
first located feature”.
Vector > Data ManagementTool > Join attributes by location
32. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Attribute of “ku” is joined to “seven eleven”.
Attributes of
“seven eleven”
Attribute of “ku”
33. Copyright (C) 2013 microbase.LLC All Rights Reserved.
a
A city
shop sale
a 2500
b 3000
c 2000
d 1500
shop sale city
a 2500 C市
b 3000 A市
c 2000 B市
d 1500 B市
B city
C city
b
c
d
Join type varies depending on how joins between the target
features and join features.
city number whole
sale
A 1 3000
B 2 3500
C 1 2500
Main target
JOIN_ONE_TO_ONE
JOIN_ONE_TO_MANY
34. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Add Census of commerce of 500m scale units
(H16_commerce.shp) and Census of population of block
scale unit(pop.shp).Then join the attributes from
“H16_commerce” to “pop”.
Exercise4
35. Copyright (C) 2013 microbase.LLC All Rights Reserved.
A block unit sometimes contains 500m grids and has more
than 2 grids.Attribute summary should be “Take summary of
interesting features.
HINT
36. Copyright (C) 2013 microbase.LLC All Rights Reserved.
If you want get an attribute value more accurately among different unit features, It
would be one of the method to divide the value based on area of the features.
ANSWER
37. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Another functions for spatial analysis are available.
38. Copyright (C) 2013 microbase.LLC All Rights Reserved.
)(
1
)(
1
2 i
n
i
XxK
nh
xf −= ∑=
)()(
3
)( 2
hx
h
xh
xK <
−
=
π
!
Spatial interpolation
Kernel density estimation
See geostatistics in more detail.
・Kriging interpolation
・Sprine interpolation
・Spatial autocorrelation
etc...
39. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Path Search
Shortest Path can be detected by Dijkstra method.
Service area analysis
40. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Contents Today
2nd session
1 Spatial Analysis
2 Spatial Data handling
Homework
42. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Data
homework2
university.shp
highschool.shp
jr_school.shp
el_school.shp
firestation.shpfire station
elementary
school
junior high
school
high school
college
43. Copyright (C) 2013 microbase.LLC All Rights Reserved.
Find the area thought to have high disaster risk in Tokyo special districts.
1) Describe characteristics and
reasons of the area thought to have
high disaster risk.
2) Create a map about 1) and paste
it to your report.
<Hint>
The data today and in “homework2” folder
may be good for describing the disaster
risk!
• population
• population density
•
• school as rescue facility
• elevation
• public transpotation