Skip to contents

Adds loc_sp and boundary_sp to fmexample for use in sp related code examples and tests.

Usage

fmexample_sp()

Value

Returns a copy of fmexample with loc_sp (SpatialPoints) and boundary_sp (SpatialPolygons) added.

Examples

if (fm_safe_sp()) {
  fmexample_sp()
}
#> $loc
#>             [,1]        [,2]
#>  [1,] -1.2070657 -0.47719270
#>  [2,]  0.2774292 -0.99838644
#>  [3,]  1.0844412 -0.77625389
#>  [4,] -2.3456977  0.06445882
#>  [5,]  0.4291247  0.95949406
#>  [6,]  0.5060559 -0.11028549
#>  [7,] -0.5747400 -0.51100951
#>  [8,] -0.5466319 -0.91119542
#>  [9,] -0.5644520 -0.83717168
#> [10,] -0.8900378  2.41583518
#> 
#> $loc_sf
#> Geometry set for 10 features 
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -2.345698 ymin: -0.9983864 xmax: 1.084441 ymax: 2.415835
#> CRS:           NA
#> First 5 geometries:
#> POINT (-1.207066 -0.4771927)
#> POINT (0.2774292 -0.9983864)
#> POINT (1.084441 -0.7762539)
#> POINT (-2.345698 0.06445882)
#> POINT (0.4291247 0.9594941)
#> 
#> $boundary_fm
#> 46 boundary edges (1 group: 1)
#> 26 boundary edges (1 group: 1)
#> 
#> $boundary_sf
#> $boundary_sf[[1]]
#> Geometry set for 1 feature 
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -3.344418 ymin: -1.995602 xmax: 2.076846 ymax: 3.404937
#> CRS:           NA
#> POLYGON ((-2.817059 0.9463137, -2.202485 1.2354...
#> 
#> $boundary_sf[[2]]
#> Geometry set for 1 feature 
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -5.331027 ymin: -3.998161 xmax: 4.061656 ymax: 5.415609
#> CRS:           NA
#> POLYGON ((-4.991262 1.478543, -3.989966 2.80278...
#> 
#> 
#> $mesh
#> fm_mesh_2d object:
#>   Manifold:	R2
#>   V / E / T:	279 / 805 / 527
#>   Euler char.:	1
#>   Constraints:	29 boundary edges (1 group: 1), 54 interior edges (1 group: 1)
#>   Bounding box: (-5.331027, 4.061656) x (-3.998161, 5.415609)
#>   Basis d.o.f.:	279
#> 
#> $loc_sp
#> SpatialPoints:
#>        coords.x1   coords.x2
#>  [1,] -1.2070657 -0.47719270
#>  [2,]  0.2774292 -0.99838644
#>  [3,]  1.0844412 -0.77625389
#>  [4,] -2.3456977  0.06445882
#>  [5,]  0.4291247  0.95949406
#>  [6,]  0.5060559 -0.11028549
#>  [7,] -0.5747400 -0.51100951
#>  [8,] -0.5466319 -0.91119542
#>  [9,] -0.5644520 -0.83717168
#> [10,] -0.8900378  2.41583518
#> Coordinate Reference System (CRS) arguments: NA 
#> 
#> $boundary_sp
#> $boundary_sp[[1]]
#> An object of class "SpatialPolygons"
#> Slot "polygons":
#> [[1]]
#> An object of class "Polygons"
#> Slot "Polygons":
#> [[1]]
#> An object of class "Polygon"
#> Slot "labpt":
#> [1] -0.5461125  0.3740483
#> 
#> Slot "area":
#> [1] 18.33926
#> 
#> Slot "hole":
#> [1] FALSE
#> 
#> Slot "ringDir":
#> [1] 1
#> 
#> Slot "coords":
#>              [,1]        [,2]
#>  [1,] -2.81705894  0.94631367
#>  [2,] -2.20248500  1.23549053
#>  [3,] -1.93714856  1.58422823
#>  [4,] -1.84819843  1.93933706
#>  [5,] -1.88966137  2.39129580
#>  [6,] -1.86566648  2.63491992
#>  [7,] -1.77189268  2.88719642
#>  [8,] -1.61423037  3.10532380
#>  [9,] -1.36139907  3.29769003
#> [10,] -1.06098684  3.40103863
#> [11,] -0.74331840  3.40493720
#> [12,] -0.44046036  3.30899222
#> [13,] -0.21852945  3.15673051
#> [14,] -0.05863083  2.97136357
#> [15,]  0.16195892  2.41850813
#> [16,]  0.32797911  2.17652337
#> [17,]  0.55709500  1.99315152
#> [18,]  1.02477913  1.76264111
#> [19,]  1.31097954  1.43085530
#> [20,]  1.41822671  1.10621348
#> [21,]  1.41806313  0.63150828
#> [22,]  1.47703673  0.36888691
#> [23,]  1.60391854  0.13150773
#> [24,]  1.92923112 -0.24129656
#> [25,]  2.05439938 -0.53329201
#> [26,]  2.07684597 -0.89865535
#> [27,]  1.97759821 -1.22583137
#> [28,]  1.79149471 -1.48330743
#> [29,]  1.53401865 -1.66941093
#> [30,]  1.30352592 -1.75188255
#> [31,]  0.92136413 -1.81235099
#> [32,]  0.47250487 -1.97909787
#> [33,]  0.20387022 -1.99560180
#> [34,] -0.23024620 -1.90653460
#> [35,] -0.66903331 -1.90360021
#> [36,] -0.99620933 -1.80435245
#> [37,] -2.10943110 -1.04428133
#> [38,] -2.65935582 -0.88499786
#> [39,] -2.88065504 -0.78033113
#> [40,] -3.06989025 -0.62502980
#> [41,] -3.21571917 -0.42840226
#> [42,] -3.30940119 -0.20223386
#> [43,] -3.34441795  0.01539484
#> [44,] -3.26950766  0.44711343
#> [45,] -3.14884475  0.66011326
#> [46,] -2.99882136  0.82161064
#> [47,] -2.81705894  0.94631367
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "labpt":
#> [1] -0.5461125  0.3740483
#> 
#> Slot "ID":
#> [1] "ID1"
#> 
#> Slot "area":
#> [1] 18.33926
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "bbox":
#>         min      max
#> x -3.344418 2.076846
#> y -1.995602 3.404937
#> 
#> Slot "proj4string":
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: NA 
#> 
#> 
#> $boundary_sp[[2]]
#> An object of class "SpatialPolygons"
#> Slot "polygons":
#> [[1]]
#> An object of class "Polygons"
#> Slot "Polygons":
#> [[1]]
#> An object of class "Polygon"
#> Slot "labpt":
#> [1] -0.5751230  0.4371188
#> 
#> Slot "area":
#> [1] 64.57747
#> 
#> Slot "hole":
#> [1] FALSE
#> 
#> Slot "ringDir":
#> [1] 1
#> 
#> Slot "coords":
#>             [,1]       [,2]
#>  [1,] -4.9912623  1.4785425
#>  [2,] -3.9899658  2.8027818
#>  [3,] -3.2994790  4.2027985
#>  [4,] -2.3686211  5.0258996
#>  [5,] -1.6189235  5.3257098
#>  [6,] -0.8900378  5.4156093
#>  [7,] -0.1611522  5.3257098
#>  [8,]  0.5240459  5.0613997
#>  [9,]  1.3326482  4.4303603
#> [10,]  1.9087688  3.6737820
#> [11,]  2.7479814  2.8625306
#> [12,]  3.1715474  2.1751265
#> [13,]  4.0616556 -0.4090495
#> [14,]  4.0265754 -1.3614808
#> [15,]  3.7300057 -2.1903376
#> [16,]  3.3071272 -2.7907790
#> [17,]  2.6893132 -3.3106237
#> [18,]  1.0063149 -3.9082611
#> [19,]  0.2774292 -3.9981605
#> [20,] -0.9138362 -3.8884098
#> [21,] -1.9607156 -3.5567600
#> [22,] -4.1912535 -2.3004024
#> [23,] -4.7105589 -1.7810970
#> [24,] -5.0881204 -1.1511736
#> [25,] -5.3310271 -0.2295705
#> [26,] -5.2878320  0.6496857
#> [27,] -4.9912623  1.4785425
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "labpt":
#> [1] -0.5751230  0.4371188
#> 
#> Slot "ID":
#> [1] "ID1"
#> 
#> Slot "area":
#> [1] 64.57747
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "bbox":
#>         min      max
#> x -5.331027 4.061656
#> y -3.998161 5.415609
#> 
#> Slot "proj4string":
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: NA 
#> 
#> 
#>