Opened 14 years ago

Closed 14 years ago

#655 closed defect (fixed)

[raster] raster2pgsql -b switch produces bad sql file

Reported by: robe Owned by: pracine
Priority: critical Milestone: PostGIS 2.0.0
Component: raster Version: master
Keywords: Cc:

Description

I suppose it might be because I'm using 2.5 python with gdal 1.6, though without the -b switch works fine.

python raster2pgsql.py -s 4326 -r US.tif -b 1 -t usdem -l 1 -k 130x79 -o usdem.sql
psql -h localhost -U postgres -d gisdb -f usdem.sql

--gives psql:usdem.sql:4: ERROR: Premature end of WKB on band reading (rt_api.c:2208) --- Let me know if I need to attach the file.

Change History (5)

comment:1 by pracine, 14 years ago

Summary: raster: raster2pgsql -b switch produces bad sql file[raster] raster2pgsql -b switch produces bad sql file

comment:2 by pracine, 14 years ago

Priority: mediumcritical

comment:3 by pracine, 14 years ago

Status: newassigned

comment:4 by jorgearevalo, 14 years ago

The problem is the WKB string is created with the number of bands of the raster, instead of the band required with the -b option.

So, if the raster has 3 bands and you specify the option -b 1', the WKB string has 3 in the number of bands, instead of 1.

comment:5 by jorgearevalo, 14 years ago

Resolution: fixed
Status: assignedclosed

Fixed in r6610

Note: See TracTickets for help on using tickets.