[postgis-devel] [raster] a more general geomval

Bryce L Nordgren bnordgren at gmail.com
Wed Jul 20 14:22:54 PDT 2011


I note that the geometry-value type (CV_GeometryValuePair in ISO 19123
speak) is defined as:

/* WKT string representing each polygon in WKT format acompagned by its
correspoding value */
struct rt_geomval_t {
    int srid;
    double val;
    char * geom;
};

I understand that it works just dandy for the original intended purpose
(polygonize a single band of a raster). In this case, the "key" is the "val"
field, and the "value" is the "geom" field (e.g., you lookup the desired
polygons based on the value). But it doesn't work so well for the reverse
case. For instance, you can't use it to represent one or more points in the
raster (e.g., the value of the raster at position (i,j) (all bands) is
[a,b,c,...]) Clearly, you can store the WKT of point (i,j) in "geom", but
"val" would need to be an array.

Also, is there any reason to pass around WKT in the C struct, instead of a
LWGEOM?

If I desired a more general geomval, should I just write a different one, or
would it be OK to modify this one?

If a justification is necessary, let's just say that a multivalued geomval
enables multiband raster-operations (as opposed to band-operations). With it
you can represent the value of an RGB pixel instead of just individual
bands. This seems to be an area not yet well defined.

Bryce
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20110720/387a31d3/attachment.html>


More information about the postgis-devel mailing list