30 theGeneralRasterInfo(src.theGeneralRasterInfo),
32 m_memoryMap(src.m_memoryMap)
201 <<
"ossimGeneralRasterElevHandler::getPostValue(const ossimIpt& gridPt): NEED TO IMPLEMENT TO NEW INTERFACE\n";
254 if(file.
trim() ==
"")
288 ossimNotify(
ossimNotifyLevel_WARN) <<
"ossimGeneralRasterElevHandler::initializeInfo WARNING:The number of bands are not specified in the header file" << std::endl;
311 std::string prefix =
"";
312 if ( kwl.
find(
"image0.type") )
356 void ossimGeneralRasterElevHandler::initializeList(
const ossimFilename& file)
360 theBoundingRectInfoList.
clear();
370 bool foundOne =
false;
371 if(dir.getFirst(file))
380 ossimGeneralRasterElevHandler::BoundingRectInfo info;
381 if(initializeInfo(info, file))
387 }
while(dir.getNext(file) &&
389 (count < maxCount)));
392 std::vector<ossimFilename> result;
394 dir.findAllFilesThatMatch(result,
399 ossimGeneralRasterElevHandler::BoundingRectInfo info;
401 for(idx = 0; idx < result.size(); ++idx)
410 if(theBoundingRectInfoList.size()>0)
417 ossimGeneralRasterElevHandler::BoundingRectInfo info;
458 double xt0 = xi - x0;
459 double yt0 = yi - y0;
463 double w00 = xt1*yt1;
464 double w01 = xt0*yt1;
465 double w10 = xt1*yt0;
466 double w11 = xt0*yt0;
469 if ( xi < 0 || yi < 0 ||
488 std::streampos offset = y0*bytesPerLine + x0*
sizeof(T);
536 cout <<
"\np00: " << p00
547 double sum_weights = w00 + w01 + w10 + w11;
551 return (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
589 double xt0 = xi - x0;
590 double yt0 = yi - y0;
594 double w00 = xt1*yt1;
595 double w01 = xt0*yt1;
596 double w10 = xt1*yt0;
597 double w11 = xt0*yt0;
598 if ( xi < 0 || yi < 0 ||
618 T v00 = *(
reinterpret_cast<T*
> (&
m_memoryMap[offset]));
619 T v01 = *(
reinterpret_cast<T*
> (&
m_memoryMap[offset +
sizeof(T)]));
620 T v10 = *(
reinterpret_cast<T*
> (&
m_memoryMap[offset2]));
621 T v11 = *(
reinterpret_cast<T*
> (&
m_memoryMap[offset2 +
sizeof(T)]));
644 cout <<
"\np00: " << p00
655 double sum_weights = w00 + w01 + w10 + w11;
659 return (p00*w00 + p01*w01 + p10*w10 + p11*w11) / sum_weights;
665 void ossimGeneralRasterElevHandler::addInfo(
const ossimGeneralRasterElevHandler::BoundingRectInfo& info)
667 if(theBoundingRectInfoList.empty())
669 theBoundingRectInfoList.push_back(info);
671 theBoundingRect = info.theBounds;
675 BoundingRectListType::iterator iter = theBoundingRectInfoList.begin();
679 while((iter!=theBoundingRectInfoList.end())&&
682 if(info.thePostSpacing.length() <= iter->thePostSpacing.length())
684 theBoundingRectInfoList.insert(iter, info);
685 theBoundingRect = theBoundingRect.combine(info.theBounds);
695 theBoundingRectInfoList.push_back(info);
double getHeightAboveMSLFileTemplate(T dummy, const ossimGeneralRasterElevHandler::GeneralRasterInfo &info, const ossimGpt &gpt)
void clear()
Erases the entire container.
bool pointWithin(const ossimDpt &pt, double epsilon=0.0) const
ossimScalarType theScalarType
std::ifstream m_inputStream
Represents serializable keyword/value map.
bool addFile(const char *file)
virtual bool setFilename(const ossimFilename &file)
double theNullHeightValue
bool open(const ossimFilename &file, bool memoryMapFlag=false)
Opens a stream to the srtm cell.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Attempts to initialize a transform and a projection given the KWL.
const char * find(const char *key) const
ossim_int64 fileSize() const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
double nan()
Method to return ieee floating point double precision NAN.
ossim_uint32 height() const
ossimFilename theFilename
const ossimIpt & ul() const
ossim_int32 bytesPerRawLine() const
Returns the number of bytes in a raw line.
static const ossimErrorCode OSSIM_ERROR
unsigned short ossim_uint16
virtual bool isOpen() const
const ossimIpt & ll() const
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
ossimByteOrder getImageDataByteOrder() const
double getHeightAboveMSLMemoryTemplate(T dummy, const ossimGeneralRasterElevHandler::GeneralRasterInfo &info, const ossimGpt &gpt)
virtual double getPostValue(const ossimIpt &gridPt) const
METHOD: getPostValue Returns the value at a given grid point as a double.
const ossimDatum * datum() const
datum().
ossimDrect getBoundingRect() const
This method does not really fit the handler since this handle a directory not a cell that could have ...
const ossimDatum * theDatum
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimRefPtr< ossimImageGeometry > theGeometry
ossimDrect theWgs84GroundRect
std::mutex m_inputStreamMutex
virtual bool pointHasCoverage(const ossimGpt &gpt) const
Loops through ossimGeneralRasterElevHandler::BoundingRectListType and checks for coverage.
bool localToWorld(const ossimDpt &local_pt, ossimGpt &world_pt) const
Exposes the 3D projection from image to world coordinates.
signed short ossim_sint16
ossimGeneralRasterElevHandler::GeneralRasterInfo theGeneralRasterInfo
unsigned long long ossim_uint64
unsigned int ossim_uint32
ossimDpt getMetersPerPixel() const
Returns the GSD associated with this image in the active projection.
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
virtual ~ossimGeneralRasterElevHandler()
destructor
ossimFilename theFilename
Virtual method for reading.
const ossimIpt & lr() const
static ossimString downcase(const ossimString &aString)
ossim_uint32 width() const
ossimErrorCode theErrorStatus
ossimByteOrder getSystemEndianType() const
const ossimIpt & ur() const
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual ossimIpt getSizeOfElevCell() const
METHOD: getSizeOfElevCell Returns the number of post in the cell.
virtual double getHeightAboveMSL(const ossimGpt &)
METHOD: getHeightAboveMSL Height access methods.
virtual ossimErrorCode getErrorStatus() const
bool m_streamOpen
true if stream is open.
virtual void setErrorStatus() const
const ossimGeneralRasterElevHandler::GeneralRasterInfo & generalRasterInfo() const
virtual void close()
Closes the stream to the file.
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
RTTI_DEF1(ossimGeneralRasterElevHandler, "ossimGeneralRasterElevHandler", ossimElevCellHandler)
const ossimImageMetaData & getImageMetaData() const
const ossimIrect & imageRect() const
Zero based rectangle of the valid image.
bool worldToLocal(const ossimGpt &world_pt, ossimDpt &local_pt) const
Exposes the 3D world-to-local image coordinate reverse projection.
ossim_float64 theNullHeightValue
std::vector< char > m_memoryMap
ossimByteOrder theByteOrder
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
ossimGeneralRasterElevHandler(const ossimFilename &file="")
static const char * FILENAME_KW
ossim_uint32 theBytesPerRawLine
ossim_int32 numberOfBands() const
Number of bands.
unsigned char ossim_uint8
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
signed long long ossim_sint64