Dear Thiemo,

Nice question.


The wind direction/speed would need to be converted into a cost or speed variable. This website explains how:

http://sites.google.com/site/yoavraz2/sailingboatspeedvs.windspeed

Best,

Jacob.



________________________________
 From: "tf@devmag.net" <tf@devmag.net>
To: r-sig-geo@r-project.org 
Sent: Thursday, 8 December 2011, 11:11
Subject: [R-sig-Geo] gdistance: working with vector speed data in two direction

Dear all,

I have the following problem.

I managed to use the gdistance package to give me computations for shortest distances between two ocean points. I am working on a simple 1 degree grid for that and it works fine.

However, now I want to incorporate something slightly more advanced. For each cell of the grid I have a wind vector with its horizontal and its vertical wind component; the units are speeds in meters per second, which can be positive / negative indicating the direction north/ south, east and west.

I have both of them as a raster object.

Similar to the vignette hiking example, I want to compute the fastest way to get from A to B. Imagine that the object that moves from A to B is a sailing boat that wants to exploit the best possible combiantion of winds along all possible paths from A to B.

The data structure for now is as follows:

vertical <- raster(nrows=10, ncols=10)
vertical <- setValues(vertical, runif(10*10, min=-1, max=1) )
horizontal <- raster(nrows=10, ncols=10)
horizontal <- setValues(horizontal, runif(10*10, min=-1, max=1) )

In the hiking example, the direction was either going up or going down which was captured by the sign of the height difference (i.e. the slope).

They key difference here is, that I essentially have "two signs" for both speed direction components.


I am not sure whether this is possible using the gdistance package; I would be happy to hear your thoughts and comments.

Best,
Thiemo

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
	[[alternative HTML version deleted]]

