2

I would like to use ggmap to plot several data points on top of a koppen-geiger climate map. The kopper-geiger data and GIS/KMZ maps can be downloaded here: http://koeppen-geiger.vu-wien.ac.at/present.htm

I've managed to have a code to plot the points on regular maps, obtained through the get_map function but I fail to use other maps such as koppen-geiger.

Any help will be appreaciated!

biojl
  • 1,060
  • 1
  • 8
  • 26
  • What have you tried so far? What errors did you encounter? Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap May 12 '16 at 16:05
  • I don't get errors (yet) because I don't know how to do it or if it's even possible. I've only obtained maps in the past using the function get_map. In the ggmap manual theres a small paragraph at the end that shows how to import the shape from a .shp file using fortify (ggplot2) but that's not what I want, I need a painted map in the background with the climate data. – biojl May 12 '16 at 16:10

1 Answers1

3

Your basic problem is that the map you are attmepting to use is an image file that is not georeferenced. So unless you want to go through the unnecessary and probably time consuming process of georeferencing this image yourself, you will be better taking an alternative approach. There are perhaps a few ways to do this. But, unless you have very few data points to overlay on the map which you can place manually using the lat-long grid of the image, then the least painful method will certainly be to redraw the map yourself using the shapefile. This is not the right place to give you an introductory lesson on GIS, but the basic steps are to

  1. Download shapefile (which is available at the same website as the image you linked)
  2. Project map to desired coordinate system
  3. Plot map, coloring by climate class
  4. Color the ocean layer
  5. Add labels, legend, and graticule, as desired
  6. Overplot with your own climate data, and legend for these.

If you are unsure how to approach any of these steps, then take an introductory course on GIS, and search the Web for instructional materials. You may find this resource useful.

https://cran.r-project.org/doc/contrib/intro-spatial-rl.pdf

dww
  • 30,425
  • 5
  • 68
  • 111