I discovered that using MapProxy with pyproj you cannot successfully reproject to an SRS that uses units different from meter.
In my case I tried to reproject OSM data into EPSG:32019 which resulted in wrong tiles.
The issue is caused by a nasty behavior of the pyproj library which has already been mentioned in multiple pyproj issues, see here:
Software using pyproj should use the additional parameter “preserve_units=True” when instantiating a new class, e.g.
ny_state = pyproj.Proj(init="EPSG:2263", preserve_units=True)
Currently MapProxy does not set this parameter, by that pyproj assumes that each SRS is based on “units=m”.
I’ve successfully tried a quick fix in mapproxy’s proj.py (I’m not a Python developer at all, so there might be nicer solutions):
from pyproj import Proj, transform, set_datapath
# this new class overrides the constructor of the Proj class to set preserve_units to True by default
def __new__(self, projparams=None, preserve_units=True, **kwargs):
return super(myProj, self).__new__(self,projparams,preserve_units,**kwargs)
log_system.info('using pyproj for coordinate transformation')
return myProj, transform, set_datapath