zlzhao1104, Two things: You need to specify the output data format using the -of option. PostGIS raster driver doesn't support writing yet. It's being implemented now.
It is more efficient to do that directly using an SQL command. Refer to PostGIS docs. -- Best regards, Chaitanya Kumar CH On 29-May-2014 6:42 am, "zlzhao1104" <[email protected]> wrote: > Hi I'm a new GDAL/PostGIS user. This question might be simple to you: > > I need to use gdal_translate to clip a raster, which is already stored in > PostGIS. I could do it by using "PG" to link to my PostGIS database and I > could store the result as a tiff file on my disk: > > gdal_translate -projwin -120.01969132 35.8820930603 -119.47058351 > 35.1172643251 "PG: dbname=geodb host=localhost user=postgres > password=xxxxxx > port=5432 mode=2 schema=public table=srtm_ca" test.tiff > > I'm wondering if there is a way to store the result raster directly to my > PostGIS database as a table. I tried to replace "test.tiff" above to > "PG:......" but GDAL still generated a raster on my disk named "PG:......". > > Thanks in advance for any ideas and sorry to bother others. > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Store-GDAL-Result-Raster-in-PostGIS-Directly-tp5143022.html > Sent from the GDAL - Dev mailing list archive at Nabble.com. > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev >
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
