Learn R Programming

wflo (version 1.9)

GetFarmFromLonLat: Accesses full FarmData set and returns a compatible list object for the requested location.

Description

This function accepts a pair longitude (decimal system, east) and latitude (decimal system, north) coordinates as well a a desired edge length in m and if valid, returns a list object similar to FarmData, but at the specified location and with the specified size.

Usage

GetFarmFromLonLat(Top, Left, EdgeLen, DoPlot = FALSE)

Value

Returns a list object following the structure of FarmData, but only containing the farm area starting from the top-left point specified and as many 'tiles' required to meet the desired edge length at 200 m tiles resolution.

Arguments

Top

longitude value (decimal system, east).

Left

latitude value (decimal system, north).

EdgeLen

edge length in meters. Note that the returned farm data object is always a square area and thus, contains square matrices.

DoPlot

optionally plots the annual energy production (AEP) 'landscape' in the returned object using a terrain.colors coloring scheme, together with a color key.

Author

Carsten Croonenbroeck

Details

Requires that the full FarmData dataset is loaded. See AcquireData on how to obtain it.

See Also

See Index2GK to convert index coordinates to Gauss-Kruger coordinates, and GK2LonLat to convert Gauss-Kruger coordinates to longitude/latitude coordinates.

Examples

Run this code
# This will return a farm at the specified location, edge length 5,000 m (5 km).
# Requires full data set to be loaded.
if (FALSE) {
MyFarm <- GetFarmFromLonLat(51.49594, 11.58818, 5000, DoPlot = FALSE)
}

Run the code above in your browser using DataLab