程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python remote sensing image processing application (17): GDAL converts normalized CSV data into multi band remote sensing images

編輯:Python

1. Using data

  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 .

2. Implementation code

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)

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved