You can set the pixeltype and the extent in ST_AsRaster(). You seems also to have a different nodata value that you can also set in ST_AsRaster(). So a bit of reading about ST_AsRaster() and experiment and you'll should get what you want.
Pierre > -----Original Message----- > From: [email protected] [mailto:postgis-users- > [email protected]] On Behalf Of georgew > Sent: Tuesday, March 04, 2014 4:55 PM > To: [email protected] > Subject: Re: [postgis-users] ST_AsRaster vs raster2pgsql > > Thank you Pierre, after adding constraints I get: > > "NZTPU";"public";"bk30_saga";"rast";2193;5;- > 5;4801;5784;TRUE;FALSE;1;"{32BF}";"{- > 99999}";"{f}";"010300002091080000010000000500000000000080DD0F3 > A41CECF067D3C72554100000080A26D3A41CECF067D3C7255410000008 > 0A26D3A41CECF067DFE55554100000080DD0F3A41CECF067DFE5555410 > 0000080DD0F3A41CECF067D3C725541" > > "NZTPU";"public";"bk30_dem2";"rast";2193;5;- > 5;4800;5783;TRUE;FALSE;1;"{8BUI}";"{0}";"{f}";"010300002091080000010 > 000000500000000000000E00F3A41000000003C72554100000000A06D3 > A41000000003C72554100000000A06D3A4100000040FF5555410000000 > 0E00F3A4100000040FF55554100000000E00F3A41000000003C725541" > > much better! but not identical. The blocksize is slightly different, the > pixel type and no_data value are different and the extent geometry is also > slightly different, I assume all due to the pixel type being generated > differently. Using st_metadata and st_bandmetadata I get: > > "(1707997.5,5622001.95354076,4801,5784,5,-5,0,0,2193,1)";"(32BF,- > 99999,f,)" > saga > "(1708000,5622000,4800,5783,5,-5,0,0,2193,1)";"(8BUI,0,f,)" > dem2 > > Any suggestions as to what I can do to make them identical? > > > > -- > View this message in context: http://postgis.17.x6.nabble.com/ST- > AsRaster-vs-raster2pgsql-tp5005827p5005830.html > Sent from the PostGIS - User mailing list archive at Nabble.com. > _______________________________________________ > postgis-users mailing list > [email protected] > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users _______________________________________________ postgis-users mailing list [email protected] http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
