Java 类com.vividsolutions.jts.geom.impl.CoordinateArraySequenceFactory 实例源码

项目:jts    文件:GeometryFactoryTest.java   
/**
   * 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());

}
项目:Earth    文件:GeometryFactory.java   
private static CoordinateSequenceFactory getDefaultCoordinateSequenceFactory() {
    return CoordinateArraySequenceFactory.instance();
}
项目:jts    文件:GeometryFactory.java   
private static CoordinateSequenceFactory getDefaultCoordinateSequenceFactory() {
    return CoordinateArraySequenceFactory.instance();
}