Opened 13 years ago

Closed 23 months ago

#2052 closed enhancement (wontfix)

[PATCH]gdal2tiles.py: support for jpg and tiff tiles

Reported by: olt Owned by: klokan
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords: kml, tiles, tms, python, gdal2tiles
Cc:

Description

Here is a patch for gdal2tiles.py to support output of jpg and tiff tiles, besides png. See discussion on #1763.

  • Adds -of argument which accepts png, jpg or tiff. Maybe it should follow the -of arguments from gdal_translate, etc. (eg. GTiff for tiff). I'm not sure.
  • Adds -co argument which is identical to gdal_translate's -co

Example: gdal2tiles.py -of tiff -co 'INTERLEAVE=PIXEL' image.tiff Ok, that example doesn't work with Open Layers and Firefox, but you get tiles as TIFF.

Attachments (2)

gdal2tiles-format.patch (2.9 KB) - added by olt 13 years ago.
patch for gdal2tile.py, adds support for other tile formats
gdal2tiles_jpeg.patch (1.6 KB) - added by Even Rouault 6 years ago.
Quick&dirty patch that works with overviews too - DO NOT APPLY AS IT

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by olt

Attachment: gdal2tiles-format.patch added

patch for gdal2tile.py, adds support for other tile formats

comment:1 Changed 6 years ago by hamish

Hi,

I'd note that the copy of gdal2tiles.py shipped with maptiler contains a number of updates which were never checked into gdal svn. That version of the code can be found in the maptiler .deb; the latest public checkin to the maptiler svn at googlecode seems to be earlier.

There the option is called "--tile-format".

You can get the .deb at:

http://maptiler.googlecode.com/files/maptiler_1.0.beta2_all.deb

and uncompress it to get the .py out from within. If I find the energy I'll make a patch vs the nearest version in gdal's svn history.

regards, Hamish

ps- you'll find some shell script code to bulk convert gdal2tiles png to jpeg in my r.out.mbtiles addon script for GRASS 6:

http://trac.osgeo.org/grass/browser/grass-addons/grass6/raster/r.out.mbtiles

comment:2 Changed 6 years ago by hamish

see also #5624

comment:3 Changed 6 years ago by Jukka Rahkonen

Summary: gdal2tiles.py: support for jpg and tiff tiles[PATCH]gdal2tiles.py: support for jpg and tiff tiles

Changed 6 years ago by Even Rouault

Attachment: gdal2tiles_jpeg.patch added

Quick&dirty patch that works with overviews too - DO NOT APPLY AS IT

comment:4 Changed 23 months ago by Even Rouault

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.