gdouble lat, gdouble lon, gdouble elev)
{
gdouble tlat = lat > tile->edge.n ? tile->edge.n :
gdouble lat, gdouble lon, gdouble elev)
{
gdouble tlat = lat > tile->edge.n ? tile->edge.n :
gdouble max_res, gint width, gint height,
gdouble lat, gdouble lon, gdouble elev)
{
gdouble max_res, gint width, gint height,
gdouble lat, gdouble lon, gdouble elev)
{
gdouble res, gint width, gint height,
gdouble lat, gdouble lon, gdouble elev,
GisTileLoadFunc load_func, gpointer user_data)
{
gdouble res, gint width, gint height,
gdouble lat, gdouble lon, gdouble elev,
GisTileLoadFunc load_func, gpointer user_data)
{
- tile->atime = time(NULL);
- //g_debug("GisTile: update - %p->atime = %u", tile, (guint)tile->atime);
- gdouble lat_dist = tile->edge.n - tile->edge.s;
- gdouble lon_dist = tile->edge.e - tile->edge.w;
- if (_gis_tile_needs_split(tile, res, width, height, lat, lon, elev)) {
- gdouble lat_step = lat_dist / G_N_ELEMENTS(tile->children);
- gdouble lon_step = lon_dist / G_N_ELEMENTS(tile->children[0]);
+ root->atime = time(NULL);
+ //g_debug("GisTile: update - %p->atime = %u", root, (guint)root->atime);
+ gdouble lat_dist = root->edge.n - root->edge.s;
+ gdouble lon_dist = root->edge.e - root->edge.w;
+ if (_gis_tile_needs_split(root, res, width, height, lat, lon, elev)) {
+ gdouble lat_step = lat_dist / G_N_ELEMENTS(root->children);
+ gdouble lon_step = lon_dist / G_N_ELEMENTS(root->children[0]);
- gis_tile_foreach_index(tile, x, y) {
- if (!tile->children[x][y]) {
- tile->children[x][y] = gis_tile_new(tile,
- tile->edge.n-(lat_step*(x+0)),
- tile->edge.n-(lat_step*(x+1)),
- tile->edge.w+(lon_step*(y+1)),
- tile->edge.w+(lon_step*(y+0)));
- load_func(tile->children[x][y], user_data);
+ gis_tile_foreach_index(root, x, y) {
+ if (!root->children[x][y]) {
+ root->children[x][y] = gis_tile_new(root,
+ root->edge.n-(lat_step*(x+0)),
+ root->edge.n-(lat_step*(x+1)),
+ root->edge.w+(lon_step*(y+1)),
+ root->edge.w+(lon_step*(y+0)));
+ load_func(root->children[x][y], user_data);
- gdouble lat_step = (tile->edge.n - tile->edge.s) / rows;
- gdouble lon_step = (tile->edge.e - tile->edge.w) / cols;
+ gdouble lat_step = (root->edge.n - root->edge.s) / rows;
+ gdouble lon_step = (root->edge.e - root->edge.w) / cols;
- else if (tile->children[row][col] && tile->children[row][col]->data)
- return gis_tile_find(tile->children[row][col], lat, lon);
+ else if (root->children[row][col] && root->children[row][col]->data)
+ return gis_tile_find(root->children[row][col], lat, lon);
- gis_tile_foreach_index(tile, x, y) {
- tile->children[x][y] = gis_tile_gc(
- tile->children[x][y], atime,
+ gis_tile_foreach_index(root, x, y) {
+ root->children[x][y] = gis_tile_gc(
+ root->children[x][y], atime,
- // tile, (guint)tile->atime, (guint)atime);
- if (!has_children && tile->atime < atime && tile->data) {
- free_func(tile, user_data);
- g_object_unref(tile);
+ // root, (guint)root->atime, (guint)atime);
+ if (!has_children && root->atime < atime && root->data) {
+ free_func(root, user_data);
+ g_object_unref(root);