Spatial Analysis Tools with Open Source GIS

Post on 11-Feb-2017

569 views 3 download

Transcript of Spatial Analysis Tools with Open Source GIS

Geospatial Analysis with Open Source GIS

Chingchai Humhong and Sakda HomhuanRegional Center of Geo-Informatics and Space Technology, Lower Northern Region

Naresuan University

chingchai.h@gmail.com, chingchaih@nu.ac.thsakda.homhuan@gmail.com

FTools

fTools Plugin The goal of the fTools python plugin is to provide a one-stop resource for many common vector-based GIS tasks, without the need for additional software, libraries, or complex workarounds.

fTools is now automatically installed and enabled in new versions of QGIS, and as with all plugins, it can be disabled and enabled using the Plugin Manager.

fTools Plugin

Analysis Tools

Menu bar > Vector > Analysis Tools

Distance Matrix

1301005 1301007 1301002 1301003 1301009 1301006 1301010

บานทรายทอง 5,614 9,049 9,466 9,781 13,109 14,554 15,543

บานตนธงชย 6,487 9,802 10,301 10,686 13,176 14,735 15,414

บานเวยงสวรรค 14,907 11,661 13,394 17,021 5,076 2,810 7,045

บานหางฮง 11,864 8,492 10,216 13,843 4,841 2,993 8,197

บานแมเมาะสถาน 14,302 11,276 13,074 16,686 3,914 1,688 6,038

บานปงชย 16,322 13,338 15,132 18,746 5,078 3,366 5,815

บานหวยคง 15,914 13,530 15,418 18,930 3,539 3,312 3,001

บานนาแขม 13,209 10,555 12,424 15,975 2,162 276 4,941

บานปงแทน 15,888 14,302 16,207 19,493 3,993 5,438 289

บานดง 4,092 399 1,517 5,068 10,837 10,716 14,619

บานทาส 4,002 2,401 494 3,160 12,846 12,704 16,619

บานจ าปย 4,312 5,069 3,281 359 15,391 15,414 19,085

บานสบปาด 352 4,298 3,956 4,297 12,819 13,382 16,232

บานสบเตน 18,821 14,979 16,354 19,846 10,679 8,394 12,174

บานสวนปาแมจาง 17,567 13,471 14,476 17,692 12,356 10,072 14,767

บานสบเมาะ 16,860 13,231 14,778 18,366 8,017 5,738 9,662

บานหวยรากไม 17,401 14,299 16,058 19,682 6,279 4,544 6,689

บานทงโปง 17,267 14,278 16,067 19,683 5,848 4,282 6,061

ต าแหนงวดกลน

หมบาน

Sum line lengths

Point in polygon

Basic statistic

1

2

5

Parameter ValueSum 8.0 Max 5.0 Min 1.0 Mean 2.7 StdDev 2.1N 3

บานนาย A

บานนาย B

บานนาย M

รายไดของสมาชกในหมบาน

Line intersections

Intersection point

แบบฝกหดเปดไฟล Lab01_Analysis_Tools.qgs แลวตอบค าถามดงตอไปน1. ใชเครองมอ Distance Matrix เพอหาหมบานใด (village_pnt.shp) อยใกลกบสถานวดกลนทสด? (odour.shp) เปนระยะทางเทาใด? (3 อนดบแรก)

2. ใชเครองมอ Sum line lengths เพอหาความยาวของเสนถนน (road.shp) ท ตดผาน/อยใน เขตพนททงดน (dump.shp) มทงสนกกโลเมตรเมตร?

3. ใชเครองมอ Point in polygon เพอหาจ านวนจดทเกดการลกใหม (xysponcom.shp) ในพนทเหมอง (existing.shp) ทงสนกจด และแปลงใหนมจดลกไหมมากทสด?

4. ใชเครองมอ Line intersections เพอหาต าแหนงทตดกนของถนน (road.shp) กบแนวสายพาน (conveyer.shp) เพอคอยเฝาระวงอนตรายจากการล าเลยงถานหน มทงสนกจด?

Research Tools

Menu bar > Vector > Research Tools

Regular points

Vector grid

Polygon from layer extent

xMin 572895.80

yMin

20

22

40

7.7

8

xMax 578596.46

yMax

20

30

08

3.5

1

[A]

[A, C]

[A, C]

[A, C, D]

[A, C, D, E, F, G, H, I, J]

[A, C, D, E, F, G, H, I, J, K, L, M, N, O]

Select by location

Input feature: greenInput feature's center: red XSelecting feature: gray

[A, B]

[A, C, D, E, F, G, H, I, J, K, L, M, N, O]

[A, C, D, E, F, G, H, I, J, K, M]

Select by location

Input feature: greenInput feature's center: red XSelecting feature: gray

