The data used in this article is the same as that in the previous article , Last link :
Python Application of remote sensing image processing ( sixteen ):GDAL Normalize csv Data is transformed into remote sensing images _ Air spin basketball blog -CSDN Blog
The last article will csv File to single band image , This one will csv The file is combined into a multi band image . Note that one premise is to know the basic information of the original image , Such as data row and column number , Projection information , Data type information, etc .
When writing multispectral data , The core problem is to use a loop to write the data of each channel .
What is written directly here is the two-dimensional array data , When reading other people's articles , Some use three-dimensional arrays , Like format (channel,row,col), I will report an error when using , Directly using a two-dimensional array can run correctly .
Running environment :python3.7.7 GDAL-3.2.3-cp37-cp37m-win_amd64.whl package .
for channel in np.arange(dim_z):
map = np.array(image_array[:, channel],dtype=np.float32)