Stay organized with collectionsSave and categorize content based on your preferences.
Understanding how Earth Engine handles scale is crucial to interpreting scientific
results obtained from Earth Engine. Here, scale means pixel resolution. Unlike other
GIS and image processing platforms, the scale of analysis is determined from the output,
rather than the input. Specifically, when you make a request for results, an image to
display or a statistic, for example, you specify the scale at which data is input to the
analysis. This concept is illustrated in Figure 1.
Figure 1. A graphic representation of an image dataset in Earth Engine.
Dashed lines represent the pyramiding policy for aggregating 2x2 blocks of 4 pixels. Earth
Engine uses the scale specified by the output to determine the appropriate level of the
image pyramid to use as input.
Image Pyramids
Image assets in Earth Engine exist at multiple scales, inimage pyramids.
The pyramiding policy (represented by dashed lines in Figure 1) determines how each pixel
at a given level of the pyramid is computed from the aggregation of a 2x2 block of pixels
at the next lower level. For continuous valued images, the pixel values of upper levels of
the pyramid are the mean of pixels at the next lower level. For discrete valued images,
pixel values of upper levels of the pyramid are a sample (usually the top left pixel) of
pixels at the next lower level.
The lowest level of the image pyramid represents image data at native resolution, when it is
ingested into Earth Engine. During ingestion, the data are aggregated (according to the
pyramiding policy) to create higher pyramid levels. The data are aggregated until the
entire image fits within a 256x256 pixel tile. When you use an image in your code,
Earth Engine chooses a level of the pyramid with the closest scale less than or equal to
the scale specified by your analysis and resamples (using nearest neighbor by default)
as necessary.
Scale of analysis
Scale of analysis in Earth Engine is determined on a "pull" basis. The scale at which
to request inputs to a computation is determined from the output. For example, if you
add an image to the Code Editor or geemap map element, the zoom level of the map determines
the scale at which inputs are requested from the image pyramid. For other computations, you
specifyscaleas an argument. For example, using the NIR band of a Landsat
image, which has 30 meters native resolution:
In this example, note that the pixel value at a constant location (the image centroid)
varies based on scale. This is due to the fact that different pyramid levels are selected
for different scales. For similar scales, nearest neighbor resampling results in the same
pixel value being returned. The important point is that by varying the scale, different
image inputs are requested.
When you visualize an image by adding it to the map, Earth Engine determines scale from
the zoom level. Consider the following simple example, which simply displays a Landsat
image:
The map starts zoomed all the way in, such that the native resolution pixels are clearly
visible. Zooming out far enough will not display the same pixels, but will instead
display higher levels of the image pyramid. It is also worth noting that the Code Editor
and geemap maps use themaps mercator (EPSG:3857)projection, so the appropriate level of the image pyramid also needs to be reprojected prior
to display. Learn more about how Earth Engine handles projections from theprojections doc.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-01 UTC."],[[["\u003cp\u003eIn Earth Engine, the scale of analysis, referring to pixel resolution, is determined by the output rather than the input, unlike other GIS platforms.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine utilizes image pyramids, where each level represents the image at a different scale, with pixel values aggregated from lower levels.\u003c/p\u003e\n"],["\u003cp\u003eThe scale you specify in your analysis dictates which level of the image pyramid Earth Engine uses as input, influencing the results you obtain.\u003c/p\u003e\n"],["\u003cp\u003eWhen visualizing images on the map, the zoom level determines the scale, and Earth Engine automatically selects the appropriate pyramid level for display.\u003c/p\u003e\n"],["\u003cp\u003eTo ensure consistent and accurate results, it's crucial to explicitly specify the desired scale when using functions with a scale parameter in Earth Engine.\u003c/p\u003e\n"]]],[],null,["# Scale\n\nUnderstanding how Earth Engine handles scale is crucial to interpreting scientific\nresults obtained from Earth Engine. Here, scale means pixel resolution. Unlike other\nGIS and image processing platforms, the scale of analysis is determined from the output,\nrather than the input. Specifically, when you make a request for results, an image to\ndisplay or a statistic, for example, you specify the scale at which data is input to the\nanalysis. This concept is illustrated in Figure 1.\nFigure 1. A graphic representation of an image dataset in Earth Engine. Dashed lines represent the pyramiding policy for aggregating 2x2 blocks of 4 pixels. Earth Engine uses the scale specified by the output to determine the appropriate level of the image pyramid to use as input.\n\nImage Pyramids\n--------------\n\nImage assets in Earth Engine exist at multiple scales, in\n[image pyramids](https://en.wikipedia.org/wiki/Pyramid_(image_processing)).\nThe pyramiding policy (represented by dashed lines in Figure 1) determines how each pixel\nat a given level of the pyramid is computed from the aggregation of a 2x2 block of pixels\nat the next lower level. For continuous valued images, the pixel values of upper levels of\nthe pyramid are the mean of pixels at the next lower level. For discrete valued images,\npixel values of upper levels of the pyramid are a sample (usually the top left pixel) of\npixels at the next lower level.\n\nThe lowest level of the image pyramid represents image data at native resolution, when it is\ningested into Earth Engine. During ingestion, the data are aggregated (according to the\npyramiding policy) to create higher pyramid levels. The data are aggregated until the\nentire image fits within a 256x256 pixel tile. When you use an image in your code,\nEarth Engine chooses a level of the pyramid with the closest scale less than or equal to\nthe scale specified by your analysis and resamples (using nearest neighbor by default)\nas necessary.\n\nScale of analysis\n-----------------\n\nScale of analysis in Earth Engine is determined on a \"pull\" basis. The scale at which\nto request inputs to a computation is determined from the output. For example, if you\nadd an image to the Code Editor or geemap map element, the zoom level of the map determines\nthe scale at which inputs are requested from the image pyramid. For other computations, you\nspecify `scale` as an argument. For example, using the NIR band of a Landsat\nimage, which has 30 meters native resolution:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar image = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318').select('B4');\n\nvar printAtScale = function(scale) {\n print('Pixel value at '+scale+' meters scale',\n image.reduceRegion({\n reducer: ee.Reducer.first(),\n geometry: image.geometry().centroid(),\n // The scale determines the pyramid level from which to pull the input\n scale: scale\n }).get('B4'));\n};\n\nprintAtScale(10); // 0.10394100844860077\nprintAtScale(30); // 0.10394100844860077\nprintAtScale(50); // 0.09130698442459106\nprintAtScale(70); // 0.1150854229927063\nprintAtScale(200); // 0.102478988468647\nprintAtScale(500); // 0.09072770178318024\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nimage = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318').select('B4')\n\n\ndef print_at_scale(scale):\n display(\n f'Pixel value at {scale} meters scale',\n image.reduceRegion(\n reducer=ee.Reducer.first(),\n geometry=image.geometry().centroid(),\n # The scale determines the pyramid level from which to pull the input\n scale=scale,\n ).get('B4'),\n )\n\n\nprint_at_scale(10) # 0.10394100844860077\nprint_at_scale(30) # 0.10394100844860077\nprint_at_scale(50) # 0.09130698442459106\nprint_at_scale(70) # 0.1150854229927063\nprint_at_scale(200) # 0.102478988468647\nprint_at_scale(500) # 0.09072770178318024\n```\n\nIn this example, note that the pixel value at a constant location (the image centroid)\nvaries based on scale. This is due to the fact that different pyramid levels are selected\nfor different scales. For similar scales, nearest neighbor resampling results in the same\npixel value being returned. The important point is that by varying the scale, different\nimage inputs are requested.\n| **Note:** To avoid ambiguity, always specify scale when you use a function which has a scale parameter.\n\nWhen you visualize an image by adding it to the map, Earth Engine determines scale from\nthe zoom level. Consider the following simple example, which simply displays a Landsat\nimage:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar image = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318');\nMap.centerObject(image, 17);\nMap.addLayer(image, {bands: ['B4', 'B3', 'B2'], max: 0.35}, 'image');\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\nimage = ee.Image('LANDSAT/LC08/C02/T1_TOA/LC08_044034_20140318')\nm = geemap.Map()\nm.center_object(image, 17)\nm.add_layer(image, {'bands': ['B4', 'B3', 'B2'], 'max': 0.35}, 'image')\nm\n```\n\nThe map starts zoomed all the way in, such that the native resolution pixels are clearly\nvisible. Zooming out far enough will not display the same pixels, but will instead\ndisplay higher levels of the image pyramid. It is also worth noting that the Code Editor\nand geemap maps use the [maps mercator (EPSG:3857)](http://epsg.io/3857)\nprojection, so the appropriate level of the image pyramid also needs to be reprojected prior\nto display. Learn more about how Earth Engine handles projections from the\n[projections doc](/earth-engine/guides/projections)."]]