中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

晉中網(wǎng)站建設(shè)公司百度我的訂單

晉中網(wǎng)站建設(shè)公司,百度我的訂單,溫州谷歌優(yōu)化排名公司,2023年網(wǎng)絡(luò)推廣方法Python遙感開發(fā)之批量拼接 1 遙感圖像無交錯(cuò)的批量拼接2 遙感圖像有交錯(cuò)的批量拼接 前言:主要借助python實(shí)現(xiàn)遙感影像的批量拼接,遙感影像的批量拼接主要分為兩種情況,一種是遙感圖像無交錯(cuò),另一種情況是遙感圖像相互有交錯(cuò)。具體…

Python遙感開發(fā)之批量拼接

  • 1 遙感圖像無交錯(cuò)的批量拼接
  • 2 遙感圖像有交錯(cuò)的批量拼接

前言:主要借助python實(shí)現(xiàn)遙感影像的批量拼接,遙感影像的批量拼接主要分為兩種情況,一種是遙感圖像無交錯(cuò),另一種情況是遙感圖像相互有交錯(cuò)。具體實(shí)現(xiàn)請(qǐng)參考以下代碼,如有問題請(qǐng)及時(shí)反饋。


1 遙感圖像無交錯(cuò)的批量拼接

此方法是各個(gè)遙感文件是沒有相互交錯(cuò)的拼接,如下圖所示。個(gè)人可以使用Arcgis進(jìn)行查看。
在這里插入圖片描述
在這里插入圖片描述

實(shí)現(xiàn)思路:通過每個(gè)遙感數(shù)據(jù)的經(jīng)緯度進(jìn)行拼接下一個(gè)遙感數(shù)據(jù)文件。

import os
from osgeo import gdaldef get_data_list(file_path, out = ""):list1 = []  # 文件的完整路徑if os.path.isdir(file_path):fileList = os.listdir(file_path)if out != "":for f in fileList:out_data = out + "\\" + fout_data = out_data.replace(".HDF", "_ndvi.tif")list1.append(out_data)else:for f in fileList:pre_data = file_path + '\\' + f  # 文件的完整路徑list1.append(pre_data)return list1def get_same_list(image, infile_list):infile_list02 = []for data in infile_list:if image in data:# print("----", data)infile_list02.append(data)return infile_list02def get_same_image_list(infile_list):image_list= []for file in infile_list:filename = file[-31:-23]if filename not in image_list:image_list.append(filename)return list(set(image_list))def pinjie(infile_list,outfile):ds = gdal.Open(infile_list[0])cols = ds.RasterXSizerows = ds.RasterYSizeingeo = ds.GetGeoTransform()proj = ds.GetProjection()minx = ingeo[0]maxy = ingeo[3]maxx = ingeo[0] + ingeo[1] * colsminy = ingeo[3] + ingeo[5] * rowsds = Nonefor file in infile_list[1:]:ds = gdal.Open(file)cols = ds.RasterXSizerows = ds.RasterYSizegeo = ds.GetGeoTransform()minx_ = geo[0]maxy_ = geo[3]maxx_ = geo[0] + geo[1] * colsminy_ = geo[3] + geo[5] * rowsminx = min(minx, minx_)maxy = max(maxy, maxy_)maxx = max(maxx, maxx_)miny = min(miny, miny_)geo = Noneds = Nonenewcols = int((maxx - minx) / abs(ingeo[1]))newrows = int((maxy - miny) / abs(ingeo[5]))driver = gdal.GetDriverByName("GTiff")outds = driver.Create(outfile, newcols, newrows, 1, gdal.GDT_Int16)outgeo = (minx, ingeo[1], 0, maxy, 0, ingeo[5])outds.SetGeoTransform(outgeo)outds.SetProjection(proj)outband = outds.GetRasterBand(1)for file in infile_list:ds = gdal.Open(file)data = ds.ReadAsArray()geo = ds.GetGeoTransform()x = int(abs((geo[0] - minx) / ingeo[1]))y = int(abs((geo[3] - maxy) / ingeo[5]))outband.WriteArray(data, x, y)ds = Noneoutband.FlushCache()pass
if __name__ == '__main__':infile = r"C:\Users\Administrator\Desktop\01提取ndvi"outfile = r"C:\Users\Administrator\Desktop\02拼接"infile_list = get_data_list(infile)image_name_list = get_same_image_list(infile_list)print(image_name_list)for name in image_name_list:print(name)infile_list02 = get_same_list(name, infile_list)pinjie(infile_list02,outfile+"\\"+name+".tif")

2 遙感圖像有交錯(cuò)的批量拼接

此方法是各個(gè)遙感文件是有相互交錯(cuò)的拼接,如下圖所示,具體可以使用Arcgis進(jìn)行查看。
在這里插入圖片描述
在這里插入圖片描述

實(shí)現(xiàn)思路:借助gdal中WarpOptions的方法實(shí)現(xiàn),有點(diǎn)類似于鑲嵌

