Package org.opengis.geometry

Examples of org.opengis.geometry.MismatchedDimensionException


            throws MismatchedDimensionException
    {
        if (vector != null) {
            final int dimension = vector.length;
            if (dimension != expected) {
                throw new MismatchedDimensionException(Errors.format(
                        Errors.Keys.MismatchedDimension_3, name, expected, dimension));
            }
        }
    }
View Full Code Here


            throws MismatchedDimensionException
    {
        if (position != null) {
            final int dimension = position.getDimension();
            if (dimension != expected) {
                throw new MismatchedDimensionException(Errors.format(
                        Errors.Keys.MismatchedDimension_3, name, expected, dimension));
            }
        }
    }
View Full Code Here

            throws MismatchedDimensionException
    {
        if (envelope != null) {
            final int dimension = envelope.getDimension();
            if (dimension != expected) {
                throw new MismatchedDimensionException(Errors.format(
                        Errors.Keys.MismatchedDimension_3, name, expected, dimension));
            }
        }
    }
View Full Code Here

    CoordinateSequence result =  csFactory.create(sequence.size(), targetCSDim);

        for (int i = 0; i < size; i++) {
            switch (sourceDim) {
            default:
                throw new MismatchedDimensionException();

            case 3:
                buffer[ib + 2] = sequence.getOrdinate(i, 2); // Fall through

            case 2:
View Full Code Here

        if( getDimension() != targetCRS.getCoordinateSystem().getDimension()){
            if( lenient ){
                return JTS.transformTo2D(this, targetCRS, lenient, numPointsForTransformation );
            }
            else {
                throw new MismatchedDimensionException(Errors.format(
                        ErrorKeys.MISMATCHED_DIMENSION_$3, crs.getName().getCode(),
                        new Integer(getDimension()), new Integer(targetCRS.getCoordinateSystem().getDimension())));
            }
        }
        // Gets a first estimation using an algorithm capable to take singularity in account
View Full Code Here

            final int expected = getDimension();
            final int dimension = crs.getCoordinateSystem().getDimension();
            if (dimension > expected) {
                // check dimensions and choose ReferencedEnvelope or ReferencedEnvelope3D
                // or the factory method ReferencedEnvelope.reference( CoordinateReferenceSystem )
                throw new MismatchedDimensionException(Errors.format(
                    ErrorKeys.MISMATCHED_DIMENSION_$3, crs.getName().getCode(),
                    new Integer(dimension), new Integer(expected)));
            }
        }
    }
View Full Code Here

        if( getDimension() != targetCRS.getCoordinateSystem().getDimension()){
            if( lenient ){
                return JTS.transformTo3D(this, targetCRS, lenient, numPointsForTransformation );
            }
            else {
                throw new MismatchedDimensionException(Errors.format(
                        ErrorKeys.MISMATCHED_DIMENSION_$3, crs.getName().getCode(),
                        new Integer(getDimension()), new Integer(targetCRS.getCoordinateSystem().getDimension())));
            }
        }
        /*
 
View Full Code Here

        ensureNonNull("sourceEnvelope", sourceEnvelope);
        ensureNonNull("transform", transform);

        if (transform.getSourceDimensions() != transform.getTargetDimensions() ||
            transform.getSourceDimensions() < 2){
            throw new MismatchedDimensionException(Errors.format(ErrorKeys.BAD_TRANSFORM_$1,
                    Classes.getShortClassName(transform)));
        }

        npoints++; // for the starting point.
View Full Code Here

        final int sourceDim = transform.getSourceDimensions();
        final int targetDim = transform.getTargetDimensions();

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

        TransformException firstError = null;
        boolean startPointTransformed = false;
View Full Code Here

        }

        // Ensure the CRS is 2D and retrieve the new envelope
        final CoordinateReferenceSystem crs2D = CRS.getHorizontalCRS(crs);
        if (crs2D == null)
            throw new MismatchedDimensionException(Errors.format(ErrorKeys.CANT_SEPARATE_CRS_$1,
                    crs));

        return new Envelope2D(crs2D, envelope.getMinX(), envelope.getMinY(), envelope.getWidth(),
                envelope.getHeight());
    }
View Full Code Here

TOP

Related Classes of org.opengis.geometry.MismatchedDimensionException

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.