Package org.geotools.measure

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


    /**
     * 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

                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

    {
        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

        {
            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

            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

                 * 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

                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

    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

        ensureLatitudeInRange(Provider.STANDARD_PARALLEL_2, phi2, true);

        // Compute Constants
        if (abs(phi1 + phi2) < EPSILON) {
            throw new IllegalArgumentException(Errors.format(ErrorKeys.ANTIPODE_LATITUDES_$2,
                    new Latitude(toDegrees(phi1)), new Latitude(toDegrees(phi2))));
        }
        double  sinphi = sin(phi1);
        double  cosphi = cos(phi1);
        double  n      = sinphi;
        boolean secant = (abs(phi1 - phi2) >= EPSILON);
View Full Code Here

TOP

Related Classes of org.geotools.measure.Latitude

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.