Products & Services Solutions Academia Support User Community Company

Learn more about Mapping Toolbox   

map2pix - Convert map coordinates to pixel coordinates

Syntax

[row,col] = map2pix(R,x,y)
p = map2pix(R,x,y)
[...] = map2pix(R,s)

Description

[row,col] = map2pix(R,x,y) calculates pixel coordinates row, col from map coordinates x,y. R is a 3-by-2 referencing matrix defining a two-dimensional affine transformation from pixel coordinates to map coordinates. x and y are vectors or arrays of matching size. The outputs row and col have the same size as x and y.

p = map2pix(R,x,y) combines row and col into a single array p. If x and y are column vectors of length n, then p is an n-by-2 matrix and each p(k,:) specifies the pixel coordinates of a single point. Otherwise, p has size [size(row) 2], and p(k1,k2,...,kn,:) contains the pixel coordinates of a single point.

[...] = map2pix(R,s) combines x and y into a single array s. If x and y are column vectors of length n, the s should be an n-by-2 matrix such that each row (s(k,:)) specifies the map coordinates of a single point. Otherwise, s should have size [size(X) 2], and s(k1,k2,...,kn,:) should contain the map coordinates of a single point.

Example

% Find the pixel coordinates for the spatial coordinates 
% (207050, 912900)
R = worldfileread('concord_ortho_w.tfw');
[r,c] = map2pix(R, 207050, 912900);

See Also

latlon2pix, makerefmat, pix2map, worldfileread

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS