Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDALCreateOverviewDataset missing since gdal-2.2 #413

Closed
vaclavblazek opened this issue Apr 13, 2018 · 2 comments
Closed

GDALCreateOverviewDataset missing since gdal-2.2 #413

vaclavblazek opened this issue Apr 13, 2018 · 2 comments

Comments

@vaclavblazek
Copy link

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 to gdalwarp 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 from gdal.so. With the advent of new LTS Ubuntu (Bionic Beaver, 18.04) the gdal-2.2 will become the default gdal version. Unfortunately, this version doesn't export GDALCreateOverviewDataset 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 let GDALWarp to decode them instead of simply filling them into the GDALWarpOptions struct.

There's a possibility to pass OVERVIEW_LEVEL option to the GDALOpenEx 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?

@rouault
Copy link
Member

rouault commented Apr 13, 2018

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)

@vaclavblazek
Copy link
Author

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.

@rouault rouault closed this as completed Apr 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants