have a look at my blog. i solve the problem using the big memory package.
there are a couple ways to speed it up but you can just download my code.
On Oct 26, 2012 11:46 AM, "Wouter Steenbeek" <WSteenbeek@nscr.nl> wrote:

> I am trying to use the "gDistance" from the "geos" package to calculate
> the Euclidean distance between a large number of points: to be exact, 28000
> points.
>
> I'm doing:
> distance <- gDistance(points.sp)
>
> R doesn't run this on my 32-bit 3Gb RAM machine. The same function works
> on a subset of these points (say the first 400 points I call
> "points1_400.sp"). I think that R doesn't run on this is because gDistance
> keeps a matrix of 28000 * 28000 cells in RAM. With at one byte per cell,
> this amounts to 28000 * 28000 * 8 / (1024 bytes per Kb / 1024 Kb per Mb /
> 1024 Mb per Gb) = almost 6 Gb of RAM is needed.
>
> 1. Is my interpretation of the problem correct?
>
> 2. What would be the best way to tackle this problem? (chop up the
> points.sp into chunks, calculate distances per chunk, and then merge
> matrices together? I'm not sure how I can do that in R. Code examples of
> how to do is is appreciated)
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

