Custom mimetype/format is not supported
Closed this issue · 3 comments
yjacolin commented
For a grayscale background map, I added a custom outputformat in MapServer. Using this image format with tilecloud I get this error:
DEBUG:tilecloud.store.url:get_one:GET http://PPelulamatrix.coll-chatelleraudais.loc/osm-default?LAYERS=default&STYLES=default&WIDTH=2304&SERVICE=WMS&FORMAT=image%2Fpng%3Bmode%3D8bit%2Cgrayscale&REQUEST=GetMap&HEIGHT=2304&SRS=epsg%3A2154&VERSION=1.1.1&BBOX=404641.000000%2C5587764.000000%2C1556641.000000%2C6739764.000000&DATE=2015&TRANSPARENT=FALSE
INFO:requests.packages.urllib3.connectionpool:_new_conn:Starting new HTTP connection (1): PPelulamatrix.coll-chatelleraudais.loc
DEBUG:requests.packages.urllib3.connectionpool:_make_request:"GET /osm-default?LAYERS=default&STYLES=default&WIDTH=2304&SERVICE=WMS&FORMAT=image%2Fpng%3Bmode%3D8bit%2Cgrayscale&REQUEST=GetMap&HEIGHT=2304&SRS=epsg%3A2154&VERSION=1.1.1&BBOX=404641.000000%2C5587764.000000%2C1556641.000000%2C6739764.000000&DATE=2015&TRANSPARENT=FALSE HTTP/1.1" 200 None
Traceback (most recent call last):
File "./buildout/bin/generate_tiles", line 20, in <module>
tilecloud_chain.generate.main()
File "/var/www/vhosts/PPelulamatrix.coll-chatelleraudais.loc/private/chatellerault/buildout/eggs/tilecloud_chain-0.9.0-py2.7.egg/tilecloud_chain/generate.py", line 421, in main
generate.gene(options, gene, options.layer)
File "/var/www/vhosts/PPelulamatrix.coll-chatelleraudais.loc/private/chatellerault/buildout/eggs/tilecloud_chain-0.9.0-py2.7.egg/tilecloud_chain/generate.py", line 283, in gene
gene.consume()
File "/var/www/vhosts/PPelulamatrix.coll-chatelleraudais.loc/private/chatellerault/buildout/eggs/tilecloud_chain-0.9.0-py2.7.egg/tilecloud_chain/__init__.py", line 1274, in consume
consume(self.tilestream, test)
File "/var/www/vhosts/PPelulamatrix.coll-chatelleraudais.loc/private/chatellerault/buildout/eggs/tilecloud-0.2dev_20140325-py2.7.egg/tilecloud/__init__.py", line 19, in consume
collections.deque(iterator, maxlen=0)
File "/var/www/vhosts/PPelulamatrix.coll-chatelleraudais.loc/private/chatellerault/buildout/eggs/tilecloud_chain-0.9.0-py2.7.egg/tilecloud_chain/__init__.py", line 977, in meta_get
for tile in substream:
File "/var/www/vhosts/PPelulamatrix.coll-chatelleraudais.loc/private/chatellerault/buildout/eggs/tilecloud-0.2dev_20140325-py2.7.egg/tilecloud/store/metatile.py", line 29, in get
image.save(string_io, FORMAT_BY_CONTENT_TYPE[self.format])
KeyError: 'image/png;mode=8bit,grayscale'
yjacolin commented
sbrunner commented
The layer configurations should be:
...
mime_type: image/png
params:
format: image/png; mode=8bit, grayscale