Package chunmap.model.geom

Examples of chunmap.model.geom.WktReader


  }

  @Test
  public void testGetIM3() {
    WktReader wkt = new WktReader();
    Geometry g = wkt
        .read("POLYGON((1.0 0.5,3.0 0.5,3.5 0.0,3.0 -1.0,1.0 0.0,1.0 0.5))");
    Polygon pg = (Polygon) 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 ls = (LineString) g2;

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


  }

  @Test
  public void testGetIM4() {
    WktReader wkt = new WktReader();
    Geometry g = wkt
        .read("POLYGON((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(4.0 0.5,6.0 0.5,6.5 0.0,6.0 -1.0,4.0 0.0,4.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

  }

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

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

  }

  @Test
  public void testGetIM6() {
    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)");
    Geometry g2 = wkt
        .read("POLYGON((-2.639991350383829 -1.7999950537374092,-1.8399918576928131 -1.7999950537374092,-1.8399918576928131 -0.9999955610463935,-2.639991350383829 -0.9999955610463935,-2.639991350383829 -1.7999950537374092))");
    LineString ls = (LineString) g;
    Polygon pg = (Polygon) g2;

    LineString_LinearRing l2a = new LineString_LinearRing(ls, pg.getShell());
View Full Code Here

  }

  @Test
  public void testGetIM7() {
    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)");
    Geometry g2 = wkt
        .read("POLYGON((3.3400048574815147 -2.1999948000829175,4.140004350172529 -2.1999948000829175,4.140004350172529 -1.399995307391901,3.3400048574815147 -1.399995307391901,3.3400048574815147 -2.1999948000829175))");
    LineString ls = (LineString) g;
    Polygon pg = (Polygon) g2;

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

public class Point_LinearRingTest {

  @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)");
    Ring lr = ((LineString) g).toLinearRing();
    GeoPoint p1 = new GeoPoint(1, 0);

    ComputeIm p2r = new Point_LinearRing(p1, lr);
    IntersectionMatrix rt = p2r.getIM();
View Full Code Here

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

  @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)");
    Ring lr = ((LineString) g).toLinearRing();
    GeoPoint p1 = new GeoPoint(2, 2);

    ComputeIm p2r = new Point_LinearRing(p1, lr);
    IntersectionMatrix rt = p2r.getIM();
View Full Code Here

public class Polygon_PolygonTest {

  @Test
  public void testGetIM() {
    WktReader wkt = new WktReader();
    Geometry g = wkt
        .read("POLYGON((-5 -8,10 -20,20 15,-10 10,-5 -8),(1 2,3 1,4 0,3 -2,0 0,1 2))");
    Polygon pg = (Polygon) g;
    Geometry g2 = wkt.read("POLYGON((1 0.5,3 0.5,3.5 0,3 -1,1 0,1 0.5))");
    Polygon pg2 = (Polygon) g2;
    Geometry g3 = wkt.read("POLYGON((4 0.5,6 0.5,6.5 0,6 -1,4 0,4 0.5))");
    Polygon pg3 = (Polygon) g3;

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
        pg, pg2).getIM();
    assertTrue(rt.match(IntersectionMatrix.DisjointPattern));
View Full Code Here

    assertTrue(rt2.match(IntersectionMatrix.WithinsPattern));
  }

  @Test
  public void testGetIM2() {
    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("POLYGON((-5 -8,10 -20,20 15,-10 10,-5 -8))");
    Polygon pg2 = (Polygon) g2;
    Geometry g3 = wkt.read("POLYGON((4 0.5,6 0.5,6.5 0,6 -1,4 0,4 0.5))");
    Polygon pg3 = (Polygon) g3;

    IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
        pg, pg2).getIM();
    // Polygon_Polygon l2a1 = new Polygon_Polygon(pg, pg2);
View Full Code Here

    assertTrue(rt2.match(IntersectionMatrix.WithinsPattern));
  }

  @Test
  public void testGetIM3() {
    WktReader wkt = new WktReader();
    Geometry g = wkt
        .read("POLYGON((-2.639991350383829 -1.7999950537374092,-1.8399918576928131 -1.7999950537374092,-1.8399918576928131 -0.9999955610463935,-2.639991350383829 -0.9999955610463935,-2.639991350383829 -1.7999950537374092))");
    Polygon pg = (Polygon) g;
    Geometry g2 = wkt
        .read("POLYGON((1.0 6.0,5.999998414659173 1.0039816335536662,1.0079632645824341 -3.999993658637697,-3.9999857319385903 0.9880551094385923,1.0 6.0))");
    Polygon pg2 = (Polygon) g2;

    // IntersectionMatrix rt = ComputeImFactory.getInstance().getImComputer(
    // pg, pg2).getIM();
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.