Select by location

The Select By Location lets you select features based on their location relative to other features.

แบบฝกหดเปดไฟล Lab02_Research_Tools.qgs แลวตอบค าถามดงตอไปน1. ใชเครองมอ Regulapoint เพอหาต าแหนงเกบตวอยางดนโดยใหระยะหางเทากบ 500 เมตร เทาๆกน และเลอกเฉพาะจดทอยในขอบเขตบอเหมอง (existing_pit.shp) เทานน (Select by location) จะไดจดเกบตวอยางทงสนกจด?

2. สรางขอบเขต (Extent) ของจดเกบตวอยางในขอ 1 เพอสงซอขอมลภาพถายรายละเอยดสงของดาวเทยม QuickBird (ราคา 545 บาท ตอ ตารางกโลเมตร) ดงนน

- จงหาคา XMin, YMin และ XMax, YMax ของบรเวณดงกลาว- ค านวณราคาขอมลภาพของบรเวณดงกลาว

Geoprocessing Tools

Menu bar > Vector > Geoprocessing Tools

Convex hull(s)

Buffer

Overlay analysis

A B A B

A B

A B

A B

A Intersect B = AB A Union B = AB A Symetricaldifference B = AB

A Clip B = A A Difference B = A

Intersect

A B

A Intersect B = AB

Intersection: Input and output

Union

A B

A Union B = AB

The input feature layers must have polygon geometry.

Symetrical difference

The input and update feature layer must be of the same geometry type.

A B

A Symetrical difference B = AB

Clip

A B

A Clip B = A

Line clipped by polygon:

Point clipped by polygon:

Polygon clipped by polygon: Line clipped by line:

Point clipped by point:

Clip: Input and output

Difference

A B

A Difference B = A

Dissolve

แบบฝกหดเปดไฟล Lab03_Geoprocessing_Tools.qgs แลวตอบค าถามดงตอไปน1. ค านวณพนททไดจากการเกบพกด (survey.csv) มเนอทเทาใด?2. สราง Buffer ของจดทเกดการลกไหม (sponcom.shp) โดยใหมขนาดแตกตางกนตามบรเวณการตรวจพบ (Field: Spon_Area)3. สราง Buffer จากขอ 2 ขนาด 1,000ม., 2,000ม. และ 3,000ม. แลว Union เขาดวยกนแลวตรวจสอบ (Intersect โดย village_pnt) วาหมบานใดนาจะไดรบกลนบาง? ทระยะหางเทาใด?4. รวมพนทเฝาระวงโดยทง 3 โซน (Dissolve) เขาดวยกน แลวค านวนหาเนอททงหมดโดยไมรวมเนอทในบอเหมอง (Difference) วามเนอทเทาใด?

Geometry Tools

Menu bar > Vector > Geometry Tools

Geometry Columns

Point

Line

Polygon

Export/Add geometry columns

Polygon centroids

The rainfall P (mm) distribution in Sirsa district: (a) temporal variation, (b) spatial variation, (c) meteorological regions using Thiessen polygons.

Voronoi (Thiessen) polygon

Polygons to lines

Lines to polygons

แบบฝกหดเปดไฟล Lab04_Geometry_Tools.qgs แลวตอบค าถามดงตอไปน1. ตรวจสอบ Geometry ของ layer: village.shp, conveyer.shp และ pratanbat.shp2. หาเนอทของแปลงประทานบตรแตละแปลงเปนหนวยไร อยากรวาแปลงใดมเนอทมาก

ทสด และหาต าแหนงตวแทนของแปลงประทานบตรแตละแปลง และค านวน Geometry ของต าแหนงดงกลาว

Menu bar > Vector > Data management Tools

Geographic Coordinate System

Latitu

de

Longitude

Spatial reference:

Projected coordinate systems(A) Mercator's projection – an equatorial cylindrical projection – yields a map (B) on which areas become increasingly distorted toward the poles (each of which is drawn out into a line at an infinite distance from the equator.

(C) An azimuthal projection from the north pole provides a useful map (D) of the southern hemisphere.

(E) A conic projection, with elements touching the globe at one (as here) or more parallels, is well suited to mapping mid-latitude regions (F). Red circles represent equal areas, showing the type of distortion produced.

Spatial reference:

Spatial reference tool: GIS software

Qgis ArcGIS

Thailand spatial reference

ระบบอางอง โซน พนหลกฐาน รหส EPSG

พกดภมศาสตร - Indian1975 4240

พกดภมศาสตร - WGS1984 4326

พกดกรด UTM 47 Indian1975 24047

พกดกรด UTM 48 Indian1975 24048

พกดกรด UTM 47 WGS1984 32647

พกดกรด UTM 48 WGS1984 32648

Thailand spatial reference

