Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
......@@ -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+"\'))";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment