Examples of AxisDirection


Examples of org.opengis.referencing.cs.AxisDirection

        int dimension = cs.getDimension();
        int longitudeDim = -1;
        int latitudeDim = -1;

        for (int i = 0; i < dimension; i++) {
            AxisDirection dir = cs.getAxis(i).getDirection().absolute();

            if (dir.equals(AxisDirection.EAST)) {
                longitudeDim = i;
            }

            if (dir.equals(AxisDirection.NORTH)) {
                latitudeDim = i;
            }
        }

        if ((longitudeDim >= 0) && (latitudeDim >= 0)) {
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

            fail("setValue(VerticalDatumType)");
        } catch (InvalidParameterValueException exception) {
            // This is the expected exception.
            assertEquals("Test", exception.getParameterName());
        }
        AxisDirection dummy = AxisDirection.valueOf("Dummy");
        try {
            param.setValue(dummy);
            fail("setValue(AxisDirection)");
        } catch (InvalidParameterValueException exception) {
            // This is the expected exception.
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

        int dimension = cs.getDimension();
        int longitudeDim = -1;
        int latitudeDim = -1;

        for (int i = 0; i < dimension; i++) {
            AxisDirection dir = cs.getAxis(i).getDirection().absolute();

            if (dir.equals(AxisDirection.EAST)) {
                longitudeDim = i;
            }

            if (dir.equals(AxisDirection.NORTH)) {
                latitudeDim = i;
            }
        }

        if ((longitudeDim >= 0) && (latitudeDim >= 0)) {
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

            if (cs != null) {
                final int dimension = cs.getDimension();
                reverseAxis = new boolean[dimension];
                if (isAutomatic(REVERSE_AXIS)) {
                    for (int i=0; i<dimension; i++) {
                        final AxisDirection direction = cs.getAxis(i).getDirection();
                        final AxisDirection absolute  = direction.absolute();
                        reverseAxis[i] = direction.equals(absolute.opposite());
                    }
                    if (dimension >= 2) {
                        final int i = getSwapXY() ? 0 : 1;
                        reverseAxis[i] = !reverseAxis[i];
                    }
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

         * have to be moved at index {@code dstIndex}.
         */
        setZero();
        for (int dstIndex=0; dstIndex<dstAxis.length; dstIndex++) {
            boolean hasFound = false;
            final AxisDirection dstAxe = dstAxis[dstIndex];
            final AxisDirection search = dstAxe.absolute();
            for (int srcIndex=0; srcIndex<srcAxis.length; srcIndex++) {
                final AxisDirection srcAxe = srcAxis[srcIndex];
                if (search.equals(srcAxe.absolute())) {
                    if (hasFound) {
                        // TODO: Use the localized version of 'getName' in GeoAPI 2.1
                        throw new IllegalArgumentException(Errors.format(ErrorKeys.COLINEAR_AXIS_$2,
                                                           srcAxe.name(), dstAxe.name()));
                    }
                    hasFound = true;
                    /*
                     * Set the matrix elements. Some matrix elements will never
                     * be set. They will be left to zero, which is their wanted
                     * value.
                     */
                    final boolean normal = srcAxe.equals(dstAxe);
                    double scale = (normal) ? +1 : -1;
                    double translate = 0;
                    if (validRegions) {
                        translate  = (normal) ? dstRegion.getMinimum(dstIndex)
                                              : dstRegion.getMaximum(dstIndex);
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

                final String epsg         = getString(result, 1, code);
                final String nameCode     = getString(result, 2, code);
                final String orientation  = getString(result, 3, code);
                final String abbreviation = getString(result, 4, code);
                final String unit         = getString(result, 5, code);
                AxisDirection direction;
                try {
                    direction = DefaultCoordinateSystemAxis.getDirection(orientation);
                } catch (NoSuchElementException exception) {
                    if (orientation.equalsIgnoreCase("Geocentre > equator/PM")) {
                        direction = AxisDirection.OTHER; // TODO: can we choose a more accurate direction?
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

                        final CoordinateSystem domainCS = domainCRS.getCoordinateSystem();
                        final int domainDimension = domainCS.getDimension();
                        for (int i = 0; i < domainDimension; i++) {
                            final double minimum = domain.getMinimum(i);
                            final double maximum = domain.getMaximum(i);
                            final AxisDirection direction = domainCS.getAxis(i).getDirection();
                            for (int j = 0; j < dimension; j++) {
                                if (direction.equals(cs.getAxis(j).getDirection())) {
                                    final int k = j + dimension;
                                    if (ordinates[j] < minimum)
                                        ordinates[j] = minimum;
                                    if (ordinates[k] > maximum)
                                        ordinates[k] = maximum;
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

            if (NonSI.DEGREE_ANGLE.equals(unit)) {
                if (angleFormat == null) {
                    angleFormat = new AngleFormat("DD°MM.m'", locale);
                }
                formats[i] = angleFormat;
                final AxisDirection axis = cs.getAxis(i).getDirection().absolute();
                if (AxisDirection.EAST.equals(axis)) {
                    types[i] = LONGITUDE;
                } else if (AxisDirection.NORTH.equals(axis)) {
                    types[i] = LATITUDE;
                } else {
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

    public static int dimensionColinearWith(final CoordinateSystem     cs,
                                            final CoordinateSystemAxis axis)
    {
        int candidate = -1;
        final int dimension = cs.getDimension();
        final AxisDirection direction = axis.getDirection().absolute();
        for (int i=0; i<dimension; i++) {
            final CoordinateSystemAxis xi = cs.getAxis(i);
            if (direction.equals(xi.getDirection().absolute())) {
                candidate = i;
                if (axis.equals(xi)) {
                    break;
                }
            }
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

            final Object rx = kvp.get("resx");
            final Object ry = kvp.get("resy");
            if (rx != null && ry != null) {
                // get resx e resy but correct also the sign for them taking into account
              final CoordinateSystem cs=crs.getCoordinateSystem();
              final AxisDirection northingDirection=cs.getAxis(1).getDirection();
              final int yAxisCorrection=AxisDirection.NORTH.equals(northingDirection)?-1:1;
              final AxisDirection eastingDirection=cs.getAxis(0).getDirection();
              final int xAxisCorrection=AxisDirection.EAST.equals(eastingDirection)?1:-1;
                final double resX = Double.parseDouble((String) rx)*xAxisCorrection;
                final double resY = Double.parseDouble((String) ry)*yAxisCorrection;
               

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.