Package chunmap.model.geom

Examples of chunmap.model.geom.LineString


  WktReader reader=new WktReader();
  @Test
  public void testHasIntersection() {
    Geometry g=reader.read("LINESTRING(92.28571428571429 100.21428571428572,93.71428571428571 100.21428571428572,93.71428571428571 101.64285714285715,92.28571428571429 101.64285714285715,92.28571428571429 100.21428571428572)");
    Geometry g2=reader.read("LINESTRING(0.0 100.0,100.0 101.0)");
    LineString ls=(LineString)g;
    LineString ls2=(LineString)g2;
    Assert.assertTrue(LineAlgorithm.hasIntersection(ls.getPoints(), ls2.getPoints()));
  }
View Full Code Here


    CPoint ep = new Coordinate2D(5, 5);
    assertTrue(p.equals(ep));

    LineSegment lseg3 = new LineSegment(p5, p6);

    LineString l = new LineString((CPoint[]) lseg1.intersection(lseg3));
    assertTrue(l.toString().equals("LINESTRING(0.0 0.0,5.0 5.0)"));

    LineSegment lseg4 = new LineSegment(p6, p7);

    assertTrue(lseg1.intersection(lseg4) == null);
  }
View Full Code Here

  @Test
  public void testGetIM() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1 1,1 2,2 2,3 2)");
    LineString ls = (LineString) g;
    Geometry g2 = wkt.read("LINESTRING(1 2,2 2,3 2,4 2)");
    LineString ls2 = (LineString) g2;
    Geometry g3 = wkt.read("LINESTRING(1 2,2 2,3 2)");
    LineString ls3 = (LineString) g3;
    Geometry g4 = wkt.read("LINESTRING(2 0,2 2,3 3)");
    LineString ls4 = (LineString) g4;

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
        ls, ls2).getIM();
    // LineString_LineString l2l = new LineString_LineString(ls, ls2);
    // IntersectionMatrix rt = l2l.getIM();
View Full Code Here

  @Test
  public void testGetIM2() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1.0 1.0,1.0 2.0,2.0 2.0,3.0 2.0)");
    LineString ls = (LineString) g;
    Geometry g2 = wkt
        .read("LINESTRING(1.0 2.0,3.0 1.0,4.0 0.0,3.0 -2.0,0.0 0.0,1.0 2.0)");
    LineString ls2 = (LineString) g2;

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
        ls2, ls).getIM();
    // LineString_LineString l2l = new LineString_LineString(ls, ls2);
    // IntersectionMatrix rt = l2l.getIM();
View Full Code Here

  @Test
  public void testGetIM3() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(2.0 2.0,0.0 0.0)");
    LineString ls = (LineString) g;
    Geometry g2 = wkt
        .read("LINESTRING(0.98 0.94,1.0466666666666666 0.94,1.0466666666666666 1.0066666666666666,0.98 1.0066666666666666,0.98 0.94)");
    LineString ls2 = (LineString) g2;

    // IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
    // ls2, ls).getIM();
    LineString_LineString l2l = new LineString_LineString(ls, ls2);
    IntersectionMatrix rt = l2l.getIM();
View Full Code Here

  @Test
  public void testGetIM4() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(-2.0 2.0,0.0 0.0)");
    LineString ls = (LineString) g;
    Geometry g2 = wkt
        .read("LINESTRING(-1.2533333333333332 1.14,-1.1866666666666665 1.14,-1.1866666666666665 1.2066666666666666,-1.2533333333333332 1.2066666666666666,-1.2533333333333332 1.14)");
    LineString ls2 = (LineString) g2;

    // IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
    // ls2, ls).getIM();
    LineString_LineString l2l = new LineString_LineString(ls, ls2);
    IntersectionMatrix rt = l2l.getIM();
View Full Code Here

  @Test
  public void testGetIM5() {
    WktReader wkt = new WktReader();
    Geometry g = wkt
        .read("LINESTRING(1.0 6.0,5.999998414659173 1.0039816335536662,1.0079632645824341 -3.999993658637697,-3.9999857319385903 0.9880551094385923,1.0 6.0)");
    LineString ls = (LineString) g;
    Geometry g2 = wkt
        .read("LINESTRING(-2.639991350383829 -1.7999950537374092,-1.8399918576928131 -1.7999950537374092,-1.8399918576928131 -0.9999955610463935,-2.639991350383829 -0.9999955610463935,-2.639991350383829 -1.7999950537374092)");
    LineString ls2 = (LineString) g2;

    // IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
    // ls2, ls).getIM();
    LineString_LineString l2l = new LineString_LineString(ls, ls2);
    IntersectionMatrix rt = l2l.getIM();
View Full Code Here

  @Test
  public void testGetIM() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1 2,3 1,4 0,3 -2,0 0,1 2)");
    LineString ls = (LineString) g;
    GeoPoint p1 = new GeoPoint(1, 0);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, ls).getIM();

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
View Full Code Here

  @Test
  public void testGetIM2() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1 2,3 1,4 0,3 -2,0 0,1 2)");
    LineString ls = (LineString) g;
    GeoPoint p1 = new GeoPoint(0, 0);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, ls).getIM();

    assertFalse(rt.match(IntersectionMatrix.DisjointPattern));
View Full Code Here

  @Test
  public void testMultiPoint2LineString() {
    WktReader wkt = new WktReader();
    Geometry g = wkt.read("LINESTRING(1.0 2.0,2.0 2.0,3.0 2.0,4.0 2.0)");
    LineString ls = (LineString) g;
    GeoPoint p1 = new GeoPoint(1.0, 1.0);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, ls).getIM();

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
View Full Code Here

TOP

Related Classes of chunmap.model.geom.LineString

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.