[R-sig-Geo] Re: [R] Using transform on spproj package.

Ernesto Jardim ernesto at ipimar.pt
Fri Jun 10 00:40:45 CEST 2005


Hi,

Following the advice from Roger I'm posting this issue on r-sig-geo.

The previous thread is below.

Responding Roger, yes you're correct these locations are near Cabo de 
Sines, so I should correct the proj4string to latlon.

However my main issue still exists. Why the transform is working on X only ?

EJ

ps: I'm using linux with R2.1.0 and I'm new to the sp family.

On Thu, 9 Jun 2005, Ernesto Jardim wrote:

> Hi,
> 
> I'm trying to use transform my mercator locations into utm but I'm doing 
> something wrong because only x is transformed ... see

Two points: I think you are getting the transform you specify, from
+proj=merc to +proj=utm with a different x origin - I suspect you meant
+proj=latlong for the input data. If the coordinates below are somewhere
off Cabo de Sines, they are latlong.

Second, spproj is not on CRAN, so either the R-spatial-dev mailing list on
sourceforge (where spproj and friends are living while they grow up) or
the R-sig-geo list might have been a good choice. Please consider
continuing this on R-sig-geo.

Best wishes,

Roger

> 
>  > xy.sp
> SpatialPoints:
>         loni  lati
>   [1,] -8.85 38.16
>   [2,] -9.19 37.99
>   [3,] -9.11 37.97
>   [4,] -9.06 38.15
>   [5,] -9.03 37.87
>   [6,] -9.14 37.81
>   [7,] -9.09 37.70
>   [8,] -8.95 37.45
>   [9,] -9.17 37.37
> [10,] -9.00 37.34
> Coordinate Reference System (CRS) arguments: +proj=merc +datum=WGS84
>  > transform(xy.sp, CRS("+proj=utm +zone=29"))
> SpatialPoints:
>           loni     lati
>   [1,] 1505638 38.62347
>   [2,] 1505638 38.45141
>   [3,] 1505638 38.43116
>   [4,] 1505638 38.61335
>   [5,] 1505638 38.32995
>   [6,] 1505638 38.26922
>   [7,] 1505638 38.15788
>   [8,] 1505638 37.90485
>   [9,] 1505638 37.82388
> [10,] 1505638 37.79351
> Coordinate Reference System (CRS) arguments:  +proj=utm +zone=29 
> +ellps=WGS84
> 
> What am I doing wrong ?
> 
> Thanks
> 
> EJ
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the R-sig-Geo mailing list