I'm curious if there is a way to reproject a raster to have 0 as the center longitude rather than 180. I am trying to convert this raster. I've been able to do this in gdal, but I'd like the solution to be in rasterio as it's more pythonic and I also don't think you're supposed to mix the two within one script. I've tried a couple different ways, but I believe the following to be the closest:
import rasterio
from rasterio.warp import reproject
def change_center_long_from_180_to_0(input_fp, output_fp):
with rasterio.open(input_fp) as src:
kwargs = src.meta.copy()
kwargs.update({'CENTER_LONG': 0, 'SOURCE_EXTRA':1000})
with rasterio.open(output_fp, '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.transform,
src_crs=src.crs)
return
However, this isn't doing anything to the raster.