ExportToNewProjection

Metadada

Define current projection

Joint Attribute

Joint attribute by location

Split vector layer

Merge shapefile

แบบฝกหดเปดไฟล Lab05_DataManagement_Tools.qgs แลวตอบค าถามดงตอไปน1. ตรวจสอบไฟลของ reservior.shp ใน “Lab_Vector\Output_lab5\” หากไมม

reservior.prj ให Define current projection เปน WGS84 UTM Zone 47 N2. เปลยนระบบพกดจาก WGS84 UTM Zone 47 N เปน Geographic coordinate

system: WGS 19843. เชอมตารางโดยใชเครองมอ Join attribute ขอมล dump.shp กบตารางชอ

Lab_Vector\Output_lab5\ dumpName.dbf4. ใชเครองมอ Join attribute by location หาวาแหลงน าอยในหมบานใดบาง?5. ใชเครอง Split vector by layer ของชนขอมล exitsting_pit.shp โดยใช field “Layer”

จะไดชนขอมลทงสนกชนขอมล? และใชเครองมอ Merge shape file to one รวมชนขอมล BT, NE, NW, SB, SE และ SW เขาดวยกน แลวจงหาวามชนแปลงใดทอยตดกบแปลง BT บาง?

QGIS Raster Tools [GDAL]

QGIS Raster Tools [GDAL]

What is GDALTools?The GDAL Tools plugin offers a GUI to the collection of tools in the Geospatial Data Abstraction Library, http://gdal.osgeo.org . These are raster management tools to query, re-project, warp, merge a wide variety of raster formats. Also included are tools to create a contour (vector) layer, or a shaded relief from a raster DEM, and to make a vrt (Virtual Raster Tile in XML format) from a collection of one or more raster files. These tools are available when the plugin is installed and activated.

QGIS Raster Tools [GDAL]

ทดสอบการเรยกใช GDAL Library (Command Prompt)

C:\Program Files (x86)\Quantum GIS Wroclaw\bin>

QGIS Raster Tools [GDAL]

gdalinfo C:/temp/Data/Site_MaeMoh_Thaichote20091223.tifgdalinfo

gdalwarp

QGIS Raster Tools [GDAL]

gdalwarp -s_srs EPSG:32647 -t_srs EPSG:24047 -of GTiffC:/temp/Raster/1_gdalwarp/Thaichote20091223.tif C:/temp/Raster/1_gdalwarp/Thaichote20091223_24047.tif

QGIS Raster Tools [GDAL]

มาใช GDAL Tools ทเปนแบบ GUI ดกวา

QGIS Raster Tools [GDAL]

เครองมอทงหมดของเมน Raster

Projections

QGIS Raster Tools [GDAL]

Projections- Warp (Reproject)- Assign projection

เครองมอในกลมของ Projections จะประกอบดวยชดค าสงไดแก Warp(Reproject) และ Assign projection ซงจะมหนาทหลกในการแปลงคาพกดขอมลภาพ หรอก าหนดคาพกดใหกบขอมลภาพ

QGIS Raster Tools [GDAL]

- Warp (Reproject)Projections

Input file : ขอมลภาพทตองการจะแปลงคาพกดOutput file : ต าแหนงผลลพธของขอมลทไดSource SRS : คาพกดอางองเดมของขอมลภาพTarget SRS : คาพกดอางองใหมทตองการ

QGIS Raster Tools [GDAL]

- Assign projectionProjections

Input file : ขอมลภาพทตองการจะแปลงคาพกดDesired SRS : คาพกดทตองการ

หมายเหต ไฟลนามสกล *.tmp จะเปนไฟลผลลพธทไดจากการ Assign Projection

Conversion

QGIS Raster Tools [GDAL]

Conversion- Rasterize (Vector to raster)- Polygonize (Raster to vector)- Translate (Convert format)- RGB to PCT- PCT to RGB

เครองมอในกลมของ Conversion ซงจะมหนาทหลกในการแปลงประเภทของขอมล และ format หรอ นามสกลของขอมลภาพ รวมไปถงการแปลงคาสของขอมลภาพ

QGIS Raster Tools [GDAL]

Conversion- Rasterize (Vector to raster)

Input file (shapefile) : ขอมล Shapefile ทตองการจะแปลงขอมลเปน RasterAttribute field : ระบขอมล field ทตองการ ซงผลลพธทไดจะเปนไปตามคาของ field นนๆOutput file for rasterized vector (raster) : ก าหนดต าแหนงผลลพธของขอมลทไดNew size (-ts) : ก าหนดขนาดไฟลของผลลพธทได จะเปนพกเซล

QGIS Raster Tools [GDAL]

Conversion- Rasterize (Vector to raster)

