QGIS training class 3

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

description

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

Transcript of QGIS training class 3

Page 1: QGIS training class 3

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

Geographic Information SystemQGIS Introduction(3)

microbase.LLChttp://microgeodata.com/

Page 2: QGIS training class 3

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 M a p P ro j e c t i o n 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 3

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

Contents Today3rd Session

Geocoding

Map Projection

 - Coordinate Reference System(CRS) - Projection transformation

Create Point Data

 - Delimited layer - OpenLayers Plugin

- ‘On the fly’ CRS transformation

OSM Data

- Create OSM data - OpenStreetMap plugin

Google Earth

- About KML - Export a layer as KML format

Page 4: QGIS training class 3

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

Data

lecture3_en

Page 5: QGIS training class 3

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

Geocoding

Page 6: QGIS training class 3

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

Address Geocoding

It is called Address geocoding to find associated geographic coordinates (often expressed as latitude and longitude) from other geographic data, such as street addresses, or ZIP codes (postal codes).

Name Address

Hongo campus 7-3-1 Hongo Bunkyo-ku Tokyo-to

Komaba campus 4--6-1 Komaba Meguro-ku Tokyo-to

Kashiwa campus 5-1-5 Kashiwanoha Kashiwa-shi Chiba-ken

GIS projects the coordinates on map.

X

Y

Name Address Lon Lat

Hongo campus Tōkyō-to, Bunkyō-ku, Hongō, 7-3-1

139.762723 35.712545

Komaba campus Tōkyō-to, Meguro-ku, Komaba, 4--6-1

139.677172 35.662492

Kashiwa campus Chiba-ken, Kashiwa-shi, Kashiwanoha, 5-1-5

139.934642 35.900801

Page 7: QGIS training class 3

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

Type of Address Geocoding

Street address Block address

The address commonly seen in Europe and the United States.

ex) Unter den Linden 6, 10099 Berlin

The address commonly seen in Asian area.

ex) Tōkyō-to, Bunkyō-ku, Hongō, 7-3-1

street

street number

postal code citypref city block block number

Page 8: QGIS training class 3

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

How to conduct geocoding Google Maps provides geocoding service. Geographic coordinate can be obtained from Google Maps by clicking “What’s here? on pop-up menu after right-clicking anywhere on map.

1) Click “What’s here? on pop-up menu after right-clicking the place you want to get on map.

2) The coordinates are displayed on web form. (latitude[Y], longitude[X])

Page 9: QGIS training class 3

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

Name Address Lon Lat

Hongo campus Tōkyō-to, Bunkyō-ku, Hongō, 7-3-1

Komaba campus Tōkyō-to, Meguro-ku, Komaba, 4--6-1

Kashiwa campus Chiba-ken, Kashiwa-shi, Kashiwanoha, 5-1-5

Exerc ise 1

Add “longitude” and “latitude” layer to “sample.csv” in “lecture3_en” folder using Google Maps. The csv file can be edited by spreadsheet or text editor.

Longitude(X)ex) 139.810896

Latitude(Y)ex) 35.710211

Page 10: QGIS training class 3

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

Google Maps API are usefulwhen you want to process geocoding on a large scale.

https://developers.google.com/maps/documentation/geocoding/?hl=en

Another geocoding services also be available. For more detail, see the below link.http://blog.programmableweb.com/2012/06/21/7-free-geocoding-apis-google-bing-yahoo-and-mapquest/

Page 11: QGIS training class 3

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

Map Pro ject ion

Page 12: QGIS training class 3

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

Geograph ic coord inates

A set of numbers of location on the globe is called Geographic coordinates(ex. longitude, latitude). A common choice of coordinates is latitude, longitude and elevation.

Position gap sometimes occur when coordinates system of each layer on QGIS differs from each other even if each layer has same coordinates..

-31788.8930935 -6433.4151654

-31785.5178796 -6432.6469309

The coordinates differ even at a same place when the CR differ.

Page 13: QGIS training class 3

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

