I am trying to plot the Pumps.shp data on top of the OSMap.tif file from this website on the same figure.
I tried using rasterio.plot() and geopandas.plot() methods, with matplotlibs subplots.
The problem is that the plots don't match, the raster file gets plotted in the range(0,1000) for both axis and the shp gets plotted in the actual coordinates range(around 50000 on the x axis and around).
The crs are equal in both objects and the coordinates are in the same range. Why is this? What am I doing wrong?
Here is my code
import rasterio as rast
import rasterio.plot as rsplot
import geopandas as gpd
src=rast.open("OSMap.tif")
data=gpd.read_file("Pumps.shp")
fig,ax=plt.subplots()
rsplot.show(src,ax=ax)
data.plot(ax=ax)
plt.show()
This is the result of calling src.bounds:
BoundingBox(left=528765.0, bottom=180466.0, right=529934.0, top=181519.0)
This is the result of data.bounds
(528765.0, 180466.0, 529934.0, 181519.0)
This is crs of both:
CRS({'lon_0': -2, 'y_0': -100000, 'k': 0.9996012717, 'lat_0': 49, 'proj': 'tmerc', 'wktext': True, 'datum': 'OSGB36', 'no_defs': True, 'x_0': 400000, 'units': 'm'})