ประกาศ : โปรเจ็กต์ที่ไม่ใช่เชิงพาณิชย์ทั้งหมดที่ลงทะเบียนเพื่อใช้ Earth Engine ก่อนวันที่
15 เมษายน 2025 ต้อง
ยืนยันการมีสิทธิ์ที่ไม่ใช่เชิงพาณิชย์ เพื่อรักษาสิทธิ์เข้าถึง หากคุณไม่ยืนยันภายในวันที่ 26 กันยายน 2025 ระบบอาจระงับสิทธิ์เข้าถึงของคุณ
ส่งความคิดเห็น
ee.ImageCollection.getRegion
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แสดงผลอาร์เรย์ของค่าสำหรับแต่ละทูเพิล [pixel, band, image] ใน ImageCollection เอาต์พุตประกอบด้วยแถวของรหัส ลองจิจูด ละติจูด เวลา และทุกแบนด์สำหรับแต่ละรูปภาพที่ตัดกับแต่ละพิกเซลในภูมิภาคที่กำหนด การพยายามดึงค่ามากกว่า 1048576 ค่าจะทำให้เกิดข้อผิดพลาด
การใช้งาน การคืนสินค้า ImageCollection. getRegion (geometry, scale , crs , crsTransform )
รายการ
อาร์กิวเมนต์ ประเภท รายละเอียด ดังนี้ collection
ImageCollection รูปภาพที่จะรวบรวมเพื่อดึงข้อมูล geometry
เรขาคณิต ภูมิภาคที่จะดึงข้อมูล scale
ลอย ค่าเริ่มต้น: null มาตราส่วนที่ระบุเป็นเมตรของโปรเจ็กชันที่จะใช้ crs
การคาดการณ์ (ไม่บังคับ) การฉายภาพเพื่อทำงาน หากไม่ระบุ ระบบจะใช้ EPSG:4326 เป็นค่าเริ่มต้น หากระบุเพิ่มเติมจากสเกล ระบบจะปรับขนาดการฉายภาพใหม่เป็นสเกลที่ระบุ crsTransform
รายการ (ค่าเริ่มต้น: null) อาร์เรย์ของค่าการแปลง CRS นี่คือลำดับแถวหลักของการแปลงแอฟฟิน 3x2 ตัวเลือกนี้จะใช้ร่วมกับตัวเลือกการปรับขนาดไม่ได้ และจะแทนที่การเปลี่ยนรูปแบบใดๆ ที่ตั้งค่าไว้แล้วในการฉายภาพที่กำหนด
ตัวอย่าง
โปรแกรมแก้ไขโค้ด (JavaScript)
// A Landsat 8 TOA image collection (3 months at a specific point, RGB bands).
var col = ee . ImageCollection ( 'LANDSAT/LC08/C02/T1_TOA' )
. filterBounds ( ee . Geometry . Point ( - 90.70 , 34.71 ))
. filterDate ( '2020-07-01' , '2020-10-01' )
. select ( 'B[2-4]' );
print ( 'Collection' , col );
// Define a region to get pixel values for. This is a small rectangle region
// that intersects 2 image pixels at 30-meter scale.
var roi = ee . Geometry . BBox ( - 90.496353 , 34.851971 , - 90.495749 , 34.852197 );
// Display the region of interest overlaid on an image representative. Note
// the ROI intersection with 2 pixels.
var visParams = {
bands : [ 'B4' , 'B3' , 'B2' ],
min : 0.128 ,
max : 0.163
};
Map . setCenter ( - 90.49605 , 34.85211 , 19 );
Map . addLayer ( col . first (), visParams , 'Image representative' );
Map . addLayer ( roi , { color : 'white' }, 'ROI' );
// Fetch pixel-level information from all images in the collection for the
// pixels intersecting the ROI.
var pixelInfoBbox = col . getRegion ({
geometry : roi ,
scale : 30
});
// The result is a table (a list of lists) where the first row is column
// labels and subsequent rows are image pixels. Columns contain values for
// the image ID ('system:index'), pixel longitude and latitude, image
// observation time ('system:time_start'), and bands. In this example, note
// that there are 5 images and the region intersects 2 pixels, so n rows
// equals 11 (5 * 2 + 1). All collection images must have the same number of
// bands with the same names.
print ( 'Extracted pixel info' , pixelInfoBbox );
// The function accepts all geometry types (e.g., points, lines, polygons).
// Here, a multi-point geometry with two points is used.
var points = ee . Geometry . MultiPoint ([[ - 90.49 , 34.85 ], [ - 90.48 , 34.84 ]]);
var pixelInfoPoints = col . getRegion ({
geometry : points ,
scale : 30
});
print ( 'Point geometry example' , pixelInfoPoints );
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap
เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
สภาพแวดล้อม Python
import ee
import geemap.core as geemap
Colab (Python)
# A Landsat 8 TOA image collection (3 months at a specific point, RGB bands).
col = (
ee . ImageCollection ( 'LANDSAT/LC08/C02/T1_TOA' )
. filterBounds ( ee . Geometry . Point ( - 90.70 , 34.71 ))
. filterDate ( '2020-07-01' , '2020-10-01' )
. select ( 'B[2-4]' )
)
display ( 'Collection' , col )
# Define a region to get pixel values for. This is a small rectangle region
# that intersects 2 image pixels at 30-meter scale.
roi = ee . Geometry . BBox ( - 90.496353 , 34.851971 , - 90.495749 , 34.852197 )
# Display the region of interest overlaid on an image representative. Note
# the ROI intersection with 2 pixels.
vis_params = { 'bands' : [ 'B4' , 'B3' , 'B2' ], 'min' : 0.128 , 'max' : 0.163 }
m = geemap . Map ()
m . set_center ( - 90.49605 , 34.85211 , 19 )
m . add_layer ( col . first (), vis_params , 'Image representative' )
m . add_layer ( roi , { 'color' : 'white' }, 'ROI' )
display ( m )
# Fetch pixel-level information from all images in the collection for the
# pixels intersecting the ROI.
pixel_info_bbox = col . getRegion ( geometry = roi , scale = 30 )
# The result is a table (a list of lists) where the first row is column
# labels and subsequent rows are image pixels. Columns contain values for
# the image ID ('system:index'), pixel longitude and latitude, image
# observation time ('system:time_start'), and bands. In this example, note
# that there are 5 images and the region intersects 2 pixels, so n rows
# equals 11 (5 * 2 + 1). All collection images must have the same number of
# bands with the same names.
display ( 'Extracted pixel info' , pixel_info_bbox )
# The function accepts all geometry types (e.g., points, lines, polygons).
# Here, a multi-point geometry with two points is used.
points = ee . Geometry . MultiPoint ([[ - 90.49 , 34.85 ], [ - 90.48 , 34.84 ]])
pixel_info_points = col . getRegion ( geometry = points , scale = 30 )
display ( 'Point geometry example' , pixel_info_points )
ส่งความคิดเห็น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
หากต้องการบอกให้เราทราบเพิ่มเติม
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-26 UTC"],[],["The `ImageCollection.getRegion` method extracts pixel values from an ImageCollection within a specified geometry. It returns a list containing rows of data for each \\[pixel, band, image\\] tuple, including id, longitude, latitude, time, and band values. Users define the extraction region, scale, and optionally the projection. The output format is a table where rows represent pixels and columns detail each image's data. The method accepts various geometry types but is limited to extracting 1,048,576 values per request.\n"]]