make_route_grid {himach}R Documentation

Make lat-long grid for route finding

Description

make_route_grid creates, and optionally classifies, a lat-long route grid

Usage

make_route_grid(
  fat_map,
  name,
  target_km = 800,
  lat_min = -60,
  lat_max = 86,
  long_min = -180,
  long_max = 179.95,
  classify = FALSE
)

Arguments

fat_map

MULTIPOLYGON map defining land regions

name

String assigned to the name slot of the result

target_km

Target length. Default 800km only to avoid accidentally starting heavy compute. 30-50km would be more useful.

lat_min, lat_max

Latitude extent of grid

long_min, long_max

Longitude extend of grid. Two allow small grids crossing the 180 boundary, the function accepts values outside [-180,180), then rounds to within this range.

classify

Whether to classify each link. Defaults to FALSE only to avoid accidentally starting heavy compute.

Details

This function creates a GridLat object that contains a set of point on a lat long grid (ie all the points are on lines of latitude). It also joins these points into a lattice. Optionally, but required later, it classifies each link as land, sea, or transition, with reference to a given map (typically including a coastal buffer).

The definitions are

The length of the links will be around target_km or 50pct longer for the diagonal links.

For more details see the help vignette: vignette("Supersonic Routing", package = "himach")

Value

gridLat object containing points and lattice.

Examples

NZ_buffer <- hm_get_test("buffer")
system.time(
  p_grid <- make_route_grid(NZ_buffer,"NZ lat-long at 300km",
                           target_km = 300, classify = TRUE,
                           lat_min = -49, lat_max = -32,
                           long_min = 162, long_max = 182)
)


[Package himach version 0.3.2 Index]