[postgis-users] raster2pgsql: -t TILE_SIZE

Bborie Park dustymugs at gmail.com
Mon Mar 16 08:31:57 PDT 2015


Ramon,

It really depends on whether the rasters are stored in the database (in-db)
or out of the database (out-db)

If out-db, I recommend using the block size returned when running gdalinfo
on the raster...

# gdalinfo raster/test/regress/loader/testraster.tif
Driver: GTiff/GeoTIFF
Files: raster/test/regress/loader/testraster.tif
Size is 90, 50
Coordinate System is `'
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,   50.0)
Upper Right (   90.0,    0.0)
Lower Right (   90.0,   50.0)
Center      (   45.0,   25.0)
Band 1 *Block=90x30* Type=Byte, ColorInterp=Red
Band 2 Block=90x30 Type=Byte, ColorInterp=Green
Band 3 Block=90x30 Type=Byte, ColorInterp=Blue

I've bolded the important bit.

If you're storing the raster in the database, I have no specific
suggestions. The reason for no suggestion is that it really depends on the
characteristics of the raster (number of bands, pixel type of each band)
and the server environment.

Having said that, I personally use the output from gdalinfo even for in-db
rasters.

-bborie


On Mon, Mar 16, 2015 at 8:23 AM, Stephen Mather <stephen at smathermather.com>
wrote:

> Hi Ramon,
>
> I am not an expert on this by any measure. Better to check with the
> postgis user group (cc'd). I know the better size choices have changed a
> lot since Bborie optimized / rewrote in C.
>
> Best,
>
> Steve
>
>
>
> On Mar 16, 2015 4:24 AM, "Ramon de Leon" <r.a.deleon80 at gmail.com> wrote:
>
>>
>> Hi Steve,
>>
>> Hope you are doing well.
>>
>> Just wondering if there is a good rule-of-thumb thing for choosing
>> tile_size in importing raster datasets via raster2pgsql.
>>
>> I usually use 100x100 or 128x128 just because it is most that I see on
>> examples. Sometimes I use the "auto" but I don't know if that helps in
>> optimization when the table gets into Postgres.
>>
>> I want to test importing some fairly large rasters to the DB like
>> Globcover (
>> http://www.un-spider.org/links-and-resources/data-sources/globcover-esa)
>> but I still lack knowledge on the import process good practices
>> and optimization. Would appreciate general tips in importing rasters
>> (specially larger datasets)!
>>
>> Thanks!
>>
>>
>> - Ramon
>>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150316/d09766b5/attachment.html>


More information about the postgis-users mailing list