nnGpos: nearest neighbour index from point matrix to grid

Description Usage Arguments Details Value Author(s)

View source: R/nnGpos.R

Description

Find the nearest neighbour index to a grid from a matrix of point coordinates

Usage

1
nnGpos(G, pos)

Arguments

G

a "gmeta6" object with grid metadata

pos

a two-column matrix with point coordinates

Details

The function assumes pos indicates [east,north] positions. The returned value is a vector indicating, for each row in pos, the nearest index in the grid refers to indexes sorted byrow=TRUE (C-like) starting by the upper-left corner and advancing row by row, from North to South.

Value

A vector

Author(s)

Javier Garcia-Pintado, e-mail: j.garcia-pintado@reading.ac.uk


garciapintado/rDAF documentation built on May 25, 2019, 7:26 p.m.