}
-/***********
- * GisBBox *
- ***********/
+/*************
+ * GisBounds *
+ *************/
/**
- * gis_bbox_set_bounds:
+ * gis_bounds_set_bounds:
* @n: the north edge
* @s: the south edge
* @e: the east edge
*
* Set the north, south, east, and west edges of the bounding box
*/
-void gis_bbox_set_bounds(GisBBox *bbox,
+void gis_bounds_set_bounds(GisBounds *bounds,
gdouble n, gdouble s, gdouble e, gdouble w)
{
- bbox->n = n;
- bbox->s = s;
- bbox->e = e;
- bbox->w = w;
+ bounds->n = n;
+ bounds->s = s;
+ bounds->e = e;
+ bounds->w = w;
}
void gis_point_set_lle(GisPoint *point,
gdouble lat, gdouble lon, gdouble elev);
-/* GisBBox */
-typedef struct _GisBBox GisBBox;
-struct _GisBBox {
+/* GisBounds */
+typedef struct _GisBounds GisBounds;
+struct _GisBounds {
gdouble n, s, e, w;
};
-void gis_bbox_set_bounds(GisBBox *bbox,
+void gis_bounds_set_bounds(GisBounds *bounds,
gdouble n, gdouble s, gdouble e, gdouble w);
GisTile *tile = g_object_new(GIS_TYPE_TILE, NULL);
tile->parent = parent;
tile->atime = time(NULL);
- gis_bbox_set_bounds(&tile->coords, 0, 1, 1, 0);
- gis_bbox_set_bounds(&tile->edge, n, s, e, w);
+ gis_bounds_set_bounds(&tile->coords, 0, 1, 1, 0);
+ gis_bounds_set_bounds(&tile->edge, n, s, e, w);
return tile;
}
return g_string_free(path, FALSE);
}
-static gdouble _gis_tile_get_min_dist(GisPoint *eye, GisBBox *bounds)
+static gdouble _gis_tile_get_min_dist(GisPoint *eye, GisBounds *bounds)
{
GisPoint pos = {};
pos.lat = eye->lat > bounds->n ? bounds->n :
return distd(a, b);
}
-static gboolean _gis_tile_precise(GisPoint *eye, GisBBox *bounds,
+static gboolean _gis_tile_precise(GisPoint *eye, GisBounds *bounds,
gdouble max_res, gint width, gint height)
{
gdouble min_dist = _gis_tile_get_min_dist(eye, bounds);
int row, col;
gis_tile_foreach_index(root, row, col) {
GisTile **child = &root->children[row][col];
- GisBBox edge;
+ GisBounds edge;
edge.n = root->edge.n-(lat_step*(row+0));
edge.s = root->edge.n-(lat_step*(row+1));
edge.e = root->edge.w+(lon_step*(col+1));