Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.LineString.equalsExact()


        assertTrue(coords2 != CompactLineString.STRAIGHT_LINE);
        assertEquals(coords.length, coords2.length);
        for (int i = 0; i < coords.length; i++)
            assertEquals(coords[i], coords2[i]);
        ls2 = CompactLineString.uncompactLineString(x1, y1, x0, y0, coords2, true);
        assertTrue(lsi.equalsExact(ls2, 0.00000015));
        LineString ls3 = CompactLineString.uncompactLineString(x1, y1, x0, y0, coords, true);
        assertTrue(lsi.equalsExact(ls3, 0.00000015));
        byte[] packedCoords2 = CompactLineString.compackLineString(x1, y1, x0, y0, ls, true);
        assertTrue(packedCoords2 != CompactLineString.STRAIGHT_LINE_PACKED);
        assertEquals(packedCoords.length, packedCoords2.length);
View Full Code Here


        // retrieve it back
        SimpleFeatureIterator fi = fs.getFeatures(FF.id(new HashSet<FeatureId>(fids))).features();
        assertTrue(fi.hasNext());
        SimpleFeature f = fi.next();
        assertTrue(ls.equalsExact((Geometry) f.getDefaultGeometry()));
        fi.close();
    }

    public void testCreateSchemaAndInsertPolyTriangle() throws Exception {
        LiteCoordinateSequenceFactory csf = new LiteCoordinateSequenceFactory();
View Full Code Here

        assertEquals(epsg4326, fr.getFeatureType().getCoordinateReferenceSystem());
        assertEquals(epsg4326, fr.getFeatureType().getGeometryDescriptor()
                .getCoordinateReferenceSystem());
        assertTrue(fr.hasNext());
        SimpleFeature f = fr.next();
        assertTrue(expected.equalsExact((Geometry) f.getDefaultGeometry()));
        fr.close();
    }

}
View Full Code Here

   
    @Test
    public void testCross() throws Exception {
        LineString ls = (LineString) wkt.read("LINESTRING(-5 -5, 15 15)");
        LineString clipped = (LineString) clipper.clip(ls, false);
        assertTrue(clipped.equalsExact(wkt.read("LINESTRING(0 0, 10 10)")));
        showResult("Cross", ls, clipped);
    }
   
    @Test
    public void testTouchLine() throws Exception {
View Full Code Here

   
    @Test
    public void testTouchLine() throws Exception {
        LineString ls = (LineString) wkt.read("LINESTRING(0 0, 0 10)");
        LineString clipped = (LineString) clipper.clip(ls, false);
        assertTrue(clipped.equalsExact(ls));
        showResult("Touch border", ls, clipped);
    }
   
    @Test
    public void testTouchPoint() throws Exception {
View Full Code Here

  public void test1() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    LineString lineString = (LineString) reader.read("LINESTRING (30 220, 240 220, 240 220)");
    LineString convexHull = (LineString) reader.read("LINESTRING (30 220, 240 220)");
    assertTrue(convexHull.equalsExact(lineString.convexHull()));
  }

  public void test2() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)");
View Full Code Here

  public void test2() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (130 240, 130 240, 130 240, 570 240, 570 240, 570 240, 650 240)");
    LineString convexHull = (LineString) reader.read("LINESTRING (130 240, 650 240)");
    assertTrue(convexHull.equalsExact(geometry.convexHull()));
  }

  public void test3() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (0 0, 0 0, 10 0)");
View Full Code Here

  public void test3() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (0 0, 0 0, 10 0)");
    LineString convexHull = (LineString) reader.read("LINESTRING (0 0, 10 0)");
    assertTrue(convexHull.equalsExact(geometry.convexHull()));
  }

  public void test4() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (0 0, 10 0, 10 0)");
View Full Code Here

  public void test4() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (0 0, 10 0, 10 0)");
    LineString convexHull = (LineString) reader.read("LINESTRING (0 0, 10 0)");
    assertTrue(convexHull.equalsExact(geometry.convexHull()));
  }

  public void test5() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (0 0, 5 0, 10 0)");
View Full Code Here

  public void test5() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry geometry = reader.read("MULTIPOINT (0 0, 5 0, 10 0)");
    LineString convexHull = (LineString) reader.read("LINESTRING (0 0, 10 0)");
    assertTrue(convexHull.equalsExact(geometry.convexHull()));
  }

  public void test6() throws Exception {
    WKTReader reader = new WKTReader(new GeometryFactory(new PrecisionModel(1), 0));
    Geometry actualGeometry = reader.read("MULTIPOINT (0 0, 5 1, 10 0)").convexHull();
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.