Annuncio : tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso. Se non hai eseguito la verifica entro il 26 settembre 2025, il tuo accesso potrebbe essere sospeso.
Invia feedback
ee.Array.and
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Restituisce 1 a livello di elemento se e solo se entrambi i valori sono diversi da zero.
Utilizzo Resi Array. and (right)
Array
Argomento Tipo Dettagli questo: left
Array Il valore a sinistra. right
Array Il valore a destra.
Esempi
Editor di codice (JavaScript)
// Element-wise boolean "and" operator.
// Both arrays must be the same dimensions.
var arrayNeither = ee . Array ([ 0 , 0 ]);
var arrayFirst = ee . Array ([ 1 , 0 ]);
var arraySecond = ee . Array ([ 0 , 1 ]);
var arrayBoth = ee . Array ([ 1 , 1 ]);
// Any non-zero value is true.
var arrayLarger = ee . Array ([ - 2 , 2 ]);
print ( arrayBoth . and ( arrayLarger )); // [1, 1]
print ( arrayBoth . and ( arrayNeither )); // [0, 0]
print ( arrayFirst . and ( arraySecond )); // [0, 0]
print ( arraySecond . and ( arrayFirst )); // [0, 0]
print ( arrayBoth . and ( arrayFirst )); // [1, 0]
print ( arrayBoth . and ( arraySecond )); // [0, 1]
print ( arrayNeither . and ( arrayFirst )); // [0, 0]
print ( arrayNeither . and ( arraySecond )); // [0, 0]
// Works the same for all PixelTypes.
var arrayDouble = ee . Array ([ 0.0 , 2.0 ], ee . PixelType . double ());
print ( arrayBoth . and ( arrayDouble )); // [0, 1]
Configurazione di Python
Consulta la pagina
Ambiente Python per informazioni sull'API Python e sull'utilizzo di
geemap
per lo sviluppo interattivo.
import ee
import geemap.core as geemap
Colab (Python)
# Element-wise boolean "and" operator.
# Both arrays must be the same dimensions.
array_neither = ee . Array ([ 0 , 0 ])
array_first = ee . Array ([ 1 , 0 ])
array_second = ee . Array ([ 0 , 1 ])
array_both = ee . Array ([ 1 , 1 ])
# Any non-zero value is true.
array_larger = ee . Array ([ - 2 , 2 ])
display ( array_both . And ( array_larger )) # [1, 1]
display ( array_both . And ( array_neither )) # [0, 0]
display ( array_first . And ( array_second )) # [0, 0]
display ( array_second . And ( array_first )) # [0, 0]
display ( array_both . And ( array_first )) # [1, 0]
display ( array_both . And ( array_second )) # [0, 1]
display ( array_neither . And ( array_first )) # [0, 0]
display ( array_neither . And ( array_second )) # [0, 0]
# Works the same for all PixelTypes.
array_double = ee . Array ([ 0.0 , 2.0 ], ee . PixelType . double ())
display ( array_both . And ( array_double )) # [0, 1]
Invia feedback
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0 , mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0 . Per ulteriori dettagli, consulta le norme del sito di Google Developers . Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-26 UTC.
Vuoi dirci altro?
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-07-26 UTC."],[],[]]