/** * Check if it requires the addition of a neighbor vertex. * * @param geomToAddVertex * @return True if it requires. */ private boolean requireVertex(Geometry geomToAddVertex) { for (Geometry geomNeighbor : originalGeometryList) { if (geomToAddVertex.touches(geomNeighbor)) { return true; } } return false; }
@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); } }
/** * Returns a boolean value that shows if this geometry touches the specified geometry. * * @param node1 xml element containing gml object(s) * @param node2 xml element containing gml object(s) * @return boolean value * @throws QueryException query exception */ @Deterministic public Bln touches(final ANode node1, final ANode node2) throws QueryException { final Geometry geo1 = checkGeo(node1); final Geometry geo2 = checkGeo(node2); return Bln.get(geo1.touches(geo2)); }
public boolean evaluateInternal(Geometry left, Geometry right) { return left.touches(right); }