2

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")
7

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');
  • Great, thanks!!! I guess my mis-understanding is that a landsat imageCollection would contain even more images, but I can yet use the print function directly... maybe because Landsat is mosaicked, while NAIP is not? Thanks!! – Matifou Mar 19 '17 at 22:58
  • The Landsat image collections each contain over 100,000 images, so would need to be similarly filtered before printing. – Tyler Erickson Mar 20 '17 at 20:20
  • I mean you can do for example print(ee.ImageCollection('LANDSAT/LE7_L1T_32DAY_NDVI')); which will work, even if that collection has potentially way more images than the NAIP one? Thanks :-) – Matifou Mar 21 '17 at 4:54
  • The images in the LANDSAT/LE7_L1T_32DAY_NDVI collection are composites in space (global) and time (32 days). There are currently only 220 images in this particular collection, so you can successfully print the collection. You can determine the collection size with the ee.ImageCollection.size() method. – Tyler Erickson Mar 21 '17 at 22:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.