org.apache.lucene.geo

## Class Line2D

- java.lang.Object
- - org.apache.lucene.geo.EdgeTree
  - - org.apache.lucene.geo.Line2D

-     public final class Line2D
      extends EdgeTree

  2D geo line implementation represented as a balanced interval tree of edges.

  Line `Line2D` Construction takes `O(n log n)` time for sorting and tree construction. `relate()` are `O(n)`, but for most practical lines are much faster than brute force.

  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Field Summary

    - ### Fields inherited from class org.apache.lucene.geo.EdgeTree

      `left, maxLat, maxLon, maxX, maxY, minLat, minLon, right, splitX, tree`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected PointValues.Relation` | `componentRelate(double minLat, double maxLat, double minLon, double maxLon)`
    `protected PointValues.Relation` | `componentRelateTriangle(double ax, double ay, double bx, double by, double cx, double cy)`
    `static Line2D` | `create(Line... lines)` create a Line2D edge tree from provided array of Linestrings
    `static Line2D` | `create(XYLine... lines)` create a Line2D edge tree from provided array of Linestrings

    - ### Methods inherited from class org.apache.lucene.geo.EdgeTree

      `createTree, internalComponentRelate, pointInTriangle, relate, relateTriangle`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### create

          public static Line2D create(Line... lines)

      create a Line2D edge tree from provided array of Linestrings

    - #### create

          public static Line2D create(XYLine... lines)

      create a Line2D edge tree from provided array of Linestrings

    - #### componentRelate

          protected PointValues.Relation componentRelate(double minLat,
                                                         double maxLat,
                                                         double minLon,
                                                         double maxLon)

      Specified by:
        `componentRelate` in class `EdgeTree`

    - #### componentRelateTriangle

          protected PointValues.Relation componentRelateTriangle(double ax,
                                                                 double ay,
                                                                 double bx,
                                                                 double by,
                                                                 double cx,
                                                                 double cy)

      Specified by:
        `componentRelateTriangle` in class `EdgeTree`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.