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

Jorge Arévalo jorge.arevalo at deimos-space.com
Wed Mar 2 09:19:59 PST 2011


On Wed, Mar 2, 2011 at 5:40 PM, Andreas Forø Tollefsen
<andreasft at gmail.com> wrote:
> 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>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>

Hi,

The problem is with the 'isnan' function. I see it was included in
Python 2.6. We need a replacement in case of lower Python versions.
I'll fix it asap (hopefully, when I arrive home).

Best regards, and thanks for the feedback

-- 
Jorge Arévalo
Internet & Mobilty Division, DEIMOS
jorge.arevalo at deimos-space.com
http://es.linkedin.com/in/jorgearevalo80
http://mobility.grupodeimos.com/
http://gis4free.wordpress.com
http://geohash.org/ezjqgrgzz0g



More information about the postgis-users mailing list