From a61847cf793a55810f7f25bec89635fc7adabcef Mon Sep 17 00:00:00 2001 From: "kikitte.lee" Date: Fri, 3 Sep 2021 23:59:28 +0800 Subject: [PATCH] gdal2tiles: fix tile grid origin of openlayers with -p geodetic --tmscompatible --xyx as arguments --- gdal/swig/python/gdal-utils/osgeo_utils/gdal2tiles.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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]'