이전에 m_map의 간단한 메뉴얼을 소개 했습니다.
https://hummingstereo.tistory.com/63
[ matlab ] m_map 사용법
1.https://www.eoas.ubc.ca/~rich/map.html 접속 M_Map: A Mapping package for Matlab A mapping package for Matlab You have collected your data, loaded it into Matlab, analyzed everything to death, and now you want to make a simple map showing how it relates
hummingstereo.tistory.com
해당 글의 그림은 육지 영역을 제외한 좌표에서 contour를 그렸기 때문에 해안선 지도가 그려지는 것처럼 보였습니다.
이번에는 m_map에서 국지적이고, 해상도 높은 지도를 그리는 법을 소개합니다.
m_map 명령어 중에 m_gshhs_.. 로 시작하는 함수들이 있습니다.
각 함수 별로 해상도 출력값이 상이하게 차이납니다.
함수명 | full name |
m_gshhs_c | crude |
m_gshhs_l | low |
m_gshhs_i | intermediate |
m_gshhs_h | high |
m_gshhs_f | full |
% 격자 형태 설정
m_proj('project_name','lat',[ latitude limit ],'long',[ longitude limit ],'rect','on'); % 해안선 그리기
m_gshhs_c('patch',[ color RGB ]); % 격자 생성 m_grid('linestyle','line_format','linewidth',2,'tickdir','out','fontsize',6);
|
다음은 각 함수를 한국 전역과 인천 경기만에 적용했을 때 사진입니다.
앞서 설명한 함수 순서 대로 subplot 하여 그림을 그리고
경기만은 google earth에서 같은 지역을 캡처 해서 첨부했습니다.
다음과 같이 m_gshhs_i 부터 해상도가 급격히 좋아지는 것을 볼 수 있습니다.
하지만 경기만 지역의 full 해상도와 google earth 캡쳐 사진을 볼 때, 영종도는 구현되지 않았습니다.
따라서 큰 스케일의 지도를 그리거나, 대략적인 해안선을 그릴 대 사용하면 좋을 듯 합니다.
코드 예시
(형식은 비슷하니 full 해상도의 한국 전역, 경기만 코드 예시만 첨부합니다.)
fig.lat1 = [32.620114 40.995438];
fig.lon1 = [122.906271 130.978774];
fig.lat2 = [36.381475 37.798595];
fig.lon2 = [124.944294 127.396894];
figure(1)
set(gcf,'color','w','Units','Normalized','OuterPosition',[0.1 0.15 .8 .8]);
m_proj('albers equal-area','lat',[fig.lat1(1) fig.lat1(2)],'long',[fig.lon1(1) fig.lon1(2)],'rect','on');
m_gshhs_f('patch',[.7 .9 .7]);
m_grid('linestyle','none','linewidth',2,'tickdir','out','fontsize',11);
title('GSHHS\_F (full)','color','k','fontweight','bold','FontSize',15);
figure(2)
set(gcf,'color','w','Units','Normalized','OuterPosition',[0.1 0.15 .8 .8]);
m_proj('albers equal-area','lat',[fig.lat2(1) fig.lat2(2)],'long',[fig.lon2(1) fig.lon2(2)],'rect','on');
m_gshhs_f('patch',[.7 .9 .7]);
m_grid('linestyle','none','linewidth',2,'tickdir','out','fontsize',11);
title('GSHHS\_F (full)','color','k','fontweight','bold','FontSize',15);
|
'matlab' 카테고리의 다른 글
[ matlab ] 데이터 읽기 방법 (textscan / importdata) (0) | 2023.06.05 |
---|---|
[ matlab ] colorbar (0) | 2023.06.02 |
[ matlab ] table ↔ matrix (0) | 2023.05.03 |
[ matlab ] subplot 활용 (0) | 2023.04.21 |
[ matlab ] 투명 배경 figure 생성 (2) | 2023.04.20 |