wkt_polygon: Random WKT polygon

Description Usage Arguments Value Examples

View source: R/wkt_polygon.R

Description

Random WKT polygon

Usage

1
2
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

1
2
3
4
5
6
wkt_polygon()
wkt_polygon(num_vertices = 3)
wkt_polygon(num_vertices = 4)
wkt_polygon(num_vertices = 100)
wkt_polygon(10)
wkt_polygon(bbox = c(50, 50, 60, 60))

Example output

[1] "POLYGON ((72.8142050 -1.9720258, 76.8946121 -4.2171133, 73.1163203 -2.9575887, 76.4369283 -4.4913879, 77.5271192 -6.5528993, 62.7482901 -5.7131018, 64.0463193 -3.2543678, 63.7980973 -2.9895910, 70.2142001 -1.8435807, 67.2085449 7.3978601, 72.8142050 -1.9720258))"
[1] "POLYGON ((131.6400044 21.9617813, 131.8817713 18.4564463, 130.0189575 18.0801621, 131.6400044 21.9617813))"
[1] "POLYGON ((75.2970937 -18.1471931, 74.8068776 -27.0968059, 71.6265913 -29.1153417, 64.9296220 -17.3573515, 75.2970937 -18.1471931))"
[1] "POLYGON ((-98.8283256 -6.9863305, -98.2055135 -5.9101149, -98.7192623 -9.8545288, -97.9859643 -6.9997484, -96.7302619 -4.1096243, -99.0368702 -12.0301257, -98.8055753 -11.2873929, -95.0974518 -4.5560401, -97.7673049 -10.0781441, -93.8082062 -4.4158152, -96.9346642 -9.6300679, -94.7073455 -7.1225697, -95.0350093 -8.7005933, -96.1762521 -9.6938772, -93.6103910 -7.9786711, -96.8497854 -10.5502475, -94.3787104 -9.0346508, -91.8145476 -7.4785866, -91.4412291 -8.5438343, -93.8540712 -9.7432517, -98.7658992 -12.0158886, -95.9629574 -11.0617230, -91.4339340 -9.6839488, -98.4736852 -12.0745349, -95.2093221 -11.9818927, -96.0649050 -12.5511768, -98.3570677 -12.3007621, -92.0824260 -14.0917495, -94.1167302 -13.8015206, -94.4483439 -14.0291458, -95.1269919 -13.8709895, -92.8824808 -15.6684818, -91.4320316 -16.5617499, -93.3274061 -15.6744341, -96.3969200 -13.8086680, -94.6620939 -15.0309407, -93.2125703 -16.2112936, -96.2241758 -14.1957337, -91.3197544 -18.7794748, -95.7949126 -15.2412692, -94.1811422 -17.1484432, -94.1949026 -17.5091796, -96.4406765 -15.5456361, -98.5015236 -12.9058748, -96.0109327 -17.7286597, -98.9564022 -12.3362734, -94.8462099 -20.5236558, -96.2852939 -20.8858278, -98.8144891 -13.4976990, -98.0330392 -18.7828390, -98.8435904 -14.3305785, -98.3473159 -20.1379108, -98.9664111 -13.3584205, -101.2745614 -21.1099756, -99.0978031 -12.2219998, -99.1904774 -12.4510313, -105.2429753 -19.9417202, -102.6033859 -15.8614485, -99.9593638 -13.0380751, -101.7923319 -14.1695083, -103.7032394 -15.1641211, -99.8863000 -12.6747787, -104.7068543 -15.5472107, -104.2903670 -15.2255937, -100.7085538 -12.9594650, -100.2055899 -12.5106662, -99.4225452 -12.1622101, -106.4785021 -12.2515364, -101.3445045 -12.1824730, -100.5138484 -12.1379625, -104.8064833 -12.1131139, -106.3858856 -11.6535330, -103.7571833 -11.6852622, -106.5218174 -10.0322228, -108.4687368 -9.0933103, -101.5237323 -11.2873502, -106.3351465 -9.4514884, -106.8711997 -9.0252600, -105.2673780 -8.5680513, -104.3028879 -8.6836817, -100.2398402 -11.3425978, -104.5988529 -8.0682886, -102.9640203 -8.5743357, -99.6262433 -11.5986127, -101.5051162 -9.6144667, -102.7665862 -8.2584976, -101.5556722 -9.4889409, -105.4091651 -5.1803419, -101.9686495 -8.1248673, -102.3243856 -6.9112909, -100.6900717 -9.4890340, -101.0364776 -6.8046217, -100.9407272 -6.4358301, -100.9186838 -5.6738115, -100.0943743 -8.5607173, -99.9777055 -8.3047460, -100.0021131 -7.4376563, -99.2236525 -11.3191687, -99.2534377 -11.1529198, -100.3028367 -3.5858941, -98.8283256 -6.9863305))"
 [1] "POLYGON ((-160.5888842 13.2566184, -154.3764500 13.8845655, -154.6732573 13.6147432, -159.2908555 11.6107723, -160.7107734 9.3405232, -163.6281397 10.6510537, -160.6741622 6.2957055, -163.0054873 8.5193325, -167.6786058 7.5536180, -166.3730713 15.0269108, -160.5888842 13.2566184))"    
 [2] "POLYGON ((127.1543192 -37.6645578, 130.3631388 -42.2068296, 118.8966633 -43.0800785, 121.3662346 -48.4117524, 120.5339432 -52.4486833, 114.9160421 -50.3878738, 110.4049121 -50.5619354, 115.1376972 -42.6003988, 114.0899958 -40.7375158, 112.9032967 -39.1126243, 127.1543192 -37.6645578))"
 [3] "POLYGON ((49.3106588 7.6959199, 47.2487298 -0.4779184, 47.6356566 -0.4717791, 47.1132610 -1.0210238, 44.8863761 -9.3101761, 44.7353868 -5.3769841, 41.1788372 3.2501134, 44.6533947 1.7635521, 46.4304179 0.2590358, 46.0027998 1.7343129, 49.3106588 7.6959199))"                            
 [4] "POLYGON ((-74.1128098 -21.5383503, -77.6006210 -28.8385427, -75.2719367 -27.9011225, -71.5572227 -25.7197565, -75.0324849 -29.3428035, -76.6717952 -35.1376544, -83.8283979 -25.4750973, -81.6848978 -26.9420038, -81.4239458 -21.2167783, -78.5225338 -27.9522747, -74.1128098 -21.5383503))"
 [5] "POLYGON ((54.2286367 -25.9517448, 54.3933000 -25.5022549, 55.2934812 -22.2928977, 57.6649532 -22.4315677, 57.9968955 -24.1274186, 61.6672538 -21.7899211, 61.5888825 -23.9373194, 51.8790125 -23.9085522, 52.6319735 -24.1683216, 52.8647359 -24.1332321, 54.2286367 -25.9517448))"           
 [6] "POLYGON ((-146.0487094 60.5830770, -141.8488551 61.1775018, -144.1873079 58.4233764, -143.7604993 57.2831910, -152.1986508 49.5323773, -152.0256549 52.8153653, -152.8766391 48.2822336, -166.2622279 53.7360198, -160.4370892 56.1028125, -151.2368596 57.0626766, -146.0487094 60.5830770))"
 [7] "POLYGON ((-139.0520990 34.2151717, -138.0312829 30.0492684, -135.0738426 32.1165963, -134.5570029 30.4977268, -131.3803777 30.6605427, -140.0782108 22.4657777, -139.8811725 27.4817074, -146.4453105 27.0548580, -141.5417041 27.8491273, -144.4379681 30.1939281, -139.0520990 34.2151717))"
 [8] "POLYGON ((82.3974008 11.0591119, 91.7570749 7.2757645, 83.1530650 9.3506180, 86.8563692 4.2599410, 84.0760274 7.0629628, 83.3315719 1.3045478, 81.9295151 7.6972050, 78.0040633 3.7716030, 78.8474651 11.3960404, 80.3220093 11.6599167, 82.3974008 11.0591119))"                             
 [9] "POLYGON ((133.8453224 42.7847952, 140.1541846 41.7115715, 133.0138968 39.8759869, 140.0568167 37.3738364, 135.9457261 33.1320780, 134.7213176 34.4236344, 131.8601797 39.3480526, 130.6762654 38.9683686, 125.8228222 36.5278699, 126.4340275 48.6232387, 133.8453224 42.7847952))"           
[10] "POLYGON ((-138.7436237 53.7399487, -138.2337557 53.1448975, -137.8458935 52.2281535, -137.3113304 46.4086897, -143.8186131 52.1021972, -146.1129113 53.5863174, -143.8203376 54.4110005, -154.1384749 56.6488671, -140.2991101 54.2075003, -139.9919798 61.3744448, -138.7436237 53.7399487))"
[1] "POLYGON ((59.8042273 61.9324539, 59.1276301 57.2434744, 71.7504118 63.9527821, 66.4292316 55.7297066, 73.1039314 52.8764564, 63.9210675 54.1731917, 60.9581191 50.5386882, 55.2559897 55.9270530, 49.4944143 59.8075217, 54.1384083 58.6990733, 59.8042273 61.9324539))"

randgeo documentation built on May 2, 2019, 5:15 a.m.