org.apache.lucene.spatial3d.geom

## Class GeoPolygonFactory

- java.lang.Object
- - org.apache.lucene.spatial3d.geom.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.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `GeoPolygonFactory.PolygonDescription` Use this class to specify a polygon with associated holes.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static GeoPolygon` | `makeGeoPolygon(PlanetModel planetModel, List<GeoPoint> pointList)` Create a GeoPolygon using the specified points and holes, using order to determine siding of the polygon.
    `static GeoPolygon` | `makeGeoPolygon(PlanetModel planetModel, List<GeoPoint> pointList, List<GeoPolygon> holes)` Create a GeoPolygon using the specified points and holes, using order to determine siding of the polygon.
    `static GeoPolygon` | `makeGeoPolygon(PlanetModel planetModel, List<GeoPoint> pointList, List<GeoPolygon> holes, double leniencyValue)` Create a GeoPolygon using the specified points and holes, using order to determine siding of the polygon.
    `static GeoPolygon` | `makeLargeGeoPolygon(PlanetModel planetModel, List<GeoPolygonFactory.PolygonDescription> shapesList)` Create a large GeoPolygon.

    - ### 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)

      Create a GeoPolygon using the specified points and holes, using order to determine siding of the polygon. Much like ESRI, this method uses clockwise to indicate the space on the same side of the shape as being inside, and counter-clockwise to indicate the space on the opposite side as being inside.
      Parameters:
        `pointList` - is a list of the GeoPoints to build an arbitrary polygon out of. If points go clockwise from a given pole, then that pole should be within the polygon. If points go counter-clockwise, then that pole should be outside the polygon.
      Returns:
        a GeoPolygon corresponding to what was specified.

    - #### makeGeoPolygon

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

      Create a GeoPolygon using the specified points and holes, using order to determine siding of the polygon. Much like ESRI, this method uses clockwise to indicate the space on the same side of the shape as being inside, and counter-clockwise to indicate the space on the opposite side as being inside.
      Parameters:
        `pointList` - is a list of the GeoPoints to build an arbitrary polygon out of. If points go clockwise from a given pole, then that pole should be within the polygon. If points go counter-clockwise, then that pole should be outside the polygon.
        `holes` - is a list of polygons representing "holes" in the outside polygon. Holes describe the area outside each hole as being "in set". Null == none.
      Returns:
        a GeoPolygon corresponding to what was specified, or null if a valid polygon cannot be generated from this input.

    - #### makeGeoPolygon

          public static GeoPolygon makeGeoPolygon(PlanetModel planetModel,
                                                  List<GeoPoint> pointList,
                                                  List<GeoPolygon> holes,
                                                  double leniencyValue)

      Create a GeoPolygon using the specified points and holes, using order to determine siding of the polygon. Much like ESRI, this method uses clockwise to indicate the space on the same side of the shape as being inside, and counter-clockwise to indicate the space on the opposite side as being inside.
      Parameters:
        `pointList` - is a list of the GeoPoints to build an arbitrary polygon out of. If points go clockwise from a given pole, then that pole should be within the polygon. If points go counter-clockwise, then that pole should be outside the polygon.
        `holes` - is a list of polygons representing "holes" in the outside polygon. Holes describe the area outside each hole as being "in set". Null == none.
        `leniencyValue` - is the maximum distance (in units) that a point can be from the plane and still be considered as belonging to the plane. Any value greater than zero may cause some of the provided points that are in fact outside the strict definition of co-planarity, but are within this distance, to be discarded for the purposes of creating a "safe" polygon.
      Returns:
        a GeoPolygon corresponding to what was specified, or null if a valid polygon cannot be generated from this input.

    - #### makeLargeGeoPolygon

          public static GeoPolygon makeLargeGeoPolygon(PlanetModel planetModel,
                                                       List<GeoPolygonFactory.PolygonDescription> shapesList)

      Create a large GeoPolygon. This is one which has more than 100 sides and/or may have resolution problems with very closely spaced points, which often occurs when the polygon was constructed to approximate curves. No tiling is done, and intersections and membership are optimized for having large numbers of sides. This method does very little checking for legality. It expects the incoming shapes to not intersect each other. The shapes can be disjoint or nested. If the shapes listed are nested, then we are describing holes. There is no limit to the depth of holes. However, if a shape is nested within another it must be explicitly described as being a child of the other shape. Membership in any given shape is described by the clockwise/counterclockwise direction of the points. The clockwise direction indicates that a point inside is "in-set", while a counter-clockwise direction implies that a point inside is "out-of-set".
      Parameters:
        `planetModel` - is the planet model.
        `shapesList` - is the list of polygons we should be making.
      Returns:
        the GeoPolygon, or null if it cannot be constructed.

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