179
Geospatial Analysis with Open Source GIS Chingchai Humhong and Sakda Homhuan Regional Center of Geo-Informatics and Space Technology, Lower Northern Region Naresuan University [email protected], [email protected] [email protected]

Spatial Analysis Tools with Open Source GIS

Embed Size (px)

Citation preview

Page 1: 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

[email protected], [email protected]@gmail.com

Page 2: Spatial Analysis Tools with Open Source GIS

FTools

Page 3: Spatial Analysis Tools with Open Source GIS

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.

Page 4: Spatial Analysis Tools with Open Source GIS

fTools Plugin

Page 5: Spatial Analysis Tools with Open Source GIS

Analysis Tools

Page 6: Spatial Analysis Tools with Open Source GIS

Menu bar > Vector > Analysis Tools

Page 7: Spatial Analysis Tools with Open Source GIS

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

ต าแหนงวดกลน

หมบาน

Page 8: Spatial Analysis Tools with Open Source GIS

Sum line lengths

Page 9: Spatial Analysis Tools with Open Source GIS

Point in polygon

Page 10: Spatial Analysis Tools with Open Source GIS

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

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

Page 11: Spatial Analysis Tools with Open Source GIS

Line intersections

Intersection point

Page 12: Spatial Analysis Tools with Open Source GIS

แบบฝกหดเปดไฟล 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) เพอคอยเฝาระวงอนตรายจากการล าเลยงถานหน มทงสนกจด?

Page 13: Spatial Analysis Tools with Open Source GIS

Research Tools

Page 14: Spatial Analysis Tools with Open Source GIS

Menu bar > Vector > Research Tools

Page 15: Spatial Analysis Tools with Open Source GIS

Regular points

Page 16: Spatial Analysis Tools with Open Source GIS

Vector grid

Page 17: Spatial Analysis Tools with Open Source GIS

Polygon from layer extent

xMin 572895.80

yMin

20

22

40

7.7

8

xMax 578596.46

yMax

20

30

08

3.5

1

Page 18: Spatial Analysis Tools with Open Source GIS

[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

Page 19: Spatial Analysis Tools with Open Source GIS

[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

Page 20: Spatial Analysis Tools with Open Source GIS

Select by location

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

Page 21: Spatial Analysis Tools with Open Source GIS

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

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

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

Page 22: Spatial Analysis Tools with Open Source GIS

Geoprocessing Tools

Page 23: Spatial Analysis Tools with Open Source GIS

Menu bar > Vector > Geoprocessing Tools

Page 24: Spatial Analysis Tools with Open Source GIS

Convex hull(s)

Page 25: Spatial Analysis Tools with Open Source GIS

Buffer

Page 26: Spatial Analysis Tools with Open Source GIS

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

Page 27: Spatial Analysis Tools with Open Source GIS

Intersect

A B

A Intersect B = AB

Page 28: Spatial Analysis Tools with Open Source GIS

Intersection: Input and output

Page 29: Spatial Analysis Tools with Open Source GIS

Union

A B

A Union B = AB

The input feature layers must have polygon geometry.

Page 30: Spatial Analysis Tools with Open Source GIS

Symetrical difference

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

A B

A Symetrical difference B = AB

Page 31: Spatial Analysis Tools with Open Source GIS

Clip

A B

A Clip B = A

Page 32: Spatial Analysis Tools with Open Source GIS

Line clipped by polygon:

Point clipped by polygon:

Polygon clipped by polygon: Line clipped by line:

Point clipped by point:

Clip: Input and output

Page 33: Spatial Analysis Tools with Open Source GIS

Difference

A B

A Difference B = A

Page 34: Spatial Analysis Tools with Open Source GIS

Dissolve

Page 35: Spatial Analysis Tools with Open Source GIS

แบบฝกหดเปดไฟล 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) วามเนอทเทาใด?

Page 36: Spatial Analysis Tools with Open Source GIS

Geometry Tools

Page 37: Spatial Analysis Tools with Open Source GIS

Menu bar > Vector > Geometry Tools

Page 38: Spatial Analysis Tools with Open Source GIS

Geometry Columns

Point

Line

Polygon

Export/Add geometry columns

Page 39: Spatial Analysis Tools with Open Source GIS

Polygon centroids

Page 40: Spatial Analysis Tools with Open Source GIS

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

Voronoi (Thiessen) polygon

Page 41: Spatial Analysis Tools with Open Source GIS

Polygons to lines

Page 42: Spatial Analysis Tools with Open Source GIS

Lines to polygons

Page 43: Spatial Analysis Tools with Open Source GIS

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

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

Page 44: Spatial Analysis Tools with Open Source GIS

Menu bar > Vector > Data management Tools

Page 45: Spatial Analysis Tools with Open Source GIS

Geographic Coordinate System

Latitu

de

Longitude

Spatial reference:

Page 46: Spatial Analysis Tools with Open Source GIS

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:

Page 47: Spatial Analysis Tools with Open Source GIS

Spatial reference tool: GIS software

Qgis ArcGIS

Page 48: Spatial Analysis Tools with Open Source GIS

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

Page 49: Spatial Analysis Tools with Open Source GIS

ExportToNewProjection

Metadada

Page 50: Spatial Analysis Tools with Open Source GIS

Define current projection

Page 51: Spatial Analysis Tools with Open Source GIS

Joint Attribute

Page 52: Spatial Analysis Tools with Open Source GIS

Joint attribute by location

Page 53: Spatial Analysis Tools with Open Source GIS

Split vector layer

Page 54: Spatial Analysis Tools with Open Source GIS

Merge shapefile

Page 55: Spatial Analysis Tools with Open Source GIS

แบบฝกหดเปดไฟล 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 บาง?

Page 56: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Page 57: Spatial Analysis Tools with Open Source GIS

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.

Page 58: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

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

Page 59: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

gdalinfo C:/temp/Data/Site_MaeMoh_Thaichote20091223.tifgdalinfo

Page 60: Spatial Analysis Tools with Open Source GIS

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

Page 61: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

Page 62: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

Page 63: Spatial Analysis Tools with Open Source GIS

Projections

Page 64: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Projections- Warp (Reproject)- Assign projection

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

Page 65: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

- Warp (Reproject)Projections

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

Page 66: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

- Assign projectionProjections

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

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

Page 67: Spatial Analysis Tools with Open Source GIS

Conversion

Page 68: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

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

Page 69: Spatial Analysis Tools with Open Source GIS

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) : ก าหนดขนาดไฟลของผลลพธทได จะเปนพกเซล

