[R-sig-Geo] Problem with spTransform en +towgs84 ?

Agustin Lobo alobolistas at gmail.com
Tue Sep 21 19:34:35 CEST 2010


Hi!

Might it be that spTransform is not taking the +towgs84 string into account?
I have:
> proj4string(polsfl1_1000)
[1] " +proj=utm +zone=31 +ellps=intl +units=m +no_defs +towgs84=-87,-98,-121"

and do:
> polsfl1_1000lonlat <- spTransform(polsfl1_1000, CRS("+proj=longlat +datum=WGS84"))
> writeOGR(polsfl1_1000,  dsn="/media/TRANSCEND/FLUXPYR/FLIGHT201009/polsfl1_1000",layer="polsfl1_1000", driver="ESRI Shapefile")
> writeOGR(polsfl1_1000lonlat,  dsn="/media/TRANSCEND/FLUXPYR/FLIGHT201009/polsfl1_1000lonlat.kml",layer="polsfl1_1000", driver="KML")

Then, in QGIS, with reprojection on the fly activated, the 2 vectors
are not coincident.
Instead, a polsfl1_1000lonlatv2 made from the original polsfl1_1000
shapefile in QGIS, is coincident.

As there are 2 different programs here, I'm not positive of my diagnostic. But
I think there is a problem with spTransform

Thanks

Agus



More information about the R-sig-Geo mailing list