org.apache.lucene.geo3d

## Class GeoPolygonFactory

- java.lang.Object
- - org.apache.lucene.geo3d.GeoPolygonFactory

-     public class GeoPolygonFactory
      extends Object

  Class which constructs a GeoMembershipShape representing an arbitrary polygon.
  WARNING: This API is experimental and might change in incompatible ways in the next release.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GeoPolygon` | `buildPolygonShape(PlanetModel planetModel, List<GeoPoint> pointsList, int startPointIndex, int endPointIndex, SidedPlane startingEdge, boolean isInternalEdge)` Build a GeoMembershipShape given points, starting edge, and whether starting edge is internal or not.
    `protected static int` | `getLegalIndex(int index, int size)` Convert raw point index into valid array position.
    `protected static boolean` | `isWithin(GeoPoint newPoint, List<SidedPlane> currentPlanes)` Check if a point is within a described list of planes.
    `static GeoPolygon` | `makeGeoPolygon(PlanetModel planetModel, List<GeoPoint> pointList, int convexPointIndex)` Create a GeoMembershipShape of the right kind given the specified bounds.

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

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

- - ### Method Detail

    - #### makeGeoPolygon

          public static GeoPolygon makeGeoPolygon(PlanetModel planetModel,
                                  List<GeoPoint> pointList,
                                  int convexPointIndex)

      Create a GeoMembershipShape of the right kind given the specified bounds.
      Parameters:
        `pointList` - is a list of the GeoPoints to build an arbitrary polygon out of.
        `convexPointIndex` - is the index of a single convex point whose conformation with its neighbors determines inside/outside for the entire polygon.
      Returns:
        a GeoPolygon corresponding to what was specified.

    - #### buildPolygonShape

          public static GeoPolygon buildPolygonShape(PlanetModel planetModel,
                                     List<GeoPoint> pointsList,
                                     int startPointIndex,
                                     int endPointIndex,
                                     SidedPlane startingEdge,
                                     boolean isInternalEdge)

      Build a GeoMembershipShape given points, starting edge, and whether starting edge is internal or not.
      Parameters:
        `pointsList` - is a list of the GeoPoints to build an arbitrary polygon out of.
        `startPointIndex` - is one of the points constituting the starting edge.
        `endPointIndex` - is another of the points constituting the starting edge.
        `startingEdge` - is the plane describing the starting edge.
        `isInternalEdge` - is true if the specified edge is an internal one.
      Returns:
        a GeoMembershipShape corresponding to what was specified.

    - #### isWithin

          protected static boolean isWithin(GeoPoint newPoint,
                         List<SidedPlane> currentPlanes)

      Check if a point is within a described list of planes.
      Parameters:
        `newPoint` - is the point.
        `currentPlanes` - is the list of planes.
      Returns:
        true if within.

    - #### getLegalIndex

          protected static int getLegalIndex(int index,
                          int size)

      Convert raw point index into valid array position.
      Parameters:
        `index` - is the array index.
        `size` - is the array size.
      Returns:
        an updated index.

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