Main Content


Convert from longitude to intrinsic x coordinates



xIntrinsic = longitudeToIntrinsicX(R,lon) returns the x-coordinate in the intrinsic coordinate system corresponding to longitude lon in the geographic coordinate system, based on the relationship defined by geographic raster R.


collapse all

Import a GeoTIFF image [1] of the Gulf of Mexico as an array and a GeographicCellsReference object. Find the intrinsic x-coordinate corresponding to a longitude of -90.0226 degrees.

[Z,R] = readgeoraster('katrina.tif');
xIntrinsic = longitudeToIntrinsicX(R,-90.0226)
xIntrinsic = 341.0619

The result means that coordinates with a longitude of -90.0226 degrees fall between columns 341 and 342 of the posting points.

[1] The image used in this example is derived from imagery obtained from the NASA Goddard Scientific Visualization Studio (SVS) Image Server.

Input Arguments

collapse all

Geographic raster, specified as a GeographicCellsReference or GeographicPostingsReference object.

Longitude coordinates, specified as a numeric array. lon coordinates can be outside the bounds of the raster R.

Data Types: single | double

Output Arguments

collapse all

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

When lon(k) is outside the bounds of raster R, xIntrinsic(k) is extrapolated in the intrinsic coordinate system. Elements of lon with value NaN map to NaN in xIntrinsic.

Data Types: double

Version History

Introduced in R2013b