blockLines: Block lines on a LatticeMap

View source: R/prepareVGA.R

blockLinesR Documentation

Block lines on a LatticeMap

Description

Takes a LatticeMap and a ShapeMap with lines and blocks the cells on the LatticeMap where the lines pass.

Usage

blockLines(latticeMap, lineStringMap, copyMap = TRUE, verbose = FALSE)

Arguments

latticeMap

The input LatticeMap

lineStringMap

Map of lines, either a ShapeMap, or an sf lineString map

copyMap

Optional. Copy the internal sala map

verbose

Optional. Show more information of the process.

Value

A new LatticeMap with points as they have been blocked by the lines

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.04
)
blockLines(
  latticeMap = latticeMap,
  lineStringMap = lineStringMap[vector()]
)

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