Closed vaclavblazek closed 6 years ago
GDALCreateOverviewDataset was documented as / CPL_DLL exported, but only for gdalwarp / in a header called gdal_priv.h, and as gdalwarp is now part of libgdal the export was no longer needed. I'd suggest you go to the road of using the GDALWarp() utility function indeed
Another solution is to import gcore/gdaloverviewdataset.cpp in your own code (making sure to rename the class to avoid symbol name clashes)
I grabbed and integrated the code from gdaloverviewdata.cpp
in our code base. Actually, I had been thinking about this option already when I posted this issue.
GDALWarp()
is way too heavyweight when you have everything at hand and tailored to use low-level API.
We're using warping in GDAL (via
GDALWarpOperation
) extensively in our vts-mapproxy server. Since this operation doesn't natively support overviews which are crucial for our server we had to write code similar togdalwarp
utility to choose and use proper overview. Sometimes, we also have to force coarser overview when memory requirements would be too high (this happens when warping near date line or poles where GDAL has problems with wrapped dataset).It was kinda easy in gdal-2.1 because function
GDALCreateOverviewDataset
was exported fromgdal.so
. With the advent of new LTS Ubuntu (Bionic Beaver, 18.04) thegdal-2.2
will become the default gdal version. Unfortunately, this version doesn't exportGDALCreateOverviewDataset
function. The function was un-exported from the dynamic library in this particular commit gdal_priv.h:1576.I've been looking around and the function is indirectly available through
GDALWarp
utility function. that encapsulates whole warp functionality. So far so good. However, this function expects its options from argv-style cmdline options, which means that our program whould have to serialize options into string only to letGDALWarp
to decode them instead of simply filling them into theGDALWarpOptions
struct.There's a possibility to pass
OVERVIEW_LEVEL
option to theGDALOpenEx
call. However, at the time of warp operation we have got an already open dataset. Re-opening of the dataset counts on the knowledge of the original dataset path and opens a full-fledged dataset.Would it be too much to ask you to make
GDALCreateOverviewDataset
function available in the installed library again? What is the intended programatic use of overview functionality?