Объявление : Все некоммерческие проекты, зарегистрированные для использования Earth Engine до
15 апреля 2025 года, должны
подтвердить право на некоммерческое использование для сохранения доступа. Если вы не подтвердите право до 26 сентября 2025 года, ваш доступ может быть приостановлен.
Отправить отзыв
ee.Image.not
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Возвращает 0, если входное значение не равно нулю, и 1 в противном случае.
Использование Возврат Image. not ()
Изображение
Аргумент Тип Подробности это: value
Изображение Изображение, к которому применена операция.
Примеры Редактор кода (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' ); Настройка Python
Информацию об API Python и использовании geemap
для интерактивной разработки см. на странице «Среда Python» .
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 ()) ,Возвращает 0, если входное значение не равно нулю, и 1 в противном случае.
Использование Возврат Image. not ()
Изображение
Аргумент Тип Подробности это: value
Изображение Изображение, к которому применена операция.
Примеры Редактор кода (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' ); Настройка Python
Информацию об API Python и использовании geemap
для интерактивной разработки см. на странице «Среда Python» .
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 ())
Отправить отзыв
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0" , а примеры кода – по лицензии Apache 2.0 . Подробнее об этом написано в правилах сайта . Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 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-24 UTC."],[],[]]