# Enum Class GeometryLibrary

Object
Enum<GeometryLibrary>
GeometryLibrary

All Implemented Interfaces:
  `Serializable`, `Comparable<GeometryLibrary>`, `Constable`

public enum GeometryLibrary extends Enum<GeometryLibrary>
Some libraries providing geometric objects or topological operations. Apache SIS uses its own implementation for the most basic objects like direct positions and envelopes, and can delegate to one of the enumerated libraries for more complex geometries. All those libraries are optional.

Since:
  0.8
See Also:
  - `OptionKey​.GEOMETRY_LIBRARY`
  - `FeatureTypeBuilder​.addAttribute(GeometryType)`

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from class Enum

  `Enum​.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ESRI`
  The ESRI geometry API library.
  `GEOAPI`
  The GeoAPI geometry interfaces.
  `JAVA2D`
  The Java 2D Graphics and Imaging library.
  `JTS`
  The Java Topology Suite (JTS) library.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `toString()`
  Returns the name of this geometry library in a way suitable to user interfaces.
  `static GeometryLibrary`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static GeometryLibrary[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### JAVA2D

    public static final GeometryLibrary JAVA2D
    The Java 2D Graphics and Imaging library. This library does not provide as many topological operations than other libraries, but is available on most standard Java environments and constitute a reliable fallback when no other library is available.

    Implementation classes
    Geometry type | Class name
    --- | ---
    `GeometryType.POINT` | `java.awt.geom.Point2D`
    `GeometryType.LINEAR` | `java.awt.Shape`
    `GeometryType.AREAL` | `java.awt.Shape`

    Note that contrarily to JTS and ESRI libraries, a point does not extend any root geometry class in Java2D.

  - ### ESRI

    public static final GeometryLibrary ESRI
    The ESRI geometry API library. This library can be used for spatial vector data processing. It is used in ESRI GIS Tools for Hadoop and has an Android port. The library is available under Apache 2 license.

    Implementation classes
    Geometry type | Class name
    --- | ---
    Root geometry class | `com.esri.core.geometry.Geometry`
    `GeometryType.POINT` | `com.esri.core.geometry.Point`
    `GeometryType.LINEAR` | `com.esri.core.geometry.Polyline`
    `GeometryType.AREAL` | `com.esri.core.geometry.Polygon`

    See Also:
      - API wiki page

  - ### JTS

    public static final GeometryLibrary JTS
    The Java Topology Suite (JTS) library. This open source library provides an object model for Euclidean planar geometry together with a set of fundamental geometric functions. The library is licensed under Eclipse Distribution License.

    Implementation classes
    Geometry type | Class name
    --- | ---
    Root geometry class | `org.locationtech.jts.geom.Geometry`
    `GeometryType.POINT` | `org.locationtech.jts.geom.Point`
    `GeometryType.LINEAR` | `org.locationtech.jts.geom.LineString`
    `GeometryType.AREAL` | `org.locationtech.jts.geom.Polygon`

    Since:
      1.0
    See Also:
      - JTS home page

  - ### GEOAPI

    public static final GeometryLibrary GEOAPI
    The GeoAPI geometry interfaces. Since GeoAPI interfaces are implementation neutral, the actual implementation is currently unspecified (a future Apache SIS version may provide some control on that).

    Implementation classes
    Geometry type | Class name
    --- | ---
    Root geometry class | `Geometry`

    #### Limitations

    The geometry interfaces are not well developed in GeoAPI 3.0. In current Apache SIS implementation, only the most basic methods are implemented and other methods throws `UnsupportedOperationException`. Future GeoAPI version and Apache SIS implementation should provide more extensive support.
    Since:
      1.4

- ## Method Details

  - ### values

    public static GeometryLibrary[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static GeometryLibrary valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### toString

    public String toString()
    Returns the name of this geometry library in a way suitable to user interfaces. This is the same as `Enum​.name()` but sometime with different cases. For example, `JAVA2D` is shown as `"Java2D"`.
    Overrides:
      `toString` in class `Enum<GeometryLibrary>`
    Returns:
      human-readable name of this library.
    Since:
      1.5