Random GeoJSON linestring

geo_linestring(count = 1, num_vertices = 10, max_length = 0.001,
  max_rotation = pi/8, bbox = NULL)

Arguments

count

(integer/numeric) number of Polygons. Default: 1

num_vertices

(integer/numeric) how many coordinates each polygon will contain. Default: 10

max_length

(integer/numeric) maximum distance that a vertex can be from its predecessor. Units are in degrees latitude (Approximately 69 miles or 111 km). Default: 0.001 (approximately 121 yards or 111 meters)

max_rotation

(integer/numeric) the maximum number of radians that a line segment can turn from the previous segment. Default: pi / 8

bbox

(integer/numeric) lat/long bounding box for the starting point of the line, numeric vector of the form west (long), south (lat), east (long), north (lat). optional

Value

GeoJSON; a list with one ore more Linestrings in a FeatureCollection, with class geo_list - simple unclass() to remove the class

Examples

geo_linestring()
#> $type #> [1] "FeatureCollection" #> #> $features #> $features[[1]] #> $features[[1]]$type #> [1] "Feature" #> #> $features[[1]]$geometry #> $features[[1]]$geometry$type #> [1] "LineString" #> #> $features[[1]]$geometry$coordinates #> $features[[1]]$geometry$coordinates[[1]] #> $features[[1]]$geometry$coordinates[[1]][[1]] #> [1] -150.9300 -41.9642 #> #> $features[[1]]$geometry$coordinates[[1]][[2]] #> [1] -150.9300 -41.9642 #> #> $features[[1]]$geometry$coordinates[[1]][[3]] #> [1] -150.92979 -41.96468 #> #> $features[[1]]$geometry$coordinates[[1]][[4]] #> [1] -150.92977 -41.96542 #> #> $features[[1]]$geometry$coordinates[[1]][[5]] #> [1] -150.93004 -41.96627 #> #> $features[[1]]$geometry$coordinates[[1]][[6]] #> [1] -150.9300 -41.9663 #> #> $features[[1]]$geometry$coordinates[[1]][[7]] #> [1] -150.9301 -41.9667 #> #> $features[[1]]$geometry$coordinates[[1]][[8]] #> [1] -150.92991 -41.96709 #> #> $features[[1]]$geometry$coordinates[[1]][[9]] #> [1] -150.92982 -41.96747 #> #> $features[[1]]$geometry$coordinates[[1]][[10]] #> [1] -150.93000 -41.96773 #> #> #> #> #> $features[[1]]$properties #> NULL #> #> #> #> attr(,"class") #> [1] "geo_list"
geo_linestring(10)
#> $type #> [1] "FeatureCollection" #> #> $features #> $features[[1]] #> $features[[1]]$type #> [1] "Feature" #> #> $features[[1]]$geometry #> $features[[1]]$geometry$type #> [1] "LineString" #> #> $features[[1]]$geometry$coordinates #> $features[[1]]$geometry$coordinates[[1]] #> $features[[1]]$geometry$coordinates[[1]][[1]] #> [1] 64.21695 -28.07580 #> #> $features[[1]]$geometry$coordinates[[1]][[2]] #> [1] 64.21779 -28.07582 #> #> $features[[1]]$geometry$coordinates[[1]][[3]] #> [1] 64.21724 -28.07602 #> #> $features[[1]]$geometry$coordinates[[1]][[4]] #> [1] 64.21792 -28.07636 #> #> $features[[1]]$geometry$coordinates[[1]][[5]] #> [1] 64.21775 -28.07652 #> #> $features[[1]]$geometry$coordinates[[1]][[6]] #> [1] 64.21833 -28.07689 #> #> $features[[1]]$geometry$coordinates[[1]][[7]] #> [1] 64.21793 -28.07713 #> #> $features[[1]]$geometry$coordinates[[1]][[8]] #> [1] 64.21875 -28.07775 #> #> $features[[1]]$geometry$coordinates[[1]][[9]] #> [1] 64.21859 -28.07792 #> #> $features[[1]]$geometry$coordinates[[1]][[10]] #> [1] 64.21890 -28.07833 #> #> #> #> #> $features[[1]]$properties #> NULL #> #> #> $features[[2]] #> $features[[2]]$type #> [1] "Feature" #> #> $features[[2]]$geometry #> $features[[2]]$geometry$type #> [1] "LineString" #> #> $features[[2]]$geometry$coordinates #> $features[[2]]$geometry$coordinates[[1]] #> $features[[2]]$geometry$coordinates[[1]][[1]] #> [1] 51.00457 -18.69732 #> #> $features[[2]]$geometry$coordinates[[1]][[2]] #> [1] 51.00516 -18.69679 #> #> $features[[2]]$geometry$coordinates[[1]][[3]] #> [1] 51.00612 -18.69646 #> #> $features[[2]]$geometry$coordinates[[1]][[4]] #> [1] 51.00656 -18.69627 #> #> $features[[2]]$geometry$coordinates[[1]][[5]] #> [1] 51.00672 -18.69617 #> #> $features[[2]]$geometry$coordinates[[1]][[6]] #> [1] 51.00717 -18.69593 #> #> $features[[2]]$geometry$coordinates[[1]][[7]] #> [1] 51.00738 -18.69588 #> #> $features[[2]]$geometry$coordinates[[1]][[8]] #> [1] 51.00745 -18.69587 #> #> $features[[2]]$geometry$coordinates[[1]][[9]] #> [1] 51.0083 -18.6957 #> #> $features[[2]]$geometry$coordinates[[1]][[10]] #> [1] 51.00886 -18.69549 #> #> #> #> #> $features[[2]]$properties #> NULL #> #> #> $features[[3]] #> $features[[3]]$type #> [1] "Feature" #> #> $features[[3]]$geometry #> $features[[3]]$geometry$type #> [1] "LineString" #> #> $features[[3]]$geometry$coordinates #> $features[[3]]$geometry$coordinates[[1]] #> $features[[3]]$geometry$coordinates[[1]][[1]] #> [1] -59.14113 -11.10021 #> #> $features[[3]]$geometry$coordinates[[1]][[2]] #> [1] -59.14058 -11.10020 #> #> $features[[3]]$geometry$coordinates[[1]][[3]] #> [1] -59.14030 -11.10017 #> #> $features[[3]]$geometry$coordinates[[1]][[4]] #> [1] -59.14005 -11.09989 #> #> $features[[3]]$geometry$coordinates[[1]][[5]] #> [1] -59.14018 -11.09944 #> #> $features[[3]]$geometry$coordinates[[1]][[6]] #> [1] -59.14018 -11.09942 #> #> $features[[3]]$geometry$coordinates[[1]][[7]] #> [1] -59.14024 -11.09887 #> #> $features[[3]]$geometry$coordinates[[1]][[8]] #> [1] -59.14014 -11.09850 #> #> $features[[3]]$geometry$coordinates[[1]][[9]] #> [1] -59.14011 -11.09790 #> #> $features[[3]]$geometry$coordinates[[1]][[10]] #> [1] -59.14016 -11.09761 #> #> #> #> #> $features[[3]]$properties #> NULL #> #> #> $features[[4]] #> $features[[4]]$type #> [1] "Feature" #> #> $features[[4]]$geometry #> $features[[4]]$geometry$type #> [1] "LineString" #> #> $features[[4]]$geometry$coordinates #> $features[[4]]$geometry$coordinates[[1]] #> $features[[4]]$geometry$coordinates[[1]][[1]] #> [1] -7.172937 -57.141291 #> #> $features[[4]]$geometry$coordinates[[1]][[2]] #> [1] -7.172008 -57.141735 #> #> $features[[4]]$geometry$coordinates[[1]][[3]] #> [1] -7.170198 -57.141909 #> #> $features[[4]]$geometry$coordinates[[1]][[4]] #> [1] -7.169255 -57.141826 #> #> $features[[4]]$geometry$coordinates[[1]][[5]] #> [1] -7.167949 -57.141945 #> #> $features[[4]]$geometry$coordinates[[1]][[6]] #> [1] -7.166946 -57.141893 #> #> $features[[4]]$geometry$coordinates[[1]][[7]] #> [1] -7.166895 -57.141899 #> #> $features[[4]]$geometry$coordinates[[1]][[8]] #> [1] -7.165419 -57.141986 #> #> $features[[4]]$geometry$coordinates[[1]][[9]] #> [1] -7.164712 -57.142112 #> #> $features[[4]]$geometry$coordinates[[1]][[10]] #> [1] -7.16394 -57.14211 #> #> #> #> #> $features[[4]]$properties #> NULL #> #> #> $features[[5]] #> $features[[5]]$type #> [1] "Feature" #> #> $features[[5]]$geometry #> $features[[5]]$geometry$type #> [1] "LineString" #> #> $features[[5]]$geometry$coordinates #> $features[[5]]$geometry$coordinates[[1]] #> $features[[5]]$geometry$coordinates[[1]][[1]] #> [1] 60.793469 -0.876692 #> #> $features[[5]]$geometry$coordinates[[1]][[2]] #> [1] 60.7927585 -0.8771315 #> #> $features[[5]]$geometry$coordinates[[1]][[3]] #> [1] 60.7920391 -0.8776283 #> #> $features[[5]]$geometry$coordinates[[1]][[4]] #> [1] 60.7917234 -0.8784586 #> #> $features[[5]]$geometry$coordinates[[1]][[5]] #> [1] 60.7914294 -0.8788633 #> #> $features[[5]]$geometry$coordinates[[1]][[6]] #> [1] 60.791183 -0.879598 #> #> $features[[5]]$geometry$coordinates[[1]][[7]] #> [1] 60.7910096 -0.8802078 #> #> $features[[5]]$geometry$coordinates[[1]][[8]] #> [1] 60.7907574 -0.8807155 #> #> $features[[5]]$geometry$coordinates[[1]][[9]] #> [1] 60.7906542 -0.8816285 #> #> $features[[5]]$geometry$coordinates[[1]][[10]] #> [1] 60.7905666 -0.8818611 #> #> #> #> #> $features[[5]]$properties #> NULL #> #> #> $features[[6]] #> $features[[6]]$type #> [1] "Feature" #> #> $features[[6]]$geometry #> $features[[6]]$geometry$type #> [1] "LineString" #> #> $features[[6]]$geometry$coordinates #> $features[[6]]$geometry$coordinates[[1]] #> $features[[6]]$geometry$coordinates[[1]][[1]] #> [1] -34.96276 -32.63330 #> #> $features[[6]]$geometry$coordinates[[1]][[2]] #> [1] -34.96267 -32.63316 #> #> $features[[6]]$geometry$coordinates[[1]][[3]] #> [1] -34.96231 -32.63236 #> #> $features[[6]]$geometry$coordinates[[1]][[4]] #> [1] -34.96201 -32.63187 #> #> $features[[6]]$geometry$coordinates[[1]][[5]] #> [1] -34.96179 -32.63121 #> #> $features[[6]]$geometry$coordinates[[1]][[6]] #> [1] -34.96179 -32.63116 #> #> $features[[6]]$geometry$coordinates[[1]][[7]] #> [1] -34.96177 -32.63109 #> #> $features[[6]]$geometry$coordinates[[1]][[8]] #> [1] -34.96141 -32.63056 #> #> $features[[6]]$geometry$coordinates[[1]][[9]] #> [1] -34.96144 -32.62965 #> #> $features[[6]]$geometry$coordinates[[1]][[10]] #> [1] -34.9617 -32.6291 #> #> #> #> #> $features[[6]]$properties #> NULL #> #> #> $features[[7]] #> $features[[7]]$type #> [1] "Feature" #> #> $features[[7]]$geometry #> $features[[7]]$geometry$type #> [1] "LineString" #> #> $features[[7]]$geometry$coordinates #> $features[[7]]$geometry$coordinates[[1]] #> $features[[7]]$geometry$coordinates[[1]][[1]] #> [1] -94.68808 -54.35020 #> #> $features[[7]]$geometry$coordinates[[1]][[2]] #> [1] -94.68839 -54.35008 #> #> $features[[7]]$geometry$coordinates[[1]][[3]] #> [1] -94.68805 -54.35000 #> #> $features[[7]]$geometry$coordinates[[1]][[4]] #> [1] -94.68858 -54.34988 #> #> $features[[7]]$geometry$coordinates[[1]][[5]] #> [1] -94.68817 -54.34980 #> #> $features[[7]]$geometry$coordinates[[1]][[6]] #> [1] -94.68968 -54.34954 #> #> $features[[7]]$geometry$coordinates[[1]][[7]] #> [1] -94.68828 -54.34961 #> #> $features[[7]]$geometry$coordinates[[1]][[8]] #> [1] -94.68926 -54.34948 #> #> $features[[7]]$geometry$coordinates[[1]][[9]] #> [1] -94.68755 -54.34947 #> #> $features[[7]]$geometry$coordinates[[1]][[10]] #> [1] -94.68791 -54.34943 #> #> #> #> #> $features[[7]]$properties #> NULL #> #> #> $features[[8]] #> $features[[8]]$type #> [1] "Feature" #> #> $features[[8]]$geometry #> $features[[8]]$geometry$type #> [1] "LineString" #> #> $features[[8]]$geometry$coordinates #> $features[[8]]$geometry$coordinates[[1]] #> $features[[8]]$geometry$coordinates[[1]][[1]] #> [1] -74.96725 -26.32865 #> #> $features[[8]]$geometry$coordinates[[1]][[2]] #> [1] -74.96726 -26.32865 #> #> $features[[8]]$geometry$coordinates[[1]][[3]] #> [1] -74.96738 -26.32823 #> #> $features[[8]]$geometry$coordinates[[1]][[4]] #> [1] -74.96732 -26.32756 #> #> $features[[8]]$geometry$coordinates[[1]][[5]] #> [1] -74.96733 -26.32721 #> #> $features[[8]]$geometry$coordinates[[1]][[6]] #> [1] -74.96721 -26.32656 #> #> $features[[8]]$geometry$coordinates[[1]][[7]] #> [1] -74.96745 -26.32573 #> #> $features[[8]]$geometry$coordinates[[1]][[8]] #> [1] -74.96785 -26.32496 #> #> $features[[8]]$geometry$coordinates[[1]][[9]] #> [1] -74.96811 -26.32453 #> #> $features[[8]]$geometry$coordinates[[1]][[10]] #> [1] -74.96842 -26.32390 #> #> #> #> #> $features[[8]]$properties #> NULL #> #> #> $features[[9]] #> $features[[9]]$type #> [1] "Feature" #> #> $features[[9]]$geometry #> $features[[9]]$geometry$type #> [1] "LineString" #> #> $features[[9]]$geometry$coordinates #> $features[[9]]$geometry$coordinates[[1]] #> $features[[9]]$geometry$coordinates[[1]][[1]] #> [1] -121.09565 -64.91092 #> #> $features[[9]]$geometry$coordinates[[1]][[2]] #> [1] -121.09368 -64.91121 #> #> $features[[9]]$geometry$coordinates[[1]][[3]] #> [1] -121.09391 -64.91122 #> #> $features[[9]]$geometry$coordinates[[1]][[4]] #> [1] -121.09221 -64.91149 #> #> $features[[9]]$geometry$coordinates[[1]][[5]] #> [1] -121.09437 -64.91188 #> #> $features[[9]]$geometry$coordinates[[1]][[6]] #> [1] -121.09220 -64.91211 #> #> $features[[9]]$geometry$coordinates[[1]][[7]] #> [1] -121.09227 -64.91212 #> #> $features[[9]]$geometry$coordinates[[1]][[8]] #> [1] -121.09027 -64.91221 #> #> $features[[9]]$geometry$coordinates[[1]][[9]] #> [1] -121.09074 -64.91228 #> #> $features[[9]]$geometry$coordinates[[1]][[10]] #> [1] -121.0885 -64.9122 #> #> #> #> #> $features[[9]]$properties #> NULL #> #> #> $features[[10]] #> $features[[10]]$type #> [1] "Feature" #> #> $features[[10]]$geometry #> $features[[10]]$geometry$type #> [1] "LineString" #> #> $features[[10]]$geometry$coordinates #> $features[[10]]$geometry$coordinates[[1]] #> $features[[10]]$geometry$coordinates[[1]][[1]] #> [1] -91.82592 -34.21121 #> #> $features[[10]]$geometry$coordinates[[1]][[2]] #> [1] -91.82562 -34.21136 #> #> $features[[10]]$geometry$coordinates[[1]][[3]] #> [1] -91.82633 -34.21142 #> #> $features[[10]]$geometry$coordinates[[1]][[4]] #> [1] -91.82536 -34.21166 #> #> $features[[10]]$geometry$coordinates[[1]][[5]] #> [1] -91.82586 -34.21168 #> #> $features[[10]]$geometry$coordinates[[1]][[6]] #> [1] -91.82577 -34.21166 #> #> $features[[10]]$geometry$coordinates[[1]][[7]] #> [1] -91.82646 -34.21146 #> #> $features[[10]]$geometry$coordinates[[1]][[8]] #> [1] -91.82606 -34.21141 #> #> $features[[10]]$geometry$coordinates[[1]][[9]] #> [1] -91.82681 -34.21105 #> #> $features[[10]]$geometry$coordinates[[1]][[10]] #> [1] -91.82564 -34.21087 #> #> #> #> #> $features[[10]]$properties #> NULL #> #> #> #> attr(,"class") #> [1] "geo_list"
geo_linestring(bbox = c(50, 50, 60, 60))
#> $type #> [1] "FeatureCollection" #> #> $features #> $features[[1]] #> $features[[1]]$type #> [1] "Feature" #> #> $features[[1]]$geometry #> $features[[1]]$geometry$type #> [1] "LineString" #> #> $features[[1]]$geometry$coordinates #> $features[[1]]$geometry$coordinates[[1]] #> $features[[1]]$geometry$coordinates[[1]][[1]] #> [1] 52.18563 56.35484 #> #> $features[[1]]$geometry$coordinates[[1]][[2]] #> [1] 52.18660 56.35453 #> #> $features[[1]]$geometry$coordinates[[1]][[3]] #> [1] 52.18728 56.35438 #> #> $features[[1]]$geometry$coordinates[[1]][[4]] #> [1] 52.18809 56.35413 #> #> $features[[1]]$geometry$coordinates[[1]][[5]] #> [1] 52.18811 56.35411 #> #> $features[[1]]$geometry$coordinates[[1]][[6]] #> [1] 52.18868 56.35392 #> #> $features[[1]]$geometry$coordinates[[1]][[7]] #> [1] 52.18964 56.35349 #> #> $features[[1]]$geometry$coordinates[[1]][[8]] #> [1] 52.1908 56.3531 #> #> $features[[1]]$geometry$coordinates[[1]][[9]] #> [1] 52.19120 56.35301 #> #> $features[[1]]$geometry$coordinates[[1]][[10]] #> [1] 52.19194 56.35292 #> #> #> #> #> $features[[1]]$properties #> NULL #> #> #> #> attr(,"class") #> [1] "geo_list"