ใหท าการลบคาทเปน No data ออก โดยผลลพธทไดจะตองเหมอนกบภาพขวามอgdal_translate -a_nodata 0 -of GTiff C:/Temp/Data/raster_reservior.tif C:/Temp/Data/raster_reservior_nodata.tif

QGIS Raster Tools [GDAL]

Conversion- Polygonize (Raster to vector)

Input file (raster) : ขอมล Raster ทตองการจะแปลงขอมลเปนแบบ VectorOutput file for polygons (shapefile) : ก าหนดต าแหนงผลลพธของขอมลทไดField name (DN) : สราง field value ทไดคาจากขอมล Raster (คาเรมตนจะตงชอ field “DN”)

QGIS Raster Tools [GDAL]

Conversion- Polygonize (Raster to vector)

ใหลองเปดขอมล reservoir.shp ทเปนไฟลตนฉบบ เปรยบเทยบกบขอมลทไดจากการท า Polygonize(Raster to vector) ซงการแปลงขอมลกลบไป-กลบมา จะท าใหมการสญเสยขอมลไปบาง

QGIS Raster Tools [GDAL]

Conversion- Translate (Convert format)

Batch mode (for processing whole directory) : จะใชในกรณหลายๆไฟลInput Layer : ขอมล Raster ทตองการจะแปลงไฟลนามสกลอนOutput file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบเลอกนามสกลอนทตองการ เชน *img เปนตนTarget SRS : เปนการก าหนดคาพกดใหกบขอมลภาพอนใหมNo data : เปนการก าหนดผลลพธทไดจะไมมคา 0

Gdal_translate นอกจากจะแปลงไฟลได ยงมความสามารถเกยวกบการบดอดขอมล (Compression) จากไฟลขอมลภาพทมขนาดใหญ สามารถท าใหขอมลมขนาดไฟลทเลกลง แตไมมการสญเสยรายละเอยดภาพมากนก

QGIS Raster Tools [GDAL]

Conversion- Translate (Convert format)

gdal_translate -a_nodata 0 -of GTiff -co COMPRESS=LZW C:/Temp/Data/Site_MaeMoh_Thaichote20091223.tif C:/Temp/Data/mm_thaichote_lzw.tif

QGIS Raster Tools [GDAL]

Conversion- RGB to PCT (Convert a 24bit RGB image to 8bit paletted)

Input file : ขอมลภาพ Raster ทตองการจะ Convert RGBOutput file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “thaichote_rgb2pct.tif”Number of colors : ก าหนดจ านวนของคาส pseudo color (ตองอยระหวาง 2 – 256)

QGIS Raster Tools [GDAL]

Conversion- RGB to PCT (Convert an 8bit paletted image to 24bit RGB)

Input file : ขอมลภาพ Raster ทตองการจะ Convert RGBOutput file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “thaichote_rgb.tif”Band of convert : จ านวนแบนดทจะแปลง (ก าหนดใหเลอกเปนคาเรมตน คอ 1)

QGIS Raster Tools [GDAL]

Extraction

QGIS Raster Tools [GDAL]

Extraction- Contour- Clipper

Extraction กลมเครองมอชดนจะมหนาทหลกในการสกดเสนชนความสงเทา(Contour)จากขอมลแบบจ าลองระดบสงเชงเลข(DEM) และการตดขอมลภาพเปนหลก

QGIS Raster Tools [GDAL]

Extraction- Contour

Input file (raster) : ขอมลแบบจ าลองระดบสงเชงเลข(DEM) Output file (shapefile) : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “mm_contour.shp”Interval between contour lines : การก าหนดชวงชนความสง โดยเทากบ 5 เมตรAttribute name : ใหท าการตกกากบากทตรงหนาชอง Attribute name จะท าใหเราได Attribute ความสงมาดวย (โดย ELEV จะเปนชอฟลด ซงเปนคาเรมตน)

QGIS Raster Tools [GDAL]

Extraction - Contour

QGIS Raster Tools [GDAL]

Extraction- Clipper การตดขอมลภาพ โดยการใชเมาสลากไปยงบรเวณพนททเราตองการ

Input file (raster) : ขอมลภาพทเราตองการจะตดOutput file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “site_mm_thaichote.tif”

QGIS Raster Tools [GDAL]

QGIS Raster Tools [GDAL]

Input file (raster) : ขอมลภาพทเราตองการจะตดOutput file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “site_mm_thaichote_mask.tif”Clipping mode : ใหเลอก Mask Layer แลวท าการ select ขอมล “mask_layer.shp”

การตดขอมลภาพ โดยการใช Mask Layer

QGIS Raster Tools [GDAL]

จากนนใหท าการลบคาทเปน No data ออก

QGIS Raster Tools [GDAL]

Analysis

