<p dir="ltr">zlzhao1104,</p>
<p dir="ltr">Two things:<br>
You need to specify the output data format using the -of option.<br>
PostGIS raster driver doesn't support writing yet. It's being implemented now.</p>
<p dir="ltr">It is more efficient to do that directly using an SQL command. Refer to PostGIS docs.</p>
<p dir="ltr">--<br>
Best regards,<br>
Chaitanya Kumar CH</p>
<div class="gmail_quote">On 29-May-2014 6:42 am, "zlzhao1104" <<a href="mailto:zlzhao1104@gmail.com">zlzhao1104@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi I'm a new GDAL/PostGIS user.  This question might be simple to you:<br>
<br>
I need to use gdal_translate to clip a raster, which is already stored in<br>
PostGIS.  I could do it by using "PG" to link to my PostGIS database and I<br>
could store the result as a tiff file on my disk:<br>
<br>
gdal_translate -projwin -120.01969132 35.8820930603 -119.47058351<br>
35.1172643251 "PG: dbname=geodb host=localhost user=postgres password=xxxxxx<br>
port=5432 mode=2 schema=public table=srtm_ca" test.tiff<br>
<br>
I'm wondering if there is a way to store the result raster directly to my<br>
PostGIS database as a table.  I tried to replace "test.tiff" above to<br>
"PG:......" but GDAL still generated a raster on my disk named "PG:......".<br>
<br>
Thanks in advance for any ideas and sorry to bother others.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/Store-GDAL-Result-Raster-in-PostGIS-Directly-tp5143022.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/Store-GDAL-Result-Raster-in-PostGIS-Directly-tp5143022.html</a><br>

Sent from the GDAL - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>