# pix2map

(To be removed) Convert pixel coordinates to map coordinates

The `pix2map` function will be removed in a future release. Use the `intrinsicToWorld` function instead. For more information, see Compatibility Considerations.

## Syntax

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

## Description

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

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

`[...] = pix2map(R,p)` combines `row` and `col` into a single array `p`. If `row` and `col` are column vectors of length `n`, then `p` should be an `n`-by-2 matrix such that each row `(p(k,:))` specifies the pixel coordinates of a single point. Otherwise, `p` should have size ```[size(row) 2]```, and `p(k1,k2,...,kn,:)` should contain the pixel coordinates of a single point.

## Examples

```% Find the map coordinates for the pixel at (100,50). [X,cmap] = imread('concord_ortho_w.tif'); R = worldfileread('concord_ortho_w.tfw','planar',size(X)); [x,y] = pix2map(R,100,50); ```

## Compatibility Considerations

expand all

Not recommended starting in R2021b