Dear Marcelino

Thank you very much for your suggestion.
I tryed your suggestion, and it worked fine to my problem.
But unfortunately I need to get a polygon-based result, because of the next
steps of my analyses.
If anyone have suggestions of how I can solve the problem of identify the
intersection region of two polygons, I would be very happy.

Kind regards,

miltinho


On 6/10/08, Marcelino de la Cruz <marcelino.delacruz@upm.es> wrote:
>
> An aproximation based on the discretization of the original polygons can be
> accomplished with intersect.owin in spatstat.
> Try this example from intersect.owin:
>
>
>
>    require (spatstat)
>    data(letterR)
>
>    A <- letterR
>    B <- rotate(letterR, 0.2)
>    plot(bounding.box(A,B), main="intersection")
>    w <- intersect.owin(A, B)
>    plot(w, add=TRUE)
>    plot(A, add=TRUE)
>    plot(B, add=TRUE)
>
>
>
> Regards,
>
> Marcelino
>
> At 22:06 09/06/2008, milton ruser wrote:
>
> Dear ALL,
>
> I need to intersect two polygons and generate a thirth object with the
> intersect area/polygon). The sample bellow ilustrate part of the task
> (Thanks Roger!). At the end I plot my two sample polygons, highlighting the
> output that I am looking for (the red region). I know that I can use ArcGis
> or other GIS software to do that. But I think that R could be a very
> flexible solutions.
>
> Kind regards,
>
> Miltinho
> =====================
>
>
> require(maptools)
> my.pol1<-cbind(x=c(3,7,7,3,3),y=c(2,2,6,6,2))
> my.pol2<-cbind(x=c(6,9,9,6,6),y=c(4,4,9,9,4))
>
>
> my.pol1.Sr <http://my.pol1.sr/> <- Polygons(list(Polygon(my.pol1)),
> ID="1")
> my.pol2.Sr <http://my.pol2.sr/> <- Polygons(list(Polygon(my.pol2)),
> ID="2")
>
> my.pols.SpatPol <- SpatialPolygons(list(my.pol1.Sr <http://my.pol1.sr/>,
> my.pol2.Sr <http://my.pol2.sr/>))
>
> rn <- sapply(slot(my.pols.SpatPol, "polygons"), function(x) slot(x, "ID"))
> df <- data.frame(rn=rn, row.names=rn)
> all.pol <- SpatialPolygonsDataFrame(my.pols.SpatPol, data=df)
>
> plot(my.pols.SpatPol, axes=T)
> polygon(x=c(6,7,7,6,6),y=c(4,4,6,6,4), col="red")
>
>          [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> ________________________________
>
> Marcelino de la Cruz Rot
>
> Departamento de  Biología Vegetal
> E.U.T.I. Agrícola
> Universidad Politécnica de Madrid
> 28040-Madrid
> Tel.: 91 336 54 35
> Fax: 91 336 56 56
> marcelino.delacruz@upm.es
> _________________________________

	[[alternative HTML version deleted]]


