@Test public void testEvaluate() throws Exception { SimpleFeatureCollection featureCollection = FunctionTestFixture.polygons(); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints()); Function exp = ff.function("mincircle", ff.property("geom")); SimpleFeatureIterator iter = featureCollection.features(); while (iter.hasNext()) { SimpleFeature feature = iter.next(); Geometry geom = (Geometry) feature.getDefaultGeometry(); Geometry circle = new MinimumBoundingCircle(geom).getCircle(); Object value = exp.evaluate(feature); assertTrue(value instanceof Polygon); assertTrue(circle.equals((Geometry) value)); } iter.close(); assertNull(exp.evaluate(null)); }
public Object evaluate(Object feature) { Geometry arg0; try { arg0 = (Geometry) getExpression(0).evaluate(feature); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function minimum bounding circle argument #0 - expected type Geometry"); } return (StaticGeometry.minimumCircle(arg0)); }
FilterFunction_minimumCircle extends FunctionExpressionImpl { public Object evaluate(Object feature) { Geometry arg0; try { arg0 = (Geometry) getExpression(0).evaluate(feature); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function minimum bounding circle argument #0 - expected type Geometry"); } return (StaticGeometry.minimumCircle(arg0)); } }
FilterFunction_minimumCircle extends FunctionExpressionImpl { public Object evaluate(Object feature) { Geometry arg0; try { arg0 = (Geometry) getExpression(0).evaluate(feature); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function minimum bounding circle argument #0 - expected type Geometry"); } return (StaticGeometry.minimumCircle(arg0)); } FilterFunction_minimumCircle(); }
FilterFunction_minimumCircle extends FunctionExpressionImpl { public Object evaluate(Object feature) { Geometry arg0; try { arg0 = (Geometry) getExpression(0).evaluate(feature); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function minimum bounding circle argument #0 - expected type Geometry"); } return (StaticGeometry.minimumCircle(arg0)); } FilterFunction_minimumCircle(); Object evaluate(Object feature); }
FilterFunction_minimumCircle extends FunctionExpressionImpl { public Object evaluate(Object feature) { Geometry arg0; try { arg0 = (Geometry) getExpression(0).evaluate(feature); } catch (Exception e) { throw new IllegalArgumentException( "Filter Function problem for function minimum bounding circle argument #0 - expected type Geometry"); } return (StaticGeometry.minimumCircle(arg0)); } FilterFunction_minimumCircle(); Object evaluate(Object feature); static FunctionName NAME; }