Hello, I needed to divide the coastline into equal interval (as shown in the image) and identify latitude and longitude of each segments of these coastline.
Basically, for each of these segment, I wish to count the frequency of storms hitting/year.
For this, I did the following:
coastlines = load('C:\Program Files\MATLAB\R2024a\toolbox\map\mapdata\coastlines.mat');
LatLimit = [15 44]; LonLimit = [60 104];
X = coastlines.coastlat((coastlines.coastlat >= LatLimit(1,1) & coastlines.coastlat <= LatLimit(1,2)),:);
Y = coastlines.coastlon((coastlines.coastlon >= LonLimit(1,1) & coastlines.coastlon <= LonLimit(1,2)),:);
However, I am unable to divide it each segmentwise, considering linear distance interval of say, 50 km and identify latitude-longitudes within those segments. Any help in this regard is deeply appreciable.

답변 (1개)

Walter Roberson
Walter Roberson 2025년 2월 6일

0 개 추천

See John D'Errico's File Exchange contribution interparc https://www.mathworks.com/matlabcentral/fileexchange/34874-interparc which is designed for interpolating curves at fixed distances traveled.

댓글 수: 6

Poulomi
Poulomi 2025년 2월 6일
but how to implement this function for the coastline bounded by the fixed latitude and longitude bounds?
t = linspace(0,1,250);
pt = interparc(t, X, Y);
Poulomi
Poulomi 2025년 2월 7일
Thanks, but still it is not clear how can I divide the coastline bounded by certain latitude, longitude box, with this function at a linear increment of 50 km.

Assuming that the distances are such that Euclidean approximation is good enough, and assuming that the coast is continuous:

You can calculate the total distance along the coast using

 D = sum(sqrt(diff(X).^2 + diff(Y).^2))

This allows you to calculate the fractional increment such that the adjacent distance is 50 km.

I said "assuming that the coast is continuous". It appears that works for your situation. It would be a nuisance if it did not, partly because it would not be defined what distance should be measured over any jump in the coast.

Looking at the map, I am not certain that using Euclidean approximation of the total distance would be good enough for your purposes. On the other hand, interparc expects Euclidean coordinates I expect.

You might need to convert map coordinates to some kind of linear coordinates before using interparc

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터 및 File Exchange에서 Earth and Planetary Science에 대해 자세히 알아보기

제품

릴리스

R2024a

질문:

2025년 2월 6일

댓글:

2025년 2월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by