Package org.geotools.geometry.jts

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


        }

        // apply the bounds, taking into account the reprojection policy if need be
        if (rinfo.getProjectionPolicy() == ProjectionPolicy.REPROJECT_TO_DECLARED && bounds != null) {
            try {
                bounds = bounds.transform(rinfo.getCRS(), true);
            } catch (Exception e) {
                throw (IOException) new IOException("transform error").initCause(e);
            }
        }
View Full Code Here


            // native available but geographic to be computed
            setupBounds(featureType);
        } else if (featureType.getNativeBoundingBox() == null && crs != null) {
            // we know the geographic and we can reproject back to native
            ReferencedEnvelope boundsLatLon = featureType.getLatLonBoundingBox();
            featureType.setNativeBoundingBox(boundsLatLon.transform(crs, true));
        }
    }

    /**
     * Initializes a wms layer object setting any info that has not been set.
View Full Code Here

            // native available but geographic to be computed
            setupBounds(wmsLayer);
        } else if (wmsLayer.getNativeBoundingBox() == null && wmsLayer.getNativeCRS() != null) {
            // we know the geographic and we can reproject back to native
            ReferencedEnvelope boundsLatLon = wmsLayer.getLatLonBoundingBox();
            wmsLayer.setNativeBoundingBox(boundsLatLon.transform(wmsLayer.getNativeCRS(), true));
        }
    }

    /**
     * Builds the default coverage contained in the current store
View Full Code Here

            ReferencedEnvelope ref = null;
            // Reproject back to requested SRS if we have to
            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) {
View Full Code Here

                    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) {
                        e.printStackTrace();
                    }
View Full Code Here

        boolean reprojectBBox = (sourceCrs != null)
                && !CRS.equalsIgnoreMetadata(
                        aoi.getCoordinateReferenceSystem(), sourceCrs);
        if (reprojectBBox) {
            aoi = aoi.transform(sourceCrs, true);
        }

        Filter filter = createBBoxFilter(schema, aoi);

        // now build the query using only the attributes and the bounding
View Full Code Here

          }
      }
     
      if ( !CRS.equalsIgnoreMetadata(declaredCRS, nativeCRS) &&
          php == ProjectionPolicy.REPROJECT_TO_DECLARED ) {
          return nativeBox.transform(declaredCRS,true);
      } else if(php == ProjectionPolicy.FORCE_DECLARED) {
          return new ReferencedEnvelope(nativeBox, declaredCRS);
      }
     
      return nativeBox;
View Full Code Here

                Filter filter = null;

                //ReferencedEnvelope aoi = mapContext.getAreaOfInterest();
                if (!CRS.equalsIgnoreMetadata(aoi.getCoordinateReferenceSystem(),
                            schema.getCoordinateReferenceSystem())) {
                    aoi = aoi.transform(schema.getCoordinateReferenceSystem(), true);
                }

                filter = createBBoxFilters(schema, attributes, aoi);

                // now build the query using only the attributes and the bounding
View Full Code Here

                CoordinateReferenceSystem sourceCrs = schema.getGeometryDescriptor().getCoordinateReferenceSystem();

                boolean reproject = (sourceCrs != null)
                && !CRS.equalsIgnoreMetadata(aoi.getCoordinateReferenceSystem(), sourceCrs);
                if (reproject) {
                    aoi = aoi.transform(sourceCrs, true);
                }
              // apply filters.
                // 1) bbox filter
                BBOX bboxFilter = filterFactory.bbox(schema.getGeometryDescriptor().getLocalName(),
                        aoi.getMinX() , aoi.getMinY(), aoi.getMaxX(), aoi.getMaxY(), null);
View Full Code Here

        void handleSpatialSubset(GetCoverageRequest request, CoverageInfo coverage) {
            try {
                ReferencedEnvelope bounds = request.bounds;
                CoordinateReferenceSystem boundsCrs = bounds.getCoordinateReferenceSystem();
                final String epsgCode = epsgUrnCode(boundsCrs);
                bounds = bounds.transform(CRS.decode(epsgCode), true);
                start("ows:BoundingBox", attributes("crs", epsgCode));
                element("ows:LowerCorner", bounds.getMinX() + " " + bounds.getMinY());
                element("ows:UpperCorner", bounds.getMaxX() + " " + bounds.getMaxY());
                end("ows:BoundingBox");
            } catch(Exception e) {
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.