worldmap文档格式.docx
《worldmap文档格式.docx》由会员分享,可在线阅读,更多相关《worldmap文档格式.docx(23页珍藏版)》请在冰豆网上搜索。
ora3-by-2referencingmatrixthattransformsrasterrowandcolumnindicesto/fromgeographiccoordinatesaccordingto:
[lonlat]=[rowcol1]*R
IfRisareferencingmatrix,itmustdefinea(non-rotational,non-skewed)relationshipinwhicheachcolumnofthedatagridfallsalongameridianandeachrowfallsalongaparallel.
h=worldmap(...)returnsthehandleofthemapaxes.
Forcylindricalprojections,worldmapusestightmapsettheaxislimitstightaroundthemap.Ifyouchangetheprojection,orjustwantmorewhitespacearoundthemapframe,usetightmapagainoraxisauto.
Examples
Example1
Setupaworldmapanddrawcoarsecoastlines:
worldmap('
)
loadcoast
plotm(lat,long)
Example2
Setupworldmapwithlandareas,majorlakesandrivers,andcitiesandpopulatedplaces:
ax=worldmap('
);
setm(ax,'
Origin'
[01800])
land=shaperead('
landareas'
UseGeoCoords'
true);
geoshow(ax,land,'
FaceColor'
[0.50.70.5])
lakes=shaperead('
worldlakes'
geoshow(lakes,'
blue'
rivers=shaperead('
worldrivers'
geoshow(rivers,'
Color'
cities=shaperead('
worldcities'
geoshow(cities,'
Marker'
.'
red'
Example3
DrawamapofAntarctica:
antarctica'
antarctica=shaperead('
true,...
'
Selector'
{@(name)strcmp(name,'
Antarctica'
),'
Name'
});
patchm(antarctica.Lat,antarctica.Lon,[0.510.5])
Example4
DrawamapofAfricaandIndiawithmajorcitiesandpopulatedplaces:
worldmap({'
Africa'
'
India'
})
landareas.shp'
geoshow(land,'
[0.150.50.15])
Example5
MakeamapofthegeoidoverSouthAmericaandthecentralPacific:
worldmap([-5050],[160-30])
loadgeoid
geoshow(geoid,geoidrefvec,'
DisplayType'
texturemap'
geoshow(lat,long)
Example6
DrawamapofterrainelevationsinKorea:
loadkorea
h=worldmap(map,refvec);
set(h,'
Visible'
off'
geoshow(h,map,refvec,'
colormap(demcmap(map))
Example7
MakeamapoftheUnitedStatesofAmerica,coloringstatepolygons:
USA'
geoshow(ax,lat,long,...
'
polygon'
[.45.60.30])
states=shaperead('
usastatelo'
faceColors=makesymbolspec('
Polygon'
...
{'
INDEX'
[1numel(states)],'
...
polcmap(numel(states))});
%NOTE-colorsarerandom
geoshow(ax,states,'
SymbolSpec'
faceColors)
Example8
韩国朝鲜地图
usamap
ConstructmapaxesforUnitedStatesofAmerica
usamapstate
usamap(state)
usamap'
conus'
usamap('
usamap(latlim,lonlim)
usamap(Z,R)
h=usamap(...)
h=usamap('
all'
allequal'
usamapstateorusamap(state)constructsanemptymapaxeswithaLambertConformalConicprojectionandmaplimitscoveringaU.S.stateorgroupofstatesspecifiedbyinputstate.statemaybeastringoracellarrayofstrings,whereeachstringcontainsthenameofastateor'
DistrictofColumbia'
.Alternatively,statemaybeastandardtwo-letterU.S.PostalServiceabbreviation.Themapaxesiscreatedinthecurrentaxesandtheaxislimitsaresettightaroundthemapframe.
orusamap('
)constructsanemptymapaxesfortheconterminous48states(i.e.excludingAlaskaandHawaii).
usamapwithnoargumentsasksyoutochoosefromamenuofstatenamesplus'
usamap(latlim,lonlim)constructsanemptyLambertConformalmapaxesforaregionoftheU.S.definedbyitslatitudeandlongitudelimitsindegrees.latlimandlonlimaretwo-elementvectorsoftheform[southern_limitnorthern_limit]and[western_limiteastern_limit],respectively.
usamap(Z,R)derivesthemaplimitsfromtheextentofaregulardatagridgeoreferencedbyR.Riseithera1-by-3vectorcontainingelements:
h=usamap(...)returnsthehandleofthemapaxes.
)constructsthreeemptyaxes,insetwithinasinglefigure,fortheconterminousstates,Alaska,andHawaii,respectively,usingprojectionparameterssuggestedbytheU.S.GeologicalSurvey.Thehandlesforthethreemapaxesarereturnedinh.h
(1)isfortheconterminousstates,h
(2)isforAlaska,andh(3)isforHawaii.
)constructsthemapaxeswithAlaskaandHawaiiatthesamescaleastheconterminousstates.
Remarks
usamapusestightmapsettheaxislimitstightaroundthemap.Ifyouchangetheprojection,orjustwantmorewhitespacearoundthemapframe,usetightmapagainoraxisauto.
axes(h(n)),wheren=1,2,or3,makesthedesiredaxescurrent.
set(h,'
on'
)makestheaxesvisible.
ButtonDownFcn'
selectmoveresize'
)allowsinteractiverepositioningoftheaxes.set(h,'
uimaptbx'
)restorestheMappingToolboxinterfaces.
axesscale(h
(1))resizestheaxescontainingAlaskaandHawaiitothesamescaleastheconterminousstates.
MakeamapofAlabamaonly:
Alabama'
alabamahi=shaperead('
usastatehi'
{@(name)strcmpi(name,'
geoshow(alabamahi,'
[0.31.0,0.675])
textm(alabamahi.LabelLat,alabamahi.LabelLon,alabamahi.Name,...
HorizontalAlignment'
center'
MaparegionextendingfromCaliforniatoMontana:
figure;
ax=usamap({'
CA'
MT'
set(ax,'
latlim=getm(ax,'
MapLatLimit'
lonlim=getm(ax,'
MapLonLimit'
true,'
BoundingBox'
[lonlim'
latlim'
]);
[0.50.51])
lat=[states.LabelLat];
lon=[states.LabelLon];
tf=ingeoquad(lat,lon,latlim,lonlim);
textm(lat(tf),lon(tf),{states(tf).Name},...
MaptheConterminousUnitedStateswithadifferentfillcolorforeachstate:
ax=usamap('
{@(name)~any(strcmp(name,{'
Alaska'
Hawaii'
})),'
...
%NOTE-colorsarerandom
framemoff;
gridmoff;
mlabeloff;
plabeloff
MapoftheUSAwithseparateaxesforAlaskaandHawaii:
names={states.Name};
indexHawaii=strmatch('
names);
indexAlaska=strmatch('
indexConus=1:
numel(states);
indexConus(indexHawaii)=[];
indexConus(indexAlaska)=[];
stateColor=[0.510.5];
geoshow(ax
(1),states(indexConus),'
stateColor)
geoshow(ax
(2),states(indexAlaska),'
geoshow(ax(3),states(indexHawaii),'
fork=1:
3
setm(ax(k),'
Frame'
Grid'
ParallelLabel'
MeridianLabel'
end
usamapwithnoargumentsasksyoutochoosefromamenuofs