1

I'm trying to learn about the basic structure of elements within Google Earth Engine, but I'm not finding the info online. GEE FeatureCollections and ImageCollections both contain a list of features. The features in each have their own properties. FeatureCollections also have properties for the entire collection, which ImageCollections don't appear to have. FeatureCollections also contain an element called "Columns", which, as best as I can tell, is simply a list of properties that are shared by each feature in the collection. Again, ImageCollections don't appear to have this.

If my summary of the structures of FeatureCollections and ImageCollections is accurate, why the difference in structures?

Example code:

// create a haphazard boundaries to subset landsat images so that collections are reasonably small
var bound = ee.Geometry.Polygon(
        [[[-98.93884992893464, 38.815418613614746],
          [-98.93884992893464, 38.20505462910476],
          [-97.81824446018464, 38.20505462910476],
          [-97.81824446018464, 38.815418613614746]]], null, false);

// load in a bunch of landsat data
var l4_coll = ee.ImageCollection('LANDSAT/LT4_L1T_TOA');
var l5_coll = ee.ImageCollection('LANDSAT/LT5_L1T_TOA');
var l7_coll = ee.ImageCollection('LANDSAT/LE7_L1T_TOA');
var l8_coll = ee.ImageCollection('LANDSAT/LC8_L1T_TOA');

// merge all the landsat data into a giant dataset
var merged_collection = ee.ImageCollection(
  l4_coll.merge(l5_coll).merge(l7_coll).merge(l8_coll)
  );

// filter all the Landsat data using the boundary polygon
var B_coll  = merged_collection.filterBounds(bound);
print(B_coll);

// load a featureCollection of political boundaries
var countries = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017');
print(countries);

which returns: enter image description here

1 Answer 1

1

As far as I know, both ee.ImageCollection and ee.FeatureCollection inherit from ee.Collection which is in the Internal section of the documentation available in the code editor. Both have their own properties, both have columns and both have elements: ee.Feature for ee.FeatureCollection and ee.Image for ee.ImageCollection, and they (both) inherit from internal ee.Element.

Regarding these two statements:

FeatureCollections also have properties for the entire collection, which ImageCollections don't appear to have. FeatureCollections also contain an element called "Columns", which, as best as I can tell, is simply a list of properties that are shared by each feature in the collection. Again, ImageCollections don't appear to have this.

here is a code showing this is not correct:

var l8 = ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA");

print(
  'propery names of Image Collection', 
  l8.propertyNames()
)

print(
  'Reducing "columns" of an Image Collection',
  l8.limit(10).reduceColumns('mean', ['CLOUD_COVER'])
)

link: https://code.earthengine.google.com/4561c89e3b54920dbee9ccdb6ebfeefc

2
  • Thanks for the explanation. I had been working with an example script that had an imageCollection of imageCollections, and that particular collection of collections didn't have any top-level properties, which threw me off. If I print out one of the sub-collections, it does show the parent-level properties: var B8_coll = l8_coll.filterBounds(bound); print(B8_coll);
    – filups21
    May 7, 2019 at 18:48
  • I still don't understand the "columns" object that prints with the FeatureCollection. I understand that the functions that refer to "columns", such as reduceColumns() operate on the properties of individual features (at least properties that are shared across all features; maybe also properties that are not shared across all features). If the underlying structure of FeatureCollections and ImageCollections is the same, then perhaps my question should be "what determines whether or not an ImageCollection or FeatureCollection prints out an object called "columns" when printed?"
    – filups21
    May 7, 2019 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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