---
# SPDX-FileCopyrightText: 2024 Petros Koutsolampros
#
# SPDX-License-Identifier: GPL-3.0-only

title: "Axial Analysis"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Axial Analysis}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---
  
```{r, include = FALSE}
knitr::opts_chunk$set(
    collapse = TRUE,
    comment = "#>"
)
```
  
```{r setup}
library(alcyon)

lineStringMap <- st_read(
    system.file(
        "extdata", "testdata", "barnsbury", "barnsbury_small_axial_original.mif",
        package = "alcyon"
    ),
    geometry_column = 1L, quiet = TRUE
)
axMap <- as(lineStringMap, "AxialShapeGraph")
```

```{r}
plot(axMap[, "Connectivity"])
```

```{r}
axAnalysed <- allToAllTraverse(
    axMap,
    traversalType = TraversalType$Topological,
    radii = c("n", "3"),
    includeBetweenness = TRUE
)
plot(axAnalysed[, "Choice [Norm] R3"])
```

```{r}
axAnalysed <- oneToAllTraverse(
    axAnalysed,
    traversalType = TraversalType$Topological,
    fromX = 0982.8,
    fromY = -1620.3,
)
plot(axAnalysed["Step Depth"])
```
