Package com.vividsolutions.jts.geom

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


        Geometry g = getExpression(0).evaluate(feature, Geometry.class);
        if(g == null)
            return null;
       
        MultiPointExtractor filter = new MultiPointExtractor();
        g.apply(filter);
        return filter.getMultiPoint();
    }
   
    static class MultiPointExtractor implements CoordinateFilter {
        List<Coordinate> coordinates = new ArrayList();
View Full Code Here


        Double extrusion = getExpression(1).evaluate(feature, Double.class);

        if (geom != null && extrusion != null) {
            // build the vertical faces
            SegmentExtractorFilter extractor = new SegmentExtractorFilter();
            geom.apply(extractor);
            List<Polygon> faces = extractor.getFaces(geom.getFactory(), extrusion);
           
            // add the "cap"
            if(geom instanceof Polygon) {
                Polygon offseted = (Polygon) geom.clone();
View Full Code Here

        if(offsetY == null)
            offsetY = 0d;

        if (geom != null) {
            Geometry offseted = (Geometry) geom.clone();
            offseted.apply(new OffsetOrdinateFilter(offsetX, offsetY));
            return offseted;
        } else {
            return null;
        }
    }
View Full Code Here

                double scale = Math.min(Math.abs(at.getScaleX()), Math.abs(at.getScaleY()));
                double rescaledInset = scale * inset;
                if (rescaledInset < 1) {
                    // just apply a 1 pixel inset on the rescaled geometry
                    Geometry cloned = (Geometry) originalFootprint.clone();
                    cloned.apply(geometryAT);
                    Geometry bounds = (Geometry) granuleBounds.clone();
                    bounds.apply(geometryAT);
                    rescaled = insetPolicy.applyInset(cloned, bounds, 1.5);
                } else {
                    // use the original footprint
View Full Code Here

                if (rescaledInset < 1) {
                    // just apply a 1 pixel inset on the rescaled geometry
                    Geometry cloned = (Geometry) originalFootprint.clone();
                    cloned.apply(geometryAT);
                    Geometry bounds = (Geometry) granuleBounds.clone();
                    bounds.apply(geometryAT);
                    rescaled = insetPolicy.applyInset(cloned, bounds, 1.5);
                } else {
                    // use the original footprint
                    rescaled = (Geometry) insetFootprint.clone();
                    rescaled.apply(geometryAT);
View Full Code Here

            if (roi instanceof ROIGeometry){
                return ((ROIGeometry) roi).getAsGeometry();
            } else if (roi instanceof ROIShape){
                final Shape shape = ((ROIShape) roi).getAsShape();
                final Geometry geom = ShapeReader.read(shape, 0, new GeometryFactory());
                geom.apply(Y_INVERSION);
                return geom;
            }
            return null;
        }
       
View Full Code Here

                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

                // of their center, this makes for odd results if the polygon is just slightly
                // misaligned with the coverage
                AffineTransformation at = new AffineTransformation();
               
                at.setToTranslation(-0.5, -0.5);
                simplifiedGeometry.apply(at);
               
                // build a shape using a fast point in polygon wrapper
                ROI roi = new ROIGeometry(simplifiedGeometry, false);

                // run the stats via JAI
View Full Code Here

                Object value = f.getProperty(attribute).getValue();
                if(value instanceof Geometry && crs != null) {
                    // if the crs is not associated with the geometry do so, this
                    // way other code will get to know the crs (e.g. for reprojection purposes)
                    Geometry geom = (Geometry) value;
                    geom.apply(new GeometryCRSFilter(crs));
                }
                results.add(value);
            }

            if (results.size() == 0) {
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));
                        }
                    });
                    geom.geometryChanged();
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.