Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Polygon.intersection()


      // result feature

      // each ring, if it lays entirely inside the polygon = one new piece
      Polygon polygonArea = gf.createPolygon((LinearRing) ring, null);
      result = result.difference(polygonArea);
      Geometry areaIntersection = polygonArea.intersection(polygon);
      for (int i = 0; i < areaIntersection.getNumGeometries(); i++) {
        piecesFrom.add(areaIntersection.getGeometryN(i));
      }
    }
    return result;
View Full Code Here


      }
      pgzer.add(solidCutter);
      ArrayList<Geometry> pgs = new ArrayList<Geometry>();
      for (Iterator itr = pgzer.getPolygons().iterator(); itr.hasNext();) {
        Polygon p = (Polygon) itr.next();
        pgs.add(p.intersection(pg));
      }
      split = GeometryUtil.gf().buildGeometry(pgs);
    } else {
      split = geometry.difference(cutter);
    }
View Full Code Here

    }

    private void createNamedAreas(AreaEdgeList edgeList, Ring ring, Collection<Area> areas) {
        Polygon containingArea = ring.toJtsPolygon();
        for (Area area : areas) {
            Geometry intersection = containingArea.intersection(area.toJTSMultiPolygon());
            if (intersection.getArea() == 0) {
                continue;
            }
            NamedArea namedArea = new NamedArea();
            OSMWithTags areaEntity = area.parent;
View Full Code Here

                    double maxY = minY + 180;
                    LinearRing ring = gf.createLinearRing(new Coordinate[] {new Coordinate(minX, minY),
                            new Coordinate(minX, maxY), new Coordinate(maxX, maxY), new Coordinate(maxX, minY),
                            new Coordinate(minX, minY)});
                    Polygon p = gf.createPolygon(ring, null);
                    Geometry intersection = p.intersection(ls);
                    if (!intersection.isEmpty()) {
                        if (intersection instanceof LineString) {
                            LineString ils = ((LineString) intersection);
                            double d = getGeodeticSegmentLength(ils);
                            distance += d;
View Full Code Here

                        Geometry g = ((Geometry) f.getAttribute(geomName));
                        if (ppoly.intersects(g)) {
                            // logger.debug("***************************");
                            // logger.debug(p.toString());
                            // logger.debug(g.toString());
                            Geometry geom = p.intersection(g);
                            // logger.debug(geom.toString());
                            if (geom instanceof LineString
                                    || geom instanceof MultiLineString) {
                                // logger.debug("gespeichert: " + length);
                                // logger.debug("aktuell: " + geom.getLength());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.