QGIS Raster Tools [GDAL]

Analysis- Proximity (Raster distance)- Grid (Interpolation)- DEM (Terrain models)

เครองมอในกลม Analysis จะมหนาทหลกในการวเคราะหขอมลทเปนแบบ Rasterเชน การประมาณคาเชงพนท (Interpolation) การหาคาความชน (Slope) การหาทศดานลาด (Aspect) รวมไปถงการสราง Hillshade และ Color relief เปนตน

- Proximity (Raster distance) QGIS Raster Tools [GDAL]

Input file : ขอมลภาพทเราตองการท า Proximity (Raster distance) ก าหนดใหเปน “road.tif”Output file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “road_buffer_geo.tif”Dist units : ก าหนดหนวยวดเปนแบบ “GEO”Max dist : ระยะทาง 10 เมตรNo data : ก าหนด No data เทากบ 0

QGIS Raster Tools [GDAL]- Proximity (Raster distance)

Dist units : GEOใหใชเครองมอ Identify และ Measure line ท าการวดคาและระยะทาง เพอสงเกตการณเปลยนแปลง เพอเปรยบเทยบกบ Distance unit แบบ Pixel

QGIS Raster Tools [GDAL]- Proximity (Raster distance)

Input file : ขอมลภาพทเราตองการท า Proximity (Raster distance) ก าหนดใหเปน “road.tif”Output file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “road_buffer_px.tif”Dist units : ก าหนดหนวยวดเปนแบบ “PIXEL”Max dist : ระยะหาง 10 pixelNo data : ก าหนด No data เทากบ 0

QGIS Raster Tools [GDAL]

Dist units : PIXEL- Proximity (Raster distance)

ใหใชเครองมอ Identify และ Measure line ท าการวดคาและระยะทาง เพอสงเกตการณเปลยนแปลง เพอเปรยบเทยบกบ Distance unit แบบ Geo

QGIS Raster Tools [GDAL]- Grid (Interpolation)

Input file : ขอมลภาพทเราตองการ Interpolation ก าหนดใหใชขอมล “sponcom.shp”Z Field : Spon_Area (ฟลดทตองการทจะน าคามา Interpolation)Output file : ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “invdist.tif”Algorithm : ก าหนดหนวยวดเปนแบบ “Inverse Distance to a Power” => Power = 2 และ Smoothing = 1Resize : Width = 1000 และ Height = 1000

QGIS Raster Tools [GDAL]- Grid (Interpolation)

ใหใช color ramp ทไดเตรยมไวเปนไฟล “color_map.txt” โดยใหเลอกใชขอมลทตองการ >> properties >> แถบเมน color map จากนนก browse ไปหา “color_map.txt”

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Hillshade

ขอมลแบบจ าลองระดบสงเชงเลข (DEM)

ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “hillshade.tif”

ก าหนดคา Z factor เทากบ “3”

ก าหนดคา Azmuth of the light เทากบ “90”

คลกโหลดขอมลหลงจากทท าเสรจแลว

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Hillshade

ใหใชหลกการซอนทบ overlay โดยก าหนดใหชนขอมล DEM อยดานบน hillshade แลวท าให DEM มคาความโปรงแสง (Transparency) เทากบ “30”

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Hillshade

ใหใชท าการผสมสใหกบชนขอมล DEM โดยใช Plugin >> mmqgis >> modify >> color map

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Slope

ขอมลแบบจ าลองระดบสงเชงเลข (DEM)

ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “slope.tif”

ก าหนด Mode เปน “Slope”

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Slope

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Aspect

ขอมลแบบจ าลองระดบสงเชงเลข (DEM)

ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “aspect.tif”

ก าหนด Mode เปน “Aspect”

คลกกากบาก

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Aspect

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Color relief

ขอมลแบบจ าลองระดบสงเชงเลข (DEM)

ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “color_relief.tif”

ก าหนด Mode เปน “Color relief”

คลกกากบาก

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Color relief

ท าการก าหนดคาความโปรงแสง (Transparency) เทากบ “50” ซงทานจะเหนวาสทไดมนยงไมสวย เราสามารถปรบแกคาสใหมเขาไปไดครบ

https://svn.osgeo.org/grass/grass/branches/releasebranch_6_4/lib/gis/colors/

QGIS Raster Tools [GDAL]- DEM (Terrain models) : Color relief

เมอเราไดคาส ทเราตองการแลว เพยงแค Save เปนนามสกล .txt เทานเรากไดสตามตองการแลวครบ

QGIS Raster Tools [GDAL]

Miscellaneous

QGIS Raster Tools [GDAL]

Miscellaneous- Build Virtual Raster (Catalog)- Merge- Information- Build overviews (Pyramids)- Tile index

