Skip to content
Snippets Groups Projects
Commit 09bc6463 authored by Robert Butora's avatar Robert Butora
Browse files

adds missing implementation of POLYGON to SQL query in DbPSearch

parent 142bfea0
Branches
Tags
No related merge requests found
...@@ -71,19 +71,25 @@ public class DbPSearch ...@@ -71,19 +71,25 @@ public class DbPSearch
inputRegion = "sbox '( ("+ sw_lon + "d, " + sw_lat + "d), (" + ne_lon +"d, " + ne_lat + "d) )'"; inputRegion = "sbox '( ("+ sw_lon + "d, " + sw_lat + "d), (" + ne_lon +"d, " + ne_lat + "d) )'";
} }
else else if (shape.equals("POLYGON"))
{ // FIXME how to deal with Polygon ? -> use enclose-RECT -> RANGE {
/* lon = coord.lon; // FIXME redefine Polygon as point-array:
lat = coord.lat; assert(coord.pos.polygon.lon.length == coord.pos.polygon.lat.length);
radius = coord.radius;
dlon = coord.dlon;
dlat = coord.dlat;*/
// Polygon has at least 3 points
inputRegion = "spoly '( (" + coord.pos.polygon.lon[0] + "d, " + coord.pos.polygon.lat[0] + "d),";
for(int ii=1; ii < coord.pos.polygon.lon.length; ii++)
{
inputRegion += ", (" + coord.pos.polygon.lon[ii] + "d, " + coord.pos.polygon.lat[ii] + "d)";
}
inputRegion += " )'";
}
else
{
throw new IllegalArgumentException("Coord::shape was: " + shape + " but valid is CIRCLE or RECT"); throw new IllegalArgumentException("Coord::shape was: " + shape + " but valid is CIRCLE or RECT");
} }
boolean vel_valid = (coord.band != null) && (coord.band.system != Band.System.NONE);//coord.vel_valid; boolean vel_valid = (coord.band != null) && (coord.band.system != Band.System.NONE);//coord.vel_valid;
// String vel_type = coord.vel_type;
String theQuery; String theQuery;
if(coord.pos.system == Pos.System.GALACTIC) if(coord.pos.system == Pos.System.GALACTIC)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment