Examples of expandBy()


Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

                                    JTS.transform(delta, mapDelta, layerToMapTransform, 10);
                                }
                                CoordinateReferenceSystem mapCRS = notifier.getMap().getViewportModel().getCRS();
                                ReferencedEnvelope bounds = new ReferencedEnvelope( mapDelta, mapCRS );
                               
                                bounds.expandBy(bounds.getWidth()*.2, bounds.getHeight()*.2);
                                refreshBounds = bounds;
                                refreshLayer = notifier;                               
                            } catch (IOException e) {
                                ProjectPlugin.log("", e); //$NON-NLS-1$
                            } catch (TransformException e) {
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

                try {
                   ref = new ReferencedEnvelope(aggregateBbox,
                            CRS.decode("EPSG:4326"));
                    aggregateBbox = ref.transform(reqCRS, true);
                } catch (ProjectionException pe) {
                    ref.expandBy( -1 * ref.getWidth() / 50, -1 * ref.getHeight() / 50);
                    try {
                        aggregateBbox = ref.transform(reqCRS, true);
                    } catch (FactoryException e) {
                        e.printStackTrace();
                    } catch (TransformException e) {
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

                bbox = layer.boundingBox();
            }

            // we now have a bounding box in the same CRS as the layer
            if ((bbox.getWidth() == 0) || (bbox.getHeight() == 0)) {
                bbox.expandBy(0.1);
            }
           
            if (layer.isEnabled()) {
                // expand bbox by 5% to allow large symbolizers to fit the map
                bbox.expandBy(bbox.getWidth() / 20, bbox.getHeight() / 20);
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

                bbox.expandBy(0.1);
            }
           
            if (layer.isEnabled()) {
                // expand bbox by 5% to allow large symbolizers to fit the map
                bbox.expandBy(bbox.getWidth() / 20, bbox.getHeight() / 20);
                return bbox;
            }
        } catch(Exception e) {

        }
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

                double expandBy = 1; // 1 meter
                if(bounds.getCoordinateReferenceSystem() instanceof GeographicCRS) {
                    expandBy = 0.0001;
                }
                if(bounds.getWidth() == 0 || bounds.getHeight() == 0) {
                    bounds.expandBy(expandBy);
                }
            }
           
        } else if(rinfo instanceof CoverageInfo) {
            // the coverage bounds computation path is a bit more linear, the
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

    double widthEnv = env.getMaxX() - env.getMinX();
    double heightEnv = env.getMaxY() - env.getMinY();
    double whEnv = widthEnv / heightEnv;
    double whSize = 1.0 * width / height;
    if (whEnv > whSize) {
      result.expandBy(0, (widthEnv / whSize - heightEnv) / 2);
    } else if (whEnv < whSize) {
      result.expandBy((heightEnv * whSize - widthEnv) / 2, 0);
    }

    return result;
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

    double whEnv = widthEnv / heightEnv;
    double whSize = 1.0 * width / height;
    if (whEnv > whSize) {
      result.expandBy(0, (widthEnv / whSize - heightEnv) / 2);
    } else if (whEnv < whSize) {
      result.expandBy((heightEnv * whSize - widthEnv) / 2, 0);
    }

    return result;
  }

View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

    public void testCurvePolygons() throws Exception {
        File property = new File(TestData.getResource(this, "curvepolygons.properties").toURI());
        PropertyDataStore ds = new PropertyDataStore(property.getParentFile());
        SimpleFeatureSource fs = ds.getFeatureSource("curvepolygons");
        ReferencedEnvelope bounds = fs.getBounds();
        bounds.expandBy(1, 1);

        Style style = RendererBaseTest.loadStyle(this, "fillSolid.sld");

        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

    public void testCurveLines() throws Exception {
        File property = new File(TestData.getResource(this, "curvelines.properties").toURI());
        PropertyDataStore ds = new PropertyDataStore(property.getParentFile());
        SimpleFeatureSource fs = ds.getFeatureSource("curvelines");
        ReferencedEnvelope bounds = fs.getBounds();
        bounds.expandBy(1, 1);

        Style style = RendererBaseTest.loadStyle(this, "lineGray.sld");

        MapContent mc = new MapContent();
        mc.addLayer(new FeatureLayer(fs, style));
View Full Code Here

Examples of org.geotools.geometry.jts.ReferencedEnvelope.expandBy()

        SimpleFeatureType schema = featureSource.getSchema();
        Query query = new Query( schema.getTypeName() );
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        String geomName = schema.getGeometryDescriptor().getName().getLocalPart();
        ReferencedEnvelope bounds = featureSource.getBounds();
        bounds.expandBy(-bounds.getWidth() / 2, -bounds.getHeight() / 2);
        query.setFilter( ff.bbox( ff.property(geomName), bounds) );
        SimpleFeatureCollection features = featureSource.getFeatures( query );
        SimpleFeatureIterator iterator = features.features();
        try {
            iterator.next();
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.