source: src/common/bin/gdal2tiles-tilesize.patch@ da2be70

debian/bullseye
Last change on this file since da2be70 was b72d9c4, checked in by Joachim Langenbach <joachim.langenbach@…>, 7 years ago

Patched gdal2tiles.py to support tile-size option. Change is merged upstream, but until it mades its way into distributions, we ship our own gdal2tiles.py

  • Property mode set to 100644
File size: 1.6 KB
  • gdal2tiles.py

    old new def optparse_init():  
    11921192                 dest="nb_processes",
    11931193                 type='int',
    11941194                 help="Number of processes to use for tiling")
     1195    p.add_option("--tilesize", dest="tilesize", default=256,
     1196                 type='int',
     1197                 help="Tile size in pixel of a tile")
    11951198
    11961199    # KML options
    11971200    g = OptionGroup(p, "KML (Google Earth) options",
    … … class GDAL2Tiles(object):  
    14001403
    14011404        # Tile format
    14021405        self.tile_size = 256
     1406        if options.tilesize:
     1407            self.tile_size = options.tilesize
    14031408        self.tiledriver = 'PNG'
    14041409        self.tileext = 'png'
    14051410        self.tmp_dir = tempfile.mkdtemp()
    … … class GDAL2Tiles(object):  
    15981603        # Calculating ranges for tiles in different zoom levels
    15991604        if self.options.profile == 'mercator':
    16001605
    1601             self.mercator = GlobalMercator()
     1606            self.mercator = GlobalMercator(tile_size=self.tile_size)
    16021607
    16031608            # Function which generates SWNE in LatLong for given tile
    16041609            self.tileswne = self.mercator.TileLatLonBounds
    … … class GDAL2Tiles(object):  
    16411646
    16421647        if self.options.profile == 'geodetic':
    16431648
    1644             self.geodetic = GlobalGeodetic(self.options.tmscompatible)
     1649            self.geodetic = GlobalGeodetic(self.options.tmscompatible, tile_size=self.tile_size)
    16451650
    16461651            # Function which generates SWNE in LatLong for given tile
    16471652            self.tileswne = self.geodetic.TileLatLonBounds
Note: See TracBrowser for help on using the repository browser.