www.gusucode.com > map 案例源码 matlab代码程序 > map/CreatePolygonWithInnerRingExample.m
%% Create Polygon with Inner Ring % %% % Define the latitude and longitude coordinates of the center of the rings. % For this example, the coordinates specify the Eiffel Tower. lat0 = 48.858288; lon0 = 2.294548; %% % Define the inner radius and the outer radius of two small circles. The % examples calls |poly2ccw| to change the direction of the vertex order of % the second circle to counter-clockwise. This change of direction is % needed to define the space between the two circles as a ring-shaped % polygon. outerRadius = .02; innerRadius = .01; [lat1,lon1] = scircle1(lat0,lon0,outerRadius); [lat2,lon2] = scircle1(lat0,lon0,innerRadius); [lon2,lat2] = poly2ccw(lon2,lat2); lat = [lat1; NaN; lat2]; lon = [lon1; NaN; lon2]; alt = 500; %% % Specify name of output KML file and write the data to the file. filename = 'EiffelTower.kml'; kmlwritepolygon(filename,lat,lon,alt, ... 'EdgeColor','g','FaceColor','c','FaceAlpha',.5)