Commit b6dceca2 authored by Ian Humphrey's avatar Ian Humphrey
Browse files

Fixed cnetextract's latlon test case by modifying cnetextract.cpp. Modified...

Fixed cnetextract's latlon test case by modifying cnetextract.cpp. Modified the conditional statements in ExtractLatLonRange() to properly check the serial number filename map. Also, modified ExtractLatLonRange()'s signature so that the QVector's used in the output summary are passed-by-reference out parameters.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@7145 41f8697f-d340-4b68-9986-7bafba869bb8
parent e80e8ec4
Loading
Loading
Loading
Loading
+22 −15
Original line number Diff line number Diff line
@@ -32,8 +32,8 @@ using namespace std;
using namespace Isis;

void ExtractPointList(ControlNet &outNet, QVector<QString> &nonListedPoints);
void ExtractLatLonRange(ControlNet &outNet, QVector<QString> nonLatLonPoints,
                        QVector<QString> cannotGenerateLatLonPoints,
void ExtractLatLonRange(ControlNet &outNet, QVector<QString> &nonLatLonPoints,
                        QVector<QString> &cannotGenerateLatLonPoints,
                        QMap<QString, QString> sn2filename);
bool NotInLatLonRange(SurfacePoint surfacePt, Latitude minlat,
                      Latitude maxlat, Longitude minlon, Longitude maxlon);
@@ -564,18 +564,26 @@ void ExtractPointList(ControlNet &outNet, QVector<QString> &nonListedPoints) {


/**
 * Removes control points not in the lat/lon range provided in the unput
 * Removes control points not in the lat/lon range provided in the input
 * parameters.
 *
 * @param outNet The output control net being removed from
 * @param noLanLonPoint The keyword recording all of the control points removed
 *                      due to the provided lat/lon range
 * @param noLanLonPoint The keyword recording all of the control points removed
 *                      due to the inability to calculate the lat/lon for that
 *                      point
 * @param outNet[in] The output control net being removed from
 * @param noLanLonPoint[out] The keyword recording all of the control points removed
 *            due to the control point being out of the lat/lon range.
 * @param cannotGenerateLatLonPoints[out] The keyword recording all of the control points removed
 *            due to the inability to find a cube to calculate the lat/lon for that point.
 * @param sn2filename[in] QMap that maps the serial numbers to (input) file names.
 * 
 * @internal
 *   @history 2016-09-29 Ian Humphrey - Reverted r6597, which had reveresed the logic for
 *                           checking the reference measure and other measures (see lines 635,643).
 *                           Modified the QVector parameters to be pass-by-reference OUT parameters,
 *                           since the cnetextract main uses them for summary output.
 */
void ExtractLatLonRange(ControlNet &outNet, QVector<QString> nonLatLonPoints,
                        QVector<QString> cannotGenerateLatLonPoints,  QMap<QString, QString> sn2filename) {
void ExtractLatLonRange(ControlNet &outNet, 
                        QVector<QString> &nonLatLonPoints,
                        QVector<QString> &cannotGenerateLatLonPoints,  
                        QMap<QString, QString> sn2filename) {
  if(outNet.GetNumPoints() == 0) {
    return;
  }
@@ -624,8 +632,7 @@ void ExtractLatLonRange(ControlNet &outNet, QVector<QString> nonLatLonPoints,
      Distance radius;

      // First check the reference Measure
      //if(!sn2filename[controlPt[cm].GetCubeSerialNumber()].length() == 0) {
      if(!sn2filename[controlPt->GetReferenceSN()].length()) {
      if(sn2filename[controlPt->GetReferenceSN()].length() != 0) {
        sn = controlPt->GetReferenceSN();
      }

@@ -633,13 +640,13 @@ void ExtractLatLonRange(ControlNet &outNet, QVector<QString> nonLatLonPoints,
      if(sn.isEmpty()) {
        // Find the Serial Number if it exists
        for(int cm = 0; (cm < controlPt->GetNumMeasures()) && sn.isEmpty(); cm ++) {
          if(!sn2filename[controlPt->GetReferenceSN()].length()) {
          if(sn2filename[controlPt->GetReferenceSN()].length() != 0) {
            sn = controlPt->GetReferenceSN();
          }
        }
      }

      // Connot fine a cube to get the lat/lon from
      // Cannot find a cube to get the lat/lon from
      if(sn.isEmpty()) {
        cannotGenerateLatLonPoints.push_back(controlPt->GetId());
        omit(outNet, cp);
+5 −0
Original line number Diff line number Diff line
@@ -275,6 +275,11 @@
      removed redundant boolean statement (len == 0) which caused warnings in clang.
      Part of porting to OS X 10.11. 
    </change>
    <change name="Ian Humphrey" date="2016-09-29">
      When using LATLON=true, control points that are out of the specified latitude and longitude
      ranges will now be properly recorded into the approriate output text files. See the internal
      history for cnetextract.cpp's ExtractLatLonRange() for more detailed change information.
    </change>
  </history>

  <category>
+5 −5
Original line number Diff line number Diff line
@@ -18,8 +18,8 @@ commands:
	  minlat=15.0 \
	  maxlat=28.0 \
	  minlon=20.0 \
	  maxlon=28.0;# \
#	  > /dev/null;
#	$(SED) 's+/.*/input/+input/+' $(OUTPUT)/newList.lis > $(OUTPUT)/newList.txt;
#	$(RM) $(OUTPUT)/newList.lis;
#	$(RM) $(OUTPUT)/list.lis;
	  maxlon=28.0 \
	  > /dev/null;
	$(SED) 's+/.*/input/+input/+' $(OUTPUT)/newList.lis > $(OUTPUT)/newList.txt;
	$(RM) $(OUTPUT)/newList.lis;
	$(RM) $(OUTPUT)/list.lis;