@Test public void testCoordinateDimensionPolygonEmptyLite3D() { Geometry geom = liteGF.createPolygon( liteGF.createLinearRing(liteCSF.create(new double[0], 3)), null); assertEquals(3, CoordinateSequences.coordinateDimension(geom)); }
public static int coordinateDimension(Geometry g) { if (g instanceof CurvedGeometry<?>) { return ((CurvedGeometry<?>) g).getCoordinatesDimension(); } if (g instanceof Point) return coordinateDimension(((Point) g).getCoordinateSequence()); if (g instanceof LineString) return coordinateDimension(((LineString) g).getCoordinateSequence()); if (g instanceof Polygon) return coordinateDimension(((Polygon) g).getExteriorRing().getCoordinateSequence()); CoordinateSequence cs = CoordinateSequenceFinder.find(g); return coordinateDimension(cs); }
CoordinateSequences extends org.locationtech.jts.geom.CoordinateSequences { public static int coordinateDimension(Geometry g) { if (g instanceof CurvedGeometry<?>) { return ((CurvedGeometry<?>) g).getCoordinatesDimension(); } if (g instanceof Point) return coordinateDimension(((Point) g).getCoordinateSequence()); if (g instanceof LineString) return coordinateDimension(((LineString) g).getCoordinateSequence()); if (g instanceof Polygon) return coordinateDimension(((Polygon) g).getExteriorRing().getCoordinateSequence()); CoordinateSequence cs = CoordinateSequenceFinder.find(g); return coordinateDimension(cs); } }
CoordinateSequences extends org.locationtech.jts.geom.CoordinateSequences { public static int coordinateDimension(Geometry g) { if (g instanceof CurvedGeometry<?>) { return ((CurvedGeometry<?>) g).getCoordinatesDimension(); } if (g instanceof Point) return coordinateDimension(((Point) g).getCoordinateSequence()); if (g instanceof LineString) return coordinateDimension(((LineString) g).getCoordinateSequence()); if (g instanceof Polygon) return coordinateDimension(((Polygon) g).getExteriorRing().getCoordinateSequence()); CoordinateSequence cs = CoordinateSequenceFinder.find(g); return coordinateDimension(cs); }  }
CoordinateSequences extends org.locationtech.jts.geom.CoordinateSequences { public static int coordinateDimension(Geometry g) { if (g instanceof CurvedGeometry<?>) { return ((CurvedGeometry<?>) g).getCoordinatesDimension(); } if (g instanceof Point) return coordinateDimension(((Point) g).getCoordinateSequence()); if (g instanceof LineString) return coordinateDimension(((LineString) g).getCoordinateSequence()); if (g instanceof Polygon) return coordinateDimension(((Polygon) g).getExteriorRing().getCoordinateSequence()); CoordinateSequence cs = CoordinateSequenceFinder.find(g); return coordinateDimension(cs); }  static boolean isCCW(CoordinateSequence ring); static int computeOrientation(CoordinateSequence cs, int p1, int p2, int q); static int coordinateDimension(Geometry g); static int coordinateDimension(CoordinateSequence seq); static boolean equalsND(Geometry g1, Geometry g2); }
CoordinateSequences extends org.locationtech.jts.geom.CoordinateSequences { public static int coordinateDimension(Geometry g) { if (g instanceof CurvedGeometry<?>) { return ((CurvedGeometry<?>) g).getCoordinatesDimension(); } if (g instanceof Point) return coordinateDimension(((Point) g).getCoordinateSequence()); if (g instanceof LineString) return coordinateDimension(((LineString) g).getCoordinateSequence()); if (g instanceof Polygon) return coordinateDimension(((Polygon) g).getExteriorRing().getCoordinateSequence()); CoordinateSequence cs = CoordinateSequenceFinder.find(g); return coordinateDimension(cs); }  static boolean isCCW(CoordinateSequence ring); static int computeOrientation(CoordinateSequence cs, int p1, int p2, int q); static int coordinateDimension(Geometry g); static int coordinateDimension(CoordinateSequence seq); static boolean equalsND(Geometry g1, Geometry g2);  }