@Test public void testConstraintGeneration() { final GeometryFactory gf = new GeometryFactory(); final Geometry multiPolygon = gf.createMultiPolygon( new Polygon[] { gf.createPolygon( new Coordinate[] { new Coordinate(20.0, 30), new Coordinate(20, 40), new Coordinate(10, 40), new Coordinate(10, 30), new Coordinate(20, 30)}), gf.createPolygon( new Coordinate[] { new Coordinate(-9, -2), new Coordinate(-9, -1), new Coordinate(-8, -1), new Coordinate(-8, -2), new Coordinate(-9, -2)})}); final Constraints constraints = GeometryUtils.basicConstraintsFromGeometry(multiPolygon); final List<MultiDimensionalNumericData> results = constraints.getIndexConstraints(new IndexImpl(new ExampleNumericIndexStrategy(), null)); assertEquals(2, results.size()); assertTrue(Arrays.equals(new double[] {10, 30}, results.get(0).getMinValuesPerDimension())); assertTrue(Arrays.equals(new double[] {20, 40}, results.get(0).getMaxValuesPerDimension())); assertTrue(Arrays.equals(new double[] {-9, -2}, results.get(1).getMinValuesPerDimension())); assertTrue(Arrays.equals(new double[] {-8, -1}, results.get(1).getMaxValuesPerDimension())); }
public static ConstraintsByClass basicConstraintsFromGeometry(final Geometry geometry) { final List<ConstraintSet> set = new LinkedList<>(); constructListOfConstraintSetsFromGeometry(geometry, set, false); return new ConstraintsByClass(set); }
GeometryUtils { public static ConstraintsByClass basicConstraintsFromGeometry(final Geometry geometry) { final List<ConstraintSet> set = new LinkedList<>(); constructListOfConstraintSetsFromGeometry(geometry, set, false); return new ConstraintsByClass(set); } }
GeometryUtils { public static ConstraintsByClass basicConstraintsFromGeometry(final Geometry geometry) { final List<ConstraintSet> set = new LinkedList<>(); constructListOfConstraintSetsFromGeometry(geometry, set, false); return new ConstraintsByClass(set); }  }
GeometryUtils { public static ConstraintsByClass basicConstraintsFromGeometry(final Geometry geometry) { final List<ConstraintSet> set = new LinkedList<>(); constructListOfConstraintSetsFromGeometry(geometry, set, false); return new ConstraintsByClass(set); }  static SpatialOperator geometryToSpatialOperator(
      final Geometry jtsGeom,
      final String geometryAttributeName); @edu.umd.cs.findbugs.annotations.SuppressFBWarnings() static CoordinateReferenceSystem getDefaultCRS(); static void initClassLoader(); static ConstraintsByClass basicConstraintsFromGeometry(final Geometry geometry); static GeoConstraintsWrapper basicGeoConstraintsWrapperFromGeometry(
      final Geometry geometry); static ConstraintSet basicConstraintSetFromEnvelope(final Envelope env); static Constraints basicConstraintsFromEnvelope(final Envelope env); static ConstraintSet basicConstraintsFromPoint(
      final double latitudeDegrees,
      final double longitudeDegrees); static MultiDimensionalNumericData getBoundsFromEnvelope(final Envelope envelope); static NumericData xRangeFromGeometry(final Geometry geometry); static NumericData yRangeFromGeometry(final Geometry geometry); static byte[] geometryToBinary(
      final Geometry geometry,
      final @Nullable Integer precision); static Geometry geometryFromBinary(
      final byte[] binary,
      final @Nullable Integer precision); static Geometry geometryFromBinary(
      final byte[] binary,
      final @Nullable Integer precision,
      final byte serializationVersion); static Geometry infinity(); static CoordinateReferenceSystem getIndexCrs(final Index[] indices); static CoordinateReferenceSystem getIndexCrs(final Index index); static String getCrsCode(final CoordinateReferenceSystem crs); static final Pair<Geometry, Double> buffer(
      final CoordinateReferenceSystem crs,
      final Geometry geometry,
      final String distanceUnits,
      final double distance); static Unit<Length> lookup(final String name); static Geometry adjustGeo(final CoordinateReferenceSystem crs, final Geometry geometry); static List<Polygon> fixRangeOfCoordinates(
      final CoordinateReferenceSystem crs,
      final Geometry geometry); static List<Polygon> constructGeometriesOverMapRegions(
      final Coordinate modifier,
      final Geometry geometry); static Coordinate adjustCoordinateToFitInRange(
      final CoordinateReferenceSystem crs,
      final Coordinate coord); static double adjustCoordinateDimensionToRange(
      final double val,
      final CoordinateReferenceSystem crs,
      final int axis); static Geometry world(final GeometryFactory factory, final CoordinateReferenceSystem crs); static SimpleFeature crsTransform(
      final SimpleFeature entry,
      final SimpleFeatureType reprojectedType,
      final MathTransform transform); }
