Package org.geotools.geometry.jts

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


        double minY = roundOrdinate(srcEnv.getMinY(), resolution, false);
        double maxY = roundOrdinate(srcEnv.getMaxY(), resolution, true);
       
        ReferencedEnvelope expanded = new ReferencedEnvelope(srcEnv);
        expanded.expandToInclude(minX, minY);
        expanded.expandToInclude(maxX, maxY);
        return expanded;
    }

    /**
     * Helper method to round ordinate values up or down to a specified resolution.
View Full Code Here


    BufferedImage render(FeatureSource[] sources, Style[] styles) throws Exception {
        DefaultMapContext map = new DefaultMapContext();

        ReferencedEnvelope env = sources[0].getBounds();
        for (int i = 1; i < sources.length; i++) {
            env.expandToInclude(sources[i].getBounds());
        }
        map.setAreaOfInterest(env);
        map.setCoordinateReferenceSystem(env.getCoordinateReferenceSystem());
        for (int i = 0; i < sources.length; i++) {
            if(styles[i] != null) {
View Full Code Here

                double maxX = renderingEnvelope.getMaxX();
                double maxY = renderingEnvelope.getMaxY();
                ReferencedEnvelope re1 = new ReferencedEnvelope(minX, datelineX - EPS, minY,
                        maxY, renderingCRS);
                ReferencedEnvelope tx1 = transformEnvelope(re1, WGS84);
                tx1.expandToInclude(180, tx1.getMinY());
                ReferencedEnvelope re2 = new ReferencedEnvelope(datelineX + EPS, maxX, minY,
                        maxY, renderingCRS);
                ReferencedEnvelope tx2 = transformEnvelope(re2, WGS84);
                if (tx2.getMinX() > 180) {
                    tx2.translate(-360, 0);
View Full Code Here

                        maxY, renderingCRS);
                ReferencedEnvelope tx2 = transformEnvelope(re2, WGS84);
                if (tx2.getMinX() > 180) {
                    tx2.translate(-360, 0);
                }
                tx2.expandToInclude(-180, tx1.getMinY());
                List<ReferencedEnvelope> result = new ArrayList<ReferencedEnvelope>();
                result.add(tx1);
                result.add(tx2);
                mergeEnvelopes(result);
                return result;
View Full Code Here

               
                while (iterator.hasNext() && (count < query.getMaxFeatures())) {
                    SimpleFeature feature = iterator.next();
                    if (filter.evaluate(feature)) {
                        count++;
                        envelope.expandToInclude(((Geometry)feature.getDefaultGeometry()).getEnvelopeInternal());
                    }
                }
            }
        }
        finally {
View Full Code Here

                j++;
            }
            array[3] = new Coordinate(numFeatures, numFeatures);
            LinearRing shell = new LinearRing(array, new PrecisionModel(), 0);
            Geometry expected = gf.createPolygon(shell, null).buffer(numFeatures + 1);
            expectedBounds.expandToInclude(expected.getEnvelopeInternal());

            SimpleFeature sf = iterator.next();
            assertTrue(expected.equals((Geometry) sf.getDefaultGeometry()));
        }
       
View Full Code Here

  public synchronized BoundingBox getBounds() {
    if( bounds == null ){
      ReferencedEnvelope bbox = new ReferencedEnvelope(getType().getCoordinateReferenceSystem());
      Geometry geom = (Geometry) getValue();
      if (geom != null) {
        bbox.expandToInclude(geom.getEnvelopeInternal());
      }
      else {
          bbox.setToNull();
      }
      bounds =  bbox;
View Full Code Here

        if (lastQuery != query)
            filterFeatures(query);
        for (SimpleFeature feature : filteredFeatures) {

            Point p = (Point) feature.getDefaultGeometry();
            env.expandToInclude(p.getCoordinate());
        }

        return env;
    }
View Full Code Here

                                throw new DataSourceException("Unable to accept modifications to "
                                    + live.getID() + " on " + typeName);
                            }

                            ReferencedEnvelope bounds = new ReferencedEnvelope();
                            bounds.expandToInclude(new ReferencedEnvelope(live.getBounds()));
                            bounds.expandToInclude(new ReferencedEnvelope(current.getBounds()));
                            listenerManager.fireFeaturesChanged(typeName, transaction,
                                bounds, true);
                            live = null;
                            current = null;
View Full Code Here

                                    + live.getID() + " on " + typeName);
                            }

                            ReferencedEnvelope bounds = new ReferencedEnvelope();
                            bounds.expandToInclude(new ReferencedEnvelope(live.getBounds()));
                            bounds.expandToInclude(new ReferencedEnvelope(current.getBounds()));
                            listenerManager.fireFeaturesChanged(typeName, transaction,
                                bounds, true);
                            live = null;
                            current = null;
                        }
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.