本文整理汇总了C++中Projection::LocalRadius方法的典型用法代码示例。如果您正苦于以下问题:C++ Projection::LocalRadius方法的具体用法?C++ Projection::LocalRadius怎么用?C++ Projection::LocalRadius使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Projection
的用法示例。
在下文中一共展示了Projection::LocalRadius方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtractLatLonRange
//.........这里部分代码省略.........
}
}
/**
* If the lat/lon cannot be determined from the point, then we need to calculate
* lat/lon on our own
*/
else if( ui.WasEntered("FROMLIST") ) {
// Find a cube in the Control Point to get the lat/lon from
int cm = 0;
iString sn = "";
double lat = 0.0;
double lon = 0.0;
double radius = 0.0;
// First check the reference Measure
if( outNet[cp].HasReference() ) {
cm = outNet[cp].ReferenceIndex();
if( !sn2filename[outNet[cp][cm].CubeSerialNumber()].empty() ) {
sn = outNet[cp][cm].CubeSerialNumber();
}
}
// Search for other Control Measures if needed
if( sn.empty() ) {
// Find the Serial Number if it exists
for( int cm = 0; (cm < outNet[cp].Size()) && sn.empty(); cm ++ ) {
if( !sn2filename[outNet[cp][cm].CubeSerialNumber()].empty() ) {
sn = outNet[cp][cm].CubeSerialNumber();
}
}
}
// Connot fine a cube to get the lat/lon from
if( sn.empty() ) {
cannotGenerateLatLonPoints += outNet[cp].Id();
outNet.Delete( cp );
}
// Calculate the lat/lon and check for validity
else {
bool remove = false;
Cube *cube = manager.OpenCube( sn2filename[sn] );
Camera *camera = cube->Camera();
if (camera == NULL) {
try {
Projection *projection = ProjectionFactory::Create( (*(cube->Label())) );
if(!projection->SetCoordinate(outNet[cp][cm].Sample(),outNet[cp][cm].Line())) {
nonLatLonPoints += outNet[cp].Id();
remove = true;
}
lat = projection->Latitude();
lon = projection->Longitude();
radius = projection->LocalRadius();
delete projection;
projection = NULL;
} catch ( iException &e ) {
remove = true;
e.Clear();
}
}
else {
if(!camera->SetImage(outNet[cp][cm].Sample(),outNet[cp][cm].Line())) {
nonLatLonPoints += outNet[cp].Id();
remove = true;
}
lat = camera->UniversalLatitude();
lon = camera->UniversalLongitude();
radius = camera->LocalRadius();
camera = NULL;
}
cube = NULL;
if( remove || NotInLatLonRange( lat, lon, minlat, maxlat, minlon, maxlon ) ) {
nonLatLonPoints += outNet[cp].Id();
outNet.Delete( cp );
}
else { // Add the reference lat/lon/radius to the Control Point
outNet[cp].SetUniversalGround( lat, lon, radius );
}
}
}
else {
cannotGenerateLatLonPoints += outNet[cp].Id();
outNet.Delete( cp );
}
}
manager.CleanCubes();
}
示例2: IsisMain
//.........这里部分代码省略.........
}
if (mapObject.hasKeyword("CENTER_LONGITUDE")) {
PvlKeyword ¢erLon = mapObject["CENTER_LONGITUDE"];
// if (centerLon[0] == "N/A") centerLon = -9998;
if (centerLon[0] == "N/A") mapObject.deleteKeyword("CENTER_LONGITUDE");
}
if (mapObject.hasKeyword("REFERENCE_LATITUDE")) {
PvlKeyword &refLat = mapObject["REFERENCE_LATITUDE"];
// if (refLat[0] == "N/A") refLat = -9998;
if (refLat[0] == "N/A") mapObject.deleteKeyword("REFERENCE_LATITUDE");
}
if (mapObject.hasKeyword("REFERENCE_LONGITUE")) {
PvlKeyword &refLon = mapObject["REFERENCE_LONGITUDE"];
// if (refLon[0] == "N/A") refLon = -9998;
if (refLon[0] == "N/A") mapObject.deleteKeyword("REFERENCE_LONGITUDE");
}
if (mapObject.hasKeyword("FIRST_STANDARD_PARALLEL")) {
PvlKeyword &firstSP = mapObject["FIRST_STANDARD_PARALLEL"];
// if (firstSP[0] == "N/A") firstSP = -9998;
if (firstSP[0] == "N/A") mapObject.deleteKeyword("FIRST_STANDARD_PARALLEL");
}
if (mapObject.hasKeyword("SECOND_STANDARD_PARALLEL")) {
PvlKeyword &secondSP = mapObject["SECOND_STANDARD_PARALLEL"];
// if (secondSP[0] == "N/A") secondSP = -9998;
if (secondSP[0] == "N/A") mapObject.deleteKeyword("SECOND_STANDARD_PARALLEL");
}
// For Equirectangular ONLY
// Modify the radii in the pds label to use the radius at the center latitude
// instead of the target radii from NAIF
if (mapObject["MAP_PROJECTION_TYPE"][0] == "EQUIRECTANGULAR") {
Projection *proj = ProjectionFactory::CreateFromCube(*icube2);
PvlGroup &mapping = icube2->label()->findGroup("MAPPING", Pvl::Traverse);
double radius = proj->LocalRadius((double)mapping["CenterLatitude"]) / 1000.0;
mapObject["A_AXIS_RADIUS"].setValue(toString(radius), "KM");
mapObject["B_AXIS_RADIUS"].setValue(toString(radius), "KM");
mapObject["C_AXIS_RADIUS"].setValue(toString(radius), "KM");
}
projName = mapObject["MAP_PROJECTION_TYPE"][0];
}
// Calculate the min/max per band keywords
// These come from the input real DN and are converted to the PDS file DN
// The input to output mapping is opposite from the one above
double slope = (p.GetOutputMaximum() - p.GetOutputMinimum()) / (maxmax - minmin);
double intercept = p.GetOutputMaximum() - slope * maxmax;
PvlKeyword minimum("MRO:MINIMUM_STRETCH", toString(slope * g_min[0] + intercept));
PvlKeyword maximum("MRO:MAXIMUM_STRETCH", toString(slope * g_max[0] + intercept));
for (int band = 1; band < icube2->bandCount(); ++band) {
minimum += toString(slope * g_min[band] + intercept);
maximum += toString(slope * g_max[band] + intercept);
}
if (enctype.Equal("jp2")) {
// Add keywords to the PDS JP2 IMAGE object
PvlObject &imagejp2 = pdsLabel.findObject("UNCOMPRESSED_FILE").findObject("IMAGE");
// Add the HiRISE specific description of the IMAGE object
imagejp2 += PvlKeyword("DESCRIPTION", "HiRISE projected and mosaicked product");
// Add the SCALLING_FACTOR and OFFSET keywords
imagejp2.addKeyword(PvlKeyword("SCALING_FACTOR", toString(slope)), Pvl::Replace);
imagejp2.addKeyword(PvlKeyword("OFFSET", toString(intercept)), Pvl::Replace);
// Reformat some keyword units in the image object