<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=WordSection1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Wait. You first said the png was working. Now it’s not? Did you
try gdal_translate with the ESRI grid? For sure I haven’t test yet with such
big rasters. Is this the result of a merge or all your original raster are all this
size? The point is that with WKT Raster you don’t have to merge your raster
first into a gigantic raster in order to get it store in a unique table like
with Oracle Spatial.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Pierre<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <b>On Behalf Of </b>Sebastian
E. Ovide<br>
<b>Sent:</b> 20 juillet 2010 05:51<br>
<b>To:</b> PostGIS Users Discussion<br>
<b>Subject:</b> Re: [postgis-users] WKTRaster : gdal2wktraster.py cannot read
AIG/Arc/Info Binary Grid<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>Hi Pierre,<br>
<br>
Does gdal2wktraster.py have any limitation on the maximum number of
columnsxrows ?<br>
<br>
in my case, my raster is 107759 x 168633...<br>
<br>
gdal works well:<br>
<br>
sebas@SeansPC:~/rasters$ gdal_translate -of PNG raster/ test.png<br>
Input file size is 107759, 168633<br>
0...10...20...30...40...50...60...70...80...90...100 - done.<br>
<br>
<br>
sebas@SeansPC:~/rasters$ python gdal2wktraster.py -r raster/ -t sebastable -o
ok.sql<br>
gdal2wktraster.py:695: DeprecationWarning: 'H' format requires 0 <= number
<= 65535<br>
hexwkb += wkblify('H', xsize)<br>
gdal2wktraster.py:696: DeprecationWarning: 'H' format requires 0 <= number
<= 65535<br>
hexwkb += wkblify('H', ysize)<br>
gdal2wktraster.py:727: DeprecationWarning: integer argument expected, got float<br>
hexwkb += wkblify(pt2fmt(pixtype), nodata)<br>
Traceback (most recent call last):<br>
File "gdal2wktraster.py", line 1013, in <module><br>
main()<br>
File "gdal2wktraster.py", line 976, in main<br>
wkblify_raster(opts, filename, i)<br>
File "gdal2wktraster.py", line 921, in wkblify_raster<br>
summary = wkblify_raster_level(options, ds,
options.overview_level, band_range, infile, i)<br>
File "gdal2wktraster.py", line 888, in wkblify_raster_level<br>
hexwkb += wkblify_band(options, band, level, xoff, yoff,
read_block_size, block_size, infile, b)<br>
File "gdal2wktraster.py", line 777, in wkblify_band<br>
target_block_size[0], target_block_size[1])<br>
File "/usr/lib/python2.6/dist-packages/osgeo/gdal.py", line
895, in ReadAsArray<br>
buf_xsize, buf_ysize, buf_obj )<br>
File "/usr/lib/python2.6/dist-packages/osgeo/gdal_array.py",
line 228, in BandReadAsArray<br>
ar = numpy.empty([buf_ysize,buf_xsize], dtype = typecode)<br>
MemoryError<br>
<br>
<br>
sebas@SeansPC:~/rasters$ python gdal2wktraster.py -r test.png -t
sebastable -o ok.sql<br>
gdal2wktraster.py:695: DeprecationWarning: 'H' format requires 0 <= number
<= 65535<br>
hexwkb += wkblify('H', xsize)<br>
gdal2wktraster.py:696: DeprecationWarning: 'H' format requires 0 <= number
<= 65535<br>
hexwkb += wkblify('H', ysize)<br>
gdal2wktraster.py:727: DeprecationWarning: integer argument expected, got float<br>
hexwkb += wkblify(pt2fmt(pixtype), nodata)<br>
Traceback (most recent call last):<br>
File "gdal2wktraster.py", line 1013, in <module><br>
main()<br>
File "gdal2wktraster.py", line 976, in main<br>
wkblify_raster(opts, filename, i)<br>
File "gdal2wktraster.py", line 921, in wkblify_raster<br>
summary = wkblify_raster_level(options, ds,
options.overview_level, band_range, infile, i)<br>
File "gdal2wktraster.py", line 888, in wkblify_raster_level<br>
hexwkb += wkblify_band(options, band, level, xoff, yoff,
read_block_size, block_size, infile, b)<br>
File "gdal2wktraster.py", line 777, in wkblify_band<br>
target_block_size[0], target_block_size[1])<br>
File "/usr/lib/python2.6/dist-packages/osgeo/gdal.py", line
895, in ReadAsArray<br>
buf_xsize, buf_ysize, buf_obj )<br>
File "/usr/lib/python2.6/dist-packages/osgeo/gdal_array.py",
line 228, in BandReadAsArray<br>
ar = numpy.empty([buf_ysize,buf_xsize], dtype = typecode)<br>
MemoryError<br>
<br>
<br>
<br>
<br>
<o:p></o:p></p>
<div>
<p class=MsoNormal>On Mon, Jul 19, 2010 at 5:56 PM, Pierre Racine <<a
href="mailto:Pierre.Racine@sbf.ulaval.ca">Pierre.Racine@sbf.ulaval.ca</a>>
wrote:<o:p></o:p></p>
<div>
<div>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Hi Sebastian,</span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>I can convert ESRI Grid file to .sql
without problem using gdal2wktraster.py and the same parameters as you. I can
do both integer and floating point rasters.</span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Maybe this is a GDAL problem. Try to
convert it using gdal_translate (to tiff for example). This would be a better
test than just gdalinfo.</span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Could you provide us with a file sample?</span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'>Pierre</span><o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span
style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>
<div style='border:none;border-left:solid windowtext 1.5pt;padding:0cm 0cm 0cm 4.0pt;
border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color blue'>
<div>
<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;
border-color:-moz-use-text-color -moz-use-text-color'>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span
style='font-size:10.0pt'>From:</span></b><span style='font-size:10.0pt'> <a
href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a>
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net"
target="_blank">postgis-users-bounces@postgis.refractions.net</a>] <b>On Behalf
Of </b>Sebastian E. Ovide<br>
<b>Sent:</b> 19 juillet 2010 12:28<br>
<b>To:</b> PostGIS Users Discussion<br>
<b>Subject:</b> [postgis-users] WKTRaster : gdal2wktraster.py cannot read
AIG/Arc/Info Binary Grid</span><o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p>
<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'>Hi All,<br>
<br>
trying to create a SQL with gdal2wktraster.py. It works on PNG but it doesn't
on AIG files... <br>
<br>
Note: As Gdal works fine.<br>
<br>
C:\Program Files\PostgreSQL\8.4\bin>gdalinfo c:\tmp\raster<br>
Driver: AIG/Arc/Info Binary Grid<br>
Files: c:\tmp\raster<br>
c:\tmp\raster\dblbnd.adf<br>
c:\tmp\raster\hdr.adf<br>
c:\tmp\raster\metadata.xml<br>
c:\tmp\raster\prj.adf<br>
c:\tmp\raster\sta.adf<br>
c:\tmp\raster\vat.adf<br>
c:\tmp\raster\w001000.adf<br>
c:\tmp\raster\w001000x.adf<br>
c:\tmp\raster\w001001.adf<br>
c:\tmp\raster\w001001x.adf<br>
c:\tmp\raster\z001001.adf<br>
c:\tmp\raster\z001001x.adf<br>
c:\tmp\raster\z001002.adf<br>
c:\tmp\raster\z001002x.adf<br>
c:\tmp\raster\z001003.adf<br>
c:\tmp\raster\z001003x.adf<br>
c:\tmp\raster\z001004.adf<br>
c:\tmp\raster\z001004x.adf<br>
c:\tmp\raster\z001005.adf<br>
c:\tmp\raster\z001005x.adf<br>
c:\tmp\raster\z001006.adf<br>
c:\tmp\raster\z001006x.adf<br>
c:\tmp\raster\z001007.adf<br>
c:\tmp\raster\z001007x.adf<br>
c:\tmp\raster\z001008.adf<br>
c:\tmp\raster\z001008x.adf<br>
c:\tmp\raster\z001009.adf<br>
c:\tmp\raster\z001009x.adf<br>
c:\tmp\raster\z001010.adf<br>
c:\tmp\raster\z001010x.adf<br>
c:\tmp\raster\z001011.adf<br>
c:\tmp\raster\z001011x.adf<br>
c:\tmp\raster\z001012.adf<br>
c:\tmp\raster\z001012x.adf<br>
c:\tmp\raster\z001013.adf<br>
c:\tmp\raster\z001013x.adf<br>
c:\tmp\raster\z001014.adf<br>
c:\tmp\raster\z001014x.adf<br>
c:\tmp\raster\z001015.adf<br>
c:\tmp\raster\z001015x.adf<br>
Size is 107759, 168633<br>
Coordinate System is:<br>
PROJCS["unnamed",<br>
GEOGCS["Unknown datum based upon the Airy 1830
ellipsoid",<br>
DATUM["Not_specified_based_on_Airy_1830_ellipsoid",<br>
SPHEROID["Airy 1830",6377563.396,299.3249646,<br>
AUTHORITY["EPSG","7001"]],<br>
AUTHORITY["EPSG","6001"]],<br>
PRIMEM["Greenwich",0,<br>
AUTHORITY["EPSG","8901"]],<br>
UNIT["degree",0.01745329251994328,<br>
AUTHORITY["EPSG","9122"]],<br>
AUTHORITY["EPSG","4001"]],<br>
PROJECTION["Transverse_Mercator"],<br>
PARAMETER["latitude_of_origin",49],<br>
PARAMETER["central_meridian",-2],<br>
PARAMETER["scale_factor",0.9996012717],<br>
PARAMETER["false_easting",400000],<br>
PARAMETER["false_northing",-100000],<br>
UNIT["METERS",1]]<br>
Origin = (128110.000000000000000,813270.000000000000000)<br>
Pixel Size = (5.000000000000000,-5.000000000000000)<br>
Corner Coordinates:<br>
Upper Left ( 128110.000, 813270.000) (
6d29'37.32"W, 57d 7'47.53"N)<br>
Lower Left ( 128110.000, -29895.000) (
5d45'40.00"W, 49d34'10.24"N)<br>
Upper Right ( 666905.000, 813270.000) ( 2d24'41.72"E,
57d 7'58.04"N)<br>
Lower Right ( 666905.000, -29895.000) ( 1d41'32.29"E,
49d34'18.23"N)<br>
Center ( 397507.500, 391687.500)
( 2d 2'15.04"W, 53d25'18.19"N)<br>
Band 1 Block=256x4 Type=Byte, ColorInterp=Undefined<br>
Min=1.000 Max=4.000<br>
NoData Value=255<br clear=all>
<br>
<br>
C:\Program Files\PostgreSQL\8.4\bin>python gdal2wktraster.py -r
c:\tmp\raster -t sebastable -o c:\tmp\sebas.sql<br>
gdal2wktraster.py:644: DeprecationWarning: 'H' format requires 0 <= number
<= 65535<br>
hexstr = binascii.hexlify(struct.pack(fmt_little, data)).upper()<br>
gdal2wktraster.py:644: DeprecationWarning: integer argument expected, got float<br>
hexstr = binascii.hexlify(struct.pack(fmt_little, data)).upper()<br>
ERROR 2: Multiplication overflow : 107759 * 168633 * 1<br>
Traceback (most recent call last):<br>
File "gdal2wktraster.py", line 1013, in <module><br>
main()<br>
File "gdal2wktraster.py", line 976, in main<br>
wkblify_raster(opts, filename, i)<br>
File "gdal2wktraster.py", line 921, in wkblify_raster<br>
summary = wkblify_raster_level(options, ds,
options.overview_level, band_range, infile, i)<br>
File "gdal2wktraster.py", line 888, in wkblify_raster_level<br>
hexwkb += wkblify_band(options, band, level, xoff, yoff,
read_block_size, block_size, infile, b)<br>
File "gdal2wktraster.py", line 777, in wkblify_band<br>
target_block_size[0], target_block_size[1])<br>
File "C:\OSGeo4W\apps\gdal-16\pymod\osgeo\gdal.py", line 835,
in ReadAsArray<br>
buf_xsize, buf_ysize, buf_obj )<br>
File "C:\OSGeo4W\apps\gdal-16\pymod\osgeo\gdal_array.py", line
140, in BandReadAsArray<br>
ar = numpy.reshape(ar, [buf_ysize,buf_xsize])<br>
File
"C:\OSGeo4W\apps\Python25\lib\site-packages\numpy\core\fromnumeric.py",
line 116, in reshape<br>
return reshape(newshape, order=order)<br>
ValueError: total size of new array must be unchanged<br>
<br>
Any ideas ?<br>
-- <br>
Sebastian E. Ovide<br>
<br>
<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users"
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><o:p></o:p></p>
</div>
<p class=MsoNormal style='margin-bottom:12.0pt'><br>
<br clear=all>
<br>
-- <br>
Sebastian E. Ovide<br>
<br>
skype: sebastian.ovide<br>
<br>
+353 (0) 87 6340149<br>
<br>
<o:p></o:p></p>
</div>
</div>
</body>
</html>