Skip to content

Commit

Permalink
Correct tolerance values.
Browse files Browse the repository at this point in the history
  • Loading branch information
at88mph committed Dec 12, 2022
1 parent baa26ed commit 3d9de3f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cadc-tap-server-oracle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ repositories {
apply from: '../opencadc.gradle'
sourceCompatibility = 1.8
group = 'org.opencadc'
version = '1.2.10'
version = '1.2.11'

description = 'OpenCADC TAP-1.1 tap server plugin (Oracle)'
def git_url = 'https://github.com/opencadc/tap'

dependencies {
implementation 'org.opencadc:cadc-tap-server:[1.1.19,2.0)'
implementation 'org.opencadc:cadc-tap-server:[1.1.21,2.0)'
implementation 'org.opencadc:cadc-adql:[1.1.11,2.0)'

testImplementation 'junit:junit:[4.12,5.0)'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class OracleRegionConverter extends RegionFinder {
private static final String CONTAINS_TRUE_VALUE = CONTAINS_RELATE_MASK.toUpperCase();
private static final String ANYINTERACT_FUNCTION_NAME = "SDO_ANYINTERACT";
private static final String ANYINTERACT_RELATE_MASK = "anyinteract";
private static final String RELATE_DEFAULT_TOLERANCE = "0.005";
private static final String RELATE_DEFAULT_TOLERANCE = "0.05";

// Prototype coordinate range function using Oracle's SDO_GEOM package.
public static final String RANGE_S2D = "RANGE_S2D";
Expand Down Expand Up @@ -270,7 +270,7 @@ protected Expression handleDistance(final Expression left, final Expression righ
}

/**
* This method is called when a CONTAINS is found outside of a predicate.
* This method is called when a CONTAINS is found outside a predicate.
* This could occur if the query had CONTAINS(...) in the select list or as
* part of an arithmetic expression or aggregate function (since CONTAINS
* returns a numeric value).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class OracleCircle extends Function {
private static final Logger LOGGER = Logger.getLogger(OracleRegionConverter.class);

public static final String FUNCTION_NAME = "SDO_UTIL.CIRCLE_POLYGON";
public static final double DEFAULT_ARC_TOLERANCE = 0.005D;
public static final double DEFAULT_ARC_TOLERANCE = 0.05D;
public static final double TO_METRES_ON_EARTH = 2.0D * Math.PI * 6371000.0D / 360.0D;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void handleContains() {
final String resultFunctionSource = resultFunction.toString();
Assert.assertEquals("Wrong output.",
"SDO_CONTAINS(SDO_UTIL.CIRCLE_POLYGON(88.0, 12.0, "
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.005), " +
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.05), " +
"SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(16.8, 33.4, NULL), NULL, NULL))",
resultFunctionSource);
}
Expand Down Expand Up @@ -141,7 +141,7 @@ public void handleRegionPredicateContains() {
final String resultFunctionSource = equalsFunction.toString();
Assert.assertEquals("Wrong output.",
"SDO_CONTAINS(SDO_UTIL.CIRCLE_POLYGON(88.0, 12.0, "
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.005), " +
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.05), " +
"SDO_GEOMETRY"
+ "(2001, 8307, SDO_POINT_TYPE(16.8, 33.4, NULL), NULL, NULL)) = 'TRUE'",
resultFunctionSource);
Expand Down Expand Up @@ -198,7 +198,7 @@ public void handleColumnReference() {

Assert.assertEquals("Wrong SQL DISTANCE output.",
"SDO_GEOM.SDO_DISTANCE(SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(ra, dec, NULL), NULL, " +
"NULL), SDO_UTIL.CIRCLE_POLYGON(88.0, 12.0, " + 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.005), 0.005)",
"NULL), SDO_UTIL.CIRCLE_POLYGON(88.0, 12.0, " + 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.05), 0.05)",
distanceFunction.toString());
}

Expand Down Expand Up @@ -228,9 +228,9 @@ public void handleRegionPredicateIntersects() {
final String resultFunctionSource = equalsFunction.toString();
Assert.assertEquals("Wrong output.",
"SDO_GEOM.RELATE(SDO_UTIL.CIRCLE_POLYGON(88.0, 12.0, "
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.005), " +
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.05), " +
"'anyinteract', " +
"SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(16.8, 33.4, NULL), NULL, NULL), 0.005) " +
"SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(16.8, 33.4, NULL), NULL, NULL), 0.05) " +
"<> 'TRUE'",
resultFunctionSource);
}
Expand Down Expand Up @@ -316,8 +316,8 @@ public void handleDistance() {

Assert.assertEquals("Wrong SQL DISTANCE output.",
"SDO_GEOM.SDO_DISTANCE(SDO_UTIL.CIRCLE_POLYGON(88.0, 12.0, "
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.005), " +
"SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(16.8, 33.4, NULL), NULL, NULL), 0.005)",
+ 0.8D * OracleCircle.TO_METRES_ON_EARTH + ", 0.05), " +
"SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(16.8, 33.4, NULL), NULL, NULL), 0.05)",
distanceFunction.toString());
}
}

0 comments on commit 3d9de3f

Please sign in to comment.