GeometryUtils { public static ConstraintsByClass basicConstraintsFromGeometry(final Geometry geometry) { final List<ConstraintSet> set = new LinkedList<>(); constructListOfConstraintSetsFromGeometry(geometry, set, false); return new ConstraintsByClass(set); }  static SpatialOperator geometryToSpatialOperator(
      final Geometry jtsGeom,
      final String geometryAttributeName); @edu.umd.cs.findbugs.annotations.SuppressFBWarnings() static CoordinateReferenceSystem getDefaultCRS(); static void initClassLoader(); static ConstraintsByClass basicConstraintsFromGeometry(final Geometry geometry); static GeoConstraintsWrapper basicGeoConstraintsWrapperFromGeometry(
      final Geometry geometry); static ConstraintSet basicConstraintSetFromEnvelope(final Envelope env); static Constraints basicConstraintsFromEnvelope(final Envelope env); static ConstraintSet basicConstraintsFromPoint(
      final double latitudeDegrees,
      final double longitudeDegrees); static MultiDimensionalNumericData getBoundsFromEnvelope(final Envelope envelope); static NumericData xRangeFromGeometry(final Geometry geometry); static NumericData yRangeFromGeometry(final Geometry geometry); static byte[] geometryToBinary(
      final Geometry geometry,
      final @Nullable Integer precision); static Geometry geometryFromBinary(
      final byte[] binary,
      final @Nullable Integer precision); static Geometry geometryFromBinary(
      final byte[] binary,
      final @Nullable Integer precision,
      final byte serializationVersion); static Geometry infinity(); static CoordinateReferenceSystem getIndexCrs(final Index[] indices); static CoordinateReferenceSystem getIndexCrs(final Index index); static String getCrsCode(final CoordinateReferenceSystem crs); static final Pair<Geometry, Double> buffer(
      final CoordinateReferenceSystem crs,
      final Geometry geometry,
      final String distanceUnits,
      final double distance); static Unit<Length> lookup(final String name); static Geometry adjustGeo(final CoordinateReferenceSystem crs, final Geometry geometry); static List<Polygon> fixRangeOfCoordinates(
      final CoordinateReferenceSystem crs,
      final Geometry geometry); static List<Polygon> constructGeometriesOverMapRegions(
      final Coordinate modifier,
      final Geometry geometry); static Coordinate adjustCoordinateToFitInRange(
      final CoordinateReferenceSystem crs,
      final Coordinate coord); static double adjustCoordinateDimensionToRange(
      final double val,
      final CoordinateReferenceSystem crs,
      final int axis); static Geometry world(final GeometryFactory factory, final CoordinateReferenceSystem crs); static SimpleFeature crsTransform(
      final SimpleFeature entry,
      final SimpleFeatureType reprojectedType,
      final MathTransform transform); static final GeometryFactory GEOMETRY_FACTORY; static final String DEFAULT_CRS_STR; static final Integer MAX_GEOMETRY_PRECISION; }