3 Raster data and formats
As stated in the introductory section of this chapter, a raster or grid is a spatial data structure which divides space into rectangular cells (pixels) that contain one or more values of an observed or modeled phenomenon. The cell values are usually numerical or categorical data.
A raster (grid) with one attribute value resembles a matrix with an additionally defined header. How is georeferencing defined for raster data? It is practically contained in the header. Depending on the raster data format, the header most often contains data about the coordinate reference system (in some formats this is in a separate file), number of rows and columns, coordinates of the initial cell (pixel), pixel size (some formats support only square pixels, while others also support rectangular pixels), and information on how values are stored for pixels without attributes. Figure 3.1 shows an example of a raster, a digital elevation model (DEM) for the area of Krupanj and its surroundings in Serbia; the raster is in the Gauss-Krüger projection, zone 7, with an perspective view in Figure 3.2.
Using the GDAL gdalinfo function, information on the above explained raster can be obtained:
gdalinfo DEM.asc
Files: DEM.asc
DEM.prj
Size is 397, 334
Coordinate System is:
PROJCS["unnamed",
GEOGCS[,
DATUM["unknown",
SPHEROID["bessel",6377397.155,299.1528128]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",21],
PARAMETER["scale_factor",0.9999],
PARAMETER["false_easting",7500000],
PARAMETER["false_northing",0],
UNIT["metre",1,AUTHORITY["EPSG","9001"]]]
Origin = (7354715.404513620771468,4930131.364209158346057)
Pixel Size = (90.000000000000000,-90.000000000000000)
Corner Coordinates:
Upper Left ( 7354715.405, 4930131.364) ( 19d10' 4.27"E, 44d29'47.38"N)
Lower Left ( 7354715.405, 4900071.364) ( 19d10'34.54"E, 44d13'33.90"N)
Upper Right ( 7390445.405, 4930131.364) ( 19d37' 1.14"E, 44d30'10.14"N)
Lower Right ( 7390445.405, 4900071.364) ( 19d37'24.00"E, 44d13'56.45"N)
Center ( 7372580.405, 4915101.364) ( 19d23'45.97"E, 44d21'52.76"N)
Band 1 Block=397x1 Type=Float32, ColorInterp=Undefined
NoData Value=-32767
Coordinates of any pixel in the raster can be obtained if the coordinates of the initial pixel are known, as explained in Figure 3.3.
A raster is often multidimensional, i.e., it has more than one attribute. Then, the analogy with multidimensional matrices is obvious. Raster attributes are colloquially called bands, Figure 3.4.
The most popular raster formats are GeoTIFF with the .tif
extension, ESRI Ascii - .asc, SAGA GIS - .sdat, IDRISI IDRISI - .rst, netCDF, etc. The list of raster formats supported by the GDAL library, with a description of each format, is available at http://www.gdal.org/formats_list.html. Using the GDAL library, it is easy to convert from one raster format to another.
The following code converts the ESRI Ascii format into the GeoTIFF format using the GDAL function gdal_translate.
gdal_translate -of GTiff DEM.asc DEM.tif
The -of
argument is a functional argument which defines the output format, followed by the input and output files separated by a space. A detailed description of the function is available at http://www.gdal.org/gdal_translate.html.
3.1 Open raster data
This section briefly presents some of the most important sources of open raster data.
USGS Earth Explorer geoportal for viewing and downloading data, containing multiple sources of raster data:
Digital terrain models from ASTER missions (DEM 30 m resolution in GeoTIFF format) and Shuttle Radar Topography Missions (DEM 90 m resolution in GeoTIFF format),
Landsat multispectral satellite images with 40 years of historical data,
http://earthexplorer.usgs.gov/.
Sentinels Scientific Data Hub is the European Space Agency’s (ESA) official data portal for distributing Sentinel satellite images:
Sentinel-2a i 2b multispectral optical images with a 10 m spatial resolution for the visible spectrum and near infrared band, with a total of 12 bands and a spatial resolution of 20 and 60 m for the remaining bands.
Sentinel-1 radar images.
https://scihub.copernicus.eu/dhus. (Copernicus Land Monitoring Service, https://land.copernicus.eu )
Global Land Cover Facility (GLCF) contains global data on land cover, created based on the Landsat, MODIS, and AVHRR satellite missions. Data include vegetation, bodies of water, geology, arable land, and urban areas. Besides these data, this portal also provides additional data such as DEM.
SoilGrids is a geoportal for raster datasets on land characteristics containing numerical and factorial data in a spatial resolution of 1 km and 250 m, available in GeoTIFF format.
LandGIS — Open Land Data service geoportal cover several environmental thematic fields, that mainly describe topography, vegetation, soil properties and classes, geology, hydrology, land cover, land use and landscape metrics in general (see below).