Convert Between Geographic and Intrinsic Coordinates

You can access and manipulate gridded geodata using either geographic or intrinsic raster coordinates. Use the russia.mat file to explore this. The north, south, east, and west limits of the mapped area can be determined as follows:

russia = load('russia','map','refvec');
R = refvecToGeoRasterReference(russia.refvec, size(russia.map));
R.LatitudeLimits
R.LongitudeLimits
ans =

    35    80


ans =

    15   190

Display a map of Russia:

figure('Color','white')
worldmap(R.LatitudeLimits,R.LongitudeLimits)
cmap = jet(4);
geoshow(russia.map,cmap,R)

The map.rasterref.GeographicCellsReference.intrinsicToGeographic method can be used to retrieve the geographic coordinates at the center of a given grid cell. For example, consider the cell in row 23, column 79. In intrinsic raster coordinates, the center of this cell is located at:

xIntrinsic = 79;
yIntrinsic = 23;

This corresponds to the following location in latitude-longitude, obtained via the intrinsicToGeographic method:

[lat, lon] = intrinsicToGeographic(R, xIntrinsic, yIntrinsic)

Your output appears like this:

lat =

   39.5000


lon =

   30.7000

The geographicToIntrinsic method does the reverse, converting from latitude-longitude to intrinsic x and y:

[xIntrinsic, yIntrinsic] = geographicToIntrinsic(R, lat, lon)

Your output appears as follows:

xIntrinsic =

    79


yIntrinsic =

    23