Examples of UniqueCoordinateArrayFilter


Examples of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter

    this.geomFactory = geomFactory;
  }

  private static Coordinate[] extractCoordinates(Geometry geom)
  {
    UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
    geom.apply(filter);
    return filter.getCoordinates();
  }
View Full Code Here

Examples of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter

    this.geomFactory = geomFactory;
  }

  private static Coordinate[] extractCoordinates(Geometry geom)
  {
    UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
    geom.apply(filter);
    return filter.getCoordinates();
  }
View Full Code Here

Examples of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter

    this.geomFactory = geomFactory;
  }

  private static Coordinate[] extractCoordinates(Geometry geom)
  {
    UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
    geom.apply(filter);
    return filter.getCoordinates();
  }
View Full Code Here

Examples of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter

   *     input geometry
   * @return
   *     a geometry collection
   */
  private static GeometryCollection transformIntoPointGeometryCollection(Geometry geom) {
    UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
    geom.apply(filter);
    Coordinate[] coord = filter.getCoordinates();
   
    Geometry[] geometries = new Geometry[coord.length];
    for (int i = 0 ; i < coord.length ; i++) {
      Coordinate[] c = new Coordinate[] { coord[i] };
      CoordinateArraySequence cs = new CoordinateArraySequence(c);
View Full Code Here

Examples of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter

   *     input geometry
   * @return
   *     a geometry collection
   */
  private static GeometryCollection transformIntoPointGeometryCollection(GeometryCollection gc) {
    UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
    gc.apply(filter);
    Coordinate[] coord = filter.getCoordinates();
   
    Geometry[] geometries = new Geometry[coord.length];
    for (int i = 0 ; i < coord.length ; i++) {
      Coordinate[] c = new Coordinate[] { coord[i] };
      CoordinateArraySequence cs = new CoordinateArraySequence(c);
View Full Code Here

Examples of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter

  }

  public void testUniqueCoordinateArrayFilter() throws Exception {
    Geometry g = reader.read(
          "MULTIPOINT(10 10, 20 20, 30 30, 20 20, 10 10)");
    UniqueCoordinateArrayFilter f = new UniqueCoordinateArrayFilter();
    g.apply(f);
    assertEquals(3, f.getCoordinates().length);
    assertEquals(new Coordinate(10, 10), f.getCoordinates()[0]);
    assertEquals(new Coordinate(20, 20), f.getCoordinates()[1]);
    assertEquals(new Coordinate(30, 30), f.getCoordinates()[2]);
  }
View Full Code Here

Examples of org.geotools.geometry.iso.topograph2D.util.UniqueCoordinateArrayFilter

      // Add control points of exterior ring
      positions = new ArrayList<DirectPositionImpl>();
      positions = ((RingImplUnsafe)((SurfaceBoundaryImpl)geom).getExterior()).asDirectPositions();
    }
   
    UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();

    // Filter all coordinates to eleminate redudant coordinates
    Iterator posIter = positions.iterator();
    while (posIter.hasNext()) {
      Object pos = posIter.next();
      if (pos instanceof DirectPositionImpl) {
        filter.filter(new Coordinate(((DirectPositionImpl)pos).getCoordinate()));
      } else if (pos instanceof PointImpl) {
        filter.filter(new Coordinate(((PointImpl)pos).getPosition().getCoordinate()));
      } else
        Assert.isTrue(false, "Invalid coordinate type");
    }
   
    return filter.getCoordinates();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.