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. Nếu bạn chưa xác minh trước ngày 26 tháng 9 năm 2025, quyền truy cập của bạn có thể bị tạm ngưng.
Gửi ý kiến phản hồi
ee.Image.not
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.
Trả về 0 nếu đầu vào khác 0 và 1 nếu đầu vào bằng 0.
Cách sử dụng Giá trị trả về Image. not ()
Hình ảnh
Đối số Loại Thông tin chi tiết this: value
Hình ảnh Hình ảnh mà thao tác được áp dụng.
Ví dụ
Trình soạn thảo mã (JavaScript)
/**
* Demonstrates the ee.Image.Not method.
*
* This example uses positive integers; non-integer and negative
* values are allowed.
*/
var notZeros = ee . Image ( 3 ); // Define an image where all pixels are not zero.
var zeros = notZeros . not (); // Pixels are not zeros, return zeros.
var ones = zeros . not (); // Pixels are zeros, return ones.
print ( 'zeros:' , zeros );
print ( 'ones:' , ones );
// Display images to the map; explore values using the Inspector.
var visParams = { min : 0 , max : 1 };
Map . addLayer ( notZeros , visParams , 'notZeros' );
Map . addLayer ( zeros , visParams , 'zeros' );
Map . addLayer ( ones , visParams , 'ones' );
Thiết lập Python
Hãy xem trang
Môi trường Python để biết thông tin về API Python và cách sử dụng geemap
cho quá trình phát triển tương tác.
import ee
import geemap.core as geemap
Colab (Python)
"""Demonstrates the ee.Image.Not method.
This example uses positive integers; non-integer and negative
values are allowed.
"""
import pprint
import ee
ee . Authenticate ()
ee . Initialize ()
not_zeros = ee . Image ( 3 ) # Define an image where all pixels are not zero.
zeros = not_zeros . Not () # Pixels are not zeros, return zeros.
ones = zeros . Not () # Pixels are zeros, return ones.
print ( 'zeros:' )
pprint . pprint ( zeros . getInfo ())
print ( ' \n ones:' )
pprint . pprint ( ones . getInfo ())
# Sample images at a location and print the results.
loc = ee . Geometry . Point ( 0 , 0 ) # Location to sample image values.
print ( 'not_zeros:' , not_zeros . sample ( loc , 1 ) . first () . get ( 'constant' ) . getInfo ())
print ( 'zeros:' , zeros . sample ( loc , 1 ) . first () . get ( 'constant' ) . getInfo ())
print ( 'ones:' , ones . sample ( loc , 1 ) . first () . get ( 'constant' ) . getInfo ())
Gửi ý kiến phản hồi
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0 . Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers . Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
Bạn muốn chia sẻ thêm với chúng tôi?
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[]]