Skip to content

Commit

Permalink
Edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixxm committed Sep 8, 2020
1 parent c239491 commit f3f805b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion django/contrib/gis/gdal/raster/source.py
Expand Up @@ -427,10 +427,11 @@ def warp(self, ds_input, resampling='NearestNeighbour', max_error=0.0):

def clone(self):
"""Return a clone of this GDALRaster."""
clone_name = os.path.join(VSI_FILESYSTEM_BASE_PATH, str(uuid.uuid4()))
return GDALRaster(
capi.copy_ds(
self.driver._ptr,
force_bytes(self.name),
force_bytes(clone_name),
self._ptr,
c_int(),
c_char_p(),
Expand Down
2 changes: 1 addition & 1 deletion tests/gis_tests/gdal_tests/test_raster.py
Expand Up @@ -488,7 +488,7 @@ def test_raster_clone(self):
}],
})
clone = source.clone()
self.assertEqual(clone.name, source.name)
self.assertNotEqual(clone.name, source.name)
self.assertEqual(clone._write, source._write)
self.assertEqual(clone.srs.srid, source.srs.srid)
self.assertEqual(clone.width, source.width)
Expand Down

0 comments on commit f3f805b

Please sign in to comment.