I have two data frames with different coordinates reference systems, one in WGS 84 and the other is the British National Grid.
When I transform them into the same crs definition (WGS 84) one of the two always has more decimal digits, and that is the one that had the British National Grid crs.
How can I get the two to match in decimal precision after transformation? I can manage this when rasterising the two objects however, I lose some points.
Here's what I have tried:
#Convert XY coordinates into Shapefiles and transform to WGS 84 police <- sf.test %>% distinct(NAME, Longitude, Latitude) %>% group_by(NAME) %>% st_as_sf(coords = c("Longitude", "Latitude"), crs = 4326) %>% st_transform(crs = 4326) %>% nest(data=c(NAME, geometry)) #Then drop the geometry points and cast as a data frame sf.test1 <- police$data %>% bind_cols %>% st_cast(to = "POINT") %>% dplyr::mutate( X = sf::st_coordinates(geometry)[,1], Y = sf::st_coordinates(geometry)[,2] ) %>% sf::st_drop_geometry()
However, the coordinates still remain different which can be shown by the difference in Longitude and Latitude coordinates after using
#first dataset already projected to crs 4326 Longitude = c(-0.679025, -2.516919, -2.512773, -2.514442, -2.515072), Latitude = c(50.781688, 51.423683, 51.411751, 51.409343, 51.419357) #second dataset after conversion Longitude = c(`1` = -0.500616835380604, `2` = -0.500579742731822, `3` = -0.500562231052187, `4` = -0.500551492843239, `5` = -0.50060557136444), Latitude = c(`1` = 51.5996873520887, `2` = 51.5995448459169, `3` = 51.5994186801437, `4` = 51.5992603285579, `5` = 51.5988473256556))