Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdal2tiles.py: Added support for XYZ tiles (OSM Slippy Map) #2359

Merged
merged 3 commits into from
Mar 30, 2020

Conversation

quipo
Copy link
Contributor

@quipo quipo commented Mar 28, 2020

Added new --xyz option to generate tiles in the OSM Slippy Map standard where the Y coordinate is flipped.

Also fixed incorrect indentation in a few places.

Fixes #2098

Added new --xyz option to generate tiles in the OSM Slippy Map standard
( https://wiki.openstreetmap.org/wiki/Slippy_Map ) where the Y coordinate
is flipped.

Fixed incorrect indentation in a few places.
@rouault
Copy link
Member

rouault commented Mar 28, 2020

Thanks, we would also need documentation of the new option in gdal/doc/source/programs/gdal2tiles.rst with a .. versionadded:: 3.1 and a test in autotest/pyscripts/test_gdal2tiles.py

@quipo
Copy link
Contributor Author

quipo commented Mar 29, 2020

done

@quipo
Copy link
Contributor Author

quipo commented Mar 30, 2020

not sure why https://travis-ci.com/github/OSGeo/gdal/jobs/308288415 is failing, it doesn't seem related to this change?

@rouault
Copy link
Member

rouault commented Mar 30, 2020

it doesn't seem related to this change?

yes, flake. I've restarted the job

@rouault rouault merged commit b4a06bf into OSGeo:master Mar 30, 2020
quipo added a commit to quipo/gdal that referenced this pull request Mar 30, 2020
…input

This PR fixes two issues:

* XYZ tiles were not generated for all zoom levels when a zoom range is specified
  (e.g. `--zoom=10-12`). I forgot to include this fix in my previous PR (PR OSGeo#2359).
  Only tiles for the highest zoom level (12) were generated.

* When an input .tif image is provided without specifying a `--s_srs` cli parameter,
  and the image itself is not georeferenced (i.e. it's missing the embedded SRS metadata),
  the input validation fails, but the program doesn't exit correctly, but hangs instead,
  as there's still an open pipe (instantiated within multiprocessing.Pool).
  Given `worker_tile_details()` is a synchronous call that needs to be executed once
  on the input file, before calling `create_base_tile()`, and cannot be parallelised,
  there is no need for it to be invoked from within the Pool.
  This way, if the input validation within `worker_tile_details()` fails, there is
  no open pipe and the parent process can terminate correctly, reporting the failure
  with sys.exit(2).

I added test cases for both issues.
rouault pushed a commit that referenced this pull request Mar 31, 2020
… input (#2362)

This PR fixes two issues:

* XYZ tiles were not generated for all zoom levels when a zoom range is specified
  (e.g. `--zoom=10-12`). I forgot to include this fix in my previous PR (PR #2359).
  Only tiles for the highest zoom level (12) were generated.

* When an input .tif image is provided without specifying a `--s_srs` cli parameter,
  and the image itself is not georeferenced (i.e. it's missing the embedded SRS metadata),
  the input validation fails, but the program doesn't exit correctly, but hangs instead,
  as there's still an open pipe (instantiated within multiprocessing.Pool).
  Given `worker_tile_details()` is a synchronous call that needs to be executed once
  on the input file, before calling `create_base_tile()`, and cannot be parallelised,
  there is no need for it to be invoked from within the Pool.
  This way, if the input validation within `worker_tile_details()` fails, there is
  no open pipe and the parent process can terminate correctly, reporting the failure
  with sys.exit(2).

I added test cases for both issues.
@rajadain
Copy link

Hi,

I just wanted to thank you both for getting this in. I wrote about it in a short blog post: https://www.azavea.com/blog/2020/06/18/this-month-we-learned-may-2020/

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gdal2tiles should allow for XYZ slippy map tiles and not just TMS
3 participants