เครองมอในกลม Miscellaneous จะเปนกลมเครองมอเบดเตลด โดยสวนใหญทจะใชงานบอยๆ กจะม Merge, Information และ Tile index ซงเครองมอกลมนจะใชงานควบคไปกบการท า Map Server เปนตน

QGIS Raster Tools [GDAL]- Build Virtual Raster (Catalog)

ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “thaichote.vrt”

ก าหนด No Data เปน “0”

คลกกากบาก

ใหเลอกขอมลภาพทโฟลเดอร 1_gdalwarp >>

Thaichote20091223.tif

QGIS Raster Tools [GDAL]- Build Virtual Raster (Catalog)

QGIS Raster Tools [GDAL]- Merge

ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “mosaic.tif”

คลกปม OK

ใหเลอกขอมลภาพทโฟลเดอร merge >> เลอกทงหมด 20 ภาพ

QGIS Raster Tools [GDAL]- Merge

QGIS Raster Tools [GDAL]- Information

QGIS Raster Tools [GDAL]- Information

QGIS Raster Tools [GDAL]- Build overviews (Pyramids)

Resampling method : nearest

คลกปม OK

ใหเลอกขอมลภาพ mosaic.tif

Levels : เราสามารถก าหนดเองได เชน 2 4 8 16 32 64 128 256

• เปนการสรางพระมดใหกบขอมลภาพ ซงจะชวยใหขอมลภาพทมไฟลขนาดใหญแสดงผลไดเรวขน• ชนพระมดทถกสรางขนจะถกบนทกทบลงไปในไฟลเดม ซงจะท าใหไฟลมขนาดใหญขน

QGIS Raster Tools [GDAL]- Tile index

เปนการสราง Tile Index ใหกบขอมลภาพ เพอการท างานรวมกบ UMN MapServer

ก าหนดต าแหนงผลลพธของขอมลทได พรอมกบตงชอเปน “ortho.shp”

คลกปม OK

ใหเลอกขอมลภาพโดยเลอกเปนแบบโฟลเดอร “tile_index”

ก าหนดใหสราง index field คาเรมตนใชชอวา “location”

QGIS Raster Tools [GDAL]- Tile index

• Raster Calculator• RasterCal Plugin

QGIS Raster Tools [GDAL]

QGIS WorkshopPart II

QGIS Raster Tools [GDAL]

Using the QGIS Raster Calculator

Operators :• Mathematical ( +, -, *, / )• Trigonometric (sin, cos, tan, asin, acos, atan)• Comparison (<, >, =, <=, >=)• Logical (AND, OR)

QGIS Raster Tools [GDAL]1. ใหใชขอมลในโฟลเดอร rcal_1 เปดขอมลภาพ “L72130047_20061110_B4.tif”จากนนใหค านวณหาคา DN ทนอยกวาหรอเทากบ 40

Ans = L72130047_20061110_B4@1 <= 40

QGIS Raster Tools [GDAL]2. ใหน าผลลพธทไดจากขอท 1 มาคณกบ “L72130047_20061110_B4.tif” เพอจะท าการลบคาทมากกวา 40 ใหหมด ดงนนกจะเหลอแคคา DN ทเราตองการ

Ans = L72130047_20061110_B4@1 * dn_lseq50@1

QGIS Raster Tools [GDAL]3. ใหใชขอมลในโฟลเดอร rcal_2 เปดขอมลภาพ “DEM.tif” จากนนใหค านวณหาคาความสงของ DEM ทอยระหวาง 350 และ 600 ใหมคาเทากบ 1 (AND,OR)

Ans = ……………………………………………………………………………………………

QGIS Raster Tools [GDAL]

Using the RasterCal Plugin

Operators :• Mathematical ( +, -, *, / )• Natural logarithm (log), exponent (exp) and exponentiation (^)• Trigonometric (sin, cos, tan, asin, acos, atan)• Comparison (<, >, =, <=, >=)• Logical (AND, OR)• Conditional statements (lt - less, gt - greater, eq - equal, ne -

not equal, le - less or equal, ge - greater or equal)

QGIS Raster Tools [GDAL]

การตดตงปลกอน RasterCal Plugin1. Plugins => Fetch Python Plugins… 2. ในชอง Filter ใหคนหาค าวา “RasterCalc”3. จากนนใหคลกปม Install Plugin

QGIS Raster Tools [GDAL]

le => less or equal นอยกวาหรอเทากบle( [DEM]@1, 130, 200 )

lt => less นอยกวาlt ( [DEM]@1, 100,100 )

QGIS Raster Tools [GDAL]

- คาความสงทงหมดทนอยกวา 100 เมตร จะถกแทนทดวยคา 100

QGIS Raster Tools [GDAL]

