Package org.opengis.referencing.cs

Examples of org.opengis.referencing.cs.CoordinateSystemAxis


                        max = new double[dims];
                        axisNames = new String[dims];
                        double extent = Double.MAX_VALUE;
                        for (int i = 0; i < dims; i++) {
                            if(i < cs.getDimension()) {
                                CoordinateSystemAxis axis = cs.getAxis(i);
                                axisNames[i] = getCompatibleAxisName(axis, i);
                                min[i] = Double.isInfinite(axis.getMinimumValue()) ? DEFAULT_AXIS_MIN : axis.getMinimumValue();
                                max[i] = Double.isInfinite(axis.getMaximumValue()) ? DEFAULT_AXIS_MAX : axis.getMaximumValue();
                                if(max[i] - min[i] < extent)
                                    extent = max[i] - min[i];
                            } else {
                                min[i] = DEFAULT_AXIS_MIN;
                                max[i] = 10000000;
View Full Code Here


        //
        // Get the "up" axis
        //

        CoordinateSystemAxis upAxis = crs.getCoordinateSystem().getAxis(upAxisDimension);

        //
        // Need to make sure we're not going to go out of bounds along the
        // axis by going up a little bit.
        //
        // Determine the maximum value along that axis
        //

        double upAxisMax = upAxis.getMaximumValue();

        //
        // Get the starting value along the up axis
        //
View Full Code Here

        // Loop through all of the axes until you find the one that is
        // probably the upward axis.
        //

        for (int i = 0; i < numDimensions; i++) {
            CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis(i);
            AxisDirection axisDirection = axis.getDirection();

            if (axisDirection.equals(AxisDirection.DISPLAY_UP)
                    || axisDirection.equals(AxisDirection.EAST_NORTH_EAST)
                    || axisDirection.equals(AxisDirection.NORTH)
                    || axisDirection.equals(AxisDirection.NORTH_EAST)
                    || axisDirection.equals(AxisDirection.NORTH_NORTH_EAST)
                    || axisDirection.equals(AxisDirection.NORTH_NORTH_WEST)
                    || axisDirection.equals(AxisDirection.NORTH_WEST)
                    || axisDirection.equals(AxisDirection.ROW_POSITIVE)
                    || axisDirection.equals(AxisDirection.UP)
                    || axisDirection.equals(AxisDirection.WEST_NORTH_WEST)) {
                return i;
            }
        }

        //
        // If not found yet, find one with name Northing or y and assume
        // it is up.
        //

        for (int i = 0; i < numDimensions; i++) {
            CoordinateSystemAxis axis = crs.getCoordinateSystem().getAxis(i);
            String axisName = axis.getName().toString().toUpperCase();
            if (axisName.equals("Y") || axisName.equals("NORTHING")
                    || axisName.contains("NORTHING")) {
                return i;
            }
        }
View Full Code Here

                        final CoordinateSystem coordinateSystem = coverageCRS.getCoordinateSystem();
                        // save also latitude axis
                        final int dimension = coordinateSystem.getDimension();
                        for (int i = 0; i < dimension; i++) {
                            CoordinateSystemAxis axis = coordinateSystem.getAxis(i);
                            if (axis.getDirection().absolute().compareTo(AxisDirection.NORTH) == 0) {
                                this.northDimension = i;
                                break;
                            }
                        }
                        // If the northDimension has not been found then an exception is thrown
View Full Code Here

    public void testCorrectAxisOrder() throws NoSuchAuthorityCodeException, FactoryException {
        final CoordinateReferenceSystem crs = CRS.decode("EPSG:4326");
        final CoordinateSystem cs = crs.getCoordinateSystem();
        assertEquals(2, cs.getDimension());

        CoordinateSystemAxis axis0 = cs.getAxis(0);
        assertEquals("Lat", axis0.getAbbreviation());

        CoordinateSystemAxis axis1 = cs.getAxis(1);
        assertEquals("Long", axis1.getAbbreviation());
    }
View Full Code Here

    public void testForcedAxisOrder() throws NoSuchAuthorityCodeException, FactoryException {
        final CoordinateReferenceSystem crs = CRS.decode("EPSG:4326", true);
        final CoordinateSystem cs = crs.getCoordinateSystem();
        assertEquals(2, cs.getDimension());

        CoordinateSystemAxis axis0 = cs.getAxis(0);
        assertEquals("Long", axis0.getAbbreviation());

        CoordinateSystemAxis axis1 = cs.getAxis(1);
        assertEquals("Lat", axis1.getAbbreviation());

        final CoordinateReferenceSystem standard = CRS.decode("EPSG:4326");
        assertFalse("Should not be (long,lat) axis order.", CRS.equalsIgnoreMetadata(crs, standard));

        final CoordinateReferenceSystem def;
View Full Code Here

        try {
            CoordinateReferenceSystem crs = CRS.decode("EPSG:4326");
            final CoordinateSystem cs = crs.getCoordinateSystem();
            assertEquals(2, cs.getDimension());

            CoordinateSystemAxis axis0  = cs.getAxis(0);
//            assertEquals("forceXY did not work", "Long", axis0.getAbbreviation());

            CoordinateSystemAxis axis1  = cs.getAxis(1);
//            assertEquals("forceXY did not work", "Lat", axis1.getAbbreviation());
        } finally {
            System.clearProperty(GeoTools.FORCE_LONGITUDE_FIRST_AXIS_ORDER);
        }
    }
View Full Code Here

    /**
     * This test uses use the default implementations to express 7 bands of a landsat image.
     */
    @Test
    public void testLandsatAxis() {
        CoordinateSystemAxis csAxis = new DefaultCoordinateSystemAxis(
                new SimpleInternationalString("light"), "light", AxisDirection.OTHER,
                SI.MICRO(SI.METER));

        DefaultLinearCS lightCS = new DefaultLinearCS("light", csAxis);
        Map<String, Object> datumProperties = new HashMap<String, Object>();
View Full Code Here

    /**
     * This test uses use the default implementations to express 7 bands of a landsat image.
     */
    @Test
    public void testLandsatAxis() {
        CoordinateSystemAxis csAxis = new DefaultCoordinateSystemAxis(
                new SimpleInternationalString("light"), "light", AxisDirection.OTHER,
                SI.MICRO(SI.METER));

        DefaultLinearCS lightCS = new DefaultLinearCS("light", csAxis);
        Map<String, Object> datumProperties = new HashMap<String, Object>();
View Full Code Here

    // premadeObjects start
    GeographicCRS geoCRS = org.geotools.referencing.crs.DefaultGeographicCRS.WGS84;
    GeodeticDatum wgs84Datum = org.geotools.referencing.datum.DefaultGeodeticDatum.WGS84;
    PrimeMeridian greenwichMeridian = org.geotools.referencing.datum.DefaultPrimeMeridian.GREENWICH;
    CartesianCS cartCS = org.geotools.referencing.cs.DefaultCartesianCS.GENERIC_2D;
    CoordinateSystemAxis latAxis = org.geotools.referencing.cs.DefaultCoordinateSystemAxis.GEODETIC_LATITUDE;
    // premadeObjects end
}
View Full Code Here

TOP

Related Classes of org.opengis.referencing.cs.CoordinateSystemAxis

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.