26 #ifndef _geo_constraint_h
27 #define _geo_constraint_h 1
118 int d_array_data_size;
126 int d_latitude_index_top;
127 int d_latitude_index_bottom;
128 int d_longitude_index_left;
129 int d_longitude_index_right;
131 bool d_bounding_box_set;
132 bool d_longitude_rightmost;
137 Array::Dim_iter d_lon_dim;
138 Array::Dim_iter d_lat_dim;
141 set<string> d_coards_lat_units;
142 set<string> d_coards_lon_units;
144 set<string> d_lat_names;
145 set<string> d_lon_names;
179 const double right,
const double bottom)
const;
181 int &longitude_index_left,
182 int &longitude_index_right)
const;
189 int &latitude_index_top,
190 int &latitude_index_bottom)
const;
206 delete [] d_lat; d_lat = 0;
207 delete [] d_lon; d_lon = 0;
208 delete [] d_array_data; d_array_data = 0;
220 return d_array_data_size;
277 return d_latitude_index_top;
281 return d_latitude_index_bottom;
285 d_latitude_index_top = top;
289 d_latitude_index_bottom = bottom;
294 return d_longitude_index_left;
298 return d_longitude_index_right;
302 d_longitude_index_left = left;
306 d_longitude_index_right = right;
311 return d_bounding_box_set;
315 return d_longitude_rightmost;
319 d_longitude_rightmost = state;
324 return d_longitude_notation;
328 return d_latitude_sense;
332 d_longitude_notation = n;
336 d_latitude_sense = l;
341 return d_coards_lat_units;
345 return d_coards_lon_units;
358 void set_bounding_box(
double top,
double left,
double bottom,
double right);
367 #endif // _geo_constraint_h
void set_lat_dim(Array::Dim_iter lat)
void transform_constraint_to_pos_notation(double &left, double &right) const
char * get_array_data() const
void set_latitude_index_bottom(int bottom)
void set_lon(double *lon)
virtual void reorder_data_longitude_axis(Array &a, Array::Dim_iter lon_dim)
Reorder the data values relative to the longitude axis so that the reordered longitude map (see GeoCo...
void set_latitude_index_top(int top)
set< string > get_coards_lat_units() const
set< string > get_lon_names() const
void set_longitude_rightmost(bool state)
void set_latitude_sense(LatitudeSense l)
void find_longitude_indeces(double left, double right, int &longitude_index_left, int &longitude_index_right) const
Scan from the left to the right, and the right to the left, looking for the left and right bounding b...
virtual void apply_constraint_to_data()=0
Once the bounding box is set use this method to apply the constraint.
int get_longitude_index_left() const
void set_bounding_box(double top, double left, double bottom, double right)
Set the bounding box for this constraint.
Array::Dim_iter get_lon_dim() const
void find_latitude_indeces(double top, double bottom, LatitudeSense sense, int &latitude_index_top, int &latitude_index_bottom) const
Scan from the top to the bottom, and the bottom to the top, looking for the top and bottom bounding b...
void set_lat(double *lat)
void set_lat_length(int len)
virtual void transpose_vector(double *src, const int length)
Given a vector of doubles, transpose the elements.
virtual void transform_longitude_to_pos_notation()
Given that the Grid has a longitude map that uses the 'neg_pos' notation, transform it to the 'pos' n...
int get_longitude_index_right() const
int get_lat_length() const
int get_array_data_size() const
int get_latitude_index_bottom() const
set< string > get_coards_lon_units() const
virtual void flip_latitude_within_array(Array &a, int lat_length, int lon_length)
virtual LatitudeSense categorize_latitude() const
Take a look at the latitude vector values and record whether the world is normal or upside down...
LatitudeSense
Most of the time, latitude starts at the top of an array with positive values and ends up at the bott...
GeoConstraint()
Initialize GeoConstraint.
virtual void transform_longitude_to_neg_pos_notation()
Given that the Grid has a longitude map that uses the 'pos' notation, transform it to the 'neg_pos' n...
LatitudeSense get_latitude_sense() const
virtual bool is_bounding_box_valid(const double left, const double top, const double right, const double bottom) const
set< string > get_lat_names() const
Notation
The longitude extents of the constraint bounding box can be expressed two ways: using a 0/359 notatio...
void set_longitude_index_right(int right)
void set_longitude_notation(Notation n)
virtual bool lat_lon_dimensions_ok()=0
Are the latitude and longitude dimensions ordered so that this class can properly constrain the data...
virtual bool build_lat_lon_maps()=0
A protected method that searches for latitude and longitude map vectors and sets six key internal fie...
Notation get_longitude_notation() const
virtual void reorder_longitude_map(int longitude_index_left)
Reorder the elements in the longitude map so that the longitude constraint no longer crosses the edge...
int get_lon_length() const
void set_longitude_index_left(int left)
Notation categorize_notation(const double left, const double right) const
A private method that determines if the longitude part of the bounding box uses 0/359 or -180/179 not...
Encapsulate the logic needed to handle geographical constraints when they are applied to DAP Grid (an...
friend class GridGeoConstraintTest
Array::Dim_iter get_lat_dim() const
bool is_longitude_rightmost() const
bool is_bounding_box_set() const
void set_lon_dim(Array::Dim_iter lon)
int get_latitude_index_top() const
void set_lon_length(int len)