I am trying to convert longitude and latitude values for UK weather stations to UK Ordnance Survey National Grid References. There are sites where one can do them one at a time but I have a large number. I have found some code which does the conversion and include the first three points which I want to convert as an example
library(sp) xy<-as.data.frame(cbind(c(55.8533,55.8551,55.8473),c(-2.38588,-2.39620,-2.11304))) colnames(xy)<-c("lon","lat") xy coordinates(xy)<-~lon+lat ## see site in jounral convert llon lat proj4string(xy)<-CRS("+init=epsg:4326") ptsOS<-spTransform(xy,CRS("+init=epsg:27700")) ptsOS but it doesn't give the right answers - the output doesn't correspond to either what I get whn I put an individual point into a conversion site nor with other points in the same region which I have got from other sources and are mutually compatible Can anyone explain where I'm going wrong and how I can fix this? Thanks Nick Wray [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo