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

David Zwarg dzwarg at avencia.com
Mon Feb 22 12:21:50 PST 2010


Pierre,

You are probably right.  I was borrowing from our conversation, when
we were talking about setting the georeference/resampling based on an
input raster in ST_MapAlgebra.  It's probably overkill in this case;
indeed, I can't think of a good use-case.  I will be happy to remove
that override (I've done it for a couple of the other methods --
namely st_setrotation, st_setupperleft) if you can't think of a good
use-case, either.

Thanks,
Zwarg

On Mon, Feb 22, 2010 at 3:10 PM, Pierre Racine
<Pierre.Racine at sbf.ulaval.ca> wrote:
> 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
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>



More information about the postgis-devel mailing list