| 78 | |
| 79 | === Vector coverages backed by a geomval collection === |
| 80 | |
| 81 | With the advent of PostGIS raster, a new datatype was introduced: the `geomval`. This name stands for "geometry-value", and pairs a single geometry object with a single value. Using this type is another way to associate locations with values, which is the single requirement for data which backs a coverage. |
| 82 | |
| 83 | The collection of `geomval` elements is analogous to a table having one `geometry` column and one value column capable of containing numeric data. (The type may be enhanced in the future to include more than one numeric value.) Each element in the collection is analogous to a single row of the table. |
| 84 | |
| 85 | The `geomval` type was originally introduced to represent a "vectorized" raster. That is, using the function [http://postgis.refractions.net/documentation/manual-svn/RT_ST_DumpAsPolygons.html ST_DumpAsPolygons()], you can obtain a set of `geomval`s, each of which relates a polygon to a particular value. The polygon "outlines" all of the pixels which possess the indicated value. Alternatively, you can request specific values to be returned. After a raster has been "vectorized" in this way, the geometries may participate in the normal spatial operations (intersection, difference, etc.) with other geometries. This enables mixed raster and geometry operations which return geometries, and the computation is actually performed using two geometries. |
| 86 | |
| 87 | As this process can be rather slow if a large number of pixels are "vectorized", the user should take care to minimize the number of pixels which require this treatment. |
| 88 | |
| 89 | == Summary == |
| 90 | |
| 91 | This page attempts to present some of the new capabilities added by PostGIS Raster, relevant to how data are represented inside PostGIS. Two new datatypes have been introduced: `raster` and `geomval`. |
| 92 | |
| 93 | A table containing a `raster` column must be treated with care in order to ensure that the desired effect is achieved. A single image may be split over multiple rows, and later re-aggregated into a single unit. To aggregate a single "raster coverage" from the rows in such a table, the user must ensure that all of the rows participating in the aggregation have the same number of bands and the same data type. This is clearly the case when a single image produces all of the rows, but may not be the case if other data were subsequently inserted. Columns which do not have the `raster` type may be used to identify the original image (coverage) for the purposes of selecting which rows participate in the aggregation. If the user has no intention of aggregating individual rows into a larger product (or performing an operation on a set of rows as if they were a single logical item--e.g., an image), then none of these restrictions need apply. |
| 94 | |
| 95 | The `geomval` type is an alternative way to store data for a vector coverage with numeric values. Originally used as a means of representing a "vectorized" raster, it contains the same information as the source raster; but in a different form. |