[postgis-devel] [wktraster] An example for ST_SetPixelSize(raster, raster)

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Feb 22 12:10:24 PST 2010


Hi,

The example provided for ST_SetPixelSize(raster, raster) in the WKT Raster specs looks like:

SELECT st_setpixelsize(rast,(
    '01' -- little endian (uint8 ndr)
    ||
    '0000' -- version (uint16 0)
    ||
    '0000' -- nBands (uint16 0)
    ||
    '0000000000000840' -- scaleX (float64 3)
    ||
    '0000000000000040' -- scaleY (float64 2)
    ||
    '000000000000E03F' -- ipX (float64 0.5)
    ||
    '000000000000E03F' -- ipY (float64 0.5)
    ||
    '0000000000000000' -- skewX (float64 0)
    ||
    '0000000000000000' -- skewY (float64 0)
    ||
    '0A000000' -- SRID (int32 10)
    ||
    '0A00' -- width (uint16 10)
    ||
    '1400' -- height (uint16 20)
)::raster)
FROM rt_properties_test;

So that the pixel size to set in "rast" is borrowed from a fake raster. To me, this is not a really good example proving the usefulness of this way to get parameters from an existing raster. There is no real difference between this and:

SELECT st_setpixelsize(rast, 4) FROM rt_properties_test;

which is a much more realistic usage.

Anybody have a real example of borrowing parameters from another raster? I try to think about such a usage in PostGIS functions for geometry and I can't find any. This would imply a join to another table that would totally brake or denature (I don't know how to say that) the query. Also, there is no such thing in PostGIS as, for example:

ST_SetSRID(geometry geom, geometry geom);

where the SRID to set is borrowed from a second geometry. Is this wishable? Any real example?

Thanks,

Pierre




More information about the postgis-devel mailing list