Opened 13 years ago

Last modified 13 years ago

#1574 closed defect

[raster] ST_AsRaster(geometry, rast) do not align raster properly — at Version 1

Reported by: pracine Owned by: pracine
Priority: medium Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc:

Description (last modified by pracine)

I made the queries to be easily displayable in OpenJump...

I have a geometry:

SELECT ST_Asbinary(ST_Buffer(ST_SetSRID(ST_MakePoint(2, 1), 0), 1.3));

and a raster:

SELECT ST_Asbinary((gv).geom) geom, (gv).val
FROM (SELECT ST_PixelAsPolygons(ST_MakeEmptyRaster(4, 4, 0, 0, 1, 1, 0, 0, 0)) gv) foo

and I want to rasterize that geometry aligned on this raster:

SELECT ST_Asbinary((gv).geom) geom, (gv).val
FROM (SELECT ST_PixelAsPolygons(
               ST_AsRaster(
                           ST_Buffer(ST_SetSRID(ST_MakePoint(2, 1), 0), 1.3),
                           ST_MakeEmptyRaster(4, 4, 0, 0, 1, 1, 0, 0, 0)
                          )
             ) gv 
     ) foo

The produced raster is not aligned properly.

Change History (1)

comment:1 by pracine, 13 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.