From dc33fa78691c21731714bacd7ecd3573c442a7d4 Mon Sep 17 00:00:00 2001 From: Sean Gillies Date: Fri, 25 Mar 2022 09:49:26 -0600 Subject: [PATCH] Let output dataset inherit CRS from the source There's no need for pycrs. The output dataset can get its CRS directly from the source dataset. There's no need to change it. --- source/notebooks/L5/clipping-raster.ipynb | 29 +---------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/source/notebooks/L5/clipping-raster.ipynb b/source/notebooks/L5/clipping-raster.ipynb index 3ee4d56..9266f44 100644 --- a/source/notebooks/L5/clipping-raster.ipynb +++ b/source/notebooks/L5/clipping-raster.ipynb @@ -258,33 +258,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "- Next we need to parse the EPSG value from the CRS so that we can create a `Proj4` -string using `PyCRS` library (to ensure that the projection information is saved correctly)." - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "32634\n" - ] - } - ], - "source": [ - "# Parse EPSG code\n", - "epsg_code = int(data.crs.data['init'][5:])\n", - "print(epsg_code)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "- Now we need to update the metadata with new dimensions, transform (affine) and CRS (as Proj4 text):" + "- Now we need to update the metadata with new dimensions, transform (affine):" ] }, { @@ -297,7 +271,6 @@ " \"height\": out_img.shape[1],\n", " \"width\": out_img.shape[2],\n", " \"transform\": out_transform,\n", - " \"crs\": pycrs.parser.from_epsg_code(epsg_code).to_proj4()}\n", " )" ] },