gt => greaterlt มากกวาgt ( [lt_relief]@1, [dem_relief]@1, [base]@1 )gt ( [lt_relief]@1, 500, [base]@1 )

QGIS Raster Tools [GDAL]

eq => equal เทากบ และ ไมเทากบeq ( [ep_relief]@1, [base]@1, [mask_exp]@1)eq ( [ep_relief]@1, [base]@1,[dem_relief]@1 * 2.8 )ne ( [ep_relief]@1 ,[base]@1, 150 )ne ( [ep_relief]@1 ,[base]@1,[mask_exp]@1 )

QGIS Raster Tools [GDAL]

ge => greater or equal มากกวาหรอเทากบge ( [mask_exp]@1, 1700 , [mask_exp]@1 /2 )ge ( [mask_exp]@1, 1700 , [mask_exp]@1 /2 - 80 )

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

1. เปดขอมลภาพดาวเทยมในโฟลเดอร “rcal_ndvi”2. ท าการผสมสโดยก าหนดเปน 432 : RGB

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

3. ไปทเมน Plugin => RasterCal4. ใหท าการใสสตรดงน :( [L72130047_20061110]@4 - [L72130047_20061110]@3 ) / ( [L72130047_20061110]@4 + [L72130047_20061110]@3)

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

5. เปนสใหเปน Color Map และ ใหสราง Legend ออกมาดวย

QGIS Raster Tools [GDAL]

Difference [spectral difference (NIR-VIS)]

ใหค านวณหา Difference โดยใสสตรดงน :[L72130047_20061110]@4 - [L72130047_20061110]@3

SAGA GIS WorkshopSystem for Automated Geoscientific Analyses

SAGA GIS Workshop

gist@nu

SAGA GIS Workshop

Modules : • Import Data• Export Data• Grid (Interpolation & Reclassify Grid Value)• Classify (Imagery)• Basic Terrain Analysis• 3D Visualization

gist@nu

SAGA GIS Workshop

Modules : • Import Data (GDAL/OGR)• Vector Data (ESRI Shapefile)• Raster (Geo Tiff)

ขนตอนการน าเขาขอมลเวกเตอรไปทเมน Modules >> File >> GDAL/OGR >> OGR: Import Vector Data

Import Data (GDAL/OGR)

gist@nu

SAGA GIS WorkshopImport Data (GDAL/OGR)

gist@nu

SAGA GIS Workshop

เปลยนคณสมบตของขอมลImport Data (GDAL/OGR)

gist@nu

SAGA GIS WorkshopImport Data (GDAL/OGR)

เปดตาราง Attribute ของขอมล

gist@nu

SAGA GIS Workshop

Modules : • Import Data (GDAL/OGR)• Vector Data (ESRI Shapefile)• Raster (Geo Tiff)

ขนตอนการน าเขาขอมลภาพไปทเมน Modules >> File >> GDAL/OGR >> OGR: Import Raster

Import Data (GDAL/OGR)

gist@nu

SAGA GIS WorkshopImport Data (GDAL/OGR)

ใหท าความเขาใจเกยวกบแถบเมนตางgist@nu

SAGA GIS WorkshopImport Data (GDAL/OGR)

การ Identify ขอมล

gist@nu

SAGA GIS WorkshopImport Data (GDAL/OGR)การสราง Color Composite

ขนตอนการสราง Color Compositeไปทเมน Modules >> Grid >> Visualisation >> RGB Composite

gist@nu

SAGA GIS WorkshopImport Data (GDAL/OGR)

gist@nu

SAGA GIS WorkshopImport Data (GDAL/OGR)

* จากนนใหลองผสมสเปน 321 : RGB และ อนๆgist@nu

SAGA GIS Workshop

321 : RGB

Import Data (GDAL/OGR)

gist@nu

SAGA GIS Workshop

Modules : • Export Data (GDAL/OGR)• Vector Data (ESRI Shapefile)• Raster (Geo Tiff)

ขนตอนการน าเขาขอมลเวกเตอรไปทเมน Modules >> File >> GDAL/OGR >> OGR: Export Vector Data

Export Data (GDAL/OGR)

gist@nu

SAGA GIS WorkshopExport Data (GDAL/OGR)

ก าหนด option ตามภาพ แลวกดปม Okay

ผลลพธทได โปรแกรมจะสรางเปนโฟลเดอรให ดงภาพครบจากนนใหลองเปดดวย QGIS

gist@nu

SAGA GIS WorkshopExport Data (GDAL/OGR)

เปดขอมลดวยโปรแกรม Quantum GIS

gist@nu

SAGA GIS WorkshopExport Data (GDAL/OGR)- ใหท าการ Export Vector Data เปนแบบ KML แลวเปดดวย Google Earth (ตอน Export ใหระบนามสกล .kml ดวย)- ควรจะตอง Define Projection โดย Modules >> Projection >> Set Coordinate Reference System

