Package org.geotools.geometry.jts

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


    estimator.visit(style);
    int bufferInPixels = estimator.getBuffer();
    // expand area to include buffer
    Rectangle tileInpix = mapContext.getViewport().getScreenArea();
    ReferencedEnvelope metaArea = new ReferencedEnvelope(areaOfInterest);
    metaArea.expandBy(bufferInPixels / tileInpix.getWidth() * areaOfInterest.getWidth(),
        bufferInPixels / tileInpix.getHeight() * areaOfInterest.getHeight());
    // fetch features in meta area
    Crs layerCrs = vectorLayerService.getCrs(layer);
    Envelope layerBounds = geoService.transform(metaArea, (Crs) areaOfInterest.getCoordinateReferenceSystem(),
        layerCrs);
View Full Code Here


                }
            }
        }

        ReferencedEnvelope bnds = new ReferencedEnvelope(mainMapEnvelope);                                   
        bnds.expandBy(Math.max(bnds.getWidth() * 3, bnds.getHeight() * 3));
        //this may be too slow and may need to done in a job ??
        ReferencedEnvelope maximumExtent = mainmap.getBounds(new NullProgressMonitor());
        ReferencedEnvelope ret = new ReferencedEnvelope(maximumExtent.intersection(bnds), bnds.getCoordinateReferenceSystem());
        return ret;
    }
View Full Code Here

                                  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

                                    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

                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

                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

                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

                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

    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

    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

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.