Skip to content
Snippets Groups Projects
Commit 9a2eddcc authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: enabled setting of the resolution through the otbMapProjectionAdapter

parent 6528e31c
Branches
Tags
No related merge requests found
...@@ -327,6 +327,17 @@ void MapProjectionAdapter::ApplyParametersToProjection() ...@@ -327,6 +327,17 @@ void MapProjectionAdapter::ApplyParametersToProjection()
ossimGpt origin(originY, originX, originZ, datum); ossimGpt origin(originY, originX, originZ, datum);
projection->setOrigin(origin); projection->setOrigin(origin);
} }
// Set up resolution
StoreType::const_iterator itResMeterX = m_ParameterStore.find("MetersPerPixelX");
StoreType::const_iterator itResMeterY = m_ParameterStore.find("MetersPerPixelY");
if (itResMeterX != m_ParameterStore.end() && itResMeterY != m_ParameterStore.end())
{
double resMeterX = atof((*itResMeterX).second.c_str());
double resMeterY = atof((*itResMeterY).second.c_str());
ossimDpt resMeter(resMeterX, resMeterY);
projection->setMetersPerPixel(resMeter);
}
// Apply parameters to LambertConformalConic // Apply parameters to LambertConformalConic
if (projectionName.compare("ossimLambertConformalConicProjection") == 0) if (projectionName.compare("ossimLambertConformalConicProjection") == 0)
......
...@@ -104,6 +104,9 @@ int otbMapProjection(int argc, char* argv[]) ...@@ -104,6 +104,9 @@ int otbMapProjection(int argc, char* argv[])
// Moving to GenericMapProjection, change the access // Moving to GenericMapProjection, change the access
lUtmProjection->SetParameter("MetersPerPixelX", "1");
lUtmProjection->SetParameter("MetersPerPixelY", "1");
file << "\n\n *** Test accessors *** \n\n"; file << "\n\n *** Test accessors *** \n\n";
file << std::setprecision(15); file << std::setprecision(15);
file << "Origin: \t" << lUtmProjection->GetParameter("Origin") << std::endl; file << "Origin: \t" << lUtmProjection->GetParameter("Origin") << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment