Are these in projected coordinates with the same units?  (They probably
should be if they aren't..)  But if so then you can just use the
Pythagorean theorem, assuming two points, distance in 3D space is:

dist3d <- sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)

Example:

> x1=0
> y1=0
> z1=0
> x2=1
> y2=2
> z2=3
> dist3d <- sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)
> sqrt(14)
[1] 3.741657
> dist3d
[1] 3.741657

Now, obviously this doesn't take into consideration overland distance along
the surface (e.g. you could calculate a distance through a mountain if the
elevation rises between the two points).  If you need this type of
fidelity, either straight-line or contour-line/least-cost-elevation-change
distances, then you'll need to look into something more complex. The
gdistance package seems like a likely candidate, or you could get really
fancy (e.g. creating a 3D mesh, via TIN creation or the like) and calculate
surface distances in ArcGIS or GRASS.

Hope this helps in some small way,
Forrest

--
Forrest R. Stevens
Ph.D. Candidate, QSE3 IGERT Fellow
Department of Geography
Land Use and Environmental Change Institute
University of Florida
www.clas.ufl.edu/users/forrest


On Fri, Nov 29, 2013 at 5:27 AM, John Tellat <john.tellat@gmail.com> wrote:

> Hi,
>
> I´m currently dealing with telemetry data combined with altitude
> measurements in a mountainous area with many valleys.
>
> I want to compute the straight distance between points but taking into
> account the elevation which is likely to extend the distance.
> Any idea on how to compute the "real distance" based on elevation raster
> data?
>
> Thanks!
>
>         [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>

	[[alternative HTML version deleted]]

