DBCache Output Provider

The DBCache Output Provider is a bit more of an experimental output provider.

It does not save rendered tiles but the results of the DB Queries used for rendering the tiles. Depending on the Queries this can significantly speed up subsequent rendering processes if these use the resulting DB Caches as input instead of the database itself.


<maprender>
    ...
    <processing>
        <!-- not strictly necessary but slightly improves performance -->
        <skiprendering>true</skiprendering>
    </processing>

    <jobs> 
        <job name="demo"> 
            <configuration>C:\maprender\configs\osm-styles\style-demo.xml</configuration> 
            <output> 
                <dbCache folder="C:\maprender\output\dbcache\demo"></dbCache> 
            </output> 
        </job> 
    </jobs>
<maprender>

The given folder will act as the root folder for a slippymap-like folder structure. Slippymap-like means that the output will be structured like a common slippymap folder however instead of images there will be .dbcache files containing the cached query results.

Slippymap folder structure means that the image and folders have specific names indicating the X and Y coordinates and the zoom level: e.g. <root-folder>/zoom/x/y.png

The folders will be automatically generated.

After you have generated the DB cache you can use it as input datasource for other rendering jobs. You just have to switch the DB datasource to the DBCache datasource:


<maprender>
    <datasource>
        <!-- Deactivate the db connection before using the dbcache 
        <db> 
            <connection>jdbc:postgresql://192.168.0.20:5432/gis</connection> 
            <user>dbUsername</user> 
            <password>dbPassword</password> 
        </db>
        --> 
        <dbcache>
            <folder>C:\maprender\output\dbcache\demo</folder>
        </dbcache>
    </datasource>

    <bounds>...</bounds>
    <processing>...</processing>
    <datatarget>...</datatarget>	
    <jobs>...</jobs>

</maprender>

Please be aware that a DB cache can only be used with the same stylesheet XML that was used to generate the cache! Reason is that in the stylesheet XML the DB queries used for filling the DB cache are defined. If you use this DB cache with another stylesheet with other queries the results will most likely be faulty.