Package chunmap.model.relate

Examples of chunmap.model.relate.IntersectionMatrix


    Geometry g = wkt.read("POLYGON((1 2,3 1,4 0,3 -2,0 0,1 2))");
    Polygon pg = (Polygon) g;
    GeoPoint p1 = new GeoPoint(1, 0);
    GeoPoint p2 = new GeoPoint(2, 2);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, pg).getIM();
    IntersectionMatrix rt2 = ComputeImFactory.getInstance().getImComputer(p2, pg).getIM();

    assertTrue(rt.match(IntersectionMatrix.WithinsPattern));
    assertFalse(rt2.match(IntersectionMatrix.WithinsPattern));
    assertTrue(rt2.match(IntersectionMatrix.DisjointPattern));

  }
View Full Code Here


    Polygon pg = (Polygon) g;
    GeoPoint p1 = new GeoPoint(1, 0);
    GeoPoint p2 = new GeoPoint(2, 2);
    GeoPoint p3 = new GeoPoint(100, 2);

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(p1, pg).getIM();
    IntersectionMatrix rt2 = ComputeImFactory.getInstance().getImComputer(p2, pg).getIM();
    IntersectionMatrix rt3 = ComputeImFactory.getInstance().getImComputer(p3, pg).getIM();

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
    assertTrue(rt2.match(IntersectionMatrix.WithinsPattern));
    assertTrue(rt3.match(IntersectionMatrix.DisjointPattern));

  }
View Full Code Here

    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();
    assertTrue(rt.match(IntersectionMatrix.OverlapPatternLL));

    IntersectionMatrix rt2 = ComputeImFactory.getInstance().getImComputer(
        ls3, ls).getIM();
    assertTrue(rt2.match(IntersectionMatrix.WithinsPattern));

    IntersectionMatrix rt3 = ComputeImFactory.getInstance().getImComputer(
        ls4, ls).getIM();
    assertTrue(rt3.match(IntersectionMatrix.CrossesPatternLL));
  }
View Full Code Here

    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();
    assertTrue(!rt.match(IntersectionMatrix.DisjointPattern));
  }
View Full Code Here

    LineString ls2 = (LineString) g2;

    // IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
    // ls2, ls).getIM();
    LineString_LineString l2l = new LineString_LineString(ls, ls2);
    IntersectionMatrix rt = l2l.getIM();
    assertTrue(rt.get(IntersectionMatrix.Inner, IntersectionMatrix.Inner) != IntersectionMatrix.EmptyDim);
  }
View Full Code Here

    LineString ls2 = (LineString) g2;

    // IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
    // ls2, ls).getIM();
    LineString_LineString l2l = new LineString_LineString(ls, ls2);
    IntersectionMatrix rt = l2l.getIM();
    assertTrue(rt.get(IntersectionMatrix.Inner, IntersectionMatrix.Inner) != IntersectionMatrix.EmptyDim);
  }
View Full Code Here

    LineString ls2 = (LineString) g2;

    // IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
    // ls2, ls).getIM();
    LineString_LineString l2l = new LineString_LineString(ls, ls2);
    IntersectionMatrix rt = l2l.getIM();
    assertTrue(rt.get(IntersectionMatrix.Inner, IntersectionMatrix.Inner) != IntersectionMatrix.EmptyDim);
  }
View Full Code Here

    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

    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

    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.relate.IntersectionMatrix

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.