Calculate Wind Fetch

Wind fetch is the unobstructed length of water over which wind can blow from a certain direction. The wind fetch is typically calculated for many directions around the compass rose for a given location, which can then be incorporated into a larger model (such as the InVEST coastal vulnerability model; < http://data.naturalcapitalproject.org/invest-releases/documentation/2_2_0/coastal_vulnerability.html>), or simply averaged for a reasonable measure of the overall wind exposure for a specific marine location. The process of calculating wind fetch can be extremely time-consuming and tedious, particularly if a large number of fetch vectors are required at many locations. The 'fetchR' package calculates wind fetch and summarises the information efficiently. There are also plot methods to help visualise the wind exposure at the various locations, and methods to output the fetch vectors to a KML file for further investigation.


Build Status CRAN_Status_Badge

Wind fetch is an important measurement in coastal applications. It provides a measurement for the unobstructed length of water over which wind from a certain direction can blow over. The higher the wind fetch from a certain direction, the more energy is imparted onto the surface of the water resulting in a larger sea state. Therefore, the larger the fetch, the larger the exposure to wind and the more likely the site experiences larger sea states.

Why fetchR?

Averaging the wind fetch for numerous directions at the same location is a reasonable measure of the overall wind exposure. This process of calculating wind fetch can be extremely time-consuming and tedious, particularly if a large number of fetch vectors are required at many locations. The fetchR package calculates wind fetch for any marine location on Earth. There are also plot methods to help visualise the wind exposure at the various locations, and methods to output the fetch vectors to a KML file for further investigation.

Shiny application

To use the fetchR package without even needing R, check out the online version.

Installation

You can install and load the latest version of fetchR from CRAN.

install.packages("fetchR")
 
# Load the fetchR package
library(fetchR)

Calculating wind fetch with fetchR

If you already have a SpatialPolygons object representing the coastline and surrounding islands, and a SpatialPoints object representing the locations, then calculating wind fetch with fetchR is easy. You can just pass these two arguments into the fetch function.

Map showing the projected SpatialPolygons (filled grey polygons) and SpatialPoints (black crosses) objects.

Note

The data for the polygon layer was sourced from Land Information New Zealand[1].

# Calculate wind fetch by passing in the projected SpatialPolygons object (nz_poly_proj)
# and the projected SpatialPoints object (fetch_locs_proj) to the fetch function.
my_fetch_proj = fetch(nz_poly_proj, fetch_locs_proj)
 
my_fetch_proj
#> Is projected : TRUE
#> Max distance : 300 km
#> Directions   : 36
#> Sites        : 3
#> 
#>                  North East South West Average
#> Kawau Bay          2.3  8.6   6.7  4.8     5.6
#> Chetwode Islands 158.9 75.4  12.1 17.1    65.9
#> Foveaux Strait    27.6 89.5 112.4 96.8    81.6

The my_fetch_proj provides a summary of the fetch for all the four quadrants, along with an overall average of the fetch length at all the sites.

Visualise the fetch vectors

# Plot the fetch vectors, along with the coastline and surrounding islands
plot(my_fetch_proj, nz_poly_proj)

Fetch vectors at all the sites

Fetch vectors at Kawau Bay

Fetch vectors at the Chetwode Islands

Fetch vectors at Foveaux Strait

Export to a KML file

# Export the fetch vectors to a KML file for further investigation
kml(my_fetch_proj, colour = "white")

Note that the distances calculated in Google Earth are (almost) the same as the distances calculated with fetchR. This can be seen in the KML output as the fetch vector at 90 degrees for the Foveaux Strait site is 300km (the maximum distance by default) in both fetchR and Google Earth, although these algorithms differ.

Output to KML

Get started with fetchR

Read the short introductory vignette to get you started with fetchR, and have a look at the simple, reproducible example in the fetch function.

# Read the short vignette
vignette("introduction-to-fetchR")
 
# Reproduce a simple example
example(fetch)

Citation

citation("fetchR")
#> 
#> To cite package 'fetchR' in publications use:
#> 
#>   Blake Seers (2017). fetchR: Calculate Wind Fetch in R. R package
#>   version 2.1-0. https://cran.r-project.org/package=fetchR
#> 
#> A BibTeX entry for LaTeX users is
#> 
#>   @Manual{,
#>     title = {fetchR: Calculate Wind Fetch in R},
#>     author = {Blake Seers},
#>     year = {2017},
#>     note = {R package version 2.1-0},
#>     url = {https://cran.r-project.org/package=fetchR},
#>   }

[1] This README contains data that was sourced from Land Information New Zealand without adaptation that is protected under CC-By Land Information New Zealand.

News

fetchR 2.1-0

Minor changes

  • Site names are automatically read from the data associated with the shapefile. The names have to be in a column with a name matching the regular expression; "^[Nn]ames{0,1}$".

  • Check out the online web application for fetchR.

  • Use on.exit to close the KML file connection in kml,Fetch method.

fetchR 2.0-0

Major changes

  • fetchR is now generalised to incorporate SpatialPolyons representing any marine location on Earth (#6). As a result, fetchR 2.0 is no longer limited to calculating wind fetch within New Zealand coastal areas.

Rewrite the entire algorithm for calculating wind fetch.

  • The rgeos::gBuffer function is used to calculate the end points of the fetch vectors at their maximum distance.

  • The interactions between the fetch vectors and the coastlines, or any of the polygons, are calculated with the rgeos::gIntersection function as opposed to the slow, iterative algorithm used by the package's predecessors.

  • Computation times have dramatically decreased.

Minor changes

Create a vignette for the package; vignette("introduction-to-fetchR").

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("fetchR")

2.1-0 by Blake Seers, 10 months ago


https://cran.r-project.org/package=fetchR


Report a bug at https://github.com/blasee/fetchR/issues


Browse source code at https://github.com/cran/fetchR


Authors: Blake Seers [aut, cre]


Documentation:   PDF Manual  


GPL-2 license


Imports rgdal, sp, methods, rgeos, plotKML, utils

Suggests knitr, ggplot2, maps, rmarkdown


See at CRAN