create_raster_metadata: Create raster XML metadata file

Description Usage Arguments Details Value Examples

View source: R/create_raster_metadata.R

Description

This function writes an XML file containing the information on the extent, projection, and dimensions of the input dataset. This is designed to be an alternative for the template argument for other functions.

Usage

1
create_raster_metadata(data_layers, output_file)

Arguments

data_layers

A Raster object for which metadata will be created.

output_file

A character file path to the XML file to which the metadata will be written.

Details

The information in the XML file does not create an exactly identical raster in terms of extent and resolution compared to the original input raster, most likely because of infinite precision issues. In other words, testing the extent and resolution of a raster created from the XML file and the original raster with identical() yields FALSE. However, testing them with all.equal(), which allows for small numerical differences, yields TRUE. It is likely that this is not a major problem because the raster package still performs map algebra without issue. However, this has not yet been tested in ArcGIS (and may apprently be remedied with the Snap Raster environment setting if it is a problem). For all display purposes, the rasters may be considered as exactly identical.

Value

Nothing. This function has a side-effect of writing to a file.

Examples

1
2
3
4
## Not run: 
create_raster_metadata(mod.brick, "C:/Desktop/metadata.xml")

## End(Not run)

jnghiem/bfasttools documentation built on Nov. 4, 2019, 3:02 p.m.