当前位置:网站首页>MATLAB快速将影像的二维坐标转换为经纬度坐标
MATLAB快速将影像的二维坐标转换为经纬度坐标
2022-06-27 05:41:00 【A-Chin】
一般使用 [lat, lon] = pix2latlon(R,row,col) 逐个将影像的二维坐标转换为经纬度坐标,但这样用到双重循环,运行较慢,代码如下:
[A, RA] = readgeoraster('D:\test.tif');
info = geotiffinfo('D:\test.tif');
A_Lat = zeros(size(A));
A_Lon = zeros(size(A));
for i = 1 : size(A, 1)
for j = 1 : size(A, 2)
[A_Lat(i, j), A_Lon(i, j)] = pix2latlon(info.RefMatrix, i, j);
end
end
一种较快的方法为,先建立二维坐标的X矩阵和Y矩阵(代码中的A_I和A_J),然后仅需运行一次 pix2latlon 函数即可,运行效率能够大幅提高,代码如下:
[A, RA] = geotiffread('D:\test.tif');
info = geotiffinfo('D:\test.tif');
A_I = zeros(size(A));
A_J = zeros(size(A));
for i = 1 : size(A_I, 1)
A_I(i, :) = i;
end
for j = 1 : size(A_J, 2)
A_J(:, j) = j;
end
[A_Lat, A_Lon] = pix2latlon(info.RefMatrix, A_I, A_J);
边栏推荐
- Double position relay jdp-1440/dc110v
- 洛谷P2939 [USACO09FEB]Revamping Trails G 题解
- 【Cocos Creator 3.5.1】this. node. Use of getposition (this.\u curpos)
- Nlp-d62-nlp competition d31 & question brushing D15
- mysql 查询时将状态改为相对应的文字
- 函数式 连续式
- [FPGA] design and implementation of frequency division and doubling based on FPGA
- Neo4j community conflicts with neo4j desktop
- Leetcode298 weekly race record
- 双位置继电器JDP-1440/DC110V
猜你喜欢

双位置继电器HJWS-9440

Redis high availability cluster (sentry, cluster)

微信小程序WebSocket使用案例

How win 10 opens the environment variables window
![[FPGA] design and implementation of frequency division and doubling based on FPGA](/img/84/75d473d3d8e670260ba16d06705c2f.png)
[FPGA] design and implementation of frequency division and doubling based on FPGA

机械转码日记【17】模板,STL简介

STM32 reads IO high and low level status

Two position relay rxmvb2 r251 204 110dc

Niuke practice 101-c reasoning clown - bit operation + thinking

NLP-D62-nlp比赛D31&刷题D15
随机推荐
Leetcode99 week race record
多线程基础部分Part3
Pytest框架的执行规则
Dual position relay dls-34a dc0.5a 220VDC
stm32读取IO高低电平状态
Go日志-Uber开源库zap使用
QT using Valgrind to analyze memory leaks
双位置继电器DLS-34A DC0.5A 220VDC
双位置继电器HJWS-9440
Wechat applet refreshes the current page
Zener diode zener diode sod123 package positive and negative distinction
数据库-索引
【FPGA】UART串口_V1.1
【FPGA】 基于FPGA分频,倍频设计实现
Wechat applet websocket use case
Netease cloud music params and encseckey parameter generation code
Execution rules of pytest framework
多线程基础部分Part 1
Ad22 Gerber files Click to open the Gerber step interface. Official solutions to problems
Senior [Software Test Engineer] learning route and necessary knowledge points