Package chunmap.model.geom

Examples of chunmap.model.geom.WktReader


public class LineString_LineStringTest {

  @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);
View Full Code Here


    assertTrue(rt3.match(IntersectionMatrix.CrossesPatternLL));
  }

  @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();
View Full Code Here

    assertTrue(!rt.match(IntersectionMatrix.DisjointPattern));
  }

  @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();
View Full Code Here

    assertTrue(rt.get(IntersectionMatrix.Inner, IntersectionMatrix.Inner) != IntersectionMatrix.EmptyDim);
  }

  @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();
View Full Code Here

    assertTrue(rt.get(IntersectionMatrix.Inner, IntersectionMatrix.Inner) != IntersectionMatrix.EmptyDim);
  }

  @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();
View Full Code Here

public class Point_LineStringTest {

  @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();
View Full Code Here

    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
  }

  @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();
View Full Code Here

    assertFalse(rt.match(IntersectionMatrix.DisjointPattern));
  }

  @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();
View Full Code Here

public class LineString_PolygonTest {

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

    // IntersectionMatrix rt2 = ComputeIm.getInstance().getIM(ls, pg);
    LineString_Polygon l2a = new LineString_Polygon(ls, pg);
    IntersectionMatrix rt = l2a.getIM();
View Full Code Here

  }

  @Test
  public void testGetIM2() {
    WktReader wkt = new WktReader();
    Geometry g = wkt
        .read("POLYGON((-5.0 -8.0,10.0 -20.0,20.0 15.0,-10.0 10.0,-5.0 -8.0),(1.0 2.0,3.0 1.0,4.0 0.0,3.0 -2.0,0.0 0.0,1.0 2.0))");
    Polygon pg = (Polygon) g;
    Geometry g2 = wkt
        .read("LINESTRING(1.0 0.5,3.0 0.5,3.5 0.0,3.0 -1.0,1.0 0.0,1.0 0.5)");
    LineString ls = (LineString) g2;

    // IntersectionMatrix rt = ComputeIm.getInstance().getIM(ls, pg);
    LineString_Polygon l2a = new LineString_Polygon(ls, pg);
View Full Code Here

TOP

Related Classes of chunmap.model.geom.WktReader

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.