0

I am able to select an image by year from the OLS dataset with the code examples from the web:

// Load a Japan boundary from a Fusion Table.
var japan = ee.FeatureCollection('ft:1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw-1d9omPw')
  .filter(ee.Filter.eq('Country', 'Japan'));

// Load a 2012 nightlights image, clipped to the Japan border.
var nl2012 = ee.Image('NOAA/DMSP-OLS/NIGHTTIME_LIGHTS/F182009')
  .select('stable_lights')
  .clipToCollection(japan);

However, when I try to use the ImageCollection I am unable to select by date like with other datasets (such as Landsat):

var collection = ee.ImageCollection('LANDSAT/LE07/C01/T1')
    .filterDate('2000-01-01', '2001-01-01');

I would like to be able to apply the same filters on the OLS dataset:

var ols = ee.ImageCollection("NOAA/DMSP-OLS/CALIBRATED_LIGHTS_V4")
 .filterDate('2000-01-01', '2001-01-01')
 .select('stable_lights')
 .clipToCollection(japan);
Val
  • 6,585
  • 5
  • 22
  • 52
supercontra
  • 165
  • 1
  • 9

1 Answers1

1

You're just using the wrong ImageCollection ID.

If you use NOAA/DMSP-OLS/NIGHTTIME_LIGHTS, the filter work:

var ols = ee.ImageCollection("NOAA/DMSP-OLS/NIGHTTIME_LIGHTS")
.filterDate('2000-01-01', '2001-01-01')
.select('stable_lights')

print(ols)

// ImageCollection NOAA/DMSP-OLS/NIGHTTIME_LIGHTS (2 elements)
// type: ImageCollection
// id: NOAA/DMSP-OLS/NIGHTTIME_LIGHTS
// version: 1509484869949711
// bands: []
// features: List (2 elements)
// properties: Object (17 properties)
Val
  • 6,585
  • 5
  • 22
  • 52