[osg-submissions] Fix georeference of gdal plugin
Robert Osfield
robert.osfield at gmail.com
Tue Dec 11 05:58:48 PST 2007
HI Cedric,
Could you provide work flow which illustrates the problem you've seen
so I can recreate at me end.
I don't believe your changes are wholly appropriate, and perhaps miss
the point of the some of the code, this code might be buggy... but
does have a purpose.
Cheers,
Robert.
On Dec 8, 2007 2:36 PM, Cedric Pinson <mornifle at plopbyte.net> wrote:
> Hi Robert,
> Here a patch for gdal reader, it did not take the georeference
> correctly. I added a diff to show you the difference. with my fix it
> works as expected for a tiff georeferenced.
>
>
> diff for info:
> 0a1,9
> > /**
> > * Who is the original author ???
> > *
> > *
> > * Modified (2007)
> > *
> > * Authors:
> > * Cedric Pinson <mornifle at plopbyte.net>
> > */
> 666c675
> < TopLeft[1] = geoTransform[1];
> ---
> > TopLeft[1] = geoTransform[3];
> 736c745
> <
> ---
> >
> 738,739c747,748
> < osg::notify(osg::INFO)<<"flipping"<<std::endl;
> < unsigned int copy_r = hf->getNumRows()-1;
> ---
> > osg::notify(osg::INFO)<<"flipping"<<std::endl;
> > unsigned int copy_r = hf->getNumRows()-1;
> 742,751c751,760
> < for(unsigned int c=0;c<hf->getNumColumns();++c)
> < {
> < float temp = hf->getHeight(c,r);
> < hf->setHeight(c,r,hf->getHeight(c,copy_r));
> < 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);
> ---
> > for(unsigned int c=0;c<hf->getNumColumns();++c)
> > {
> > float temp = hf->getHeight(c,r);
> > hf->setHeight(c,r,hf->getHeight(c,copy_r));
> > hf->setHeight(c,copy_r,temp);
> > }
> > }
> > hf->setOrigin(osg::Vec3(TopLeft[0],BottomLeft[1],-100));
> > hf->setXInterval(geoTransform[1]);
> > hf->setYInterval(-geoTransform[5]);
>
> Cheers
>
> --
> +33 (0) 6 63 20 03 56 Cedric Pinson mailto:mornifle at plopbyte.net http://www.plopbyte.net
>
>
>
> _______________________________________________
> osg-submissions mailing list
> osg-submissions at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
More information about the osg-submissions
mailing list