diff --git a/source/notebooks/L5/clipping-raster.ipynb b/source/notebooks/L5/clipping-raster.ipynb index 3ee4d56..8c97341 100644 --- a/source/notebooks/L5/clipping-raster.ipynb +++ b/source/notebooks/L5/clipping-raster.ipynb @@ -227,33 +227,6 @@ "out_img, out_transform = mask(dataset=data, shapes=coords, crop=True)" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "- Next, we need to modify the metadata. Let's start by copying the metadata from the original data file." - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'driver': 'GTiff', 'dtype': 'uint8', 'nodata': None, 'width': 8877, 'height': 8106, 'count': 7, 'crs': CRS({'init': 'epsg:32634'}), 'transform': Affine(28.5, 0.0, 600466.5,\n", - " 0.0, -28.5, 6784966.5)}\n" - ] - } - ], - "source": [ - "# Copy the metadata\n", - "out_meta = data.meta.copy()\n", - "print(out_meta)" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -293,6 +266,7 @@ "metadata": {}, "outputs": [], "source": [ + "out_meta = data.profile\n", "out_meta.update({\"driver\": \"GTiff\",\n", " \"height\": out_img.shape[1],\n", " \"width\": out_img.shape[2],\n",