Page 70: Spatial Analysis Tools with Open Source GIS

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

Page 71: Spatial Analysis Tools with Open Source GIS

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

Page 72: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Conversion- Polygonize (Raster to vector)

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

Page 73: Spatial Analysis Tools with Open Source GIS
Page 74: Spatial Analysis Tools with Open Source GIS

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) จากไฟลขอมลภาพทมขนาดใหญ สามารถท าใหขอมลมขนาดไฟลทเลกลง แตไมมการสญเสยรายละเอยดภาพมากนก

Page 75: Spatial Analysis Tools with Open Source GIS

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

Page 76: Spatial Analysis Tools with Open Source GIS

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)

Page 77: Spatial Analysis Tools with Open Source GIS

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)

Page 78: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Extraction

Page 79: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Extraction- Contour- Clipper

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

Page 80: Spatial Analysis Tools with Open Source GIS

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 จะเปนชอฟลด ซงเปนคาเรมตน)

Page 81: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Extraction - Contour

Page 82: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

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

Page 83: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Page 84: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

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

Page 85: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

Page 86: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Analysis

Page 87: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

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

Page 88: Spatial Analysis Tools with Open Source GIS

- 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

Page 89: Spatial Analysis Tools with Open Source GIS

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

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

Page 90: Spatial Analysis Tools with Open Source GIS

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

Page 91: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Dist units : PIXEL- Proximity (Raster distance)

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

Page 92: Spatial Analysis Tools with Open Source GIS

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

Page 93: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]- Grid (Interpolation)

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

Page 94: Spatial Analysis Tools with Open Source GIS

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

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

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

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

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

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

Page 95: Spatial Analysis Tools with Open Source GIS

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

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

Page 96: Spatial Analysis Tools with Open Source GIS

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

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

Page 97: Spatial Analysis Tools with Open Source GIS

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

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

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

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

Page 98: Spatial Analysis Tools with Open Source GIS

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

Page 99: Spatial Analysis Tools with Open Source GIS

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

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

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

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

คลกกากบาก

Page 100: Spatial Analysis Tools with Open Source GIS

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

Page 101: Spatial Analysis Tools with Open Source GIS

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

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

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

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

คลกกากบาก

Page 102: Spatial Analysis Tools with Open Source GIS

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

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

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

Page 103: Spatial Analysis Tools with Open Source GIS

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

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

Page 104: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Miscellaneous

Page 105: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

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

Page 106: Spatial Analysis Tools with Open Source GIS

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

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

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

คลกกากบาก

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

Thaichote20091223.tif

Page 107: Spatial Analysis Tools with Open Source GIS

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

Page 108: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]- Merge

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

คลกปม OK

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

Page 109: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]- Merge

Page 110: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]- Information

Page 111: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]- Information

Page 112: Spatial Analysis Tools with Open Source GIS

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

Resampling method : nearest

คลกปม OK

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

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

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

Page 113: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]- Tile index

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

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

คลกปม OK

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

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

Page 114: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]- Tile index

Page 115: Spatial Analysis Tools with Open Source GIS

• Raster Calculator• RasterCal Plugin

QGIS Raster Tools [GDAL]

QGIS WorkshopPart II

Page 116: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Using the QGIS Raster Calculator

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

Page 117: Spatial Analysis Tools with Open Source GIS

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

Ans = L72130047_20061110_B4@1 <= 40

Page 118: Spatial Analysis Tools with Open Source GIS

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

Ans = L72130047_20061110_B4@1 * dn_lseq50@1

Page 119: Spatial Analysis Tools with Open Source GIS

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

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

Page 120: Spatial Analysis Tools with Open Source GIS

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)

Page 121: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

Page 122: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

