jwo.landserf.process.proj
Class TimeSpace

java.lang.Object
  extended byjwo.landserf.process.proj.TimeSpace
All Implemented Interfaces:
Transformable

public class TimeSpace
extends Object
implements Transformable

Class for representing Mayhew time-space transformations. Projection is effectively a Lambert type transformation with u = lambda.x where lambda is orbital travel time over 2*PI v = 1/omega * ln(r/r0) where omega is the angular velocity in radians per time units (usually hours), r is the distance from a given centre point (e.g. centre of a city) and r0 is a constant that relates to the radius of the central zone.

Version:
2.2, 13th May, 2004.
Author:
Jo Wood taken from method suggested by Les Mayhew, 2004.

Field Summary
static int FROM_TIME_SPACE
          Indicates a transformation from time-space to planar.
static int TO_TIME_SPACE
          Indicates a transformation to time-space from planar coordinates.
 
Constructor Summary
TimeSpace(int direction, float centreX, float centreY, float r0, float lambda, float omega)
          Initialises the time-space converter.
 
Method Summary
 boolean doInterpolation()
          Indicates whether the transformation should use nearest neighbour (false) or some interpolator (true).
 String getDescription()
          Provides a general description of the transformation.
 Footprint invTransformCoords(Footprint fpIn)
          Performs an inverse planar time-space transformation on the given location.
static void main(String[] args)
          Generates a sample grid to test projection.
 Footprint planarToTimeSpace(float x, float y)
          Converts the given planar coordinates into a their time-space location.
 void setInterpolation(boolean doInterpolation)
          Sets whether the transformation should use nearest neighbour (false) or some interpolator (true).
 Footprint timeSpaceToPlanar(float u, float v)
          Converts the given time-space coordinates into a their planar location.
 Footprint transformCoords(Footprint fpIn)
          Performs a forward planar time-space transformation on the given location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FROM_TIME_SPACE

public static final int FROM_TIME_SPACE
Indicates a transformation from time-space to planar.

See Also:
Constant Field Values

TO_TIME_SPACE

public static final int TO_TIME_SPACE
Indicates a transformation to time-space from planar coordinates.

See Also:
Constant Field Values
Constructor Detail

TimeSpace

public TimeSpace(int direction,
                 float centreX,
                 float centreY,
                 float r0,
                 float lambda,
                 float omega)
Initialises the time-space converter. Note that r0 should be in same distance units as coordinates centreX and centreY. Angular velocity omega will determine the time units used for the transformation.

Parameters:
centreX - Centre x coordinate from which radial distances measured.
centreY - Centre y coordinate from which radial distances measured.
r0 - Radius of central zone.
lambda - orbital speed coefficient.
omega - Radial speed coefficient.
Method Detail

main

public static void main(String[] args)
Generates a sample grid to test projection.

Parameters:
args - Command line arguements (ignored).

transformCoords

public Footprint transformCoords(Footprint fpIn)
Performs a forward planar time-space transformation on the given location. Note that the actual direction of the transformation is determined by the value of 'direction' in the constructor. If set to TO_TIME_SPACE this method will convert from planar into time-space, if set to FROM_TIME_SPACE it will convert from time-space into planar coordinates.

Specified by:
transformCoords in interface Transformable
Parameters:
fpIn - Incoming footprint to transform.
Returns:
Transformed footprint.

invTransformCoords

public Footprint invTransformCoords(Footprint fpIn)
Performs an inverse planar time-space transformation on the given location. Note that the actual direction of the transformation is determined by the value of 'direction' in the constructor. If set to TO_TIME_SPACE this method will convert from time-space to planar coordinates, if set to FROM_TIME_SPACE it will convert from planar to time-space coordinates.

Specified by:
invTransformCoords in interface Transformable
Parameters:
fpIn - Incoming footprint to transform.
Returns:
Transformed footprint.

getDescription

public String getDescription()
Provides a general description of the transformation.

Specified by:
getDescription in interface Transformable
Returns:
Description of the transformation.

doInterpolation

public boolean doInterpolation()
Indicates whether the transformation should use nearest neighbour (false) or some interpolator (true).

Specified by:
doInterpolation in interface Transformable
Returns:
True if transformation should perform some local interpolation.

setInterpolation

public void setInterpolation(boolean doInterpolation)
Sets whether the transformation should use nearest neighbour (false) or some interpolator (true).

Parameters:
doInterpolation - True if transformation should perform some local interpolation.

planarToTimeSpace

public Footprint planarToTimeSpace(float x,
                                   float y)
Converts the given planar coordinates into a their time-space location.

Parameters:
x - x-coordinate measured in distance units (e.g OSGB, UTM)
y - y-coordinate measured in distance units (e.g OSGB, UTM)
Returns:
timeSpace location.

timeSpaceToPlanar

public Footprint timeSpaceToPlanar(float u,
                                   float v)
Converts the given time-space coordinates into a their planar location.

Parameters:
u - x-coordinate measured in time units.
v - y-coordinate measured in time units.
Returns:
Planar location.


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005