I will read up on how grids are created tomorrow, if you have any usefull
links on how R connects points to form grids and vectors, please send it my
way! Thank you!

On Mon, Aug 31, 2009 at 12:55 AM, Mehdi Khan <mwkhan@ucdavis.edu> wrote:

> For that specific problem, this is what I ended up doing:
>
> wald <- SpatialPixelsDataFrame(coordinates(wald),
> as.data.frame(wald)[,3,drop = FALSE], tolerance = 0.125)
>
> So what does this mean exactly?  that since it wasn't an exact grid, a
> tolerance was specified to "straighten" curves into a grid structure?  I
> appreciate your help, my experience only goes back 8 weeks or so with this
> program.
>
>
> Mehdi Khan
>
>
> On Mon, Aug 31, 2009 at 12:37 AM, Edzer Pebesma <
> edzer.pebesma@uni-muenster.de> wrote:
>
>> I am not sure if I can follow your reasoning. The function
>> SpatialGridDataFrame tries to form a grid from a set of points. In the
>> earlier example output you sent, it seemed that the set of points you
>> had were not exactly on a grid. Look at the following two examples:
>>
>> > library(sp)
>> > pts1 = data.frame(x = rnorm(10),y = rnorm(10), z = rnorm(10))
>> > gridded(pts1) = ~x+y
>> suggested tolerance minimum: 0.758031516672908
>> Error in points2grid(points, tolerance, round, fuzz.tol) :
>>  dimension 1 : coordinate intervals are not constant
>> > pts2 = data.frame(expand.grid(x=1:10,y=1:10),z=rnorm(100))
>> > gridded(pts2) = ~x+y
>> > points2grid(pts2)
>>                   x  y
>> cellcentre.offset  1  1
>> cellsize           1  1
>> cells.dim         10 10
>>
>> It is clear that for pts1 it is complete nonsense to try to find a grid
>> structure, as it is not there. For the second one it is there by
>> construction -- expand.grid does this.
>>
>> For cases where data are almost on a grid, but not exactly (often
>> because of rounding of coordinates that are not round numbers but
>> written to ascii text), points2grid tries to find a useful grid
>> topology, but may fail. You can enlarge its tolerance to help it find
>> one, but no success guaranteed.
>>
>> If you want to compare overlays, you better make sure you have a real
>> and identical grid in both environments (R and ArcGIS), and do the
>> overlay in both. In R, this is done with the overlay method.
>> --
>> Edzer
>>
>> Mehdi Khan wrote:
>> > Hello everyone, I am trying to investigate what the shortcomings may be
>> of
>> > using vectors/ rasters in determining attribute data from one program to
>> > another.  My project has entailed overlaying points on different maps
>> > (vector as well as raster based) and then determining attribute data
>> from
>> > each one and comparing them against one another.
>> >
>> > What would the limitations be in this process?  From what I understand,
>> one
>> > of the limitations is that there are tolerance limits within the program
>> > which are used to assign points from one pixel to another.  I don't
>> fully
>> > understand this concept-- why would one need a tolerance when
>> determining if
>> > a point is within a square or outside of it?
>> >
>> > thank you all for your help!
>> >
>> >       [[alternative HTML version deleted]]
>> >
>> > _______________________________________________
>> > R-sig-Geo mailing list
>> > R-sig-Geo@stat.math.ethz.ch
>> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>> --
>> Edzer Pebesma
>> Institute for Geoinformatics (ifgi), University of Münster
>> Weseler Straße 253, 48151 Münster, Germany. Phone: +49 251
>> 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de/
>> http://www.springer.com/978-0-387-78170-9 e.pebesma@wwu.de
>>
>
>

	[[alternative HTML version deleted]]

