Commit b6fc0226 authored by Makayla Shepherd's avatar Makayla Shepherd
Browse files

isis2pds and hidtmgen will no longer crash if the keyword MaximumLongitude...

isis2pds and hidtmgen will no longer crash if the keyword MaximumLongitude does not exist in the Mapping group label. Fixes #947.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6298 41f8697f-d340-4b68-9986-7bafba869bb8
parent b80dc42f
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -753,18 +753,18 @@ namespace Isis {
    PvlKeyword &isisLonDir = inputMapping.findKeyword("LongitudeDirection");
    QString lonDir = isisLonDir[0];
    lonDir = lonDir.toUpper();
    if(lonDir == "POSITIVEEAST") {
    if (inputMapping.hasKeyword("MaximumLongitude") && inputMapping.hasKeyword("MinimumLongitude")) {
      double maxLon = inputMapping.findKeyword("MaximumLongitude");
      pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", toString(maxLon));
      double minLon = inputMapping.findKeyword("MinimumLongitude");
      if(lonDir == "POSITIVEEAST") {
        pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", toString(maxLon));
        pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", toString(minLon));
      }
      else {
      double minLon = inputMapping.findKeyword("MinimumLongitude");
        pdsMapObj += PvlKeyword("EASTERNMOST_LONGITUDE", toString(minLon));
      double maxLon = inputMapping.findKeyword("MaximumLongitude");
        pdsMapObj += PvlKeyword("WESTERNMOST_LONGITUDE", toString(maxLon));
      }
    }

    // Add the LINE_PROJECTION_OFFSET and SAMPLE_PROJECTION_OFFSET keywords
    // These keywords are the distance from the origin of the image to the
+3 −0
Original line number Diff line number Diff line
@@ -116,6 +116,8 @@ void IsisMain() {
    mapping.findKeyword("C_AXIS_RADIUS").setUnits("KM");
  }
  else if (mapping["MAP_PROJECTION_TYPE"][0] == "POLAR STEREOGRAPHIC") {
    if (mapping.hasKeyword("MAXIMUM_LATITUDE") && mapping.hasKeyword("MAXIMUM_LATITUDE") &&
        mapping.hasKeyword("EASTERNMOST_LONGITUDE") && mapping.hasKeyword("WESTERNMOST_LONGITUDE")) {
      double clat = ((toDouble(mapping["MAXIMUM_LATITUDE"][0]) -
                    toDouble(mapping["MINIMUM_LATITUDE"][0]) ) / 2) +
                    toDouble(mapping["MINIMUM_LATITUDE"][0]) ;
@@ -140,6 +142,7 @@ void IsisMain() {
        northAzimuth = -(360.00 - (270.00 + clon));
      }
    }
  }
  // Unsupported projection
  else {
    QString msg = "The projection type [" +