public class SpatialArgs extends 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,
com.spatial4j.core.shape.Shape shape) |
Modifier and Type | Method and Description |
---|---|
static double |
calcDistanceFromErrPct(com.spatial4j.core.shape.Shape shape,
double distErrPct,
com.spatial4j.core.context.SpatialContext ctx)
Computes the distance given a shape and the
distErrPct . |
Double |
getDistErr()
The acceptable error of the shape.
|
Double |
getDistErrPct()
A measure of acceptable error of the shape as a fraction.
|
SpatialOperation |
getOperation() |
com.spatial4j.core.shape.Shape |
getShape() |
double |
resolveDistErr(com.spatial4j.core.context.SpatialContext ctx,
double defaultDistErrPct)
Gets the error distance that specifies how precise the query shape is.
|
void |
setDistErr(Double distErr) |
void |
setDistErrPct(Double distErrPct) |
void |
setOperation(SpatialOperation operation) |
void |
setShape(com.spatial4j.core.shape.Shape shape) |
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, com.spatial4j.core.shape.Shape shape)
public static double calcDistanceFromErrPct(com.spatial4j.core.shape.Shape shape, double distErrPct, com.spatial4j.core.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(com.spatial4j.core.context.SpatialContext ctx, double defaultDistErrPct)
getDistErr()
, getDistErrPct()
, and defaultDistErrPct
.defaultDistErrPct
- 0 to 0.5public void validate() throws IllegalArgumentException
IllegalArgumentException
public SpatialOperation getOperation()
public void setOperation(SpatialOperation operation)
public com.spatial4j.core.shape.Shape getShape()
public void setShape(com.spatial4j.core.shape.Shape shape)
public Double getDistErrPct()
public void setDistErrPct(Double distErrPct)
public Double getDistErr()
public void setDistErr(Double distErr)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.