Crop a raster and convert the output tiles into new formats.
Source:R/raster_to_raw_tiles.R
raster_to_raw_tiles.Rd
This function has been deprecated as of terrainr 0.5.0 in favor of the new function, make_manifest. While it will be continued to be exported until at least 2022, improvements and bug fixes will only be made to the new function. Please open an issue if any features you relied upon is missing from the new function!
Details
This function crops input raster files into smaller square tiles and then converts them into either .png or .raw files which are ready to be imported into the Unity game engine.
See also
Other data manipulation functions:
combine_overlays()
,
georeference_overlay()
,
merge_rasters()
,
vector_to_overlay()
Other visualization functions:
combine_overlays()
,
geom_spatial_rgb()
,
vector_to_overlay()
Examples
if (FALSE) { # \dontrun{
if (!isTRUE(as.logical(Sys.getenv("CI")))) {
simulated_data <- data.frame(
id = seq(1, 100, 1),
lat = runif(100, 44.04905, 44.17609),
lng = runif(100, -74.01188, -73.83493)
)
simulated_data <- sf::st_as_sf(simulated_data, coords = c("lng", "lat"))
output_files <- get_tiles(simulated_data)
temptiff <- tempfile(fileext = ".tif")
merge_rasters(output_files["elevation"][[1]], temptiff)
raster_to_raw_tiles(temptiff, tempfile())
}
} # }