[postgis-users] PostGIS Raster efficient enough to get height given coords from a large DEM?
Paragon Corporation
lr at pcorp.us
Sun Dec 4 11:17:38 PST 2011
> Yes, you are correct about the significant performance issues
> with calling ST_SetValue for each pixel of a raster. This
> unfortunately has to do with the deserialization and
> serialization that occurs every time ST_SetValue is called.
>
> Hopefully, I can get to it before the 2.0 code freeze but the
> outlook doesn't look good.
>
> -bborie
>
> --
Not sure it helps but as a work-around I define my values I want to set as
a multipoint collection (Basically SELECt ST_Collect(my_grid_points), val
FROM myresults GROUP BY val
which I then convert to ST_AsRaster and then use ST_MapAlgebra to burn
into my main raster (one for each grouping using a union call)
http://www.postgis.org/documentation/manual-svn/RT_ST_AsRaster.html
http://www.postgis.org/documentation/manual-svn/RT_ST_MapAlgebraFct2.html
That I think works pretty fast (well much faster than ST_SetValue anyway).
I haven't bothered demonstrating the technique
since it will quickly become obsolete with the ST_Union already in place
(not yet documented) (though which needs some cleanup)
and also the other functions Bborie/Pierre have discussed/planned.
Thanks,
Regina
http://www.postgis.us
More information about the postgis-users
mailing list