Skip to content

Commit

Permalink
Disable transformation if source CRS equals to destination
Browse files Browse the repository at this point in the history
  • Loading branch information
drnextgis committed Jun 26, 2020
1 parent 19b6e4f commit 22375e5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
'packaging',
'pycodestyle',
'pytest>=4',
'pytest-cov',
'pytest-cov==2.8.1',
'sphinx',
'ipython',
'nbsphinx',
Expand Down
2 changes: 1 addition & 1 deletion telluric/util/local_tile_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def _get_raster_png_tile(self, raster, x, y, z):

@gen.coroutine
def _get_collection_png_tile(self, fc, x, y, z):
rasters = yield gen.multi([self._get_raster_png_tile(f.raster(), x, y, z) for f in fc])
rasters = yield gen.multi([self._get_raster_png_tile(f.raster(), x, y, z) for f in fc]) # type: ignore
if len(rasters) < 1:
return None
tile = yield self._merge_rasters(rasters, z)
Expand Down
3 changes: 2 additions & 1 deletion telluric/util/projections.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def transform(shape, source_crs, destination_crs=None, src_affine=None, dst_affi
if src_affine is not None:
shape = ops.transform(lambda r, q: ~src_affine * (r, q), shape)

shape = generate_transform(source_crs, destination_crs)(shape)
if source_crs != destination_crs:
shape = generate_transform(source_crs, destination_crs)(shape)

if dst_affine is not None:
shape = ops.transform(lambda r, q: dst_affine * (r, q), shape)
Expand Down

0 comments on commit 22375e5

Please sign in to comment.