Package com.vividsolutions.jts.util

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


    this.geomFactory = geomFactory;
  }

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

    this.geomFactory = geomFactory;
  }

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

   *     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

   *     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

  }

  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

TOP

Related Classes of com.vividsolutions.jts.util.UniqueCoordinateArrayFilter

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.