public class SpatialArgs
extends java.lang.Object
Shape
and the SpatialOperation
.
It's used as an argument to some methods on SpatialStrategy
.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_DISTERRPCT |
Constructor and Description |
---|
SpatialArgs(SpatialOperation operation,
org.locationtech.spatial4j.shape.Shape shape) |
Modifier and Type | Method and Description |
---|---|
static double |
calcDistanceFromErrPct(org.locationtech.spatial4j.shape.Shape shape,
double distErrPct,
org.locationtech.spatial4j.context.SpatialContext ctx)
Computes the distance given a shape and the
distErrPct . |
java.lang.Double |
getDistErr()
The acceptable error of the shape.
|
java.lang.Double |
getDistErrPct()
A measure of acceptable error of the shape as a fraction.
|
SpatialOperation |
getOperation() |
org.locationtech.spatial4j.shape.Shape |
getShape() |
double |
resolveDistErr(org.locationtech.spatial4j.context.SpatialContext ctx,
double defaultDistErrPct)
Gets the error distance that specifies how precise the query shape is.
|
void |
setDistErr(java.lang.Double distErr) |
void |
setDistErrPct(java.lang.Double distErrPct) |
void |
setOperation(SpatialOperation operation) |
void |
setShape(org.locationtech.spatial4j.shape.Shape shape) |
java.lang.String |
toString() |
void |
validate()
Check if the arguments make sense -- throw an exception if not
|
public static final double DEFAULT_DISTERRPCT
public SpatialArgs(SpatialOperation operation, org.locationtech.spatial4j.shape.Shape shape)
public static double calcDistanceFromErrPct(org.locationtech.spatial4j.shape.Shape shape, double distErrPct, org.locationtech.spatial4j.context.SpatialContext ctx)
distErrPct
. The
algorithm is the fraction of the distance from the center of the query
shape to its closest bounding box corner.shape
- Mandatory.distErrPct
- 0 to 0.5ctx
- Mandatorypublic double resolveDistErr(org.locationtech.spatial4j.context.SpatialContext ctx, double defaultDistErrPct)
getDistErr()
, getDistErrPct()
, and defaultDistErrPct
.defaultDistErrPct
- 0 to 0.5>= 0
public void validate() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String toString()
toString
in class java.lang.Object
public SpatialOperation getOperation()
public void setOperation(SpatialOperation operation)
public org.locationtech.spatial4j.shape.Shape getShape()
public void setShape(org.locationtech.spatial4j.shape.Shape shape)
public java.lang.Double getDistErrPct()
public void setDistErrPct(java.lang.Double distErrPct)
public java.lang.Double getDistErr()
>= 0
public void setDistErr(java.lang.Double distErr)
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.