/** * CoordinateArraySequences default their dimension to 3 unless explicitly told otherwise. * This test ensures that GeometryFactory.createGeometry() recreates the input dimension properly. * * @throws ParseException */ public void testCopyGeometryWithNonDefaultDimension() throws ParseException { GeometryFactory gf = new GeometryFactory(CoordinateArraySequenceFactory.instance()); CoordinateSequence mpSeq = gf.getCoordinateSequenceFactory().create(1, 2); mpSeq.setOrdinate(0, 0, 50); mpSeq.setOrdinate(0, 1, -2); Point g = gf.createPoint(mpSeq); CoordinateSequence pSeq = ((Point) g.getGeometryN(0)).getCoordinateSequence(); assertEquals(2, pSeq.getDimension()); Point g2 = (Point) geometryFactory.createGeometry(g); assertEquals(2, g2.getCoordinateSequence().getDimension()); }
private static CoordinateSequenceFactory getDefaultCoordinateSequenceFactory() { return CoordinateArraySequenceFactory.instance(); }