[gdal-dev] Create big COG file (C++)

Even Rouault even.rouault at spatialys.com
Mon Sep 14 10:48:42 PDT 2020


Javier,

> I want to create a big (I mean bigger than my RAM size) COG file in C++
> with GDAL 3.1.
> COG driver does not have the "Create()" method, but "CreateCopy()". I am
> not sure how I have to do it. Should I Create() first the dataset with the
> MEM driver, write on it, and then call the CreateCopy with the COG driver?
> (by the way, before closing the MEM dataset? Is then everything copied?)

You shouldn't use the MEM driver for datasets that can't fit entirely into RAM.
MEM datasets are temporary. Once you've closed the dataset handle, it is destroyed. So if 
you use a MEM dataset, you must pass to CreateCopy() the handle you got when calling 
Create() for the MEM dataset

> Or should I use a normal GTiff dataset, and then CreateCopy() with
> the COG driver?

Yes

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200914/fb4c9ef0/attachment.html>


More information about the gdal-dev mailing list