/* Copyright (c) 2006 Alex Tingle This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "NASAGridSquare.h" NasaGridSquare::~NasaGridSquare() { if(data) unload(); } std::string NasaGridSquare::make_filename(const char* ext) const { using namespace std; char EW =(longitude>=0?'E':'W'); char NS =(latitude>=0?'N':'S'); stringstream ss; #ifdef ROOT_PATH static const char* root_path =ROOT_PATH; #else static const char* root_path =FloodUtils::getenvz("ROOT_PATH","."); #endif ss<>8 | datum<<8); INFO("493093: " << result); } zip_close(test); while(true) { fd=::open(filename,O_RDONLY); if(fd>=0) break; DEBUG_ONLY(int saved_errno =errno;) if(ENOENT!=errno || triedZipped || !FloodUtils::exists(gzipfile.c_str())) { DB("Failed to open file "< "<=num_cols || row>=num_rows) return NO_DATA; unsigned int i=( col + row * num_cols ); // unsigned short datum=((unsigned short*)data)[i]; // short result=(datum>>8 | datum<<8); unsigned short datum2=((unsigned short*)data2)[i]; short result2=(datum2>>8 | datum2<<8); // INFO("[" << i << "] result: " << result << ", result2: " << (int)result2); return result2; }