[postgis-users] Polygon grid to multiband raster?

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Mar 19 08:53:22 PDT 2012


Use ST_AsRaster() to rasterize a polygon.

Pierre

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of David Quinn
> Sent: Saturday, March 17, 2012 5:46 PM
> To: PostGIS Users Discussion
> Subject: [postgis-users] Polygon grid to multiband raster?
> 
> Hi List,
> 
> Is it possible to convert a polygon grid into a multiband raster in PostGIS 2.0?
> 
> For example, I saw on an earlier question that a multiband raster can be
> generated using the following code:
> 
> CREATE newtable AS
> SELECT ST_AddBand(ST_Band(table1.rast, 1), ST_Band(table2.rast, 1)) rast FROM
> table1, table2 WHERE table1.rid = table2.rid
> 
> Is it possible to do something like the following?
> 
> CREATE newtable AS
> SELECT ST_AddBand( "rasterize (t.geom, col1)", "rasterize (t..geom, col2)" )  rast
> FROM table1 as t
> 
> where "rasterize (t.geom, col1)" is my pseudocode description of how I want to
> convert the polygon grid into a raster, using a column name.
> 
> - David




More information about the postgis-users mailing list