Package com.vividsolutions.jts.geom

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


                Geometry intersection = aFilter.intersection(bFilter);
                if (intersection instanceof MultiPolygon) {
                    rasterFilter = (MultiPolygon)intersection;
                } else {
                    final List<Polygon> accum = new ArrayList<Polygon>();
                    intersection.apply(
                        new GeometryComponentFilter() {
                            public void filter(Geometry geom) {
                                if (geom instanceof Polygon) accum.add((Polygon)geom);
                            }
                        }
View Full Code Here


         */
        private Geometry getFeatureGeometry(SimpleFeature sf, final double height) {
            Geometry geom = (Geometry) sf.getDefaultGeometry();

            if (!Double.isNaN(height) && height != 0) {
                geom.apply(new CoordinateFilter() {
                    public void filter(Coordinate c) {
                        c.setCoordinate(new Coordinate(c.x, c.y, height));
                    }
                });
                geom.geometryChanged();
View Full Code Here

            Geometry geom = (Geometry) f.getDefaultGeometry();
            try{
                final double height = new FeatureHeightTemplate(template).execute(f);

                if (!Double.isNaN(height) && height != 0){
                    geom.apply(
                        new CoordinateFilter(){
                            public void filter(Coordinate c){
                                c.setCoordinate(new Coordinate(c.x, c.y, height));
                            }
                        }
View Full Code Here

  public void testUniqueCoordinateArrayFilter() throws Exception {
    Geometry g = reader.read(
          "MULTIPOINT(10 10, 20 20, 30 30, 20 20, 10 10)");
    UniqueCoordinateArrayFilter f = new UniqueCoordinateArrayFilter();
    g.apply(f);
    assertEquals(3, f.getCoordinates().length);
    assertEquals(new Coordinate(10, 10), f.getCoordinates()[0]);
    assertEquals(new Coordinate(20, 20), f.getCoordinates()[1]);
    assertEquals(new Coordinate(30, 30), f.getCoordinates()[2]);
  }
View Full Code Here

        FeatureIterator i = inputFeatures.features();
        try {
            while (i.hasNext()) {
                SimpleFeature f = (SimpleFeature) i.next();
                Geometry g = (Geometry) f.getDefaultGeometry();
                g.apply(lineFilter);
            }
        } finally {
            i.close();
        }
        return linesList;
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.