Products & Services Solutions Academia Support User Community Company

Learn more about Mapping Toolbox   

maptrimp - Trim polygons to latitude-longitude quadrangle

Syntax

[latTrimmed,lonTrimmed] = maptrimp(lat,lon,latlim,lonlim)

Description

[latTrimmed,lonTrimmed] = maptrimp(lat,lon,latlim,lonlim) trims the polygons in lat and lon to the quadrangle specified by latlim and lonlim. latlim and lonlim are two-element vectors, defining the latitude and longitude limits respectively. lat and lon must be vectors that represent valid polygons.

Remarks

maptrimp conditions the longitude limits such that:

Example

Display a world map of coastline data, trim the dataset to a specific geographic area, and display a map of this trimmed data.

coast = load('coast.mat');
figure
mapshow(coast.long, coast.lat, 'DisplayType', 'polygon');

Original Map

latlim = [-50 50];
lonlim = [-100 50];
[latTrimmed, lonTrimmed] = maptrimp(coast.lat, coast.long, ...
   latlim, lonlim);
figure
mapshow(lonTrimmed, latTrimmed, 'DisplayType', 'polygon');

Map with Trimmed Data

See Also

maptriml, maptrims

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS