I am trying to calculate summary statistics for a raster file. I am encountering a problem when loading my raster into Python.
When I load the raster and I plot it, it is flipped 180 degrees. This means it is upside down.
When the raster is loaded into QGIS or ArcMap is properly displayed. How can I proceed?
import os import sys import glob import rasterio import gdal from rasterio.plot import show from rasterio.transform import Affine import networkx as nx import geopandas as gpd import osmnx as ox import matplotlib.pyplot as plt from rasterstats import zonal_stats os.getcwd() path = "path_to_data" gis = "path_to_vector" raster = "path_to_raster**" raster_yearly_path = [f for f in glob.glob(raster + '*ppty.tif', recursive=True)] raster_yearly =  for raster in raster_yearly_path: local = rasterio.open(raster) raster_yearly.append(local) ax = show(raster_yearly)
I cannot move forward since the basins will not be in the proper extent. Please check the image below. I need to process more than 500 rasters. This is why I am using Python.