sgo_transform: Coordinate transformation of a set of points

View source: R/sgo_transform.R

sgo_transformR Documentation

Coordinate transformation of a set of points

Description

Transforms the coordinate system of a set of points to any supported coordinate system.

Usage

sgo_transform(x, to = NULL, ...)

Arguments

x

A sgo_points object.

to

Specifies the EPSG code to convert the coordinates to. See sgo_points for a list of supported EPSG codes.

...

Additional parameters passed to internal functions. Currently it supports the additional arguments seen in sgo_bng_lonlat and sgo_lonlat_bng.

Details

This function is a wrapper of specific transformation functions (sgo_bng_lonlat, sgo_en_wgs84, sgo_lonlat_bng, sgo_wgs84_en, sgo_laea_etrs, sgo_etrs_laea, sgo_cart_lonlat, sgo_lonlat_cart) that transforms the coordinate system of a set of points to any of the supported coordinate systems.

Please note that this package assumes that the Coordinate Reference Systems (CRS) ETRS89 and WGS84 are the same within the UK, but this shouldn't be a problem for most civilian use of GPS satellites. If a high-precision transformation between WGS84 and ETRS89 is required then it is recommended to use a different package to do the conversion.

According to the Transformations and OSGM15 User Guide, p. 8: "...ETRS89 is a precise version of the better known WGS84 reference system optimised for use in Europe; however, for most purposes it can be considered equivalent to WGS84." and "For all navigation, mapping, GIS, and engineering applications within the tectonically stable parts of Europe (including UK and Ireland), the term ETRS89 should be taken as synonymous with WGS84.".

Warning: Coordinates defined in the Geodetic Coordinate System EPSG:4277 (with datum OSGB 1936) should only be used to convert to or from BNG coordinates and for historical reasons only.

Value

An object of class 'sgo_points'.

See Also

sgo_points, sgo_coordinates, sgo_set_gcs, sgo_bng_ngr

Examples

ln <- c(-4.22472, -2.09908)
lt <- c(57.47777, 57.14965)
n <- c("Inverness", "Aberdeen")
df <- data.frame(n, ln, lt, stringsAsFactors = FALSE)
locations <- sgo_points(df, coords=c("ln", "lt"), epsg=4326)

locations.bng <- sgo_transform(locations, to=27700)
locations.osgb36 <- sgo_transform(locations, to=4277)
locations.ngr <- sgo_bng_ngr(sgo_transform(locations, to=27700))
locations.wgs84EN <- sgo_transform(locations.bng, to=3857)

sgo documentation built on Sept. 23, 2022, 5:08 p.m.