[R-sig-Geo] LatLong to UTM zone and coordinates?

Roger Bivand Roger.Bivand at nhh.no
Fri Dec 30 09:36:50 CET 2011


On Wed, 28 Dec 2011, yaniv brandvain wrote:

>
> Dear all,I have a lot of global lat-long data, and want to find the UTM 
> coordinates and zones for each.I tried using the convUL function in the 
> PBSmapping package, but it seemed to get the zone wrong for entries far 
> from the equator. A similar problem arose when using latlong2grid in 
> SpatialEpi.Suggestions would be much appreciated.yaniv

Use spTransform in rgdal once you have found the target zone. You might 
find the target zone with a sequence of longitudes in steps of 6 degrees, 
and findInterval() to assign the zones; splitting on the sign of the 
latitude could also give you +south if you want it. You will have to 
subset the Spatial* object by zone, as each object can only have a single 
coordinate reference system. You might also like to consider whether and 
why you want to assign UTM coordinates, as it does lead to your data set 
being split up into many parts.

Roger


> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> 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, 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