1

What the difference between columns and properties in Google Earth Engine feature collections?

When I build a new feature collection with a property directly in the code editor, when I print it I do not see "properties" but only "columns" and "features". Instead, when I open a feature collection which I have as an asset I see "properties","columns" and "features" as three different parts of the the feature collections. Where "columns" are the fields from the shapefile that I imported as asset.

So, why "properties" are added in a feature collections imported as asset?

And what's the difference between "properties" and "columns"?

2

First, it's important to understand that a feature collection is, itself, a sort of feature — or in the lesser-known terminology of the API, an “element”. Thus, like any other feature (or an image or image collection), the collection itself can have properties, which are completely separate from properties of features within the collection.

As an example, suppose you have uploaded your own table (feature collection) asset from a CSV file: properties of features come from the rows of the CSV file, but properties of the collection come from filling out the “Properties” section of the upload dialog.

When you're writing code, collection.set("pname", "pvalue") will add a property on a collection; collection.map(function (feature) { return feature.set("pname", "pvalue"); }) will add a property on each feature of the collection.


When you print or evaluate a feature collection, you may see:

  • properties: Properties attached to the collection itself, not the features.
  • features: The features in the collection, each of which has its own properties.
  • columns: The names and types of properties which every feature in the collection has.

columns information is only sometimes available; in particular, it is typically present for feature properties in collections loaded from assets (tables) and typically not present for properties you've added within the computation via .map() over the collection or other such operations.

If a property name is listed in columns, then you can expect that every feature in the collection has that property. If not listed, there may or may not be such a property on each feature.

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.