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.ChainConverter, JGeometry.ElementIterator, JGeometry.GeomParser, JGeometry.Point
dim, EITPR_ARC, EITPR_CIRCLE, EITPR_GEODETICMBR, EITPR_LINEAR, EITPR_NURBSCURVE, EITPR_RECTANGLE, EITPR_UNKNOWN, elemInfo, elemInfoDesc, ELEMINFODESCSTR, ETOPO_EXTERIOR, ETOPO_INTERIOR, ETOPO_NA, ETOPO_UNKNOWN, ETYPE_COMPOUNDCURVE, ETYPE_COMPOUNDRING, ETYPE_CURVE, ETYPE_POINT, ETYPE_RING, ETYPE_UNKNOWN, geomDesc, GEOMDESCSTR, gtransH, gtype, GTYPE_COLLECTION, GTYPE_CURVE, GTYPE_MULTICURVE, GTYPE_MULTIPOINT, GTYPE_MULTIPOLYGON, GTYPE_POINT, GTYPE_POLYGON, linfo, lttpH, mbr, mer, ORDINATEDESCSTR, ordinates, ordinatesDesc, pointDesc, POINTDESCSTR, srid, sridCSI, x, y, z
Constructor and Description |
---|
FastJGeometry(JGeometry geom,
double tolerance)
All eligible operations will be preprocessed automatically at the discretion of the implementation.
|
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, closeCoords, computeArc, computeArcMBR, concaveHullDig, convexHull, coord, createArc2d, createCircle, createCircle, createDBDescriptors, createDoubleShape, createDoubleShape, createLinearLineString, createLinearMultiLineString, createLinearPolygon, createLinearPolygon, createLRSLinearLineString, createLRSLinearMultiLineString, createLRSLinearPolygon, createLRSLinearPolygon, createLRSPoint, createMultiPoint, createNURBScurve, createPoint, createShape, createShape, createShape, crossesMeridian, defaultTolerance, densifyArcs, densifyArcs, densifyGeodesic, densifyGeodesic, distance, equals, expandCircle, expandMBR, expandMBR, expandMBR, expandMBR, fitArc, fitsInHemisphere, geodetic3DLength, geodetic3DLength, getCoordSysInfo, getDimensions, getElementAt, getElements, getElements, getElemInfo, getElemInfoOfElement, getExtendedMBR, getFirstPoint, getGeomDescriptor, getJavaPoint, getJavaPoints, getLabelPoint, getLabelPointXYZ, getLastPoint, getLRMDimension, getMBR, getMer, getNumPoints, getNurbsApprox, getOracleDescriptors, getOracleDescriptorsStr, getOrdinatesArray, getOrdinatesOfElement, getOrdinatesOfElements, getOrientMultiPointOffset, getPoint, getSize, getSRID, getType, hasCircularArcs, isCircle, isCompoundElement, isGeodetic, isGeodeticMBR, isInside, isLRSGeometry, isMultiPoint, isOptimizedPoint, isOrientedMultiPoint, isOrientedPoint, isPoint, isRectangle, isSimpleElement, length, linearizeArc, linearizeArc, linearizeArc, linearizeArc, load, load, loadJS, loadJS, make_2d, make_3d, make_3dgeom, make_3dgeom, makeElementGeometry, monoMeasure, orientation, parseGeometry, projectArrayToGNM, projectFromGNM_longLat, projectFromLTP, projectToGNM_longLat, projectToGNM_longLat, projectToLTP, projectToLTP, reFormulateArc, remove_etype0, reOrientCurves, 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, thetaInArc, 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:
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(JGeometry geom, double tolerance) throws java.lang.Exception
geom
- tolerance
- isGeodetic
- java.lang.Exception
public FastJGeometry.PPStatus getPPStatus(FastJGeometry.FastOp op)
op
- public boolean anyInteract(JGeometry B, double tolerance) throws java.lang.Exception
anyInteract
in class JGeometry
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