Thanks Even, worked great! Issue has been submitted.

Scott

On 9/17/25 12:49, Even Rouault wrote:
Hi Scott,

please file a GH issue about that. The PGRaster indeed kicks in here. gdalwarp doesn't have that issue as it only uses vector drivers for the cutline whereas gdal raster clip allows both raster & vector drivers. In the mean time you should be able to work around the issue by adding "-- config GDAL_SKIP=PostGISRaster"

Even

Le 17/09/2025 à 20:06, Scott via gdal-dev a écrit :
I'm trying to clip a raster with a vector data source:

gdal raster clip \
   --input=raster.tif \
   --like="PG:dbname=mydb" --like-sql="select geom from vector_table" \
   --output=clipped.tif --overwrite --progress

It gives me the error:
ERROR 1: clip: Cannot get extent from clip dataset

If I use a .gpkg in --like, it works fine.

gdalwarp works fine with the same raster and same PG vector table:

gdalwarp -cutline PG:dbname=mydb -csql "select geom from vector_table" raster.tif clipped.tif

If I modify the connection string to:
--like="PG:mydb table=vector_table"

It seems to think it's a raster table:

Creating tile for bbox -12980000,3850000,-12970000,3860000
Warning 1: Cannot find information about public.vector_table table in raster_columns view. The raster table load would take a lot of time. Please, execute AddRasterConstraints PostGIS function to register this table as raster table in raster_columns view. This will save a lot of time. ERROR 1: Error browsing database for PostGIS Raster properties : ERROR: column "rast" does not exist LINE 1: ...m) as ymax, scale_x, scale_y from (select st_srid("rast") sr...



Am I missing a key parameter here?

Debian 12, GDAL 3.11.3

Thanks!
Scott
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev


_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to