<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
On 2/12/2020 12:28 PM, Regina Obe wrote:<br>
<blockquote type="cite"
cite="mid:001001d5e1e3$0b71c990$22555cb0$@pcorp.us"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">SELECT
lo_from_bytea(0, -- <1><o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
ST_AsGDALRaster(ST_Band(rast,1), <o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> 'USGSDEM',<o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
ARRAY[<o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
'PRODUCER=' || quote_literal('postgis_in_action'),<o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
'INTERNALNAME=' || quote_literal(rast_name)]<o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">
) -- <2> <o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> )
AS oid <o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> FROM
ch07.bag_o_rasters <o:p></o:p></span><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> WHERE
rast_name = 'Raster 1 band heatmap'; -- <2></span></blockquote>
Thanks, Regina. I tried the new code above and I still get the same
error. <br>
<p>Here is the simple SELECT statement:<br>
</p>
<p>postgis_in_action=# SELECT rast_name FROM ch07.bag_o_rasters
WHERE rast_name = 'Raster 1 band heatmap';<br>
rast_name<br>
-----------------------<br>
Raster 1 band heatmap<br>
(1 row)</p>
<p>I made different attempts and replaced 'USGSDEM' with 'JPEG' and
'GTiff'. I tried with the old and new code. It worked either way
with the JPEG and GTiff types. It seems like 'USGSDEM' is the
problem here. I don't know why. I don't know how to diagnose the
problem pertaining to one raster type. I suppose it's not a
problem until I'll need to actually produce output as USGSDEM. :)</p>
<p>best regards,</p>
<p>John <br>
</p>
<pre class="moz-signature" cols="72">--
Enlightenment is ego's ultimate disappointment.
-Chogyam Trungpa</pre>
</body>
</html>