org.opensha.commons.geo
Class RegionUtils
java.lang.Object
org.opensha.commons.geo.RegionUtils
public class RegionUtils
- extends Object
Add comments here
- Version:
- $Id: RegionUtils.java 8975 2012-05-18 16:22:48Z pmpowers $
- Author:
- Peter Powers
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegionUtils
public RegionUtils()
regionToKML
public static void regionToKML(Region region,
String filename,
Color c)
locListToKML
public static void locListToKML(LocationList locs,
String filename,
Color c)
getFractionInside
public static double getFractionInside(Region region,
Iterable<Location> locs)
throws NullPointerException,
IllegalArgumentException
- The returns the fraction of points in the given collection of locations that is inside
the given region. This will commonly be used with the
AbstractEvenlyGriddedSurface class
to determine the fraction of a fault surface that is inside of a region.
- Parameters:
region - the region for which to testlocs - any instance of Iterable, for example, ArrayList or EvenlyGriddedSurface.
- Returns:
- fraction of locations inside the given region
- Throws:
NullPointerException - if region or locs is null
IllegalArgumentException - if locs is empty
getNodeShape
public static Area getNodeShape(Location p,
double w,
double h)
- Returns the
Region spanned by a node centered at the supplied
location with the given width and height.
- Parameters:
p - Location at center of a grid nodew - node widthh - node height
- Returns:
- the node's
Region
main
public static void main(String[] args)