<< Vectorization/Rasterization functions | Vectorization/Rasterization functions | rec2XY >>

CLaRiNet 0.1 beta >> Vectorization/Rasterization functions > XY2rec

# XY2rec

Returns the record numbers of cells in a georeferenced grid, according to their XY coordinates.

### Calling Sequence

    C = XY2rec ( Header , XY )

### Arguments

Header

  Vector of 7 elements describing the grid georeferencing (as returned by `GetFloatRasterHeader` or `GetFlowDirGridHeader`) : number of columns, number of lines, cellsize, X coordinate of lower-left pixel, Y coordinate of lower-left pixel, NODATA value, convention for positioning the lower-left pixel.

XY

  Matrix with n lines and 2 columns containing the coordinates of the points to be projected on the grid.

C

  Output, vector of length `size(XY,'r')` : corresponding record numbers in the grid defined by the header.

### Description

Returns the record numbers of cells in a georeferenced grid, according to their XY coordinates.

The point with coordinates `(x_i,y_i)` is associated with pixel `(row_i,col_i)` in the grid, i.e. record `rec_i = row_i * ncols + col_i`

### Examples

### See Also

- rec2XY

### Authors

- Nicolas LE MOINE

<< Vectorization/Rasterization functions | Vectorization/Rasterization functions | rec2XY >>