Package org.opengis.referencing.operation

Examples of org.opengis.referencing.operation.TransformException


     */
    @SuppressWarnings("deprecation")
    public void testRenderingErrorsHandling() throws Exception {

        //the ones that are ignorable by the renderer
        assertNotNull(forceRenderingError(new TransformException("fake transform exception")));
        assertNotNull(forceRenderingError(new NoninvertibleTransformException("fake non invertible exception")));
        assertNotNull(forceRenderingError(new IllegalAttributeException("non illegal attribute exception")));
        assertNotNull(forceRenderingError(new FactoryException("fake factory exception")));

        //any other one should make the map producer fail
View Full Code Here


    public BoundingBox toBounds(final CoordinateReferenceSystem targetCRS)
        throws TransformException {
        try {
            return transform(targetCRS, true);
        } catch (FactoryException e) {
            throw new TransformException(e.getLocalizedMessage(), e);
        }
    }
View Full Code Here

    public BoundingBox toBounds(final CoordinateReferenceSystem targetCRS)
        throws TransformException {
        try {
            return transform(targetCRS, true);
        } catch (FactoryException e) {
            throw new TransformException(e.getLocalizedMessage(), e);
        }
    }
View Full Code Here

        if (targetDim != sourceDim) {
            throw new MismatchedDimensionException();
        }

        TransformException firstError = null;
        boolean startPointTransformed = false;

        for (int i = 0; i < src.length; i += sourceDim) {
            try {
                transform.transform(src, i, dest, i, 1);
View Full Code Here

                MathTransform transform = CRS.findMathTransform( crs,  DefaultGeographicCRS.WGS84_3D );
                Geometry geometry = transform( geom, transform );
               
                return geometry; // The extra Z values will be ignored
            } catch (FactoryException exception) {
                throw new TransformException(Errors.format(
                        ErrorKeys.CANT_REPROJECT_$1, crs));
            }
        }
        else if ( CRS.equalsIgnoreMetadata( crs,  DefaultGeographicCRS.WGS84 ) ){
            return geom;
        }
        else {
            try {
                MathTransform transform = CRS.findMathTransform( crs,  DefaultGeographicCRS.WGS84 );
                return transform( geom, transform );
            } catch (FactoryException exception) {
                throw new TransformException(Errors.format(
                        ErrorKeys.CANT_REPROJECT_$1, crs));
            }
        }
    }
View Full Code Here

        //
        // ///////////////////////////////////////////////////////////////////
        this.destinationSize = screenSize;
        this.destinationCRS = destinationCRS;
        if (this.destinationCRS == null) {
            throw new TransformException(Errors.format(ErrorKeys.CANT_SEPARATE_CRS_$1,
                    this.destinationCRS));
        }
        destinationEnvelope = new GeneralEnvelope(new ReferencedEnvelope(envelope,
                this.destinationCRS));
        // ///////////////////////////////////////////////////////////////////
View Full Code Here

            }
        }
        if(returnedCRS==null)
          returnedCRS= CRS.getHorizontalCRS(coverage.getCoordinateReferenceSystem());
        if(returnedCRS==null)
                throw new TransformException(Errors.format(
                          ErrorKeys.CANT_REDUCE_TO_TWO_DIMENSIONS_$1,
                          returnedCRS));
        return returnedCRS;
    }
View Full Code Here

    final T piece = findDomainElement(value);
    if (piece == null) {
      //do we have a default value?
      if(hasDefaultValue())
        return getDefaultValue();
      throw new TransformException(Errors.format(ErrorKeys.TRANSFORM_EVALUATION_$1,new Double(value)));
    }
    return piece.transform(value);
  }
View Full Code Here

    if (transform == null)
      //  @todo TODO
      throw new IllegalStateException();
    if (contains(value))
      return transform.derivative(value);
    throw new TransformException(Errors.format(ErrorKeys.TRANSFORM_EVALUATION_$1, new Double(value)));
  }
View Full Code Here

      throws TransformException, FactoryException {


    final CoordinateReferenceSystem tempCRS = CRS.getHorizontalCRS(coordinateReferenceSystem);
        if(tempCRS==null)
            throw new TransformException(Errors.format(
                      ErrorKeys.CANT_REDUCE_TO_TWO_DIMENSIONS_$1,
                      coordinateReferenceSystem));
    // final CoordinateSystem tempCS = tempCRS.getCoordinateSystem();
    // final MathTransform preTransform;
    // if (tempCS.getAxis(0).getDirection().absolute().equals(
View Full Code Here

TOP

Related Classes of org.opengis.referencing.operation.TransformException

Copyright © 2018 www.massapicom. 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.