[postgis-users] PostGIS Raster efficient enough to get height given coords from a large DEM?

Bborie Park bkpark at ucdavis.edu
Sun Dec 4 11:22:59 PST 2011


On Sun, Dec 4, 2011 at 11:17 AM, Paragon Corporation <lr at pcorp.us> wrote:
>
>> 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

Thanks Regina!  Never thought of that approach!

-- 
Bborie Park
Programmer
Center for Vectorborne Diseases
UC Davis
530-752-8380
bkpark at ucdavis.edu



More information about the postgis-users mailing list