www.gusucode.com > map 案例源码 matlab代码程序 > map/OverlayPolygonAndLinesOnOrthophotoExample.m

    %% Overlay Polygon and Lines on Orthophoto
% 
%%
% Read orthophoto.

% Copyright 2015 The MathWorks, Inc.

[ortho, cmap] = imread('concord_ortho_w.tif');
%%
% Read vector data.
R = worldfileread('concord_ortho_w.tfw', 'planar', size(ortho));
%%
% Display the orthophoto with the vector data.
figure
mapshow(ortho,cmap,R)
%%
% Read polygon vector data representing a pond with three islands (feature
% 14 in the file). Note that the islands are visible in the orthophoto
% throught three "holes" in the pond polygon.
pond = shaperead('concord_hydro_area.shp', 'RecordNumbers', 14);
mapshow(pond, 'FaceColor', [0.3 0.5 1], 'EdgeColor', 'black')
%%
% Overlay road vector data in the same figure.
mapshow('concord_roads.shp', 'Color', 'red', 'LineWidth', 1);