rgismap-projections

How to find the right CRS to plot coordinates derived from another map


I've recorded coordinates of points on some maps (see image below) using the juicr package. However, when I come to plot the points in R, they end up in different places (second image below).

If I use juicr to extract positions of the points along the x and y axes, what do I need to do so that the points are projected to the correct locations? I presume this is a CRS issue (?) but how do I know what the right projection to use is?

Here's the code I'm using to plot the coordinates:

#set theme
theme_set(theme_bw())

#create base map
world <- ne_countries(scale = "medium", returnclass = "sf")
class(world)

base.map <- ggplot(data = world) + 
  geom_sf(color = "dark gray", fill = "white") +
  coord_sf(xlim = c(20, 62), ylim = c(22, 48), expand = FALSE) +
  theme(panel.background = element_rect(fill = "#c6dbef")) +
  theme(plot.title = element_text(lineheight=.8, face="bold"), legend.position = "none")


#create Cupressus sempervirens L. map
#sample of coordinates derived from original map

csem$x <- c(21.06574, 21.45329, 21.64706, 21.84083, 22.95502, 23.68166, 24.02076, 23.87543, 24.0692) 
csem$y <- c(31.85996, 31.85996, 31.62298, 31.82047, 34.50628, 34.62478, 34.46679, 34.38779, 34.34829)
 


#plot occurrence mapCupressus sempervirens L. populations
csem.map <- base.map +
  geom_point(data = csem, aes(x = x, y = y), size = 0.75)+
  scale_color_manual(values=c("#56B4E9", "black")) +
  labs(title = "Distribution of Cupressus sempervirens L. recorded by Browicz") + 
  theme(plot.title = element_text(lineheight=.8, face="bold"), 
        plot.caption = element_text(face = "italic"), 
        legend.position = "none") + 
  theme(axis.title  = element_blank()) +
  theme(plot.caption = element_text(hjust = 0))

csem.map

Image 1 - historic map of species distributions

enter image description here


Solution

  • Your code is working properly, however the coordinates are misaligned; the first 4 points (located on African coast) have latitude misaligned about 0.8 deg.

    I have loaded your scanned map to QGIS, referenced it, and to check if the georeferencing was done properly, have generated a grid 2x2 deg. As you can see, it's aligned with the grid on scan:

    enter image description here

    Using Coordinate Conversion plugin you can check the coordinates of the points:

    enter image description here

    So, your first 4 points:

    newcsem <- data.frame(
      x = c(21.06574, 21.45329, 21.64706, 21.84083),
      y = c(32.62377, 32.55922, 32.32941, 32.65600)
    )
    

    I have leaved longitude coordinates unchanged.

    library(rnaturalearth)
    library(ggplot2)
    #set theme
    theme_set(theme_bw())
    
    #create base map
    world <- ne_countries(scale = "medium", returnclass = "sf")
    class(world)
    #> [1] "sf"         "data.frame"
    
    base.map <- ggplot(data = world) + 
      geom_sf(color = "dark gray", fill = "white") +
      coord_sf(xlim = c(20, 62), ylim = c(22, 48), expand = FALSE) +
      theme(panel.background = element_rect(fill = "#c6dbef")) +
      theme(plot.title = element_text(lineheight=.8, face="bold"), legend.position = "none")
    
    csem <- data.frame(
      x = c(21.06574, 21.45329, 21.64706, 21.84083, 22.95502, 23.68166, 24.02076, 23.87543, 24.0692),
      y = c(31.85996, 31.85996, 31.62298, 31.82047, 34.50628, 34.62478, 34.46679, 34.38779, 34.34829)
    )
    
    newcsem <- data.frame(
      x = c(21.06574, 21.45329, 21.64706, 21.84083),
      y = c(32.62377, 32.55922, 32.32941, 32.65600)
    )
    
    csem.map <- base.map +
      geom_point(data = csem, aes(x = x, y = y), size = 0.75)+
      geom_point(data = newcsem, aes(x = x, y = y, color = "blue"), size = 0.75, )+
      scale_color_manual(values=c("#56B4E9", "black")) +
      labs(title = "Distribution of Cupressus sempervirens L. recorded by Browicz") + 
      theme(plot.title = element_text(lineheight=.8, face="bold"), 
            plot.caption = element_text(face = "italic"), 
            legend.position = "none") + 
      theme(axis.title  = element_blank()) +
      theme(plot.caption = element_text(hjust = 0))
    
    csem.map
    

    You can find georeferenced tiff under link

    Hope it helps, Grzegorz

    Created on 2022-09-04 with reprex v2.0.2