Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hash from --get-hash does not match the one detected while generating empty tiles #176

Closed
asaunier opened this issue Nov 1, 2013 · 3 comments
Milestone

Comments

@asaunier
Copy link
Member

asaunier commented Nov 1, 2013

The following command returns a hash for empty_tile_detection:

$ ./buildout/bin/generate_tiles --get-hash 0/8/8 -l grundkarte 
Tile: 0/8/8:+8/+8    
    empty_metatile_detection:
        size: 753
        hash: 7227e6229574d56f9d02ec3f71064ee717dfeea1
Tile: 0/8/8
    empty_tile_detection:
        size: 1189
        hash: cddcea030117de8845ebb2a7e98fa2cdad301f13

that does not match the one actually computed when generating empty tiles with

./buildout/bin/generate_tiles -l grundkarte -z 0 -v

(should be f94e1d96bda53402b0b4f0a2d74b9ea37ab1f17a).

The error occurs with the PNG tiles, OK with JPEG tiles.

Here is the relevant parts of the config.yaml file:

ayer_default:
    type: wms
    grid: swissgrid
    # The minimum resolution to seed, useful to use with mapcache, optional.
    min_resolution_seed: 0.25
    # the URL of the WMS server to used
    url: http://${vars:host}/${vars:instanceid}/wsgi/mapserv_proxy
    # file name extension
    extension: png
    # the bbox there we want to generate tiles
    bbox: [669000, 193000, 722000, 232000]

    # mime type used for the WMS request and the WMTS capabilities generation
    mime_type: image/png
    wmts_style: default
    # the WMTS dimensions definition [default to []]
    dimensions:
        -   name: DATE
            # the default value for the WMTS capabilities
            default: 2013
            # the generated value
            value: 2013
            # all the available values in the WMTS capabilities
            values: [2013]
    # the meta tiles definition [default to off]
    meta: on
    # the meta tiles size [default to 8]
    meta_size: 8
    # the meta tiles buffer [default to 128]
    meta_buffer: 128
    # connexion an sql to get geometries (in column named geom) where we want to generate tiles
    # Warn: too complex result can slow down the application
#    connection: user=www-data password=www-data dbname=<db> host=localhost
#    sql: <column> AS geom FROM <table>
    # size and hash used to detect empty tiles and metatiles [optional, default to None]
    empty_metatile_detection:
        size: 753
        hash: 7227e6229574d56f9d02ec3f71064ee717dfeea1
    empty_tile_detection:
        size: 1189
        #hash: cddcea030117de8845ebb2a7e98fa2cdad301f13
        hash: f94e1d96bda53402b0b4f0a2d74b9ea37ab1f17a

layers:
    grundkarte:
        layers: grundkarte
    ortho:
        layers: ortho
        extension: jpeg
        mime_type: image/jpeg
        # no buffer needed on rater sources
        meta_buffer: 0
        empty_metatile_detection:
            size: 66163
            hash: a9d16a1794586ef92129a2fb41a739451ed09914
        empty_tile_detection:
            size: 1651
            hash: 2892fea0a474228f5d66a534b0b5231d923696da
@ochriste
Copy link
Member

do you remember if for your png you had any QUANTITIZE_* options set in the mapfile's OUTPUTFORMAT for png ?

@sbrunner
Copy link
Member

The optimize=True in image save options (purpose in #172) don't do anything ...

Adding image = image.convert(mode='P', palette=Image.ADAPTIVE) in the metatile spliter solved the issue but it's an unwanted hack, I will see for an other solution...

@sbrunner
Copy link
Member

I hope that process (available in version 0.8) will be a solution to fix that ...

E.g.:

layers:
  <name>:
    post_process: optipng

process:
    optipng_test:
    - cmd: optipng -o7 -simulate %(in)s
    optipng:
    - cmd: optipng %(args)s -zc9 -zm8 -zs3 -f5 %(in)s
        arg:
            default: '-q'
            quiet: '-q'

@sbrunner sbrunner modified the milestones: 0.9, 0.8 Jul 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants