[postgis-devel] Another idea to speedup raster value editing
Paul Ramsey
pramsey at opengeo.org
Wed Feb 1 07:27:46 PST 2012
Kinda... but then you've got a multipoint to deal with and that's
easier because...?
How about just getting/taking an array?
P.
On Wed, Feb 1, 2012 at 12:52 AM, Sandro Santilli <strk at keybit.net> wrote:
> I've been thinking that for my use case (create the NTv2 gridshift)
> it would be fast to pass a measured MULTIPOINT geometry where X/Y
> would address the pixel and M would set the value.
>
> The same representation could be useful in output, to use in place
> of ST_PixelAsPolygon.
>
> Such function, implemented in C, would allow to set and get all values in
> a band with a single raster deserialization.
>
> Map algebra, btw, you could perform on the M values directly.
> Something like:
>
> WITH
> pixels AS (
> SELECT (ST_DumpPixelsAsPointM(rast)).geom FROM myrasttable
> ),
> newpixels AS (
> SELECT ST_Point(ST_X(geom),ST_Y(geom), ST_M(geom)+1) as geom
> )
> SELECT ST_SetValueFromPointM(rast, st_collect(geom) FROM newpixels;
>
> How do you like it ?
>
> --strk;
>
> ,------o-.
> | __/ | Thank you for PostGIS-2.0 Topology !
> | / 2.0 | http://www.pledgebank.com/postgistopology
> `-o------'
>
> _______________________________________________
> 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