Using geointerp and los2

조회 수: 1 (최근 30일)
John
John 2022년 8월 31일
답변: Bjorn Gustavsson 2022년 9월 1일
I'm a novice with the mapping toolbox. I've read in a tiff file using readgeoraster that contains elevation data
[Z R] = readgeoraster('test.tif')
R is a mapPostingReference. When I try to use geointerp function I get the error it expects a GeographicPostingsReference.
When I'm trying to use los2(Z,R, lat1,lon1,lat2,lon1) it states that it expects to be a raster object. I'm looking to understand what I'm doing wrong and what geointerp and los2 expects as inputs.

답변 (1개)

Bjorn Gustavsson
Bjorn Gustavsson 2022년 9월 1일
If you check the documentation (browse on from the help) you will see this:
load topo
Create a raster reference object associated with the topo raster grid.
R = georefcells(topolatlim,topolonlim,size(topo))
and a couple of lines further down:
Define the points you want to interpolate using latitude and longitude.
mylats = [-40 -20 20 40];
mylons = [ 42 54 38 62];
Interpolate the values at the defined points.
Vinterpolated = geointerp(topo,R,mylats,mylons)
There's also a live-script illustrating the workings.
HTH

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by