Skip to content

Find incircle of a polygon

4 messages · Etienne Bellemare Racine, Roger Bivand

#
On Wed, 22 Apr 2009, Etienne Bellemare Racine wrote:

            
You can read (polygon) shapefiles into SpatialPolygon* objects using 
readShapeSpatial in maptools and readOGR in rgdal. Once there, coerce to 
an owin object with methods in maptools, something like:

x <- readOGR(".", "myshape")
ox <- as(as(x, "SpatialPolygons"), "owin")

should do it, but watch for topology checking in spatstat. Spatstat ships 
with a vignette on using shapefiles, see for an online link:

http://cran.r-project.org/web/packages/spatstat/vignettes/shapefiles.pdf

which is up to date, humourous, and should tell you what you need to know. 
Using the advice there should resolve any topology problems. If you are 
stuck after trying things from there, please follow up on this list.

Hope this helps,

Roger

  
    
#
Thanks Roger it helped me a lot.
Now I would like to iteratively find the incircle in a polygon until a 
certain radii (i.e. as if I was stuffing balls in my polygon, from the 
biggest to the smallest). So I have to subtract that circle to my polygon.
Should I subtract it from my polygon by adding an inside loop (setting 
hole to TRUE, is it that simple) or can I substract it directly from the 
owin object ?

Thanks,
Etienne

Roger Bivand a ?crit :
#
On Wed, 22 Apr 2009, Etienne Bellemare Racine wrote:

            
I guess that others may have ideas here - this is uncharted territory. 
You'd be using gpclib through spatstat or maptools (or PBSmapping) to 
construct a new object with a hole, so trial and error will get you some 
of the way. Ideas, anyone?

Roger