Dear List, I have been banging my head on a problem for three days now, so I believe the time has come to look for help. I have a polygon shapefile with an irregular grid and I would like to turn the polygons in the shapefile into tiles to use with "quadratcount" method in spatstat package. I have been coercing back and forth with lists, slots, classes and I got a little lost into trying to turn the coordinates of the shapes into tiles. The final objective is to extract statistics on points falling inside each polygons. The points are a SpatialPointsDataframe class with attributes which will be analysed in each polygon as if the polygons were containers. I hope I have explained clearly and that someone can point towards a method to use for this. PS I am relatively new to R, but it's fantastic. Cheers, -------------------------------------- Francesco Pirotti Dept. Te.S.A.F./CIRGEO University of Padua Viale dell'Universit? 16 I-35020 Legnaro (PD) tel. +39 049 827 2710 fax. +39 049 827 2686 mob. +39 349 55 39 261 @mail francesco.pirotti at unipd.it skypeID francesco197576 http://www.cirgeo.unipd.it/cirgeo/francescopirotti.htm
turning polygons shapefile into quadrats
2 messages · Francesco, Roger Bivand
On Tue, 30 Dec 2008, francesco wrote:
Dear List, I have been banging my head on a problem for three days now, so I believe the time has come to look for help. I have a polygon shapefile with an irregular grid and I would like to turn the polygons in the shapefile into tiles to use with "quadratcount" method in spatstat package. I have been coercing back and forth with lists, slots, classes and I got a little lost into trying to turn the coordinates of the shapes into tiles. The final objective is to extract statistics on points falling inside each polygons. The points are a SpatialPointsDataframe class with attributes which will be analysed in each polygon as if the polygons were containers. I hope I have explained clearly and that someone can point towards a method to use for this.
Not really clear without a simple code example. If you need to find out which points are inside which polygon, use an overlay() method. It isn't clear what quadratcount might have to do with this, so you'll need to explain that. You can also use overlay() methods to find out which grid cells points belong to. Hope this helps, Roger
PS I am relatively new to R, but it's fantastic. Cheers, -------------------------------------- Francesco Pirotti Dept. Te.S.A.F./CIRGEO University of Padua Viale dell'Universit? 16 I-35020 Legnaro (PD) tel. +39 049 827 2710 fax. +39 049 827 2686 mob. +39 349 55 39 261 @mail francesco.pirotti at unipd.it skypeID francesco197576 http://www.cirgeo.unipd.it/cirgeo/francescopirotti.htm
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at 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 at nhh.no