Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

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.

Examples

collapse all

Read coastline data and display it on a map.

load coastlines
figure
mapshow(coastlon,coastlat,'DisplayType','polygon');

Trim the dataset.

latlim = [-50 50];
lonlim = [-100 50];
[latTrimmed,lonTrimmed] = maptrimp(coastlat,coastlon, ...
   latlim, lonlim);

Display the trimmed dataset.

figure
mapshow(lonTrimmed,latTrimmed, 'DisplayType', 'polygon');

More About

collapse all

Tips

maptrimp conditions the longitude limits such that:

  • lonlim(2) always exceeds lonlim(1)

  • lonlim(2) never exceeds lonlim(1) by more than 360

  • lonlim(1) < 180 or lonlim(2) > -180

  • Ensure that if the quadrangle span the Greenwich meridian, then that meridian appears at longitude 0.

See Also

|

Introduced before R2006a

Was this topic helpful?