[R-sig-Geo] points-in-polygons calculation

Anne Ghisla a.ghisla at studenti.uninsubria.it
Tue Feb 12 17:06:27 CET 2008


Hi all,

during a spatial analysis I need to compute a point-in-polygon
calculation, and I chose findPolys() in PBSmapping package.

For the moment the script is built as follows:
- import the polygon shapefile with rgdal
- import the point shapefile with PBSmapping
- nested for cycles that
  - isolate each polygon (or region) through a superkey on the
attributes in data slot. The selected element is a homerange. It's then
converted in a PolySet, for next step
  - finds which points fall inside the homerange with findPolys()
  - picks up a defined value among the attributes of points and computes
mean of all values of the selected points, then writes it in a new
column of the attribute table

Can the for cycle be based on a unique key like PolygonsID? Among the
methods for sp classes I didn't find it. I found functions like
getPolygonsIDSlot but they have not to be used directly.

Any suggestions?

thank you in advance

Anne Ghisla
Università degli Studi dell'Insubria, Varese
-- 


0< ascii ribbon campaign - stop html mail - http://www.asciiribbon.org
-----------------------------------------------------------
Please consider the environment before printing this email
-----------------------------------------------------------
Per favore non mandatemi allegati in formati proprietari
Please do not send attachments in proprietary formats
(Word, Excel, PowerPoint, etc.)
Meglio usare formati standaridzzati e documentati
Better use standard open formats
(.odt, .txt, .html, .pdf, .shp, dump SQL)
http://www.gnu.org/philosophy/no-word-attachments.html
Standard UNI CEI ISO/IEC 26300:2007
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa ? una parte del messaggio	firmata digitalmente
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20080212/9125291c/attachment.bin>


More information about the R-sig-Geo mailing list