Hi there
I am trying to use ggplot
and geom_sf
to create a map but the performance is terrible. It takes over a minute to generate one basic plot. I am looking for ways to make this run quicker so I am not wasting so much time as I iterate through plots.
I am working with a multi polygon shape file that is around 600 MB and has ~24,000 polygons in it. I have tried running st_simplify(map_file, dTolerance = 1000)
which bring the size down to 400 MB, but ggplot
still take a minute to render and I am getting visible distortions in my map.
Here is my super basic plot code that take 60 seconds to return
ggplot(map_file) +
geom_sf(aes(fill = weight)) +
theme_void()
Any ideas on how to make geom_sf
run faster would be much appreciated.