Main Content

latitudeToIntrinsicY

Convert from latitude to intrinsic y coordinates

Description

yIntrinsic = latitudeToIntrinsicY(R,lat) returns the y-coordinate in the intrinsic coordinate system corresponding to latitude lat in the geographic coordinate system, based on the relationship defined by geographic raster R.

example

Examples

collapse all

Import elevation data [1] for a region in Colorado as an array and a GeographicPostingsReference object. Find the intrinsic y-coordinate corresponding to a latitude of 39.9539 degrees.

[Z,R] = readgeoraster('n39_w106_3arc_v2.dt1');
yIntrinsic = latitudeToIntrinsicY(R,39.9539)
yIntrinsic = 
56.3200

The result means that coordinates with a latitude of 39.9539 degrees fall between rows 56 and 57 of the posting points.

[1] The elevation data used in this example is from the U.S. Geological Survey.

Input Arguments

collapse all

Geographic raster, specified as a GeographicCellsReference or GeographicPostingsReference object.

Latitude coordinates, specified as a numeric array. Valid values of lat are in the range [-90, 90] degrees. lat coordinates can be outside the bounds of the raster R.

Data Types: single | double

Output Arguments

collapse all

y-coordinates in intrinsic coordinate system, returned as a numeric array. yIntrinsic is the same size as lat.

When a point has valid latitude outside the bounds of raster R, yIntrinsic(k) is extrapolated in the intrinsic coordinate system. When lat(k) is outside the range [-90, 90] degrees, or has a value of NaN, the corresponding value yIntrinsic(k) is set to NaN.

Data Types: double

Version History

Introduced in R2013b