3

I was trying to make a raster from an dataset (https://www.dropbox.com/s/jsm1x06lnzfbqty/data.csv?dl=0) code:

inter1= read.table("c:/data.csv", header=TRUE)
#convert to spatial points
coordinates(inter1) = ~long + lat
#gridify your set of points
gridded(inter1) <- TRUE 
#convert to raster
r <- raster(inter1)
#plot
plot(r)

I get as an error:

suggested tolerance minimum: 0.0487805 
Error in points2grid(points, tolerance, round) : 
  dimension 1 : coordinate intervals are not constant

What is the problem?

  • 3
    I don't know for sure, but I think you probably have a set of irregularly spaced points. That is, your points deviate from a regular spacing by more than the allowable tolerance. You need to interpolate the points onto a grid. – WhiteboxDev Oct 11 '14 at 16:12
4

I think that the script is expecting to read in a set of regularly spaced points, with deviations less than the minimum tolerance. Your set of points is actually quite irregularly spaced:

enter image description here

You can see that there are large missing areas. Also, if you zoom in closer, you'll see that even at the fine scale, the points are not regularly spaced on a grid structure:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.