Skip to contents

Sorts features by a specific column and extracts the top x percent

Usage

getTopFeatures(lineStringMap, column, percent)

Arguments

lineStringMap

An sf lineString map

column

The column to use to extract the features from

percent

Percentage of features (to total) to extract

Value

The lineString map filtered and sorted

Examples

mifFile <- system.file(
    "extdata", "testdata", "barnsbury",
    "barnsbury_small_axial_original.mif",
    package = "alcyon"
  )
  sfMap <- st_read(mifFile,
    geometry_column = 1L, quiet = TRUE
  )
  shapeGraph <- as(sfMap, "AxialShapeGraph")
shapeGraph <- allToAllTraverse(
  shapeGraph,
  traversalType = TraversalType$Topological,
  radii = c("n", "3"),
  includeBetweenness = TRUE
)
getTopFeatures(shapeGraph, "Connectivity", 0.1)
#> Simple feature collection with 6 features and 28 fields
#> Geometry type: LINESTRING
#> Dimension:     XY
#> Bounding box:  xmin: 973 ymin: -2058 xmax: 1359 ymax: -1581
#> CRS:           NA
#>    Depthmap_Ref Connectivity Data_Map_Ref Line_Length
#> 17           16            7           16    213.8832
#> 4             3            8            3    210.3450
#> 6             5            8            5    145.4648
#> 20           19            9           19    226.0022
#> 10            9           10            9    273.1483
#> 13           12           12           12    193.4942
#>                          geometry Data Map Ref Line Length Choice Choice R3
#> 17 LINESTRING (1236 -1847, 127...           16    213.8831    327       116
#> 4  LINESTRING (1200 -1581, 127...            3    210.3450    515       179
#> 6  LINESTRING (1223 -1898, 126...            5    145.4648    529       219
#> 20 LINESTRING (973 -1752, 1199...           19    226.0022    445       179
#> 10 LINESTRING (988 -1876, 1261...            9    273.1483    724       268
#> 13 LINESTRING (1167 -1874, 135...           12    193.4942    593       304
#>    Choice [Norm] Choice [Norm] R3  Entropy Entropy R3 Harmonic Mean Depth
#> 17     0.2048872        0.1171717 1.973692   1.460506            5.223067
#> 4      0.3226817        0.1349925 1.758874   1.463609           14.419703
#> 6      0.3314536        0.1651584 1.731490   1.433642           14.256503
#> 20     0.2788221        0.2294872 2.044582   1.536169            5.368661
#> 10     0.4536341        0.2021116 1.864475   1.511067            4.842767
#> 13     0.3715539        0.2812211 1.941796   1.550662           20.000000
#>    Harmonic Mean Depth R3 Integration [HH] Integration [HH] R3
#> 17               16.04494         2.105129            2.527273
#> 4                18.51018         2.361852            2.543419
#> 6                18.11097         2.548314            2.793591
#> 20               16.57253         1.936718            2.447779
#> 10               20.46512         2.482972            2.748533
#> 13               20.00000         2.420898            2.956538
#>    Integration [P-value] Integration [P-value] R3 Integration [Tekl]
#> 17             0.5558915                0.7177534          0.7369218
#> 4              0.6236832                0.6906281          0.7561645
#> 6              0.6729213                0.7585587          0.7694319
#> 20             0.5114202                0.7217177          0.7235790
#> 10             0.6556669                0.7463239          0.7648444
#> 13             0.6392753                0.8283008          0.7604254
#>    Integration [Tekl] R3 Intensity Intensity R3 Mean Depth Mean Depth R3
#> 17             0.7713465  1.257958     1.244135   2.614035      2.222222
#> 4              0.7702533  1.259441     1.175322   2.438596      2.288461
#> 6              0.7878321  1.339019     1.266384   2.333333      2.173077
#> 20             0.7673109  1.197836     1.340062   2.754386      2.200000
#> 10             0.7847281  1.404410     1.312894   2.368421      2.192308
#> 13             0.8015020  1.425622     1.519016   2.403509      2.063830
#>    Node Count Node Count R3 Relativised Entropy Relativised Entropy R3
#> 17         58            46            1.641994               1.710227
#> 4          58            53            1.662805               1.783778
#> 6          58            53            1.593437               1.692109
#> 20         58            41            1.723361               1.641913
#> 10         58            53            1.526621               1.657888
#> 13         58            48            1.524789               1.500373