Hi,

I want to randomly sample some points within a polygon. After reading the bounday file to the SpatialPolygonsDataFrame, I found that I can only sample them in the rectangular containing the polygon based on bbox.

bound <- readShapePoly("bound.shp") 
plot(bound)
rand.points=rpoint(100, win=as.owin(c(bound@bbox[1],bound@bbox[3],bound@bbox[2],bound@bbox[4])))

Can you help me sample them inside the boundary?
Thanks!

Best,
Shaofei
	[[alternative HTML version deleted]]

