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 , 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.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    SpatialArgsParser
    Namespace: Lucene.Net.Spatial.Queries
    Assembly: Lucene.Net.Spatial.dll
    Syntax
    public class SpatialArgsParser : object

    Fields

    | Improve this Doc View Source

    DIST_ERR

    Declaration
    public const string DIST_ERR = null
    Field Value
    Type Description
    System.String
    | Improve this Doc View Source

    DIST_ERR_PCT

    Declaration
    public const string DIST_ERR_PCT = null
    Field Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    NewSpatialArgs(SpatialOperation, IShape)

    Declaration
    protected virtual SpatialArgs NewSpatialArgs(SpatialOperation op, IShape shape)
    Parameters
    Type Name Description
    SpatialOperation op
    IShape shape
    Returns
    Type Description
    SpatialArgs
    | Improve this Doc View Source

    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
    System.String v

    The string to parse. Mandatory.

    SpatialContext ctx

    The spatial context. Mandatory.

    Returns
    Type Description
    SpatialArgs

    Not null.

    | Improve this Doc View Source

    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
    System.String body
    Returns
    Type Description
    IDictionary<System.String, System.String>
    | Improve this Doc View Source

    ParseShape(String, SpatialContext)

    Declaration
    protected virtual IShape ParseShape(string str, SpatialContext ctx)
    Parameters
    Type Name Description
    System.String str
    SpatialContext ctx
    Returns
    Type Description
    IShape
    | Improve this Doc View Source

    ReadBool(String, Boolean)

    Declaration
    protected static bool ReadBool(string v, bool defaultValue)
    Parameters
    Type Name Description
    System.String v
    System.Boolean defaultValue
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    ReadDouble(String)

    Declaration
    protected static double? ReadDouble(string v)
    Parameters
    Type Name Description
    System.String v
    Returns
    Type Description
    System.Nullable<System.Double>
    | Improve this Doc View Source

    ReadNameValuePairs(SpatialArgs, IDictionary<String, String>)

    Declaration
    protected virtual void ReadNameValuePairs(SpatialArgs args, IDictionary<string, string> nameValPairs)
    Parameters
    Type Name Description
    SpatialArgs args
    IDictionary<System.String, System.String> nameValPairs
    | Improve this Doc View Source

    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
    System.String
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)