diff --git a/examples/osgdem/DataSet.cpp b/examples/osgdem/DataSet.cpp index ee86c6b8e..93893cdec 100644 --- a/examples/osgdem/DataSet.cpp +++ b/examples/osgdem/DataSet.cpp @@ -438,34 +438,19 @@ void DataSet::SourceData::readHeightField(DestinationData& destination) unsigned int numBytesPerZvalue = 4; int lineSpace=-(hf->getNumColumns()*numBytesPerZvalue); //and work down (note - sign) + std::cout<<"reading height field"<RasterIO(GF_Read,windowX,_numValuesY-(windowY+windowHeight),windowWidth,windowHeight,floatdata,destWidth,destHeight,GDT_Float32,numBytesPerZvalue,lineSpace); - bool doFlip = false; - if (doFlip) - { - // now need to flip since the OSG's origin is in lower left corner. - std::cout<<"flipping"<getNumRows()-1; - for(unsigned int r=0;rgetNumColumns();++c) - { - float temp = hf->getHeight(c,r); - hf->setHeight(c,r,hf->getHeight(c,copy_r)*heightRatio); - hf->setHeight(c,copy_r,temp*heightRatio); - } - } - } - else - { - for(int r=destY;rsetHeight(c,r,hf->getHeight(c,r)*heightRatio); - } - } - } + std::cout<<" scaling height field"<getHeight(c,r)==0.0) std::cout<<"."; +// else std::cout<<"** "<getHeight(c,r)<<" **"<setHeight(c,r,hf->getHeight(c,r)*heightRatio); + } + } } @@ -515,7 +500,7 @@ bool DataSet::Source::needReproject(const osgTerrain::CoordinateSystem* cs, doub if (_sourceData->_hasGCPs) return true; bool csTheSame = (_sourceData->_cs == cs) || - (_sourceData->_cs.valid() && cs && (*(_sourceData->_cs) != *cs)); + (_sourceData->_cs.valid() && cs && (*(_sourceData->_cs) == *cs)); if (!csTheSame) return true; @@ -541,18 +526,12 @@ DataSet::Source* DataSet::Source::doReproject(const std::string& filename, osgTe std::cout<<"reprojecting to file "<_cs.valid()) { _coordinateSystem = sd->_cs; + std::cout<<"Setting coordinate system to "<<_coordinateSystem->getProjectionRef()<get(); - source->buildOverviews(); + //source->buildOverviews(); } }