RePast
v. 2.0

uchicago.src.sim.gis
Class GisUtilities

java.lang.Object
  |
  +--uchicago.src.sim.gis.GisUtilities

public class GisUtilities
extends Object

This is a set of useful gis tools that are not included in any of the third party libraries. If something isn't in here, it may well be in either the JTS libraries or Geotools.


Field Summary
static int KILOMETERS
          Great Circle distance of the Earth in Kilometers.
static int METERS
          Great Circle distance of the Earth in Meters.
static int MILES
          Great Circle distance of the Earth in Miles.
 
Constructor Summary
GisUtilities()
           
 
Method Summary
static double getDistance(com.vividsolutions.jts.geom.Coordinate c1, com.vividsolutions.jts.geom.Coordinate c2)
          Calculates the distance between two points using the haversine formula.
static double getDistance(com.vividsolutions.jts.geom.Coordinate c1, com.vividsolutions.jts.geom.Coordinate c2, int measure)
          Calculates the distance between two points using the haversine formula.
static double getDistance(double x1, double x2, double y1, double y2)
          Calculates the distance between two points using the haversine formula.
static double getDistance(double x1, double x2, double y1, double y2, int measure)
          Calculates the distance between two points using the haversine formula.
static com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory()
          Get a singleton version of a JTS GeometryFactory, which is used to create the Geometries (not the feature data).
static com.vividsolutions.jts.geom.Coordinate getPolygonCenterOfMass(com.vividsolutions.jts.geom.Geometry poly)
          Returns the Center of Mass or centroid of the polygon.
static double polygonArea(com.vividsolutions.jts.geom.Coordinate[] polygon, int N)
          This calculates the area of a polygon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METERS

public static final int METERS
Great Circle distance of the Earth in Meters. Used in the distance formula.

See Also:
Constant Field Values

KILOMETERS

public static final int KILOMETERS
Great Circle distance of the Earth in Kilometers. Used in the distance formula.

See Also:
Constant Field Values

MILES

public static final int MILES
Great Circle distance of the Earth in Miles. Used in the distance formula.

See Also:
Constant Field Values
Constructor Detail

GisUtilities

public GisUtilities()
Method Detail

getGeometryFactory

public static com.vividsolutions.jts.geom.GeometryFactory getGeometryFactory()
Get a singleton version of a JTS GeometryFactory, which is used to create the Geometries (not the feature data).

Returns:
The GeometryFactory

polygonArea

public static double polygonArea(com.vividsolutions.jts.geom.Coordinate[] polygon,
                                 int N)
This calculates the area of a polygon.

Parameters:
polygon -
N -
Returns:

getPolygonCenterOfMass

public static com.vividsolutions.jts.geom.Coordinate getPolygonCenterOfMass(com.vividsolutions.jts.geom.Geometry poly)
Returns the Center of Mass or centroid of the polygon. It is

Parameters:
poly -
Returns:

getDistance

public static double getDistance(com.vividsolutions.jts.geom.Coordinate c1,
                                 com.vividsolutions.jts.geom.Coordinate c2,
                                 int measure)
Calculates the distance between two points using the haversine formula. The haversine formula requires the great circle distance in some measure. The results will be in the same units as that measure

Parameters:
c1 -
c2 -
measure - This is the distance of the great circle in meters, km, or miles
Returns:

getDistance

public static double getDistance(com.vividsolutions.jts.geom.Coordinate c1,
                                 com.vividsolutions.jts.geom.Coordinate c2)
Calculates the distance between two points using the haversine formula. The haversine formula requires the great circle distance in some measure. This returns km.

Parameters:
c1 -
c2 -
Returns:

getDistance

public static double getDistance(double x1,
                                 double x2,
                                 double y1,
                                 double y2)
Calculates the distance between two points using the haversine formula. The haversine formula requires the great circle distance in some measure. This returns km.

Parameters:
x1 -
x2 -
y1 -
y2 -
Returns:

getDistance

public static double getDistance(double x1,
                                 double x2,
                                 double y1,
                                 double y2,
                                 int measure)
Calculates the distance between two points using the haversine formula. The haversine formula requires the great circle distance in some measure. This is the distance of the great circle in meters, km, or miles

Parameters:
x1 -
x2 -
y1 -
y2 -
measure - This is the distance of the great circle in meters, km, or miles
Returns:

RePast
v. 2.0

Bug reports and feature requests to RePast