I have a few thousand TIF tiles and need to extract polygons of the actual data coverage from inside these TIFs (see below for image showing what the coverage looks like). The resulting geometry will be loaded into a Postgres table.
Due to the number of TIFs, and the fact that the data-set will be regularly updated, I need the process to be as efficient and automated as possible.
I have tried gdal_polygonize.py, but this gives me a result like this:
I would then have to 'dissolve' these polygons, or run ST_Union with PostGIS to get the result I want, which looks like this:
Dissolving is very slow, and feels unnecessary when there must surely be a way to skip the multiple polygon result of gdal_polygonize.
Does anyone have any ideas how I could do it in one step, or just make the process faster/more efficient?