Skip to contents

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)

update_physics_period(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".

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.

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.

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.

See also

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