0

I have a dataset (2.7 million rows< ) which has given me geometries of various polygons which yields the visual below with this code:

library(tidyverse)
library(sf)

dt %>% 
st_as_sf(wkt  = "geometry")%>%
ggplot()+
geom_sf()

enter image description here

I am trying to use the rnaturalearth package but the geometries given are:

  1. Multipolygons
  2. Do not conform with the polygons I have in my dataset.

The code used to get the relevant data is:

library(rnaturalearth)
world_map <- ne_countries(scale = "large", returnclass = 'sf')
canada_map <- world_map %>% filter(name =="Canada")

Is there a way that I can scale my data so that I can make my Canadian polygons work with the Canadian Polygons in rnatural earth? I have tried to "force" the polygons from my data to have them work with rnaturalearth but it doesn't line up at all.

I hope I was able to explain myself. Any help is greatly appreciated!

Bensstats
  • 988
  • 5
  • 17
  • 2
    Hi, could you please provide your `df` file in some way? Or at least the result of `dput(head(df))`? By doing so you can get better advice on this. Regards – dieghernan Feb 07 '22 at 13:51
  • 1
    Did you already check for projection issues, does `df` have the right crs? I'm not sure if it is created from well known text. Did you try projecting them to the same projection? – Bart Feb 09 '22 at 23:23

0 Answers0