Opened 6 years ago

Closed 5 years ago

#7133 closed defect (wontfix)

gdal2tiles.py calculates zoom range inconsistently

Reported by: csbubbles Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: 2.2.2
Severity: normal Keywords:
Cc: gbataille

Description

There are two implementation of ZoomForPixelSize() method for GlobalMercator and GlobalGeodetic:

https://github.com/OSGeo/gdal/blob/trunk/gdal/swig/python/scripts/gdal2tiles.py#L289

and

https://github.com/OSGeo/gdal/blob/trunk/gdal/swig/python/scripts/gdal2tiles.py#L395

They have slightly different logics (which might be incorrect):

if pixelSize > self.Resolution(i):
    if i != -1:
        return i-1
    else:
        return 0

and

if pixelSize > self.Resolution(i):
    if i != 0:
        return i-1
    else:
        return 0

Also, in the first snippet when i == 0 the method will return zoom level -1 which doesn't seem right.

Change History (3)

comment:1 by Even Rouault, 6 years ago

Cc: gbataille added

comment:2 by csbubbles, 6 years ago

Version: unspecified2.2.2

comment:3 by Even Rouault, 5 years ago

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.