[R-sig-Geo] Eurostat shapefiles & google maps offset

Julian M. Burgos julian.burgos at hafogvatn.is
Wed Mar 29 19:39:53 CEST 2017


Martin, as far as I know Google images are in EPSG:3857, which is an
spherical Mercator projection, and not in WSG84.  The solution is to use
the spTransform function to project your polygons to EPSG:3857.

Julian

Martin Zuba writes:

> Dear list,
>
> I would like to plot shaded shapefiles with static google maps background
> images.
>
> I obtain the shapefiles from Eurostat, via the eurostat R package.
>
> I obtain the static google background images from using the get_map wrapper
> from the R package ggmap.
>
> My problem is that there seems to be an offset between those two coordinate
> systems. I know that the Eurostat files uss the coordinate reference system
> ETRS89 and google maps uses WSG84, which should be (almost) identical.
>
> However, google images and the shapefiles are somwhat off; and that offset
> is not constant, which indicates that there might be a problem related to
> projections.
>
>
> illustration:
> https://www.dropbox.com/s/34k2ace42ubjjek/eurostatVSgoogle.png?dl=0
>
> replication:
> https://www.dropbox.com/s/hhoc84lrmo42imf/niceEurostat.R?dl=0
>
>
> I welcome any suggestions.
>
> Best Regards,
>
> Martin Zuba
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


--
Julian Mariano Burgos, PhD
Hafrannsóknastofnun, rannsókna- og ráðgjafarstofnun hafs og vatna/
Marine and Freshwater Research Institute
Skúlagata 4, 121 Reykjavík, Iceland
Sími/Telephone : +354-5752037
Bréfsími/Telefax:  +354-5752001
Netfang/Email: julian.burgos at hafogvatn.is



More information about the R-sig-Geo mailing list