Examples of RangeType


Examples of org.geotools.coverage.io.range.RangeType

        checkRequest(request);
        final BoundingBox requestedBoundingBox = request.getGeographicArea();
        final Rectangle requestedRasterArea = request.getRasterArea();
        final Set<TemporalGeometricPrimitive> temporalSubset = request.getTemporalSubset();
        final Set<NumberRange<Double>> verticalSubset = request.getVerticalSubset();
        final RangeType range = request.getRangeSubset();
        final Set<FieldType> fieldTypes = range.getFieldTypes();

        final boolean useJAI = false;

        final CoverageResponse response = new CoverageResponse();
        response.setRequest(request);

        final Rectangle sourceRasterRegion = new Rectangle();
        GeneralEnvelope adjustedRequestedEnvelope2D;
        final GeneralEnvelope requestedEnvelope2D = new GeneralEnvelope(requestedBoundingBox);
        final MathTransform2D grid2WorldTransform = request.getGridToWorldTransform();
        final ImageReadParam imageReadParam = new ImageReadParam();
        try {
            // //
            //
            // Set envelope and source region
            //
            // //
            adjustedRequestedEnvelope2D = Utilities.evaluateRequestedParams(
                    access.gridGeometry2DMap.get(this.name).getGridRange(),
                    access.baseEnvelope2DMap.get(this.name),
                    access.spatialReferenceSystem2DMap.get(this.name),
                    access.raster2ModelMap.get(this.name), requestedEnvelope2D,
                    sourceRasterRegion, requestedRasterArea,
                    grid2WorldTransform, access.wgs84BaseEnvelope2DMap.get(this.name));

            // //
            //
            // Set specific imageIO parameters: type of read operation,
            // imageReadParams
            //
            // //

            if (adjustedRequestedEnvelope2D != null) {
                final GeneralEnvelope req = (adjustedRequestedEnvelope2D.isEmpty()) ? requestedEnvelope2D
                        : adjustedRequestedEnvelope2D;
                Utilities.setReadParameters(null /* OverviewPolicy */,
                        imageReadParam, req, requestedRasterArea,
                        access.highestResMap.get(this.name),
                        access.gridGeometry2DMap.get(this.name).getGridRange(),
                        PixelInCell.CELL_CORNER);
            }
        } catch (IOException e) {
            LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
            adjustedRequestedEnvelope2D = null;
        } catch (TransformException e) {
            LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
            adjustedRequestedEnvelope2D = null;
        }
        if (adjustedRequestedEnvelope2D != null && sourceRasterRegion != null && !sourceRasterRegion.isEmpty()) {
            imageReadParam.setSourceRegion(sourceRasterRegion);
        }

        // A transformation is requested in case the requested envelope has been
        // adjusted
        final boolean needTransformation = (adjustedRequestedEnvelope2D != null && !adjustedRequestedEnvelope2D.isEmpty());

        // In case the adjusted requested envelope is null, no intersection
        // between requested envelope and base envelope have been found. Hence,
        // no valid coverage will be loaded and the request should be considered
        // as producing an empty result.
        final boolean emptyRequest = adjustedRequestedEnvelope2D == null;

        // //
        //
        // adding GridCoverages to the results list
        //
        // //
        for (FieldType fieldType : fieldTypes) {
            final Name name = fieldType.getName();

            // TODO: Fix this leveraging on the proper Band
            Set<SampleDimension> sampleDims = fieldType.getSampleDimensions();
            if (sampleDims == null || sampleDims.isEmpty()) {
                final RangeType innerRange = access.rangeMap.get(this.name);
                if (innerRange != null) {
                    final FieldType ft = innerRange.getFieldType(name.getLocalPart());
                    if (ft != null)
                        sampleDims = ft.getSampleDimensions();
                }

            }
View Full Code Here

Examples of org.geotools.coverage.io.range.RangeType

        // //
        //
        // Checking RangeSubset setting
        //
        // //
        RangeType range = request.getRangeSubset();
        if (range == null)
            request.setRangeSubset(access.rangeMap.get(this.name));
    }
View Full Code Here

Examples of org.jfree.data.RangeType

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = RangeType.FULL;
        assertTrue(r1.equals(r2));
        int h1 = r1.hashCode();
        int h2 = r2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.data.RangeType

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(r1);
            out.close();
View Full Code Here

Examples of org.jfree.data.RangeType

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = RangeType.FULL;
        assertTrue(r1.equals(r2));
        int h1 = r1.hashCode();
        int h2 = r2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.data.RangeType

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(r1);
            out.close();
View Full Code Here

Examples of org.jfree.data.RangeType

   
    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = RangeType.FULL;
        assertTrue(r1.equals(r2));
        int h1 = r1.hashCode();
        int h2 = r2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.data.RangeType

   
    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(r1);
            out.close();
View Full Code Here

Examples of org.jfree.data.RangeType

   
    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = RangeType.FULL;
        assertTrue(r1.equals(r2));
        int h1 = r1.hashCode();
        int h2 = r2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

Examples of org.jfree.data.RangeType

   
    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {
        RangeType r1 = RangeType.FULL;
        RangeType r2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(r1);
            out.close();
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.