[postgis-users] Raster2pgsql.py Possible No Data Problem

Andreas Forø Tollefsen andreasft at gmail.com
Wed Mar 2 08:40:18 PST 2011


Hi,

Postgresql 8.4.7
postgis-pg84-binaries-2.0.0svn.zip
Tested with latest raster2pgsql.py rev 6860

I have a raster which is giving me problems when creating the raster table.
The raster does not have any digits for no data but 'no data'.
Could this be the cause of the below problem? I tried a different raster
which normally have been working with the old gdal2wktraster.py script.
Any suggestions?

The error:
C:\Python25>python raster2pgsql.py -r
c:\prio_grid\source\mountain\mean_mnt_bin.
tif -t mountain -o mountain.sql
Traceback (most recent call last):
  File "raster2pgsql.py", line 1036, in <module>
    main()
  File "raster2pgsql.py", line 999, in main
    gt = wkblify_raster(opts, filename.replace( '\\', '/') , i, gt)
  File "raster2pgsql.py", line 941, in wkblify_raster
    summary = wkblify_raster_level(options, ds, options.overview_level,
band_ran
ge, infile, i)
  File "raster2pgsql.py", line 853, in wkblify_raster_level
    nodata_values = collect_nodata_values(ds, band_from, band_to)
  File "raster2pgsql.py", line 532, in collect_nodata_values
    if nodata is not None and not math.isnan(nodata):
AttributeError: 'module' object has no attribute 'isnan'

C:\Python25>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110302/f57d4f9b/attachment.html>


More information about the postgis-users mailing list