Thông báo: Tất cả dự án phi thương mại đã đăng ký sử dụng Earth Engine trước ngày 15 tháng 4 năm 2025 phải xác minh điều kiện sử dụng phi thương mại để duy trì quyền truy cập vào Earth Engine.
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Việc hiểu cách Earth Engine xử lý quy mô là rất quan trọng để diễn giải kết quả khoa học thu được từ Earth Engine. Ở đây, tỷ lệ có nghĩa là độ phân giải pixel. Không giống như các nền tảng GIS và xử lý hình ảnh khác, quy mô phân tích được xác định từ đầu ra, thay vì đầu vào. Cụ thể, khi đưa ra yêu cầu về kết quả, hình ảnh cần hiển thị hoặc số liệu thống kê, bạn sẽ chỉ định tỷ lệ mà dữ liệu được nhập vào quy trình phân tích. Khái niệm này được minh hoạ trong Hình 1.
Hình 1. Hình ảnh biểu thị tập dữ liệu hình ảnh trong Earth Engine.
Đường nét đứt thể hiện chính sách tạo kim tự tháp để tổng hợp các khối 2x2 gồm 4 pixel. Earth Engine sử dụng tỷ lệ do đầu ra chỉ định để xác định cấp độ phù hợp của kim tự tháp hình ảnh dùng làm đầu vào.
Kim tự tháp hình ảnh
Các thành phần hình ảnh trong Earth Engine tồn tại ở nhiều tỷ lệ, trong kim tự tháp hình ảnh.
Chính sách tạo kim tự tháp (được biểu thị bằng các đường đứt nét trong Hình 1) xác định cách mỗi pixel ở một cấp độ nhất định của kim tự tháp được tính toán từ việc tổng hợp một khối pixel 2x2 ở cấp thấp hơn tiếp theo. Đối với hình ảnh có giá trị liên tục, giá trị pixel của các cấp cao hơn của kim tự tháp là giá trị trung bình của các pixel ở cấp thấp hơn tiếp theo. Đối với hình ảnh có giá trị rời rạc, giá trị pixel của các cấp trên của kim tự tháp là một mẫu (thường là pixel trên cùng bên trái) của các pixel ở cấp thấp hơn tiếp theo.
Cấp thấp nhất của kim tự tháp hình ảnh đại diện cho dữ liệu hình ảnh ở độ phân giải gốc, khi dữ liệu này được đưa vào Earth Engine. Trong quá trình nhập, dữ liệu được tổng hợp (theo chính sách tạo kim tự tháp) để tạo các cấp kim tự tháp cao hơn. Dữ liệu được tổng hợp cho đến khi toàn bộ hình ảnh vừa với một ô 256x256 pixel. Khi bạn sử dụng hình ảnh trong mã, Earth Engine sẽ chọn một cấp của kim tự tháp có tỷ lệ gần nhất nhỏ hơn hoặc bằng tỷ lệ do phân tích của bạn chỉ định và lấy mẫu lại (sử dụng thuật toán lấy mẫu kề cận nhất theo mặc định) nếu cần.
Quy mô phân tích
Quy mô phân tích trong Earth Engine được xác định trên cơ sở "kéo". Quy mô để yêu cầu dữ liệu đầu vào cho một phép tính được xác định từ đầu ra. Ví dụ: nếu bạn thêm hình ảnh vào Trình soạn thảo mã hoặc phần tử bản đồ geemap, thì mức thu phóng của bản đồ sẽ xác định tỷ lệ mà dữ liệu đầu vào được yêu cầu từ kim tự tháp hình ảnh. Đối với các phép tính khác, bạn chỉ định scale làm đối số. Ví dụ: sử dụng băng NIR của hình ảnh Landsat có độ phân giải gốc là 30 mét:
Trong ví dụ này, hãy lưu ý rằng giá trị pixel tại một vị trí không đổi (trung tâm hình ảnh) sẽ thay đổi tuỳ theo tỷ lệ. Điều này là do các cấp kim tự tháp khác nhau được chọn cho các tỷ lệ khác nhau. Đối với các tỷ lệ tương tự, việc lấy mẫu lại bằng thuật toán lấy mẫu kề gần nhất sẽ trả về cùng một giá trị pixel. Điểm quan trọng là bằng cách thay đổi tỷ lệ, hệ thống sẽ yêu cầu các đầu vào hình ảnh khác nhau.
Khi bạn trực quan hoá hình ảnh bằng cách thêm hình ảnh đó vào bản đồ, Earth Engine sẽ xác định tỷ lệ theo cấp độ thu phóng. Hãy xem xét ví dụ đơn giản sau đây, chỉ hiển thị một hình ảnh Landsat:
Bản đồ bắt đầu được thu phóng hết cỡ để các điểm ảnh có độ phân giải gốc hiển thị rõ ràng. Việc thu nhỏ đủ xa sẽ không hiển thị cùng một pixel mà sẽ hiển thị các cấp cao hơn của kim tự tháp hình ảnh. Cũng cần lưu ý rằng Trình soạn thảo mã và bản đồ geemap sử dụng phép chiếu bản đồ Mercator (EPSG:3857), vì vậy, bạn cũng cần chiếu lại cấp độ thích hợp của kim tự tháp hình ảnh trước khi hiển thị. Tìm hiểu thêm về cách Earth Engine xử lý các phép chiếu trong tài liệu về phép chiếu.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-25 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)."]]