[postgis-devel] [PostGIS] #1839: [raster] raster2pgsql is unable to handle TIFF subdatasets

PostGIS trac at osgeo.org
Tue May 29 09:58:51 PDT 2012


#1839: [raster] raster2pgsql is unable to handle TIFF subdatasets
-----------------------------------------------------+----------------------
 Reporter:  turbothomas                              |       Owner:  dustymugs    
     Type:  defect                                   |      Status:  assigned     
 Priority:  medium                                   |   Milestone:  PostGIS 2.0.1
Component:  raster                                   |     Version:  2.0.x        
 Keywords:  raster2pgsql, TIFF, subdataset, history  |  
-----------------------------------------------------+----------------------

Comment(by dustymugs):

 What are you passing to raster2pgsql?  If I'm correct based upon with
 working with other raster formats (HDF4, HDF5, NetCDF) with subdatasets,
 you can't pass the raster file in as that automatically assumes the first
 subdataset.  Instead, you need to pass in something like:

 {{{
 SUBDATASET_1_NAME=GTIFF_DIR:1:pathto/imagename.tif
 }}}

 The above is from the gdalinfo output you posted in a prior comment.  So,
 the following only gets the first subdataset.

 {{{
 raster2pgsql -s 0 -t 50x50 pathto/imagename.tif tablename
 }}}

 The following gets the specific subdataset

 {{{
 raster2pgsql -s 0 -t 50x50
 SUBDATASET_1_NAME=GTIFF_DIR:1:pathto/imagename.tif tablename
 }}}

 The behavior is as such because a raster can have multiple subdatasets,
 each of which can have multiple bands.  Actually, the behavior is exactly
 the same as with any of the gdal utilities.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1839#comment:17>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list