A lightweight GDAL API package for R.

Details

Provides low-level access to 'GDAL' functionality for R packages. The aim is to minimize the level of interpretation put on the 'GDAL' facilities, to enable direct use of it for a variety of purposes. 'GDAL' is the 'Geospatial Data Abstraction Library' a translator for raster and vector geospatial data formats that presents a single raster abstract data model and single vector abstract data model to the calling application for all supported formats https://gdal.org/.

Lightweight means we access parts of the GDAL API as near as possible to their native usage. GDAL is not a lightweight library, but provide a very nice abstraction over format details for a very large number of different formats.

Functions for raster and vector sources are included.

vapour_all_driverslist of all available drivers, with type and features
vapour_driverreport short name of driver that will be used for a data source
vapour_gdal_versionreport version of GDAL in use
vapour_srs_wktproduce WKT projection string from various projection string inputs
vapour_vsi_listreport contents of VSI sources
vapour_raster_gcpreturn internal ground control points, if present
vapour_raster_infostructural metadata of a source
vapour_read_rasterread data direct from a window of a raster band source
vapour_sds_nameslist individual raster sources in a source containing subdatasets
vapour_warp_rasterread data direct from a raster source into a specific window
vapour_driverreport name of the driver used for a given source
vapour_geom_namereport attribute name of geometry
vapour_geom_summaryreport simple properties of each feature geometry
vapour_layer_nameslist names of vector layers in a data source
vapour_layer_infolist of data source, driver, layer name/s, fields, feature count, projection
vapour_read_extentread the extent, or bounding box, of geometries in a layer
vapour_read_fieldsread attributes of features in a layer, the columnar data associated with each geometry
vapour_read_geometryread geometry in binary (blob, WKB) form
vapour_read_geometry_iaread geometry by index, arbitrary
vapour_read_geometry_ijread geometry by sequential index, i to j
vapour_read_geometry_textread geometry in text form, various formats
vapour_read_namesread the 'names' of features in a layer, the 'FID'
vapour_read_typeread the GDAL types of attributes
vapour_report_fieldsreport internal type of each attribute by name

As far as possible vapour aims to minimize the level of interpretation provided for the functions, so that developers can choose how things are implemented. Functions return raw lists or vectors rather than data frames or classed types.

options

The following options can be set to control global behaviour.

Sys.getenv("vapour.sql.dialect")the current SQL dialect in use

SQL dialect

The SQL dialect can be set to "" (empty string), "OGRSQL", or "SQLITE".

The empty string indicates that the native dialect will be used, see OGRSQL and SQLITE for GDAL, accessed 2022-11-11 and the GDAL_DMD_SUPPORTED_SQL_DIALECTS development documentation (since GDAL 3.6).

Setting "NATIVE" as an alias for "" is quite recent and has not been tested with vapour, similarly no testing has been done with non OGRSQL-native or SQLITE-native drivers yet.