[gdal-dev] Notes on gdalbuildvrt.cpp

Nicu Tofan nicu.tofan at gmail.com
Thu Aug 21 10:32:34 PDT 2014


Assuming that VRTBuilder class inside gdalbuildvrt.cpp has been created to
be reusable, I have some comments/questions that, depending on your input,
may end up in pull requests.

   - *VRTBuilder::VRTBuilder, line 300*

Instead of assigning the pointer create a copy to be consistent with the
rest of the code. The memory is released twice, once at 1558 with

CPLFree( panBandList );

and once at 347 with

delete[] panBandList;

   - *VRTBuilder::pasDatasetProperties line 237*

At line 1092 AnalyseRaster is called with a pointer inside
pasDatasetProperties

if (AnalyseRaster( hDS, dsFileName, &pasDatasetProperties[i] ))

However the array may be re-allocated at line 416; if the reallocation is
not in place the psDatasetProperties pointer will be invalid.

Maybe passing an index instead of a pointer can solve the problem.

   - *line 513-520*

What would it take to support rotated, positive NS resolutions?

   - *line 543*

Assumes that there is at least one band; The code below does not make that
assumption and checks for that condition; GDALGetBlockSize() does not
handle a NULL pointer.

   -
*line 825, 920 *

Why the GDALProxyPoolDatasetH? Why not opening it like a regular data set?
When creating VRT files in C++ code this is the path to be taken?


Regards,

Nicu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140821/d11337de/attachment.html>


More information about the gdal-dev mailing list