Learn R Programming

alcyon (version 0.7.0)

makeVGAGraph: Create a graph between visible cells in the PointMap

Description

Create a graph between visible cells in the PointMap

Usage

makeVGAGraph(
  pointMap,
  boundaryGraph = FALSE,
  maxVisibility = NA,
  copyMap = TRUE,
  verbose = FALSE
)

Value

A new PointMap with a graph between points

Arguments

pointMap

The input PointMap

boundaryGraph

Only create a graph on the boundary cells

maxVisibility

Limit how far two cells can be to be connected

copyMap

Optional. Copy the internal sala map

verbose

Optional. Show more information of the process.

Examples

Run this code
mifFile <- system.file(
    "extdata", "testdata", "simple",
    "simple_interior.mif",
    package = "alcyon"
  )
  sfMap <- st_read(mifFile,
    geometry_column = 1L, quiet = TRUE
  )
  shapeMap <- as(sfMap[, vector()], "ShapeMap")
lineStringMap <- as(sfMap, "sf")
mapRegion <- sf::st_bbox(lineStringMap)
pointMap <- createGrid(
  minX = mapRegion[["xmin"]],
  minY = mapRegion[["ymin"]],
  maxX = mapRegion[["xmax"]],
  maxY = mapRegion[["ymax"]],
  gridSize = 0.5
)
pointMap <- blockLines(
  pointMap = pointMap,
  lineStringMap = lineStringMap[vector()]
)
pointMap <- fillGrid(
  pointMap = pointMap,
  fillX = 3.01,
  fillY = 6.7
)
makeVGAGraph(
  pointMap = pointMap,
  boundaryGraph = FALSE,
  maxVisibility = NA
)

Run the code above in your browser using DataLab