3

My knowledge in GIS and R is again tested when I want to map a small part of northern Greenland (called Washington Land) in R (and plot analysis data on top later).

I've managed to plot it with

library(maps)
library(mapdata)
library(rworldmap)
map("worldHires", "Greenland", xlim=c(-67,-63), ylim=c(78,82))
newmap <- getMap(resolution = "high")
plot(newmap, xlim=c(-67, -63), ylim=c(78,82), asp=1)

But resolution and projection is horrible for this area and my need.

I have a good map in MapInfo, but how should I output a map, so it can load in R and R can plot data accurately on top of it?

5

You could use the freely available Level 2 GADM shapefile data for Greenland, which comes in EPSG:4326 (Lat/Lon projection) by default, and import it into R using the GDAL functionalities offered by the rgdal package. Then, define the geographic extent for Washington Land and crop the previously imported shapefile. Make sure you have all the required dependencies installed (e.g. rgeos)

# Required packages
library(rgdal)
library(raster)

# Import Greenland shapefile data
shp.greenland <- readOGR(dsn = "/path/to/shapefile/folder", 
                         layer = "GRL_adm2")

# Define cropping extent for Washington Land
ext.washington.land <- extent(-67, -63, 78, 82)

# Subset Greenland shapefile
shp.washington.land <- crop(shp.greenland, ext.washington.land)

Update:
Now, if you'd like to include glaciated areas, you could download e.g. the corresponding 10m shapefile from Natural Earth, import and crop it according to the predefined extent, and add it to your plot.

# Import glaciated areas
shp.glaciers <- readOGR(dsn = "/path/to/shapefile/folder", 
                        layer = "ne_10m_glaciated_areas")

# Subset (and plot) glaciated areas by extent of Washington Land
shp.glaciers <- crop(shp.glaciers, ext.washington.land)

plot(shp.washington.land, col = "darkolivegreen3")
plot(shp.glaciers, col = "azure", add = TRUE)

Washington Land glaciated

  • It looks better yes. I'm having a small issue with the code. It says it can't find the "shp.adm2" file. I can't see it in the downloaded files either? – user3178323 Jun 23 '14 at 9:07
  • Ah, sorry for that. I just forgot to rename a variable in the above code. Now it should work (: – fdetsch Jun 23 '14 at 9:24
  • great, but now I realize that there is no inner boundary from the inland ice which pose a problem. Does gadm files include this data, and how do I inspect/explore the gadm shp file? – user3178323 Jun 23 '14 at 9:38
  • See above update. What information do you need about the shapefiles? – fdetsch Jun 23 '14 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.