Package org.opengis.geometry

Examples of org.opengis.geometry.MismatchedDimensionException


   * 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, new Integer(1),
          new Integer(dim)));
    }
  }
View Full Code Here


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

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

     */
    final void ensureDimensionMatch(final String name, final double[] coordinates)
            throws MismatchedDimensionException
    {
        if (coordinates.length != axis.length) {
            throw new MismatchedDimensionException(Errors.format(
                        ErrorKeys.MISMATCHED_DIMENSION_$3, name, coordinates.length, axis.length));
        }
    }
View Full Code Here

    public Matrix derivative(final DirectPosition point) throws TransformException {
        final int nSkipped = firstAffectedOrdinate + numTrailingOrdinates;
        final int transDim = subTransform.getSourceDimensions();
        final int pointDim = point.getDimension();
        if (pointDim != transDim+nSkipped) {
            throw new MismatchedDimensionException(Errors.format(
                        ErrorKeys.MISMATCHED_DIMENSION_$3, "point", pointDim, transDim + nSkipped));
        }
        final GeneralDirectPosition subPoint = new GeneralDirectPosition(transDim);
        for (int i=0; i<transDim; i++) {
            subPoint.ordinates[i] = point.getOrdinate(i + firstAffectedOrdinate);
View Full Code Here

        if (ptDst == null) {
            ptDst = new GeneralDirectPosition(2);
        } else {
            final int dimension = ptDst.getDimension();
            if (dimension != 2) {
                throw new MismatchedDimensionException(Errors.format(
                          ErrorKeys.MISMATCHED_DIMENSION_$3, "ptDst", dimension, 2));
            }
        }
        final double[] array = ptSrc.getCoordinate();
        transform(array, 0, array, 0, 1);
View Full Code Here

     * @see MathTransform2D#transform(Point2D,Point2D)
     */
    public Point2D transform(final Point2D ptSrc, final Point2D ptDst) throws TransformException {
        int dim;
        if ((dim = getSourceDimensions()) != 2) {
            throw new MismatchedDimensionException(constructMessage("ptSrc", 2, dim));
        }
        if ((dim = getTargetDimensions()) != 2) {
            throw new MismatchedDimensionException(constructMessage("ptDst", 2, dim));
        }
        final double[] ord = new double[] {ptSrc.getX(), ptSrc.getY()};
        this.transform(ord, 0, ord, 0, 1);
        if (ptDst != null) {
            ptDst.setLocation(ord[0], ord[1]);
View Full Code Here

    {
              int  dimPoint = ptSrc.getDimension();
        final int dimSource = getSourceDimensions();
        final int dimTarget = getTargetDimensions();
        if (dimPoint != dimSource) {
            throw new MismatchedDimensionException(constructMessage("ptSrc", dimPoint, dimSource));
        }
        if (ptDst != null) {
            dimPoint = ptDst.getDimension();
            if (dimPoint != dimTarget) {
                throw new MismatchedDimensionException(constructMessage("ptDst", dimPoint, dimTarget));
            }
            /*
             * Transforms the coordinates using a temporary 'double[]' buffer,
             * and copy the transformation result in the destination position.
             */
 
View Full Code Here

                                       final int             orientation)
            throws TransformException
    {
        int dim;
        if ((dim=getSourceDimensions())!=2 || (dim=getTargetDimensions())!=2) {
            throw new MismatchedDimensionException(constructMessage("shape", 2, dim));
        }
        final PathIterator    it = shape.getPathIterator(preTransform);
        final GeneralPath   path = new GeneralPath(it.getWindingRule());
        final Point2D.Float ctrl = new Point2D.Float();
        final double[]    buffer = new double[6];
View Full Code Here

     * @see MathTransform2D#derivative(Point2D)
     */
    public Matrix derivative(final Point2D point) throws TransformException {
        final int dimSource = getSourceDimensions();
        if (dimSource != 2) {
            throw new MismatchedDimensionException(constructMessage("point", 2, dimSource));
        }
        throw new TransformException(Errors.format(ErrorKeys.CANT_COMPUTE_DERIVATIVE));
    }
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.