Main Content

geoquadline

Geographic quadrangle bounding multi-part line

Description

[latlim,lonlim] = geoquadline(lat,lon) returns the limits of the tightest possible geographic quadrangle that bounds a line connecting vertices with geographic coordinates specified by lat and lon.

example

Examples

collapse all

Read shape data and then create a bounding box around the line.

brahmaputra = shaperead('worldrivers.shp','Selector', ...
    {@(name) strcmp(name,'Brahmaputra'), 'Name'}, 'UseGeoCoords',true);
[latlim, lonlim] = geoquadline(brahmaputra.Lat, brahmaputra.Lon)
latlim =

   23.8285   30.3831


lonlim =

   81.8971   95.4970

Input Arguments

collapse all

Latitudes along a line, specified as a vector representing an ordered sequences of vertices, in units of degrees. The line may be broken into multiple parts, delimited by values of NaN.

Data Types: single | double

Longitudes along a line, specified as a vector representing an ordered sequences of vertices, in units of degrees. The line may be broken into multiple parts, delimited by values of NaN.

Data Types: single | double

Output Arguments

collapse all

Latitude limits of a geographic quadrangle, returned as a 1-by-2 vector of the form [southern_limit northern_limit], in units of degrees. The elements are in ascending order, and both lie in the closed interval [-90 90].

Longitude limits of a geographic quadrangle, returned as a 1-by-2 vector of the form [western_limit eastern_limit], in units of degrees. The limits are wrapped to the interval [-180 180]. They are not necessarily in numerical ascending order.

Version History

Introduced in R2012b