no.uio.edd.utils.geoutils
Class GeoTransformations

java.lang.Object
  extended by no.uio.edd.utils.geoutils.GeoTransformations

public class GeoTransformations
extends java.lang.Object

A set of static methods to create and manipulate spatial objects.

Author:
oeide

Constructor Summary
GeoTransformations()
           
 
Method Summary
(package private) static double fixAngleDeg(double rotationDeg)
           
static boolean isBetween(GeoPoint centre, GeoPoint between1, GeoPoint between2)
           
static double normaliseLength(double length)
          TOOD: DOES NOT WORK
static java.lang.String rotateRectangle(double sizeX, double sizeY, double rotationDeg)
          Make a rectangle with size as specified, located with what would be the lower left corner of an west-east rectangle at origo.
static java.lang.String rotateRectangle(double sizeX, double sizeY, double rotationDeg, double offsetX, double offsetY)
          Make a rectangle with size and location (what would be the lower left corner of and west-east rectangle) as specified.
static GeoPolygon rotateRectangle(GeoPolygon polyIn, double rotationDeg)
          Make a rectangle with size and location (what would be the lower left corner of and west-east rectangle) as specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoTransformations

public GeoTransformations()
Method Detail

rotateRectangle

public static java.lang.String rotateRectangle(double sizeX,
                                               double sizeY,
                                               double rotationDeg)
Make a rectangle with size as specified, located with what would be the lower left corner of an west-east rectangle at origo. The rectangle is rotated the specified number of degrees. Rotation direction is clockwise on increased number of degrees.

Parameters:
sizeX - The size of the rectangle.
sizeY - The size of the rectangle.
rotationDeg - The number of degrees the rectangle is rotated clockwise. south-north is 0 degrees.
Returns:
A string representation of the rotated object.

rotateRectangle

public static java.lang.String rotateRectangle(double sizeX,
                                               double sizeY,
                                               double rotationDeg,
                                               double offsetX,
                                               double offsetY)
Make a rectangle with size and location (what would be the lower left corner of and west-east rectangle) as specified. The rectangle is rotated the specified number of degrees. Rotation direction is clockwise on increased number of degrees.

Parameters:
sizeX - The size of the rectangle.
sizeY - The size of the rectangle.
rotationDeg - The number of degrees the rectangle is rotated clockwise. south-north is 0 degrees.
offsetX - The offset of the starting point. 0 means at Y axis.
offsetY - The offset of the starting point. 0 means at X axis.
Returns:
A string representation of the rotated object.

rotateRectangle

public static GeoPolygon rotateRectangle(GeoPolygon polyIn,
                                         double rotationDeg)
Make a rectangle with size and location (what would be the lower left corner of and west-east rectangle) as specified. The rectangle is rotated the specified number of degrees. Rotation direction is clockwise on increased number of degrees. The input polygon is assumed to be aligned with the x and y axis. TODO: code duplication with rotateRectangle(double sizeX, double sizeY, double rotationDeg, double offsetX, double offsetY)

Parameters:
polyIn - The input rectangle.
rotationDeg - The number of degrees the rectangle is rotated clockwise. south-north is 0 degrees.
Returns:
An object representing the rotated object.

fixAngleDeg

static double fixAngleDeg(double rotationDeg)

normaliseLength

public static double normaliseLength(double length)
TOOD: DOES NOT WORK

Parameters:
length -
Returns:

isBetween

public static boolean isBetween(GeoPoint centre,
                                GeoPoint between1,
                                GeoPoint between2)