libdap
Updated for version 3.21.0
libdap4 is an implementation of OPeNDAP's DAP protocol.
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 <set>
30
#include <sstream>
31
#include <string>
32
33
#ifndef _geo_constraint_h
34
#include "GeoConstraint.h"
35
#endif
36
37
namespace
functions {
38
39
// Defined in GeoConstraint; maybe move to util.cc/h?
40
extern
bool
unit_or_name_match(set<string> units, set<string> names,
const
string
&var_units,
const
string
&var_name);
41
45
class
GridGeoConstraint
:
public
GeoConstraint
{
46
47
private
:
48
// Specific to a Grid
49
libdap::Grid
*d_grid;
//< Constrain this Grid (weak pointer)
50
51
libdap::Array
*d_latitude;
//< A (weak) pointer to the Grid's latitude map
52
libdap::Array
*d_longitude;
//< A (weak) pointer to the Grid's longitude map
53
54
bool
build_lat_lon_maps();
55
bool
build_lat_lon_maps(
libdap::Array
*lat,
libdap::Array
*lon);
56
57
bool
lat_lon_dimensions_ok();
58
59
friend
class
GridGeoConstraintTest;
// Unit tests
60
61
public
:
64
GridGeoConstraint
(
libdap::Grid
*grid);
65
GridGeoConstraint
(
libdap::Grid
*grid,
libdap::Array
*lat,
libdap::Array
*lon);
67
68
virtual
~GridGeoConstraint
() {}
69
70
virtual
void
apply_constraint_to_data
();
71
72
virtual
libdap::Grid
*get_constrained_grid()
const
{
return
d_grid; }
73
};
74
75
}
// namespace functions
76
77
#endif
// _grid_geo_constraint_h
functions::GeoConstraint
Definition
GeoConstraint.h:96
functions::GridGeoConstraint
Definition
GridGeoConstraint.h:45
functions::GridGeoConstraint::GridGeoConstraint
GridGeoConstraint(libdap::Grid *grid)
Initialize GeoConstraint with a Grid.
Definition
GridGeoConstraint.cc:58
functions::GridGeoConstraint::apply_constraint_to_data
virtual void apply_constraint_to_data()
Definition
GridGeoConstraint.cc:264
libdap::Array
A multidimensional array of identical data types.
Definition
Array.h:121
libdap::Grid
Holds the Grid data type.
Definition
Grid.h:121
retired
geo
not_used
GridGeoConstraint.h
Generated by
1.12.0