[GIS] Earth Engine: issues with NAIP image collection

google-earth-enginenaip

I am trying to visualize the NAIP data available by direct import in Earth Engine. I am unable to use the simple print method: Collection query aborted after accumulating over 5000 elements.

I suppose the problem comes from the fact that the NAIP is an image collection containing images with different bands over time, but not sure how to solve this, and how to visualize the details/information on the discussion?

var NAIP = ee.ImageCollection('USDA/NAIP/DOQQ')

// problem 1:
print(NAIP, "NAIP")

Best Answer

The NAIP image collection contains over 1.4 million images, and printing the image collection requests metadata for each of the images. This is probably not what a user actually wants to do, so the query limit of 5000 elements (images in this case) seems to be a reasonable limit.

If you do want to see the metadata for the NAIP images, do it on a subset of the collection. For example, limit it to 10 images:

var NAIP = ee.ImageCollection('USDA/NAIP/DOQQ');
print("NAIP sample", NAIP.limit(10));

Backing up to your original goal, a map-based visualization of Earth Engine data can be done using the Map.addLayer() command. For example, the NAIP images for 2015 can be visualized with the following code:

var NAIP2015 = NAIP.filterDate('2015', '2016');
Map.addLayer(NAIP2015, {bands: 'R,G,B'}, 'NAIP 2016');

Note-1: NAIP only covers selected US states each year, so there may be no data where you are looking.

Note-2: The spectral bands of NAIP images has changed over the years and may not even be consistent within a single year, so you may need to filter the collection to make it homogeneous before displaying it. For example, this code filters out the 2006 images that do not contain the blue 'B' band:

var NAIP2006 = NAIP.filterDate('2006', '2007')
  .filter(ee.Filter.listContains('system:band_names', 'B'));
Map.addLayer(NAIP2006, {bands: 'R,G,B'}, 'NAIP 2006');