Enum Class SimplifyAlgorithm

java.lang.Object
java.lang.Enum<SimplifyAlgorithm>
dev.avelar.mapnik.SimplifyAlgorithm
All Implemented Interfaces:
Serializable, Comparable<SimplifyAlgorithm>, Constable

public enum SimplifyAlgorithm extends Enum<SimplifyAlgorithm>
How Geometry.simplify(dev.avelar.mapnik.SimplifyAlgorithm, double) decides which points to drop. The tolerance means something different for each, so try a value and look at the result.
  • Enum Constant Details

    • RADIAL_DISTANCE

      public static final SimplifyAlgorithm RADIAL_DISTANCE
      Drops points closer than the tolerance to the previous kept point. Fast and crude.
    • DOUGLAS_PEUCKER

      public static final SimplifyAlgorithm DOUGLAS_PEUCKER
      Keeps points that deviate from a straight run by more than the tolerance. The usual choice.
    • VISVALINGAM_WHYATT

      public static final SimplifyAlgorithm VISVALINGAM_WHYATT
      Drops the points that change the shape least, by triangle area. Smooth results.
    • ZHAO_SALFELD

      public static final SimplifyAlgorithm ZHAO_SALFELD
      A variant of Visvalingam-Whyatt that keeps the line's overall direction.
  • Method Details

    • values

      public static SimplifyAlgorithm[] 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 SimplifyAlgorithm 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
    • xmlName

      public String xmlName()
      The name as written in style files, for example douglas-peucker.