Skip to content

convert Map shapes to logical matrices - for setoperations

1 message · Roger Bivand

#
On Tue, 7 Dec 2004, James Muller wrote:

            
Do you have Shapes from the Map object in lat-long or projected 
coordinates? If they are in projected coordinates, you can generate a grid 
with the standard function expand.grid() and then use a point-in-polygon 
function, such as inside.owin() or similar, on each of the grid points. If 
your shape polygons are in geographical coordinates, then consider 
projecting them, see http://www.remotesensing.org/proj for open source 
projection software. You would then be looking for grid points in A, and 
among those, grid points in B, I think. I don't think I'd want to have to 
generate equal area grid points in lat-long, though you could do that 
using proj inversely.

Roger