From 1781d7df18b5e546002cf9ad779163143b75e417 Mon Sep 17 00:00:00 2001
From: acpaquette <acpaquette@usgs.gov>
Date: Thu, 30 Mar 2023 13:10:27 -0700
Subject: [PATCH] Removed get functions in favor of the ones in ALE

---
 include/usgscsm/Utilities.h             |  4 ----
 src/UsgsAstroProjectedLsSensorModel.cpp |  4 ++--
 src/Utilities.cpp                       | 22 ----------------------
 3 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/include/usgscsm/Utilities.h b/include/usgscsm/Utilities.h
index a661a35..f110629 100644
--- a/include/usgscsm/Utilities.h
+++ b/include/usgscsm/Utilities.h
@@ -199,10 +199,6 @@ void applyRotationTranslationToXyzVec(ale::Rotation const& r, ale::Vec3d const&
 // to a calendar time string, such as 2000-01-01T00:16:40Z.
 std::string ephemTimeToCalendarTime(double ephemTime);
 
-std::vector<double> getGeoTransform(nlohmann::json isd);
-
-std::string getProjectionString(nlohmann::json isd);
-
 std::vector<double> pixelToMeter(double line, double sample, std::vector<double> geoTransform);
 
 std::vector<double> meterToPixel(double meter_x, double meter_y, std::vector<double> geoTransform);
diff --git a/src/UsgsAstroProjectedLsSensorModel.cpp b/src/UsgsAstroProjectedLsSensorModel.cpp
index b08de14..4dfed48 100644
--- a/src/UsgsAstroProjectedLsSensorModel.cpp
+++ b/src/UsgsAstroProjectedLsSensorModel.cpp
@@ -775,8 +775,8 @@ std::string UsgsAstroProjectedLsSensorModel::constructStateFromIsd(
   json lsState = json::parse(UsgsAstroLsSensorModel::constructStateFromIsd(imageSupportData, warnings));
   json state = json::parse(imageSupportData);
 
-  lsState["m_geoTransform"] = getGeoTransform(state);
-  lsState["m_projString"] = getProjectionString(state);
+  lsState["m_geoTransform"] = ale::getGeoTransform(state);
+  lsState["m_projString"] = ale::getProjectionString(state);
   MESSAGE_LOG(
       spdlog::level::trace,
       "m_geoTransform: {} "
diff --git a/src/Utilities.cpp b/src/Utilities.cpp
index 039885d..5599c25 100644
--- a/src/Utilities.cpp
+++ b/src/Utilities.cpp
@@ -1529,28 +1529,6 @@ std::string ephemTimeToCalendarTime(double ephemTime) {
   return buffer;
 }
 
-std::vector<double> getGeoTransform(json isd) {
-  std::vector<double> transform = {};
-  try {
-    transform = isd.at("geo_transform").get<std::vector<double>>();
-  } catch (std::exception &e) {
-    std::string originalError = e.what();
-    std::string msg = "Could not parse the geo_transform. ERROR: " + originalError + isd.dump();
-    throw std::runtime_error(msg);
-  }
-  return transform;
-}
-
-std::string getProjectionString(json isd) {
-  std::string projection_string = "";
-  try {
-    projection_string = isd.at("proj_string");
-  } catch (...) {
-    throw std::runtime_error("Could not parse the projection string.");
-  }
-  return projection_string;
-}
-
 std::vector<double> pixelToMeter(double line, double sample, std::vector<double> geoTransform) {
   double meter_x = (sample * geoTransform[1]) + geoTransform[0];
   double meter_y = (line * geoTransform[5]) + geoTransform[3];
-- 
GitLab