What ’s map pro ject ion?

• Azimuthal projectionAzimuthal projections have the property that directions from a central point are preserved and therefore great circles through the central point are represented by straight lines on the map.

• Cylindrical projectionA map projection in which the surface features of a globe are depicted as if projected onto a cylinder typically positioned with the globe centered horizontally inside the cylinder. The Mercator projection one of the cylindrical ,developed for navigational purposes, has often been used in world maps.

A map projection is a systematic transformation of the latitudes and longitudes of locations on the surface of a sphere or an ellipsoid into locations on a plane.

Because the earth is round, a position gap is inevitable even on any projection. Therefore a projection should be varied depending on the intended use such as calculating area, angle and distance.

Page 14: QGIS training class 3

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

引用: 国土地理院 http://vldb.gsi.go.jp/sokuchi/datum/tokyodatum.html

• WGS84 (World Geodetic System)WGS 84 is the reference coordinate system used by the Global Positioning System. The coordinate origin of WGS 84 is meant to be located at the Earth's center of mass.

• JGD2000 (Japanese Geodetic Datum)JGD2000 is the geodetic datum based on the GRS80 in common with WGS84. It has been introduced since 2002 instead of the former Tokyo Datum in order to adapt the coordinate system to various high-tech tools using GPS/GIS technology more easily.

• Tokyo DatumTokyo Datum is the coordinate system based on triangulation defined by “Meiji” government was basically established in early 20th century.

The following system are generally used in Japan.

Type of Coord inate Reference System

引用: United Nation

http://unstats.un.org/unsd/geoinfo/RCC/docs/rcca8/crp/8th_UNRCCA_econf.96_CRP9.pdf

Page 15: QGIS training class 3

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

How to manage CRS onGIS

Projection is defined in the “.prj” file in case of shape file. “CRS selector” window will appear on GIS when you load shape file without “prj”. #prj is one of the set of shape file.

Page 16: QGIS training class 3

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

Add ”bunkyo.shp” and “tokyo.shp” in “lecture3_en” folder and show the map. Then choose WGS84(EPSG:4326) for the coordinate system of “tokyo.shp”. Former layer shows the administrative unit of “Bunkyo ward” , the latter shows the administrative unit of “Tokyo prefecture”.

Exerc ise 2

Page 17: QGIS training class 3

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

ANSWER

Both layers appear but have position gaps.

Page 18: QGIS training class 3

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

Check coord inate Reference system(CRS)

Position gaps have occured among “Tokyo” and “Bunkyo” because both CRS differs from each other.

Open a property of each layer and choose “General Information” tab at the top of the window. Current layer CRS can be seen there.

Bunkyo layer : Tokyo Tokyo layer : WGS84

Page 19: QGIS training class 3

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

Project ion tr ans format ionThis kinds of position gap sometimes occur when CRS of each layer on QGIS differs from each other. In order to modify the gap, CRS must be common.

It is called “Projection transformation” to project a layer from one coordinate system to another CRS.

Page 20: QGIS training class 3

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

Projects “Bunkyo” layer from Tokyo(ESPG:4301) to WGS84. Projection transformation can be done from “Save as”.

CRS can be derived from “CRS Selector”.

Filter function enable to find a plugin you want easily. Input a keyword about the plugin.

The list of CRS will appear depending on keywords in filter.

Page 21: QGIS training class 3

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

“Bunkyo” layer overlaps with “Tokyo” layer properly.

Page 22: QGIS training class 3

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

Create Point Data

Page 23: QGIS training class 3

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

Create point data

QGIS can load and create point data from a table file with coordinates fields such as CSV data format. Create point data from sample.csv you’ve added coordinates fields at Exercese 1.

X

Y

Name Address Lon Lat

Hongo campus Tōkyō-to, Bunkyō-ku, Hongō, 7-3-1

139.762723 35.712545

Komaba campus Tōkyō-to, Meguro-ku, Komaba, 4--6-1

139.677172 35.662492

