GitHubRGI / geopackage-python

Achived - See GitLab repository for current development
https://gitlab.com/GitLabRGI/erdc/geopackage-python
GNU General Public License v3.0
65 stars 42 forks source link

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

Open Opadera opened 7 years ago

Opadera commented 7 years ago

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:

shaystrong commented 7 years ago

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

Robinlovelace commented 7 years ago

Same problem here...

mrgloom commented 7 years ago

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>
seripap commented 7 years ago

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

dvictori commented 7 years ago

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.