I am trying to reproject on python 2.7 a Landsat8 image from UTM 19N to UTM 18S using rasterio, reading the docs I found and example on the documentation and just change the input, output file and dst_CRS:
import numpy as np
import rasterio
from rasterio.warp import calculate_default_transform, reproject, RESAMPLING
INPUT_raster_1 = "D:\Minam\LC08_L1TP_005063_20170528_20170528_01_RT\LC08_L1TP_005063_20170528_20170528_01_RT_B5.tif"
dst_crs ='EPSG:32718' #output reprojection
with rasterio.open("D:\Minam\LC08_L1TP_005063_20170528_20170528_01_RT\LC08_L1TP_005063_20170528_20170528_01_RT_B5.tif") as src:
affine, width, height = calculate_default_transform(
src.crs, dst_crs, src.width, src.height, *src.bounds)
kwargs = src.meta.copy()
kwargs.update({
'crs': dst_crs,
'transform': affine,
'affine': affine,
'width': width,
'height': height
})
with rasterio.open('D:\Minam\wgs84.tif', 'w', **kwargs) as dst:
for i in range(1, src.count + 1):
reproject(
source=rasterio.band(src, i),
destination=rasterio.band(dst, i),
src_transform=src.affine,
src_crs=src.crs,
dst_transform=affine,
dst_crs=dst_crs,
resampling=RESAMPLING.nearest)
The first problem is that there is no module RESAMPLING on library, then this when reading the dst_crs:
rasterio.errors.CRSError: Invalid CRS: 'EPSG:32718'
But that is the epsg to utm 18S. How do I fix it?