Learn R Programming

gdalraster (version 1.11.1)

gdalraster-package: Bindings to the GDAL Raster API

Description

gdalraster is an interface to the Geospatial Data Abstraction Library (GDAL) for low level raster I/O. Calling signatures resemble those of the native C, C++ and Python APIs provided by the GDAL project. See https://gdal.org/api/ for details of the GDAL Raster API.

Arguments

Author

GDAL is by: Frank Warmerdam, Even Rouault and others
(see https://github.com/OSGeo/gdal/graphs/contributors)

R interface/additional functionality: Chris Toney

Maintainer: Chris Toney <chris.toney at usda.gov>

Details

Core functionality is contained in class GDALRaster and several related stand-alone functions:

  • GDALRaster-class is an exposed C++ class that allows opening a raster dataset and calling methods on the GDALDataset, GDALDriver and GDALRasterBand objects in the underlying API (e.g., get/set parameters, read/write pixel data).

  • raster creation: create(), createCopy(), rasterFromRaster(), translate(), getCreationOptions()

  • virtual raster: buildVRT(), rasterToVRT()

  • reproject/resample/crop/mosaic: warp()

  • algorithms: dem_proc(), fillNodata(), footprint(), polygonize(), rasterize(), sieveFilter(), GDALRaster$getChecksum()

  • raster attribute tables: buildRAT(), displayRAT(), GDALRaster$getDefaultRAT(), GDALRaster$setDefaultRAT()

  • geotransform conversion: apply_geotransform(), get_pixel_line(), inv_geotransform()

  • coordinate transformation: transform_xy(), inv_project()

  • spatial reference convenience functions: epsg_to_wkt(), srs_to_wkt(),
    srs_is_geographic(), srs_is_projected(), srs_is_same()

  • geometry convenience functions: bbox_from_wkt(), bbox_to_wkt(), bbox_intersect(), bbox_union(), bbox_transform(), g_area(), g_buffer(), g_centroid(), g_contains(), g_crosses(), g_difference(), g_disjoint(), g_distance(), g_equals(), g_intersection(), g_intersects(), g_is_empty(), g_is_valid(), g_length(), g_name(), g_overlaps(), g_sym_difference(), g_touches(), g_transform(), g_union(), g_within(), geos_version()

  • data management: addFilesInZip(), copyDatasetFiles(), deleteDataset(),
    renameDataset(), bandCopyWholeRaster()

  • OGR vector utilities: ogr2ogr(), ogrinfo(), ogr_manage, ogr_define

  • virtual file systems: VSIFile, vsi_clear_path_options(), vsi_copy_file(), vsi_curl_clear_cache(), vsi_get_disk_free_space(), vsi_get_file_metadata(), vsi_get_fs_options(), vsi_get_fs_prefixes(), vsi_mkdir(), vsi_read_dir(), vsi_rename(), vsi_rmdir(), vsi_set_path_option(), vsi_stat(), vsi_supports_rnd_write(), vsi_supports_seq_write(), vsi_sync(), vsi_unlink(), vsi_unlink_batch()

  • GDAL configuration: gdal_version(), gdal_formats(), get_cache_used(), get_config_option(), set_config_option(), get_num_cpus(), get_usable_physical_ram(), has_spatialite(), http_enabled(), push_error_handler(), pop_error_handler(), dump_open_datasets()

  • PROJ configuration: proj_version(), proj_search_paths(), proj_networking()

Additional functionality includes:

  • RunningStats-class calculates mean and variance in one pass. The min, max, sum, and count are also tracked (efficient summary statistics on data streams).

  • CmbTable-class implements a hash table for counting unique combinations of integer values.

  • combine() overlays multiple rasters so that a unique ID is assigned to each unique combination of input values. Pixel counts for each unique combination are obtained, and combination IDs are optionally written to an output raster.

  • calc() evaluates an R expression for each pixel in a raster layer or stack of layers. Individual pixel coordinates are available as variables in the R expression, as either x/y in the raster projected coordinate system or inverse projected longitude/latitude.

  • plot_raster() displays raster data using base R graphics. Supports single-band grayscale, RGB, color tables and color map functions (e.g., color ramp).

See Also