Dear all,

I'm trying to convert a map of Barcelona (in shp format) with reference
ED50 to a kml with Google Maps reference. I have used the following syntax,
but it creates a slightly displaced map (maybe just a few meters) and do
not understand why!


setwd("C:/dir")
barcelona <- readOGR("C:/dir", "Dist_postals_BCN")
proj4string(barcelona) <- CRS("+proj=utm +zone=31 +ellps=intl +units=m
+no_defs")
# Or proj4string(barcelona) <- CRS("+init=epsg:23031")
x1 <- spTransform(barcelona, CRS("+proj=longlat +datum=WGS84 +no_defs"))
writeOGR(x1, "districtes.kml", "x1" ,  driver="KML")


If you want to try, you can download the ED50 shp map here:
https://dl.dropboxusercontent.com/u/14934021/map.zip

And here de displaced kml:
https://dl.dropboxusercontent.com/u/14934021/districtes.kml

Thank you!!

Marc

	[[alternative HTML version deleted]]

