1

I am a beginner for GEE. I don't understand about "geometry". What's the difference between var studyRegion = roi.geometry();and var studyRegion = roi;enter image description here?

1
  • roi is probably an object having a geometry property (+some others) so when assigning it to your var studyRegion you assign all the content of that object to your variable, and if you precise that you only want the geometry property, well, you only get the geometry. Jun 24, 2021 at 10:17

1 Answer 1

1

A table or feature collection (ee.FeatureCollection) is a collection of features (ee.Feature). A feature has a geometry (ee.Geometry) and properties.

If you print a ee.Feature you'll see:

{
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              12.3456,
              -6.54321
            ], ....
          ]
        ]
      },
      "id": "00001",
      "properties": {
        "id": 0,
        "area": 1234,
        ....
      }
    }

Your roi is a table, so it has one or many ee.Feature. When you call roi.geometry() you get all the geometries (of all features) merged together. A simple example: https://code.earthengine.google.com/ae458356e23340a09d46e5fb5584b9df

Many functions into GEE need a ee.Geometry as a parameter

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.