[R-sig-Geo] error - converting latlong to utm

Roger Bivand Roger.Bivand at nhh.no
Fri Aug 30 16:01:42 CEST 2013


Do not post HTML!

Yes, you have reversed your eastings and northings, so -115N is out of 
bounds for obvious reasons.

Roger

On Fri, 30 Aug 2013, Ludmila Rattis wrote:

> Hi everyone,
>
> I tried to convert five different matrix of geographic coordinates using
> this code, but just two didn't work:
>
> *The code:*
>
> gila_centroid_latlong<-data.frame(Y=gila_centroid[,2],X=gila_centroid[,3])
> coordinates(gila_centroid_latlong) <- ~ X + Y
>
> ##*And the error occurs here:*.
>
> proj4string(gila_centroide_latlong)<- CRS("+proj=longlat +ellps=WGS84
> +datum=WGS84")
>
> Error in `proj4string<-`(`*tmp*`, value = <S4 object of class "CRS">) :
>  Geographical CRS given to non-conformant data: -115.675801995
>
> and for another species...
>
> proj4string(tas_centroide_latlong)<- CRS("+proj=longlat +ellps=WGS84
> +datum=WGS84")
> Error in `proj4string<-`(`*tmp*`, value = <S4 object of class "CRS">) :
>  Geographical CRS given to non-conformant data: 148.34508586
>
> proj4string(gila_centroid_latlong)<- CRS("+proj=longlat +ellps=WGS84
> +datum=WGS84")
> gila_centroid_utm <- spTransform (gila_centroid_latlong, CRS("+proj=utm
> +zone! ellps=WGS84"))
>
>
>
>
> Someone knows what's going on???
>
> I would really appreciate some help.
> Best wishes,
>
>

-- 
Roger Bivand
Department of Economics, NHH Norwegian School of Economics,
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