Package org.geotools.geometry.jts

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


    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

        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

        @Override
        public ReferencedEnvelope getBounds() {
            if(attribute == null) {
                // in this case we just have to expand the original collection bounds
                ReferencedEnvelope re = delegate.getBounds();
                re.expandBy(distance);
                return re;
            } else {
                // unlucky case, we need to actually compute by hand...
                return DataUtilities.bounds(features());
            }
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

            if (!useNativeBounds && !reqSRS.equalsIgnoreCase(SRS)) {
                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

                Neo4jFeatureBuilder.getType(layer.getName(), geomType, layer.getCoordinateReferenceSystem(), layer.getExtraPropertyNames()));
          }
         
          ReferencedEnvelope bounds = layerCollection.getBounds();
          bounds.expandToInclude(pipelineCollection.getBounds());
          bounds.expandBy(boundsDelta, boundsDelta);
         
            StyledImageExporter exporter = new StyledImageExporter( db );
            exporter.setExportDir( "target/docs/images/" );
            exporter.saveImage(
                new FeatureCollection[] {
View Full Code Here

            if (!useNativeBounds && !reqSRS.equalsIgnoreCase(SRS)) {
                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

    @Test
  public void testMapProducePointsWithDifferenSizeInScale2() throws Exception {
   
        final FeatureSource<SimpleFeatureType,SimpleFeature> fs = testDS.getFeatureSource("BuildingCenters");
        ReferencedEnvelope tmp=fs.getBounds();
        tmp.expandBy(5, 5);
        final ReferencedEnvelope env = new ReferencedEnvelope(tmp,WGS84);
       
        LOGGER.info("about to create map ctx for BuildingCenters with bounds " + env);

        final WMSMapContent map = new WMSMapContent();
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

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.