Skip to content
Prev 33516 / 398513 Next

finding contours in a matrix

On Wed, 18 Jun 2003, Douglas Beare wrote:

            
This is a different question to the "can I retrieve a contour line from 
contour()" - it presupposes that we have the line, but asks which cells of 
the array are intersected by the line, is that right? It could also be 
used to interrogate any other image/raster layer for the same area, not 
just depth. Polygon clipping is available in the gcplib package, but that 
may be overkill. If the (contour) line(s) can be converted into sequences 
of points closer together than the raster resolution, it should be 
possible to identify the raster cells they belong to (row and column 
numbers). If this was GIS data, it might be easier to do the overlay 
operation there, especially if you need a buffer around the line.

Roger