I would like to create an interactive map, using the plotly package in R.
However, I face the issue now that my geodata is contained in a shx shapefile, which the plot_ly()
function seems to have issues with, as it does not contain long and lat but the known geometry lists. How do I solve this issue?
Here a selection of the geodata that I read in using the st_read()
function:
structure(list(mun_id = 1, geometry = structure(list(structure(list(
structure(c(2680604.962, 2680570.93, 2680546.48, 2680527.546,
2680510.696, 2680475.176, 2680438.55, 2680419.956, 2680402.976,
2680401.001, 2680403.759, 2680394.18, 2680394.198, 2680397.223,
2680409.448, 2680420.546, 2680584.215, 2680601.274, 2680582.464,
2680570.35, 2680563.675, 2680564.359, 2680563.087, 2680554.433,
2680547.215, 2680537.773, 2680517.273, 2680503.011, 2680497.39,
2680494.454, 2680490.761, 2680485.479, 2680485.692, 2680488.398,
2680499.302, 2680492.059, 2680482.144, 2680473.227, 2680462.278,
2680455.456, 2680445.046, 2680434.409, 2680410.975, 2680401.454,
2680391.141, 2680380.1, 2680358.844, 2680333.986, 2680324.375,
2680314.134, 2680306.394, 2680298.573, 2680262.984, 2680239.015,
2680214.995, 2680188.918, 2680177.336, 2680162.854, 2680148.802,
2680112.306, 2680103.188, 2680093.781, 2680087.144, 2680080.896,
2680046.376, 2680033.146, 2680018.796, 2680007.668, 2679995.177,
2679969.759, 2679956.435, 2679942.832, 2679927.139, 2679832.957,
2679783.446, 2679773.215, 2679752.005, 2679744.955, 2679731.374,
2679705.994, 2679682.602, 2679658.233, 2679643.723, 2679629.883,
2679614.341, 2679592.331, 2679572.421, 2679556.94, 2679527.52,
2679498.829, 2679480.949, 2679473.258, 2679442.524, 2679437.945,
2679433.363, 2679427.146, 2679421.884, 2679403.806, 2679391.035,
2679381.045, 2679367.895, 2679356.655, 2679351.385, 2679334.305,
2679339.914, 2679341.974, 2679299.512, 2679274.593, 2679254.491,
2679247.271, 2679219.399, 2679223.2, 2679184.407, 2679183.247,
2679195.017, 2679201.927, 2679209.778, 2679220.017, 2679233.617,
2679242.247, 2679243.617, 2679231.849, 2679220.23, 2679209.859,
2679197.212, 2679191.08, 2679183.264, 2679175.355, 2679175.455,
2679180.075, 2679180.488, 2679176.725, 2679166.545, 2679136.245,
2679128.409, 2679117.939, 2679110.154, 2679107.809, 2679105.379,
2679085.444, 2679058.349, 2679049.939, 2679040.164, 2679019.259,
2679007.137, 2678996.153, 2678984.188, 2678960.422, 2678943.753,
2678925.343, 2678905.372, 2678875.591, 2678862.081, 2678852.886,
2678841.281, 2678828.156, 2678817.026, 2678807.476, 2678796.121,
2678769.911, 2678749.02, 2678740.25, 2678725.37, 2678700.795,
2678681.635, 2678671.625, 2678629.999, 2678609.309, 2678595.934,
2678583.679, 2678571.594, 2678563.959, 2678548.009, 2678499.012,
2678472.587, 2678452.398, 2678436.346, 2678414.501, 2678403.226,
2678399.986, 2678389.776, 2678371.926, 2678319.885, 2678311.345,
2678310.77, 2678316.135, 2678317.979, 2678318.665, 2678318.755,
2678305.375, 2678289.61, 2678277.67, 2678268.02, 2678254.475,
2678243.459, 2678242.254, 2678238.074, 2678260.965, 2678343.655,
2678347.385, 2678422.151, 2678426.486, 2678428.736, 2678440.736,
2678418.966, 2678408.325, 2678400.595, 2678431.995, 2678453.455,
2678450.544, 2678460.49, 2678462.546, 2678468.086, 2678474.422,
2678494.1, 2678498.337, 2678477.253, 2678471.951, 2678457.561,
2678459.469, 2678453.304, 2678446.613, 2678444.913, 2678444.003,
2678444.372, 2678436.703, 2678428.573, 2678426.142, 2678422.672,
2678422.442, 2678419.501, 2678419.591, 2678416.131, 2678414.731,
2678426.401, 2678439.851, 2678466.421, 2678479.271, 2678484.571,
2678482.78, 2678473.06, 2678475.7, 2678512.155, 2678517.58,
2678533.56, 2678547.73, 2678538.17, 2678560.659, 2678546.859,
2678532.19, 2678511.309, 2678485.297, 2678474.082, 2678469.828,
2678473.534, 2678467.514, 2678462.619, 2678455.849, 2678450.899,
2678439.64, 2678432.865, 2678395.225, 2678393.337, 2678392.669,
2678393.323, 2678396.099, 2678396.69, 2678396.58, 2678395.336,
2678362.508, 2678340.474, 2678333.174, 2678324.091, 2678303.011,
2678281.281, 2678251.461, 2678231.461, 2678206.911, 2678206.411,
2678204.471, 2678204.631, 2678232.13, 2678223.21, 2678222.791,
2678222.165, 2678218.18, 2678219.991, 2678230.111, 2678232.331,
2678233.091, 2678232.721, 2678230.661, 2678200.653, 2678200.081,
2678200.329, 2678201.48, 2678203.514, 2678206.355, 2678209.87,
2678213.142, 2678285.153, 2678294.233, 2678299.313, 2678299.962,
2678269.194, 2678264.294, 2678253.844, 2678245.324, 2678252.561,
2678260.87, 2678268.371, 2678276.9, 2678284.538, 2678292.185,
2678299.806, 2678308.301, 2678323.084, 2678429.405, 2678444.285,
2678458.516, 2678474.78, 2678489.97, 2678551.407, 2678550.948,
2678557.308, 2678549.079, 2678543.754, 2678508.858, 2678507.128,
2678466.979, 2678452.349, 2678250.185, 2678240.65, 2678231.426,
2678222.745, 2678122.995, 2678110.695, 2678124.805, 2678140.845,
2678187.096, 2678190.886, 2678190.506, 2678187.846, 2678188.246,
2678191.837, 2678197.168, 2678204.867, 2678229.698, 2678239.079,
2678244.657, 2678247.657, 2678248.799, 2678247.883, 2678256.009,
2678376.539, 2678398.919, 2678411.129, 2678425.949, 2678531.65,
2678583.921, 2678576.571, 2678572.381, 2678570.549, 2678604.012,
2678647.554, 2678653.483, 2678672.545, 2678723.046, 2678770.686,
2678816.567, 2678821.009, 2678865.556, 2678886.859, 2678922.216,
2678922.765, 2678924.805, 2678932.082, 2678944.806, 2679058.081,
2679074.471, 2679076.081, 2679082.53, 2679090.891, 2679157.71,
2679164.191, 2679169.449, 2679174.23, 2679177.04, 2679178.04,
2679179.567, 2679179.488, 2679191.566, 2679326.108, 2679352.278,
2679381.573, 2679403.258, 2679406, 2679432.688, 2679454.98,
2679508.866, 2679521.933, 2679548.336, 2679555.155, 2679565.77,
2679675.761, 2679728.529, 2679749.126, 2679765.488, 2679769.269,
2679748.97, 2679744.549, 2679757.718, 2679825.683, 2679833.602,
2679842.295, 2679850.856, 2679857.63, 2679862.78, 2679867.931,
2679890.429, 2679896.944, 2679903.169, 2679911.992, 2679920.547,
2679929.365, 2679938.345, 2679939.055, 2679938.071, 2679938.766,
2679934.02, 2679935.645, 2679953.716, 2679976.565, 2679979.864,
2679987.323, 2679990.438, 2679991.543, 2679993.426, 2679991.892,
2679993.046, 2679995.314, 2679997.284, 2679999.131, 2680007.295,
2680008.755, 2680024.874, 2680038.247, 2680050.064, 2680061.955,
2680068.471, 2680072.485, 2680075.767, 2680088.099, 2680090.988,
2680102.091, 2680126.901, 2680157.25, 2680181.308, 2680183.29,
2680180.971, 2680178.24, 2680175.141, 2680172.036, 2680168.741,
2680164.883, 2680168.505, 2680234.965, 2680256.797, 2680276.559,
2680297.53, 2680318.108, 2680347.596, 2680372.536, 2680400.574,
2680476.695, 2680500.774, 2680533.96, 2680540.256, 2680569.086,
2680601.916, 2680655.983, 2680675.438, 2680745.574, 2680792.718,
2680806.098, 2680946.456, 2680992.656, 2681014.786, 2681024.186,
2681049.826, 2681070.676, 2681076.796, 2681090.086, 2681116.386,
2681154.916, 2681145.876, 2681140.476, 2681132.336, 2681136.426,
2681137.736, 2681139.606, 2681134.906, 2681132.729, 2681095.828,
2681066.386, 2681077.736, 2681073.595, 2681093.465, 2681121.255,
2681135.335, 2681127.965, 2681108.285, 2681103.495, 2681091.135,
2681089.245, 2681067.595, 2681043.415, 2681023.875, 2681007.865,
2680984.175, 2680962.515, 2680945.185, 2680927.585, 2680927.265,
2680959.665, 2681006.125, 2681030.975, 2681050.025, 2681048.185,
2681039.204, 2681029.294, 2681035.584, 2681024.284, 2681007.914,
2680990.306, 2680987.854, 2680973.954, 2680955.524, 2680932.444,
2680921.455, 2680896.108, 2680868.788, 2680812.944, 2680786.128,
2680759.973, 2680728.122, 2680703.641, 2680697.913, 2680627.442,
2680604.962, 1236344.185, 1236364.095, 1236373.734, 1236374.727,
1236367.165, 1236346.372, 1236321.277, 1236309.779, 1236308.789,
1236308.38, 1236293.44, 1236272.615, 1236253.056, 1236237.611,
1236217.157, 1236207.315, 1235439.016, 1235427.88, 1235401.546,
1235378.698, 1235354.915, 1235338.422, 1235323.497, 1235301.648,
1235291.585, 1235282.045, 1235264.091, 1235246.299, 1235224.265,
1235189.155, 1235157.363, 1235127.254, 1235082.665, 1235068.874,
1235041.598, 1235035.207, 1235041.46, 1235046.421, 1235051.782,
1235054.538, 1235058.21, 1235061.331, 1235066.294, 1235032.636,
1235035.63, 1235028.791, 1235015.649, 1234997.744, 1234993.032,
1234989.968, 1234988.815, 1234988.602, 1234992.239, 1234993.067,
1234992.777, 1234990.639, 1234989.039, 1234985.644, 1234980.766,
1234963.804, 1234958.54, 1234951.95, 1234946.459, 1234940.525,
1234902.858, 1234890.128, 1234878.767, 1234871.247, 1234865.448,
1234857.293, 1234854.145, 1234852.404, 1234852.17, 1234857.538,
1234863.386, 1234841.108, 1234843.646, 1234842.496, 1234838.366,
1234838.476, 1234848.676, 1234868.516, 1234881.426, 1234889.896,
1234896.255, 1234909.955, 1234918.895, 1234921.145, 1234919.525,
1234913.775, 1234907.135, 1234871.085, 1234864.154, 1234863.742,
1234864.099, 1234865.88, 1234868.796, 1234882.455, 1234894.394,
1234906.984, 1234926.704, 1234941.184, 1234949.964, 1234939.844,
1234897.334, 1234867.744, 1234869.474, 1234873.664, 1234881.444,
1234850.944, 1234786.004, 1234783.684, 1234704.715, 1234700.315,
1234683.905, 1234677.695, 1234673.775, 1234673.385, 1234675.685,
1234657.715, 1234629.596, 1234628.017, 1234625.579, 1234622.63,
1234618.247, 1234616.637, 1234615.33, 1234614.815, 1234606.805,
1234602.895, 1234590.721, 1234588.916, 1234586.161, 1234564.92,
1234561.04, 1234562.33, 1234572.9, 1234591.83, 1234593.205,
1234612.555, 1234615.36, 1234622.584, 1234633.109, 1234639.079,
1234647.759, 1234665.414, 1234674.674, 1234690.043, 1234698.497,
1234703.968, 1234707.938, 1234709.223, 1234713.543, 1234721.206,
1234738.156, 1234750.941, 1234756.066, 1234754.731, 1234756.456,
1234783.255, 1234808.56, 1234824.125, 1234836.65, 1234848.245,
1234865.279, 1234870.119, 1234876.044, 1234877.899, 1234883.754,
1234897.657, 1234900.994, 1234899.939, 1234900.899, 1234878.578,
1234891.777, 1234896.934, 1234898.194, 1234905.104, 1234912.084,
1234911.604, 1234918.604, 1234936.029, 1234988.724, 1235001.744,
1235023.929, 1235038.109, 1235044.054, 1235053.289, 1235064.164,
1235124.375, 1235135.135, 1235144.37, 1235156.56, 1235167.94,
1235200.48, 1235218.39, 1235234.79, 1235245.43, 1235275.51,
1235278.1, 1235339.461, 1235343.66, 1235348.39, 1235358.22,
1235398.11, 1235421.34, 1235445.595, 1235470.92, 1235480.379,
1235494.859, 1235503.782, 1235506.622, 1235502.968, 1235504,
1235524.879, 1235534.43, 1235538.036, 1235550.981, 1235564.546,
1235566.602, 1235571.539, 1235580.949, 1235584.509, 1235591.799,
1235595.989, 1235604.739, 1235618.579, 1235621.099, 1235642.369,
1235648.039, 1235671.819, 1235675.549, 1235695.648, 1235700.938,
1235698.277, 1235702.558, 1235716.598, 1235727.427, 1235742.858,
1235757.907, 1235781.488, 1235788.196, 1235769.294, 1235776.616,
1235781.666, 1235798.596, 1235824.836, 1235856.185, 1235873.015,
1235889.793, 1235911.265, 1235948.325, 1235968.04, 1235993.265,
1236004.664, 1236008.863, 1236014.114, 1236025.894, 1236038.543,
1236076.837, 1236095.363, 1236180.445, 1236187.666, 1236195.651,
1236203.049, 1236215, 1236219.302, 1236225.571, 1236231.723,
1236310.069, 1236363.843, 1236388.01, 1236422.305, 1236420.655,
1236421.416, 1236417.626, 1236417.806, 1236418.936, 1236455.628,
1236482.488, 1236517.468, 1236590.848, 1236639.358, 1236651.344,
1236715.141, 1236787.758, 1236807.227, 1236848.008, 1236865.637,
1236884.767, 1236898.348, 1236907.769, 1237013.229, 1237017.254,
1237021.718, 1237026.038, 1237030.073, 1237033.621, 1237036.504,
1237038.279, 1237069.957, 1237077.648, 1237087.688, 1237099.317,
1237268.039, 1237276.529, 1237280.299, 1237286.97, 1237289.375,
1237291.531, 1237292.95, 1237293.959, 1237294.319, 1237294.175,
1237293.536, 1237292.251, 1237288.466, 1237252.901, 1237249.372,
1237247.608, 1237247.474, 1237249.13, 1237260.497, 1237263.098,
1237264.348, 1237308.539, 1237311.9, 1237291.648, 1237294.648,
1237480.79, 1237479.141, 1237491.3, 1237492.637, 1237495.48,
1237499.766, 1237562.503, 1237559.992, 1237571.973, 1237588.313,
1237647.611, 1237658.561, 1237670.241, 1237697.171, 1237716.421,
1237734.271, 1237747.761, 1237759.861, 1237786.77, 1237802.867,
1237819.39, 1237837.23, 1237856.16, 1237890.686, 1237890.19,
1237920.169, 1237925.309, 1237923.029, 1237912.239, 1238000.738,
1238031.777, 1238052.546, 1238071.646, 1238076.08, 1238088.302,
1238097.988, 1238067.006, 1238037.242, 1238060.896, 1238058.355,
1238034.289, 1238032.884, 1238032.57, 1238050.239, 1238080.551,
1238068.494, 1238056.49, 1238023.291, 1238027.299, 1238102.867,
1238108.616, 1238119.344, 1238149.954, 1238180.12, 1238393.265,
1238415.688, 1238436.122, 1238459.117, 1238477.841, 1238487.253,
1238512.451, 1238543.665, 1238541.86, 1238498.004, 1238498.859,
1238507.559, 1238491.1, 1238512.009, 1238501.86, 1238477.279,
1238444.639, 1238417.366, 1238400.642, 1238388.755, 1238393.475,
1238381.075, 1238370.781, 1238365.274, 1238358.418, 1238426.442,
1238449.479, 1238470.356, 1238486.399, 1238378.067, 1238379.813,
1238380.32, 1238379.418, 1238377.459, 1238375.035, 1238371.726,
1238351.825, 1238347.071, 1238343.339, 1238339.18, 1238336.25,
1238334.244, 1238333.183, 1238315.267, 1238310.813, 1238307.945,
1238297.235, 1238287.399, 1238261.055, 1238246.544, 1238241.664,
1238234.231, 1238226.517, 1238222.585, 1238220.391, 1238216.585,
1238202.351, 1238194.496, 1238182.721, 1238175.101, 1238166.085,
1238167.336, 1238147.421, 1238132.086, 1238128.265, 1238119.68,
1238111.24, 1238107.016, 1238099.82, 1238081.66, 1238076.203,
1238069.014, 1238062.981, 1238046.462, 1238030.37, 1238028.01,
1238025.006, 1238022.372, 1238020.155, 1238018.536, 1238017.349,
1238016.556, 1238007.419, 1237992.302, 1237982.027, 1237952.435,
1237931.087, 1237925.406, 1237918.581, 1237903.746, 1237850.994,
1237804.823, 1237787.913, 1237759.672, 1237736.15, 1237747.959,
1237769.281, 1237788.061, 1237788.054, 1237797.886, 1237777.865,
1237763.461, 1237626.733, 1237548.694, 1237521.824, 1237504.824,
1237493.394, 1237479.964, 1237462.384, 1237435.024, 1237441.654,
1237443.415, 1237395.275, 1237369.665, 1237352.065, 1237323.375,
1237280.635, 1237242.435, 1237220.845, 1237204.434, 1237173.262,
1237171.515, 1237148.295, 1237122.205, 1237101.195, 1237065.405,
1237052.985, 1237030.445, 1237001.945, 1236983.195, 1236963.085,
1236957.955, 1236951.535, 1236955.765, 1236942.515, 1236917.925,
1236914.455, 1236909.345, 1236890.195, 1236883.445, 1236868.015,
1236841.515, 1236811.905, 1236791.736, 1236769.006, 1236714.606,
1236686.496, 1236658.386, 1236647.876, 1236630.566, 1236592.256,
1236576.453, 1236573.166, 1236562.226, 1236506.776, 1236481.716,
1236476.159, 1236456.259, 1236442.846, 1236428.335, 1236417.239,
1236409.745, 1236409.425, 1236401.672, 1236343.515, 1236344.505,
1236344.185, 720.723, 718.27, 719.837, 716.867, 708.035,
686.725, 662.265, 650.235, 645.661, 645.351, 645.467, 645.048,
645.351, 645.098, 645.15, 645.439, 644.753, 648.768, 649.92,
651.145, 651.447, 651.092, 649.982, 649.27, 648.742, 647.976,
648.281, 650.194, 650.329, 648.5, 647.523, 647.327, 648.239,
649.375, 652.342, 652.813, 651.958, 651.492, 650.702, 650.47,
650.145, 649.961, 649.666, 646.227, 645.92, 644.363, 642.658,
641.443, 640.916, 640.166, 639.592, 638.988, 638.069, 637.813,
637.445, 637.428, 637.575, 637.756, 637.506, 637.065, 635.872,
634.82, 634.068, 633.531, 633.063, 633.659, 634.024, 634.122,
633.84, 633.511, 633.456, 633.424, 633.321, 636.758, 635.512,
631.395, 637.958, 639.092, 640.398, 640.441, 638.49, 638.74,
640.489, 642.356, 642.749, 644.682, 646.354, 645.992, 643.896,
638.958, 636.188, 624.559, 626.592, 626.813, 627.262, 628.003,
628.775, 630.628, 631.398, 631.898, 632.464, 632.93, 633.476,
628.363, 636.994, 635.769, 634.619, 634.114, 634.724, 625.178,
603.344, 603.193, 589.741, 589.416, 586.967, 585.438, 583.973,
582.128, 580.126, 571.095, 558.136, 557.725, 557.617, 557.31,
557.029, 556.894, 556.568, 556.337, 556.434, 556.128, 553.715,
553.646, 553.462, 553.204, 553.083, 552.902, 552.967, 552.334,
552.292, 552.111, 551.57, 551.374, 551.52, 550.986, 550.79,
550.77, 550.6, 550.136, 550.121, 549.715, 549.885, 549.32,
549.071, 548.738, 548.521, 548.469, 548.28, 548.042, 547.72,
546.819, 545.925, 545.622, 545.539, 544.804, 544.742, 544.568,
543.753, 543.678, 543.419, 543.179, 542.977, 542.755, 542.568,
541.396, 541.053, 540.824, 540.557, 540.158, 539.988, 539.775,
539.53, 539.033, 538.14, 537.969, 537.477, 536.895, 536.587,
536.489, 536.451, 535.467, 535.079, 534.271, 533.989, 533.814,
533.023, 532.717, 532.466, 535.747, 566.568, 567.165, 600.617,
601.475, 604.033, 612.476, 613.182, 612.663, 612.702, 629.607,
638.277, 638.165, 641.136, 641.366, 641.37, 641.113, 637.628,
637.125, 636.023, 635.518, 632.893, 632.708, 631.908, 631.747,
631.423, 630.119, 630.351, 629.372, 628.315, 628.033, 628.029,
627.485, 626.56, 626.18, 624.999, 625.001, 625.419, 626.205,
628.75, 630.06, 631.458, 632.117, 634.29, 635.305, 638.958,
640.042, 644.893, 651.572, 654.235, 666.143, 668.706, 670.557,
671.481, 670.223, 669.542, 668.736, 666.955, 666.887, 666.869,
666.788, 666.764, 666.658, 666.05, 664.755, 664.708, 664.759,
664.696, 664.5, 664.405, 664.271, 663.99, 662.959, 662.38,
662.029, 660.541, 657.232, 656.518, 653.999, 652.413, 649.6,
655.141, 654.083, 651.425, 658.71, 657.803, 657.488, 656.648,
659.663, 660.541, 660.3, 659.255, 658.012, 657.149, 656.831,
651.435, 651.504, 651.276, 651.35, 651.434, 651.524, 651.533,
651.523, 651.564, 651.152, 650.652, 650.363, 649.604, 648.952,
648.091, 648.102, 648.333, 648.629, 648.835, 648.979, 649.124,
649.21, 649.314, 649.417, 649.486, 652.818, 653.591, 654.405,
655.223, 656.004, 659.201, 659.292, 659.488, 661.595, 661.413,
659.637, 659.374, 658.965, 658.139, 646.579, 646.291, 645.97,
645.63, 641.708, 641.313, 642.13, 643.637, 651.934, 653.261,
654.705, 657.066, 659.398, 660.961, 662.481, 664.036, 665.894,
666.023, 666.474, 666.768, 666.557, 665.974, 666.856, 686.423,
690.411, 692.054, 693.66, 725.518, 732.833, 731.443, 732.042,
731.574, 707.962, 678.524, 682.008, 676.361, 646.95, 623.148,
612.36, 612.305, 604.592, 601.816, 596.934, 597.019, 597.085,
597.426, 597.357, 602.201, 603.255, 603.133, 602.458, 601.835,
594.836, 594.003, 593.352, 592.766, 592.488, 592.398, 592.242,
592.048, 592.615, 607.666, 610.481, 614.217, 622.394, 620.339,
625.069, 629.529, 635.908, 642.385, 646.887, 649.004, 648.996,
683.857, 723.94, 740.021, 750.742, 747.071, 742.095, 738.086,
738.313, 758.758, 758.686, 758.827, 758.91, 758.863, 758.949,
759.06, 760.148, 760.533, 760.727, 760.958, 761.383, 761.697,
762.204, 765.232, 766.181, 766.815, 768.223, 769.931, 775.985,
780.768, 781.434, 783.098, 784.965, 785.6, 786.1, 787.867,
790.215, 791.804, 792.262, 792.645, 794.766, 794.969, 797.678,
800.929, 803.893, 807.381, 809.193, 810.249, 812.319, 816.432,
817.146, 819.283, 824.667, 830.259, 834.786, 836.429, 836.419,
836.619, 836.68, 836.729, 836.714, 836.717, 837.352, 842.962,
844.872, 848.984, 851.931, 853.102, 854.88, 856.628, 862.048,
871.878, 874.055, 880.264, 884.852, 885.072, 882.355, 881.01,
882.637, 884.217, 885.413, 886.637, 882.424, 838.491, 837.48,
832.747, 827.916, 827.079, 823.447, 821.211, 831.75, 853.984,
858.982, 865.026, 869.95, 875.731, 871.394, 862.979, 857.712,
854.762, 841.705, 829.337, 829.357, 830.979, 822.738, 818.355,
821.652, 807.715, 808.148, 805.449, 803.579, 803.845, 792.217,
783.533, 782.488, 782.238, 782.024, 779.396, 780.815, 783.79,
783.304, 785.916, 778.011, 771.863, 776.747, 777.32, 775.001,
769.901, 776.262, 773.714, 765.024, 759.435, 759.404, 760.423,
773.669, 775.28, 774.981, 773.166, 771.22, 764.842, 760.583,
754.992, 746.251, 740.387, 733.012, 722.258, 720.723), dim = c(550L,
3L))), class = c("XYZ", "POLYGON", "sfg"))), class = c("sfc_POLYGON",
"sfc"), precision = 0, bbox = structure(c(xmin = 2678110.695,
ymin = 1234561.04, xmax = 2681154.916, ymax = 1238543.665), class = "bbox"), z_range = structure(c(zmin = 532.466,
zmax = 886.637), class = "z_range"), crs = structure(list(input = "CH1903+ / LV95 + LN02 height",
wkt = "COMPOUNDCRS[\"CH1903+ / LV95 + LN02 height\",\n PROJCRS[\"CH1903+ / LV95\",\n BASEGEOGCRS[\"CH1903+\",\n DATUM[\"CH1903+\",\n ELLIPSOID[\"Bessel 1841\",6377397.155,299.1528128,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4150]],\n CONVERSION[\"Swiss Oblique Mercator 1995\",\n METHOD[\"Hotine Oblique Mercator (variant B)\",\n ID[\"EPSG\",9815]],\n PARAMETER[\"Latitude of projection centre\",46.9524055555556,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8811]],\n PARAMETER[\"Longitude of projection centre\",7.43958333333333,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8812]],\n PARAMETER[\"Azimuth of initial line\",90,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8813]],\n PARAMETER[\"Angle from Rectified to Skew Grid\",90,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8814]],\n PARAMETER[\"Scale factor on initial line\",1,\n SCALEUNIT[\"unity\",1],\n ID[\"EPSG\",8815]],\n PARAMETER[\"Easting at projection centre\",2600000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8816]],\n PARAMETER[\"Northing at projection centre\",1200000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8817]]],\n CS[Cartesian,2],\n AXIS[\"(E)\",east,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"(N)\",north,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n USAGE[\n SCOPE[\"Cadastre, engineering survey, topographic mapping (large and medium scale).\"],\n AREA[\"Liechtenstein; Switzerland.\"],\n BBOX[45.82,5.96,47.81,10.49]],\n ID[\"EPSG\",2056]],\n VERTCRS[\"LN02 height\",\n VDATUM[\"Landesnivellement 1902\"],\n CS[vertical,1],\n AXIS[\"gravity-related height (H)\",up,\n LENGTHUNIT[\"metre\",1]],\n USAGE[\n SCOPE[\"Engineering survey, topographic mapping.\"],\n AREA[\"Liechtenstein; Switzerland.\"],\n BBOX[45.82,5.96,47.81,10.49]],\n ID[\"EPSG\",5728]]]"), class = "crs"), n_empty = 0L)), row.names = 1L, class = c("sf",
"data.frame"), sf_column = "geometry", agr = structure(c(mun_id = NA_integer_), levels = c("constant",
"aggregate", "identity"), class = "factor"))
You can simply use plot_ly
or plot_geo
for this. Or you can plot in ggplot2
and then use ggplotly
function.
Here's the plot for one polygon that you provided:
plot_ly(df)
plot_geo(df)