org.deegree.geometry.utils
Class GeometryUtils

java.lang.Object
  extended by org.deegree.geometry.utils.GeometryUtils

public class GeometryUtils
extends Object

GeometryUtils

Version:
$Revision: 31641 $, $Date: 2011-08-24 21:24:55 +0200 (Wed, 24 Aug 2011) $
Author:
Andreas Schmitz, last edited by: $Author: mschneider $

Constructor Summary
GeometryUtils()
           
 
Method Summary
static Envelope createConvertedEnvelope(Envelope sourceEnvelope, ICRS targetCRS)
          Converts the given Envelope into an envelope with the given coordinate system.
static float[] createEnvelope(Envelope validDomain)
          Creates float array out of an envelope (Geometry).
static Envelope createEnvelope(float[] env, CRS crs)
           
static Polygon envelopeToPolygon(Envelope env)
           
static LinkedList<Double> measurePathLengths(Shape shape)
          This method flattens the path with a flatness parameter of 1.
static Geometry move(Geometry geom, double offx, double offy)
          Moves the coordinates of a geometry.
static String prettyPrintShape(Shape shape)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryUtils

public GeometryUtils()
Method Detail

envelopeToPolygon

public static Polygon envelopeToPolygon(Envelope env)
Parameters:
env -
Returns:
a polygon

move

public static Geometry move(Geometry geom,
                            double offx,
                            double offy)
Moves the coordinates of a geometry.

Parameters:
geom - use only surfaces, line strings or points, and only with dim == 2
offx -
offy -
Returns:
the moved geometry

prettyPrintShape

public static String prettyPrintShape(Shape shape)
Parameters:
shape -
Returns:
a string representation of the shape

measurePathLengths

public static LinkedList<Double> measurePathLengths(Shape shape)
This method flattens the path with a flatness parameter of 1.

Parameters:
shape -
Returns:
the path segment lengths

createConvertedEnvelope

public static Envelope createConvertedEnvelope(Envelope sourceEnvelope,
                                               ICRS targetCRS)
                                        throws TransformationException
Converts the given Envelope into an envelope with the given coordinate system. Basically this is a delegate call to the GeometryTransformer.

Parameters:
sourceEnvelope - to convert
targetCRS -
Returns:
the target Envelope
Throws:
TransformationException
TransformationException - if the transformation between the source and target crs cannot be created.

createEnvelope

public static final float[] createEnvelope(Envelope validDomain)
Creates float array out of an envelope (Geometry).

Parameters:
validDomain -
Returns:
a float[] representation of the given envelope

createEnvelope

public static final Envelope createEnvelope(float[] env,
                                            CRS crs)
Parameters:
env -
crs -
Returns:
reverse of the other createEnvelope method


Copyright © 2011. All Rights Reserved.