Open MitchStares opened 2 years ago
Simplest method within SF is to import using st_buffer(x, dist = x$radius)
. Circle polygon is a bit chopping and has an insane number of coordinates making them bulky.
For basic implementation within the app, import circles from shapefiles with something like the following:
if(any(names(uploaded[n,]) == "radius")){ circle <- st_buffer(uploaded[n,], dist = uploaded$radius[n,]) proxy %>% addPolygons(data = circle, group = "Draw", layerId = uploaded[n,"iter"]) } else { proxy %>% addMarkers(data = uploaded[n,],group = "Draw") }
Note: the above didn't work, but on principle something close should.
Circles drawn in leaflet via leaflet.draw are recorded as a point with a radius attribute. When imported into SF, records simply as point. Should create a function, or look for existing function to convert to polygon.