import numpy as np
from osgeo import gdal, gdalconst
import osdef RasterMosaic(firstinputfilePath, inputfileList, outputfilePath):inputrasfile1 = gdal.Open(firstinputfilePath, gdal.GA_ReadOnly)  # 第一幅影像inputProj1 = inputrasfile1.GetProjection()options = gdal.WarpOptions(srcSRS=inputProj1, dstSRS=inputProj1, format='GTiff')gdal.Warp(outputfilePath, inputfileList, options=options)def get_data_list(file_path, out=""):list1 = []  # 文件的完整路徑if os.path.isdir(file_path):fileList = os.listdir(file_path)if out != "":for f in fileList:out_data = out + "\\" + fout_data = out_data.replace(".HDF", "_ndvi.tif")list1.append(out_data)else:for f in fileList:pre_data = file_path + '\\' + f  # 文件的完整路徑list1.append(pre_data)return list1def get_same_image_list(infile_list):image_list = []for file in infile_list:filename = file[-20:-12]if filename not in image_list:image_list.append(filename)return list(set(image_list))def get_infile(image,infile_list):for data in infile_list:if image in data:return datadef get_same_list(image, infile_list):infile_list02 = []for data in infile_list:if image in data:infile_list02.append(data)return infile_list02if __name__ == '__main__':inputfile_path = r"D:\風(fēng)云數(shù)據(jù)\MERSI-II陸表反射比1KM段產(chǎn)品\b1\01原始"outfile = r"D:\風(fēng)云數(shù)據(jù)\MERSI-II陸表反射比1KM段產(chǎn)品\b1\02拼接"infile_list = get_data_list(inputfile_path)image_list = get_same_image_list(infile_list)print(image_list)for image in image_list:firstinputfilePath = get_infile(image,infile_list)infile_list02 = get_same_list(image, infile_list)print(image)print(firstinputfilePath)print(infile_list02)RasterMosaic(firstinputfilePath, infile_list02, outfile+"\\"+image+"_b1.tif")print("-------")
http://www.risenshineclean.com/news/10839.html

相關(guān)文章:

  • 在線手機(jī)網(wǎng)站建設(shè)百度官方網(wǎng)站下載
  • 做網(wǎng)站用python好嗎北京seo專業(yè)團(tuán)隊(duì)
  • 網(wǎng)站建設(shè)英文專業(yè)術(shù)語廈門網(wǎng)站快速排名優(yōu)化
  • 免費(fèi) 微網(wǎng)站友情鏈接的定義
  • 不寫編程可以做網(wǎng)站建設(shè)怎么推廣網(wǎng)址
  • 做最最優(yōu)秀的視頻網(wǎng)站有哪些怎么發(fā)布信息到百度
  • l林州住房建設(shè)部官方網(wǎng)站seo查詢是什么意思
  • 如何在自己的網(wǎng)站上做h5頁面阿里云搜索引擎入口
  • 哈爾濱工程研究生招生信息網(wǎng)seo必備軟件
  • 創(chuàng)個(gè)網(wǎng)站怎么弄電腦培訓(xùn)學(xué)校
  • led 網(wǎng)站建設(shè)網(wǎng)級(jí)移動(dòng)營銷app下載
  • 網(wǎng)站代碼怎么改線上運(yùn)營的5個(gè)步驟
  • wordpress教程appseo關(guān)鍵詞布局案例
  • 合肥做網(wǎng)站的的公司有哪些百度推廣要多少錢
  • wordpress的網(wǎng)站怎么讓他上線網(wǎng)絡(luò)營銷的職能是什么
  • wordpress 谷歌西seo優(yōu)化排名
  • 醫(yī)療網(wǎng)站不備案百度熱搜榜排名今日頭條
  • 網(wǎng)站建設(shè)需要什么谷歌google 官網(wǎng)下載
  • 公司名稱大全四個(gè)字seo的工作原理
  • php網(wǎng)站服務(wù)器搭建杭州百度首頁排名
  • 網(wǎng)站開發(fā)簡歷項(xiàng)目經(jīng)驗(yàn)seo服務(wù)工程
  • 手機(jī)網(wǎng)站淘寶客網(wǎng)站建設(shè)找哪家公司好
  • 網(wǎng)站制作設(shè)計(jì)正規(guī)公司市場調(diào)研表模板
  • 做旅行社的都是在哪網(wǎng)站拿票公司網(wǎng)站如何制作設(shè)計(jì)
  • 鄭州網(wǎng)站建設(shè)品牌好網(wǎng)絡(luò)推廣靠譜嗎
  • 網(wǎng)站開發(fā)設(shè)計(jì)怎么找客戶惠州抖音seo策劃
  • 阿里云服務(wù)器可以做網(wǎng)站品牌營銷策劃
  • 上海貿(mào)易公司有哪些甘肅新站優(yōu)化
  • 盤錦威旺做網(wǎng)站建設(shè)山西網(wǎng)絡(luò)推廣專業(yè)
  • 北京靠譜的網(wǎng)站建設(shè)谷歌商店下載不了軟件