From f4b549ba8f60808a0fb27e189f913cb9e519241f Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 7 Aug 2007 14:49:37 +0000 Subject: [PATCH] From Luc Fruciel, "Gdal plugins reads lots of information that is not taken into account in ReadHeigthField for example. Attached a modification that read the HeigthField position and X,Yintervals. I also removed the limitation to 1024*1024 to 4096*4096, because when you are preprocessing your data with OSG, it can be useful to read large images/heigthfields. Is there a reason (other than hardware limitations for textures) for this limit ?" --- src/osgPlugins/gdal/ReaderWriterGDAL.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp index 0fcb33c7f..5c3805523 100644 --- a/src/osgPlugins/gdal/ReaderWriterGDAL.cpp +++ b/src/osgPlugins/gdal/ReaderWriterGDAL.cpp @@ -76,8 +76,8 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter int destX = 0; int destY = 0; - int destWidth = osg::minimum(dataWidth,1024); - int destHeight = osg::minimum(dataHeight,1024); + int destWidth = osg::minimum(dataWidth,4096); + int destHeight = osg::minimum(dataHeight,4096); // int destWidth = osg::minimum(dataWidth,4096); // int destHeight = osg::minimum(dataHeight,4096); @@ -530,8 +530,8 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter int destX = 0; int destY = 0; - int destWidth = osg::minimum(dataWidth,1024); - int destHeight = osg::minimum(dataHeight,1024); + int destWidth = osg::minimum(dataWidth,4096); + int destHeight = osg::minimum(dataHeight,4096); osgDB::ImageOptions::TexCoordRange* texCoordRange = 0; @@ -711,7 +711,9 @@ class ReaderWriterGDAL : public osgDB::ReaderWriter hf->setHeight(c,copy_r,temp); } } - + hf->setOrigin(osg::Vec3(BottomLeft[0],-BottomLeft[1],0)); + hf->setXInterval((BottomRight[0]-BottomLeft[0])/destWidth); + hf->setYInterval((TopLeft[1]-BottomLeft[1])/destHeight); return hf; }