Earth Engine ได้เปิดตัว
ระดับโควต้าที่ไม่ใช่เชิงพาณิชย์เพื่อปกป้องทรัพยากรการประมวลผลที่ใช้ร่วมกันและรับประกันประสิทธิภาพที่เชื่อถือได้สำหรับทุกคน โปรเจ็กต์ที่ไม่ใช่เชิงพาณิชย์จะใช้ระดับชุมชนโดยค่าเริ่มต้น แต่คุณสามารถเปลี่ยนระดับของโปรเจ็กต์ได้ทุกเมื่อ
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
ee.Geometry.coveringGrid
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงผลคอลเล็กชันฟีเจอร์ที่ครอบคลุมเรขาคณิตนี้ โดยแต่ละฟีเจอร์จะเป็นสี่เหลี่ยมผืนผ้าในตารางกริดที่กำหนดโดยการฉายภาพที่ระบุ
| การใช้งาน | การคืนสินค้า |
|---|
Geometry.coveringGrid(proj, scale) | FeatureCollection |
| อาร์กิวเมนต์ | ประเภท | รายละเอียด |
|---|
this: geometry | เรขาคณิต | ผลลัพธ์คือเซลล์ตารางกริดที่ตัดกับภูมิภาคนี้ |
proj | Projection | การฉายภาพที่จะใช้สร้างตารางกริด ระบบจะสร้างฟีเจอร์สำหรับเซลล์ตารางกริดแต่ละเซลล์ที่ตัดกับ "geometry" โดยมุมของเซลล์จะอยู่ที่ตำแหน่งที่มีค่าเป็นจำนวนเต็มในการฉายภาพ หากการฉายภาพมีการปรับขนาดเป็นเมตร จุดต่างๆ จะอยู่ในตารางกริดที่มีขนาดดังกล่าว ณ จุดที่มีการปรับขนาดจริง |
scale | Float, ค่าเริ่มต้น: null | ลบล้างขนาดของการฉายภาพ หากระบุไว้ อาจจำเป็นหากยังไม่ได้ปรับขนาดการฉายภาพ |
ตัวอย่าง
ตัวแก้ไขโค้ด (JavaScript)
// Define the coordinate reference system (CRS) to be used for grid alignment.
// WGS 84 / UTM zone 36S.
var epsg = 'EPSG:32736';
// Create a point geometry to serve as the center for the analysis.
var point = ee.Geometry.Point(31.6, -8.54);
Map.addLayer(point, {color: 'orange'}, 'Center');
Map.centerObject(point, 8);
// Create a circular buffer of 100,000 meters (100 km) around the point to
// define the study area.
var areaOfInterest = point.buffer(100000);
Map.addLayer(areaOfInterest, {color: 'purple'}, 'Area of interest');
// Calculate a scale value to determine the size of the grid cells.
// Use a power of 2 for best GeoTIFF tiling, e.g., assuming that we'll use the
// grid cell to define image export regions, 2**14 -> 16384.
var scale = Math.pow(2, 14);
// Generate a FeatureCollection of grid cells that covers the buffered area
// using the specified projection and scale.
var grid = areaOfInterest.coveringGrid({proj: epsg, scale: scale});
Map.addLayer(grid, {color: 'blue'}, 'Covering Grid', true, 0.5);
// Define the specific index string of the grid cell to be extracted.
var cellOfInterest = '18,551';
// Filter the grid collection to find the feature matching the index and
// retrieve it as an ee.Feature.
var feature =
ee.Feature(grid.toList(10000)
.filter(ee.Filter.eq('system:index', cellOfInterest))
.get(0));
Map.addLayer(feature, {color: 'red'}, 'grid cell', true, 0.5);
// One common use of coveringGrid is to tile operations such as exports.
// This often involves iterating through grid cells on the client-side to
// submit tasks for each cell. Here we print each cell ID using evaluate().
print('Grid cell IDs:');
grid.aggregate_array('system:index').evaluate(function(cellIds) {
cellIds.forEach(function(cellId) {
print(cellId);
});
});
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2026-05-23 UTC
[null,null,["อัปเดตล่าสุด 2026-05-23 UTC"],[],["The `coveringGrid` function generates a `FeatureCollection` of rectangular grid cells that intersect a given `Geometry`. It uses a specified `Projection` to define the grid, with each cell represented as a feature. The grid's scale is determined by the projection, or overridden by an optional `scale` argument. The function returns cells where their corners are located at integer-valued positions within the specified `Projection`.\n"]]