– ciąg tekstowy: identyfikator zasobu EarthEngine,
– ciąg tekstowy i liczba: identyfikator i wersja zasobu Earth Engine,
– liczba lub ee.Array: tworzy stały obraz,
– lista: tworzy obraz z każdego elementu listy i łączy je w jeden obraz;
– ee.Image: zwraca argument,
- Nic: powoduje wyświetlenie pustego przezroczystego obrazu.
Wykorzystanie | Zwroty |
---|---|
ee.Image(args) | Obraz |
Argument | Typ | Szczegóły |
---|---|---|
args | Image|List, opcjonalnie | Argument konstruktora. |
Przykłady
Edytor kodu (JavaScript)
var image = ee.Image('NASA/NASADEM_HGT/001'); Map.setZoom(3); Map.addLayer(image.select('elevation'), {min: -1e3, max: 5e3}, 'Elevation'); // Image NASA/NASADEM_HGT/001 (3 bands) // type: Image // id: NASA/NASADEM_HGT/001 // version: 1641990521971299 // bands: List (3 elements) // properties: Object (22 properties) print(image); var transparent = ee.Image(); Map.addLayer(transparent, null, 'transparent', false); // Image (1 band) // type: Image // bands: List (1 element) // 0: "constant", int ∈ [0, 0], EPSG:4326 print(transparent); // Create a multi-band image from a list of constants. var orange = ee.Image([0xff, 0x88, 0x00]); Map.addLayer(orange, {min: 0, max: 0xff}, 'orange', false); // Image (3 bands) // type: Image // bands: List (3 elements) // 0: "constant", int ∈ [255, 255], EPSG:4326 // 1: "constant_1", int ∈ [136, 136], EPSG:4326 // 2: "constant_2", int ∈ [0, 0], EPSG:4326 print(orange); // Create a one band image where each pixel is an array of three values. var imageOfArray = ee.Image(ee.Array([0x00, 0x00, 0xff])); Map.addLayer(imageOfArray, null, 'imageOfArray', false); // Image (1 band) // type: Image // bands: List (1 element) // 0: "constant", unsigned int8, 1 dimension, EPSG:4326 // id: constant // crs: EPSG:4326 // crs_transform: [1,0,0,0,1,0] // data_type: unsigned int8, 1 dimension // type: PixelType // dimensions: 1 // max: 255 // min: 0 // precision: int print(imageOfArray);
import ee import geemap.core as geemap
Colab (Python)
image = ee.Image('NASA/NASADEM_HGT/001') m = geemap.Map() m.zoom = 3 display(m) m.add_layer(image.select('elevation'), {'min': -1e3, 'max': 5e3}, 'Elevation') # Image NASA/NASADEM_HGT/001 (3 bands) # type: Image # id: NASA/NASADEM_HGT/001 # version: 1641990521971299 # 'bands': List (3 elements) # properties: Object (22 properties) display(image) transparent = ee.Image() m.add_layer(transparent, None, 'transparent', False) # Image (1 band) # type: Image # 'bands': List (1 element) # 0: "constant", int ∈ [0, 0], EPSG:4326 display(transparent) # Create a multi-band image from a list of constants. orange = ee.Image([0xFF, 0x88, 0x00]) m.add_layer(orange, {'min': 0, 'max': 0xFF}, 'orange', False) # Image (3 bands) # type: Image # 'bands': List (3 elements) # 0: "constant", int ∈ [255, 255], EPSG:4326 # 1: "constant_1", int ∈ [136, 136], EPSG:4326 # 2: "constant_2", int ∈ [0, 0], EPSG:4326 display(orange) # Create a one band image where each pixel is an array of three values. image_of_array = ee.Image(ee.Array([0x00, 0x00, 0xFF])) m.add_layer(image_of_array, None, 'image_of_array', False) # Image (1 band) # type: Image # 'bands': List (1 element) # 0: "constant", unsigned int8, 1 dimension, EPSG:4326 # id: constant # crs: EPSG:4326 # crs_transform: [1,0,0,0,1,0] # data_type: unsigned int8, 1 dimension # type: PixelType # dimensions: 1 # 'max': 255 # 'min': 0 # precision: int display(image_of_array)