There are more parameters to ST_AsRaster to align the raster you produce. You can align on an existing raster or provide all the parameters (scalex, scaley, gridx, gridy) to align it.
See http://postgis.refractions.net/documentation/manual-svn/RT_ST_AsRaster.html Pierre > -----Original Message----- > From: postgis-users-boun...@postgis.refractions.net [mailto:postgis-users- > boun...@postgis.refractions.net] On Behalf Of Paolo Cavallini > Sent: Tuesday, May 29, 2012 9:42 AM > To: PostGIS Users Discussion > Subject: [postgis-users] Rasterize a vector > > 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 > _______________________________________________ > postgis-users mailing list > postgis-users@postgis.refractions.net > http://postgis.refractions.net/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users