Class GeometryUtils

java.lang.Object
org.openjump.core.ui.util.GeometryUtils

public class GeometryUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    centerGeometry(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Coordinate displacement)
    Move a geometry to a defined coordinate
    static org.locationtech.jts.geom.Geometry
    createEmptyGeometry(Class geometryClass, org.locationtech.jts.geom.GeometryFactory geometryFactory)
    creates an empty geometry matching the geom type set already or an empty geom collection if that fails
    static org.locationtech.jts.geom.Geometry
    createEmptyGeometry(String geometryName, org.locationtech.jts.geom.GeometryFactory geometryFactory)
     
    static void
    rotateGeometry(org.locationtech.jts.geom.Geometry geometry, double angle)
    Method to clock wise rotate a geometry of a defined angle
    static void
    rotateGeometry(org.locationtech.jts.geom.Geometry geometry, int angle)
    Method to counterclock wise rotate a geometry of a defined angle
    static void
    scaleGeometry(org.locationtech.jts.geom.Geometry geometry, double scale)
    Method to scale a selected geometry of a scale factor

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GeometryUtils

      public GeometryUtils()
  • Method Details

    • scaleGeometry

      public static void scaleGeometry(org.locationtech.jts.geom.Geometry geometry, double scale)
      Method to scale a selected geometry of a scale factor
      Parameters:
      geometry - the geometry to be scaled
      scale - the scale factor to apply (50 = half, 100 = no rescale, 200 = scale two times)
    • rotateGeometry

      public static void rotateGeometry(org.locationtech.jts.geom.Geometry geometry, double angle)
      Method to clock wise rotate a geometry of a defined angle
      Parameters:
      geometry - the geometry to be rotated
      angle - in degree
    • rotateGeometry

      public static void rotateGeometry(org.locationtech.jts.geom.Geometry geometry, int angle)
      Method to counterclock wise rotate a geometry of a defined angle
      Parameters:
      geometry - the geometry to be rotated
      angle - in degree
    • centerGeometry

      public static void centerGeometry(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Coordinate displacement)
      Move a geometry to a defined coordinate
      Parameters:
      geometry - the geometry to be moved
      displacement - the new geometry coordinate
    • createEmptyGeometry

      public static org.locationtech.jts.geom.Geometry createEmptyGeometry(Class geometryClass, org.locationtech.jts.geom.GeometryFactory geometryFactory)
      creates an empty geometry matching the geom type set already or an empty geom collection if that fails
      Parameters:
      geometryClass - the geometry Class
      geometryFactory - the GeometryFactory to create the empty Geometry
      Returns:
      an empty Geometry of the specified class
    • createEmptyGeometry

      public static org.locationtech.jts.geom.Geometry createEmptyGeometry(String geometryName, org.locationtech.jts.geom.GeometryFactory geometryFactory) throws ClassNotFoundException
      Throws:
      ClassNotFoundException