| 31 | == Discrete Coverages == |
| 32 | |
| 33 | If the easiest way to think of continuous coverages is to think of continuously varying coverages, then the easiest way to think of discrete coverages is to envision a coverage which is not continuously variable. In short: the values "jump" suddenly from one value to another. The coverage does not look "smooth" when displayed in a viewer. |
| 34 | |
| 35 | Discrete coverages are not typically implemented by an equation, but are usually based on a collection of data. The collection of data is self-consistent, meaning that all data items in the collection have the same types. As the terms are commonly used, raster and vector coverages are both ''types of'' discrete coverage. They differ only in how they store and manage their collection of data. Since they are almost invariably based on a collection of data, discrete coverages offer additional functionality related to querying the data for items which match a specific criteria: |
| 36 | |
| 37 | * `find()` locates the nearest data items to a given point. |
| 38 | * `select()` locates all the data items within a given region. |
| 39 | * `list()` returns all the data items in the collection. |
| 40 | |
| 41 | The most important concept of this section is that a coverage is not the same thing as the data upon which it is based. Using the same term for two different things may have been acceptable in the past, but now that raster is here, it is important to learn the difference. The differences are subtle, and it is important to master these subtleties. |
| 42 | |
| 43 | Two main types of discrete coverages, in the common parlance, are "vector" and "raster". These are not distinctions present in ISO 19123, which has served as the basis of this document up to this point. We introduce the notions of vector and raster simply because the terms have a notional value, and we wish to place them in context with respect to a larger framework. |
| 44 | |
| 45 | === Vector Coverages === |
| 46 | |
| 47 | Vector coverages are probably the most familiar type of coverage to the majority of users. The collection of data items upon which the coverage is based is usually a table. Individual data items are individual rows in the table. The columns of the table ensure that the collection is self-consistent Each data item (row) may fill in values for each column: text may be placed in text columns, numbers in numeric columns, geometries in geometry columns, etc. The only requirement a table must fulfill in order to have the potential to supply information to a coverage is that it must have at least one `geometry` column. |
| 48 | |
| 49 | The following table could serve as a collection of data items upon which a coverage could be built. Note that it has a `geometry` column (geom), two text columns (Name and Mayor), and two numeric columns (Elevation and Population). Each row is a data item, and each relates a point to a consistent set of values, defined by the columns. |
| 50 | |
| 51 | [[Image(Cities.png)]] |
| 52 | |
| 53 | This single table could back any number of coverages. It could back a "Population" coverage simply by returning the value in the Population column whenever the query point intersects the geometry. |