Skip to content
Permalink
Browse files

gdal2tiles: prevent accidental copy of full GeoTIFF into temporary .v…

…rt file

This line is used to write the temporary .vrt for the reprojected input.
However, if the input was already in the correct projection,
`self.warped_input_dataset` was the input GeoTIFF dataset directly due
to the previous line, so `GetDriver` returned the GeoTIFF driver rather
than VRT. It then created a .vrt file that was actually in GeoTIFF
format and copied the entire input into it.
  • Loading branch information...
kevinmehall authored and rouault committed Mar 12, 2019
1 parent f8917ec commit fae3a65f16af509cf9e0dd16cd16858d8e49eb25
Showing with 2 additions and 2 deletions.
  1. +2 −2 gdal/swig/python/scripts/gdal2tiles.py
@@ -1509,8 +1509,8 @@ def open_input(self):
if not self.warped_input_dataset:
self.warped_input_dataset = input_dataset

self.warped_input_dataset.GetDriver().CreateCopy(self.tmp_vrt_filename,
self.warped_input_dataset)
gdal.GetDriverByName('VRT').CreateCopy(self.tmp_vrt_filename,
self.warped_input_dataset)

# Get alpha band (either directly or from NODATA value)
self.alphaband = self.warped_input_dataset.GetRasterBand(1).GetMaskBand()

0 comments on commit fae3a65

Please sign in to comment.
You can’t perform that action at this time.