Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

geoquadpt

Geographic quadrangle bounding scattered points

Syntax

  • [latlim,lonlim] = geoquadpt(lat,lon)
    example

Description

example

[latlim,lonlim] = geoquadpt(lat,lon) returns the limits of the tightest possible geographic quadrangle that bounds a set of points with geographic coordinates lat and lon.

In most cases, tf = ingeoquad(lat,lon,latlim,lonlim) will return true, but tf may be false for points on the edges of the quadrangle, due to round off. tf will also be false for elements of lat that fall outside the interval [-90 90] and elements of lon that are not finite.

Examples

collapse all

In this case the output quadrangle straddles the 180-degree meridian, hence the elements of lonlim are in descending numerical order, although they are ordered from west to east.

Read a set of points and then create a bounding box around the points.

cities = shaperead('worldcities.shp','Selector',{@(name) any(strcmp(name,{'Tokyo','Honolulu'})),'Name'}, 'UseGeoCoords',true);
[latlim,lonlim] = geoquadpt([cities.Lat],[cities.Lon])
latlim =

   21.3178   35.7082


lonlim =

  139.6401 -157.8291

Input Arguments

collapse all

Point latitudes, specified as a vector, matrix, or N-D array, in units of degrees.

Data Types: single | double

Point longitudes, specified as a vector, matrix, or N-D array, in units of degrees.

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.

Introduced in R2012b

Was this topic helpful?