projecting rasters

At 9:01 AM 16/5/95 +0200, Cosyn Bart wrote:

Hello,

Has anyone done any projection conversions on raster files?
If so, I would like to hear how you went about it, it seems
a bit complicated to me.

Hi Steve,
I worked a few months ago on some problems to change from our Belgian
Lambert projection to UTM and vice versa. As far as I know there was no
conversion tool to do so in Grass. The way I solved the problem was by
rectifying the image from one location to another. I used the module
i.rectify ...

Although this may produce an approximate solution, it is NOT the right
method. i.rectify uses an essentially statistical method to perform a
generalised image warp. It is intended for use with imagery where camera
position effects, and lens and media distortions lead to an arbitrary
mis-registration. Projections, on the other hand are precise mathematical
functions and so forward and inverse transformations can be done exactly.
This is the approach used by the GRASS programs v.proj, m.ll2u, etc. It
should be the method used in shifting already-registered rasters from one
projection to another.

The lack of r.proj has been discussed many times on this list in the past
(check the archives). GRASS tools to accomplish it properly do exist,
however, if they are used in the correct combination. The most difficult
step is getting the raster in the destination projection gridded correctly:
since the cell locations in the source projections do not correspond with
required cell locations in the destination projection, some interpolation
method is required. Depending on the nature of the data different methods
should be used - for example, typically nearest-neighbour for categorical
data, or some smooth interpolant for continuous data.

Quoting a previous posting of mine to the list, the general flow would be:

=======
(i) in GRASS in the NEW projection, use r.stats -1gz to generate a list of
desired cell locations. Cell values will not be used so any layer can be
used
(ii) outside of GRASS use awk and Gerry Evenden's proj to convert this to a
site list in the old projection
(iii) in GRASS in the OLD projection use Darrell McCauley's s.sample to
generate a list of values at the positions in this site-list
(iv) edit/awk this so that it can be swallowed by r.in.ascii - a small
program might have to be written to make this quick
(v) in GRASS in the NEW projection run r.in.ascii.

In putting together s.sample, Darrell McCauley has kindly implemented
bilinear, nearest-neighbour and cubic interpolators, and since it works in
the "implicity indexed" raster domain, it will run quick.

I hope that this is clear, and that the important difference between
projections and rectification is also apparent. It does require you to do
a little "programming" here and there, but this is possible because you
understand what is happening (!) and the file formats for GRASS are
published - after all, GRASS is really a research tool and no-one ever
claimed that it was a slick turn-key package. Does this sound a bit
protestant? :wink:

Good luck Simon Cox

___________________________________________________________
Dr Simon Cox __ \
CSIRO Exploration & Mining ,~' L_|\ Australian
39 Fairway, PO Box 437, ;-' \ Geodynamics
Nedlands, WA 6009 Australia ( \ Cooperative
      Phone +61 9 389 8421 + ___ / Research
      Fax +61 9 389 1906 L~~' "\__/ Centre
s.cox@dem.csiro.au W
AGCRC info>> http://www.dem.csiro.au/simon/crc/intro.html
___________________________________________________________

Greetings,

I am looking for a cheap / free plotting package capable of displaying
raster data in a box plot or quantile plot graphic. Preferably, the
display would produce Postscript publication quality output. Other
statistical analysis would be helpful. Anybody know if such a package
exists?

Thanks again-

Steve King
Hydrologist 10159 East 11th St., Suite 300
NOAA, National Weather Service Tulsa, Oklahoma 74128-3050
Arkansas-Red Basin River Forecast Center Off: (918)832-4109
sbk@awips1.abrfc.noaa.gov FAX: (918)832-4101

Stephen B. King (sbk@apwk01g3.abrfc.noaa.gov) writes on 17 May 1995:

I am looking for a cheap / free plotting package capable of displaying
raster data in a box plot or quantile plot graphic. Preferably, the
display would produce Postscript publication quality output. Other
statistical analysis would be helpful. Anybody know if such a package
exists?

you may want to look at gnuplot:
ftp://ftp.dartmouth.edu/pub/gnuplot/gnuplot3.5.tar.Z
FTP by email is available from this host. Send a message to
ftpmail@ftp.Dartmouth.EDU with the word "help" as the text.

There's a Gmakefile (disguised as makefile.g) in the distribution and
a GRASS terminal so that plots can be made to the GRASS monitor (as
well as PostScript, MIF, LaTeX, etc). This makes g.gnuplot.

You may need to write a front-end to coerce [g.]gnuplot to do box-plots.
E.g., see ftp://pasture.ecn.purdue.edu/pub/mccauley/grass/s.probplt.tar.gz
for a front-end to plot sites in a (log-)normal plot. You might check
with comp.graphics.gnuplot to see if anyone has done something similar.

The new version of gnuplot (in beta testing) include gnufit, which
*may* include some useful statistical analysis routines (I know that
it does curve fitting, but I'm not sure what else).

FWIW, gnuplot runs on most every computer/OS that I've ever heard of.

Darrell
--
James Darrell McCauley, PhD http://soils.ecn.purdue.edu/~mccauley/
Dept of Agricultural Engineering mccauley@ecn.purdue.edu
Purdue University tel: 317.494.1198 fax: 317.496.1115