Commit 6f1fb86c authored by Robert Butora's avatar Robert Butora
Browse files

fixes overlap calc in SQL-query to use GALACTIC vs ICRS correctly

parent 450bc14c
Loading
Loading
Loading
Loading
+43 −38
Original line number Diff line number Diff line
@@ -75,8 +75,15 @@ public class DbPSearch
	   }


	   String theQuery ="SELECT obs_publisher_did FROM obscore WHERE (" + inputRegion + "  && polygon_region_galactic)";

      String theQuery;
      if(coord.skySystem.equals("GALACTIC"))
      {
         theQuery ="SELECT obs_publisher_did FROM obscore WHERE (" + inputRegion + "  && polygon_region_galactic)";
      }
      else
      {
         theQuery ="SELECT obs_publisher_did FROM obscore WHERE (" + inputRegion + "  && polygon_region)";
      }

      if(vel_valid)
      {
@@ -196,18 +203,16 @@ public class DbPSearch
      String commaSepPubdids  = String.join("\',\'", pubdidArr);


      String theQuery;
      //String theQuery ="SELECT dataproduct_type,obs_publisher_did,obs_collection,polygon_region_galactic,access_url,em_min,em_max," 

      // FIXME coord sys read from somwehere
      if(true)
      { // GALACTIC
      String theQuery;
      if(coord.skySystem.equals("GALACTIC"))
      {
         theQuery ="SELECT *," 
            + inputRegion + " <@ polygon_region_galactic AS inputInsideDb, " 
            + inputRegion + " @> polygon_region_galactic AS dbInsideInput FROM obscore WHERE (obs_publisher_did IN (\'"+commaSepPubdids+"\'))";
      }
      else
      { // ICRS
      {
         theQuery ="SELECT *," 
            + inputRegion + " <@ polygon_region AS inputInsideDb, " 
            + inputRegion + " @> polygon_region AS dbInsideInput FROM obscore WHERE (obs_publisher_did IN (\'"+commaSepPubdids+"\'))";