Esempio n. 1
0
  @Override
  protected void execute() throws ProcessException {

    try {

      final Geometry geom1 = value(GEOM1, inputParameters);
      Geometry geom2 = value(GEOM2, inputParameters);

      // ensure geometries are in the same CRS
      final CoordinateReferenceSystem resultCRS = JTS.getCommonCRS(geom1, geom2);
      if (JTS.isConversionNeeded(geom1, geom2)) {
        geom2 = JTS.convertToCRS(geom2, resultCRS);
      }

      final boolean result = geom1.touches(geom2);

      getOrCreate(RESULT, outputParameters).setValue(result);

    } catch (FactoryException ex) {
      throw new ProcessException(ex.getMessage(), this, ex);
    } catch (TransformException ex) {
      throw new ProcessException(ex.getMessage(), this, ex);
    }
  }