Examples of AxisDirection


Examples of org.opengis.referencing.cs.AxisDirection

     *
     * @param  dir The direction for which to return the absolute direction, or {@code null}.
     * @return The direction from the above table, or {@code null} if the given direction was null.
     */
    public static AxisDirection absolute(final AxisDirection dir) {
        final AxisDirection opposite = opposite(dir);
        if (opposite != null) {
            if (opposite.ordinal() < dir.ordinal()) {
                return opposite;
            }
        }
        return dir;
    }
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

     *
     * @param  dir The direction to test, or {@code null}.
     * @return {@code true} if the given direction is an "opposite".
     */
    public static boolean isOpposite(final AxisDirection dir) {
        final AxisDirection opposite = opposite(dir);
        return (opposite != null) && opposite.ordinal() < dir.ordinal();
    }
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

    public static int indexOfColinear(final CoordinateSystem cs, final AxisDirection direction) {
        int fallback = -1;
        if (cs != null) {
            final int dimension = cs.getDimension();
            for (int i=0; i<dimension; i++) {
                final AxisDirection d = cs.getAxis(i).getDirection();
                if (direction.equals(d)) {
                    return i;
                }
                if (fallback < 0 && d.equals(opposite(direction))) {
                    fallback = i;
                }
            }
        }
        return fallback;
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

     * @return The first axis direction having a name matching the given one, or {@code null} if none.
     */
    public static AxisDirection valueOf(String name) {
        name = trimWhitespaces(name.replace('_', ' '));
        final AxisDirection[] directions = AxisDirection.values();
        AxisDirection candidate = find(name, directions);
        if (candidate == null) {
            /*
             * No match found when using the pre-defined axis name. Searches among
             * the set of geocentric directions. Expected directions are:
             *
 
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

        };
        assertEquals(compass.length, AxisDirections.COMPASS_COUNT);
        final int base = NORTH.ordinal();
        final int h = compass.length / 2;
        for (int i=0; i<compass.length; i++) {
            final AxisDirection direction = compass[i];
            final AxisDirection opposite  = AxisDirections.opposite(direction);
            final String        message   = direction.name();
            int io = i+h, in = i;
            if (i >= h) io -= AxisDirections.COMPASS_COUNT;
            if (i >  h) in -= AxisDirections.COMPASS_COUNT;
            assertEquals(message, base + i,  direction.ordinal());
            assertEquals(message, base + io, opposite.ordinal());
            assertEquals(message, 0,     AxisDirections.angleForCompass(direction, direction));
            assertEquals(message, h, abs(AxisDirections.angleForCompass(direction, opposite)));
            assertEquals(message, in,    AxisDirections.angleForCompass(direction, NORTH));
        }
    }
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

        };
        assertEquals(compass.length, AxisDirections.COMPASS_COUNT);
        final int base = NORTH.ordinal();
        final int h = compass.length / 2;
        for (int i=0; i<compass.length; i++) {
            final AxisDirection direction = compass[i];
            final AxisDirection opposite  = AxisDirections.opposite(direction);
            final String        message   = direction.name();
            int io = i+h, in = i;
            if (i >= h) io -= AxisDirections.COMPASS_COUNT;
            if (i >  h) in -= AxisDirections.COMPASS_COUNT;
            assertEquals(message, base + i,  direction.ordinal());
            assertEquals(message, base + io, opposite.ordinal());
            assertEquals(message, 0,     AxisDirections.angleForCompass(direction, direction));
            assertEquals(message, h, abs(AxisDirections.angleForCompass(direction, opposite)));
            assertEquals(message, in,    AxisDirections.angleForCompass(direction, NORTH));
        }
    }
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

        final String name, abrv;
        Unit<?> unit = SI.METRE;
        double min = Double.NEGATIVE_INFINITY;
        double max = Double.POSITIVE_INFINITY;
        RangeMeaning rm = null;
        final AxisDirection dir;
        switch (code) {
            case 108// Used in Ellipsoidal 3D.
            case 106:  name = "Geodetic latitude";
                       abrv = "φ";
                       unit = NonSI.DEGREE_ANGLE;
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

     * Ensures that all axes are perpendicular.
     */
    private void ensurePerpendicularAxis() throws IllegalArgumentException {
        final int dimension = getDimension();
        for (int i=0; i<dimension; i++) {
            final AxisDirection axis0 = getAxis(i).getDirection();
            for (int j=i; ++j<dimension;) {
                final AxisDirection axis1 = getAxis(j).getDirection();
                final Angle angle = CoordinateSystems.angle(axis0, axis1);
                /*
                 * The angle may be null for grid directions (COLUMN_POSITIVE, COLUMN_NEGATIVE,
                 * ROW_POSITIVE, ROW_NEGATIVE). We conservatively accept those directions even if
                 * they are not really for Cartesian CS because we do not know the grid geometry.
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

                                final CoordinateSystemAxis axis0,
                                final CoordinateSystemAxis axis1)
    {
        super(properties, axis0, axis1);
        for (int i=0; i<2; i++) {
            final AxisDirection direction = super.getAxis(i).getDirection();
            if (AxisDirections.isVertical(direction)) {
                throw new IllegalArgumentException(Errors.format(
                        Errors.Keys.IllegalAxisDirection_2, "EllipdoicalCS (2D)", direction));
            }
        }
View Full Code Here

Examples of org.opengis.referencing.cs.AxisDirection

    /**
     * For internal usage by {@link #sort(CoordinateSystemAxis[])} only.
     */
    private Normalizer(final CoordinateSystemAxis axis) {
        this.axis = axis;
        final AxisDirection dir = axis.getDirection();
        meridian = AxisDirections.isUserDefined(dir) ? DirectionAlongMeridian.parse(dir) : null;
    }
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.