Kashiwa campus Chiba-ken, Kashiwa-shi, Kashiwanoha, 5-1-5

139.934642 35.900801

Page 24: QGIS training class 3

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

Click the icon of “Add Elimited Text Layer” from the menu.(or Layer > Add Elimited Text Layer)

1)Choose sample1new.csv which you added the coordinates.

2) Check the checkbox of comma( if csv is loaded).

3) Choose the column of coordinates such as X(longitude) and Y(latitude).

A sample imagery about the loading table can be checked from here.

Page 25: QGIS training class 3

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

Then specify CRS (Coordinate reference system) of the table.

Choose WGS84 as CRS. The coordinates picked up derive from Google Maps which support WGS84.

Page 26: QGIS training class 3

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

A layer has been created from CSV file.

#This layer are added just as a temporary file. Save it as a shape file.

Hongo

Kashiwa

Komaba

Page 27: QGIS training class 3

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

Add a background imagery so that map view is comprehensive.

Plugin > Fetch Python Plugin

Filter function enable to find a plugin you want easily. Input a keyword about the plugin.

#Internet access is necessary for installing OpenLayers plugin.

Page 28: QGIS training class 3

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

After installing the plugin, check whether the plugin is activated or not on the QGIS Plugin Manager.

Check the checkbox of OpenLayers Plugin

Plugin > QGIS Plugin Manager

Page 29: QGIS training class 3

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

After installing the plugin properly, “OpenLayers plugin” will be added to “Plugin” menu. Add “OpenStreetMap layer” from the list.

#Internet access is necessary for using OpenLayers plugin.

Another maps such as Google Maps and Bing Maps also can be seen.

Page 30: QGIS training class 3

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

‘On the fly’ CRS transformationWhen mapping the layers which have different CS, one common CS should be used. QGIS has a useful function for this named ‘On the fly’ CRS transformation which conducts projection transformation automatically just for map view.#‘On the fly’ CRS transformation is just a function for display. Projection transformation is necessary for analysis usage.

‘On the fly’ CRS transformation

‘On the fly’ CRS transformation will turn on automatically when Open Layers Plugin” is launched.

Uncheck the checkbox and the function will turn off.

Choose CS just like projection transformation.

Page 31: QGIS training class 3

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

1) Add “denki.csv” in “lecture3_en” folder on QGIS and project it from Tokyo(EPSG:4301) to WGS84(EPSG:4362). Save it as ”denki_wgs1984.shp”.

2) Color the “BUSINESS” field in the attribute table of “denk_wgs1984” in different colors. This field includes the name of electronics retail stores such “Big camera”.

3) Add “OpenStreetMap” as a background imagery.

Exerc ise 3

“denki.csv” includes a list of electronics retail stores in Tokyo.

Page 32: QGIS training class 3

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

1) Load “denki.csv” and choose Tokyo(EPSG:4301) as CRS using “Add Elimited Text Layer”.

ANSWER

Page 33: QGIS training class 3

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

1) After adding on QGIS, project it to WGS84(EPSG:4362).

ANSWER

Page 34: QGIS training class 3

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

1) The position gap before and after projection transformation can been seen.

ANSWER

Page 35: QGIS training class 3

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

2) 3) color each store depending on “BUSINESS” field of “denki” and load openstreetmap from openlayers plugin.

ANSWER

Page 36: QGIS training class 3

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

OSM Data

Page 37: QGIS training class 3

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

Create OSM Data

openstreetmap(OSM) is created by volunteers and can be available for free. The data also can be used on GIS. We’ve already used it as a background imagery.

Access to openstreetmap.org and try creating open maps!

Create your account at first!

Page 38: QGIS training class 3

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

OpenSteetMap can be edited after log in. Click “Edit with ID(in-browser editor)” from “Edit” menu at the top of the screen and launch an edit window.

Page 39: QGIS training class 3

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

Create vector data on Bing Map as a background imagery.

2)Create vector data while tracing each building on Bing Maps.

1)Click “Area” in case creating or editing polygon data.

