[Tile-serving] [openstreetmap/mod_tile] getting blank tile while using mod_tile with mapnik to serve geotiff file (Issue #432)

Hummeltech notifications at github.com
Fri May 17 14:43:18 UTC 2024


@pdpsinghr, you would just need to create the function and add a configuration to your `renderd.conf` file. The value in the request will be passed via the `parameter` function parameter.
E.g.:
Create your new function in `/src/parameterize_style.cpp`:
```C++
 static void parameterize_geotiff_by_date(mapnik::Map &m, char *parameter) 
 {
 	char *geotiff_date = strdup(parameter);
 	# modify `mapnik::Map &m` to use `geotiff_date` in the `DataSource` file name
 }
 ```
Add a reference to it in `init_parameterization_function` in `/src/parameterize_style.cpp`:
```C++
parameterize_function_ptr init_parameterization_function(const char *function_name)
{
	if (strcmp(function_name, "") == 0) {
		g_logger(G_LOG_LEVEL_DEBUG, "Parameterize_style not specified (or empty string specified)");
		return NULL;
	} else if (strcmp(function_name, "language") == 0) {
		g_logger(G_LOG_LEVEL_DEBUG, "Loading parameterization function for '%s'", function_name);
		return parameterize_map_language;
	} else if (strcmp(function_name, "geotiff_by_date") == 0) {
		g_logger(G_LOG_LEVEL_DEBUG, "Loading parameterization function for '%s'", function_name);
		return parameterize_geotiff_by_date;
	} else {
		g_logger(G_LOG_LEVEL_WARNING, "unknown parameterization function for '%s'", function_name);
	}

	return NULL;
}
```

Add a configuration to `renderd.conf`:
 ```ini
[geotiff_by_date]
PARAMETERIZE_STYLE=geotiff_by_date
TILEDIR=/var/lib/mod_tile
XML=/usr/share/renderd/example-map/mapnik.xml
 ```


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/mod_tile/issues/432#issuecomment-2117762683
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/mod_tile/issues/432/2117762683 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/tile-serving/attachments/20240517/b194e738/attachment.htm>


More information about the Tile-serving mailing list