rgisepsg

Does sgo R package give accurate UK latitude and longitude?


Newbie here, so please be gentle with me!

My council has released some data about tree protection orders (TPOs) in EPSG 27700 format. So an example would be 448098.4741, 271753.1604

I want to convert this to latitude and longitude so I can add it to a Google map. I've tried using this web tool https://gridreferencefinder.com/batchConvert/batchConvert.php This seemed to give accurate results.

But I have a lot of points to convert and would rather use R to handle the large amount of data. I'm using the sgo_transform function in the sgo package but it is giving very slightly different results to the web tool. I know nothing about GIS and am winging it. Does anyone know which is likely to be more accurate?

The web tool converts my example to 52.341754, -1.2954299 The sgo package gives 52.34177, -1.295411

My R code:

x <- c(448098.4741, 448028.2853)
y <- c(271753.1604, 271665.0542)
locations <- sgo_points(list(x, y), epsg=27700)
locations.osgb36 <- sgo_transform(locations, to=4326)

As you can see, I'm testing this with 2 points, but the example I've described is the first point.

Thanks in advance...Carrie


Solution

  • Disclaimer: I wrote the sgo package.

    This answer will try to address the original question 'Does sgo R package give accurate UK latitude and longitude?'

    sgo is using the OSTN15 model to convert between ETRS89 and OSGB36 (see their online transformation tool here). This model has been developed by Ordanance Survey and is considered the definitive ETRS89/OSGB36 transformation. So, sgo should be very accurate for the OSGB36/ETRS89 transformation.

    sgo also applies the OSTN15 model to the OSGB36/WGS84 transformation (i.e. to EPSG:4326) because it considers ETRS89 and WGS84 to be equivalent - although there are actually some differences mainly because of the continental drift, and these differences increase every year at a rate of ~2.5cm. However, as others have already answer before, this shouldn´t be currently a problem for small scale maps. If we were applying the results on large scale maps where high accuracy is necessary then we probably should look for a different tool to convert between ETRS89 and WGS84.

    sf seems to also consider ETRS89 and WGS84 to be equivalent when using the default transformation:

    x <- c(448098.4741, 448028.2853)
    y <- c(271753.1604, 271665.0542)
    loc.sf <- st_as_sf(data.frame(x,y), coords=c("x", "y"), crs=27700)
    
    loc.4326 <- st_transform(loc.sf, crs=4326)
    loc.4258 <- st_transform(loc.sf, crs=4258)
    
    st_coordinates(loc.4326)
              X        Y
    1 -1.295423 52.34176
    2 -1.296466 52.34097
    
    st_coordinates(loc.4258)
              X        Y
    1 -1.295423 52.34176
    2 -1.296466 52.34097
    

    Finally, as far as I can tell from looking at the source code of gridreferencefinder, it appears to be using a Helmert transformation to do the job. The accuracy ot that operation is in the order of 7m for 90% of Great Britain as it is stated in their library code (https://gridreferencefinder.com/include/geotools2.min.js).

    Hope this helps.