I am trying to use the orthophotos as my background in project. I have used gdal2tiles to prepare the tiles for xyz. Then in the next step, I have uploaded the folder in our server. Then I make a new connection to xyz tiles with the following example link---> https://xxxxx.xxxx.solutions/planning_storage/xxxxx/{z}/{x}/{y}.png

The xyz is made but I can not read it in my QGIS. I am using QGIS 3.16 in Windows 10.

  • Can you give us the gdal2tiles command you used? You can anonymize your path/directory if confidential
    – ThomasG77
    Mar 22 at 15:31

By default, gdal2tiles generate xyz tiles starting from south as quoted in the doc

In the default mode (TMS), tiles at y=0 are the southern-most tiles, whereas in XYZ mode (used by OGC WMTS too), tiles at y=0 are the northern-most tiles.

You need to use gdal2tiles.py with --xyz option available with GDAL 3.1 and later. To avoid downloading/installing new GDAL version due to this, you can also get recent version of gdal2tiles at https://raw.githubusercontent.com/OSGeo/gdal/master/gdal/swig/python/scripts/gdal2tiles.py

Then use

gdal2tiles.py --xyz --zoom=2-10 input.tif output_folder

or if you retrieved latest gdal2tiles.py file version

python gdal2tiles.py --xyz --zoom=2-10 input.tif output_folder

I have a full demo at https://gist.github.com/ThomasG77/e8b9281d07334f3b77eb4b45c42073d8 using French SCAN1000 tiles

  • thank you so much for the feedback. I try it out! My try with gdal2tiles were: gdal2tiles --zoom=10-14 .....vrt folder when I am writing gdal2tiles.py, python canot be called!
    – Hermetik
    Mar 23 at 6:53
  • Thank you so much! I am trying it out
    – Hermetik
    Mar 23 at 7:22
  • Not sure why you mentioned gdal2tiles where it should gdal2tiles.py. Also, if you have issues with Python just calling gdal2tiles.py, you can do python exact/path/to/gdal2tiles.py (a way to bypass configuration due to PATH)
    – ThomasG77
    Mar 23 at 9:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.