[postgis-users] ST_Value from Polygon

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Wed Mar 2 08:08:17 PST 2011


>Ok thanks. I got a bit confused regarding the vectorizing. Isnt that what i am doing with this query?
>I have now reduced the resolution to increase performance. Each cell is
>now 0.02222222222222224x0.02222222222222224. (previous X 8)

Yes this is what you are doing. ST_Intersection will polygonize (or vectorize) every tile before intersecting. What I meant is that it SHOULD be used in conjonction with ST_Intersects in the WHERE clause on a tiled coverage.

This is what I would call the "vector" way of computing raster statistics. I'm working on a "pixel" way where we count pixel one after the other without vectorizing anything. The performance of the "vector" way is better for a certain tile size but it seems not to reduce with smaller tile. The "pixel" way does get better performance with smaller tiles so that I get much better performance now with this method than with the vector one. I had to reimport my coverage with -k25x25 instead of 100x100 though. The pixel method is a bit more coarse since it is a "take all the pixel or nothing" approach when the vector method "cuts" the pixels so that you get exactly the right proportion intersecting your polygon. It will be interesting to compare the two approaches.

I will try to add the "pixel" method to the wiki soon.

Pierre



More information about the postgis-users mailing list