gridFlights: Apply a function on all flight nodes per gridcell

Description Usage Arguments Value Author(s) Examples

Description

Produces a specific SpatialPixelsDataFrame of the given function for all nodes within a grid cell. Track information is lost.

Usage

1
2
3
4
gridFlights(data, FUN, col.names = c("lon", "lat", "altitude"),
  proj.in = "+init=epsg:4326",
  proj.out = "+proj=utm +zone=32 +ellps=WGS84 +dataum=WGS84 +units=m +no_defs",
  res.out = 1000, ...)

Arguments

data

the flights data.frame (at least with column names "lon", "lat" and "altitude")

FUN

function to apply

col.names

column names of the flights data.frame to use 1st for x-coordinate, 2nd for y-coordinate and 3rd for z-coordinate

proj.in

proj4string: projection of the input flights data.frame

proj.out

proj4string: projection of the output

res.out

output resulution in the unit of proj.out

...

further parameters passed to FUN

Value

a SpatialPixelsDataFrame

Author(s)

Joerg Steinkamp joergsteinkamp@yahoo.de

Examples

1
2
3
4
5
6
7
8
9
library(raster)
extent <- extent(c(7.25, 8.5, 49.5, 50.2))
N <- 750
set.seed(987654)
data <- data.frame(lon=rbeta(N, 5, 2) * (extent@xmax - extent@xmin) + extent@xmin,
                   lat=rbeta(N, 2.5, 2.5) * (extent@ymax - extent@ymin) + extent@ymin)
data$altitude = (data$lon - 7.9)^3 - 3 * (data$lon - 7.9) * (data$lat- 50)^2
fgrid = gridFlights(data, min)
plot(fgrid)

joergsteinkamp/FlightControl documentation built on May 19, 2019, 3 p.m.