Re: [gdal-dev] gdal_translate clip PostGIS raster

2021-05-13 Thread Andreas Oxenstierna
I had missed something essential and simple ... mode=2 must be added to the end of the PG connection string to tell GDAL to treat a PostGIS raster table as one unit. The default mode=1 treats each tile as a subdataset Sorry for the noise Best regards Andreas Oxenstierna T-Kartor Geospatial AB O

Re: [gdal-dev] gdal_translate clip PostGIS raster

2021-05-11 Thread Andreas Oxenstierna
Tested with: 1 … table=rastertable WHERE=rid>0" dest.tif Returns: WHERE=rid>0 has no raster bands 2 … table=rastertable WHERE=rid=1" dest.tif Returns: a valid but empty tif file 3 … table=mailto:andreas.oxenstie...@t-kartor.com> www.t-kartor.com On 11 Ma

Re: [gdal-dev] gdal_translate clip PostGIS raster

2021-05-10 Thread Andreas Oxenstierna
Thanks but still stumbling (using 2.3.2) gdalwarp -cutline "PG:dbname=gisdb" -csql 'select * from polytest where id=1' -crop_to_cutline -of GTiff -srcnodata - -dstnodata - "PG: schema=a table=rastertable" dest.tif returns: ERROR 1: Input file has no raster bands. gdalinfo reports that

Re: [gdal-dev] gdal_translate clip PostGIS raster

2021-05-10 Thread Even Rouault
Try with gdalwarp and the -cutline family of arguments Le 10/05/2021 à 19:23, Andreas Oxenstierna a écrit : Hi list Is it possible to clip a PostGIS raster with a PostGIS vector poly using gdal_translate? I cannot find a working syntax to define the clipping table in the WHERE clause. Eg. t

[gdal-dev] gdal_translate clip PostGIS raster

2021-05-10 Thread Andreas Oxenstierna
Hi list Is it possible to clip a PostGIS raster with a PostGIS vector poly using gdal_translate? I cannot find a working syntax to define the clipping table in the WHERE clause. Eg. this returns "Error browsing database for PostGIS Raster properties : ERROR: syntax error at or near "FROM" gda