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
No related branches found
No related tags found
No related merge requests found
......@@ -71,19 +71,25 @@ public class DbPSearch
inputRegion = "sbox '( ("+ sw_lon + "d, " + sw_lat + "d), (" + ne_lon +"d, " + ne_lat + "d) )'";
}
else
{ // FIXME how to deal with Polygon ? -> use enclose-RECT -> RANGE
/* lon = coord.lon;
lat = coord.lat;
radius = coord.radius;
dlon = coord.dlon;
dlat = coord.dlat;*/
else if (shape.equals("POLYGON"))
{
// FIXME redefine Polygon as point-array:
assert(coord.pos.polygon.lon.length == coord.pos.polygon.lat.length);
// 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");
}
boolean vel_valid = (coord.band != null) && (coord.band.system != Band.System.NONE);//coord.vel_valid;
// String vel_type = coord.vel_type;
String theQuery;
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