[postgis-users] ST_AsRaster vs raster2pgsql

georgew gws293 at hotmail.com
Tue Mar 4 09:51:14 PST 2014


Hi, I am new to raster and am having some problems creating a raster table
from a contour vector table, PostGIS 2.1.1, Win 8.1 64bit 

To create the table I am using: 

CREATE TABLE BK30_dem2 AS 
  SELECT 1 AS rid, ST_AsRaster(( 
       SELECT 
          ST_Collect(geom) 
       FROM contours_topo_2 where sheet='BK30' 
       ), 5.0, 5.0 ) 
  AS rast; 
  
For comparison purpose I also created a grid from the same contours using
SAGA GIS, then created a second raster table in PostGIS using: 

 raster2pgsql -I -C -s 2193 I:\dems\pg-50k-grid\BK30\BK30_dem2.sdat
public.bk30_saga | psql -d NZTPU; 
  
 I was hoping for identical results but the output from Raster Columns shows
the following: 
  

"NZTPU";"public";"bk30_saga";"rast";2193;5;-5;4801;5784;TRUE;FALSE;1;"{32BF}";"{-99999}";"{f}";"010300002091080000010000000500000000000080DD0F3A41CECF067D3C72554100000080A26D3A41CECF067D3C72554100000080A26D3A41CECF067DFE55554100000080DD0F3A41CECF067DFE55554100000080DD0F3A41CECF067D3C725541"
  
"NZTPU";"public";"bk30_dem2";"rast";0;;;;;FALSE;FALSE;;"";"";"";"" 

Clearly I am doing something wrong, but what?? 
Many thanks for any help. 



--
View this message in context: http://postgis.17.x6.nabble.com/ST-AsRaster-vs-raster2pgsql-tp5005827.html
Sent from the PostGIS - User mailing list archive at Nabble.com.


More information about the postgis-users mailing list