DimensionInfo implements Serializable { public static DimensionInfo findCollection(List<? extends Geometry> geometries, Geometry geometry) { Coordinate coordinate; if (geometries.isEmpty()) { coordinate = XY_COORDINATE; } else { Geometry geom = geometries.get(0); coordinate = geom.getCoordinate(); } return find(coordinate, geometry); } DimensionInfo(CoordinateSequenceDimensions coordinateSequenceDimensions, int topological);  DimensionInfo(int coordinate, int spatial, int topological); static int findSpatialDimension(CoordinateSequenceDimensions dims); static int findCoordinateDimension(CoordinateSequenceDimensions dims); static DimensionInfo find(Coordinate coordinate, Geometry geometry); static DimensionInfo find(Coordinate[] coordinates, Geometry geometry); static DimensionInfo find(List<Coordinate> coordinates, Geometry geometry); static DimensionInfo findCollection(List<? extends Geometry> geometries, Geometry geometry); int getCoordinate(); int getSpatial(); int getTopological(); boolean isPoint(); boolean isLine(); boolean isArea(); CoordinateSequenceDimensions getDimensions(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static DimensionInfo XY_POINT; static DimensionInfo XYZ_POINT; static DimensionInfo XYM_POINT; static DimensionInfo XYZM_POINT; static DimensionInfo XY_LINESTRING; static DimensionInfo XYZ_LINESTRING; static DimensionInfo XYM_LINESTRING; static DimensionInfo XYZM_LINESTRING; static DimensionInfo XY_POLYGON; static DimensionInfo XYZ_POLYGON; static DimensionInfo XYM_POLYGON; static DimensionInfo XYZM_POLYGON; }
@Test public void testFindCollection() { GeometryFactory factory = new GeometryFactory(); List<Point> points = Arrays.asList(factory.createPoint(new Coordinate(1.0, 2.0)), factory.createPoint(new Coordinate(10.0, 20.0))); Geometry geometry = factory.createMultiPoint(points.toArray(new Point[points.size()])); DimensionInfo expResult = DimensionInfo.XY_POINT; DimensionInfo result = DimensionInfo.findCollection(points, geometry); assertEquals(expResult, result); }