public final class FastJGeometry extends JGeometry
Currently does not handle arcs or splines.
Modifier and Type | Class and Description |
---|---|
static class |
FastJGeometry.FastOp
Operations can be accelerated by doing preprocessing beforehand.
|
static class |
FastJGeometry.PPStatus
Whether a particular operation is PREPROCESSed, should NEVER be preprocessed, or may be AUTOmatcially done at the discretion of the implementation.
|
JGeometry.Point
GTYPE_COLLECTION, GTYPE_CURVE, GTYPE_MULTICURVE, GTYPE_MULTIPOINT, GTYPE_MULTIPOLYGON, GTYPE_POINT, GTYPE_POLYGON
Constructor and Description |
---|
FastJGeometry(JGeometry geom, double tolerance, java.util.EnumSet<FastJGeometry.FastOp> opsSet, boolean defaultAuto)
Creates a shallow copy of the given geometry that will be preprocessed as specified.
|
Modifier and Type | Method and Description |
---|---|
boolean |
anyInteract(JGeometry B, double tolerance)
This method determines if a 2D/3D Geometry has anyinteraction with another 2D/3D Geometry.
|
double |
distance(JGeometry A)
Compute distance to geometry A using the tolerance and isGeodetic values passed at creation.
|
double |
distance(JGeometry B, double tolerance)
This method determines the distance between two 2D Geometries.
|
FastJGeometry.PPStatus |
getPPStatus(FastJGeometry.FastOp op)
Return the preprocessing status of the specified operation.
|
boolean |
isInside(JGeometry B, double tolerance)
Determine whether this geometry is inside B.
|
affineTransforms, anyInteract, anyInteract, area, buffer, buffer, buffer, byteArrayToHexString, centralLongLatforGNMProjection, circle_polygon, circle_polygon, clone, computeArc, concaveHullDig, convexHull, createArc2d, createCircle, createCircle, createDoubleShape, createDoubleShape, createLinearLineString, createLinearMultiLineString, createLinearPolygon, createLinearPolygon, createLRSLinearLineString, createLRSLinearMultiLineString, createLRSLinearPolygon, createLRSLinearPolygon, createLRSPoint, createMultiPoint, createNURBScurve, createPoint, createShape, createShape, createShape, densifyArcs, densifyArcs, densifyGeodesic, densifyGeodesic, distance, equals, expandCircle, fitArc, geodetic3DLength, geodetic3DLength, getCoordSysInfo, getDimensions, getElementAt, getElements, getElemInfo, getFirstPoint, getGeomDescriptor, getJavaPoint, getJavaPoints, getLabelPoint, getLabelPointXYZ, getLastPoint, getLRMDimension, getMBR, getNumPoints, getNurbsApprox, getOracleDescriptors, getOracleDescriptorsStr, getOrdinatesArray, getOrdinatesOfElements, getOrientMultiPointOffset, getPoint, getSize, getSRID, getType, hasCircularArcs, isCircle, isGeodetic, isGeodeticMBR, isInside, isLRSGeometry, isMultiPoint, isOrientedMultiPoint, isOrientedPoint, isPoint, isRectangle, length, linearizeArc, linearizeArc, linearizeArc, linearizeArc, load, loadJS, make_2d, make_3d, make_3dgeom, make_3dgeom, monoMeasure, projectArrayToGNM, projectFromGNM_longLat, projectFromLTP, projectToGNM_longLat, projectToGNM_longLat, projectToLTP, projectToLTP, reFormulateArc, setLRMDimension, setSRID, setType, simplify, simplify, simplifyVW, simplifyVW, simplifyVW, simplifyVW, store, store, store, store, store, store, store, storeJS, storeJS, storeJS, storeJS, storeJS, tfm_8307_to_PopularMercator, tfm_8307_to_PopularMercator, tfm_PopularMercator_to_8307, tfm_PopularMercator_to_8307, toGeoJson, toString, toStringFull, toStringFull, volume
public FastJGeometry(JGeometry geom, double tolerance, java.util.EnumSet<FastJGeometry.FastOp> opsSet, boolean defaultAuto) throws java.lang.Exception
Preprocessing does not help in all cases:
Preprocessing is intended to be harmless; operations should return their contracted results whether or not preprocessing succeeded, regardless of the values used for preprocessing. However, results do change in some cases due to the different algorithms. If exactly reproducable results are required, especially for results affected by tolerances, preprocessing should be used always or never for that operation. AUTO is particularly discouraged if exactly reproducable results are required.
Preprocessing information is usable both when a method on FastJGeometry is called, and also when a FastJGeometry is passed to a JGeometry method.
This object is not thread-safe.
Example usage: JGeometry geom = new JGeometry(2003, SRID, new int[] { 1, 2, 1 }, new double[] { 3,3, 6,6 }); FastJGeometry fastGeom = new FastJGeometry(fjg, 0.05, false, EnumSet.of(JGeometry.FastOp.DISTANCE, JGeometry.FastOp.ANYINTERACT)); JGeometry otherGeom = new JGeometry(2003, SRID, new int[] { 1, 2, 1 }, new double[] { 0,0, 9,9 }); double dist1 = fastGeom.distance(otherGeom); // Defaults tolerance and isGeodetic values double dist2 = otherGeom.distance(fastGeom, 0.05, false); // Returns same answer using same preprocessed info in fjg // (parameter order doesn't matter for distance).
AUTO allows the implementation freedom to decide when to preprocess based on usage.
geom
- must not be modified after this object is created.tolerance
-isGeodetic
-opsSet
- list of operations to preprcoess immediatelydefaultAuto
- true = other operations are AUTO (may also be preprocessed); false = NEVER preprocess other operationsjava.lang.Exception
public FastJGeometry.PPStatus getPPStatus(FastJGeometry.FastOp op)
op
-public boolean anyInteract(JGeometry B, double tolerance) throws java.lang.Exception
B
- 2D/3D Geometrytolerance
- at which the given geometry is validisGeodetic
- true if the geometries are geodeticjava.lang.Exception
public double distance(JGeometry B, double tolerance) throws java.lang.Exception
distance
in class JGeometry
B
- 2D Geometry that is a polygon or multi-polygontolerance
- at which the given geometry is validisGeodetic
- if the geometries are geodeticjava.lang.Exception
public double distance(JGeometry A) throws java.lang.Exception
A
-java.lang.Exception