About Rasters
From Eonfusion wiki
A raster consists of gridded data that has a predictable underlying structure. The cells of a raster provide the basis of the raster's dimension. A cell can be 2D (as in a pixel) or 3D (as in a voxel), or higher.
Contents |
A note on terminology
Raster is a term that is used to include data that is traditionally stored as regularly gridded 2D data that is spatially registered: most often as images or DEMs. The distinction between images and DEMs is overly simplistic however: their use is usually constrained to two dimensions and does not account for the use of grids of data variables other than colors or elevation.
Rasters in Eonfusion
Eonfusion makes a distinction between the cells and the vertices of a raster. Attribute values that vary continuously are associated with the vertices, while cells store attribute values that are discrete and unvaried across the cell.
- Raster data can be of any dimension, and both cell features and vertices can have any number of attributes with any mix of data type.
- The distinction between raster cell features and the vertices that define the cell structure allows geometry to be decoupled from topology. In particular, rasters can be reprojected or otherwise modified in ways that requires the geometry of the raster to depart from simple regularity.
- Rasters can have a discrete (a grid of separate cells) or continuous interpretation (sample points from a continually varying field) and this interpretation has a implications for analysis and visualization.
- The underlying gridded structure of a raster remains unchanged by geometric operations. That is, the vertex attributes may be modified (reprojected, or transformed by calculation) in ways that position them arbitrarily in geometric terms. However the underlying grid retains the connectivity between adjacent cells. The connectivity is provided by the continuity of vertices, and it is this connectivity that underpins the inherent nature of a raster.
Dimensionality
Eonfusion can represent rasters of any dimension. In practice most rasters that can be read will be 2D - the traditional image or DEM.
3D rasters can be visualized in a Scene with the third axis mapped to the Z axis or the slider. A 3D raster may be thought of as a series of 2D rasters, such as a time series or stack of slices. A 4D raster may be thought of as a series of 3D rasters, each of which is a series of 2D rasters.
By default all of the raster slices that fall within the range of the slider will be displayed. This may be controlled using the Limit display to one 2D raster slice option on the Raster visualizer.
4D (and higher) rasters cannot be visualized in a Scene and must be sliced in order to produce a 2D or 3D raster. See Slice Raster operators for more information.
Cell or continuous interpretation
Rasters have two interpretations: cell raster or continuous raster. This interpretation is determined by the data source, and may be modified manually. See Raster data sources for more information.
Each of these is defined as follows:
- Interpreting raster data as a "cell" raster implies that each value is the value of a cell feature attribute. The attribute value applies to a cell of finite size, defined by vertices. A 2D raster (for example an image) is a grid of 2D cell features, each with a different attribute value. Each cell is defined by four vertices in this 2D case.
- Interpreting raster data as a “continuous” raster implies that each value in the list is the value of a vertex attribute. The entire raster is a single feature, with a continuously-varying vertex attribute. An example is a 2D DEM, where the height of the surface is sampled at discrete points but is considered to vary continuously across the single cell feature.
See Cell rasters compared to continuous rasters for more information.
Raster data structure
Rasters are presented with a Features attribute group and a Vertices attribute group in a data structure view. The dimension and extents of the raster can be seen in the Details pane. A continuous raster has only one cell feature, and a vertex for every grid position implied by the raster's dimension. A cell raster has a cell for every grid position, and a vertex for every cell corner. For example, a 2D continuous raster with size 20x5 will have 100 vertices but a cell raster of the same size will have 100 cells, and 126 (21 * 6) vertices.
Rasters can be thought of as grids (or arrays) in which the real world position of each grid cell is known. Every grid has its own internal space identified by index in each direction, such as 0, 1, 2, ... 119 - but we can also apply a real world space to this grid in which cell 0 is at some arbitrary place such as X0 = 147.354, and cell 1 is next to it at X1 = 148.432. In simple regular cases the relative position of each cell can be calculated using only an offset (X0 = 147.354) and scale (Xd = X1 - X0) value applied to the cell's index. In more complex irregular cases the position of each and every cell must be stored.
Raster data does not appear as a grid of the appropriate dimension - this information is stored as metadata about the raster. The actual cell or vertex values are presented in tabular form. A raster, or grid, can have any dimension: 0D, 1D, 2D, 3D, 4D, 5D, and so on. Eonfusion's data structure stores the required positioning information as vertex attributes.
Raster axes
Every raster has the same number of axes as its dimension. For each axis the raster has a (Real) coordinate attribute and corresponding (Integer) index attribute. Raster axis-based vertex attributes can be modified like any other, but the index attributes are read-only as they refer to the underlying gridded structure of the raster. See Attributes for more information.
For example, a 3D raster may have axes X, Y and Z and this requires six vertex attributes: X, Y, Z, X Index, Y Index, Z Index. All other raster attributes (often called bands, or channels) such as Luminance, Elevation, Green etc. will be present on the Vertices attribute group (for continuous rasters) or the Features attribute group (for cell rasters).
Note: X, Y and Z are nominal names that are commonly used, but raster axes are not limited to having particular names. Some data sources, such as NetCDF rasters may have very different conventions.
Raster axes and regularity
The vertex attribute of most rasters is regular. The regular arrangement of cells requires only a single coordinate (offset) and grid spacing for each dimension to be stored in order to define the raster's location in geometric space. This property of regularity is lost if any modification is applied to the vertex attribute values; modifications such as calculation or reprojection. Changing units via Metadata properties preserves regularity.
Any raster source that is stored with irregular axes cannot be read completely and may result in an unrolled 2D raster with many bands (see NetCDF rasters) or fail to read. Once a raster is read into Eonfusion the vertex attributes may be modified in any way, such as calculations that cause axes to become irregular, and reprojection.
Spatial coordinates and index attributes
A raster has a vertex attribute for each axis (such as X, Y, T). These are used to locate the raster in a geometric space like that of the Scene. Commonly this information is not stored explicitly for every vertex in the raster but generated as required from reference values stored for each axis. When a raster is read these regular vertex attributes are generated using the appropriate metadata from the raster source.
Some file formats, such as Arc/Info Grids, GeoTIFF and USGS DEM, store this information internally as metadata. Other file formats may be delivered with a World file of the same name but with a different extension.
Notably, NetCDF files may contain 3D or higher dimensional rasters and each axis will be stored with the appropriate metadata if it is available. See NetCDF rasters for more information.
If this metadata is not available, the Raster data source will generate default metadata so that the vertex attributes will match the index attributes for each axis.
See Georeferencing for more information.
Time and Z coordinates
A raster may have further axes beyond X and Y. The metadata of these can be defined on the data source Properties window Metadata tab.
A Time attribute may be generated from a Time projection file in order to create a 3D raster from a set of 2D raster files.
Higher dimensional metadata may also be provided by NetCDF rasters.
Raster concepts
A familiar example of raster data is an image with elements usually called pixels (picture elements).
Image colors are stored as numeric attributes
This very simple image of 3x5 cells has been greatly exaggerated in order to identify individual cells easily. Each cell is numbered with an Index, starting from zero:
| 0 | 1 | 2 |
| 3 | 4 | 5 |
| 6 | 7 | 8 |
| 9 | 10 | 11 |
| 12 | 13 | 14 |
This visual representation of the cell colors hides that fact that colors are stored as numbers, and that a color model is used to convert those numbers to colors on a display device. The RGB color model requires triplets of values (R, G and B) for each of the cells in the above image. This table shows how the cells of this image can be stored by unrolling the dimensions of the raster:
| Index | Color | R value | G value | B value |
| 0 | 0 | 0 | 255 | |
| 1 | 0 | 255 | 255 | |
| 2 | 0 | 255 | 0 | |
| 3 | 0 | 255 | 255 | |
| 4 | 0 | 255 | 0 | |
| 5 | 255 | 255 | 0 | |
| 6 | 0 | 255 | 0 | |
| 7 | 255 | 255 | 0 | |
| 8 | 255 | 0 | 0 | |
| 9 | 255 | 255 | 0 | |
| 10 | 255 | 0 | 0 | |
| 11 | 255 | 0 | 255 | |
| 12 | 255 | 0 | 0 | |
| 13 | 255 | 0 | 255 | |
| 14 | 0 | 0 | 255 |
Although there are many ways of encoding these colors, and the colors may be stored explicitly or by using a lookup table or palette, the main point is that attributes are used to store the values for each cell. The raster and its cells have dimension, with a cell representing a small rectangle (2D) or box (3D) and each cell may have any number of attributes stored for it.
If we ignore the Color column in the above table, this is how the attribute group for the above image raster would appear in Eonfusion under Features. In the Vertices attribute group we would see 4x6 rows as each cell has a vertex on each corner, requiring one more vertex in each dimension than for cells. Try this by downloading the following image, reading it with a Raster data source and click View table on the output data structure of the raster. Image:SimpleImage.png
The same unrolling principle applies to rasters of higher dimensions: so a 3x5x6 3D cell raster would requires a cell table of 90 rows, and a vertex table of 168 rows. In practice however, these simple relationships are not seen as the requirement for internal tiling means that index values will not be a simple count, and the storage of varying levels of detail mean that more attribute values than the product of the rasters dimensionality are required.
Cell rasters compared to continuous rasters
This figure compares the same raster structure interpreted as a cell raster and a continuous raster. In the cell case the cell attribute values apply to the entire discrete cell, and there are vertices for each cell corner. In the continuous case all attribute values apply to the vertices only. Each vertex is interpreted as the center of where each cell would lie using the first interpretation.
If the data structure of the color image raster used above is inspected in Eonfusion, the corresponding cell and continuous interpretations look like this:
To manually set the interpretation used for any raster, change the Interpretation property on the Raster data source.

