@Override public boolean contains( Geometry geometry ) { return getReferencedObject().contains( geometry ); }
@Override public <T> boolean evaluate( T obj, XPathEvaluator<T> xpathEvaluator ) throws FilterEvaluationException { for ( TypedObjectNode paramValue : propName.evaluate( obj, xpathEvaluator ) ) { Geometry geom = checkGeometryOrNull( paramValue ); if ( geom != null ) { Geometry transformedLiteral = getCompatibleGeometry( geom, geometry ); return geom.contains( transformedLiteral ); } } return false; }
@Override public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info ) throws ProcessletException { ComplexInput gmlInput1 = (ComplexInput) in.getParameter( "GMLInput1" ); ComplexInput gmlInput2 = (ComplexInput) in.getParameter( "GMLInput2" ); Geometry geometry1 = readGeometry( gmlInput1 ); Geometry geometry2 = readGeometry( gmlInput2 ); boolean contains = geometry1.contains( geometry2 ); LiteralOutput containsOutput = (LiteralOutput) out.getParameter( "Contains" ); containsOutput.setValue( String.valueOf( contains ) ); }
Geometry clipGeometry( final Geometry geom, Geometry clippingArea ) { if ( clippingArea != null && !clippingArea.contains( geom ) ) { try { Geometry clippedGeometry = clippingArea.getIntersection( geom ); if ( clippedGeometry == null ) { return null; } com.vividsolutions.jts.geom.Geometry jtsOrig = ( (AbstractDefaultGeometry) geom ).getJTSGeometry(); com.vividsolutions.jts.geom.Geometry jtsClipped = ( (AbstractDefaultGeometry) clippedGeometry ).getJTSGeometry(); if ( jtsOrig == jtsClipped ) { return geom; } if ( isInvertedOrientation( jtsOrig ) ) { return clippedGeometry; } return fixOrientation( clippedGeometry, clippedGeometry.getCoordinateSystem() ); } catch ( UnsupportedOperationException e ) { // use original geometry if intersection not supported by JTS return geom; } } return geom; }