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
#> 43 boundary edges (1 group: 1)
#> 34 boundary edges (1 group: 1)
#> 
#> $boundary_sf
#> $boundary_sf[[1]]
#> Geometry set for 1 feature 
#> Geometry type: POLYGON
#> Dimension:     XYZ
#> Bounding box:  xmin: -3.345586 ymin: -1.997743 xmax: 2.07684 ymax: 3.40255
#> z_range:       zmin: 0 zmax: 0
#> CRS:           NA
#> POLYGON Z ((-3.202599 -0.4432085 0, -3.012083 -...
#> 
#> $boundary_sf[[2]]
#> Geometry set for 1 feature 
#> Geometry type: POLYGON
#> Dimension:     XYZ
#> Bounding box:  xmin: -5.345477 ymin: -3.997839 xmax: 4.08358 ymax: 5.415519
#> z_range:       zmin: 0 zmax: 0
#> CRS:           NA
#> POLYGON Z ((-5.180541 -0.8956538 0, -4.924679 -...
#> 
#> 
#> $mesh
#> fm_mesh_2d object:
#>   Manifold:	R2
#>   V / E / T:	292 / 838 / 547
#>   Euler char.:	1
#>   Constraints:	Boundary: 35 boundary edges (1 group: 1), Interior: 55 interior edges (1 group: 1)
#>   Bounding box: (-5.345477, 4.083580) x (-3.997839, 5.415519)
#>   Basis d.o.f.:	292
#> 
#> $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.5471743  0.3808746
#> 
#> Slot "area":
#> [1] 18.48926
#> 
#> Slot "hole":
#> [1] FALSE
#> 
#> Slot "ringDir":
#> [1] 1
#> 
#> Slot "coords":
#>              [,1]       [,2]
#>  [1,] -3.20259941 -0.4432085
#>  [2,] -3.32333698 -0.1467627
#>  [3,] -3.34558626  0.0433455
#>  [4,] -3.27933738  0.4235620
#>  [5,] -3.18074616  0.6136702
#>  [6,] -3.01208303  0.8084371
#>  [7,] -2.37469219  1.1839950
#>  [8,] -2.04903206  1.5642115
#>  [9,] -1.88843285  1.9444280
#> [10,] -1.88698209  2.5147527
#> [11,] -1.76607200  2.8949692
#> [12,] -1.63063925  3.0850775
#> [13,] -1.29743560  3.3276712
#> [14,] -1.10691922  3.3923014
#> [15,] -0.72588645  3.4025498
#> [16,] -0.38259928  3.2751857
#> [17,] -0.15433731  3.0912113
#> [18,] -0.01276793  2.8949692
#> [19,]  0.25334789  2.3246445
#> [20,]  0.41721184  2.1411072
#> [21,]  0.60772822  1.9940843
#> [22,]  0.98876098  1.7865826
#> [23,]  1.22388325  1.5642115
#> [24,]  1.40394094  1.1839950
#> [25,]  1.44144252  0.6136702
#> [26,]  1.49873091  0.4235620
#> [27,]  1.70182084  0.0433455
#> [28,]  1.98245497 -0.3368710
#> [29,]  2.05301018 -0.5269792
#> [30,]  2.07683967 -0.9071957
#> [31,]  1.94134289 -1.2921694
#> [32,]  1.75082651 -1.5190524
#> [33,]  1.56031012 -1.6576058
#> [34,]  1.36979374 -1.7348566
#> [35,]  0.98876098 -1.8030499
#> [36,]  0.41721184 -1.9893401
#> [37,]  0.22669545 -1.9977428
#> [38,] -0.15433731 -1.9206084
#> [39,] -0.72588645 -1.8950806
#> [40,] -0.91640284 -1.8400314
#> [41,] -2.25001751 -0.9949053
#> [42,] -2.82156665 -0.8132865
#> [43,] -3.01208303 -0.6785684
#> [44,] -3.20259941 -0.4432085
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "labpt":
#> [1] -0.5471743  0.3808746
#> 
#> Slot "ID":
#> [1] "ID1"
#> 
#> Slot "area":
#> [1] 18.48926
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "bbox":
#>         min     max
#> x -3.345586 2.07684
#> y -1.997743 3.40255
#> 
#> 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.5729693  0.4391398
#> 
#> Slot "area":
#> [1] 64.79843
#> 
#> Slot "hole":
#> [1] FALSE
#> 
#> Slot "ringDir":
#> [1] 1
#> 
#> Slot "coords":
#>              [,1]       [,2]
#>  [1,] -5.18054101 -0.8956538
#>  [2,] -5.34547744  0.1158697
#>  [3,] -5.18054101  1.0310343
#>  [4,] -4.86165968  1.6968155
#>  [5,] -3.98006289  2.8825249
#>  [6,] -3.39223207  4.0682342
#>  [7,] -2.80667349  4.7205789
#>  [8,] -2.41102890  4.9999852
#>  [9,] -1.61973973  5.3261485
#> [10,] -0.82845056  5.4155191
#> [11,] -0.03716138  5.2923424
#> [12,]  0.84902797  4.8587071
#> [13,]  1.30404651  4.4634707
#> [14,]  1.94106155  3.6682249
#> [15,]  2.73235072  2.8804611
#> [16,]  3.20643136  2.0920519
#> [17,]  3.59901221  0.9063426
#> [18,]  3.94959543  0.1158697
#> [19,]  4.08358003 -0.6746032
#> [20,]  4.00481210 -1.4650761
#> [21,]  3.87910146 -1.8603126
#> [22,]  3.52363990 -2.5146962
#> [23,]  3.04025776 -3.0460219
#> [24,]  2.45015789 -3.4412584
#> [25,]  1.94106155 -3.6520862
#> [26,]  0.75412779 -3.9609006
#> [27,]  0.35848320 -3.9978389
#> [28,] -0.82845056 -3.8990598
#> [29,] -1.61973973 -3.7135116
#> [30,] -3.20231808 -2.8266798
#> [31,] -3.62002773 -2.6507855
#> [32,] -4.24202446 -2.2555490
#> [33,] -4.64407379 -1.8603126
#> [34,] -4.92467895 -1.4650761
#> [35,] -5.18054101 -0.8956538
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "labpt":
#> [1] -0.5729693  0.4391398
#> 
#> Slot "ID":
#> [1] "ID1"
#> 
#> Slot "area":
#> [1] 64.79843
#> 
#> 
#> 
#> Slot "plotOrder":
#> [1] 1
#> 
#> Slot "bbox":
#>         min      max
#> x -5.345477 4.083580
#> y -3.997839 5.415519
#> 
#> Slot "proj4string":
#> Coordinate Reference System:
#> Deprecated Proj.4 representation: NA 
#> 
#> 
#>