bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
GridGeoConstraint.h
1
2// -*- mode: c++; c-basic-offset:4 -*-
3
4// This file is part of libdap, A C++ implementation of the OPeNDAP Data
5// Access Protocol.
6
7// Copyright (c) 2006 OPeNDAP, Inc.
8// Author: James Gallagher <jgallagher@opendap.org>
9//
10// This library is free software; you can redistribute it and/or
11// modify it under the terms of the GNU Lesser General Public
12// License as published by the Free Software Foundation; either
13// version 2.1 of the License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23//
24// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25
26#ifndef _grid_geo_constraint_h
27#define _grid_geo_constraint_h 1
28
29#include <string>
30#include <sstream>
31#include <set>
32
33#ifndef _geo_constraint_h
34#include "GeoConstraint.h"
35#endif
36
37namespace functions
38{
39
40// Defined in GeoConstraint; maybe move to util.cc/h?
41extern bool unit_or_name_match(set < string > units, set < string > names,
42 const string & var_units,
43 const string & var_name);
44
47
48class GridGeoConstraint : public GeoConstraint
49{
50
51private:
52 // Specific to a Grid
53 libdap::Grid *d_grid; //< Constrain this Grid
54
55 libdap::Array *d_coverage; //< Constrain this Dap4 Array
56 libdap::Array *d_latitude; //< A pointer to the Grid's latitude map
57 libdap::Array *d_longitude; //< A pointer to the Grid's longitude map
58
59 bool build_lat_lon_maps();
60 bool build_lat_lon_maps(libdap::Array *lat, libdap::Array *lon);
61
62 bool lat_lon_dimensions_ok();
63
64 friend class GridGeoConstraintTest; // Unit tests
65
66public:
69 GridGeoConstraint(libdap::Grid *grid);
70 GridGeoConstraint(libdap::Grid *grid, libdap::Array *lat, libdap::Array *lon);
71
72 GridGeoConstraint(libdap::Array *coverage);
73 GridGeoConstraint(libdap::Array *coverage, libdap::Array *lat, libdap::Array *lon);
75
76 virtual ~GridGeoConstraint()
77 {}
78
79 virtual void apply_constraint_to_data() ;
80
81 virtual libdap::Grid *get_constrained_grid() const
82 {
83 return d_grid;
84 }
85};
86
87} // namespace libdap
88
89#endif // _grid_geo_constraint_h
90
virtual void apply_constraint_to_data()
Once the bounding box is set use this method to apply the constraint.