Package chunmap.model.elem

Examples of chunmap.model.elem.PointLineBag


    Geometry g = wkt.read("LINESTRING(0 4,4 0)");
    Geometry g2 = wkt.read("LINESTRING(1 1,2 1,2 3)");
    LineString l = (LineString) g;
    LineString l2 = (LineString) g2;

    PointLineBag bag = l.intersection(l2);
    assertTrue(!bag.isEmpty());
  }
View Full Code Here


    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;

    PointLineBag bag = ls.intersection(ls2);
    assertTrue(!bag.isEmpty());
  }
View Full Code Here

    LineString ls = (LineString) g;
    Geometry g2 = wkt
        .read("LINESTRING(1.0 6.0,5.75429730253235 2.5481140652851213,3.9440778098389764 -3.0413371363465505,-1.9311899958501355 -3.0506944106199967,-3.759204394078429 2.5329623398454943,1.0 6.0)");
    LineString ls2 = (LineString) g2;

    PointLineBag bag = ls.intersection(ls2);
    assertTrue(!bag.isEmpty());
  }
View Full Code Here

    LineString ls = (LineString) g;
    Geometry g2 = wkt
        .read("LINESTRING(1.0 6.0,5.328799197461722 3.502298445041029,5.332779000281329 -1.4954009967780992,1.0079632645824363 -3.999993658637697,-3.324808414448497 -1.5091895461115477,-3.3367478128123684 3.488497218818446,1.0 6.0)");
    LineString ls2 = (LineString) g2;

    PointLineBag bag = ls.intersection(ls2);
    assertTrue(!bag.isEmpty());
  }
View Full Code Here

    LineString ls = (LineString) g;
    Geometry g2 = wkt
        .read("LINESTRING(3.3400048574815147 -2.1999948000829175,4.140004350172529 -2.1999948000829175,4.140004350172529 -1.399995307391901,3.3400048574815147 -1.399995307391901,3.3400048574815147 -2.1999948000829175)");
    LineString ls2 = (LineString) g2;

    PointLineBag bag = ls.intersection(ls2);
    assertTrue(!bag.isEmpty());
  }
View Full Code Here

  }

  private void breakLine(Ring r, List<LineString> lines) {
    for (int i = 0, n = lines.size(); i < n; i++) {
      LineString line = lines.get(i);
      PointLineBag bag = line.intersection(r);
      List<LineString> newLines = bag.breakLine(line);
     
      if (newLines.size() > 1) {
        lines.remove(i);
        lines.addAll(newLines);
        return;
View Full Code Here

  public FragmentCollection(Polygon r1, Polygon r2) {
    if (!r1.isValid() || !r2.isValid()) {
      throw new GeometryException();
    }

    PointLineBag bag = getIntersection(r1, r2);

    addPolygon(fragments1, r1, r2, bag);
    addPolygon(fragments2, r2, r1, bag);
  }
View Full Code Here

    }
    return;
  }

  private PointLineBag getIntersection(Polygon pg1, Polygon pg2) {
    PointLineBag tbag = subGetIntersection(pg1.getShell(), pg2);
    List<Ring> rs = pg1.getHoles();
    for (Ring r : rs) {
      tbag.add(subGetIntersection(r, pg2));
    }
    return tbag;
  }
View Full Code Here

    }
    return tbag;
  }

  private PointLineBag subGetIntersection(Ring r1, Polygon pg2) {
    PointLineBag tbag = r1.intersection(pg2.getShell());
    List<Ring> rs = pg2.getHoles();
    for (Ring r : rs) {
      tbag.add(r1.intersection(r));
    }
    return tbag;
  }
View Full Code Here

    }
    public PointLineBag intersection(LineString l2)
    {
        if (!this.getEnvelop().hasIntersect(l2.getEnvelop()))
        {
            return new PointLineBag();
        }
        return LineAlgorithm.intersection(this.points, l2.points);
    }
View Full Code Here

TOP

Related Classes of chunmap.model.elem.PointLineBag

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.