32 {
"$Id: ArrayGeoConstraint.cc 21922 2010-01-07 18:23:57Z jimg $"
55 void ArrayGeoConstraint::m_init()
57 if (d_array->dimensions() < 2 || d_array->dimensions() > 3)
58 throw Error(
"The geoarray() function works only with Arrays of two or three dimensions.");
65 ArrayGeoConstraint::ArrayGeoConstraint(
Array *
array,
double top,
double left,
66 double bottom,
double right)
68 d_extent(top, left, bottom, right), d_projection(
"plat-carre",
"wgs84")
75 double top,
double left,
double bottom,
double right,
76 const string &projection,
const string &datum)
78 d_extent(top, left, bottom, right), d_projection(projection, datum)
95 bool ArrayGeoConstraint::build_lat_lon_maps()
102 double *lon_map =
new double[number_elements_longitude];
103 for (
int i = 0; i < number_elements_longitude; ++i) {
104 lon_map[i] = ((d_extent.d_right - d_extent.d_left) / (number_elements_longitude - 1)) * i + d_extent.d_left;
113 double *lat_map =
new double[number_elements_latitude];
114 for (
int i = 0; i < number_elements_latitude; ++i) {
115 lat_map[i] = ((d_extent.d_bottom - d_extent.d_top) / (number_elements_latitude - 1)) * i + d_extent.d_top;
131 ArrayGeoConstraint::lat_lon_dimensions_ok()
154 "The Latitude and Longitude constraints must be set before calling\n\
155 apply_constraint_to_data().");
166 throw Error(
"The upper and lower latitude indexes appear to be reversed. Please provide\nthe latitude bounding box numbers giving the northern-most latitude first.");
203 (
"Expected data size not copied to the Grid's buffer.");