Mapping Toolbox | ![]() ![]() |
Trimming Vector Data to a Defined Region
Sometimes vector data may extend beyond the geographic region of interest. For example, if you have world coastline data, but you require a map of Australia only, you may want to create new variables that contain only the data you need. You might also want to trim your data to save memory or to speed up calculations and display.
We can distinguish between trimming line data and patch data. Line data can be trimmed by simply removing points outside the region of interest. Patch data requires a more complicated method to ensure that the patch objects are correctly displayed. For the vector data, two functions are available to achieve this. If the variables are to be treated as line data, the maptriml
command will return variables containing only those points in the defined region. If polygon format must be retained, the maptrimp
command will ensure this, although compared to the line formatted data, the patch-trimmed data will be larger and take more time to compute.
Note
For viewing purposes, trimming the data before display is not required. The vector data is automatically trimmed to the region specified by the frame limits (FLatLimit and FLonLimit map axes properties) for azimuthal projections and frame or map limits (MapLatLimit and MapLonLimit map axes properties) for nonazimuthal projections. The trimming is done internally in the display routine, so the original data remains intact. For further information on trimming geographic vector data, see Map Axes of this document, along with the reference pages for the trimming functions in the online Mapping Toolbox reference documentation,
|
Load the coast
MAT-file, and trim the vector data to a region centered on Australia:
load coast whos
|
|
|
|
|
|
|
|
lat |
9589x1 |
76712 |
|
long |
9589x1 |
76712 |
|
![]() | Buffer Zones | Simplifying Vector Data | ![]() |