[postgis-users] Rasterize a vector

Paolo Cavallini cavallini at faunalia.it
Tue May 29 06:41:46 PDT 2012


Hi all.
I'm testing the ST_AsRaster command to convert a vector of adjacent polygons into a
raster with different cell values according to one of the variables. I want the
result to align to an existing raster. Sounds an easy task, but it is proving elusive.

create table rasterizzo6
 as select id as rid,
 St_asRaster(geom, 100, 100, '4BUI')
 as rast from province;

creates a raster with irregular tiles, so it cannot be read by QGIS, and it is not
aligned to an existing rasters.

Are there more detailed instructions available?
Thanks.
-- 
Paolo Cavallini - Faunalia
www.faunalia.eu
Full contact details at www.faunalia.eu/pc



More information about the postgis-users mailing list