diff --git a/gdal/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py b/gdal/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py index 8b81477a6dfe..820f237fae9e 100644 --- a/gdal/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py +++ b/gdal/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py @@ -2872,7 +2872,10 @@ def generate_openlayers(self) -> str: args['resolutions'] = '[' + ','.join('%.18g' % res for res in resolutions) + ']' if self.options.xyz: - args['origin'] = '[-180,90]' + if self.options.tmscompatible: + args['origin'] = '[-180,90]' + else: + args['origin'] = '[-180,270]' args['y_formula'] = 'tileCoord[2]' else: args['origin'] = '[-180,-90]'