diff --git a/gdal2mbtiles/constants.py b/gdal2mbtiles/constants.py index e460e4a..b799dc4 100644 --- a/gdal2mbtiles/constants.py +++ b/gdal2mbtiles/constants.py @@ -27,9 +27,10 @@ # EPSG constants EPSG_WEB_MERCATOR = 3857 -# ESRI constants with their EPSG code equivalent +# ESRI / QGIS constants with their EPSG code equivalent ESRI_102113_PROJ = 'WGS_1984_Web_Mercator' # EPSG:3785 ESRI_102100_PROJ = 'WGS_1984_Web_Mercator_Auxiliary_Sphere' # EPSG:3857 +QGIS_3857_PROJ = 'WGS 84 / Pseudo-Mercator' # EPSG:3857 # Output constants TILE_SIDE = 256 # in pixels diff --git a/gdal2mbtiles/gdal.py b/gdal2mbtiles/gdal.py index 4b85741..0eaf77f 100644 --- a/gdal2mbtiles/gdal.py +++ b/gdal2mbtiles/gdal.py @@ -51,7 +51,7 @@ from .constants import (EPSG_WEB_MERCATOR, ESRI_102113_PROJ, ESRI_102100_PROJ, - GDALTRANSLATE, GDALWARP, TILE_SIDE) + GDALTRANSLATE, GDALWARP, QGIS_3857_PROJ, TILE_SIDE) from .exceptions import (GdalError, CalledGdalError, UnalignedInputError, UnknownResamplingMethodError) from .gd_types import Extents, GdalFormat, XY @@ -819,7 +819,7 @@ def GetEPSGCode(self): # 'mercator_auxiliary_sphere' projection name. projcs_name = self.GetAttrValue(str('PROJCS')) # Returning equivalent EPSG code - if projcs_name == ESRI_102100_PROJ: + if projcs_name in (ESRI_102100_PROJ, QGIS_3857_PROJ): return 3857 elif projcs_name == ESRI_102113_PROJ: return 3785