65 #include "DAP_Dataset.h" 66 #include "reproj_functions.h" 74 double w32strtod(
const char *,
char **);
90 void function_swath2array(
int argc, BaseType * argv[], DDS &, BaseType **btpp)
92 DBG(cerr <<
"Entering function_swath2array..." << endl);
95 string info = string(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
96 +
"<function name=\"swath2array\" version=\"1.0\" href=\"http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid\">\n" 100 Str *response =
new Str(
"info");
101 response->set_value(info);
109 throw Error(
"The function swath2array() requires three arguments. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
111 Array *src =
dynamic_cast<Array*
>(argv[0]);
113 throw Error(
"The first argument to swath2array() must be a data array. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
115 Array *lat =
dynamic_cast<Array*
>(argv[1]);
117 throw Error(
"The second argument to swath2array() must be a latitude array. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
119 Array *lon =
dynamic_cast<Array*
>(argv[2]);
121 throw Error(
"The third argument to swath2array() must be a longitude array. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
125 DAP_Dataset ds(src, lat, lon);
128 ds.InitialDataset(0);
130 *btpp = ds.GetDAPArray();
133 DBG(cerr <<
"caught Error: " << e.get_error_message() << endl);
137 DBG(cerr <<
"caught unknown exception" << endl);
152 void function_swath2grid(
int argc, BaseType * argv[], DDS &, BaseType **btpp)
154 DBG(cerr <<
"Entering function_swath2grid..." << endl);
156 string info = string(
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
157 +
"<function name=\"swath2grid\" version=\"1.0\" href=\"http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid\">\n" 161 Str *response =
new Str(
"info");
162 response->set_value(info);
170 throw Error(
"The function swath2grid() requires three arguments. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
172 Array *src =
dynamic_cast<Array*
>(argv[0]);
174 throw Error(
"The first argument to swath2grid() must be a data array. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
176 Array *lat =
dynamic_cast<Array*
>(argv[1]);
178 throw Error(
"The second argument to swath2grid() must be a latitude array. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
180 Array *lon =
dynamic_cast<Array*
>(argv[2]);
182 throw Error(
"The third argument to swath2grid() must be a longitude array. See http://docs.opendap.org/index.php/Server_Side_Processing_Functions#swath2grid");
186 DAP_Dataset ds(src, lat, lon);
189 ds.InitialDataset(0);
191 *btpp = ds.GetDAPGrid();
194 DBG(cerr <<
"caught Error: " << e.get_error_message() << endl);
198 DBG(cerr <<
"caught unknown exception" << endl);