ee.Array.bitwiseOr Stay organized with collections Save and categorize content based on your preferences.
Page Summary
The
Array.bitwiseOrmethod calculates the bitwise OR of two input arrays on an element-wise basis.The method returns an array as the result.
Both the left-hand (
this) and right-hand (right) values are arrays.The examples demonstrate the bitwise OR operation with various integer inputs, including positive, negative, and hexadecimal values.
| Usage | Returns |
|---|---|
Array.bitwiseOr(right) | Array |
| Argument | Type | Details |
|---|---|---|
this:left | Array | The left-hand value. |
right | Array | The right-hand value. |
Examples
Code Editor (JavaScript)
varempty=ee.Array([],ee.PixelType.int8());print(empty.bitwiseOr(empty));// []print(ee.Array(0).bitwiseOr(ee.Array(0)));// 0print(ee.Array(0).bitwiseOr(ee.Array(1)));// 1print(ee.Array(1).bitwiseOr(ee.Array(0)));// 1print(ee.Array(1).bitwiseOr(ee.Array(1)));// 1print(ee.Array(0xFF).bitwiseOr(ee.Array(0xFFFF)));// 65535print(ee.Array(0xFFFF).bitwiseOr(ee.Array(0xFF)));// 65535print(ee.Array(-1).bitwiseOr(ee.Array(0xFF)));// -1print(ee.Array(-2).bitwiseOr(ee.Array(-3)));// -1print(ee.Array(-2).bitwiseOr(ee.Array(-4)));// -2print(ee.Array([6,6]).bitwiseOr(ee.Array([1,11])));// [7,15]
Python setup
See the Python Environment page for information on the Python API and usinggeemap for interactive development.
importeeimportgeemap.coreasgeemap
Colab (Python)
empty=ee.Array([],ee.PixelType.int8())display(empty.bitwiseOr(empty))# []display(ee.Array(0).bitwiseOr(ee.Array(0)))# 0display(ee.Array(0).bitwiseOr(ee.Array(1)))# 1display(ee.Array(1).bitwiseOr(ee.Array(0)))# 1display(ee.Array(1).bitwiseOr(ee.Array(1)))# 1display(ee.Array(0xFF).bitwiseOr(ee.Array(0xFFFF)))# 65535display(ee.Array(0xFFFF).bitwiseOr(ee.Array(0xFF)))# 65535display(ee.Array(-1).bitwiseOr(ee.Array(0xFF)))# -1display(ee.Array(-2).bitwiseOr(ee.Array(-3)))# -1display(ee.Array(-2).bitwiseOr(ee.Array(-4)))# -2display(ee.Array([6,6]).bitwiseOr(ee.Array([1,11])))# [7, 15]
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.