Page 67 - รายงานการประยุกต์ใช้ฐานข้อมูลการสำรวจระยะไกลจากซอฟต์แวร์รหัสเปิดและคลาวด์คอมพิวติงเพื่องานพัฒนาที่ดิน Utilization of Remote Sensing Database derived from Open-source software and Cloud computing platform for Land Development
P. 67

ห้องสมุดกรมพัฒนาที่ดิน


                                                                                                           59







                           Code editor 7

                          var s2 = ee.ImageCollection("COPERNICUS/S2")
                         var urban = ee.FeatureCollection("users/totsanatrtk/prov_rachaburi_addmin56")



                          var filtered = urban.filter(ee.Filter.eq('PROV_NAM_E', 'Ratchaburi'))
                         var geometry = filtered.geometry()



                          var rgbVis = {
                           min: 0.0,
                            max: 3000,

                           bands: ['B4', 'B3', 'B2'],

                         };
                         var filtered = s2.filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 30))

                           .filter(ee.Filter.date('2021-01-01', '2021-12-01'))

                           .filter(ee.Filter.bounds(geometry))

                         var image = filtered.median();


                         var clipped = image.clip(geometry)


                         Map.addLayer(clipped, rgbVis, 'Clipped')


                         var exportImage = clipped.select('B.*')

                         Export.image.toDrive({

                             image: exportImage,
                             description: 'Ratchaburi_Composite_Raw',

                             fileNamePrefix: 'Ratchaburi_composite_raw_2021',

                             region: geometry,
                             scale: 20,
                             maxPixels: 1e9
                         })
                       ภาพที่ 35 ภาพ Sentinel 2 ที่ใช้ค าสั่งผสมสีภาพแบบสีจริงและตัดภาพ

                         // Rather than exporting raw bands, we can apply a rendered image
                          // visualize() function allows you to apply the same parameters

                         // that are used in earth engine which exports a 3-band RGB image
                         print(clipped)
   62   63   64   65   66   67   68   69   70   71   72