[postgis-users] Error Loading HDF4 Format with raster2pgsql.py Script.

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Nov 7 08:59:18 PST 2011


Apparently the gdal Python binding is not able to determine the pixeltype of the raster...

Does gdalinfo can?

> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-
> bounces at postgis.refractions.net] On Behalf Of elliott
> Sent: Monday, November 07, 2011 10:45 AM
> To: PostGIS Users Discussion
> Subject: [postgis-users] Error Loading HDF4 Format with raster2pgsql.py Script.
> 
> Hi,
> 
> I have tried to load an HDF4 formatted MODIS temperature file with the
> raster2pgsql.py script and getting the following error.  I have built GDAL with the
> HDF4 format and it seems to recognize the file but the loader is having the
> following problem:
> 
> /usr/local/pgsql/bin/raster2pgsql.py -r
> MOD11A2.A2011289.h27v05.005.2011298111759.hdf -F -t modisLandTemp -s
> 4326 -I > /usr/local/pgsql/data/modislt.sql Traceback (most recent call last):
>    File "/usr/local/pgsql/bin/raster2pgsql.py", line 1040, in <module>
>      main()
>    File "/usr/local/pgsql/bin/raster2pgsql.py", line 1003, in main
>      gt = wkblify_raster(opts, filename.replace( '\\', '/') , i, gt)
>    File "/usr/local/pgsql/bin/raster2pgsql.py", line 945, in wkblify_raster
>      summary = wkblify_raster_level(options, ds, options.overview_level,
> band_range, infile, i)
>    File "/usr/local/pgsql/bin/raster2pgsql.py", line 861, in wkblify_raster_level
>      pixel_size, block_size, extent)
>    File "/usr/local/pgsql/bin/raster2pgsql.py", line 385, in
> make_sql_addrastercolumn
>      assert len(pixeltypes) > 0, "No pixel types given"
> AssertionError: No pixel types given
> 
> Thanks for your help!
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users



More information about the postgis-users mailing list