[postgis-devel] [PostGIS] #1574: [raster] ST_AsRaster(geometry, rast) do not align raster properly

PostGIS trac at osgeo.org
Mon Feb 13 10:40:40 PST 2012


#1574: [raster] ST_AsRaster(geometry, rast) do not align raster properly
---------------------+------------------------------------------------------
 Reporter:  pracine  |       Owner:  pracine      
     Type:  defect   |      Status:  new          
 Priority:  medium   |   Milestone:  PostGIS 2.0.0
Component:  raster   |     Version:  trunk        
 Keywords:           |  
---------------------+------------------------------------------------------
Description changed by pracine:

Old description:

> 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 and the extent do not
> encompass the geometry.

New description:

 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.

--

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1574#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list