Class SpatialArgs
Principally holds the query Spatial4n.Shapes.IShape and the SpatialOperation. It's used as an argument to some methods on SpatialStrategy.
Note
This API is experimental and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Spatial.Queries
Assembly: Lucene.Net.Spatial.dll
Syntax
public class SpatialArgs
Constructors
SpatialArgs(SpatialOperation, IShape)
Principally holds the query Spatial4n.Shapes.IShape and the SpatialOperation. It's used as an argument to some methods on SpatialStrategy.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public SpatialArgs(SpatialOperation operation, IShape shape)
Parameters
Type | Name | Description |
---|---|---|
SpatialOperation | operation | |
IShape | shape |
Fields
DEFAULT_DISTERRPCT
Principally holds the query Spatial4n.Shapes.IShape and the SpatialOperation. It's used as an argument to some methods on SpatialStrategy.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public static readonly double DEFAULT_DISTERRPCT
Field Value
Type | Description |
---|---|
double |
Properties
DistErr
The acceptable error of the shape. This effectively inflates the size of the shape but should not shrink it.
Declaration
public virtual double? DistErr { get; set; }
Property Value
Type | Description |
---|---|
double? |
|
DistErrPct
A measure of acceptable error of the shape as a fraction. This effectively inflates the size of the shape but should not shrink it.
Declaration
public virtual double? DistErrPct { get; set; }
Property Value
Type | Description |
---|---|
double? | 0 to 0.5 |
Operation
Principally holds the query Spatial4n.Shapes.IShape and the SpatialOperation. It's used as an argument to some methods on SpatialStrategy.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public virtual SpatialOperation Operation { get; set; }
Property Value
Type | Description |
---|---|
SpatialOperation |
Shape
Principally holds the query Spatial4n.Shapes.IShape and the SpatialOperation. It's used as an argument to some methods on SpatialStrategy.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public virtual IShape Shape { get; set; }
Property Value
Type | Description |
---|---|
IShape |
Methods
CalcDistanceFromErrPct(IShape, double, SpatialContext)
Computes the distance given a shape and the distErrPct
. The
algorithm is the fraction of the distance from the center of the query
shape to its furthest bounding box corner.
Declaration
public static double CalcDistanceFromErrPct(IShape shape, double distErrPct, SpatialContext ctx)
Parameters
Type | Name | Description |
---|---|---|
IShape | shape | Mandatory. |
double | distErrPct | 0 to 0.5 |
SpatialContext | ctx | Mandatory |
Returns
Type | Description |
---|---|
double | A distance (in degrees). |
ResolveDistErr(SpatialContext, double)
Gets the error distance that specifies how precise the query shape is. This
looks at DistErr, DistErrPct, and
defaultDistErrPct
.
Declaration
public virtual double ResolveDistErr(SpatialContext ctx, double defaultDistErrPct)
Parameters
Type | Name | Description |
---|---|---|
SpatialContext | ctx | |
double | defaultDistErrPct | 0 to 0.5 |
Returns
Type | Description |
---|---|
double |
|
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current object. |
Overrides
Validate()
Check if the arguments make sense -- throw an exception if not
Declaration
public virtual void Validate()