Class SpatialArgsParser
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
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 SpatialArgsParser
Fields
DIST_ERR
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public const string DIST_ERR = "distErr"
Field Value
Type | Description |
---|---|
string |
DIST_ERR_PCT
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
public const string DIST_ERR_PCT = "distErrPct"
Field Value
Type | Description |
---|---|
string |
Methods
NewSpatialArgs(SpatialOperation, IShape)
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected virtual SpatialArgs NewSpatialArgs(SpatialOperation op, IShape shape)
Parameters
Type | Name | Description |
---|---|---|
SpatialOperation | op | |
IShape | shape |
Returns
Type | Description |
---|---|
SpatialArgs |
Parse(string, SpatialContext)
Parses a string such as "Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025".
Declaration
public virtual SpatialArgs Parse(string v, SpatialContext ctx)
Parameters
Type | Name | Description |
---|---|---|
string | v | The string to parse. Mandatory. |
SpatialContext | ctx | The spatial context. Mandatory. |
Returns
Type | Description |
---|---|
SpatialArgs | Not null. |
Exceptions
Type | Condition |
---|---|
ArgumentException | if the parameters don't make sense or an add-on parameter is unknown. |
ParseException | If there is a problem parsing the string. |
InvalidShapeException | When the coordinates are invalid for the shape. |
ArgumentNullException |
|
ParseMap(string)
Parses "a=b c=d f" (whitespace separated) into name-value pairs. If there is no '=' as in 'f' above then it's short for f=f.
Declaration
protected static IDictionary<string, string> ParseMap(string body)
Parameters
Type | Name | Description |
---|---|---|
string | body |
Returns
Type | Description |
---|---|
IDictionary<string, string> |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ParseShape(string, SpatialContext)
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected virtual IShape ParseShape(string str, SpatialContext ctx)
Parameters
Type | Name | Description |
---|---|---|
string | str | |
SpatialContext | ctx |
Returns
Type | Description |
---|---|
IShape |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ReadBool(string?, bool)
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected static bool ReadBool(string? v, bool defaultValue)
Parameters
Type | Name | Description |
---|---|---|
string | v | |
bool | defaultValue |
Returns
Type | Description |
---|---|
bool |
ReadDouble(string?)
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected static double? ReadDouble(string? v)
Parameters
Type | Name | Description |
---|---|---|
string | v |
Returns
Type | Description |
---|---|
double? |
ReadNameValuePairs(SpatialArgs, IDictionary<string, string>)
Parses a string that usually looks like "OPERATION(SHAPE)" into a SpatialArgs object. The set of operations supported are defined in SpatialOperation, such as "Intersects" being a common one. The shape portion is defined by WKT Spatial4n.IO.WktShapeParser, but it can be overridden/customized via ParseShape(string, SpatialContext). There are some optional name-value pair parameters that follow the closing parenthesis. Example:
Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
In the future it would be good to support something at least semi-standardized like a variant of [E]CQL.
Note
This API is experimental and might change in incompatible ways in the next release.
Declaration
protected virtual void ReadNameValuePairs(SpatialArgs args, IDictionary<string, string> nameValPairs)
Parameters
Type | Name | Description |
---|---|---|
SpatialArgs | args | |
IDictionary<string, string> | nameValPairs |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
WriteSpatialArgs(SpatialArgs)
Writes a close approximation to the parsed input format.
Declaration
public static string WriteSpatialArgs(SpatialArgs args)
Parameters
Type | Name | Description |
---|---|---|
SpatialArgs | args |
Returns
Type | Description |
---|---|
string |