working with Nightlight data

analyzing economic development

Question 1

Copy and paste the code below in the code editor and inspect the image

var nightlight = ee.Image("NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG/20140101").select("avg_rad");
print(nightlight)
Map.addLayer(nightlight,{min:0,max:10,palette:['000000','700000','808080','FFFF00','ffffff','ffffff','ffffff']},"nightlights");

Try to answer the following questions:

  1. try to find a good value for the max?
  2. what is the date of the image?

Question 2

Copy and paste the code below in the code editor and inspect the image

var nightlight2014 = ee.Image("NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG/20140101").select("avg_rad");
print(nightlight2014)
Map.addLayer(nightlight2014,{min:0,max:10,palette:['000000','700000','808080','FFFF00','ffffff','ffffff','ffffff']},"nightlights 2014");

var nightlight2021 = ee.Image("NOAA/VIIRS/DNB/MONTHLY_V1/VCMSLCFG/20210101").select("avg_rad");
print(nightlight2021)
Map.addLayer(nightlight2021,{min:0,max:10,palette:['000000','700000','808080','FFFF00','ffffff','ffffff','ffffff']},"nightlights 2021");

Try to answer the following question:

  1. where do we see most change?

Question 2

use the drawing tool to draw a box around Phnom Penh

rename the geometry to aoi

copy the code below to the code above

print(nightlight2014.reduceRegion({reducer:ee.Reducer.mean(),geometry:aoi,scale:500}))
print(nightlight2021.reduceRegion({reducer:ee.Reducer.mean(),geometry:aoi,scale:500}))

Try to answer the following question:

  1. what is the difference between the two numbers?

Leave a Reply