[postgis-devel] loading a raster with overview fails

John Thakkar thakkar at nexgenwireless.com
Wed Aug 31 12:42:30 PDT 2011


I'm trying to load overviews for a raster with this command.

 

/usr/local/pgsql/bin/gdal2wktraster.py -s 26918 -M -I -v -V -l 4 -k 256x256
-r raster.grd -t schema.mytablename

 

It fails with this information.

 

Traceback (most recent call last):

  File "/usr/local/pgsql/bin/gdal2wktraster.py", line 1014, in <module>

    main()

  File "/usr/local/pgsql/bin/gdal2wktraster.py", line 977, in main

    wkblify_raster(opts, filename, i)

  File "/usr/local/pgsql/bin/gdal2wktraster.py", line 922, in wkblify_raster

    summary = wkblify_raster_level(options, ds, options.overview_level,
band_range, infile, i)

  File "/usr/local/pgsql/bin/gdal2wktraster.py", line 889, in
wkblify_raster_level

   hexwkb += wkblify_band(options, band, level, xoff, yoff, read_block_size,
block_size, infile, b)

  File "/usr/local/pgsql/bin/gdal2wktraster.py", line 797, in wkblify_band

    out_pixels[row] = out_line

ValueError: shape mismatch: objects cannot be broadcast to a single shape

 

It seems to write the entire SQL properly but seems to fail while inserting?

 

Here is the gdal info on the file.

 

Driver: NWT_GRD/Northwood Numeric Grid Format .grd/.tab

Files: raster.grd

Size is 1293, 1276 

Coordinate System is:

PROJCS["unnamed",

    GEOGCS["unnamed",

        DATUM["North_American_Datum_1983",

            SPHEROID["GRS 80",6378137,298.257222101],

            TOWGS84[0,0,0,-0,-0,-0,0]],

        PRIMEM["Greenwich",0],

        UNIT["degree",0.0174532925199433]],

    PROJECTION["Transverse_Mercator"],

    PARAMETER["latitude_of_origin",0],

    PARAMETER["central_meridian",-75],

    PARAMETER["scale_factor",0.9996],

    PARAMETER["false_easting",500000],

    PARAMETER["false_northing",0],

    UNIT["Meter",1]]

Origin = (306885.000000000000000,4328685.000000000000000)

Pixel Size = (30.000000000000000,-30.000000000000000)

Corner Coordinates:

Upper Left  (  306885.000, 4328685.000) ( 77d13'57.95"W, 39d 5' 9.33"N)

Lower Left  (  306885.000, 4290405.000) ( 77d13'19.14"W, 38d44'28.42"N)

Upper Right (  345675.000, 4328685.000) ( 76d47' 4.23"W, 39d 5'37.14"N)

Lower Right (  345675.000, 4290405.000) ( 76d46'33.21"W, 38d44'55.89"N)

Center      (  326280.000, 4309545.000) ( 77d 0'13.63"W, 38d55' 3.48"N)

Band 1 Block=1293x1 Type=Byte, ColorInterp=Red

  NoData Value=0

Band 2 Block=1293x1 Type=Byte, ColorInterp=Green

  NoData Value=0

Band 3 Block=1293x1 Type=Byte, ColorInterp=Blue

  NoData Value=0

Band 4 Block=1293x1 Type=Float32, ColorInterp=Undefined

  NoData Value=0

  Offset: -100,   Scale:0.00305185094759972

 

 

Any help would be appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20110831/c6f40a4b/attachment.html>


More information about the postgis-devel mailing list