[R-sig-Geo] Proj4 natgrid coordinate transformation error

Roger Bivand Roger.Bivand at nhh.no
Mon Mar 24 13:11:51 CET 2014


On Mon, 24 Mar 2014, Jonas Schmedtmann wrote:

> Hi everyone,
> I’m trying to use the nadgird parameter for coordinate transformation 
> from the portuguese Hayford Gauss IGeoE system to UTM 29 WGS84 used in 
> Landsat images for Portugal. I have the following code, which produces 
> an error, so I wonder if I got everything right in my proj4strings. I’ve 
> tried a lot of things, and an intensive google search did not solve my 
> problem either. I got the file 'ptLX_e89.gsb’ from a professor of mine 
> so I assume there’s nothing wrong with it.

The error message says: failed to load datum shift file, suggesting that 
it isn't where it should be.

You didn't report your output from sessionInfo(), not the messages printed 
when rgdal is loaded. The resolution is system-dependent, but at base the 
file must be where PROJ expects to find it. If your rgdal is the CRAN 
Windows oe OSX binary, the directory should be system.file("proj", package 
= "rgdal")[1]; if PROJ is provided externally, where the share/proj 
directory is (default /usr/local/share/proj for source installs).

Roger

>
>> PROJ4_IGEOE<-CRS("+proj=tmerc +lat_0=39.66666666666666 +lon_0=-8.131906111111112 +k=1 +x_0=200000 +y_0=300000 +ellps=intl +units=m +nadgrids=ptLX_e89.gsb +wktext +no_defs")
>> PROJ4_UTM<-CRS("+proj=utm +zone=29 +ellps=WGS84 +datum=WGS84 +units=m")
>> area<-readShapePoly("../01 Dados/02 Dados espaciais/AREA_ESTUDO", proj4string=PROJ4_IGEOE)
>> area_wgs84<-spTransform(area, PROJ4_UTM)
> Error in .spTransform_Polygon(input[[i]], to_args = to_args, from_args = from_args,  :
>  error in pj_transform: failed to load datum shift file
>>
>
> I’d appreciate any help. Thanks in advance!
> Jonas Schmedtmann
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; fax +47 55 95 91 00
e-mail: Roger.Bivand at nhh.no


More information about the R-sig-Geo mailing list