wfsconvert: Convert coordinates

wfsconvertR Documentation

Convert coordinates

Description

  • The function convert_bbox converts (the coordinates of) a bbox from one CRS to another

  • The function convert_points converts a set of points (in vector or matrix form) from one CRS to another

Usage

convert_bbox(coords, crs_in, crs_out)

convert_points(coords, crs_in, crs_out, out_matrix = T, keep_names = T)

Arguments

coords

Numeric vector with four elements indicating the bounding box (for convert_bbox ) or a numeric vector of even length or numeric matrix with two columns (for convert_points )

crs_in

Character string with the name of the input crs (e.g. "EPSG:4326" )

crs_out

Character string with the name of the output crs (e.g. "EPSG:28992" )

out_matrix

Logical indicating that the output of convert_points should be matrix

keep_names

Logical indicating that the output of convert_points keeps the column names when the input is a matrix

Value

The convert_bbox returns a numeric vector of class bbox and the convert_points returns a numeric matrix with two columns (if outmatrix == FALSE a vector is returned)

Examples

bbox_28992 <- c(119103, 480726, 119160, 481078)
bbox_4326  <- convert_bbox(bbox_28992,"EPSG:28992","EPSG:4326")
points_4326 <- convert_points(bbox_28992,"EPSG:28992","EPSG:4326")

HanOostdijk/HOQCwfs documentation built on March 6, 2023, 8:18 a.m.