13 if(theHeader.readHeader(file))
17 theInputFile.open(file.
c_str(), ios::in|ios::binary);
19 theBoundingRect = theHeader.getBoundingRect();
20 theLatLonOrigin.lat = theHeader.getMinY();
21 theLatLonOrigin.lon = theHeader.getMinX();
24 return theInputFile.good();
26 theFileOkFlag =
false;
40 if(pointWithin(lat, lon))
42 double x = (lon - theLatLonOrigin.lon)/(
double)theHeader.getDeltaX();
43 double y = (lat - theLatLonOrigin.lat)/(
double)theHeader.getDeltaY();
50 int rows = theHeader.getNumberOfRows();
51 int cols = theHeader.getNumberOfCols();
53 if(lat1 >= rows) lat1 = lat0;
54 if(lon1 >= cols) lon1 = lon0;
56 double tLat =
y - lat0;
57 double tLon =
x - lon0;
59 int offset00 = lat0*theHeader.getBytesPerRow() + lon0*4 + theHeader.getStartOffset();
60 int offset01 = lat0*theHeader.getBytesPerRow() + lon1*4 + theHeader.getStartOffset();
61 int offset11 = lat1*theHeader.getBytesPerRow() + lon1*4 + theHeader.getStartOffset();
62 int offset10 = lat1*theHeader.getBytesPerRow() + lon0*4 + theHeader.getStartOffset();
70 theInputFile.seekg((std::streampos)offset00);
71 theInputFile.read((
char*)&v00, 4);
72 theInputFile.seekg((std::streampos)offset01);
73 theInputFile.read((
char*)&v01, 4);
74 theInputFile.seekg((std::streampos)offset11);
75 theInputFile.read((
char*)&v11, 4);
76 theInputFile.seekg((std::streampos)offset10);
77 theInputFile.read((
char*)&v10, 4);
88 double top = (double)v00 + ((
double)v01 - (double)v00)*tLon;
89 double bottom = (double)v10 + ((
double)v11 - (double)v10)*tLon;
91 result = top + (bottom-top)*tLat;
99 return theBoundingRect.pointWithin(
ossimDpt(lon, lat));
double nan()
Method to return ieee floating point double precision NAN.
ossimByteOrder getSystemEndianType() const
double getShiftAtLatLon(double lat, double lon) const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
bool open(const ossimFilename &file)
bool pointWithin(double lat, double lon) const