地図画像の上に色変化のあるデータ点を描く方法はありますか?
4 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2017 年 2 月 16 日
編集済み: MathWorks Support Team
2017 年 2 月 17 日
地図画像の上に色変化のあるデータ点を描く方法を教えてください。
特に、地図画像を地図の軸に表示する方法と、同じ色ではなく標高などに応じた色を表示できるようにしたいです。どのような関数を使えばいいか、教えてください。
採用された回答
MathWorks Support Team
2017 年 2 月 17 日
編集済み: MathWorks Support Team
2017 年 2 月 17 日
地図画像を表示するには geoshow 関数を使用します。ただし、geoshow 関数を実行する際には、画像を配置するための軸 (axis) を指定する必要があります。その軸は、worldmap 関数を使って作成することができます。
以下の例では、<http://gis-lab.info/ GIS-LAB.info> のサイトにある WMS サーバ(<http://irs.gis-lab.info/>)を使用して画像を取得しています。
% 緯度経度の定義
latlim = [35.668 35.678];
lonlim = [139.728, 139.738];
% WMS server から画像の取得
url = 'http://irs.gis-lab.info/';
info = wmsinfo(url);
layers = info.Layer;
osm = refine(layers, 'osm', 'SearchField', 'layername');
[A,R] = wmsread(osm,'Latlim',latlim,'Lonlim',lonlim);
% 地図描画
ax = worldmap(latlim, lonlim);
h = geoshow(ax, A, R);
また、点ごとに色を変えたい場合、通常地図データを描画するためによく使われる geoshow, mapshow, plotm ではなく、scatterm を使用します。
% 描画するデータ点の定義
circle_size = 100;
lat = [35.6702 35.6767 35.6688 35.6723 35.6695];
lon = [139.7290 139.7356 139.7372 139.7345 139.7338];
marker_color = [150 20 100 200 180];
% 地図上に描画
scatterm(ax, lat, lon, circle_size, marker_color, 'filled')
colorbar
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Map Display についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!