Dear Roger,

I am not sure if I really need to convert my polygons to psp format. 
In fact I have a shapefile with polygons and a pair of points (x0,y0,x1,y1) and what I need is:
  (1) to checkout if the lines defined by (x0,y0,x1,y1) cross or not any polygon and 
  (2) to identify which polygons were crossed by this line.

I obtained these (x0,y0,x1,y1) coordinates by computing the shortest distance between all polygons pairwise. Now I need to eliminate the "lines" which cross over polygons, and keep only those lines that "link" polygons without a overlap relationship betteen lines and polygons.

I understand that it is a topological question, but I don´t know how to deal it on sp/maptools.

Case you have other ideas, please, let me know.

Regards a lot,

miltinho


----- Mensagem original ----
De: Roger Bivand <Roger.Bivand@nhh.no>
Para: Milton Cezar Ribeiro <milton_ruser@yahoo.com.br>
Cc: r-sig-geo@stat.math.ethz.ch
Enviadas: Segunda-feira, 4 de Fevereiro de 2008 17:03:25
Assunto: Re: [R-sig-Geo] converting shapefile/polygon to psp

On Mon, 4 Feb 2008, Milton Cezar Ribeiro wrote:

> Dear all,
>
> I have some shapefiles which contents are polygons and I would like to 
> convert it to psp (spatstat) format, and after run crossdist.psp. I 
> tryed several times without success. Any idea?

Look at the coercion function in maptools from SpatialPolygons to owin; 
see what needs to be changed to match psp; debug; contribute?

Note that touching polygons fail the topology test in spatstat, as they 
should. Seeing how a psp works should't be hard, it is effectively as 
described in:

https://stat.ethz.ch/pipermail/r-sig-geo/2008-January/003075

for making the lll matrix for distppll(), but as a data frame. You could 
use the marks to record which Polygons/Polygon object the segments belong 
to.

Roger

>
> Miltinho
>
>
>
> para armazenamento!
>
>     [[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
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand@nhh.no



 para armazenamento!

	[[alternative HTML version deleted]]


