[R] distance by sea
yvan at dragonfly.co.nz
Sun Jun 8 08:23:53 CEST 2014
Tell me if I'm wrong, but I am guessing that you are trying to
calculate the minimum distance between two points, given the presence
of barriers between them. For this problem, I have been using cost
distances. By giving a raster representing the cost of crossing one
cell of the landscape, the minimum distance that minimises the cost of
movement between two locations can be found. If you assign the cells
of a projected raster that represent the sea with a value of 1, and
the cells that represent land with a very high value (or infinite),
the resulting cost distance will be the minimum distance over sea,
without going over land.
I have been using GRASS for this, but cost distances can also be
calculated in R with the gdistance package. But I don't have much
experience with it.
On 8 June 2014 18:00, jwd <jwd at surewest.net> wrote:
> On Thu, 5 Jun 2014 14:58:11 +0200
> Giulia Fassio <giuliafassio at gmail.com> wrote:
>> someone know if it is possible to use R to calculate distance by sea
>> between two geographic coordinates? I have many points in the sea and
>> I want to create a matrix using R of the length of trajectories that
>> pass only trough sea.
> You need to be a great deal more detailed before you are likely to get
> useful advice. Are you trying to track a sea mammal for example? Or
> are you working out the course for a sea vessel to travel?
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Physical address: Level 5, 158 Victoria St, Te Aro, Wellington
Postal address: PO Box 27535, Wellington 6141
More information about the R-help