Package com.vividsolutions.jts.geom

Examples of com.vividsolutions.jts.geom.Geometry.union()


    Geometry[] result = new Geometry[1];
    // points/lines to polygon, prevents problems later on...
    // TODO this works for meters (1 cm) what with other crs's ?
    Geometry merged = geoms[0].buffer(0.01);
    for (int i = 1; i < geoms.length; i++) {
      merged = merged.union(geoms[i].buffer(0.01));
    }
    result[0] = merged;
    return result;
  }
View Full Code Here


        }

        GeometryFactory factory = new GeometryFactory();
        Geometry combined = factory.buildGeometry(geoms);

        return combined.union();
    }

    private void updateAOIService( ILayer layer, Geometry newAOI )
            throws IOException {
        IAOIService aOIService = PlatformGIS.getAOIService();
View Full Code Here

    static Geometry combineIntoOneGeometry( Collection<Geometry> geometryCollection ){
        //GeometryFactory factory = FactoryFinder.getGeometryFactory( null );
        GeometryFactory factory = new GeometryFactory();
       
      Geometry combined = factory.buildGeometry( geometryCollection );
        return combined.union();
    }
   
    /**
     * @param iter
     * @param geoms the geometry to remove the features in iter from.  IE the geometries that will be diffed.  Is
View Full Code Here

        // Handle geometries
        List<Geometry> geometriesList = EsriJsonUtil
            .json2Geometries(geometries);
        Geometry collection = GeometryUtil.gf().buildGeometry(
            geometriesList);
        resultGeometry = collection.union();
      }

      // Various out format
      if ("json".equals(f)) {
        result = this.generateJSONResult(resultGeometry, geometries);
View Full Code Here

      return new GeometryFactory().createPoint((Coordinate) null);
    }

    Geometry union = (Geometry) geometries.get(0);
    for (int i = 1; i < geometries.size(); i++) {
      union = union.union((Geometry) geometries.get(i));
    }

    return union;
  }
View Full Code Here

        /* Union the geometries at each contour threshold. */
        Map<Integer, Geometry> contours = Maps.newHashMap();
        for (Integer threshold : bufferLists.keys()) {
            Collection<Geometry> buffers = bufferLists.get(threshold);
            Geometry geom = geomf.buildGeometry(buffers); // make geometry collection
            geom = geom.union(); // combine all individual buffers in this contour into one
            if ( ! resultsProjected) geom = JTS.transform(geom, fromMeters);
            contours.put(threshold, geom);
        }
        return contours;
    }
View Full Code Here

            }
        }
        GeometryFactory geometryFactory = GeometryUtils.getGeometryFactory();
        Geometry u = geometryFactory.createMultiPolygon(allRings.toArray(new Polygon[allRings
                .size()]));
        u = u.union();

        if (u instanceof GeometryCollection) {
            GeometryCollection mp = (GeometryCollection) u;
            for (int i = 0; i < mp.getNumGeometries(); ++i) {
                Geometry poly = mp.getGeometryN(i);
View Full Code Here

            Geometry geom = crudeProjectedBuffer(pt, bufferMeters);
            geometries.add(geom);
        }
        Geometry multiGeom = gf.buildGeometry(geometries);
        LOG.info("unioning hull...");
        hull = multiGeom.union();
        LOG.trace("hull is {}", hull.toText());
        // may lead to false rejections
        // DouglasPeuckerSimplifier simplifier = new DouglasPeuckerSimplifier();
    }
   
View Full Code Here

        Geometry result = null;
        for (Geometry g : geoms) {
            if (result == null) {
                result = g;
            } else {
                result = result.union(g);
            }
        }
        return result;
    }
View Full Code Here

    }

    static public Geometry union(Geometry arg0, Geometry arg1) {
        Geometry _this = arg0;

        return _this.union(arg1);
    }

    static public Geometry difference(Geometry arg0, Geometry arg1) {
        Geometry _this = arg0;
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.