[postgis-users] Efficient ways to query PostGIS Raster pixel values using Intersects

Bborie Park bkpark at ucdavis.edu
Mon Dec 12 17:45:17 PST 2011


On Mon, Dec 12, 2011 at 3:55 PM, Andrew Hill <andrew at vizzuality.com> wrote:
> Sure sure, here is the ST_Metadata
>
> (-179.9,84.905556,100,100,0.0988488850916839,-0.0988488850916839,0,0,4326,3)
>
> I actually checked that against the ST_Envelope(rast) and couldn't find the
> source of the error. Also, I've tried the simpler version, it fails the same
> way.
>

Hey Andrew,

I tested a raster using your metadata and the geometry in your prior
message and the alignment test comes back true.


WITH foo AS (
	SELECT ST_MakeEmptyRaster(1, 1, -179.9, 84.905556,
0.0988488850916839,-0.0988488850916839, 0, 0, 4326) AS rast
)
SELECT
	ST_SameAlignment(ST_AsRaster(GEOMETRYFROMTEXT('MULTIPOLYGON(((10 10,
10 0, 0 0, 0 10, 10 10)))',4326), foo.rast), foo.rast)
FROM foo;

So, the only possibility in my head for the ST_SameAlignment test to
come back false is if your copy of postgis trunk is older than
revision 8120 when I fixed several floating point issues.

-bborie

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



More information about the postgis-users mailing list