private boolean isErodedCompletely(LinearRing ring,double bufferDistance){
  Coordinate[] ringCoord=ring.getCoordinates();
  double minDiam=0.0;
  if (ringCoord.length < 4)   return bufferDistance < 0;
  if (ringCoord.length == 4)   return isTriangleErodedCompletely(ringCoord,bufferDistance);
  Envelope env=ring.getEnvelopeInternal();
  double envMinDimension=Math.min(env.getHeight(),env.getWidth());
  if (bufferDistance < 0.0 && 2 * Math.abs(bufferDistance) > envMinDimension)   return true;
  return false;
}

private boolean isErodedCompletely ( LinearRing ring , double bufferDistance ) { Coordinate [ ] ringCoord = ring . getCoordinates ( ) ; double minDiam = 0.0 ; if ( ringCoord . length < 4 ) return bufferDistance < 0 ; if ( ringCoord . length == 4 ) return isTriangleErodedCompletely ( ringCoord , bufferDistance ) ; Envelope env = ring . getEnvelopeInternal ( ) ; double envMinDimension = Math . min ( env . getHeight ( ) , env . getWidth ( ) ) ; if ( bufferDistance < 0.0 && 2 * Math . abs ( bufferDistance ) > envMinDimension ) return true ; return false ; }
the ringcoord is assumed to contain no repeated points . it may be degenerate ( i . e . contain only 1 , 2 , or 3 points ) . in this case it has no area , and hence has a minimum diameter of 0 .
