Random WKT polygon

wkt_polygon(count = 1, num_vertices = 10, max_radial_length = 10,
  bbox = NULL, fmt = 7)

Arguments

count

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

num_vertices

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

max_radial_length

(integer/numeric) maximum distance that a vertex can reach out of the center of the polygon. Units are in degrees latitude (Approximately 69 miles or 111 km). Default: 10

bbox

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

fmt

(integer/numeric) number of digits. Default: 7

Value

WKT; a character vector with one or more POLYGON strings

Examples

wkt_polygon()
#> [1] "POLYGON ((-76.8041324 23.6710468, -71.4236054 28.2898504, -75.3876372 22.4349528, -68.7436273 22.4494982, -72.3742396 20.9728268, -77.3880824 17.9318015, -80.4318394 17.3616192, -84.6655389 24.8975625, -84.7291013 28.0959312, -77.6737671 24.4254245, -76.8041324 23.6710468))"
wkt_polygon(num_vertices = 3)
#> [1] "POLYGON ((115.2617919 -19.8847888, 109.4879164 -20.4901491, 101.4438588 -23.8155669, 115.2617919 -19.8847888))"
wkt_polygon(num_vertices = 4)
#> [1] "POLYGON ((-79.9294579 17.2179540, -79.2658827 12.3915507, -89.6953990 12.5118859, -86.7392144 20.5541106, -79.9294579 17.2179540))"
wkt_polygon(num_vertices = 100)
#> [1] "POLYGON ((-162.4923546 -22.5598499, -161.4351448 -16.4131903, -162.2772397 -22.2880641, -162.2017225 -22.9770718, -159.0022301 -15.2693619, -159.2576330 -16.1586377, -160.2672885 -18.7383251, -159.8175655 -17.7464984, -162.1680072 -23.2189724, -158.2539684 -17.2956907, -161.2130914 -22.1384534, -159.1778239 -20.8329635, -161.3283056 -22.8949593, -161.0997586 -22.9046218, -160.9100272 -22.7689591, -159.4499715 -21.9079194, -160.9086912 -23.0552194, -157.2993505 -21.2418468, -156.2071225 -21.0553635, -155.8996653 -21.6343140, -162.5512496 -24.0237330, -152.1987273 -21.3668445, -155.8222742 -23.0157285, -162.4179684 -24.0099479, -160.3310396 -23.9858619, -155.3260119 -23.8106299, -157.4985594 -24.1802711, -158.6783864 -24.6381660, -155.1086535 -25.2360951, -159.8015147 -24.5818942, -153.5091804 -26.2974276, -157.6525299 -25.7906229, -157.4392013 -26.7376868, -156.4016744 -27.6224432, -159.9051286 -25.8139404, -160.5469312 -25.9163473, -160.2695200 -26.2535357, -156.6621326 -31.0382943, -158.0199158 -29.9593224, -160.3608648 -27.5769523, -162.4814742 -24.2029676, -162.3332838 -24.4800399, -159.4889583 -30.4950164, -162.3795636 -24.6689079, -162.4987603 -24.3842245, -162.5350813 -24.2278875, -161.8753600 -27.7039989, -162.2847733 -26.2710901, -162.2721136 -28.9415834, -162.3208526 -28.4905136, -162.1722826 -30.9226911, -162.1289575 -32.4481482, -163.2531531 -27.7387067, -165.8831167 -33.4443959, -165.9665806 -33.0787579, -166.2789474 -33.3835938, -164.1653508 -28.2255842, -163.1446009 -25.4785136, -166.8044006 -32.7169920, -164.8197224 -28.8209637, -165.0660094 -27.9997165, -163.8661319 -25.8947658, -163.5139806 -25.1302352, -164.2056249 -25.6068471, -165.6784135 -26.9663890, -164.6078156 -25.4655231, -162.7957762 -24.1810173, -169.7385730 -27.9271486, -169.5970171 -27.7356843, -166.5905582 -25.9003266, -168.8294269 -26.8461333, -163.2219369 -24.3158197, -164.0548047 -24.6602763, -165.4467111 -25.0332063, -171.5225935 -26.6859772, -162.8052716 -24.0829924, -165.2791870 -24.6019398, -169.7209863 -24.9636214, -171.1839813 -25.0176806, -170.3180404 -24.7796139, -163.2838441 -24.0364292, -168.1712556 -23.9119966, -164.7590075 -23.7912482, -171.3476591 -22.7974822, -169.1664620 -21.6085471, -166.1055432 -22.6230293, -168.4403609 -21.5060808, -169.6222542 -20.7816145, -171.9046868 -19.1344347, -167.1692229 -21.4095455, -164.6764091 -22.7689122, -165.2654756 -22.3078546, -167.4503298 -18.4357379, -164.3723401 -22.0045626, -163.2499526 -23.1472806, -164.0204708 -21.7676727, -163.1519840 -22.2394119, -164.1574795 -18.8087699, -162.7528045 -23.3949301, -163.2336601 -15.2478148, -162.4923546 -22.5598499))"
wkt_polygon(10)
#> [1] "POLYGON ((-36.4328512 28.5857591, -35.4288019 27.7477320, -37.5757275 24.1256631, -51.0229347 28.3812938, -51.4398319 29.0065406, -48.5442568 30.5005622, -50.3625440 31.6223502, -41.8047745 32.0052136, -44.3024406 34.2264561, -44.3785168 35.7774308, -36.4328512 28.5857591))" #> [2] "POLYGON ((-83.0125172 70.9814342, -97.1547930 68.4634166, -86.2486560 68.5274402, -82.6073384 64.5262821, -84.2978304 64.8235693, -95.9365301 60.7782440, -101.4459210 67.3770612, -112.2511295 69.4069934, -106.7576393 75.4852277, -104.8884454 75.9122774, -83.0125172 70.9814342))" #> [3] "POLYGON ((-96.1573133 21.4297956, -94.4893737 23.3079266, -94.4131185 19.5404404, -95.6708354 17.7924759, -102.5283008 13.9530503, -103.2926923 21.6772103, -96.8586465 20.8847817, -101.8613943 24.9007772, -99.5907431 25.5809914, -100.0348215 26.5699990, -96.1573133 21.4297956))" #> [4] "POLYGON ((-59.7896235 -30.7997848, -60.8665778 -31.1419092, -66.6167300 -30.0897160, -61.9411997 -33.9996931, -73.3137678 -35.2575696, -74.8200518 -33.2442667, -79.0514673 -26.9449444, -75.4575668 -19.6150639, -72.7583043 -22.4363692, -71.6465765 -22.8158548, -59.7896235 -30.7997848))" #> [5] "POLYGON ((47.3191692 -31.8327763, 53.3798406 -34.0481615, 48.9713300 -37.7483378, 46.4663949 -39.2569910, 36.9331412 -42.7724502, 41.5800900 -38.1632970, 45.0457937 -37.4436029, 46.1569939 -36.7751971, 41.9943125 -29.2740909, 44.3658505 -31.6195725, 47.3191692 -31.8327763))" #> [6] "POLYGON ((-99.9643012 -42.5862718, -96.5126364 -41.6408900, -92.7538525 -48.6129624, -102.6060490 -43.9612095, -107.4061484 -47.0284978, -104.8085380 -44.6502148, -114.5499261 -40.4872773, -105.7425359 -40.1146083, -106.9593011 -37.9993020, -103.0131064 -42.0005625, -99.9643012 -42.5862718))" #> [7] "POLYGON ((-153.0929941 24.2604505, -147.8433472 29.6567619, -148.7759193 23.4925375, -148.0526433 18.8242907, -149.6718431 15.1445838, -154.1403124 22.6202956, -157.1755293 20.2303819, -158.8304947 20.0973645, -154.6349038 22.6866531, -162.8308525 23.6370169, -153.0929941 24.2604505))" #> [8] "POLYGON ((-19.9465501 25.4703134, -19.8736169 25.4703434, -19.9343305 23.6903285, -9.8294888 25.1258392, -19.2915755 23.0738820, -15.6753998 22.9419605, -24.7963842 17.3516447, -23.7581674 21.7310150, -24.6617605 23.5394350, -21.3265848 29.7482438, -19.9465501 25.4703134))" #> [9] "POLYGON ((101.6130369 -34.1899483, 102.2134386 -33.7307729, 95.0321184 -39.6293890, 95.6930995 -40.2754437, 103.4758942 -46.3702777, 100.0404883 -44.7509482, 95.8601068 -43.7219282, 85.8137370 -40.4095010, 94.6060270 -38.0199468, 94.3405135 -35.8601831, 101.6130369 -34.1899483))" #> [10] "POLYGON ((-116.1328336 48.0327234, -114.7520826 45.4013468, -115.9527689 43.9397098, -113.5831781 41.4737911, -106.8498869 41.1457376, -116.2155964 39.2408974, -119.2338534 38.2407596, -119.5574733 38.8914790, -122.4131988 36.3428780, -123.7824870 40.4491421, -116.1328336 48.0327234))"
wkt_polygon(bbox = c(50, 50, 60, 60))
#> [1] "POLYGON ((63.3534760 64.9907345, 69.4176974 58.7366205, 69.9213901 56.5513699, 66.8860545 56.1904634, 67.5812930 52.6600350, 55.8192283 57.4797311, 57.3402090 50.8964803, 52.5516830 56.0708751, 50.6946087 55.6338779, 50.1158167 58.5695898, 63.3534760 64.9907345))"