April 11

GEE APP 3

var border = ee.FeatureCollection("projects/geoinfouz/assets/Samarqand")

// Map.setCenter(67.00, 39.65, 10)
Map.centerObject(border, 8)

var s2_dataset = ee.ImageCollection("COPERNICUS/S2_SR_HARMONIZED")
                   .filterBounds(border)
                   .filterDate("2023-05-10", "2023-05-16")
                   .select(['B.*'])
                   .median()
                   .clip(border)
print(s2_dataset)     

Map.addLayer(s2_dataset, {bands: ['B4', 'B3', 'B2'], max:3000}, "Natural_color")
Map.addLayer(border.style({color:"red", fillColor: "00000000"}), {}, "Region Border")

var LeftPanel = ui.Panel({
                  layout: ui.Panel.Layout.flow('vertical'),
                  style: {width: '300px'}
              })

var header = ui.Label({ 
  value: "SAMARQAND WEB XARITASI",
  style: {
    fontWeight: "bold",
    margin: "10px"
  }
})
var subtitle = ui.Label({
  value: 'Use 30m Landsat 5,7,8 or 10m Sentinel-2 MSI imagery to'+
  ' analyze changes in river geomorpholgy over time using spectral indices.'+
  ' Allows you to choose area of interest and type of map you want to visualize.'+
  ' Landsat imagery is available from 1984 - 2018, while Sentinel-2 MSI imagery is available 2016-2017.',
  style: {
    // fontWeight: "bold",
    margin: "10px"
  }
});

var RightPanel = ui.Panel({
                  layout: ui.Panel.Layout.flow('vertical'),
                  style: {width: '300px'}
              })


// ui.root.clear();
ui.root.insert(1, RightPanel)
ui.root.insert(0, LeftPanel)
LeftPanel.add(header).add(subtitle)

  var classColor = ['red', '#ebc709', '#ecf23f', '#4ec71a', '#228B22'];
  var className = ['Suv yoki boshqa obyektlar', 'Bo\'sh maydon', 'Vegetatsiya kam', 'Vegetatsiya o\'rtacha', 'Vegetatsiya yaxshi'];

var Legend = ui.Panel({
  style: {position: 'bottom-left', padding: '8px', width: '300px'}
})
Legend.add(ui.Label({
        value: "Shartli belgilar",
        style: {margin: '10px 6px', fontWeight: 'bold'}
}))



for (var i=0; i < className.length; i++) {

  var colorbar = ui.Label({
          style: {backgroundColor: classColor[i], padding: '10px 20px', margin: '0 0 4px 6px'}
        })
        
  var nameLegend = ui.Label({
          value: className[i],
          style: {margin: '0 0 4px 6px', padding: '10px 20px'}
        })
  
  Legend.add(ui.Panel({
          widgets: [colorbar, nameLegend],
          layout: ui.Panel.Layout.Flow('horizontal')
        })
      )
}
var DistrictSelectTitle = ui.Label("Tuman tanlang")
var DistrictSelect = ui.Select({items: ['Bulung\'ur','Ishtixon','Jomboy','Kattaqo\'rg\'on','Qo\'shrabot','Narpay','Nurobod','Oqdaryo','Paxtachi','Payariq','Pastdarg\'om','Samarqand','Toyloq','Urgut',]})
RightPanel.add(DistrictSelectTitle).add(DistrictSelect)

LeftPanel.add(Legend)





https://geoinfouz.projects.earthengine.app/view/samarqand-app