Examples of Latitude


Examples of org.apache.sis.measure.Latitude

    @DependsOnMethod("testSet")
    public void testAppend() {
        createBox();
        assertAppendResultEquals("westBoundLongitude", null, new Longitude(-20));
        assertAppendResultEquals("eastBoundLongitude", null, new Longitude( 24));
        assertAppendResultEquals("southBoundLatitude", null, new Latitude ( -6));
        assertAppendResultEquals("northBoundLatitude", null, 40.0);
        assertAppendResultEquals("extentTypeCode", false, Boolean.TRUE);

        assertEquals("westBoundLongitude", -20, box.getWestBoundLongitude(), STRICT);
        assertEquals("eastBoundLongitude"30, box.getEastBoundLongitude(), STRICT);
View Full Code Here

Examples of org.geotools.measure.Latitude

            phi1 = phi2 = latitudeOfOrigin;
        }
        // Compute constants
        if (abs(phi1 + phi2) < EPSILON) {
            throw new IllegalArgumentException(Errors.format(ErrorKeys.ANTIPODE_LATITUDES_$2,
                                               new Latitude(toDegrees(phi1)),
                                               new Latitude(toDegrees(phi2))));
        }
        final double  cosphi1 = cos(phi1);
        final double  sinphi1 = sin(phi1);
        final boolean  secant = abs(phi1-phi2) > EPSILON; // Should be 'true' for 2SP case.
        if (isSpherical) {
View Full Code Here

Examples of org.geotools.measure.Latitude

    /**
     * Constructs a new exception with a detail message
     * formatted for a latitude too close from a pole.
     */
    ProjectionException(final double latitude) {
        this(Errors.format(ErrorKeys.POLE_PROJECTION_$1, new Latitude(Math.toDegrees(latitude))));
    }
View Full Code Here

Examples of org.geotools.measure.Latitude

                value = Provider_TwoPoint.LAT_OF_2ND_POINT.getName().getCode();
                // Exception will be thrown below.
            }
            if (abs(latitudeOf1stPoint) < EPSILON_LATITUDE) {
                desc  = Provider_TwoPoint.LAT_OF_1ST_POINT;
                value = new Latitude(latitudeOf1stPoint);
                // Exception will be thrown below.
            }
            if (abs(latitudeOf2ndPoint + PI/2.0) < EPSILON_LATITUDE) {
                desc  = Provider_TwoPoint.LAT_OF_2ND_POINT;
                value = new Latitude(latitudeOf2ndPoint);
                // Exception will be thrown below.
            }
            if (desc != null) {
                final String name = desc.getName().getCode();
                throw new InvalidParameterValueException(Errors.format(
View Full Code Here

Examples of org.geotools.measure.Latitude

    {
        if (!(abs(abs(y) - expected) < EPSILON)) {
            y = toDegrees(y);
            final String n = name.getName().getCode();
            throw new InvalidParameterValueException(Errors.format(
                    ErrorKeys.ILLEGAL_ARGUMENT_$2, n, new Latitude(y)), n, y);
        }
    }
View Full Code Here

Examples of org.geotools.measure.Latitude

        {
            return;
        }
        y = toDegrees(y);
        throw new InvalidParameterValueException(Errors.format(ErrorKeys.LATITUDE_OUT_OF_RANGE_$1,
                                                 new Latitude(y)), name.getName().getCode(), y);
    }
View Full Code Here

Examples of org.geotools.measure.Latitude

            buffer.append(lineSeparator);
            buffer.append(Errors.format(ErrorKeys.LONGITUDE_OUT_OF_RANGE_$1, new Longitude(x)));
        }
        if (yOut) {
            buffer.append(lineSeparator);
            buffer.append(Errors.format(ErrorKeys.LATITUDE_OUT_OF_RANGE_$1, new Latitude(y)));
        }
        final LogRecord record = new LogRecord(Level.WARNING, buffer.toString());
        final String classe;
        if (tr instanceof Inverse) {
            classe = ((Inverse) tr).inverse().getClass().getName() + ".Inverse";
View Full Code Here

Examples of org.geotools.measure.Latitude

                 * them handle the exception the way they are used to.
                 */
                throw new ProjectionException(Errors.format(ErrorKeys.PROJECTION_CHECK_FAILED_$4,
                          distance,
                          new Longitude(longitude - toDegrees(centralMeridian )),
                          new Latitude (latitude  - toDegrees(latitudeOfOrigin)),
                          getName()));
            }
        } catch (ProjectionException exception) {
            throw exception;
        } catch (TransformException exception) {
View Full Code Here

Examples of org.geotools.measure.Latitude

                final CoordinateOperation op = ReferencingFactoryFinder.getCoordinateOperationFactory(null)
                        .createOperation(crs2D, DefaultGeographicCRS.WGS84);
                bounds = CRS.transform(op, bounds, null);
            }
            final AngleFormat fmt = new AngleFormat("DD°MM.m'");
            fmt.format(new  Latitude(bounds.getMinY()), buffer, null).append('-');
            fmt.format(new  Latitude(bounds.getMaxY()), buffer, null).append(' ');
            fmt.format(new Longitude(bounds.getMinX()), buffer, null).append('-');
            fmt.format(new Longitude(bounds.getMaxX()), buffer, null);
            return buffer.toString();
        } catch (TransformException e) {
            exception = e;
View Full Code Here

Examples of org.geotools.measure.Latitude

    private static double checkLatitude(final double latitude) throws IllegalArgumentException {
        if (latitude >= Latitude.MIN_VALUE && latitude <= Latitude.MAX_VALUE) {
            return toRadians(latitude);
        }
        throw new IllegalArgumentException(Errors.format(
                ErrorKeys.LATITUDE_OUT_OF_RANGE_$1, new Latitude(latitude)));
    }
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.