[GRASSLIST:10775] Re: How to calculate maximum & minimum elevation across a raster?
Matthew Perry
perrygeo at gmail.com
Mon Mar 6 15:39:55 EST 2006
Michael, if you've got R installed, you can use a combination of
r.profile and R to calculate this (and to generate profile graphs if
needed).
=================
r.profile input=pcdem output=line.profile profile=x1,y1,x2,y2
# csvify the output by adding header row and replacing spaces with commas
echo "distance,elevation" > profile.csv
sed "s/ /,/g" line.profile >> profile.csv
#Plot the profile in R and calculate min and max elevations:
R
> x <- read.csv('profile.csv')
> plot(x,type='l',main='Elevation Profile')
> min(x$elevation)
[1] 123.4588
> max(x$elevation)
[1] 551.2437
==================
- Matt
On 3/6/06, Ian MacMillan <Ian.MacMillan at pomona.edu> wrote:
> Michael, I am sure you have already thought of this, but have you tried
> to use r.profile? This would work if you know the two endpoints. If
> you don't know the endpoints, but are trying to calculate the general
> case between a point and an area, doesn't r.sun deal with this somehow?
> I am not superfamiliar with it, but that would be where I would start.
>
> G'luck,
> Ian
>
> On Mar 5, 2006, at 11:20 PM, Michael Barton wrote:
>
> > I need to calculate maximum and minimum elevation between any point on
> > a landscape and a coastline. I can get total, cumulative elevation,
> > but can't figure out how to get maximum or minimum. Any ideas?
> >
> > Michael
> > __________________________________________
> > Michael Barton, Professor of Anthropology
> > School of Human Evolution and Social Change
> > Arizona State University
> > Tempe, AZ 85287-2402
> >
> > phone: 480-965-6213
> > fax: 480-965-7671
> > www: http://www.public.asu.edu/~cmbarton
> >
> >
> >
> >
> What happens if a big asteroid hits Earth? Judging from realistic
> simulations involving a sledge hammer and a common laboratory frog, we
> can assume it will be pretty bad.
> - Dave Barry
>
>
> -------------------------------------------------------------
> This message has been scanned by Postini anti-virus software.
>
>
--
Matt Perry
perrygeo at gmail.com
http://www.perrygeo.net
More information about the grass-user
mailing list