Page 40: QGIS training class 3

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

Attributes of each feature can be edited after vector data was created.

Page 41: QGIS training class 3

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

The vector data you created will be seen several tens of seconds later.

Page 42: QGIS training class 3

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

Create building polygon data of your home town or neighborhood on open street map.

Exerc ise 4

Page 43: QGIS training class 3

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

OSM data can be downloaded and displayed on QGIS using “OpenStreeetMap plugin”.

Download OSM data

Web > OpenStreetMap > Download OSM data

Check the check box of “Open data automatically after download” and the downloaded OSM data will be loaded on QGIS automatically.

The extent of downloading OSM is depending on the map view size. However you can’t download it on a wide scale

Page 44: QGIS training class 3

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

The downloaded OSM data will be divided into 3 types: Point data, Polyline data and Polygon data sepalately. Generally, The data tend to be saved as “.osm” data format(xml) and can be converted into any data format.

Page 45: QGIS training class 3

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

http://downloads.cloudmade.com/ http://www.geofabrik.de/data/download.html

GeofabrikCloudmade

If you want to download huge amount of OSM data at a time, the following sites are recommended. These sites provide the compiled data as a unit in country and area.

Page 46: QGIS training class 3

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

Existing study using OSM data

http://www.youtube.com/watch?v=7zaQCza9Z6Q&feature=share&list=UUpPkZWEggV6yiBMl6LmEiZQ

UT, Center for spatial information science

People flow in Manila, Philippines in 1996

People flow animation are created from huge mobile history data in Person trip survery. Each detail motion are interpolated based on OSM data.

Page 47: QGIS training class 3

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

Wor k with GoogleEar th

Page 48: QGIS training class 3

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

Google Earth also can load GIS data on it and adopts a data format named KML(Keyhole Markup Language. KML is XML based markup language and is used for Google Maps too. QGIS can export a layer as KML.

About KML

※Google Earth is a virtual globe, map and geographical information program that was originally called EarthViewer 3D, and was created by Keyhole, Inc, a Central Intelligence Agency (CIA) funded company acquired by Google in 2004.

Google Earth is available even AndroidOS and iOS. If you export the data as KML, you can show it on mobile devise.

Page 49: QGIS training class 3

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

QGIS can export KML data from layer option “Save as” in the same way as exporting a layer.

Export a layer as KML format

Choose “Keyhole Markup Language[KML]” for “Format”.

Choose WGS84 for “CRS”.#Google Earth supports WGS84.

Page 50: QGIS training class 3

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

Double-click an exported KML files and Google Earth will be launched with the data added.

※Google Earth has to be installed in order to load KML files on Google Earth.

Page 51: QGIS training class 3

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

http://opentextmap.org/

kml sharing site by NPO Ino-company

OpenTextMap

For those who want to know Google Earth more

SlideshareIntroduction of Google Earth for educators

http://www.slideshare.net/hiroakisengoku/20130331excercise2

Page 52: QGIS training class 3

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

Contents Today3rd Session

Geocoding

Map Projection

 - Coordinate Reference System(CRS)

- Projection transformation

Create Point Data

 - Delimited layer - OpenLayers Plugin

- ‘On the fly’ CRS transformation

OSM Data

- Create OSM data - OpenStreetMap plugin

Google Earth

- About KML - Export a layer as KML format

Page 53: QGIS training class 3

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

H O M E W O R K

Page 54: QGIS training class 3

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

Write a report about regional issues you live or have been while meeting the following requirements.

-Describe a summary about the area you mention.-Explain the issues with maps using GIS.-Design a simple map to see and understand.-Cite data source.

Page 55: QGIS training class 3

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

National Land Numerical Informationhttp://nlftp.mlit.go.jp/ksj-e/index.html

Free Spatial Datahttp://www.diva-gis.org/Data

Useful download site for GIS

National Statistics Center - Regional Statisticshttp://www.e-stat.go.jp/SG1/chiiki/Welcome.do?lang=02