Export individual images as a pseudo-georectified GeoTIFF
Source:R/uas_exp_geotiff.R
uas_exp_geotiff.Rd
Export individual images as a pseudo-georectified GeoTIFF
Usage
uas_exp_geotiff(
x,
flt = NULL,
idx = NULL,
method = c("near", "binlinear", "cubic")[1],
crs = NULL,
dir_out = ".",
overwrite = FALSE,
use_tmpdir = FALSE,
quiet = FALSE
)
Arguments
- x
A list of class 'uas_info'
- flt
Which flight(s) in x to process (default is all)
- idx
Which row numbers (i.e., images) in the selected flights to process (default is all)
- method
Resampling method to use for the rotation
- crs
coordinate reference system of the output file
- dir_out
The output directory (default is the same folder as the source images)
- overwrite
Overwrite existing files
- use_tmpdir
Use the temp directory
- quiet
Show messages.
Details
This function will export individual image(s) to a pseudo-georectified GeoTIFF, using the estimated ground footprint modeled from the EXIF data. It should be self-evident that footprints should be considered approximate at best, as they modeled from a) the above-launch-point elevation, b) GPS location, c) yaw, and d) camera parameters (all of which have error).
Note: if your goal is simply to view individual images in their approximate
location in desktop GIS software, this function is probably overkill (use uas_worldfile
instead).
A prerequisite for using this function is that you computed footprints when you first created the image collection object (in other words,
be sure to pass pass fp = TRUE
when you run uas_info
). This function also requires that you have `terra` installed.
method
is the name of a resampling method used to create the pseudo-georectified image. The default is near
which is fastest
and should give reasonably good results. See also terra::resample()
.
The crs of the pseudo-georectified image will be the crs of the image collection
object (i.e., UTM). You can override this with the crs
argument. If
provided, crs
should be provided as text as a <authority:number> code (e.g., "epsg:4326"
) or WKT syntax.
For details see terra::project()
.
Note rectifying (unrotating) images can take a long time and result in much larger image files (because GeoTiffs are uncompressed). You can use the
flt
and idx
arguments to specify which flight(s) and images(s) within selected the flights respectively to export.
This function has been tested with JPG files from DJI cameras. It has not yet been fully tested for TIF files from multispectral cameras, and may not work with those formats (contact the package author if you want to try).
Un-rotating the images requires write permission for the directory where the input images are saved (to write a
temporary worldfile). If you don't have write permission where the images reside, pass use_tmpdir = TRUE
.
This will make a temporary copy of the image in the temp directory.