sgo_coordinates: Extracts coordinates from an 'sgo_points' object

sgo_coordinatesR Documentation

Extracts coordinates from an sgo_points object

Description

Extract the coordinates of an sgo_points object expressed as a matrix.

Usage

sgo_coordinates(x, names.xyz = NULL, as.latlon = FALSE,
ll.format=NULL)

Arguments

x

An instance of sgo_points.

names.xyz

Character vector. New names for the columns x, y and possibly z of the object x.

as.latlon

Logical variable. When x is defined in a geodetic coordinate system as lon/lat and this parameter is set to TRUE then it returns the coordinates ordered as lat/lon.

ll.format

Character variable. Applies a format to the returned coordinates when x is defined in a geodetic coordinate system. As of now it only accepts DMS, which will return strings of coordinates formatted as degrees, minutes and seconds (certain accuracy will be lost because seconds are rounded to the second decimal).

Value

A matrix with 2 or 3 named columns.

Examples

p <- sgo_points(list(57.47777, -4.22472), epsg=4326)
coords <- sgo_coordinates(p)


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