Skip to content

Error using SpatialPixelsDataFrame function

3 messages · Francisco Javier Santos Alamillos, Edzer Pebesma, Alexandre Villers

#
Dear R-Geo users,

I am trying to create a SP objects using SpatialPixelsDataFrame. Next I
can see the code:
Error in if (max(object at grid.index) > .NumberOfCells(object at grid))
stop("grid.index max value too large") :
  missing value where TRUE/FALSE needed
In addition: Warning messages:
1: In points2grid(points, tolerance, round) :
  grid has empty column/rows in dimension 1
2: In points2grid(points, tolerance, round) :
  grid topology may be corrupt in dimension 1
3: In points2grid(points, tolerance, round) :
  grid has empty column/rows in dimension 2
4: In points2grid(points, tolerance, round) :
  grid topology may be corrupt in dimension 2
5: In getGridIndex(coordinates(points), grid) : NAs introduced by coercion

What's the problem?

PD: I can not attach data for this because the size exceeds the maximum
allowable.

Thanks in advance.
#
SpatialPixelsDataFrame() tries to figure out how the points you feed it 
with are layed out on a grid structure. Small errors, possibly from 
rounding (you're reading from ascii) may cause it to go slightly wrong, 
and not give you the grid you'd like.

As you probably know the grid at which "coords.txt" is layed out, you 
can create it the right way and pass it to SpatialPixelsDataFrame(). Use 
function GridTopology() for this.
On 02/06/2013 10:45 AM, fsantos at ujaen.es wrote: