Create a RMODFLOW projection object

rmf_create_prj(
  origin = c(0, 0, 0),
  rotation = 0,
  crs = NA,
  ulcoordinate = FALSE,
  nodecoordinate = FALSE,
  dis = NULL
)

Arguments

origin

numeric vector with the x & y (and optionally z) coordinates of the origin which by default is the lowerleft corner of the model. Defaults to c(0, 0, 0).

rotation

numeric; counterclockwise rotation angle (in degrees). Rotation is around the lowerleft corner of the model. Defaults to 0.

crs

coordinate reference system of the model. Any values accepted by sf::st_crs may be defined. Defaults to NA.

ulcoordinate

logical; if TRUE, origin refers to the upperleft cell instead of the lowerleft.

nodecoordinate

logical; if TRUE, origin refers to the cell center instead of the cell corner.

dis

RMODFLOW dis object. Only required when ulcoordinate or nodecoordinate is TRUE.

Value

an object of class prj which is a list with the (1) origin vector containing x, y and z coordinates of the lowerleft corner, (2) the rotation angle in degrees counterclockwise and (3) the coordinate reference system as an sf crs object

Details

origin should be specified in the length units defined by crs. If no z coordinate is specified in origin, it is set to zero. crs is set by a call to sf::st_crs. Rotation is around the lowerleft corner of the model. RMODFLOW does not work optimally for geographic coordinate systems.

Examples

rmf_create_prj(origin = c(152082, 168000.2), rotation = -12, crs = 31370)
#> RMODFLOW Projection object: #> Origin coordinates (x y z) of the lowerleft corner: #> 152082 168000.2 0 #> Grid rotation (degrees counterclockwise): #> -12 #> Coordinate Reference System: #> EPSG: 31370 #> proj4string: +proj=lcc +lat_0=90 +lon_0=4.36748666666667 +lat_1=51.1666672333333 +lat_2=49.8333339 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +units=m +no_defs
dis <- rmf_create_dis() rmf_create_prj(origin = c(120, 300, 13), ulcoordinate = TRUE, dis = dis)
#> RMODFLOW Projection object: #> Origin coordinates (x y z) of the lowerleft corner: #> 120 -700 13 #> Grid rotation (degrees counterclockwise): #> 0 #> Coordinate Reference System: #> NA