GitHubRGI/geopackage-python

gdal2tiles_parallel.py: error: Output formats allowed are PNG and JPEG

Opadera opened this issue · 5 comments

When I try to run the command as given in the wiki:
python gdal2tiles_parallel.py -e -p mercator /data/raw/WhiteHorse.tif /data/tiles/mercator/WhiteHorse_tiles

i get the error:
gdal2tiles_parallel.py: error: Output formats allowed are PNG and JPEG

I tried to include --format JPEG as indicated here but I only get "Format Details" in the editor returned, no tiles created.
Any solutions to this?

Answer the following when submitting a ticket:

  • What is your platform (Windows/Linux): Windows 10
  • What is your architecture? (32 v. 64): 64
  • What version of GDAL are you using? 2.1
  • What are the steps to reproduce your issue? replace path/filename in the command

same problems here. Works fine in the v5.0 tag

Same problem here...

Same on Linux

time gdalbuildvrt -srcnodata "0,0,0" orthomaps/$DATASET/global.vrt orthomaps/$DATASET/orthophoto_*.tif
GDAL_TO_TILES="/usr/bin/python /usr/bin/gdal2tiles_parallel.py"
time $GDAL_TO_TILES -z 0-$LEVELS_OF_DETAIL orthomaps/$DATASET/global.vrt tiles/gdal2tiles_parallel_$DATASET"_tiles"

Produced error:

Usage: gdal2tiles_parallel.py [options] input_file(s) [output]

gdal2tiles_parallel.py: error: Output formats allowed are PNG and JPEG

If I use time $GDAL_TO_TILES -z 0-$LEVELS_OF_DETAIL -v --format PNG orthomaps/$DATASET/global.vrt tiles/gdal2tiles_parallel_$DATASET"_tiles"
is just print some info and nothing happens:

Format Details:
  Short Name: PNG
  Long Name: Portable Network Graphics
  Extension: png
  Mime Type: image/png
  Help Topic: frmt_various.html#PNG
  Supports: CreateCopy() - Create dataset by copying another.
  Supports: Virtual IO - eg. /vsimem/
  Creation Datatypes: Byte UInt16

<CreationOptionList>
  <Option name="WORLDFILE" type="boolean" description="Create world file" />
  <Option name="ZLEVEL" type="int" description="DEFLATE compression level 1-9" default="6" />
</CreationOptionList>

Format Details:
  Short Name: PNG
  Long Name: Portable Network Graphics
  Extension: png
  Mime Type: image/png
  Help Topic: frmt_various.html#PNG
  Supports: CreateCopy() - Create dataset by copying another.
  Supports: Virtual IO - eg. /vsimem/
  Creation Datatypes: Byte UInt16

<CreationOptionList>
  <Option name="WORLDFILE" type="boolean" description="Create world file" />
  <Option name="ZLEVEL" type="int" description="DEFLATE compression level 1-9" default="6" />
</CreationOptionList>

A quick fix is to hard code the output tile driver format. Not the best solution, but works fine for my use case.

If I use the flag --format=PNG or --format=JPEG it works. I guess is just a matter of how to set the flag in the command line.