Enum Class GeometryFamily

java.lang.Object
java.lang.Enum<GeometryFamily>
nz.org.riskscape.engine.geo.GeometryFamily
All Implemented Interfaces:
Serializable, Comparable<GeometryFamily>, Constable

public enum GeometryFamily extends Enum<GeometryFamily>

An enumeration of the main Geometry type 'families' we support in RiskScape, ranked in terms of their lowest-common-denominator-y-ness when intersecting each other, e.g. intersection of points and polygons results in points, so polygons are ranked higher than points as they are more 'specific'.

  • Enum Constant Details

  • Method Details

    • values

      public static GeometryFamily[] 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 GeometryFamily 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
    • from

      public static GeometryFamily from(org.locationtech.jts.geom.Geometry geometry)
      Returns:
      the GeometryFamily for the given geometry
    • fromClass

      public static GeometryFamily fromClass(Class fromClass)

      Return the GeometryFamily of fromClass. If fromClass is not a specific geometry type then null will be returned.

      Returns:
      the GeometryFamily for the given geometry class
    • min

      public GeometryFamily min(GeometryFamily rhs)

      Returns the lesser of the two geometry types - equivalent to the expected type when intersecting two geometries of the given types, excluding weird peripheral geometries such as glancing points and lines

    • isSameFamily

      public boolean isSameFamily(org.locationtech.jts.geom.Geometry geom)
      Returns:
      true if geom is a member of this geometry family, false otherwise
    • getFamilyClass

      public Class<?> getFamilyClass()