[postgis-devel] loading a raster with overview fails
Pierre Racine
Pierre.Racine at sbf.ulaval.ca
Wed Aug 31 13:10:50 PDT 2011
Right. Someone should be looking at it before 2.0 John. It's a blocker.
Don't be shy to dig it if you have some knowledge of Python ;-)
Pierre
> -----Original Message-----
> From: postgis-devel-bounces at postgis.refractions.net [mailto:postgis-devel-
> bounces at postgis.refractions.net] On Behalf Of John Thakkar
> Sent: Wednesday, August 31, 2011 4:08 PM
> To: 'PostGIS Development Discussion'
> Subject: Re: [postgis-devel] loading a raster with overview fails
>
> It looks like ticket #1151 has been opened by pracine for this based on my last
> email to the group. Thanks!
>
>
>
> From: postgis-devel-bounces at postgis.refractions.net [mailto:postgis-devel-
> bounces at postgis.refractions.net] On Behalf Of John Thakkar
> Sent: Wednesday, August 31, 2011 2:43 PM
> To: postgis-devel at postgis.refractions.net
> Subject: [postgis-devel] loading a raster with overview fails
>
>
>
> 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.
More information about the postgis-devel
mailing list