makeVGAGraph: Create a graph between visible cells in the LatticeMap

View source: R/prepareVGA.R

makeVGAGraphR Documentation

Create a graph between visible cells in the LatticeMap

Description

Create a graph between visible cells in the LatticeMap

Usage

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

Arguments

latticeMap

The input LatticeMap

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.

Value

A new LatticeMap with a graph between points

Examples

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)
latticeMap <- createGrid(
  minX = mapRegion[["xmin"]],
  minY = mapRegion[["ymin"]],
  maxX = mapRegion[["xmax"]],
  maxY = mapRegion[["ymax"]],
  gridSize = 0.5
)
latticeMap <- blockLines(
  latticeMap = latticeMap,
  lineStringMap = lineStringMap[vector()]
)
latticeMap <- fillGrid(
  latticeMap = latticeMap,
  fillX = 3.01,
  fillY = 6.7
)
makeVGAGraph(
  latticeMap = latticeMap,
  boundaryGraph = FALSE,
  maxVisibility = NA
)

alcyon documentation built on Aug. 30, 2026, 1:07 a.m.