[R-sig-Geo] Elevation profiles

Forrest Stevens r-sig-geo at forreststevens.com
Mon Jan 25 15:51:46 CET 2016


Hey Allie, long time, hope things are going well!

Coincidentally I was working on something for a student of mine to do this
so I'll throw my two bits in. Starting from two points which specify a line
perpendicular to your swath and separated by the distance of your swath
width, you can create a series of lines parallel to the starting line
extending for as long as you want your swath.  Then, the most efficient way
to create multiple, touching polygons is to buffer those lines to a
distance that's half the width of the distance between your parallel
lines.  Using these polygons you can then aggregate statistics for your
underlying DEM.

I've posted some reproducible code that does something similar, however, it
creates angled transects along an E-W line.  It should be relatively easy
to change the calculated line end points to use changing Y values, keeping
the lines oriented along your swath instead of the E-W orientation.

https://github.com/ForrestStevens/Scratch/blob/master/swath_slices.R

Hopefully this gives you something to go on, but I'd be interested to know
if Roger or anyone else has a simpler solution!

Sincerely,
Forrest

On Mon, Jan 25, 2016 at 8:39 AM chris english <englishchristophera at gmail.com>
wrote:

> Allie,
>
> Perhaps rgoes, gBuffer (which wouldn't necessarily fit your arbitrary width
> criteria but otherwise serve, (perhaps selecting your widths from a random
> distribution multiplier)) your polyline and lay it over your DEM, something
> like a swath transect? Sorry, just kinda thinking out loud. Or reading
> again, do you really want to lay something like an arbitrary polygon on
> there that contains the 10 pts?
>
> Chris
> And you ask, so how would you do that. Indeed.
>
>
>
> On Mon, Jan 25, 2016 at 1:58 PM, Alexander Shenkin <ashenkin at ufl.edu>
> wrote:
>
> > Hello All,
> >
> > I've done this in ArcMAP, but further requirements are making it harder
> to
> > do it there, so was hoping I can do it in R.
> >
> > I have SRTM DEM rasters, and want to create an elevation profile. This
> > profile is drawn along a polyline connecting 10 GPS points.  I was able
> to
> > do all that in arcmap.  Now, however, I want to create the profile from
> an
> > average elevation drawn from a swath of arbitrary width, rather than by
> > just a line.  I hope this makes sense.
> >
> > Apologies for not including reproducible code here - I'm hoping there's
> > enough here to point me in a direction in terms of packages and
> algorithms
> > regardless.  Thanks in advance.
> >
> > Allie
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > R-sig-Geo at r-project.org
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list