Mapping Toolbox | ![]() ![]() |
Trim surface regular matrix map data to a specified region
Syntax
[submap,sublegend] = maptrims(map,maplegend,latlim,lonlim) [submap,sublegend] = maptrims(map,maplegend,latlim,lonlim,scale)
Description
This command selects a portion of a larger matrix map defined by a latitude-longitude quadrangle.
[submap,sublegend] = maptrims(map,maplegend,latlim,lonlim) returns the subset of the input regular matrix map
between the latitude and longitude limits, in degrees, defined by the two-element vectors latlim
and lonlim.
maplegend
is the map legend vector of the input matrix map; sublegend
is the map legend vector of the output matrix map.
[submap,sublegend] = maptrims(map,maplegend,latlim,lonlim,scale) is a means of further reducing the size of the output matrix. The cells-per-degree scale of the original matrix is given by the first element of maplegend
. The desired cells-per-degree scale in the output map is given by scale
, which must equally divide maplegend(1)
. For example, if maplegend(1)
were 20 (cells per degree), then scale
could be 1, 2, 4, 5, 10 or 20.
The reduced matrix is created using resizem
with a 'nearest'
interpolation method.
Examples
load topo [submap,sublegend] = maptrims(topo,topolegend,... [80.25 85.3],[165.2 170.7]) submap = -2826 -2810 -2802 -2793 -2915 -2913 -2905 -2884 -3192 -3186 -3165 -3122 -3399 -3324 -3273 -3214 sublegend = 1 85 166
The upper left corner of the map may differ slightly from that of the requested region. maptrims
uses the corner coordinates of the first cell inside the limits.
See Also
map legend vector |
Data structure for describing regular matrix maps |
maptriml |
Trim line vector map data to specified region |
maptrimp |
Trim patch map data to specified region |
resizem |
Resize a matrix map |
![]() | maptrimp | maskm | ![]() |