0

I'm getting this error:

Exception: Requested format "PNG" does not match tileset format "png"

I am using RedHat Linux 7.5 (RHEL7.5).

I have setup GDAL 2.4.0 with following options while configuring:

./configure --with-sqlite3=yes --with-spatialite=yes --with-ogr=yes

I have also setup gdal2mbtiles from github. gdal_translate is showing MBTiles and PNG -raster format in this command:

# gdal_translate --formats

I converted my tiff file to mbtiles file format with this three methods:

(1) Method-1

# gdal_translate my_dataset.tif my_dataset_1.mbtiles -of MBTILES

# gdaladdo -r average my_dataset_1.mbtiles 2 4 8 16

(2) Method-2

# gdal2mbtiles my_dataset.tif my_dataset_2.mbtiles

(3) Method-3

Manually using TileMill. The converted file is my_dataset_3.mbtiles

TileStache server setup info.

  • TileStache configuration file.
     /opt/TileStache/tilestache.cfg
  • Configuration file has following content.

I have also tried this option in this configuration.

"path": "file:///tmp/stache"

enter image description here

Accessing the tile.

  1. Start server
# cd /opt/TileStache/

# python2 scripts/tilestache-server.py

I have also checked with python3 that I have in my system. Same error.

  1. Access the tile.
http://localhost:8080/tile1/0/0/0.png
http://localhost:8080/tile2/0/0/0.png
http://localhost:8080/tile3/0/0/0.png

While serving first two files, it shows this error:

# python2 scripts/tilestache-server.py 
 * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)
127.0.0.1 - - [25/Jul/2019 10:29:07] "GET /tile1/0/0/0.png HTTP/1.1" 500 -
Error on request:
Traceback (most recent call last):

File "/usr/lib64/python2.7/site-packages/werkzeug/serving.py", line 303, in run_wsgi
    execute(self.server.app)

  File "/usr/lib64/python2.7/site-packages/werkzeug/serving.py", line 291, in execute
    application_iter = app(environ, start_response)

  File "/usr/lib/python2.7/site-packages/TileStache-1.51.14-py2.7.egg/TileStache/__init__.py", line 393, in __call__
    status_code, headers, content = requestHandler2(self.config, path_info, query_string, script_name)

  File "/usr/lib/python2.7/site-packages/TileStache-1.51.14-py2.7.egg/TileStache/__init__.py", line 266, in requestHandler2
    status_code, headers, content = layer.getTileResponse(coord, extension)

  File "/usr/lib/python2.7/site-packages/TileStache-1.51.14-py2.7.egg/TileStache/Core.py", line 443, in getTileResponse
    tile.save(buff, format, **save_kwargs)

  File "/usr/lib/python2.7/site-packages/TileStache-1.51.14-py2.7.egg/TileStache/MBTiles.py", line 270, in save
    raise Exception('Requested format "%s" does not match tileset format "%s"' % (format, self.format))

Exception: Requested format "PNG" does not match tileset format "png"

127.0.0.1 - - [25/Jul/2019 10:29:08] "GET /favicon.ico HTTP/1.1" 400 

Notes:

  • The 3rd tile converted using TileMill is served as expected but remaining ones converted using first two methods shows above error.
  • I need to convert hundreds of tiff file to .mbtiles format and that is not feasible with TileMill hence I have only two options, the 1st and 2nd method.
  • Does any one have successfully converted tiff to mbtiles format and used TileStache server to serve it without above error.

I am not able to deal with the error it prompting me while serving the mbtile tiles.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.