Hi Marc, Maybe You should try to use QGIS software. Is a free and open-source software and is very simple to transform shapefile from a reference system to another also in different format. QGIS is also very powerful with spatial transformation and uses GDAL like R Anyway I will try for you with Barcelona data.
> Message: 2 > Date: Tue, 3 Dec 2013 11:56:07 +0100 > From: Marc Mar? Dell'Olmo <[email protected] <javascript:;>> > To: R-sig-geo mailing list <[email protected] <javascript:;>> > Subject: [R-sig-Geo] Problem converting shp ED50 to WGS84 with > spTransform and writeOGR > Message-ID: > < > caazscq7zxoehfzeqjyt1b3bwthbj5duyu5ahrzte-jfu1je...@mail.gmail.com<javascript:;> > > > Content-Type: text/plain > > 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]] > > > > ------------------------------ > > _______________________________________________ > R-sig-Geo mailing list > [email protected] <javascript:;> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > > End of R-sig-Geo Digest, Vol 124, Issue 3 > ***************************************** > -- Maurizio Marchi ID skype: maurizioxyz *Ubuntu 12.04 (Precise Pangolin)* *"Il bello dell'open-source è che le domande possono essere poste alla fonte"* *utente linux 552.742* [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list [email protected] https://stat.ethz.ch/mailman/listinfo/r-sig-geo
