Package org.opengis.geometry

Examples of org.opengis.geometry.MismatchedDimensionException


      double[] toPosition, double startPar) {

    if (fromPosition == null || toPosition == null)
      throw new IllegalArgumentException("Start or End parameter is null"); //$NON-NLS-1$;
    if (fromPosition.length != toPosition.length)
      throw new MismatchedDimensionException();

    return createLineSegment(
        this.createPosition(fromPosition),
        this.createPosition(toPosition),
        startPar);
View Full Code Here


         * Note: this method was previously in GridCoverage2D and, at this point, there was
         * a check that the number of point dimensions were the same as that of the coverage's
         * CRS. Here this is modified to just check that the point is at least 2D - mbedward
         */
        if (point.getDimension() < 2) {
            throw new MismatchedDimensionException(Errors.format(
                    ErrorKeys.MISMATCHED_DIMENSION_$2, point.getDimension(), 2));
        }

        if (point instanceof Point2D) {
            return (Point2D) point;
View Full Code Here

        ensureNonNull("gridRange", gridRange);
        ensureNonNull("userRange", userRange);
        final int gridDim = gridRange.getDimension();
        final int userDim = userRange.getDimension();
        if (userDim != gridDim) {
            throw new MismatchedDimensionException(Errors.format(ErrorKeys.MISMATCHED_DIMENSION_$2,
                        gridDim, userDim));
        }
        this.gridRange = gridRange;
        this.envelope  = userRange;
    }
View Full Code Here

                label = "envelope";
                dim1  = envelope .getDimension();
                dim2  = gridRange.getDimension();
            }
            if (dim1 != dim2) {
                throw new MismatchedDimensionException(Errors.format(
                        ErrorKeys.MISMATCHED_DIMENSION_$3, label, dim1, dim2));
            }
        }
    }
View Full Code Here

                                             final int      dimension)
        throws MismatchedDimensionException
    {
        final int dim = envelope.getDimension();
        if (dimension != dim) {
            throw new MismatchedDimensionException(Errors.format(
                        ErrorKeys.MISMATCHED_DIMENSION_$3, name, dim, dimension));
        }
    }
View Full Code Here

     * Ensure the specified point is one-dimensional.
     */
    private static void checkDimension(final DirectPosition point) {
        final int dim = point.getDimension();
        if (dim != 1) {
            throw new MismatchedDimensionException(Errors.format(
                    ErrorKeys.MISMATCHED_DIMENSION_$2, 1, dim));
        }
    }
View Full Code Here

  public PointImpl createPoint(double[] coord) {
    // Test ok
    if (coord == null)
      throw new NullPointerException();
    if (coord.length != this.getDimension())
      throw new MismatchedDimensionException();

    return new PointImpl(positionFactory.createDirectPosition(coord));
  }
View Full Code Here

    public static void ensureDimensionMatch(
            final String name,
            final int dimension,
            final int expectedDimension) throws MismatchedDimensionException {
        if (dimension != expectedDimension) {
            throw new MismatchedDimensionException(name + " does not have " + dimension + "dimension(s)"
                                                    /*
                                                    * Resources.format(
                                                    * ResourceKeys.ERROR_MISMATCHED_DIMENSION_$3,
                                                    * name, new
                                                    * Integer(dimension), new
View Full Code Here

    // Test ok
    // Compare Dimension (which is the Coordinate Dimension) of the
    // DirectPosition with the CoordinateDimension of the current Coordinate
    // System in Euclidian Space
    if (dp.getDimension() != this.getDimension())
      throw new MismatchedDimensionException();

    return new PointImpl(dp.clone());
  }
View Full Code Here

    // Test ok
    if (position == null) {
      throw new IllegalArgumentException("Parameter position is null.");
    }
    if (position.getDirectPosition().getDimension() != this.getDimension()) {
      throw new MismatchedDimensionException();
    }
    DirectPosition copy = positionFactory.createDirectPosition(position.getDirectPosition().getCoordinate());
    return new PointImpl(copy);
  }
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.