0

I have some coordinated in SWEREF 99 TM which I cannot convert into WGS84 using the proj4 package in R.

temp <-  data.frame (x = c(598223, 598812, 598824, 598232, 597614, 597629), 
        y = c(7095460, 7095426, 7094827, 7094227, 7094821, 7095433))


ptransform(temp, 
    src.proj = '+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ',
    dst.proj = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs', silent=TRUE)

Note that the output is not equivalent to coordinates in Sweden - latitudes are equivalent to those near the equator.

AEM
  • 919
  • 1
  • 9
  • 22
  • The answer to this question is at https://gis.stackexchange.com/questions/318254/transforming-coordinates-using-r-sweref-to-wgs84/318255#318255 – AEM Apr 09 '19 at 14:27

1 Answers1

0

I managed to transform the coordinates using SpatialPoints and spTransform from rgdal :

temp <- data.frame (x = c(598223, 598812, 598824, 598232, 597614, 597629), y = c(7095460, 7095426, 7094827, 7094227, 7094821, 7095433))

temp <- SpatialPoints (temp, proj4string = CRS ('+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs'))

temp <- as.data.frame (spTransform(temp, CRS('+proj=longlat +datum=WGS84 +no_defs')))

AEM
  • 919
  • 1
  • 9
  • 22