gist@nu

SAGA GIS WorkshopExport Data (GDAL/OGR)

Modules : • Export Data (GDAL/OGR)• Vector Data (ESRI Shapefile)• Raster (Geo Tiff)

ขนตอนการน าเขาขอมลเวกเตอรไปทเมน Modules >> File >> GDAL/OGR >> OGR: Export Raster to Geo TIFF

gist@nu

SAGA GIS WorkshopExport Data (GDAL/OGR)

เลอกขอมลทตองการจะ Export

Output path และตงชอใหม

gist@nu

SAGA GIS WorkshopExport Data (GDAL/OGR)

เปดขอมลดวยโปรแกรม Quantum GIS

gist@nu

Modules : • Grid (Interpolation)

SAGA GIS WorkshopGrid

ท าการ Interpolation โดยใชขอมล sponcom [Spon_Area]

gist@nu

SAGA GIS WorkshopGrid

ท าการก าหนดคาตางๆ ดงภาพ แลวคลกปม Okay

gist@nu

SAGA GIS WorkshopGrid

gist@nu

SAGA GIS WorkshopGrid

Modules : • Grid (Reclassify Grid Value)

gist@nu

SAGA GIS WorkshopGrid

1. ท าการก าหนดคาตางๆ ดงภาพ

gist@nu

SAGA GIS WorkshopGrid

2. ท าการก าหนดคาตางๆ ดงภาพ

gist@nu

SAGA GIS WorkshopGrid

3. ผลลพธทไดจากการ Reclassify

gist@nu

Modules : • Classify (Imagery)

SAGA GIS WorkshopClassify (Imagery)

1. กอนทจะ Classify ใหท าการผสมสโดยก าหนดใหเปน 543 : RGB ดงภาพ

gist@nu

SAGA GIS WorkshopClassify (Imagery)

2. ท าการก าหนดคาตางๆ ดงภาพ

gist@nu

SAGA GIS WorkshopClassify (Imagery)

3. ผลลพธทไดจากการ Reclassify โดยก าหนด 5 Class

gist@nu

SAGA GIS WorkshopClassify (Imagery)

4. ให Export ออกเปนแบบ GeoTiff แลวน าไปเปดในโปรแกรม QGIS

gist@nu

5. เปดขอมลภาพทสงออกมา โดยแสดงผลในโปรแกรม QGIS SAGA GIS WorkshopClassify (Imagery)

gist@nu

Modules : • Standard Terrain Analysis

SAGA GIS WorkshopBasic Terrain Analysis

gist@nu

1. Import DEM (Digital Elevation Model) เขามากอน ดงภาพ

gist@nu

2. ไปทเมน Modules > Terrain Analysis > Standard Terrain AnalysisSAGA GIS WorkshopBasic Terrain Analysis

gist@nu

SAGA GIS WorkshopBasic Terrain Analysis

3. ก าหนดคา Grid system และ Elevation ทเหลอใหท าการสรางใหมหมด [create]

gist@nu

SAGA GIS WorkshopBasic Terrain Analysis

4. ผลลพธทได

gist@nu

SAGA GIS WorkshopBasic Terrain Analysis

gist@nu

Modules : • 3D Visualization

SAGA GIS Workshop3D Visualization

1. เมอเปดขอมลเขาส Map View ขนมาแลว ใหท าการคลกทปม 3D

gist@nu

SAGA GIS Workshop3D Visualization

1. ท าการก าหนดคาตางๆ ดงน

gist@nu

SAGA GIS Workshop3D Visualization

gist@nu

SAGA GIS Workshop3D Visualization

กรณศกษา: การวเคราะหการกระจายของกลน

ขอมลการลกใหม (CSV)

ขอมลจากสถานตรวจวดกลน (รายวน)

วเคราะหการกระจายของกลน

(Interpolation)

ซอนทบขอมล(Overlay)

แผนทกลนจากพนทลกไหมในพนทเหมองแมเมาะ

ขนตอนการวเคราะห

เลอกวนทตองการวเคราะห (Query)

เลอกวนทตองการวเคราะห (Query)

ต าแหนงตรวจดกลนและจดเกดการลกไหม

การกระจายของกลนจากต าแหนงวดกลน

กลนระดบ 1

กลนระดบ 2

กรณศกษา: แบบจ าลองน าทวมในบอเหมอง

ขอมลความสง ก าหนดระดบน าในบอเหมอง10 ระดบ

วเคราะหระดบน าหลายชวงเวลา

แผนทน าทวมในพนทบอเหมองแมเมาะ

ขนตอนการวเคราะห

สราง Dem

แบบจ าลองน าทวมในบอเหมอง