Skip to content
Prev 2218 / 29559 Next

distmap

Dear sig-geos,

I have to calculate a distmap (that is, a map
in which the value of each cell is the distance
from the cell to a given object) for a set of polygons.
It seems to me that distmap.owin in spatstat would do it
fine, but distmap.owin does not accept objects
imported from shp vectors via readOGR. distmap.owin requires
type "polygonal" and readOGR yields class 'SpatialPolygonsDataFrame'
Is there any way to cast or convert from 'SpatialPolygonsDataFrame'
to "polygonal" or an alternative function to calculate the distances
to the boundaries of the polygons?

Thanks

Agus