Skip to content
Permalink
Browse files

Add ':inv_x' and ':inv_y' to templates available in SQLite queries (#190

)
  • Loading branch information...
jbo-ads authored and tbonfort committed Dec 5, 2018
1 parent 3eb53ca commit 1deb5ec189cfe5ff9a80d0d7e8c2aeb15fc38c7c
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/cache_sqlite.c
@@ -296,11 +296,19 @@ static void _bind_sqlite_params(mapcache_context *ctx, void *vstmt, mapcache_cac
paramidx = sqlite3_bind_parameter_index(stmt, ":x");
if (paramidx) sqlite3_bind_int(stmt, paramidx, tile->x);

paramidx = sqlite3_bind_parameter_index(stmt, ":inv_x");
if (paramidx)
sqlite3_bind_int(stmt, paramidx, tile->grid_link->grid->levels[tile->z]->maxx - tile->x - 1);

/* tile->y */
paramidx = sqlite3_bind_parameter_index(stmt, ":y");
if (paramidx) sqlite3_bind_int(stmt, paramidx, tile->y);

/* tile->y */
paramidx = sqlite3_bind_parameter_index(stmt, ":inv_y");
if (paramidx)
sqlite3_bind_int(stmt, paramidx, tile->grid_link->grid->levels[tile->z]->maxy - tile->y - 1);

/* tile->z */
paramidx = sqlite3_bind_parameter_index(stmt, ":z");
if (paramidx) sqlite3_bind_int(stmt, paramidx, tile->z);

0 comments on commit 1deb5ec

Please sign in to comment.
You can’t perform that action at this time.