main_lat *= -1;
}
- sprintf(raw_path, "%c%03d%c%02d/%c%03d%c%02d",
+ snprintf(raw_path, 256, "%c%03d%c%02d/%c%03d%c%02d",
hem, top_lon, pole, top_lat,
hem, main_lon, pole, main_lat);
// return width of the tile in degrees
double SGBucket::get_width() const {
- if (lon==-180 && (lat==-89 || lat==88) ) {
- /* Normally the tile at 180W in 88N and 89S
- * would cover 184W to 176W and the next
- * on the east side starts at 176W.
- * To correct, make this a special tile
- * from 180W to 176W with 4 degrees width
- * instead of the normal 8 degrees at
- * that latitude.
- */
- return 4.0;
- }
return sg_bucket_span( get_center_lat() );
}
#endif
}
+void sgGetBuckets( const SGGeod& min, const SGGeod& max, std::vector<SGBucket>& list ) {
+ double lon, lat, span;
+ for (lat = min.getLatitudeDeg(); lat <= max.getLatitudeDeg(); lat += SG_BUCKET_SPAN) {
+ span = sg_bucket_span( lat );
+ for (lon = min.getLongitudeDeg(); lon <= max.getLongitudeDeg(); lon += span) {
+ list.push_back( SGBucket(lon , lat) );
+ }
+ }
+}