[GRASSLIST:144] Re: Considering replacing ESRI
Glynn Clements
glynn.clements at virgin.net
Thu May 22 17:13:31 EDT 2003
David Finlayson wrote:
> That is similar to what I eventually did, though I hesitate to admit
> that I dumped the grid from Grass, did the rotation in ArcInfo and then
> brought it back into Grass for my final processing.
>
> The problem with this approach is that my program can only be ported to
> another user if they have all of the dependent programs (ArcInfo in this
> case, or the Gimp, or Image magic etc).
Another option for rotation would be convert to a sites list with
r.to.sites, rotate the sites list, then import the result with
s.surf.rst or s.to.rast (depending upon whether it's meaningful to
interpolate the data).
The main problem with rotating a raster directly is that it can't be
done a row at a time; you would have to read the whole thing into
memory.
> I think that this is the unspoken down side to the Unix paradigm. You
> wind up with this spaghetti of dependencies that make it impossible to
> hand a script over to a buddy on their machine.
>
> It would be better if I learned enough C to get my rotation program
> added to Grass.
The quickest way to do this would be to modify r.proj, replacing
pj_do_proj() with an affine transformation (and discarding the other
PROJ stuff).
> Or better yet, write a Python interface to the C API so
> that I could read and write to the rasters directly from Python!
If you want to get the raw cell values without using C, you can read
the output from "r.stats -1 ...".
--
Glynn Clements <glynn.clements at virgin.net>
More information about the grass-user
mailing list