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,
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 . |
Double |
getDistErr()
The acceptable error of the shape.
|
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(Double distErr) |
void |
setDistErrPct(Double distErrPct) |
void |
setOperation(SpatialOperation operation) |
void |
setShape(org.locationtech.spatial4j.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, 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 IllegalArgumentException
IllegalArgumentException
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 Double getDistErrPct()
public void setDistErrPct(Double distErrPct)
public Double getDistErr()
>= 0
public void setDistErr(Double distErr)
Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.