192 | | A very generic core utility could be provided with the definition of: |
193 | | |
194 | | 1. Input extension points defined for `geometry`, `geomval`, and `raster` data types. |
195 | | 1. Spatial operation extension points defined for common operations: difference, intersection, symmetric difference, and union. |
196 | | 1. Value computation extension points defined for: mask value, copy value from input 1 (preferred) or input 2 (if necessary), expression evaluation. |
197 | | |
198 | | Such a core utility would be called with different arguments in order to handle different combinations of input arguments, spatial operations, and value computations. Each extension point represents a well-encapsulated, reusable module which can be combined in many ways with other extension points. There is only one grid iteration engine (for the two input case), and it contains only the basic iteration logic; as the logic for other necessary pieces has been factored out to separate modules. |
| 192 | Examination of the above requirements suggests a single interface could represent both a "Spatial Only" and a "Spatial Value" information type, and could also represent both inputs as well as the output. The main functions of this interface would be to provide access to two methods: one which determines whether a point is included in the collection of geometric objects; and another which returns a value associated with a point. The following UML diagram provides a design which fits these requirements: |
| 193 | |
| 194 | [[Image(spatialcollection.png)]] |
| 195 | |
| 196 | Using this design, the raster iteration engine would be called with different arguments in order to handle different combinations of input arguments, spatial operations, and value computations. Each extension point represents a well-encapsulated, reusable module which can be combined in many ways with other extension points. There is only one grid iteration engine (for the two input case), and it contains only the basic iteration logic; as the logic for other necessary pieces has been factored out to separate modules. |