[R-sig-Geo] Conversion geographical coodinate in UTM

Roger Bivand Roger.Bivand at nhh.no
Tue Jul 1 00:56:31 CEST 2014


On Mon, 30 Jun 2014, Barry Rowlingson wrote:

> Not your fault that readShapeSpatial ignores the projection!
>
> I think Roger recently spoke about fixing these things...

The underlying shapelib code will not be maintained, anmd 
maptools::readShape* will be deprecated very soon. Always use 
rgdal::readOGR() for reading shapefiles - it reads thje *.prj file. the 
maptools functions cannot do so. The fix is to make maptools::readShape* 
defunct.

Roger

>
> Barry
>
>
>
> On Mon, Jun 30, 2014 at 4:33 PM, Gilles Benjamin Leduc <gbl1 at hi.is> wrote:
>> Thanks Barry,
>>
>> That's it… Sorry if my question was too simple… I'm not a geograph, I'm a molecular biologist… so I'm not used to these packages … I started from the simple script I had for normal maps… (and it is monday, brain isn't fully operational!)
>>
>> Benjamin
>>
>>
>>
>>
>> Le Lundi 30 Juin 2014 15:12 GMT, Barry Rowlingson <b.rowlingson at lancaster.ac.uk> a écrit:
>>
>>> On Mon, Jun 30, 2014 at 3:18 PM, Sarah Goslee <sarah.goslee at gmail.com> wrote:
>>> > Hi,
>>> >
>>> > At a guess, your Front dataset doesn't have a CRS set, so
>>>
>>> Probably because you've used readShapeSpatial which ignores projection
>>> info from shapefiles...
>>>
>>> >> Front<-readShapeSpatial("ISL_adm0.shp")
>>> >> class(Front)
>>> >> [1] "SpatialPolygonsDataFrame"
>>>
>>> Use rgdal:
>>>
>>> require(rgdal)
>>> Front = readOGR(".","ISL_adm0")
>>>
>>> then check Front has a proj4string. summary(Front) should mention it.
>>>
>>> This is getting to be the R-sig-geo equivalent of R FAQ 7.31..
>>>
>>> Barry
>>
>>
>>
>
> _______________________________________________
> 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