Package org.geotools.geometry.jts

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


        /* The intersection of the viewport and the combined wms layers */
        Envelope interestBBox;
        if (layersBBox == null) {
            interestBBox = reprojectedViewportBBox;
        } else {
            interestBBox = reprojectedViewportBBox.intersection(layersBBox);
        }
        if (isEnvelopeNull(interestBBox)) {
            // outside of bounds, do not draw
            WMSPlugin.trace("Bounds of the data are outside the bounds of the viewscreen."); //$NON-NLS-1$
            return NILL_BOX;
View Full Code Here


            ReferencedEnvelope fullBounds;
            fullBounds = new ReferencedEnvelope(crs);
            typeTreeRef.expand(fullBounds);

            Envelope clipped = fullBounds.intersection(queryBounds);
            LOGGER.trace("query bounds: {}", queryBounds);
            queryBounds = new ReferencedEnvelope(crs);
            queryBounds.expandToInclude(clipped);
            LOGGER.trace("clipped query bounds: {}", queryBounds);
            if (queryBounds.equals(fullBounds)) {
View Full Code Here

        approximateWGS84RequestedResolution=CoverageUtilities.getResolution(geMapper.createAffineTransform());

        // intersect with the coverage native WGS84 bbox
        // note that for the moment we got to use general envelope since there is no intersection othrewise
        // TODO fix then we'll have intersection in ReferencedEnvelope
        approximateWGS84requestedBBox=new ReferencedEnvelope(approximateWGS84requestedBBox.intersection(coverageGeographicBBox),DefaultGeographicCRS.WGS84);
        final GeneralEnvelope approximateRequestedBBoInNativeCRS = CRS.transform(
                approximateWGS84requestedBBox, coverageCRS2D);
      approximateRequestedBBoInNativeCRS.setCoordinateReferenceSystem(coverageCRS2D);
      requestedBBox = new ReferencedEnvelope(approximateRequestedBBoInNativeCRS);       
View Full Code Here

                final List<Polygon> polygons = polygonExtractor.getPolygons(preProcessed);
                for (Polygon p : polygons) {
                    ReferencedEnvelope cropEnvelope = new ReferencedEnvelope(
                            p.getEnvelopeInternal(), readerCRS);
                    cropEnvelope = new ReferencedEnvelope(
                            cropEnvelope.intersection(coverageEnvelope), readerCRS);
                    cropEnvelope = new ReferencedEnvelope(
                            cropEnvelope.intersection(readingEnvelope), readerCRS);
                    if (isNotEmpty(cropEnvelope)) {
                        GridCoverage2D cropped = cropCoverage(coverage, cropEnvelope);
                        coverages.add(cropped);
View Full Code Here

                    ReferencedEnvelope cropEnvelope = new ReferencedEnvelope(
                            p.getEnvelopeInternal(), readerCRS);
                    cropEnvelope = new ReferencedEnvelope(
                            cropEnvelope.intersection(coverageEnvelope), readerCRS);
                    cropEnvelope = new ReferencedEnvelope(
                            cropEnvelope.intersection(readingEnvelope), readerCRS);
                    if (isNotEmpty(cropEnvelope)) {
                        GridCoverage2D cropped = cropCoverage(coverage, cropEnvelope);
                        coverages.add(cropped);
                    }
                }
View Full Code Here

            // handler for the source CRS
            ProjectionHandler handler = ProjectionHandlerFinder.getHandler(envelope,
                    envelope.getCoordinateReferenceSystem(), false);
            if (handler != null && handler.validAreaBounds != null) {

                Envelope intersection = envWGS84.intersection(validAreaBounds);
                if (intersection.isNull()) {
                    return null;
                } else {
                    try {
                        return ReferencedEnvelope.reference(intersection)
View Full Code Here

        approximateWGS84RequestedResolution=CoverageUtilities.getResolution(geMapper.createAffineTransform());

        // intersect with the coverage native WGS84 bbox
        // note that for the moment we got to use general envelope since there is no intersection othrewise
        // TODO fix then we'll have intersection in ReferencedEnvelope
        approximateWGS84requestedBBox=new ReferencedEnvelope(approximateWGS84requestedBBox.intersection(coverageGeographicBBox),DefaultGeographicCRS.WGS84);
        final GeneralEnvelope approximateRequestedBBoInNativeCRS = new GeneralEnvelope(
                CRS.transform(approximateWGS84requestedBBox, coverageCRS2D));
      approximateRequestedBBoInNativeCRS.setCoordinateReferenceSystem(coverageCRS2D);
      requestedBBox = new ReferencedEnvelope(approximateRequestedBBoInNativeCRS);       
View Full Code Here

    ReferencedEnvelope requestedBBox=bboxExtractor.getBBox();
    BoundingBox bbox = wrappedCatalogue.getBounds(typeName);
    // add eventual bbox from the underlying index to constrain search
    if(requestedBBox!=null){
      // intersection
      final Envelope intersection = requestedBBox.intersection(ReferencedEnvelope.reference(bbox));
     
      // create intersection
      final ReferencedEnvelope referencedEnvelope= new ReferencedEnvelope(intersection,bbox.getCoordinateReferenceSystem());
    }
    else{
View Full Code Here

                   FeatureEntry e = new FeatureEntry();
                   e.setTableName(layer.getName());                  
                   addLayerMetadata(e, features);
                   ReferencedEnvelope bounds = collection.getBounds();
                   if (features.getBbox() != null){
                       bounds = ReferencedEnvelope.reference(bounds.intersection(features.getBbox()));
                   }
                  
                   e.setBounds(bounds);
                 
                   gpkg.add(e, (SimpleFeatureCollectioncollection);
View Full Code Here

                    // see if we can get a valid restricted area using the projection handlers
                    ProjectionHandler handler = ProjectionHandlerFinder.getHandler(
                            new ReferencedEnvelope(0, 1, 0, 1, subsettingCRS), sourceCRS, false);
                    if (handler != null) {
                        ReferencedEnvelope validArea = handler.getValidAreaBounds();
                        Envelope intersection = validArea.intersection(ReferencedEnvelope
                                .reference(reader.getOriginalEnvelope()));
                        ReferencedEnvelope re = new ReferencedEnvelope(intersection, sourceCRS);
                        sourceEnvelopeInSubsettingCRS = new WCSEnvelope(re.transform(subsettingCRS,
                                true));
                    } else {
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.