Update-drivers: Reproject from Latitude and Longitude to Project CRS

Update-driversR Documentation

Reproject from Latitude and Longitude to Project CRS

Description

This function takes a dataframe containing a latitude and longitude column, and replaces them with an X and Y column of coordinates in a new CRS.

Usage

update_boundary_period(start, end, path, convert_units = TRUE)

update_physics_period(start, end, path)

update_physics_period_MA(start, end, path)

Arguments

start

The first year in the target time period.

path

A character string containing the path to a model variant, i.e. "./Models/Region/start-last".

convert_units

logical for backwards compatibility with MiMeMo scripts. Should be set to 'FALSE' and unit conversion performed before saving .rds files.

data

A dataframe containing Longitude and Latitude.

crs

The new Coordinate Reference System to project to.

last

The last year in the target time period.

Details

The function converts a dataframe into an SF object and reprojects into a new CRS. Two coordinate columns are extracted from the geometry column using 'sfc_as_cols', before the geometry column is dropped.

Value

A dataframe, now with an x and y column specifying the coordinates for points in the projects Coordiante Reference System.

Run this function for it's side effects. The appropriate driving file will be updated.

See Also

Other NEMO-MEDUSA spatial tools: Window(), sfc_as_cols(), vectors_2_direction()


Jack-H-Laverick/MiMeMo.tools documentation built on March 6, 2023, 3:44 p.m.