Skip to content
Snippets Groups Projects
Commit 5a5dfd9f authored by Cyrille Valladeau's avatar Cyrille Valladeau
Browse files

ENH : correct header data type + file write number of characters

parent 6d219814
Branches
Tags
No related merge requests found
...@@ -50,8 +50,7 @@ int otbOssimElevManagerTest4(int argc,char* argv[]) ...@@ -50,8 +50,7 @@ int otbOssimElevManagerTest4(int argc,char* argv[])
size[1]= atoi(argv[8]); size[1]= atoi(argv[8]);
double* image = new double[size[0]*size[1]]; double* image = new double[size[0]*size[1]];
ossimElevManager * elevManager = ossimElevManager::instance(); ossimElevManager * elevManager = ossimElevManager::instance();
elevManager->openDirectory(srtmDir); elevManager->openDirectory(srtmDir);
...@@ -68,7 +67,7 @@ int otbOssimElevManagerTest4(int argc,char* argv[]) ...@@ -68,7 +67,7 @@ int otbOssimElevManagerTest4(int argc,char* argv[])
ossimWorldPoint.lon=point[0]; ossimWorldPoint.lon=point[0];
ossimWorldPoint.lat=point[1]; ossimWorldPoint.lat=point[1];
double height = elevManager->getHeightAboveMSL(ossimWorldPoint); double height = elevManager->getHeightAboveMSL(ossimWorldPoint);
if (!ossim::isnan(height)) if (!ossim::isnan(height))
{ {
// Fill the image // Fill the image
...@@ -83,9 +82,10 @@ int otbOssimElevManagerTest4(int argc,char* argv[]) ...@@ -83,9 +82,10 @@ int otbOssimElevManagerTest4(int argc,char* argv[])
} }
std::ofstream file; std::ofstream file;
std::cout<<outfname<<std::endl;
file.open(outfname, ios::binary|ios::out); file.open(outfname, ios::binary|ios::out);
file.write(reinterpret_cast<char*>(image), sizeof(image)*size[0]*size[1]); file.write(reinterpret_cast<char*>(image), sizeof(double)*size[0]*size[1]);
file.close(); file.close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment