43
Copyright (C) 2013 microbase.LLC All Rights Reserved. Geographic Information System QGIS Introduction(2) microbase.LLC http://microgeodata.com/

QGIS training class 2

Embed Size (px)

DESCRIPTION

合同会社マイクロベースのQGIS演習資料(ver.1.8)です。ご希望にしたがって研修内容を構成します。研修のご依頼をご希望の方は弊社ホームページよりお問い合わせください。 http://microgeodata.com/ 製作・協力: 仙石裕明・東郷直子・秋山祐樹

Citation preview

Page 1: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Geographic Information SystemQGIS Introduction(2)

microbase.LLChttp://microgeodata.com/

Page 2: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Agenda

1st

2nd

3rd

W h a t ’s Q G I S ? B a s i c u s a g e B a s i c d a t a m a n a g e m e n t

S p a t i a l A n a l y s i s S p a t i a l d a t a a n d l i n g

G e o c o rd i n g C re a t e Ve c t o r d a t a A b o u t c o o rd i n a t e s y s t e m C re a t e K M L d a t a U t i l i z e O S M d a t a

Page 3: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Contents Today

2nd session

1 Spatial Analysis

2 Spatial Data handling

Homework

Page 4: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Lecture data

lecture1_data

tokyo23

homework2

Page 5: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

1 Spat ia l Ana lys i s

Page 6: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

1.1 Buf fer ing

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.

Page 7: QGIS training class 2

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 > Geoprocessing Tool > Clip

Page 8: QGIS training class 2

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.

Page 9: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Exerc ise 1

Create 250m buffer polygon data from each station and save it as “station_buffer250.shp”.

Page 10: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

ANSWER

Page 11: QGIS training class 2

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 Over lay

Page 12: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Various kinds of Overlay

Intersect Union Clip

Input

Output

Inersectfeature

Unionfeature

Clipfeature

Output features have each attribute table of input features Just clip features

Page 13: QGIS training class 2

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.

Clipfeature

Overlay1: Clip

Vector > Geoprocessing Tool > Clip

Page 14: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Libraries in only Meguro city are clipped.

Page 15: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Intersect railways in Meguro ward using “library.shp” and “ku.shp”.Inersectfeature

Overlay1: Intersect

Vector > Geoprocessing Tool > 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.

Page 16: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Railways in only Meguro city are intersected.

Page 17: QGIS training class 2

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.

Exerc ise2

Page 18: QGIS training class 2

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.

Page 19: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

ANSWER

2) Dentists in the buffers are shown.

Page 20: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

2 Spat ia l Data Handl ing

Page 21: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

2.1Se lect Layer By Locat ion

Features can be selected by not only an attribute but also location.

ExampleSelect 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

Page 22: QGIS training class 2

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 in Tokyo special districts.

Page 23: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Create 500m buffer polygons from each station.

Page 24: QGIS training class 2

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 > Research Tool > Select by location “Select by location” covers the following spatial relationship among features.

- within

- contain

Page 25: QGIS training class 2

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.

Page 26: QGIS training class 2

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

Page 27: QGIS training class 2

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.

Exerc ise3

Page 28: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

ANSWER

1) the borders which intersect highways.

Page 29: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

467 shops

ANSWER

2) Count the number of a supermarket within 250m from each station.

Page 30: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

2.2 Spat ia l Jo in

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 cityshop

a

b

c

shop city

a C

b A

c B

B city

C cityb

c

Page 31: QGIS training class 2

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 Management Tool > Join attributes by location

Page 32: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Attribute of “ku” is joined to “seven eleven”.

Attributes of “seven eleven” Attribute of “ku”

Page 33: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

a

A city

shop sale

a 2500

b 3000

c 2000

d 1500shop sale city

a 2500 C市b 3000 A市c 2000 B市d 1500 B市

B city

C cityb

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

Page 34: QGIS training class 2

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”.

Exerc ise4

Page 35: QGIS training class 2

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

Page 36: QGIS training class 2

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

Page 37: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Another functions for spatial analysis are available.

Page 38: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

���

)(1)(1

2 i

n

i

XxKnh

xf −= ∑=

)()(3)( 2 hxhxh

xK <−

= ���π

�����

����!��

Spatial interpolation

Kernel density estimation

See geostatistics in more detail.・Kriging interpolation

・Sprine interpolation

・Spatial autocorrelation

etc...

Page 39: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Path Search

Shortest Path can be detected by Dijkstra method.

Service area analysis

Page 40: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Contents Today

2nd session

1 Spatial Analysis

2 Spatial Data handling

Homework

Page 41: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

H O M E W O R K

Page 42: QGIS training class 2

Copyright (C) 2013 microbase.LLC All Rights Reserved.

Data

homework2university.shp

highschool.shp

jr_school.shp

el_school.shp

firestation.shpfire station

elementaryschooljunior highschool

high school

college

Page 43: QGIS training class 2

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