<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Satap_srm on Medium]]></title>
        <description><![CDATA[Stories by Satap_srm on Medium]]></description>
        <link>https://medium.com/@tam.menot?source=rss-755434259fbb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FeK4zweQ5GLJqKUqeK1jEA.jpeg</url>
            <title>Stories by Satap_srm on Medium</title>
            <link>https://medium.com/@tam.menot?source=rss-755434259fbb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 07:00:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tam.menot/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[วิธีกำหนด ID อัตโนมัติ เมื่อสร้าง Feature ใหม่ บน QGIS]]></title>
            <link>https://medium.com/mapedia/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%81%E0%B8%B3%E0%B8%AB%E0%B8%99%E0%B8%94-id-%E0%B8%AD%E0%B8%B1%E0%B8%95%E0%B9%82%E0%B8%99%E0%B8%A1%E0%B8%B1%E0%B8%95%E0%B8%B4-%E0%B9%80%E0%B8%A1%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-feature-%E0%B9%83%E0%B8%AB%E0%B8%A1%E0%B9%88-%E0%B8%9A%E0%B8%99-qgis-f01580cb0d4a?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/f01580cb0d4a</guid>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[mapping]]></category>
            <category><![CDATA[qgis]]></category>
            <category><![CDATA[mapedia]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Wed, 16 Aug 2023 09:39:49 GMT</pubDate>
            <atom:updated>2023-08-21T07:28:24.997Z</atom:updated>
            <content:encoded><![CDATA[<p>หลายคนที่มีโอกาสได้ใช้โปรแกรม QGIS ในการสร้างข้อมูลประเภทต่างๆ ไม่ว่าจะเป็นข้อมูลจุด เส้น หรือ พื้นที่ปิด จะพบปัญหาหลังจากวาดเสร็จแล้วต้องมานั่งกรอก id ของแต่ละข้อมูล ซึ่งอาจจะทำให้เกิดการล่าช้าในการสร้างข้อมูล วันนี้ผมจะมาแนะนำการกำหนด id อัตโนมัติ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NMN_EU9fZfDLjfBaVkPCPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1HtvKhCqowiJVmVQ-qIwmg.png" /></figure><p>ขั้นแรกให้เลือกชั้นข้อมูลที่เราต้องการ จากนั้นคลิกขวาที่ชั้นข้อมูล เลือก Properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VNflJRzAiw5zUnxEkx_0Xg.png" /></figure><p>จะปรากฏหน้าต่าง Properties เลือก Attributes Form จากนั้นในหัวข้อ Fields ให้เลือกคอลัมน์ที่เราต้องการ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WfFAE9SL-KaVvZRiuFMhdg.png" /></figure><p>เมื่อเลือกคอลัมน์ที่ต้องการเรียบร้อย จะปรากฏเมนูให้ตั้งค่า มองหาเมนู Default value</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gG_RtO4o2t51l6AIYbr-Pg.png" /></figure><p>จะปรากฏหน้าต่าง Expression Dialog ให้ทำการใส่สูตรที่ต้องการ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3lmT05_ZAtGVmULV8Q-wHg.png" /></figure><p>โดยสูตรมีให้เลือกสองแบบคือ</p><ul><li>if (maximum(“id”) is NULL, 1 ,maximum(“id”) + 1) กำหนด id อัตโนมัติจากข้อมูลในตารางคอลัมน์ id เช่น ถ้าเรามี id ที่ 5 อยู่แล้ว เมื่อวาดใหม่จะกรอกค่า id อัตโนมัติ เป็น id = 6</li><li>if (count(‘id’) = 0, 1 ,count(‘id’)+1) กำหนด id อัตโนมัติจากข้อมูล ใช้ในกรณีที่ข้อมูลไม่มีข้อมูลตาราง แต่ต้องการนับเป็น id ด้วย เช่น ถ้าเรามี id ที่ 5 อยู่แล้ว เมื่อวาดใหม่ เมื่อวาดใหม่จะกรอกค่า id อัตโนมัติ เป็น id = 2 ซึ่งนับตามจำนวนรูปที่วาดไว้</li></ul><p>เมื่อเลือกสูตรได้แล้วให้ใส่สูตรแล้วก็กด ok ก็เรียบร้อยสำหรับการ กำหนด ID อัตโนมัติ เมื่อสร้าง Feature ใหม่ บน QGIS</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQnirg11Zc-9gflt8M2b6g.png" /></figure><p>ทดสอบการวาดก็จะปรากฏ ID ให้อัตโนมัติให้เราเป็นอันเรียบร้อย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*bpkgrrlZ1msb_1q1V8AkqA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f01580cb0d4a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/%E0%B8%A7%E0%B8%B4%E0%B8%98%E0%B8%B5%E0%B8%81%E0%B8%B3%E0%B8%AB%E0%B8%99%E0%B8%94-id-%E0%B8%AD%E0%B8%B1%E0%B8%95%E0%B9%82%E0%B8%99%E0%B8%A1%E0%B8%B1%E0%B8%95%E0%B8%B4-%E0%B9%80%E0%B8%A1%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%AA%E0%B8%A3%E0%B9%89%E0%B8%B2%E0%B8%87-feature-%E0%B9%83%E0%B8%AB%E0%B8%A1%E0%B9%88-%E0%B8%9A%E0%B8%99-qgis-f01580cb0d4a">วิธีกำหนด ID อัตโนมัติ เมื่อสร้าง Feature ใหม่ บน QGIS</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ตั้งค่าการแสดงผลของเครื่องมือ Digitize และเครื่องมือ Select Feature ง่ายๆใน QGIS]]></title>
            <link>https://medium.com/mapedia/%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%AA%E0%B8%94%E0%B8%87%E0%B8%9C%E0%B8%A5%E0%B8%82%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B8%A1%E0%B8%B7%E0%B8%AD-digitize-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B8%A1%E0%B8%B7%E0%B8%AD-select-feature-%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B9%86%E0%B9%83%E0%B8%99-qgis-9ddce55efc48?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ddce55efc48</guid>
            <category><![CDATA[mapedia]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[qgis]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Wed, 02 Aug 2023 03:01:50 GMT</pubDate>
            <atom:updated>2023-08-03T02:34:49.361Z</atom:updated>
            <content:encoded><![CDATA[<p>หลายคนคงเคยใช้โปรแกรม QGIS กันอยู่แล้ว ซึ่งเวลาที่เราใช้เครื่องมือ โปรแกรมจะตั้งค่าสี และขนาดของเส้นให้อัตโนมัติ วันนี้จะมาแนะนำวิธีการตั้งค่าเพื่อให้เกิดความง่ายต่อการใช้งานมากยิ่งขึ้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDAB1FoyVrDmLya9LViCig.png" /></figure><p>มาเริ่มกันที่ เครื่องมือ Digitize ปกติเครื่องมือ Digitize จะมีขนาดเส้นและสีที่ตั้งค่าให้อัตโนมัติ โดยถ้าหากจะตั้งค่าให้ไปที่เมนู Setting แล้วเลือก Option</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*cMLRUCCQGAzgCUyx3I89Jw.png" /></figure><p>จากนั้นจะปรากฏหน้าต่างแล้วไปที่เมนู Map Tools แล้วเลือก Digitizing จะเห็นเมนูให้ตั้งค่า Rubberband เลือกปรับขนาดเส้นและสี ตามต้องการ</p><ul><li>Line width ขนาดของเส้น</li><li>Line color สีของเส้น</li><li>Fill color สีของพื้นที่ข้างในเส้น</li></ul><p>ในส่วนของการตั้งค่าอื่นๆก็สามารถปรับได้ตามต้องการเช่นกัน</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jpr0MxFzV0Z5rPrFZDTaxA.png" /></figure><p>ในส่วนของเครื่องมือ Select Feature โดยปกติโปรแกรมจะตั้งค่าให้ฟีเจอร์ที่ทำการเลือกเป็นสีเหลือง โดยสามารถตั้งค่าเพิ่มเติมได้ที่ เมนู Project แล้วเลือก Properties</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*6mFXENymd8EKLb8qbecfGA.png" /></figure><p>ในเมนู General จะเห็นเมนู Selection color เลือกปรับสี ความโปร่งใสได้ตามต้องการได้เลย</p><ul><li>background color เป็นการตั้งค่าสีพื้นหลังของส่วนแสดงผลแผนที่ทั้งหมด</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pRYocvPvdHTy3xbV1YOxPA.png" /></figure><p>เป็นอันเรียบร้อยสำหรับการตั้งค่าเบื้องต้น ในส่วนของการตั้งค่าอื่นๆนั้นสามารถหาได้จาก</p><p><a href="https://docs.qgis.org/3.22/en/docs/user_manual/introduction/qgis_configuration.html">https://docs.qgis.org/3.22/en/docs/user_manual/introduction/qgis_configuration.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ddce55efc48" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/%E0%B8%95%E0%B8%B1%E0%B9%89%E0%B8%87%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%81%E0%B8%AA%E0%B8%94%E0%B8%87%E0%B8%9C%E0%B8%A5%E0%B8%82%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B8%A1%E0%B8%B7%E0%B8%AD-digitize-%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B8%A1%E0%B8%B7%E0%B8%AD-select-feature-%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B9%86%E0%B9%83%E0%B8%99-qgis-9ddce55efc48">ตั้งค่าการแสดงผลของเครื่องมือ Digitize และเครื่องมือ Select Feature ง่ายๆใน QGIS</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ปรับค่า Raster ให้เป็นค่าจริงด้วย scale factor และ add offset]]></title>
            <link>https://medium.com/mapedia/%E0%B8%9B%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%84%E0%B9%88%E0%B8%B2-raster-%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%9B%E0%B9%87%E0%B8%99%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%88%E0%B8%A3%E0%B8%B4%E0%B8%87%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-scale-factor-%E0%B9%81%E0%B8%A5%E0%B8%B0-add-offset-59bc12846189?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/59bc12846189</guid>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rasterio]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Thu, 18 May 2023 04:00:54 GMT</pubDate>
            <atom:updated>2023-05-19T14:44:14.158Z</atom:updated>
            <content:encoded><![CDATA[<p>บางครั้งที่เราทำการดาวน์โหลดภาพดาวเทียมจากแหล่งต่างๆมา เราจะได้ไฟล์ที่เป็น .nc .hdf5 บ้าง เราจึงจำเป็นต้องแปลงให้เป็น geotiff ก่อนนำมาใช้งาน ก็จะพบปัญหาคือ เมื่อนำไฟล์ไปเปิดใน qgis ปรากฏว่าค่าของ raster กลายเป็น 0–255 ไปซะงั้น ปัญหานี้สามารถแก้ไขได้ด้วย Rasterio</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h51GYl8ZoVMh4cSEl3elBQ.png" /></figure><p>Rasterio เป็นหนึ่งในไลบรารี Python ที่ใช้ในการอ่านและเขียนข้อมูลเราเตอร์ (raster data) ในรูปแบบที่เป็นไฟล์ภาพ รวมไปถึงการเข้าถึงข้อมูล Meta Data</p><p>ศึกษาเพิ่มเติมได้ที่</p><p><a href="https://github.com/rasterio/rasterio/blob/4c01600b0e8c8841c661cbaf1297ac52f601fc3a/docs/index.rst">rasterio/index.rst at 4c01600b0e8c8841c661cbaf1297ac52f601fc3a · rasterio/rasterio</a></p><p><strong>ขั้นตอนการเปิดภาพด้วย rasterio เริ่มต้นด้วยการติดตั้ง rasterio โดยสามารถติดตั้งผ่าน pip หรือ conda ได้ตามปกติ</strong></p><pre>pip install rasterio</pre><p>เมื่อติดตั้งเรียบร้อยแล้วทำการ import มาใช้งานในไพธอนไฟล์</p><pre>import rasterio</pre><p>วิธีการเปิดไฟล์ด้วย rasterio</p><pre>#input_path = ตำแหน่งที่เก็บไฟล์ราสเตอร์<br>with rasterio.open(input_path) as src:</pre><p>เริ่มปรับแก้กันเลย</p><pre>with rasterio.open(input_path) as src:<br>      arr = src.read(1)<br>      arr = arr.astype(rasterio.float32)<br>      <br>      # ค้นหาข้อมูล scale_factor add_offset ใน metadata ของข้อมูล<br>      scale_factor = src.tags()[&#39;scale_factor&#39;] <br>      add_offset = src.tags()[&#39;add_offset&#39;]<br><br>      # ปรับแก้ค่า<br>      arr = arr * float(scale_factor) + float(add_offset)<br>      <br>      # คัดลอกข้อมูลราสเตอร์เดิม<br>      kwargs = src.meta.copy()<br><br>      kwargs.update(<br>          dtype=rasterio.float32,<br>          count=1<br>      )<br><br>      # บันทึกเป็นไฟล์ใหม่<br>      with rasterio.open(output_path, &quot;w&quot;, **kwargs) as dst:<br>        dst.write(arr_out, 1)<br>        dst.nodata = 0</pre><p>เป็นอันเสร็จสิ้น ก็จะได้ราสเตอร์ใหม่ที่แสดงค่าที่บันทึกมาแล้ว</p><pre>scale_factor = src.tags()[&#39;scale_factor&#39;] <br>add_offset = src.tags()[&#39;add_offset&#39;]</pre><p>หมายเหตุ บางครั้งข้อมูลใน meta data อาจจะไม่ได้ใช้ชื่อ scale_factor หรือ add_offset โดยตรง ทำให้ค้นหาไม่เจอ อาจต้องแสดงค่าออกมาดูทาง terminal ก่อน</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59bc12846189" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/%E0%B8%9B%E0%B8%A3%E0%B8%B1%E0%B8%9A%E0%B8%84%E0%B9%88%E0%B8%B2-raster-%E0%B9%83%E0%B8%AB%E0%B9%89%E0%B9%80%E0%B8%9B%E0%B9%87%E0%B8%99%E0%B8%84%E0%B9%88%E0%B8%B2%E0%B8%88%E0%B8%A3%E0%B8%B4%E0%B8%87%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-scale-factor-%E0%B9%81%E0%B8%A5%E0%B8%B0-add-offset-59bc12846189">ปรับค่า Raster ให้เป็นค่าจริงด้วย scale factor และ add offset</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[อัปเดตข้อมูลตารางง่ายๆด้วย Python Console ใน QGIS]]></title>
            <link>https://medium.com/mapedia/%E0%B8%AD%E0%B8%B1%E0%B8%9B%E0%B9%80%E0%B8%94%E0%B8%95%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5%E0%B8%95%E0%B8%B2%E0%B8%A3%E0%B8%B2%E0%B8%87%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-python-console-%E0%B9%83%E0%B8%99-qgis-2ed439da0b8a?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ed439da0b8a</guid>
            <category><![CDATA[mapedia]]></category>
            <category><![CDATA[qgis]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Wed, 10 May 2023 07:23:35 GMT</pubDate>
            <atom:updated>2023-05-17T07:51:40.179Z</atom:updated>
            <content:encoded><![CDATA[<p>ในโปรแกรม QGIS นั้น เราสามารถจัดการแก้ไขข้อมูลตารางได้อย่างง่ายดาย ด้วยเครื่องมือ Field Calculator แต่บางครั้ง เราต้องการวิธีจัดการที่ซับซ้อน หรือต้องการคำนวณด้วยสูตรที่ไม่มีใน QGIS ปัญหาเหล่านี้แก้ได้ด้วยพระเอกของเรา Python Console</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pMGw3Mp8zOxsTAf1iRGayQ.png" /></figure><p>ขั้นแรกเปิด QGIS และเปิด Python Console ขึ้นมา อย่าลืมเปิดเลเยอร์ที่เราต้องการใช้งานด้วย จากนั้นเริ่มเขียนกันได้เลย</p><pre>#กำหนดเลเยอร์ที่เราต้องการเลือกใช้าน<br>layer = QgsProject.instance().mapLayersByName(&#39;Layer Name&#39;)[0]</pre><p>ในตัวอย่างนี้จะยกตัวอย่าง การนำข้อมูลจาก เลเยอร์1 มาใส่ใน เลเยอร์2 โดยจะทำการเลือกเฉพาะแถวที่ต้องการอัปเดตด้วยการ select</p><p>ขั้นตอนการ select features</p><pre>field_name = &#39;ชื่อคอลัมน์&#39;<br>colume_name = &#39;ชื่อคอลัมน์ที่ต้องการจะอัปเดต&#39;<br>new_value = &#39;ค่าที่ต้องการจะอัปเดต&#39;<br>search_value = &#39;ประเภทหรือกลุ่มของข้อมูลที่ต้องการอัปเดต&#39;<br><br>request = QgsFeatureRequest().setFilterExpression(f&quot;{field_name} = &#39;{search_value}&#39;&quot;)<br>feature = next(layer.getFeatures(request))</pre><p>ขั้นตอนอัปเดตฟีเจอร์ที่เลือก</p><pre>#เริ่มการแก้ไข<br>layer.startEditing()<br><br>#กำหนดค่า<br>feature[colume_name] = new_value<br><br>#อัปเดตฟีเจอร์<br>layer.updateFeature(feature)<br><br>#บันทึกการอัปเดต<br>layer.commitChanges()</pre><p>เป็นอันเสร็จสิ้น นอกจากนี้สามารถนำไปปรับใช้กับพวกสูตรคำนวณต่างๆได้เช่น นำค่าจากเลเยอร์นึง ไปคำนวณแล้วนำไปอัปเดตในอีกเลเยอร์เป็นต้น</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ed439da0b8a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/%E0%B8%AD%E0%B8%B1%E0%B8%9B%E0%B9%80%E0%B8%94%E0%B8%95%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5%E0%B8%95%E0%B8%B2%E0%B8%A3%E0%B8%B2%E0%B8%87%E0%B8%87%E0%B9%88%E0%B8%B2%E0%B8%A2%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-python-console-%E0%B9%83%E0%B8%99-qgis-2ed439da0b8a">อัปเดตข้อมูลตารางง่ายๆด้วย Python Console ใน QGIS</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leaflet Event Map Style]]></title>
            <link>https://medium.com/mapedia/leaflet-event-map-style-2e33710ce292?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e33710ce292</guid>
            <category><![CDATA[leaflet]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 05:13:35 GMT</pubDate>
            <atom:updated>2023-03-16T04:41:23.680Z</atom:updated>
            <content:encoded><![CDATA[<p>การแสดงผลแผนที่บนเว็บไซต์ด้วย leaflet นั้นหลายๆคนคงรู้จักกันแล้ว วันนี้จะมาแนะนำเกี่ยวกับการปรับเปลี่ยนสไตล์การแสดงผลแผนที่เมื่อเกิด Event ต่างๆขึ้นมา</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6PldtRYVBvRSAkddXi3rMw.png" /></figure><p>เราจะข้ามในส่วนของการสร้างเว็บแล้วก็การเรียกใช้งาน leaflet ไปเลยนะครับโดยในขั้นตอนที่ 1 ทำการเพิ่มเลเยอร์เข้าสู่แผนที่ของเรานะครับ ในตัวอย่างผมจะเพิ่มเลเยอร์ด้วยคำสั่ง L.geoJSON</p><pre> # point เป็นข้อมูลที่เก็บในรูปแบบ GeoJSON<br> let points =  L.geoJSON(point)<br> point.addTo(map)</pre><p>จากคำสั่งด้านบนเราก็จะได้เลเยอร์ขึ้นมาบนแผนที่ โดยปกติถ้าเป็นข้อมูลประเภทจุด ถ้าหากไม่ได้กำหนดสไตล์เข้าไปด้วย จะมีการแสดงผลในรูปแบบของหมุดแต่ในตัวอย่างต่อไปเราจะทำการกำหนดสไตล์ด้วยคำสั่งต่อไปนี้</p><pre>  var style = {<br>        radius: 5,<br>        fillColor: &quot;#d91d0f&quot;,<br>        color: &quot;#000&quot;,<br>        weight: 1,<br>        opacity: 1,<br>        fillOpacity: 0.8,<br>      };<br><br>let points =  L.geoJSON(point, {<br>        pointToLayer: function (feature, latlng) {<br>        <br>        return L.circleMarker(latlng, geojsonMarkerOptions);<br><br>        }<br> }).addTo(map)</pre><p>จะได้ผลลัพธ์ดังนี้</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OI0xifPxE7VLbl28Qo-NwQ.png" /></figure><p>เมื่อเราได้เลเยอร์แล้วต่อไปเราจะทำการเปลี่ยนสไตล์ของเลเยอร์เมื่อมีการเกิดอีเวนต์ขึ้น โดยขั้นแรกต้องกำหนดสไตล์ 2 ขึ้นมา</p><pre> var style = {<br>        radius: 5,<br>        fillColor: &quot;#d91d0f&quot;,<br>        color: &quot;#000&quot;,<br>        weight: 1,<br>        opacity: 1,<br>        fillOpacity: 0.8,<br>      };<br><br> var Style2 = {<br>        radius: 9,<br>        fillColor: &quot;green&quot;,<br>        color: &quot;#000&quot;,<br>        weight: 1,<br>        opacity: 1,<br>        fillOpacity: 0.8,<br><br><br>        <br><br>       <br>      };</pre><p>หลังจากนั้นดักจับอีเวนต์ที่เกิดจากเลเยอร์ด้วยคำสั่ง</p><pre>let points =  L.geoJSON(point, {<br>        pointToLayer: function (feature, latlng) {<br>        <br>        return L.circleMarker(latlng, geojsonMarkerOptions);<br><br>        },<br>        onEachFeature: (feature, layer)=&gt; {<br>       <br>          layer.on(&#39;mouseover&#39;, (e) =&gt; {<br>            e.target.setStyle(Style2);<br>     <br><br>          });<br><br>          layer.on(&#39;mouseout&#39;, (e) =&gt; {<br>            e.target.setStyle(style);<br>         <br>          });<br>        }<br> }).addTo(map)</pre><p>เมื่อมีการเอาเม้าส์วางบนจุดก็จะมีการเปลี่ยนสไตล์ของจุด ดังภาพ</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*HVfzk8eoW3WP8m6Jiqsj1A.png" /></figure><p>สามารถเลือกใช้อีเวนต์อื่นๆในการเปลี่ยนสไตล์ได้ด้วย เช่นกัน ศึกษาเพิ่มเติมได้ที่</p><ul><li><a href="https://leafletjs.com/reference.html#evented-on">Documentation - Leaflet - a JavaScript library for interactive maps</a></li><li><a href="https://medium.com/mapedia">MAPEDIA BLOG</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e33710ce292" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/leaflet-event-map-style-2e33710ce292">Leaflet Event Map Style</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GDAL Warp เครื่องมือสุดอเนกประสงค์]]></title>
            <link>https://medium.com/mapedia/gdal-warp-%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B8%A1%E0%B8%B7%E0%B8%AD%E0%B8%AA%E0%B8%B8%E0%B8%94%E0%B8%AD%E0%B9%80%E0%B8%99%E0%B8%81%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%AA%E0%B8%87%E0%B8%84%E0%B9%8C-2bf9929c8ffb?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/2bf9929c8ffb</guid>
            <category><![CDATA[geoinformatics]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[raster]]></category>
            <category><![CDATA[geography]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Wed, 22 Feb 2023 04:08:12 GMT</pubDate>
            <atom:updated>2023-02-25T02:17:50.314Z</atom:updated>
            <content:encoded><![CDATA[<p>หลายคนคงรู้จัก Gdal กันไปแล้วจากหลายๆบทความที่เคยกล่าวถึง วันนี้จะมาแนะนำเครื่องมือสุดอเนกประสงค์ อย่าง GDAL Warp แล้วทำไมเราถึงยังไม่วาร์ป</p><p>GDAL Warp เป็นชุดคำสั่งสำหรับการแปลงค่าพิกัดทางภูมิศาสตร์ในวัตถุประสงค์ต่างๆ ไปดูกันเลยว่า GDAL Warp นั้นทำได้บ้าง</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SgIJ2jkVy6AxHgVO1B1KHA.png" /></figure><h4>Reprojecting and transforming</h4><pre>#ใช้แปลงระบบพิกัดของข้อมูลภาพที่มีพิกัดทางภูมิศาสตร์<br>gdalwarp -s_srs EPSG:4326 -t_srs EPSG:3857 input.tif output.tif<br><br># -s_srs ระบบพิกัดตั้งต้น<br># -t_srs ระบบพิกัดที่ต้องการ<br># โดยสามารถกำหนด resolution ของภาพได้ด้วยเช่นกัน</pre><h4>Resampling</h4><pre>#ใช้ Resampling pixel ภาพ<br>gdalwarp -r bilinear -tr 100 100 input.tif output.tif<br><br># -r  กำหนด Resampling method ที่ใช้ เช่น bilinear nearest neighbor เป้นต้น</pre><h4>Clipping</h4><pre># ใช้ตัดภาพ จะตัดด้วย extent หรือว่าจะตัดด้วย shapefile ก็ได้ด้วยเช่นกัน<br>gdalwarp -te xmin ymin xmax ymax input.tif output.tif</pre><h4>Mosaicing</h4><pre># ใช้ต่อภาพหลายภาพเข้าด้วยกัน โดยสามารถกำหนดนามสกุลไฟล์ได้<br>gdalwarp -of GTiff input1.tif input2.tif input3.tif output.tif</pre><p>เครื่องมือ GDAL Warp นั้นค่อนข้างอเนกประสงค์สามารถปรับใช้ได้ในหลากหลายสถานการณ์โดยสามารถศึกษาเพิ่มเดิมได้ที่</p><ul><li><a href="https://gdal.org/programs/gdalwarp.html">gdalwarp - GDAL documentation</a></li><li><a href="https://medium.com/mapedia/read-raster-data-using-gdal-4d121cab97bb">Read Raster Data Using GDAL</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2bf9929c8ffb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/gdal-warp-%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B8%A1%E0%B8%B7%E0%B8%AD%E0%B8%AA%E0%B8%B8%E0%B8%94%E0%B8%AD%E0%B9%80%E0%B8%99%E0%B8%81%E0%B8%9B%E0%B8%A3%E0%B8%B0%E0%B8%AA%E0%B8%87%E0%B8%84%E0%B9%8C-2bf9929c8ffb">GDAL Warp เครื่องมือสุดอเนกประสงค์</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Read Raster Data Using GDAL]]></title>
            <link>https://medium.com/mapedia/read-raster-data-using-gdal-4d121cab97bb?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d121cab97bb</guid>
            <category><![CDATA[gdal]]></category>
            <category><![CDATA[gis]]></category>
            <category><![CDATA[raster]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Fri, 20 Jan 2023 07:57:09 GMT</pubDate>
            <atom:updated>2023-01-20T09:47:21.331Z</atom:updated>
            <content:encoded><![CDATA[<p>วันนี้จะมาแนะนำวิธีการอ่านข้อมูล raster ที่มีข้อมูลเชิงตำแหน่ง เช่น GeoTiff ,Tiff เป็นต้น โดยเครื่องมือที่ชื่อว่า gdallocationinfo โดยเราสามารถค้นหา ข้อมูลของ Raster จากตำแหน่งทางภูมิศาสตร์ได้เลย</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wrIfY8UumrhkK-WmB1sHww.png" /></figure><h4>ติดตั้ง GDAL</h4><p>การติดตั้ง GDAL สามารถทำการติดตั้งได้ด้วยตัว python package manager ทั่วไป เช่น PIP Conda Mini Conda เป็นต้น</p><pre>conda install -c conda-forge gdal<br>pip install gdal </pre><p>ตรวจสอบการติดตั้งด้วยคำสั่ง</p><pre>gdal-config --version<br><br>&gt;&gt;&gt; 3.5.3 เป็นต้น</pre><p>เมื่อทำการติดตั้งสำเร็จการใช้งาน GDAL สามารถเรียกใช้งานได้ทั้งผ่าน command line และ บน python script โดยรันผ่าน OS หรือ subprocess ก็ได้เช่นกัน</p><h3>ตัวอย่างการใช้งาน</h3><pre>#command line<br>gdallocationinfo -valonly input_raster.tif 50.3,25.5<br><br>#python<br>subprocess.run([&#39;gdallocationinfo&#39;, &#39;-valonly&#39;, raster_path_dsm, &#39;-wgs84&#39;, str(longitude), str(latitude)], stdout=subprocess.PIPE)<br><br>#result <br>pixel value</pre><p>คำสั่ง gdallocationinfo ยังมีตัวเลือกอีกมากมายให้ปรับใช้สามารถค้นหาข้อมูลเพิ่มเติมได้ที่</p><p><a href="https://gdal.org/programs/gdallocationinfo.html">https://gdal.org/programs/gdallocationinfo.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d121cab97bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/read-raster-data-using-gdal-4d121cab97bb">Read Raster Data Using GDAL</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qgis Processing in Python Standalone Script]]></title>
            <link>https://medium.com/mapedia/qgis-processing-in-python-standalone-script-eb6b8de44acf?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/eb6b8de44acf</guid>
            <category><![CDATA[mapedia]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[pyqgis]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Mon, 26 Dec 2022 02:40:28 GMT</pubDate>
            <atom:updated>2022-12-26T02:55:32.781Z</atom:updated>
            <content:encoded><![CDATA[<p>อย่างที่ทุกคนทราบกันดีอยู่แล้วว่า โปรแกรม Qgis นั้นใช้ Python เป็นการทำงานเบื้องหลัง ทั้งการประมวลผลและลักษณะหน้าตาของโปรแกรม ดังนั้นเราจึงสามารถเขียนโปรแกรมด้วยภาษา python เพื่อเรียกใช้งานเครื่องมือการประมวลผลของ Qgis</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sC3VlW4pnPSWpft8ty9stw.png" /></figure><p>ขั้นตอนการติดตั้งและเรียกใช้งาน</p><pre>pip install qgis<br><br>from qgis.core import QgsApplication<br>from qgis.gui import QgsMapCanvas</pre><p>เมื่อติดตั้งไลบรารี่เรียบร้อยขั้นตอนต่อไปจะเป็นการเริ่มการทำงานของโปรแกรมและจบการทำงานหลังทำการประมวลผลเสร็จ</p><pre>app = QgsApplication([], False)<br>app.initQgis()<br><br>#เขียนโค้ดคำสั่งต่างๆ<br><br>app.exitQgis()<br>app.exit()</pre><p>สำหรับการใช้เครื่องมือการประมวลนั้นต้องทำการเรียกใช้ plugins processing ของ qgis ก่อนซึ่งทำได้ด้วยการระบุ path ที่ทำการติดตั้งปลั๊กอินไว้</p><pre>app = QgsApplication([], False)<br>app.initQgis()<br><br>#เขียนโค้ดคำสั่งต่างๆ<br>sys.path.append(&#39;/usr/share/qgis/python/plugins&#39;) # Folder where Processing is located<br>import processing<br>from processing.core.Processing import Processing<br>proc = Processing()<br>proc.initialize()<br><br>app.exitQgis()<br>app.exit()</pre><p>หลังนี้เราก็จะสามารถเรียกใช้งานเครื่องมือประมวลผลได้แล้ว และสามารถเรียกดูว่ามีคำสั่งอะไรบ้างให้ใช้งานได้ด้วยคำสั่ง</p><pre>for alg in QgsApplication.processingRegistry().algorithms():<br>        print(alg.id(), &quot;-&gt;&quot;, alg.displayName())</pre><p>คำสั่งสำหรับดูว่าแต่ละเครื่องมือประมวลผลต้องการพารามิเตอร์อะไรบ้าง</p><pre>processing.algorithmHelp(&#39;algorithm ID&#39;)<br><br>#ex<br>processing.algorithmHelp(&#39;qgis:idwinterpolation&#39;)<br></pre><p>บางครั้งเมื่อเรียกใช้งาน Qgis ในการทำงานเบื้องหลังอาจติดปัญหา อาจจะเป็นต้องตั้งค่าเพิ่มเติมด้วย</p><pre>os.environ[&quot;QT_QPA_PLATFORM&quot;] = &quot;offscreen&quot;<br><br>#อย่าลืม import os</pre><p>ข้อมูลเพิ่มเติม</p><ul><li><a href="https://docs.qgis.org/3.22/en/docs/user_manual/">QGIS User Guide - QGIS Documentation documentation</a></li><li><a href="https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/cheat_sheet.html">21. Cheat sheet for PyQGIS - QGIS Documentation documentation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eb6b8de44acf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/mapedia/qgis-processing-in-python-standalone-script-eb6b8de44acf">Qgis Processing in Python Standalone Script</a> was originally published in <a href="https://medium.com/mapedia">MAPEDIA BLOG</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[[ฝึกงาน 2 weeks] การพัฒนาและออกแบบเว็บไซต์ด้วย Ionic Framework]]></title>
            <link>https://medium.com/@tam.menot/%E0%B8%9D%E0%B8%B6%E0%B8%81%E0%B8%87%E0%B8%B2%E0%B8%99-2-weeks-%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B8%9E%E0%B8%B1%E0%B8%92%E0%B8%99%E0%B8%B2%E0%B9%81%E0%B8%A5%E0%B8%B0%E0%B8%AD%E0%B8%AD%E0%B8%81%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B9%80%E0%B8%A7%E0%B9%87%E0%B8%9A%E0%B9%84%E0%B8%8B%E0%B8%95%E0%B9%8C%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-ionic-framework-505cab7002ce?source=rss-755434259fbb------2</link>
            <guid isPermaLink="false">https://medium.com/p/505cab7002ce</guid>
            <category><![CDATA[comsci]]></category>
            <category><![CDATA[gis]]></category>
            <dc:creator><![CDATA[Satap_srm]]></dc:creator>
            <pubDate>Mon, 22 Nov 2021 15:44:26 GMT</pubDate>
            <atom:updated>2021-11-23T01:41:59.605Z</atom:updated>
            <content:encoded><![CDATA[<p>Ionic Framework เว็ปเฟรมเวิร์คที่ช่วยในเรื่องการแสดงผลในหลายแพลตฟอร์มโดยไม่ได้ทำการปรับเปลี่ยนโค้ด</p><p><strong>วิธีการติดตั้ง</strong></p><p>การจะติดตั้ง Ionic Framework ต้องทำการติดตั้ง NodeJS ก่อนถึงจะทำการติดตั้งได้โดยการติดตั้ง NodeJS นั้นสามารถโหลดตัวติดตั้งจาก <a href="https://nodejs.org/">www.nodejs.org</a> มาทำการติดตั้งให้เรียบร้อยก่อน</p><p>ติดตั้ง Ionic Framework โดยการเปิด Cmd หรือ Command Prompt</p><p>คำสั่ง npm install -g ionic หลังทำการติดตั้ง เช็คเวอร์ชั่นด้วย ionic -v เพื่อทำการตรวจสอบการติดตั้ง</p><pre>npm install -g ionic</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J6FFT8iDNL7iALt7us4VqA.png" /><figcaption>เวอร์ชั่น Ionic</figcaption></figure><p>ขั้นการสร้างโปรเจค</p><p>คำสั่ง ionic start &lt;app-name&gt; เช่น ionic start test_project ใช้สำหรับสร้างโปรเจ็คขึ้นมาโดยหลังจากนั้นจะต้องทำการเลือกเฟรมเวิร์คสำหรับการทำงานเบื้องหลังตามตวามต้องการโดยในที่นี้ใช้ Angular</p><pre>ionic start &lt;app-name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4vSF_63xOp9CQROZG9pqpQ.png" /></figure><p>เลือก template โดยแนะนำ My First App ในการเริ่มต้น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CuWYbJCfAsSzgRVLlq-Sbg.png" /></figure><p>เริ่มโปรเจ็คด้วยการเลือก Path ที่ทำการสร้างโปรเจ็คไว้</p><p>คำสั่ง cd &lt;path&gt; เช่น cd project_intern &gt;&gt; cd medium</p><p>แล้วทำการรันคำสั่ง Ionic serve เพื่อเริ่มใช้งานเว็บเพจหรือแอพพลิเตชั่นของเรา</p><pre>cd &lt;path&gt;<br>&lt;path&gt; ionic serve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X5RT5QXx8H4HPA7bileAyw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2AI7pCAHGDXJDXAhi5_Hg.png" /></figure><p>เป็นอันเสร็จสิ้นสำหรับการเริ่มต้นสร้างเว็บแอพลิเคชั่น</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nkB72mYoIOus221LsIXF3g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=505cab7002ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>