0

Is this

spTransform(Finland3, CRS("+proj=longlat +ellps=WGS84 +no_defs+ellps=WGS84 +towgs84=0,0,0 "))

the right way to project a shapefile with this projection

coord. ref. : +proj=merc +lon_0=0 +lat_ts=0 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 

to plot it in ggmap on top of a Google map raster?

therefore looking like

+proj=longlat +ellps=WGS84 +towgs84=0,0,0 
  • Please any help is welcome. I need this for my thesis and my tutor is unable to help me in this and I don't know anybody to whom I could ask for advice. – Irene Jul 1 '14 at 13:29
1

Why not just use the gmap() functionality offered by the dismo package instead of ggmap? You can download Google maps of type 'satellite', 'terrain', 'roadmap' and 'hybrid' there as well. The advantage is that the thus aquired maps are instantly available as objects of class 'RasterLayer' or 'RasterStack', holding a defined spatial information.

Setting gmap(..., lonlat = TRUE), you can then use

spTransform(Finland3, CRS(proj4string(map)))

as mentioned above to reproject your Finland shapefile to EPSG:4326 and combine the resulting data sets in one plot.

  • GIS is really not my field I am really sorry if I sound stupid or pathetic. I need to plot my interpolation and/or spatial prediction which I did in R on top of the map. To do this I transformed the dataframe to a raster and would like to clip it so that "it does not get out of the coast". To attain this I understood that I have to us a shapefile, and did this: gis.stackexchange.com/questions/103738/… what I want is to get the first image on top of the second (see the dark shade) but I need a high quality shp. – Irene Jul 1 '14 at 14:04
  • Am I doing it all wrong? – Irene Jul 1 '14 at 14:05
  • If you solve your other problems you will meet a 200 m shift in your data because your EPSG:239x definitions are missing the +towgs84 parameters. Here is a good example of 2393 KKJ / Finland Uniform Coordinate System <2393> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=3500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +no_defs <> – user30184 Jul 1 '14 at 14:22
  • 1
    Best source for high quality data is the National Land Survey of Finland and the Kapsi repository. However, coastline is made in a tricky way and it must be combined from several feature classes. Would sea polygons suit for your purpose? – user30184 Jul 1 '14 at 14:25
1

As suggested by @user30184 the kapsi repository had what I needed, it can be found at this link

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.