diff --git a/setup.py b/setup.py index 4f7db368..07d11f8e 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ 'dsnparse', 'fiona>=1.8.4,<2.*', 'folium>=0.6.0', - 'ipyleaflet!=0.8.2', + 'ipyleaflet==0.10.2', 'pyproj<2; python_version<="3.4"', 'pyproj; python_version>="3.5"', 'shapely>=1.6.3,<2.*', diff --git a/telluric/georaster.py b/telluric/georaster.py index ba3901a4..22f2872a 100644 --- a/telluric/georaster.py +++ b/telluric/georaster.py @@ -899,7 +899,6 @@ def save(self, filename, tags=None, **kwargs): 'driver': driver, 'width': size[2], 'height': size[1], 'count': size[0], 'dtype': dtype_map[self.dtype.type], 'nodata': nodata_value, - 'masked': True, 'blockxsize': min(blockxsize, size[2]), 'blockysize': min(blockysize, size[1]), 'tiled': tiled, @@ -931,7 +930,7 @@ def save(self, filename, tags=None, **kwargs): # write data: for band in range(self.shape[0]): - img = self.image.data + img = self.image.filled(nodata_value) r.write_band(1 + band, img[band, :, :]) # write mask: @@ -1233,6 +1232,7 @@ def copy(self, mutable=False): def copy_with(self, mutable=False, **kwargs): """Get a copy of this GeoRaster with some attributes changed. NOTE: image is shallow-copied!""" init_args = {'affine': self.affine, 'crs': self.crs, 'band_names': self.band_names, 'nodata': self.nodata_value} + init_args.update(kwargs) # The image is a special case because we don't want to make a copy of a possibly big array diff --git a/telluric/vrt.py b/telluric/vrt.py index 1bc698a2..1ebdc9bf 100644 --- a/telluric/vrt.py +++ b/telluric/vrt.py @@ -253,7 +253,7 @@ def max_resolution(): else: file_name = os.path.join(os.getcwd(), raster.source_file) - vrt.add_band_simplesource(band_element, band_idx, raster.dtype, relative_to_vrt, file_name, + vrt.add_band_simplesource(band_element, i+1, raster.dtype, relative_to_vrt, file_name, raster.width, raster.height, raster.block_shape(i)[1], raster.block_shape(i)[0], src_window, dst_window)