5 Raster Data Model
5.2 Load libraries
library(sf) # vector spatial data classes and functions
#library(raster) # [OLD] raster spatial data classes and functions
library(terra) # [NEW] raster spatial data classes and functions
library(tmap) # noninteractive and interactive maps
library(stars) # spatiotemporal arrays classes and functions
library(ggplot2) # non-spatial and spatial plotting
library(units) # units conversions
5.3 Schematic representation of a raster
5.3.3 Raster data & metadata
We can distinguish two blocks in a raster (also called grid):
-
metadata, such as
- class, e.g. SpatRaster, (OLD: RasterLayer)
- size, e.g. 3264 x 4800 pixels (nrows x ncols)
- resolution, e.g. 5 meters (synonims are CELLSIZE, PIXELSIZE)
- extent / bounding box (xmin, xmax, ymin, ymax)
- crs (a geographic or projected coordinate system, generally in the proj4 format or EPSG code)
- no data value, e.g. -9999 (synonims are NODATAVALUE, NODATA)
- source (location of file on hard disk, such as ../docente_Langella/Raster-Data/dem5m_vt.tif)
-
data, that is a matrix (=grid) of cells (=pixels)
- the grid of cells has size nrows x ncols
- each cell in a grid store one numeric value (e.g. integer or double number)
- (we can have multiple layers as depicted in the multidimensional raster data representaion)
5.4 Import raster | example: D.E.M.
The command ?rast search for raster string in the documentation.
If the terra package is not loaded in R, the command below gives a warning that nothing was found.
?rast
Load the terra package in R
The command below open the documentation of the rast()
function of the terra
package in the help:
?rast
getwd()
#> [1] "/home/giuliano/lectures"
5.4.1 Import (i.e. read) a raster
One of the most common rasters used worldwide is the one storing the elevation of each point of land surface.
This kind of raster is called D.E.M., that is Digital Elevation Model.
The raster has the data matrix in which each pixel stores the value of elevation of that surface on Earth.
Any time we are interested in reading a geodata (raster or vector) we need three diferent information:
- path to the file (e.g.
../datasets/raster/
), - file name (
dem5m_vt
), - file extension (
tif
), use a point to separate the filename and the extension.
dem <- rast("../datasets/raster/dem5m_vt.tif")
class(dem)
#> [1] "SpatRaster"
#> attr(,"package")
#> [1] "terra"
hasValues(dem)
#> [1] TRUE
5.4.2 Metadata
5.4.2.1 Print the dem metadata
dem
#> class : SpatRaster
#> size : 3264, 4800, 1 (nrow, ncol, nlyr)
#> resolution : 5, 5 (x, y)
#> extent : 453000, 477000, 4556000, 4572320 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 33N (EPSG:32633)
#> source : dem5m_vt.tif
#> name : dem5m_vt
5.4.2.2 Extent
ext(dem)
#> SpatExtent : 453000, 477000, 4556000, 4572320 (xmin, xmax, ymin, ymax)
5.4.2.3 Bounding Box
st_bbox(dem)
#> xmin ymin xmax ymax
#> 453000 4556000 477000 4572320

