-
Notifications
You must be signed in to change notification settings - Fork 192
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
getting blank tile while using mod_tile with mapnik to serve geotiff file #432
Comments
Hello @pdpsinghr, It looks like your Here's an example of our valid example |
Hi @hummeltech I'm exploring ways to dynamically serve GeoTIFF files with mod_tile, where the hour parameter is provided via an API URL. I tried using a custom script in renderd.conf (ModTileXMLConfigEndpoint /usr/renderd/custom_script.py), but encountered issues. Do you know of any alternative methods or approaches? i keep last 48 hours geotiff so the url will be dynamic along with the mapnik.xml. |
@pdpsinghr, I would recommend you look into writing a "parameterization" function for this, here's a comment I wrote recently explaining it a little bit: In your case, you might add a new function which would change the source GeoTIFF based on the URL path. |
@hummeltech I am new to this one , |
@pdpsinghr, you would just need to create the function and add a configuration to your 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 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 [geotiff_by_date]
PARAMETERIZE_STYLE=geotiff_by_date
TILEDIR=/var/lib/mod_tile
XML=/usr/share/renderd/example-map/mapnik.xml |
if i define renderd.conf file like this [ats_tile] URI=/tiles/ats_tile/2024_05_20_09 URI=/tiles/ats_tile/2024_05_20_10 URI=/tiles/ats_tile/2024_05_20_11 then from cache i getting wrong tile mostly from different hour not for the hour specified can we store cache according to hour and then go by x, y, z? |
If you are going to create multiple [ats_tile_2024_05_20_08]
[ats_tile_2024_05_20_09]
[ats_tile_2024_05_20_10]
[ats_tile_2024_05_20_11]
|
Hi, I stuck in one issue where i have geotiff files and i want to use mod_tile but problem is after trying everything i am still getting balnk tile in api response but i tride to generate same tile using python and mapnik i am able to do so.
i am adding all information here
[renderd]
pid_file=/run/renderd/renderd.pid
socketname=/run/renderd/renderd.sock
stats_file=/run/renderd/renderd.stats
tile_dir=/var/cache/renderd/tiles
[mapnik]
font_dir=/usr/share/fonts
font_dir_recurse=0
plugins_dir=/usr/lib/mapnik/3.0/input
[default]
URI=/osm_tiles/
TILEDIR=/var/lib/mod_tile
XML=/usr/share/renderd/example-map/mapnik.xml
HOST=0.0.0.0
TILESIZE=256
[example-map]
URI=/tiles/renderd-example
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-jpg]
TYPE=jpg image/jpeg jpeg
URI=/tiles/renderd-example-jpg
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-png256]
TYPE=png image/png png256
URI=/tiles/renderd-example-png256
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-png32]
TYPE=png image/png png32
URI=/tiles/renderd-example-png32
XML=/usr/share/renderd/example-map/mapnik.xml
[example-map-webp]
TYPE=webp image/webp webp
URI=/tiles/renderd-example-webp
XML=/usr/share/renderd/example-map/mapnik.xml
Driver: GTiff/GeoTIFF
Files: AQ.tiff
Size is 7220, 2810
Coordinate System is:
GEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]]
Data axis to CRS axis mapping: 2,1
Origin = (-180.500000000000000,84.099607528087063)
Pixel Size = (0.050000000000000,-0.050000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left (-180.5000000, 84.0996075) (180d30' 0.00"W, 84d 5'58.59"N)
Lower Left (-180.5000000, -56.4003925) (180d30' 0.00"W, 56d24' 1.41"S)
Upper Right ( 180.5000000, 84.0996075) (180d30' 0.00"E, 84d 5'58.59"N)
Lower Right ( 180.5000000, -56.4003925) (180d30' 0.00"E, 56d24' 1.41"S)
Center ( 0.0000000, 13.8496075) ( 0d 0' 0.01"E, 13d50'58.59"N)
Band 1 Block=7220x1 Type=Int32, ColorInterp=Gray
NoData Value=-255
The text was updated successfully, but these errors were encountered: