create world files#93
Conversation
There was a problem hiding this comment.
could we remove this function, and instead factor in a forced extension in _mapcache_cache_disk_template_tile_key ?
There was a problem hiding this comment.
something like:
static void _mapcache_cache_disk_tilecache_tile_key(mapcache_context *ctx, mapcache_tile *tile, char **path, char *extension)and if extension == NULL we use the current behaviour of the function?
Otherwise we set the extension to "wld" ?
There was a problem hiding this comment.
That would be a bigger change...
All generic functions
lib/cache_disk.c:833: dcache->tile_key = _mapcache_cache_disk_tilecache_tile_key;
lib/cache_disk.c:835: dcache->tile_key = _mapcache_cache_disk_arcgis_tile_key;
lib/cache_disk.c:837: dcache->tile_key = _mapcache_cache_disk_template_tile_key;have to get this parameter, although they maybe never will use it.
As well as the interface in mapcache.h has to be changed:
struct mapcache_cache_disk {
...
void (*tile_key)(mapcache_context *ctx, mapcache_tile *tile, char **path);
};As an alternative we could implement a function to change the extension of a filename and use the current version of _mapcache_cache_disk_tilecache_tile_key.
But this could be as dirty as the internal API change...
There was a problem hiding this comment.
both options are OK for me, as long as we're not duplicating the code just to use another extension
the strstr function is already called in mapcache_util_str_replace
Instead we use replace_file_extension to generate the filename for the world file
|
@ruester - Is this pull request still relevant? |
|
As this PR is very old and was not merged till now, we can close it... If someone needs this feature they can use these commits to implement it for a newer version of mapcache 👍 |
|
@ruester we're doing a push for the upcoming 1.12.0 release and these changes could be included. Please re-open this as it is a good enhancement for the community. |
|
Oh ok, sure you can add this, but I will have no time for rebasing the commits or fix the implementation if needed.. |
|
ok thanks for explaining. Closing. |
When caching to disk or tiff it is useful to also create world files for the images.
So we are able to generate all tiles using mapcache_seed and then use the same raster data for a WMS service.
To use this feature following has to be added to the configuration file:
We used the file extension ".wld" for the world files as suggested by MapServer (see here).