@Test public void testCreate_withPolygon() throws ConversionException { final Geometry geometry = jtsGeometryConverter.parse("POLYGON((5 1, 5 2, 6 2, 6 1, 5 1))"); final GeometryFilter filter = GeometryFilterFactory.create(geometry); assertTrue(filter instanceof PolygonGeometryFilter); }
public static GeometryFilter create(Geometry region) { if (region == null) { return new NoConstraintGeometryFilter(); } else if (region instanceof Polygon) { return new PolygonGeometryFilter(region); } throw new IllegalArgumentException("Unsupported region geometry: " + region.toString()); }
GeometryFilterFactory { public static GeometryFilter create(Geometry region) { if (region == null) { return new NoConstraintGeometryFilter(); } else if (region instanceof Polygon) { return new PolygonGeometryFilter(region); } throw new IllegalArgumentException("Unsupported region geometry: " + region.toString()); } }
GeometryFilterFactory { public static GeometryFilter create(Geometry region) { if (region == null) { return new NoConstraintGeometryFilter(); } else if (region instanceof Polygon) { return new PolygonGeometryFilter(region); } throw new IllegalArgumentException("Unsupported region geometry: " + region.toString()); }  }
GeometryFilterFactory { public static GeometryFilter create(Geometry region) { if (region == null) { return new NoConstraintGeometryFilter(); } else if (region instanceof Polygon) { return new PolygonGeometryFilter(region); } throw new IllegalArgumentException("Unsupported region geometry: " + region.toString()); }  static GeometryFilter create(Geometry region); }
GeometryFilterFactory { public static GeometryFilter create(Geometry region) { if (region == null) { return new NoConstraintGeometryFilter(); } else if (region instanceof Polygon) { return new PolygonGeometryFilter(region); } throw new IllegalArgumentException("Unsupported region geometry: " + region.toString()); }  static GeometryFilter create(Geometry region);  }