Converting coordinates

Hey everyone,

I have a data frame, which consists of several coordinates in the UTM33N system. For better understanding I want to convert them into the "normal" WGS84 / GPS coordinate system. There are some Excel spreadsheets and converters online, but a simple R command would be way easier to convert all at once. Unfortunately, everything I can find online like the sf package etc looks super complicated to me since I'm a total beginner in R.
Any ideas or alternatives?

Kind regards,
Kingpin

I adapted this example from the one included in the sf package helpfiles, which I agree is rather cluttered.

#something to start with 
(sfc = st_sfc( st_point(c(7,52)),
               st_point(c(-30,20)),
               crs = 2264)) #some random crs other than WGS84

#transform to WGS84
st_transform(sfc, "+proj=longlat +datum=WGS84")

I suggest you stick with the {sf} package - it may seem complicated at first, but once you get the hang of it it becomes rather easy (especially compared to earlier implementations).

The function you look for is sf::st_transform(), you may use either proj4 string as nirgrahamuk mentioned, or, as projections are highly standardized, an EPSG code - 4326 stands for WGS84 - which may be slightly easier.

Thank you guys! I'll give it a try. :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.