{"id":810,"date":"2020-05-18T07:09:00","date_gmt":"2020-05-18T00:09:00","guid":{"rendered":"http:\/\/www.gis2me.com\/geospatial\/?p=810"},"modified":"2025-04-30T09:28:44","modified_gmt":"2025-04-30T02:28:44","slug":"r-studio-ep06-%e0%b8%a7%e0%b8%b4%e0%b8%98%e0%b8%b5%e0%b9%81%e0%b8%aa%e0%b8%94%e0%b8%87-polygon-%e0%b8%ab%e0%b8%a5%e0%b8%b2%e0%b8%a2%e0%b8%8a%e0%b8%b1%e0%b9%89%e0%b8%99%e0%b8%82%e0%b9%89","status":"publish","type":"post","link":"http:\/\/www.gis2me.com\/geospatial\/?p=810","title":{"rendered":"R-studio : ( EP#06 ) \u0e27\u0e34\u0e18\u0e35\u0e41\u0e2a\u0e14\u0e07 polygon \u0e2b\u0e25\u0e32\u0e22\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e0a\u0e19\u0e34\u0e14 Shapefile \u0e43\u0e19 leaflet \u0e14\u0e49\u0e27\u0e22\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 R"},"content":{"rendered":"<p>R-studio : ( EP#06 ) \u0e27\u0e34\u0e18\u0e35\u0e41\u0e2a\u0e14\u0e07 polygon \u0e2b\u0e25\u0e32\u0e22\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e0a\u0e19\u0e34\u0e14 Shapefile \u0e43\u0e19 leaflet \u0e14\u0e49\u0e27\u0e22\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 R<br \/>\u0e43\u0e19\u0e15\u0e2d\u0e19 <strong data-start=\"6\" data-end=\"26\">R-Studio (EP#06)<\/strong> \u0e19\u0e35\u0e49 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e27\u0e34\u0e18\u0e35 <strong data-start=\"49\" data-end=\"113\">\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25 Polygon \u0e2b\u0e25\u0e32\u0e22\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 (Multiple Layers of Shapefile)<\/strong> \u0e1a\u0e19\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48 <strong data-start=\"123\" data-end=\"134\">Leaflet<\/strong> \u0e14\u0e49\u0e27\u0e22\u0e20\u0e32\u0e29\u0e32 <strong data-start=\"144\" data-end=\"149\">R<\/strong> \u0e0b\u0e36\u0e48\u0e07\u0e40\u0e2b\u0e21\u0e32\u0e30\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e27\u0e34\u0e40\u0e04\u0e23\u0e32\u0e30\u0e2b\u0e4c\u0e40\u0e0a\u0e34\u0e07\u0e1e\u0e37\u0e49\u0e19\u0e17\u0e35\u0e48\u0e17\u0e35\u0e48\u0e40\u0e01\u0e35\u0e48\u0e22\u0e27\u0e02\u0e49\u0e2d\u0e07\u0e01\u0e31\u0e1a\u0e2b\u0e25\u0e32\u0e22\u0e23\u0e30\u0e14\u0e31\u0e1a \u0e40\u0e0a\u0e48\u0e19 <strong data-start=\"219\" data-end=\"238\">\u0e25\u0e38\u0e48\u0e21\u0e19\u0e49\u0e33 (BASIN)<\/strong> \u0e41\u0e25\u0e30 <strong data-start=\"243\" data-end=\"269\">\u0e02\u0e2d\u0e1a\u0e40\u0e02\u0e15\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14 (THPROV)<\/strong> \u0e1a\u0e19\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e40\u0e14\u0e35\u0e22\u0e27\u0e01\u0e31\u0e19<\/p>\n<p>R script \u0e1b\u0e23\u0e30\u0e01\u0e2d\u0e1a\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49 \u0e41\u0e25\u0e30 shapefile [BASIN] &amp; shapefile [THPROV] <a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLScDvubf_qVdT1SYCdXKi5580cix7uQlAHzuo2bFs9_anojPBg\/viewform\">https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLScDvubf_qVdT1SYCdXKi5580cix7uQlAHzuo2bFs9_anojPBg\/viewform<\/a><\/p>\n<p>\u00a0\u00a0\u00a0\u00a0<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/j8khRmVSsbA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udded \u0e27\u0e31\u0e15\u0e16\u0e38\u0e1b\u0e23\u0e30\u0e2a\u0e07\u0e04\u0e4c<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07 <strong>\u0e2b\u0e25\u0e32\u0e22\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 Shapefile (Polygon)<\/strong> \u0e43\u0e19\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48 Leaflet<\/li>\n\n\n\n<li>\u0e40\u0e23\u0e35\u0e22\u0e19\u0e23\u0e39\u0e49\u0e01\u0e32\u0e23\u0e43\u0e0a\u0e49\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 <code>leaflet()<\/code> \u0e41\u0e25\u0e30 <code>addPolygons()<\/code> \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e41\u0e15\u0e48\u0e25\u0e30\u0e0a\u0e31\u0e49\u0e19<\/li>\n\n\n\n<li>\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e41\u0e1a\u0e1a Interactive \u0e41\u0e25\u0e30\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e1c\u0e25 Layer<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udce6 \u0e0a\u0e38\u0e14\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14\u0e44\u0e14\u0e49\u0e08\u0e32\u0e01\u0e1f\u0e2d\u0e23\u0e4c\u0e21: \ud83d\udc49 <a class=\"\" href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLScDvubf_qVdT1SYCdXKi5580cix7uQlAHzuo2bFs9_anojPBg\/viewform\">Shapefile BASIN \u0e41\u0e25\u0e30 THPROV<\/a><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>BASIN.shp<\/strong> \u2013 \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e25\u0e38\u0e48\u0e21\u0e19\u0e49\u0e33<\/li>\n\n\n\n<li><strong>THPROV.shp<\/strong> \u2013 \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e02\u0e2d\u0e1a\u0e40\u0e02\u0e15\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14\u0e02\u0e2d\u0e07\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccc \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e42\u0e04\u0e49\u0e14 R \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a Leaflet (\u0e2b\u0e25\u0e32\u0e22\u0e0a\u0e31\u0e49\u0e19 Polygon)<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">rCopyEdit<code># \u0e42\u0e2b\u0e25\u0e14 package \u0e17\u0e35\u0e48\u0e08\u0e33\u0e40\u0e1b\u0e47\u0e19\nlibrary(sf)\nlibrary(leaflet)\n\n# \u0e2d\u0e48\u0e32\u0e19 shapefile\nbasin &lt;- st_read(\"BASIN.shp\")\nprovince &lt;- st_read(\"THPROV.shp\")\n\n# \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48 leaflet\nleaflet() %&gt;%\n  addTiles() %&gt;%\n  addPolygons(data = basin,\n              fillColor = \"blue\", \n              weight = 1,\n              opacity = 1,\n              color = \"white\",\n              fillOpacity = 0.5,\n              group = \"\u0e25\u0e38\u0e48\u0e21\u0e19\u0e49\u0e33 BASIN\") %&gt;%\n  addPolygons(data = province,\n              fillColor = \"green\",\n              weight = 1,\n              opacity = 1,\n              color = \"black\",\n              fillOpacity = 0.2,\n              group = \"\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14 THPROV\") %&gt;%\n  addLayersControl(\n    overlayGroups = c(\"\u0e25\u0e38\u0e48\u0e21\u0e19\u0e49\u0e33 BASIN\", \"\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14 THPROV\"),\n    options = layersControlOptions(collapsed = FALSE)\n  )\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udcdd \u0e04\u0e33\u0e2d\u0e18\u0e34\u0e1a\u0e32\u0e22\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u0e1f\u0e31\u0e07\u0e01\u0e4c\u0e0a\u0e31\u0e19<\/th><th>\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14<\/th><\/tr><\/thead><tbody><tr><td><code>st_read()<\/code><\/td><td>\u0e2d\u0e48\u0e32\u0e19\u0e44\u0e1f\u0e25\u0e4c Shapefile \u0e14\u0e49\u0e27\u0e22 Simple Features<\/td><\/tr><tr><td><code>addPolygons()<\/code><\/td><td>\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 Polygon \u0e1a\u0e19\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48<\/td><\/tr><tr><td><code>group<\/code><\/td><td>\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e0a\u0e37\u0e48\u0e2d\u0e01\u0e25\u0e38\u0e48\u0e21 Layer \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21\u0e01\u0e32\u0e23\u0e40\u0e1b\u0e34\u0e14\/\u0e1b\u0e34\u0e14<\/td><\/tr><tr><td><code>addLayersControl()<\/code><\/td><td>\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e01\u0e25\u0e48\u0e2d\u0e07\u0e04\u0e27\u0e1a\u0e04\u0e38\u0e21\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07 Layer<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83e\udde0 \u0e1b\u0e23\u0e30\u0e42\u0e22\u0e0a\u0e19\u0e4c\u0e40\u0e0a\u0e34\u0e07\u0e27\u0e34\u0e0a\u0e32\u0e01\u0e32\u0e23<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e43\u0e0a\u0e49\u0e41\u0e2a\u0e14\u0e07 <strong>\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2b\u0e25\u0e32\u0e01\u0e2b\u0e25\u0e32\u0e22\u0e21\u0e34\u0e15\u0e34<\/strong> \u0e1a\u0e19\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e40\u0e14\u0e35\u0e22\u0e27 \u0e40\u0e0a\u0e48\u0e19 \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e34\u0e48\u0e07\u0e41\u0e27\u0e14\u0e25\u0e49\u0e2d\u0e21 \u2013 \u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23<\/li>\n\n\n\n<li>\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e01\u0e32\u0e23\u0e40\u0e23\u0e35\u0e22\u0e19\u0e01\u0e32\u0e23\u0e2a\u0e2d\u0e19\u0e41\u0e1a\u0e1a <strong>Interactive GIS Visualization<\/strong><\/li>\n\n\n\n<li>\u0e40\u0e1b\u0e47\u0e19\u0e41\u0e19\u0e27\u0e17\u0e32\u0e07\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a <strong>Web GIS Development \u0e14\u0e49\u0e27\u0e22 R-Shiny + Leaflet<\/strong><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccc \u0e41\u0e19\u0e30\u0e19\u0e33\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e40\u0e15\u0e34\u0e21<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e2b\u0e32\u0e01\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e43\u0e2b\u0e49 <strong>\u0e41\u0e2a\u0e14\u0e07\u0e04\u0e48\u0e32\u0e08\u0e32\u0e01 Attribute Table<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e04\u0e25\u0e34\u0e01 Polygon \u2192 \u0e43\u0e0a\u0e49 <code>label = ~FIELD_NAME<\/code><\/li>\n\n\n\n<li>\u0e2b\u0e32\u0e01\u0e21\u0e35\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e21\u0e32\u0e01 \u0e04\u0e27\u0e23\u0e43\u0e0a\u0e49 <code>simplify<\/code> \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e1e\u0e34\u0e48\u0e21\u0e1b\u0e23\u0e30\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e20\u0e32\u0e1e\u0e01\u0e32\u0e23\u0e42\u0e2b\u0e25\u0e14\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>R-studio : ( EP#06 ) \u0e27\u0e34\u0e18\u0e35\u0e41\u0e2a\u0e14\u0e07 polygon \u0e2b\u0e25\u0e32\u0e22\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e0a\u0e19\u0e34 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[21],"tags":[440,578,581,477,577,439,486,371,582,85,445,580,579,576],"class_list":["post-810","post","type-post","status-publish","format-standard","hentry","category--r-studio","tag-gis--r","tag-leaflet-interactive-map","tag-leaflet-layerscontrol","tag-leaflet-r","tag-polygon-gis","tag-r-studio","tag-sf-package","tag-shapefile","tag-web-gis-r","tag-85","tag--shapefile","tag-580","tag-579","tag-576"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts\/810","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=810"}],"version-history":[{"count":1,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions"}],"predecessor-version":[{"id":811,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions\/811"}],"wp:attachment":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}