[postgis-users] import raster

Eloi Ribeiro eloi at openmailbox.org
Fri Feb 28 03:38:22 PST 2014


On 2014-02-27 18:01, Bborie Park wrote:
> When using raster2pgsql, you wouldn't pass the -C flag. If you're
> going to use the generated SQL file, remove the SELECT
> AddRasterConstraints... line.
> 
> You can add the raster constraints that you want added later with the
> AddRasterConstraints() function.

Thanks bborie, with this last tip the import came down to 20 minutes. 
Considering the size of the image is quite acceptable.

Now the import looks like this:
raster2pgsql -s 4326 -d -I -Y -M -t 5x5 
/home/eloi/Documents/project_soilgrid1Km/ftp/data/5.Dec.2013/CEC_sd1_L_04_dec_2013.tif 
soilgrid1km.cec_l_b1i|psql -d gisbase

What could be the consequences of not creating only this single 
constraint 'enforce_max_extent_rast'? Once it takes just too much time, 
in 24 hours it was not finished. All the images I wont to import have 
the same extent -180 -90 180 90.

By the way, query the imported raster at certain point is really fast, 
it takes 12 milliseconds!! While the same raster but register (in the 
file system) takes 36 seconds.

Cheers,

Eloi Ribeiro



More information about the postgis-users mailing list