This is machine translation

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

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


Compute outline of georeferenced image or data grid


[x,y] = mapoutline(R,height,width)
[x,y] = mapoutline(R, sizea)
[x,y] = mapoutline(info)
[x,y] = mapoutline(...,'close')
[lon,lat] = mapoutline(R,...)
outline = mapoutline(...)


[x,y] = mapoutline(R,height,width) computes the outline of a georeferenced image or regular gridded data set in map coordinates. R is either a 3-by-2 referencing matrix defining a 2-dimensional affine transformation from intrinsic pixel coordinates to map coordinates, or a MapCellsReference or MapPostingsReference object. height and width are the image dimensions. x and y are 4-by-1 column vectors containing the map coordinates of the outer corners of the corner pixels, in the following order:

(1,1), (height,1), (height, width), (1, width).

[x,y] = mapoutline(R, sizea) accepts sizea = [height, width, ...] instead of height and width.

[x,y] = mapoutline(info) accepts a scalar struct array with the fields


3-by-2 referencing matrix


Scalar number


Scalar number

[x,y] = mapoutline(...,'close') returns x and y as 5-by-1 vectors, appending the coordinates of the first of the four corners to the end.

[lon,lat] = mapoutline(R,...), where R georeferences pixels to longitude and latitude rather than map coordinates, returns the outline in geographic coordinates. Longitude must precede latitude in the output argument list.

outline = mapoutline(...) returns the corner coordinates in a 4-by-2 or 5-by-2 array.


Draw a red outline delineating the Boston GeoTIFF image, which is referenced to the Massachusetts Mainland State Plane coordinate system with units of survey feet.

info  = geotiffinfo('boston.tif');
[x,y] = mapoutline(info, 'close');
hold on
xlabel('MA Mainland State Plane easting, survey feet')
ylabel('MA Mainland State Plane northing, survey feet')
Draw a black outline delineating a TIFF image of Concord, Massachusetts, while lies roughly 25 km north west of Boston. Convert world file units to survey feet from meters to be consistent with the Boston image.
info  = imfinfo('concord_ortho_w.tif');
R = worldfileread('concord_ortho_w.tfw');
R = R * unitsratio('sf','meter');
[x,y] = mapoutline(R, info.Height, info.Width, 'close');

Introduced before R2006a

Was this topic helpful?