hydroScalingAPI.modules.networkExtraction.objects
Class Pit

java.lang.Object
  extended by hydroScalingAPI.modules.networkExtraction.objects.Pit
All Implemented Interfaces:
java.lang.Comparable

public class Pit
extends java.lang.Object
implements java.lang.Comparable

This class represent a DEM PIT. A very important feature of the terrain associated to the Network Extraction Process. In escence a Pit is a region of terrain to which part of the DEM drains into. This regions are usually artifacts of the data. The network extraction algorithm assumes that there are not interal Pits in the DEM, thus all pits are resolved by filling or cutting the DEM such that they flow to another region of the DEM or to the DEM borders. Notice that "actual" pits can exist on the terrain, such as lakes. These features must be properly identified (by -9999 values) in order to stop the algoritm from trying to solve it.

Author:
Jorge Mario Ramirez and Ricardo Mantilla

Field Summary
 boolean corregido
          A boolean flag indicating whether the Pit has been resolved
 double cota
          The elevation of the Pit.
 int grupo
          An identifier for assigned to cells that belong (drain into) the Pit.
 WorkRectangle Mc
          A WorkRectangle object describing the rectangular region that encloses the Pit's basin (set of cells that drain into the Pit)
 WorkRectangle Mp
          A WorkRectangle object describing the rectangular region that encloses the Pit
 int orden
          An index identifying the priority of the Pit with respect to all the other Pits in the DEM.
 boolean salida
          A boolean flag indicating whether an outlet has been assigned for the Pit
 
Constructor Summary
Pit(int ggrupo, double ccota, WorkRectangle MMp)
          Creates an instance of the Pit element
 
Method Summary
 int compareTo(java.lang.Object p1)
          The comparison method for the Pit
 void corrigePit(NetworkExtractionModule Proc)
          This algorithm fixes the Pit by finding a way out for the cells iside and draining to the pit
 boolean equals(java.lang.Object p1)
          The equal method for the Pit
 int getCantCPit(int[][] MD)
          Returns the size (number of pixels) in the Pit's basin
 int getCantPit(int[][] MD)
          Returns the size (number of pixels) in the Pit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

grupo

public int grupo
An identifier for assigned to cells that belong (drain into) the Pit.


orden

public int orden
An index identifying the priority of the Pit with respect to all the other Pits in the DEM. The herarchy is usually based on the Pit elevation.


salida

public boolean salida
A boolean flag indicating whether an outlet has been assigned for the Pit


Mp

public WorkRectangle Mp
A WorkRectangle object describing the rectangular region that encloses the Pit


Mc

public WorkRectangle Mc
A WorkRectangle object describing the rectangular region that encloses the Pit's basin (set of cells that drain into the Pit)


cota

public double cota
The elevation of the Pit.


corregido

public boolean corregido
A boolean flag indicating whether the Pit has been resolved

Constructor Detail

Pit

public Pit(int ggrupo,
           double ccota,
           WorkRectangle MMp)
Creates an instance of the Pit element

Parameters:
ggrupo - The Pit group ID
ccota - The Pit elevation
MMp - A WorkRectangle object describing the rectangular region that encloses the Pit
Method Detail

compareTo

public int compareTo(java.lang.Object p1)
The comparison method for the Pit

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
p1 - The Pit be compared against
Returns:
A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

equals

public boolean equals(java.lang.Object p1)
The equal method for the Pit

Overrides:
equals in class java.lang.Object
Parameters:
p1 - The Pit be compared against
Returns:
A boolean indicating if the equality holds

corrigePit

public void corrigePit(NetworkExtractionModule Proc)
This algorithm fixes the Pit by finding a way out for the cells iside and draining to the pit

Parameters:
Proc - The parent NetworkExtractionModule

getCantPit

public int getCantPit(int[][] MD)
Returns the size (number of pixels) in the Pit

Parameters:
MD - A direction matrix in which cells belonging to a Pit are labeled by the Pit group ID
Returns:
An integer with the Pit size

getCantCPit

public int getCantCPit(int[][] MD)
Returns the size (number of pixels) in the Pit's basin

Parameters:
MD - A direction matrix in which cells belonging to a Pit are labeled by the Pit group ID
Returns:
The size of the Pit's basin


CUENCAS was initially developed by Ricardo Mantilla at the University of Colorado under the supervision of Dr. Vijay K. Gupta. We wish to recognize the support from the National Science Fundation.