Fork me on GitHub
  • API

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    SpatialArgsParser
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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

    v or ctx is null.

    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

    body is null.

    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

    str or ctx is null.

    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

    args or nameValPairs is null.

    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
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.