bufferm works differently with the same data sets?
3 ビュー (過去 30 日間)
古いコメントを表示
Faez Alkadi
2021 年 11 月 25 日
編集済み: Faez Alkadi
2021 年 12 月 2 日
I am using bufferm to find buffer arounf letters of a name. The letter are consisting of segments in both clockwise and anti_clockwise. first file with name Name works perfect while the other file named Name_Shifted doesn't.
Both files are attached
Here is what is did for the first file Name:
BufferSize=0.3;
Segments=Name;
%Segments=Name_Shifted;
for L=1:length(Segments(:, 1))
xyz=Segments{L, 1};
xyz1=[xyz;xyz(1,:)]; %To close the segment
xyz2=xyz1;
plot(xyz2(:,1),xyz2(:,2),'color',rand(1,3))
hold on
[x1,y1] = bufferm(xyz1(:,1),xyz1(:,2),BufferSize,'in');
xyz3=[x1,y1];
plot(xyz3(:,1),xyz3(:,2),'Color','k')
hold on
end
and this was the result:
However, Here is what is did for the first file Name_Shifted :
BufferSize=0.3;
%Segments=Name;
Segments=Name_Shifted;
for L=1:length(Segments(:, 1))
xyz=Segments{L, 1};
xyz1=[xyz;xyz(1,:)]; %To close the segment
xyz2=xyz1;
plot(xyz2(:,1),xyz2(:,2),'color',rand(1,3))
hold on
[x1,y1] = bufferm(xyz1(:,1),xyz1(:,2),BufferSize,'in');
xyz3=[x1,y1];
plot(xyz3(:,1),xyz3(:,2),'Color','k')
hold on
end
and this was the result:
0 件のコメント
採用された回答
Harikrishnan Balachandran Nair
2021 年 12 月 1 日
Hi Faiz,
I understand that you are trying to find the buffer zone inside your polygon using the 'bufferm' function. The 'bufferm' function expects the inputs to be in degrees, specifying the latitude and longitude.
However , In the 'Name_Shifted' mat file, i understand that you have shifted all the points in the 'x' and 'y' direction by a value of 200. when these values are given as input to the 'bufferm' function, it is perceived as latitudes and longitudes. This makes the latitude take values which is much more than 90 degree .This is the reason that the results are not as expected.
You can observe the issue by using 'geoplot' instead of 'plot' for plotting these polygons in the geographic co-ordinates.
1 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Earth and Planetary Science についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!