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.
Inheritance
Inherited Members
Namespace: Lucene.Net.Spatial.Queries
Assembly: Lucene.Net.Spatial.dll
Syntax
public class SpatialArgs
Constructors
| Improve this Doc View SourceSpatialArgs(SpatialOperation, IShape)
Declaration
public SpatialArgs(SpatialOperation operation, IShape shape)
Parameters
| Type | Name | Description |
|---|---|---|
| SpatialOperation | operation | |
| Spatial4n.Shapes.IShape | shape |
Fields
| Improve this Doc View SourceDEFAULT_DISTERRPCT
Declaration
public static readonly double DEFAULT_DISTERRPCT
Field Value
| Type | Description |
|---|---|
| System.Double |
Properties
| Improve this Doc View SourceDistErr
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 |
|---|---|
| System.Nullable<System.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 |
|---|---|
| System.Nullable<System.Double> | 0 to 0.5 |
Operation
Declaration
public virtual SpatialOperation Operation { get; set; }
Property Value
| Type | Description |
|---|---|
| SpatialOperation |
Shape
Declaration
public virtual IShape Shape { get; set; }
Property Value
| Type | Description |
|---|---|
| Spatial4n.Shapes.IShape |
Methods
| Improve this Doc View SourceCalcDistanceFromErrPct(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 |
|---|---|---|
| Spatial4n.Shapes.IShape | shape | Mandatory. |
| System.Double | distErrPct | 0 to 0.5 |
| Spatial4n.Context.SpatialContext | ctx | Mandatory |
Returns
| Type | Description |
|---|---|
| System.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 |
|---|---|---|
| Spatial4n.Context.SpatialContext | ctx | |
| System.Double | defaultDistErrPct | 0 to 0.5 |
Returns
| Type | Description |
|---|---|
| System.Double |
|
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String |
Overrides
Validate()
Check if the arguments make sense -- throw an exception if not
Declaration
public virtual void Validate()