Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to vrt and nodata #249

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'dsnparse',
'fiona>=1.8.4,<2.*',
'folium>=0.6.0',
'ipyleaflet!=0.8.2',
'ipyleaflet==0.10.2',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'ipyleaflet==0.10.2',
'ipyleaflet!=0.10.3',

'pyproj<2; python_version<="3.4"',
'pyproj; python_version>="3.5"',
'shapely>=1.6.3,<2.*',
Expand Down
4 changes: 2 additions & 2 deletions telluric/georaster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion telluric/vrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down