Package oracle.spatial.geometry
Class CompJGeom
- java.lang.Object
-
- oracle.spatial.geometry.CompJGeom
-
public class CompJGeom extends java.lang.Object
- Since:
- release specific (what release of product did this appear in)
-
-
Constructor Summary
Constructors Constructor Description CompJGeom()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
distLineToLine(JPoint2DD p1, JPoint2DD p2, JPoint2DD q1, JPoint2DD q2, CoordSysInfo CSI)
Compute the distance from a line to a line.static double
distToLine(double px, double py, double q1x, double q1y, double q2x, double q2y)
Finds the planar closest distance from a point to a line segment.static double
distToLine(JPoint2DD pt, JPoint2DD q1, JPoint2DD q2, CoordSysInfo CSI)
Compute the distance from a point to a line.static double
distToPoint(double q1x, double q1y, double q2x, double q2y)
Finds the planar closest distance from a point to a point.static double
distToPoint(JPoint2DD p1, JPoint2DD p2, CoordSysInfo CSI)
Compute the distance from a point to a line.static double
isInsideCheck(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDcl(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDclcl(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDcurv(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDistance(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDlinecurve(JPoint2DD[] line1, JGeometry geom, CoordSysInfo CSI)
static double
jmdDlinepolygon(JPoint2DD[] line1, JGeometry geom, CoordSysInfo CSI)
static double
jmdDpg(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDpgpg(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDpnt(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDpntcurve(JPoint2DD p1, JGeometry geom2, CoordSysInfo CSI)
static double
jmdDpntpolygon(JPoint2DD point, JGeometry geom, CoordSysInfo CSI)
protected static double
jMdspheedis(double x1, double y1, double x2, double y2, double smax, double iflat)
The method jMdspheedis computes the precise ellipsoidal distance using long/lat of two points.static boolean
lineLineIntersect(double a1x, double a1y, double a2x, double a2y, double b1x, double b1y, double b2x, double b2y, double[] c)
Finds the open-set intersection of two line segments, if any.static double
MBRDistance(double[] mbrA, double[] mbrB, CoordSysInfo CSI)
static boolean
MBRIscts(double[] mbrA, double[] mbrB, CoordSysInfo CSI)
-
-
-
Method Detail
-
lineLineIntersect
public static final boolean lineLineIntersect(double a1x, double a1y, double a2x, double a2y, double b1x, double b1y, double b2x, double b2y, double[] c)
Finds the open-set intersection of two line segments, if any.Returns false ("no intersection") if the lines are nearly parallel (regardless of whether they cross).
If the end-point of a segment lies very near to the other segment, intersection test is not reliable; the caller should test the point-on-line case separately. If the endpoint lies exactly on an endpoint of the other segment this method guarantees to return false.
- Parameters:
a1x
- the first endpoint x-value of line segment aa1y
- the first endpoint y-value of line segment aa2x
- the first endpoint x-value of line segment aa2y
- the first endpoint y-value of line segment ab1x
- the first endpoint x-value of line segment bb1y
- the first endpoint y-value of line segment bb2x
- the first endpoint x-value of line segment bb2y
- the first endpoint y-value of line segment ac
- the intersection (if any). May pass null. If non-null, may be overwritten even if result is false.- Returns:
- true if there is an intersection; false otherwise
-
distToPoint
public static final double distToPoint(JPoint2DD p1, JPoint2DD p2, CoordSysInfo CSI)
Compute the distance from a point to a line. Geodetic computations assume a sphere. All input is in degrees.- Parameters:
p1
- the pointp2
- other end of the lineCSI
- coordinate system- Returns:
- distance in coordiante system units (meters if geodetic)
-
distToLine
public static final double distToLine(JPoint2DD pt, JPoint2DD q1, JPoint2DD q2, CoordSysInfo CSI)
Compute the distance from a point to a line. Geodetic computations assume a sphere. All input is in degrees.- Parameters:
pt
- the pointq1
- one end of the lineq2
- other end of the lineCSI
- coordinate system- Returns:
- distance in coordiante system units (meters if geodetic)
-
distLineToLine
public static final double distLineToLine(JPoint2DD p1, JPoint2DD p2, JPoint2DD q1, JPoint2DD q2, CoordSysInfo CSI)
Compute the distance from a line to a line. Geodetic computations assume a sphere. All input is in degrees.- Parameters:
pt1
- one end of the linept2
- other end of the lineq1
- one end of the lineq2
- other end of the lineCSI
- coordinate system- Returns:
- distance in coordiante system units (meters if geodetic)
-
distToPoint
public static final double distToPoint(double q1x, double q1y, double q2x, double q2y)
Finds the planar closest distance from a point to a point.- Parameters:
p1
- The first pointp2
- The second point
-
distToLine
public static final double distToLine(double px, double py, double q1x, double q1y, double q2x, double q2y)
Finds the planar closest distance from a point to a line segment.- Parameters:
p
- The pointq1
- The first vertex of the line segmentq2
- The second vertex of the line segment- Returns:
- The distance in coordinate system units
-
jMdspheedis
protected static double jMdspheedis(double x1, double y1, double x2, double y2, double smax, double iflat)
The method jMdspheedis computes the precise ellipsoidal distance using long/lat of two points. It is the Java version of mdspheedis function in mdsph.c Original function by Author: B. Blackwell from mdsph.cInput is geodetic longitude, latitude in radians of two points on earth spheroid.
Based on Mathematica Geodesy package by John Novak
Will return 0. for arcs of the order of a meter or less. For very short arcs use mdsphedis(). Will return the antipodal distance for points which are very close to antipodal.
Accuracy is of order 1e-9.
- Parameters:
x1
- longitude of first point in radiansy1
- latitude of first point in radiansx2
- longitude of second point in radiansy2
- latitude of second point in radianssmax
- smax of ellipsoidiflat
- inverse flattening- Returns:
- ellipsoid distance in meters.
-
jmdDistance
public static double jmdDistance(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
jmdDpnt
public static double jmdDpnt(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
jmdDcurv
public static double jmdDcurv(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
jmdDpntcurve
public static double jmdDpntcurve(JPoint2DD p1, JGeometry geom2, CoordSysInfo CSI)
-
jmdDlinecurve
public static double jmdDlinecurve(JPoint2DD[] line1, JGeometry geom, CoordSysInfo CSI)
-
jmdDlinepolygon
public static double jmdDlinepolygon(JPoint2DD[] line1, JGeometry geom, CoordSysInfo CSI)
-
jmdDpntpolygon
public static double jmdDpntpolygon(JPoint2DD point, JGeometry geom, CoordSysInfo CSI)
-
jmdDpg
public static double jmdDpg(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
jmdDpgpg
public static double jmdDpgpg(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
jmdDcl
public static double jmdDcl(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
jmdDclcl
public static double jmdDclcl(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
MBRIscts
public static boolean MBRIscts(double[] mbrA, double[] mbrB, CoordSysInfo CSI)
-
MBRDistance
public static double MBRDistance(double[] mbrA, double[] mbrB, CoordSysInfo CSI)
-
isInsideCheck
public static double isInsideCheck(JGeometry geom1, JGeometry geom2, CoordSysInfo CSI)
-
-