| [b72d9c4] | 1 | --- gdal2tiles.py.old 2020-04-02 19:51:46.360797145 +0200
|
|---|
| 2 | +++ gdal2tiles.py 2020-04-02 18:08:21.052870654 +0200
|
|---|
| 3 | @@ -1192,6 +1192,9 @@ def optparse_init():
|
|---|
| 4 | dest="nb_processes",
|
|---|
| 5 | type='int',
|
|---|
| 6 | help="Number of processes to use for tiling")
|
|---|
| 7 | + p.add_option("--tilesize", dest="tilesize", default=256,
|
|---|
| 8 | + type='int',
|
|---|
| 9 | + help="Tile size in pixel of a tile")
|
|---|
| 10 |
|
|---|
| 11 | # KML options
|
|---|
| 12 | g = OptionGroup(p, "KML (Google Earth) options",
|
|---|
| 13 | @@ -1400,6 +1403,8 @@ class GDAL2Tiles(object):
|
|---|
| 14 |
|
|---|
| 15 | # Tile format
|
|---|
| 16 | self.tile_size = 256
|
|---|
| 17 | + if options.tilesize:
|
|---|
| 18 | + self.tile_size = options.tilesize
|
|---|
| 19 | self.tiledriver = 'PNG'
|
|---|
| 20 | self.tileext = 'png'
|
|---|
| 21 | self.tmp_dir = tempfile.mkdtemp()
|
|---|
| 22 | @@ -1598,7 +1603,7 @@ class GDAL2Tiles(object):
|
|---|
| 23 | # Calculating ranges for tiles in different zoom levels
|
|---|
| 24 | if self.options.profile == 'mercator':
|
|---|
| 25 |
|
|---|
| 26 | - self.mercator = GlobalMercator()
|
|---|
| 27 | + self.mercator = GlobalMercator(tile_size=self.tile_size)
|
|---|
| 28 |
|
|---|
| 29 | # Function which generates SWNE in LatLong for given tile
|
|---|
| 30 | self.tileswne = self.mercator.TileLatLonBounds
|
|---|
| 31 | @@ -1641,7 +1646,7 @@ class GDAL2Tiles(object):
|
|---|
| 32 |
|
|---|
| 33 | if self.options.profile == 'geodetic':
|
|---|
| 34 |
|
|---|
| 35 | - self.geodetic = GlobalGeodetic(self.options.tmscompatible)
|
|---|
| 36 | + self.geodetic = GlobalGeodetic(self.options.tmscompatible, tile_size=self.tile_size)
|
|---|
| 37 |
|
|---|
| 38 | # Function which generates SWNE in LatLong for given tile
|
|---|
| 39 | self.tileswne = self.geodetic.TileLatLonBounds
|
|---|