Package org.openjump.core.ui.util
Class GeometryUtils
- java.lang.Object
-
- org.openjump.core.ui.util.GeometryUtils
-
public class GeometryUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description GeometryUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcenterGeometry(org.locationtech.jts.geom.Geometry geometry, org.locationtech.jts.geom.Coordinate displacement)Move a geometry to a defined coordinatestatic org.locationtech.jts.geom.GeometrycreateEmptyGeometry(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 failsstatic org.locationtech.jts.geom.GeometrycreateEmptyGeometry(String geometryName, org.locationtech.jts.geom.GeometryFactory geometryFactory)static voidrotateGeometry(org.locationtech.jts.geom.Geometry geometry, double angle)Method to clock wise rotate a geometry of a defined anglestatic voidrotateGeometry(org.locationtech.jts.geom.Geometry geometry, int angle)Method to counterclock wise rotate a geometry of a defined anglestatic voidscaleGeometry(org.locationtech.jts.geom.Geometry geometry, double scale)Method to scale a selected geometry of a scale factor
-
-
-
Method Detail
-
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 scaledscale- 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 rotatedangle- 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 rotatedangle- 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 moveddisplacement- 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 ClassgeometryFactory- 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
-
-