Feedback geben
ee.Image.arrayCat
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erstellt ein Array-Bild, indem die einzelnen Array-Pixel entlang der angegebenen Achse in jedem Band verkettet werden.
Nutzung Ausgabe Image. arrayCat (image2, axis)
Bild
Argument Typ Details So gehts: image1
Bild Das erste Array-Bild, das verkettet werden soll. image2
Bild Zweites Array-Bild, das verkettet werden soll. axis
Ganzzahl Achse, entlang der die Verkettung erfolgen soll.
Beispiele
Code-Editor (JavaScript)
// A function to print arrays for a selected pixel in the following examples.
function sampArrImg ( arrImg ) {
var point = ee . Geometry . Point ([ - 121 , 42 ]);
return arrImg . sample ( point , 500 ). first (). get ( 'array' );
}
// Create two 1D array images.
var arrayImg1Da = ee . Image ([ 0 , 1 , 2 ]). toArray ();
print ( '1D array image (A) (pixel)' , sampArrImg ( arrayImg1Da ));
// [0, 1, 2]
var arrayImg1Db = ee . Image ([ 3 , 4 , 5 ]). toArray ();
print ( '1D array image (B) (pixel)' , sampArrImg ( arrayImg1Db ));
// [3, 4, 5]
// Concatenate 1D array image B to 1D array image A on 0-axis (rows).
var arrayImg1DcatAx0 = arrayImg1Da . arrayCat ( arrayImg1Db , 0 );
print ( 'Concatenate 1D array images on 0-axis' , sampArrImg ( arrayImg1DcatAx0 ));
// [0, 1, 2, 3, 4, 5]
// Concatenate 1D array image B to 1D array image A on 1-axis (columns).
var arrayImg1DcatAx1 = arrayImg1Da . arrayCat ( arrayImg1Db , 1 );
print ( 'Concatenate 1D array images on 1-axis' , sampArrImg ( arrayImg1DcatAx1 ));
// [[0, 3],
// [1, 4]
// [2, 5]]
// Create two 2D array images (expand the dimensions of 1D arrays).
var arrayImg2Da = arrayImg1Da . toArray ( 1 );
print ( '2D array image (A) (pixel)' , sampArrImg ( arrayImg2Da ));
// [[0],
// [1],
// [2]]
var arrayImg2Db = arrayImg1Db . toArray ( 1 );
print ( '2D array image (B) (pixel)' , sampArrImg ( arrayImg2Db ));
// [[3],
// [4],
// [5]]
// Concatenate 2D array image B to 2D array image A on 0-axis (rows).
var arrayImg2DcatAx0 = arrayImg2Da . arrayCat ( arrayImg2Db , 0 );
print ( 'Concatenate 2D array images on 0-axis' , sampArrImg ( arrayImg2DcatAx0 ));
// [[0],
// [1],
// [2],
// [3],
// [4],
// [5]]
// Concatenate 2D array image B to 2D array image A on 1-axis (columns).
var arrayImg2DcatAx1 = arrayImg2Da . arrayCat ( arrayImg2Db , 1 );
print ( 'Concatenate 2D array images on 1-axis' , sampArrImg ( arrayImg2DcatAx1 ));
// [[0, 3],
// [1, 4],
// [2, 5]]
Python einrichten
Informationen zur Python API und zur Verwendung von geemap
für die interaktive Entwicklung finden Sie auf der Seite
Python-Umgebung .
import ee
import geemap.core as geemap
Colab (Python)
# A function to print arrays for a selected pixel in the following examples.
def samp_arr_img ( arr_img ):
point = ee . Geometry . Point ([ - 121 , 42 ])
return arr_img . sample ( point , 500 ) . first () . get ( 'array' )
# Create two 1D array images.
array_img_1d_a = ee . Image ([ 0 , 1 , 2 ]) . toArray ()
print ( '1D array image (A) (pixel):' , samp_arr_img ( array_img_1d_a ) . getInfo ())
# [0, 1, 2]
array_img_1d_b = ee . Image ([ 3 , 4 , 5 ]) . toArray ()
print ( '1D array image (B) (pixel):' , samp_arr_img ( array_img_1d_b ) . getInfo ())
# [3, 4, 5]
# Concatenate 1D array image B to 1D array image A on 0-axis (rows).
array_img_1d_cat_ax0 = array_img_1d_a . arrayCat ( array_img_1d_b , 0 )
print (
'Concatenate 1D array images on 0-axis:' ,
samp_arr_img ( array_img_1d_cat_ax0 ) . getInfo ()
)
# [0, 1, 2, 3, 4, 5]
# Concatenate 1D array image B to 1D array image A on 1-axis (columns).
array_img_1d_cat_ax1 = array_img_1d_a . arrayCat ( array_img_1d_b , 1 )
print (
'Concatenate 1D array images on 1-axis:' ,
samp_arr_img ( array_img_1d_cat_ax1 ) . getInfo ()
)
# [[0, 3],
# [1, 4]
# [2, 5]]
# Create two 2D array images (expand the dimensions of 1D arrays).
array_img_2d_a = array_img_1d_a . toArray ( 1 )
print ( '2D array image (A) (pixel):' , samp_arr_img ( array_img_2d_a ) . getInfo ())
# [[0],
# [1],
# [2]]
array_img_2d_b = array_img_1d_b . toArray ( 1 )
print ( '2D array image (B) (pixel):' , samp_arr_img ( array_img_2d_b ) . getInfo ())
# [[3],
# [4],
# [5]]
# Concatenate 2D array image B to 2D array image A on 0-axis (rows).
array_img_2d_cat_ax0 = array_img_2d_a . arrayCat ( array_img_2d_b , 0 )
print (
'Concatenate 2D array images on 0-axis:' ,
samp_arr_img ( array_img_2d_cat_ax0 ) . getInfo ()
)
# [[0],
# [1],
# [2],
# [3],
# [4],
# [5]]
# Concatenate 2D array image B to 2D array image A on 1-axis (columns).
array_img_2d_cat_ax1 = array_img_2d_a . arrayCat ( array_img_2d_b , 1 )
print (
'Concatenate 2D array images on 1-axis:' ,
samp_arr_img ( array_img_2d_cat_ax1 ) . getInfo ()
)
# [[0, 3],
# [1, 4],
# [2, 5]]
Feedback geben
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers . Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-07-26 (UTC).
Haben Sie Feedback für uns?
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-07-26 (UTC)."],[[["`Image.arrayCat()` combines two array images by concatenating their pixels along a specified axis (0 for rows, 1 for columns)."],["This function accepts two array images and the axis of concatenation as input, returning a new, combined array image."],["The resulting array image has dimensions determined by the original images and the chosen concatenation axis."],["It can be used to combine 1D or 2D array images, effectively expanding their dimensions or creating multi-band array images."]]],[]]