gdal open 28in raster 29

Solutions on MaxInterview for gdal open 28in raster 29 by the best coders in the world

showing results for - "gdal open 28in raster 29"
Sofiane
02 Sep 2016
1def write_tile(self, tile, image):
2        if tile.z != self._zoom:
3            self._init_zoom_layer(tile.z)
4
5        data = QByteArray()
6        buff = QBuffer(data)
7        image.save(buff, 'PNG')
8
9        mmap_name = '/vsimem/' + uuid4().hex
10        gdal.FileFromMemBuffer(mmap_name, data.data())
11        gdal_dataset = gdal.Open(mmap_name)
12        data = gdal_dataset.ReadRaster(0, 0, self.tile_width, self.tile_height)
13        gdal_dataset = None
14        gdal.Unlink(mmap_name)
15
16        xoff = (tile.x - self._first_tile.x) * self.tile_width
17        yoff = (tile.y - self._first_tile.y) * self.tile_height
18        self._zoom_ds.WriteRaster(xoff, yoff, self.tile_width, self.tile_height, data)