Page 123: Spatial Analysis Tools with Open Source GIS

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

QGIS Raster Tools [GDAL]

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

Page 124: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

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

Page 125: Spatial Analysis Tools with Open Source GIS

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 )

Page 126: Spatial Analysis Tools with Open Source GIS

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 )

Page 127: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

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

Page 128: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

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

Page 129: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

Page 130: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

NDVI : Normalized Difference Vegetation Index

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

Page 131: Spatial Analysis Tools with Open Source GIS

QGIS Raster Tools [GDAL]

Difference [spectral difference (NIR-VIS)]

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

Page 132: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopSystem for Automated Geoscientific Analyses

SAGA GIS Workshop

gist@nu

Page 133: Spatial Analysis Tools with Open Source GIS

SAGA GIS Workshop

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

gist@nu

Page 134: Spatial Analysis Tools with Open Source GIS

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

Page 135: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopImport Data (GDAL/OGR)

gist@nu

Page 136: Spatial Analysis Tools with Open Source GIS

SAGA GIS Workshop

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

gist@nu

Page 137: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopImport Data (GDAL/OGR)

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

gist@nu

Page 138: Spatial Analysis Tools with Open Source GIS

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

Page 139: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopImport Data (GDAL/OGR)

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

Page 140: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopImport Data (GDAL/OGR)

การ Identify ขอมล

gist@nu

Page 141: Spatial Analysis Tools with Open Source GIS

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

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

gist@nu

Page 142: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopImport Data (GDAL/OGR)

gist@nu

Page 143: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopImport Data (GDAL/OGR)

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

Page 144: Spatial Analysis Tools with Open Source GIS

SAGA GIS Workshop

321 : RGB

Import Data (GDAL/OGR)

gist@nu

Page 145: Spatial Analysis Tools with Open Source GIS

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

Page 146: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopExport Data (GDAL/OGR)

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

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

gist@nu

Page 147: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopExport Data (GDAL/OGR)

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

gist@nu

Page 148: Spatial Analysis Tools with Open Source GIS

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

gist@nu

Page 149: Spatial Analysis Tools with Open Source GIS

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

Page 150: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopExport Data (GDAL/OGR)

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

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

gist@nu

Page 151: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopExport Data (GDAL/OGR)

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

gist@nu

Page 152: Spatial Analysis Tools with Open Source GIS

Modules : • Grid (Interpolation)

SAGA GIS WorkshopGrid

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

gist@nu

Page 153: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopGrid

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

gist@nu

Page 154: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopGrid

gist@nu

Page 155: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopGrid

Modules : • Grid (Reclassify Grid Value)

gist@nu

Page 156: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopGrid

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

gist@nu

Page 157: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopGrid

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

gist@nu

Page 158: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopGrid

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

gist@nu

Page 159: Spatial Analysis Tools with Open Source GIS

Modules : • Classify (Imagery)

SAGA GIS WorkshopClassify (Imagery)

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

gist@nu

Page 160: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopClassify (Imagery)

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

gist@nu

Page 161: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopClassify (Imagery)

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

gist@nu

Page 162: Spatial Analysis Tools with Open Source GIS

SAGA GIS WorkshopClassify (Imagery)

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

gist@nu

Page 163: Spatial Analysis Tools with Open Source GIS

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

gist@nu

Page 164: Spatial Analysis Tools with Open Source GIS

Modules : • Standard Terrain Analysis

SAGA GIS WorkshopBasic Terrain Analysis

gist@nu

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

Page 165: Spatial Analysis Tools with Open Source GIS

gist@nu

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

Page 166: Spatial Analysis Tools with Open Source GIS

gist@nu

SAGA GIS WorkshopBasic Terrain Analysis

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

Page 167: Spatial Analysis Tools with Open Source GIS

gist@nu

SAGA GIS WorkshopBasic Terrain Analysis

4. ผลลพธทได

Page 168: Spatial Analysis Tools with Open Source GIS

gist@nu

SAGA GIS WorkshopBasic Terrain Analysis

Page 169: Spatial Analysis Tools with Open Source GIS

gist@nu

Modules : • 3D Visualization

SAGA GIS Workshop3D Visualization

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

Page 170: Spatial Analysis Tools with Open Source GIS

gist@nu

SAGA GIS Workshop3D Visualization

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

Page 171: Spatial Analysis Tools with Open Source GIS

gist@nu

SAGA GIS Workshop3D Visualization

Page 172: Spatial Analysis Tools with Open Source GIS

gist@nu

SAGA GIS Workshop3D Visualization

Page 173: Spatial Analysis Tools with Open Source GIS

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

Page 174: Spatial Analysis Tools with Open Source GIS

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

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

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

(Interpolation)

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

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

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

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

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

Page 175: Spatial Analysis Tools with Open Source GIS

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

Page 176: Spatial Analysis Tools with Open Source GIS

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

กลนระดบ 1

กลนระดบ 2

Page 177: Spatial Analysis Tools with Open Source GIS

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

Page 178: Spatial Analysis Tools with Open Source GIS

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

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

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

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

สราง Dem

Page 179: Spatial Analysis Tools with Open Source GIS

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