Added option to Locator to help specify here the locator value was defined from.

Update wrappers and Gdal plugin to use this new parameter
This commit is contained in:
Robert Osfield
2007-09-05 14:15:55 +00:00
parent 9e7a944639
commit a2447d493c
5 changed files with 305 additions and 275 deletions

View File

@@ -120,6 +120,11 @@ void DataSetLayer::setUpLocator()
0.0, 0.0, 1.0, 0.0,
geoTransform[0], geoTransform[3], 0.0, 1.0);
locator->setTransform(matrix);
locator->setDefinedInFile(true);
setLocator(locator.get());
}
else if (_dataset->GetGCPCount()>0 && _dataset->GetGCPProjection())
{
@@ -162,23 +167,15 @@ void DataSetLayer::setUpLocator()
adfDstGeoTransform[2], adfDstGeoTransform[5], 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
adfDstGeoTransform[0], adfDstGeoTransform[3], 0.0, 1.0);
locator->setTransform(matrix);
locator->setDefinedInFile(true);
setLocator(locator.get());
}
else
{
osg::notify(osg::NOTICE) << " No GeoTransform or GCP's - unable to compute position in space"<< std::endl;
matrix.set( 1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0);
}
osg::notify(osg::NOTICE)<<"Matrix = "<<matrix<<std::endl;
// need to invert y and scale by pixel size.
locator->setTransform(matrix);
setLocator(locator.get());
}