| prj_auxiliary | R Documentation |
Functions to get, set, transform and check presence of prj objects
rmf_get_prj(...) ## S3 method for class 'dis' rmf_get_prj(dis) ## S3 method for class 'modflow' rmf_get_prj(modflow) rmf_has_prj(...) ## S3 method for class 'dis' rmf_has_prj(dis) ## S3 method for class 'modflow' rmf_has_prj(modflow) rmf_set_prj(...) ## S3 method for class 'character' rmf_set_prj(file, dis, prj = rmf_get_prj(dis)) ## S3 method for class 'dis' rmf_set_prj(dis, prj) ## S3 method for class 'modflow' rmf_set_prj(modflow, prj) rmf_transform_prj(...) ## S3 method for class 'prj' rmf_transform_prj(prj, crs) ## S3 method for class 'dis' rmf_transform_prj(dis, crs) ## S3 method for class 'modflow' rmf_transform_prj(modflow, crs)
dis |
|
modflow |
|
file |
path to discretization file; typically "*.dis" |
prj |
|
crs |
coordinate reference system to transform to. Input for |
These functions can also be used with the RMT3DMS library on btn and mt3dms objects.
If prj information is already present, a warning is raised when overwriting.
rmf_set_prj.character writes the projection information of prj directly into the header comments of the discretization file
rmf_transform_prj transforms the origin coordinates to the new crs. If no prj was set, an error is raised.
rmf_get_prj returns a RMODFLOW prj object if present; otherwise NULL
rmf_has_prj returns a logical depending on whether or not a RMODFLOW prj object is present
rmf_set_prj returns either a RMODFLOW dis or modflow object with the prj set or nothing when writing directly to a file.
rmf_transform_prj returns the RMODFLOW object with a transformed crs in the prj object
dis <- rmf_read_dis(rmf_example_file('water-supply-problem.dis'))
rmf_get_prj(dis)
m <- rmf_read(rmf_example_file('example-model.nam'), verbose = FALSE)
rmf_get_prj(m)
# return NULL
rmf_get_prj(rmf_create_dis())
rmf_has_prj(dis)
rmf_has_prj(m)
rmf_has_prj(rmf_create_dis())
dis <- rmf_create_dis()
prj <- rmf_create_prj(origin = c(100, -150))
rmf_set_prj(dis, prj)
# write directly to header comments of file
f <- tempfile()
rmf_write_dis(dis, file = f)
rmf_set_prj(f, dis, prj)
rmf_read_dis(f)
prj <- rmf_create_prj(origin = c(152082, 168000.2), rotation = -12, crs = 31370)
dis <- rmf_create_dis(prj = prj)
rmf_transform_prj(prj, crs = 4326)
rmf_transform_prj(dis, crs = 3044)
## Not run:
# error when no prj is present
rmf_transform_prj(rmf_create_dis(), 3044)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.