-
- // Informational methods
- inline int get_lon() const { return lon; }
- inline int get_lat() const { return lat; }
+
+ /**
+ * @return the center of the bucket in geodetic coordinates.
+ */
+ SGGeod get_center() const
+ { return SGGeod::fromDeg(get_center_lon(), get_center_lat()); }
+
+ /**
+ * @return the center of the bucket in geodetic coordinates.
+ */
+ SGGeod get_corner(unsigned num) const
+ {
+ double lonFac = ((num + 1) & 2) ? 0.5 : -0.5;
+ double latFac = ((num ) & 2) ? 0.5 : -0.5;
+ return SGGeod::fromDeg(get_center_lon() + lonFac*get_width(),
+ get_center_lat() + latFac*get_height());
+ }
+
+ // Informational methods.
+
+ /**
+ * @return the lon of the lower left corner of
+ * the 1x1 chunk containing this tile.
+ */
+ inline int get_chunk_lon() const { return lon; }
+
+ /**
+ * @return the lat of the lower left corner of
+ * the 1x1 chunk containing this tile.
+ */
+ inline int get_chunk_lat() const { return lat; }
+
+ /**
+ * @return the x coord within the 1x1 degree chunk this tile.
+ */