I have a set of polygons in PostGIS DB.
I also have a set of GeoTIFF files.
I would like to know what is the best way (using GDAL) to get one polygon from DB (based on SQL Query) and then take all TIFF files that intersect with that polygon, clip those that need to be cut and merge result into one TIFF file.
I found method here: Merging GDAL tiles and crop via bounding box?
So I have that VRT file already but I don't know how to get that KML file or maybe I can simply replace is somehow with SQL Query to PostGIS to take that clipper?