Package com.vividsolutions.jts.generator

Examples of com.vividsolutions.jts.generator.GridGenerator


  /**
   * Round Trip test for a 100 non overlapping points
   * @throws SQLException
   */
  public void testGridPointsRoundTrip() throws SQLException{
    GridGenerator grid = new GridGenerator();
    grid.setGeometryFactory(geometryFactory);
    grid.setBoundingBox(new Envelope(0,10,0,10));
    grid.setNumberColumns(10);
    grid.setNumberRows(10);
   
    Point[] pt = new Point[100];
    STRUCT[] st = new STRUCT[100];

    PointGenerator pg = new PointGenerator();
    pg.setGeometryFactory(geometryFactory);
    OraWriter ow = new OraWriter(getConnection());
   
    int i=0;
    while(grid.canCreate() && i<100){
      pg.setBoundingBox(grid.createEnv());
      pt[i] = (Point) pg.create();
      st[i] = ow.write(pt[i]);
      i++;
    }
   
View Full Code Here


  /**
   * Round Trip test for a 8 overlapping points (4 distinct points)
   * @throws SQLException
   */
  public void testOverlappingPointsRoundTrip() throws SQLException{
    GridGenerator grid = new GridGenerator();
    grid.setGeometryFactory(geometryFactory);
    grid.setBoundingBox(new Envelope(0,10,0,10));
    grid.setNumberColumns(2);
    grid.setNumberRows(2);
   
    Point[] pt = new Point[4];
    STRUCT[] st = new STRUCT[8];

    PointGenerator pg = new PointGenerator();
    pg.setGeometryFactory(geometryFactory);
    OraWriter ow = new OraWriter(getConnection());
   
    int i=0;
    while(grid.canCreate() && i<8){
      pg.setBoundingBox(grid.createEnv());
      pt[i] = (Point) pg.create();
      st[i] = ow.write(pt[i]);
      i++;
    }
    for(int j=0;j<4;j++){
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.generator.GridGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.