Figure 5.3: Bounding Box Visualization
ymax(dem)
#> [1] 4572320
5.4.2.4 Pixelsize or (spatial) resolution
res(dem)
#> [1] 5 5
5.4.2.5 How many rows are in the height of the bounding box?
Written using the metadata from the print of dem above:
(4572320 - 4556000)/5
#> [1] 3264
Written using the R object dem called by dedicated functions > ymax() , ymin() , res()
5.4.2.6 About the Coordinate Reference System\(\ldots\)
Using terra::crs
:
terra::crs(dem) # {terra}
#> [1] "PROJCRS[\"WGS 84 / UTM zone 33N\",\n BASEGEOGCRS[\"WGS 84\",\n DATUM[\"World Geodetic System 1984\",\n ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n LENGTHUNIT[\"metre\",1]]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4326]],\n CONVERSION[\"UTM zone 33N\",\n METHOD[\"Transverse Mercator\",\n ID[\"EPSG\",9807]],\n PARAMETER[\"Latitude of natural origin\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8801]],\n PARAMETER[\"Longitude of natural origin\",15,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8802]],\n PARAMETER[\"Scale factor at natural origin\",0.9996,\n SCALEUNIT[\"unity\",1],\n ID[\"EPSG\",8805]],\n PARAMETER[\"False easting\",500000,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8806]],\n PARAMETER[\"False northing\",0,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8807]]],\n CS[Cartesian,2],\n AXIS[\"(E)\",east,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"(N)\",north,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n USAGE[\n SCOPE[\"Engineering survey, topographic mapping.\"],\n AREA[\"Between 12°E and 18°E, northern hemisphere between equator and 84°N, onshore and offshore. Austria. Bosnia and Herzegovina. Cameroon. Central African Republic. Chad. Congo. Croatia. Czechia. Democratic Republic of the Congo (Zaire). Gabon. Germany. Hungary. Italy. Libya. Malta. Niger. Nigeria. Norway. Poland. San Marino. Slovakia. Slovenia. Svalbard. Sweden. Vatican City State.\"],\n BBOX[0,12,84,18]],\n ID[\"EPSG\",32633]]"
Note: if you use the cat()
function to print the previous command, you’ll get the same result as given below. Please, try it!
Using sf::st_crs
:
sf::st_crs(dem) # {sf}
#> Coordinate Reference System:
#> User input: WGS 84 / UTM zone 33N
#> wkt:
#> PROJCRS["WGS 84 / UTM zone 33N",
#> BASEGEOGCRS["WGS 84",
#> DATUM["World Geodetic System 1984",
#> ELLIPSOID["WGS 84",6378137,298.257223563,
#> LENGTHUNIT["metre",1]]],
#> PRIMEM["Greenwich",0,
#> ANGLEUNIT["degree",0.0174532925199433]],
#> ID["EPSG",4326]],
#> CONVERSION["UTM zone 33N",
#> METHOD["Transverse Mercator",
#> ID["EPSG",9807]],
#> PARAMETER["Latitude of natural origin",0,
#> ANGLEUNIT["degree",0.0174532925199433],
#> ID["EPSG",8801]],
#> PARAMETER["Longitude of natural origin",15,
#> ANGLEUNIT["degree",0.0174532925199433],
#> ID["EPSG",8802]],
#> PARAMETER["Scale factor at natural origin",0.9996,
#> SCALEUNIT["unity",1],
#> ID["EPSG",8805]],
#> PARAMETER["False easting",500000,
#> LENGTHUNIT["metre",1],
#> ID["EPSG",8806]],
#> PARAMETER["False northing",0,
#> LENGTHUNIT["metre",1],
#> ID["EPSG",8807]]],
#> CS[Cartesian,2],
#> AXIS["(E)",east,
#> ORDER[1],
#> LENGTHUNIT["metre",1]],
#> AXIS["(N)",north,
#> ORDER[2],
#> LENGTHUNIT["metre",1]],
#> USAGE[
#> SCOPE["Engineering survey, topographic mapping."],
#> AREA["Between 12°E and 18°E, northern hemisphere between equator and 84°N, onshore and offshore. Austria. Bosnia and Herzegovina. Cameroon. Central African Republic. Chad. Congo. Croatia. Czechia. Democratic Republic of the Congo (Zaire). Gabon. Germany. Hungary. Italy. Libya. Malta. Niger. Nigeria. Norway. Poland. San Marino. Slovakia. Slovenia. Svalbard. Sweden. Vatican City State."],
#> BBOX[0,12,84,18]],
#> ID["EPSG",32633]]
5.4.3 Data
5.4.4 Extract
Calculate the mean X and Y of the bounding box of the DEM above, which can be also considered as the center of gravity of the DEM.
Average coordinates:
Xmean
#> [1] 465000
Ymean
#> [1] 4564160
Extract the elevation value for the DEM center of gravity:
Now analyse the situation from the point of view of the row-column dem subsetting.
This instruction selects the upper-left pixel of the 2x2 pixel box centered on the center of gravity:
Indeed, the same value provided by the extract function is returned selecting the lower-right pixel of the 2x2 pixel box centered on the center of gravity (see +1):
5.4.4.0.1 Exercise
Fulfil the assignment given at Raster geodata > Extract
5.5 Create new raster from scratch
5.5.1 We must provide Bounding Box, resolution and CRS
GRID <- rast( xmin = 453000,
xmax = 477000,
ymin = 4556000,
ymax = 4572320,
resolution = 25,
crs = "epsg:32633")
Print the metadata of the raster created above:
GRID
#> class : SpatRaster
#> size : 653, 960, 1 (nrow, ncol, nlyr)
#> resolution : 25, 25 (x, y)
#> extent : 453000, 477000, 4556000, 4572325 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 33N (EPSG:32633)
Remove the CRS:
crs(GRID) <- NULL
Check the CRS:
GRID
#> class : SpatRaster
#> size : 653, 960, 1 (nrow, ncol, nlyr)
#> resolution : 25, 25 (x, y)
#> extent : 453000, 477000, 4556000, 4572325 (xmin, xmax, ymin, ymax)
#> coord. ref. :
Define a CRS:
crs(GRID) <- "epsg:32633"
Check the CRS again:
GRID
#> class : SpatRaster
#> size : 653, 960, 1 (nrow, ncol, nlyr)
#> resolution : 25, 25 (x, y)
#> extent : 453000, 477000, 4556000, 4572325 (xmin, xmax, ymin, ymax)
#> coord. ref. : WGS 84 / UTM zone 33N (EPSG:32633)
5.5.2 Initialise a CRS
The CRS can be initialised using the st_crs() function and passing a CRS code in EPSG format.
In this case, we use the EPSG code 32633.
(Remember to provide the EPSG code associated to the coordinates used in xmn, xmx, ymn, ymx)
st_crs(32633) # {sf}
#> Coordinate Reference System:
#> User input: EPSG:32633
#> wkt:
#> PROJCRS["WGS 84 / UTM zone 33N",
#> BASEGEOGCRS["WGS 84",
#> DATUM["World Geodetic System 1984",
#> ELLIPSOID["WGS 84",6378137,298.257223563,
#> LENGTHUNIT["metre",1]]],
#> PRIMEM["Greenwich",0,
#> ANGLEUNIT["degree",0.0174532925199433]],
#> ID["EPSG",4326]],
#> CONVERSION["UTM zone 33N",
#> METHOD["Transverse Mercator",
#> ID["EPSG",9807]],
#> PARAMETER["Latitude of natural origin",0,
#> ANGLEUNIT["degree",0.0174532925199433],
#> ID["EPSG",8801]],
#> PARAMETER["Longitude of natural origin",15,
#> ANGLEUNIT["degree",0.0174532925199433],
#> ID["EPSG",8802]],
#> PARAMETER["Scale factor at natural origin",0.9996,
#> SCALEUNIT["unity",1],
#> ID["EPSG",8805]],
#> PARAMETER["False easting",500000,
#> LENGTHUNIT["metre",1],
#> ID["EPSG",8806]],
#> PARAMETER["False northing",0,
#> LENGTHUNIT["metre",1],
#> ID["EPSG",8807]]],
#> CS[Cartesian,2],
#> AXIS["(E)",east,
#> ORDER[1],
#> LENGTHUNIT["metre",1]],
#> AXIS["(N)",north,
#> ORDER[2],
#> LENGTHUNIT["metre",1]],
#> USAGE[
#> SCOPE["Engineering survey, topographic mapping."],
#> AREA["Between 12°E and 18°E, northern hemisphere between equator and 84°N, onshore and offshore. Austria. Bosnia and Herzegovina. Cameroon. Central African Republic. Chad. Congo. Croatia. Czechia. Democratic Republic of the Congo (Zaire). Gabon. Germany. Hungary. Italy. Libya. Malta. Niger. Nigeria. Norway. Poland. San Marino. Slovakia. Slovenia. Svalbard. Sweden. Vatican City State."],
#> BBOX[0,12,84,18]],
#> ID["EPSG",32633]]
# Or:
# crs("epsg:32633") # {terra}
5.5.4 Matrix of values
Has the raster GRID
values in the matrix?
Was the matrix of values initialised at all?
hasValues(GRID)
#> [1] FALSE
5.6 Raster drivers / formats
Here follows the list of drivers that are available in the current GDAL installation:
tab = terra::gdal(drivers = TRUE)
name | raster | vector | can | vsi | long.name |
---|---|---|---|---|---|
AAIGrid | TRUE | FALSE | read/write | TRUE | Arc/Info ASCII Grid |
ACE2 | TRUE | FALSE | read | TRUE | ACE2 |
ADRG | TRUE | FALSE | read/write | TRUE | ARC Digitized Raster Graphics |
AIG | TRUE | FALSE | read | TRUE | Arc/Info Binary Grid |
AirSAR | TRUE | FALSE | read | TRUE | AirSAR Polarimetric Image |
AmigoCloud | FALSE | TRUE | read/write | FALSE | AmigoCloud |
ARCGEN | FALSE | TRUE | read | TRUE | Arc/Info Generate |
ARG | TRUE | FALSE | read/write | TRUE | Azavea Raster Grid format |
AVCBin | FALSE | TRUE | read | TRUE | Arc/Info Binary Coverage |
AVCE00 | FALSE | TRUE | read | TRUE | Arc/Info E00 (ASCII) Coverage |
BAG | TRUE | TRUE | read/write | TRUE | Bathymetry Attributed Grid |
BIGGIF | TRUE | FALSE | read | TRUE | Graphics Interchange Format (.gif) |
BLX | TRUE | FALSE | read/write | TRUE | Magellan topo (.blx) |
BMP | TRUE | FALSE | read/write | TRUE | MS Windows Device Independent Bitmap |
BSB | TRUE | FALSE | read | TRUE | Maptech BSB Nautical Charts |
BT | TRUE | FALSE | read/write | TRUE | VTP .bt (Binary Terrain) 1.3 Format |
BYN | TRUE | FALSE | read/write | TRUE | Natural Resources Canada’s Geoid |
CAD | TRUE | TRUE | read | TRUE | AutoCAD Driver |
CALS | TRUE | FALSE | read/write | TRUE | CALS (Type 1) |
Carto | FALSE | TRUE | read/write | FALSE | Carto |
CEOS | TRUE | FALSE | read | TRUE | CEOS Image |
Cloudant | FALSE | TRUE | read/write | FALSE | Cloudant / CouchDB |
COASP | TRUE | FALSE | read | FALSE | DRDC COASP SAR Processor Raster |
COG | TRUE | FALSE | read/write | TRUE | Cloud optimized GeoTIFF generator |
COSAR | TRUE | FALSE | read | TRUE | COSAR Annotated Binary Matrix (TerraSAR-X) |
CouchDB | FALSE | TRUE | read/write | FALSE | CouchDB / GeoCouch |
CPG | TRUE | FALSE | read | TRUE | Convair PolGASP |
CSV | FALSE | TRUE | read/write | TRUE | Comma Separated Value (.csv) |
CSW | FALSE | TRUE | read | FALSE | OGC CSW (Catalog Service for the Web) |
CTable2 | TRUE | FALSE | read/write | TRUE | CTable2 Datum Grid Shift |
CTG | TRUE | FALSE | read | TRUE | USGS LULC Composite Theme Grid |
DAAS | TRUE | FALSE | read | FALSE | Airbus DS Intelligence Data As A Service driver |
DERIVED | TRUE | FALSE | read | FALSE | Derived datasets using VRT pixel functions |
DGN | FALSE | TRUE | read/write | TRUE | Microstation DGN |
DIMAP | TRUE | FALSE | read | TRUE | SPOT DIMAP |
DIPEx | TRUE | FALSE | read | TRUE | DIPEx |
DOQ1 | TRUE | FALSE | read | TRUE | USGS DOQ (Old Style) |
DOQ2 | TRUE | FALSE | read | TRUE | USGS DOQ (New Style) |
DTED | TRUE | FALSE | read/write | TRUE | DTED Elevation Raster |
DXF | FALSE | TRUE | read/write | TRUE | AutoCAD DXF |
ECRGTOC | TRUE | FALSE | read | TRUE | ECRG TOC format |
EDIGEO | FALSE | TRUE | read | TRUE | French EDIGEO exchange format |
EEDA | FALSE | TRUE | read | FALSE | Earth Engine Data API |
EEDAI | TRUE | FALSE | read | FALSE | Earth Engine Data API Image |
EHdr | TRUE | FALSE | read/write | TRUE | ESRI .hdr Labelled |
EIR | TRUE | FALSE | read | TRUE | Erdas Imagine Raw |
ELAS | TRUE | FALSE | read/write | TRUE | ELAS |
Elasticsearch | FALSE | TRUE | read/write | FALSE | Elastic Search |
ENVI | TRUE | FALSE | read/write | TRUE | ENVI .hdr Labelled |
ERS | TRUE | FALSE | read/write | TRUE | ERMapper .ers Labelled |
ESAT | TRUE | FALSE | read | TRUE | Envisat Image Format |
ESRI Shapefile | FALSE | TRUE | read/write | TRUE | ESRI Shapefile |
ESRIC | TRUE | FALSE | read | TRUE | Esri Compact Cache |
ESRIJSON | FALSE | TRUE | read | TRUE | ESRIJSON |
FAST | TRUE | FALSE | read | TRUE | EOSAT FAST Format |
FIT | TRUE | FALSE | read/write | TRUE | FIT Image |
FITS | TRUE | TRUE | read/write | FALSE | Flexible Image Transport System |
FlatGeobuf | FALSE | TRUE | read/write | TRUE | FlatGeobuf |
FujiBAS | TRUE | FALSE | read | TRUE | Fuji BAS Scanner Image |
GenBin | TRUE | FALSE | read | TRUE | Generic Binary (.hdr Labelled) |
Geoconcept | FALSE | TRUE | read/write | TRUE | Geoconcept |
GeoJSON | FALSE | TRUE | read/write | TRUE | GeoJSON |
GeoJSONSeq | FALSE | TRUE | read/write | TRUE | GeoJSON Sequence |
Geomedia | FALSE | TRUE | read | FALSE | Geomedia .mdb |
GeoRSS | FALSE | TRUE | read/write | TRUE | GeoRSS |
GFF | TRUE | FALSE | read | TRUE | Ground-based SAR Applications Testbed File Format (.gff) |
GIF | TRUE | FALSE | read/write | TRUE | Graphics Interchange Format (.gif) |
GML | FALSE | TRUE | read/write | TRUE | Geography Markup Language (GML) |
GMLAS | FALSE | TRUE | read/write | TRUE | Geography Markup Language (GML) driven by application schemas |
GMT | TRUE | FALSE | read/write | FALSE | GMT NetCDF Grid Format |
GNMDatabase | FALSE | FALSE | read/write | FALSE | Geographic Network generic DB based model |
GNMFile | FALSE | FALSE | read/write | FALSE | Geographic Network generic file based model |
GPKG | TRUE | TRUE | read/write | TRUE | GeoPackage |
GPSBabel | FALSE | TRUE | read/write | FALSE | GPSBabel |
GPSTrackMaker | FALSE | TRUE | read/write | TRUE | GPSTrackMaker |
GPX | FALSE | TRUE | read/write | TRUE | GPX |
GRASSASCIIGrid | TRUE | FALSE | read | TRUE | GRASS ASCII Grid |
GRIB | TRUE | FALSE | read/write | TRUE | GRIdded Binary (.grb, .grb2) |
GS7BG | TRUE | FALSE | read/write | TRUE | Golden Software 7 Binary Grid (.grd) |
GSAG | TRUE | FALSE | read/write | TRUE | Golden Software ASCII Grid (.grd) |
GSBG | TRUE | FALSE | read/write | TRUE | Golden Software Binary Grid (.grd) |
GSC | TRUE | FALSE | read | TRUE | GSC Geogrid |
GTiff | TRUE | FALSE | read/write | TRUE | GeoTIFF |
GTX | TRUE | FALSE | read/write | TRUE | NOAA Vertical Datum .GTX |
GXF | TRUE | FALSE | read | TRUE | GeoSoft Grid Exchange Format |
HDF4 | TRUE | FALSE | read | FALSE | Hierarchical Data Format Release 4 |
HDF4Image | TRUE | FALSE | read/write | FALSE | HDF4 Dataset |
HDF5 | TRUE | FALSE | read | TRUE | Hierarchical Data Format Release 5 |
HDF5Image | TRUE | FALSE | read | TRUE | HDF5 Dataset |
HEIF | TRUE | FALSE | read | TRUE | ISO/IEC 23008-12:2017 High Efficiency Image File Format |
HF2 | TRUE | FALSE | read/write | TRUE | HF2/HFZ heightfield raster |
HFA | TRUE | FALSE | read/write | TRUE | Erdas Imagine Images (.img) |
HTTP | TRUE | TRUE | read | FALSE | HTTP Fetching Wrapper |
IDA | TRUE | FALSE | read/write | TRUE | Image Data and Analysis |
Idrisi | FALSE | TRUE | read | TRUE | Idrisi Vector (.vct) |
ILWIS | TRUE | FALSE | read/write | TRUE | ILWIS Raster Map |
INGR | TRUE | FALSE | read/write | TRUE | Intergraph Raster |
Interlis 1 | FALSE | TRUE | read/write | TRUE | Interlis 1 |
Interlis 2 | FALSE | TRUE | read/write | TRUE | Interlis 2 |
IRIS | TRUE | FALSE | read | TRUE | IRIS data (.PPI, .CAPPi etc) |
ISCE | TRUE | FALSE | read/write | TRUE | ISCE raster |
ISG | TRUE | FALSE | read | TRUE | International Service for the Geoid |
ISIS2 | TRUE | FALSE | read/write | TRUE | USGS Astrogeology ISIS cube (Version 2) |
ISIS3 | TRUE | FALSE | read/write | TRUE | USGS Astrogeology ISIS cube (Version 3) |
JAXAPALSAR | TRUE | FALSE | read | TRUE | JAXA PALSAR Product Reader (Level 1.1/1.5) |
JDEM | TRUE | FALSE | read | TRUE | Japanese DEM (.mem) |
JML | FALSE | TRUE | read/write | TRUE | OpenJUMP JML |
JP2OpenJPEG | TRUE | TRUE | read/write | TRUE | JPEG-2000 driver based on OpenJPEG library |
JPEG | TRUE | FALSE | read/write | TRUE | JPEG JFIF |
JPEGLS | TRUE | FALSE | read/write | TRUE | JPEGLS |
KML | FALSE | TRUE | read/write | TRUE | Keyhole Markup Language (KML) |
KMLSUPEROVERLAY | TRUE | FALSE | read/write | TRUE | Kml Super Overlay |
KRO | TRUE | FALSE | read/write | TRUE | KOLOR Raw |
L1B | TRUE | FALSE | read | TRUE | NOAA Polar Orbiter Level 1b Data Set |
LAN | TRUE | FALSE | read/write | TRUE | Erdas .LAN/.GIS |
LCP | TRUE | FALSE | read/write | TRUE | FARSITE v.4 Landscape File (.lcp) |
Leveller | TRUE | FALSE | read/write | TRUE | Leveller heightfield |
LIBKML | FALSE | TRUE | read/write | TRUE | Keyhole Markup Language (LIBKML) |
LOSLAS | TRUE | FALSE | read | TRUE | NADCON .los/.las Datum Grid Shift |
LVBAG | FALSE | TRUE | read | TRUE | Kadaster LV BAG Extract 2.0 |
MAP | TRUE | FALSE | read | TRUE | OziExplorer .MAP |
MapInfo File | FALSE | TRUE | read/write | TRUE | MapInfo File |
MapML | FALSE | TRUE | read/write | TRUE | MapML |
MBTiles | TRUE | TRUE | read/write | TRUE | MBTiles |
MEM | TRUE | FALSE | read/write | FALSE | In Memory Raster |
Memory | FALSE | TRUE | read/write | FALSE | Memory |
MFF | TRUE | FALSE | read/write | TRUE | Vexcel MFF Raster |
MFF2 | TRUE | FALSE | read/write | FALSE | Vexcel MFF2 (HKV) Raster |
MRF | TRUE | FALSE | read/write | TRUE | Meta Raster Format |
MSGN | TRUE | FALSE | read | TRUE | EUMETSAT Archive native (.nat) |
MSSQLSpatial | FALSE | TRUE | read/write | FALSE | Microsoft SQL Server Spatial Database |
MVT | FALSE | TRUE | read/write | TRUE | Mapbox Vector Tiles |
MySQL | FALSE | TRUE | read/write | FALSE | MySQL |
NAS | FALSE | TRUE | read | TRUE | NAS - ALKIS |
NDF | TRUE | FALSE | read | TRUE | NLAPS Data Format |
netCDF | TRUE | TRUE | read/write | TRUE | Network Common Data Format |
NGSGEOID | TRUE | FALSE | read | TRUE | NOAA NGS Geoid Height Grids |
NGW | TRUE | TRUE | read/write | FALSE | NextGIS Web |
NITF | TRUE | FALSE | read/write | TRUE | National Imagery Transmission Format |
NTv2 | TRUE | FALSE | read/write | TRUE | NTv2 Datum Grid Shift |
NWT_GRC | TRUE | FALSE | read | TRUE | Northwood Classified Grid Format .grc/.tab |
NWT_GRD | TRUE | FALSE | read/write | TRUE | Northwood Numeric Grid Format .grd/.tab |
OAPIF | FALSE | TRUE | read | FALSE | OGC API - Features |
ODBC | FALSE | TRUE | read | FALSE | |
ODS | FALSE | TRUE | read/write | TRUE | Open Document/ LibreOffice / OpenOffice Spreadsheet |
OGCAPI | TRUE | TRUE | read | TRUE | OGCAPI |
OGR_GMT | FALSE | TRUE | read/write | TRUE | GMT ASCII Vectors (.gmt) |
OGR_OGDI | FALSE | TRUE | read | FALSE | OGDI Vectors (VPF, VMAP, DCW) |
OGR_PDS | FALSE | TRUE | read | TRUE | Planetary Data Systems TABLE |
OGR_SDTS | FALSE | TRUE | read | TRUE | SDTS |
OGR_VRT | FALSE | TRUE | read | TRUE | VRT - Virtual Datasource |
OpenFileGDB | FALSE | TRUE | read | TRUE | ESRI FileGDB |
OSM | FALSE | TRUE | read | TRUE | OpenStreetMap XML and PBF |
OZI | TRUE | FALSE | read | TRUE | OziExplorer Image File |
PAux | TRUE | FALSE | read/write | TRUE | PCI .aux Labelled |
PCIDSK | TRUE | TRUE | read/write | TRUE | PCIDSK Database File |
PCRaster | TRUE | FALSE | read/write | FALSE | PCRaster Raster File |
TRUE | TRUE | read/write | TRUE | Geospatial PDF | |
PDS | TRUE | FALSE | read | TRUE | NASA Planetary Data System |
PDS4 | TRUE | TRUE | read/write | TRUE | NASA Planetary Data System 4 |
PGDUMP | FALSE | TRUE | read/write | TRUE | PostgreSQL SQL dump |
PGeo | FALSE | TRUE | read | FALSE | ESRI Personal GeoDatabase |
PLMOSAIC | TRUE | FALSE | read | FALSE | Planet Labs Mosaics API |
PLSCENES | TRUE | TRUE | read | FALSE | Planet Labs Scenes API |
PNG | TRUE | FALSE | read/write | TRUE | Portable Network Graphics |
PNM | TRUE | FALSE | read/write | TRUE | Portable Pixmap Format (netpbm) |
PostGISRaster | TRUE | FALSE | read/write | FALSE | PostGIS Raster driver |
PostgreSQL | FALSE | TRUE | read/write | FALSE | PostgreSQL/PostGIS |
PRF | TRUE | FALSE | read | TRUE | Racurs PHOTOMOD PRF |
R | TRUE | FALSE | read/write | TRUE | R Object Data Store |
Rasterlite | TRUE | FALSE | read/write | TRUE | Rasterlite |
RDA | TRUE | FALSE | read | FALSE | DigitalGlobe Raster Data Access driver |
REC | FALSE | TRUE | read | FALSE | EPIInfo .REC |
RIK | TRUE | FALSE | read | TRUE | Swedish Grid RIK (.rik) |
RMF | TRUE | FALSE | read/write | TRUE | Raster Matrix Format |
ROI_PAC | TRUE | FALSE | read/write | TRUE | ROI_PAC raster |
RPFTOC | TRUE | FALSE | read | TRUE | Raster Product Format TOC format |
RRASTER | TRUE | FALSE | read/write | TRUE | R Raster |
RS2 | TRUE | FALSE | read | TRUE | RadarSat 2 XML Product |
RST | TRUE | FALSE | read/write | TRUE | Idrisi Raster A.1 |
S57 | FALSE | TRUE | read/write | TRUE | IHO S-57 (ENC) |
SAFE | TRUE | FALSE | read | TRUE | Sentinel-1 SAR SAFE Product |
SAGA | TRUE | FALSE | read/write | TRUE | SAGA GIS Binary Grid (.sdat, .sg-grd-z) |
SAR_CEOS | TRUE | FALSE | read | TRUE | CEOS SAR Image |
SDTS | TRUE | FALSE | read | TRUE | SDTS Raster |
Selafin | FALSE | TRUE | read/write | TRUE | Selafin |
SENTINEL2 | TRUE | FALSE | read | TRUE | Sentinel 2 |
SGI | TRUE | FALSE | read/write | TRUE | SGI Image File Format 1.0 |
SIGDEM | TRUE | FALSE | read/write | TRUE | Scaled Integer Gridded DEM .sigdem |
SNODAS | TRUE | FALSE | read | TRUE | Snow Data Assimilation System |
SOSI | FALSE | TRUE | read | FALSE | Norwegian SOSI Standard |
SQLite | FALSE | TRUE | read/write | TRUE | SQLite / Spatialite |
SRP | TRUE | FALSE | read | TRUE | Standard Raster Product (ASRP/USRP) |
SRTMHGT | TRUE | FALSE | read/write | TRUE | SRTMHGT File Format |
STACIT | TRUE | FALSE | read | TRUE | Spatio-Temporal Asset Catalog Items |
STACTA | TRUE | FALSE | read | TRUE | Spatio-Temporal Asset Catalog Tiled Assets |
SVG | FALSE | TRUE | read | TRUE | Scalable Vector Graphics |
SXF | FALSE | TRUE | read | TRUE | Storage and eXchange Format |
Terragen | TRUE | FALSE | read/write | TRUE | Terragen heightfield |
TGA | TRUE | FALSE | read | TRUE | TGA/TARGA Image File Format |
TIGER | FALSE | TRUE | read/write | TRUE | U.S. Census TIGER/Line |
TIL | TRUE | FALSE | read | TRUE | EarthWatch .TIL |
TopoJSON | FALSE | TRUE | read | TRUE | TopoJSON |
TSX | TRUE | FALSE | read | TRUE | TerraSAR-X Product |
UK .NTF | FALSE | TRUE | read | TRUE | UK .NTF |
USGSDEM | TRUE | FALSE | read/write | TRUE | USGS Optional ASCII DEM (and CDED) |
VDV | FALSE | TRUE | read/write | TRUE | VDV-451/VDV-452/INTREST Data Format |
VFK | FALSE | TRUE | read | FALSE | Czech Cadastral Exchange Data Format |
VICAR | TRUE | TRUE | read/write | TRUE | MIPL VICAR file |
VRT | TRUE | FALSE | read/write | TRUE | Virtual Raster |
Walk | FALSE | TRUE | read | FALSE | |
WAsP | FALSE | TRUE | read/write | TRUE | WAsP .map format |
WCS | TRUE | FALSE | read | TRUE | OGC Web Coverage Service |
WEBP | TRUE | FALSE | read/write | TRUE | WEBP |
WFS | FALSE | TRUE | read | TRUE | OGC WFS (Web Feature Service) |
WMS | TRUE | FALSE | read/write | TRUE | OGC Web Map Service |
WMTS | TRUE | FALSE | read/write | TRUE | OGC Web Map Tile Service |
XLS | FALSE | TRUE | read | FALSE | MS Excel format |
XLSX | FALSE | TRUE | read/write | TRUE | MS Office Open XML spreadsheet |
XPM | TRUE | FALSE | read/write | TRUE | X11 PixMap Format |
XYZ | TRUE | FALSE | read/write | TRUE | ASCII Gridded XYZ |
Zarr | TRUE | FALSE | read/write | TRUE | Zarr |
ZMap | TRUE | FALSE | read/write | TRUE | ZMap Plus Grid |
5.7 Export raster
terra::writeRaster( GRID, "DummyRaster.tif", overwrite=TRUE )