[postgis-users] WKT Raster Error

Paragon Corporation lr at pcorp.us
Mon Oct 25 22:38:00 PDT 2010


Andreas,
Nope haven't seen that error before.
 
I take it this used to work for you - gdal2wtraster.py.
 
Which version of gdal are you running under python?
 
FWIW -- we don't run it like that -- we run with the -o output file swithin.
I'm not sure the way you are running it works or not
 
So try
c:\Python25\python c:\wktraster_pg84\bin\gdal2wktraster.py -r
c:\prio_grid\source\forest\fcworld.img -t forest -s 4326 -I  -o
C:\prio_grid\source\gpw\forest.sql
 
and see if you have any better luck.
 
Alternatively you can try the new postgis raster packaged with PostGIS 2.0
and use the gdal2raster.py.  It has some minor fixes in it.
 
Although its in 2.0, at the moment the rtpostgis*.dll is still a separate
binary and doesn't YET have any direct dependency on postgis-2.0.dll (and
has a few more functions that the old wktraster project is missing. So you
can grab it from there and use with your PostGIS 1.5/1.4  or whatever
install.
 
This MAY CHANGE when PostGIS 2.0 finally comes out.
 
We'll also be releasing a new windows binaries of PostGIS 2.0 in the next
day or so.  The dll in that build will change from rtpostgis.dll to
rtpostgis-2.0.dll, but will still be pretty much the same functionality.
 
 
Leo and Regina
http://www.postgis.us
 
  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Andreas
Forø Tollefsen
Sent: Monday, October 25, 2010 8:04 AM
To: PostGIS Users Discussion
Subject: [postgis-users] WKT Raster Error


Anyone familiar with the below error? 
I have never experienced it before when importing rasters:

C:\Python25>c:\Python25\python c:\wktraster_pg84\bin\gdal2wktraster.py -r
c:\pri
o_grid\source\forest\fcworld.img -t forest -s 4326 -I >
C:\prio_grid\source\gpw\
forest.sql
c:\wktraster_pg84\bin\gdal2wktraster.py:645: DeprecationWarning: integer
argumen
t expected, got float
  hexstr = binascii.hexlify(struct.pack(fmt_little, data)).upper()
Traceback (most recent call last):
  File "c:\wktraster_pg84\bin\gdal2wktraster.py", line 1014, in <module>
    main()
  File "c:\wktraster_pg84\bin\gdal2wktraster.py", line 977, in main
    wkblify_raster(opts, filename, i)
  File "c:\wktraster_pg84\bin\gdal2wktraster.py", line 922, in
wkblify_raster
    summary = wkblify_raster_level(options, ds, options.overview_level,
band_ran
ge, infile, i)
  File "c:\wktraster_pg84\bin\gdal2wktraster.py", line 889, in
wkblify_raster_le
vel
    hexwkb += wkblify_band(options, band, level, xoff, yoff,
read_block_size, bl
ock_size, infile, b)
  File "c:\wktraster_pg84\bin\gdal2wktraster.py", line 778, in wkblify_band
    target_block_size[0], target_block_size[1])
  File "C:\Python25\Lib\site-packages\osgeo\gdal.py", line 835, in
ReadAsArray
    buf_xsize, buf_ysize, buf_obj )
  File "C:\Python25\Lib\site-packages\osgeo\gdal_array.py", line 138, in
BandRea
dAsArray
    buf_xsize, buf_ysize, datatype )
  File "C:\Python25\Lib\site-packages\osgeo\gdal.py", line 760, in
ReadRaster
    return _gdal.Band_ReadRaster(*args, **kwargs)
MemoryError
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20101026/4d125f74/attachment.html>


More information about the postgis-users mailing list