Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.MultiPoint


    Point p2 = (Point) reader.read("POINT EMPTY");
    assertTrue(p1.compareTo(p2) > 0);
  }

  public void testNormalizeMultiPoint() throws Exception {
    MultiPoint m = (MultiPoint) reader.read(
          "MULTIPOINT(30 20, 10 10, 20 20, 30 30, 20 10)");
    m.normalize();
    MultiPoint expectedValue = (MultiPoint) reader.read(
          "MULTIPOINT(10 10, 20 10, 20 20, 30 20, 30 30)");
    assertEqualsExact(expectedValue, m);
    MultiPoint unexpectedValue = (MultiPoint) reader.read(
          "MULTIPOINT(20 10, 20 20, 30 20, 30 30, 10 10)");
    assertTrue(! m.equalsExact(unexpectedValue));
  }
View Full Code Here


//    MultiPoint m = (MultiPoint) reader.read("MULTIPOINT(1.111 2.222, 3.333 4.444, 3.333 4.444)");
//    assertTrue(! m.isSimple());
//  }

  public void testGetGeometryN() throws Exception {
    MultiPoint m = (MultiPoint) reader.read("MULTIPOINT(1.111 2.222, 3.333 4.444, 3.333 4.444)");
    Geometry g = m.getGeometryN(1);
    assertTrue(g instanceof Point);
    Point p = (Point) g;
    Coordinate externalCoordinate = new Coordinate();
    Coordinate internal = p.getCoordinate();
    externalCoordinate.x = internal.x;
View Full Code Here

    assertEquals(3.333, externalCoordinate.x, 1E-10);
    assertEquals(4.444, externalCoordinate.y, 1E-10);
  }

  public void testGetEnvelope() throws Exception {
    MultiPoint m = (MultiPoint) reader.read("MULTIPOINT(1.111 2.222, 3.333 4.444, 3.333 4.444)");
    Envelope e = m.getEnvelopeInternal();
    assertEquals(1.111, e.getMinX(), 1E-10);
    assertEquals(3.333, e.getMaxX(), 1E-10);
    assertEquals(2.222, e.getMinY(), 1E-10);
    assertEquals(4.444, e.getMaxY(), 1E-10);
  }
View Full Code Here

    assertEquals(2.222, e.getMinY(), 1E-10);
    assertEquals(4.444, e.getMaxY(), 1E-10);
  }

  public void testEquals() throws Exception {
    MultiPoint m1 = (MultiPoint) reader.read("MULTIPOINT(5 6, 7 8)");
    MultiPoint m2 = (MultiPoint) reader.read("MULTIPOINT(5 6, 7 8)");
    assertTrue(m1.equals(m2));
  }
View Full Code Here

    catch (IllegalArgumentException e) {
    }
  }

  public void testEmptyMultiPoint() throws Exception {
    MultiPoint g = geometryFactory.createMultiPoint((Point[])null);
    assertEquals(0, g.getDimension());
    assertEquals(new Envelope(), g.getEnvelopeInternal());
/**
* @todo Enable when #isSimple implemented
*/
//    assertTrue(g.isSimple());
  }
View Full Code Here

//  }

  public void testLineStringGetBoundary1() throws Exception {
    LineString g = (LineString) reader.read("LINESTRING(10 10, 20 10, 15 20)");
    assertTrue(g.getBoundary() instanceof MultiPoint);
    MultiPoint boundary = (MultiPoint) g.getBoundary();
    assertTrue(boundary.getGeometryN(0).equals(g.getStartPoint()));
    assertTrue(boundary.getGeometryN(1).equals(g.getEndPoint()));
  }
View Full Code Here

  }

  public void testWriteMultiPoint() {
    Point[] points = { geometryFactory.createPoint(new Coordinate(10, 10, 0)),
                       geometryFactory.createPoint(new Coordinate(20, 20, 0)) };
    MultiPoint multiPoint = geometryFactory.createMultiPoint(points);
    assertEquals("MULTIPOINT ((10 10), (20 20))", writer.write(multiPoint).toString());
  }
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.geom.MultiPoint

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.