code: public Geometry getGeometry( List<PfafstetterNumber> limit, IHMProgressMonitor pm, boolean doMonitor ) {
  
          if (limit == null && totalGeometryUpstream != null) {
              return totalGeometryUpstream;
          }
  
          List<Geometry> geometries = new ArrayList<Geometry>();
          geometries.add((Geometry) hillslopeFeature.getDefaultGeometry());
          getAllUpstreamElementsGeometries(geometries, limit, this);
          GeometryFactory gFactory = new GeometryFactory();
          /*
           * join the geoms to a single one
           */
          Geometry runningGeometry = geometries.get(0);
          if (doMonitor)
              pm.beginTask("Estrazione geometrie dei bacini elementari a monte", geometries.size() - 1);
          for( int i = 1; i < geometries.size(); i++ ) {
              if (doMonitor) {
                  pm.worked(1);
              } else {
                  pm.subTask("Unione geometrie " + i + "/" + (geometries.size() - 1));
              }
              List<Geometry> tmp = new ArrayList<Geometry>(2);
              tmp.add(runningGeometry);
              tmp.add(geometries.get(i));
              Geometry gCollection = gFactory.buildGeometry(tmp);
              runningGeometry = gCollection.buffer(0.0);
          }
          pm.subTask("");
          if (doMonitor)
              pm.done();
  
          // keep the total geometry, in case it is asked again
          if (limit == null) {
              totalGeometryUpstream = runningGeometry;
          }
  
          return runningGeometry;
          // return gCollection.buffer(0.0);
      }
docs: /* (non-Javadoc)
  @see org.hortonmachine.hmachine.modules.hydrogeomorphology.adige.core.IHillSlope#getGeometry(java.util.List, org.hortonmachine.gears.libs.monitor.IHMProgressMonitor, boolean)