Examples of Latitude


Examples of jaron.gps.Latitude

          while ((s = is.readLine()) != null) {
            String[] params = s.split(",");
            if(params[0].equals("$GPRMC")) {
              nmea = new HashMap<String, String>();
              nmea.put("GPRMC", s);
              trackpoint.setLatitude(new Latitude(params[3], Direction.fromValue( params[4])));
              trackpoint.setLongitude(new Longitude(params[5], Direction.fromValue( params[6])));
              String time = params[1];
              String date = params[9];
              Calendar cal = GregorianCalendar.getInstance();
              cal.set(Calendar.HOUR, Integer.parseInt(time.substring(0, 2)));
View Full Code Here

Examples of jaron.gps.Latitude

          while ((s = is.readLine()) != null) {
            String[] params = s.split(",");
            if(params[0].equals("$GPRMC")) {
              nmea = new HashMap<String, String>();
              nmea.put("GPRMC", s);
              trackpoint.setLatitude(new Latitude(params[3], Direction.fromValue( params[4])));
              trackpoint.setLongitude(new Longitude(params[5], Direction.fromValue( params[6])));
              String time = params[1];
              String date = params[9];
              Calendar cal = GregorianCalendar.getInstance();
              cal.set(Calendar.HOUR, Integer.parseInt(time.substring(0, 2)));
View Full Code Here

Examples of org.apache.sis.measure.Latitude

        final Angle min, max;
        if (westBoundLongitude > eastBoundLongitude) {
            min = new Longitude(westBoundLongitude);
            max = new Longitude(eastBoundLongitude);
        } else if (southBoundLatitude > northBoundLatitude) {
            min = new Latitude(southBoundLatitude);
            max = new Latitude(northBoundLatitude);
        } else {
            return;
        }
        throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalRange_2, min, max));
    }
View Full Code Here

Examples of org.apache.sis.measure.Latitude

        if (westBoundLongitude > eastBoundLongitude) {
            min = new Longitude(westBoundLongitude);
            max = new Longitude(eastBoundLongitude);
            // Exception will be thrown below.
        } else if (southBoundLatitude > northBoundLatitude) {
            min = new Latitude(southBoundLatitude);
            max = new Latitude(northBoundLatitude);
            // Exception will be thrown below.
        } else {
            this.westBoundLongitude = westBoundLongitude;
            this.eastBoundLongitude = eastBoundLongitude;
            this.southBoundLatitude = southBoundLatitude;
View Full Code Here

Examples of org.apache.sis.measure.Latitude

    private static void verifyBounds(final double southBoundLatitude, final double northBoundLatitude)
            throws IllegalArgumentException
    {
        if (southBoundLatitude > northBoundLatitude) { // Accept NaN.
            throw new IllegalArgumentException(Errors.format(Errors.Keys.IllegalRange_2,
                    new Latitude(southBoundLatitude), new Latitude(northBoundLatitude)));
        }
    }
View Full Code Here

Examples of org.apache.sis.measure.Latitude

        Object value = super.get(index, metadata);
        if (value != null) {
            if (index == westBoundLongitude || index == eastBoundLongitude) {
                value = new Longitude((Double) value);
            } else if (index == southBoundLatitude || index == northBoundLatitude) {
                value = new Latitude((Double) value);
            }
        }
        return value;
    }
View Full Code Here

Examples of org.apache.sis.measure.Latitude

            if (value instanceof Latitude) {
                value = ((Latitude) value).degrees();
            }
            value = super.set(index, metadata, value, mode);
            if (value != null) {
                value = new Latitude((Double) value);
            }
            return value;
        } else {
            return super.set(index, metadata, value, mode);
        }
View Full Code Here

Examples of org.apache.sis.measure.Latitude

    @Test
    public void testGet() {
        createBox();
        assertPropertyEquals("westBoundLongitude", new Longitude(-20));
        assertPropertyEquals("eastBoundLongitude", new Longitude( 30));
        assertPropertyEquals("southBoundLatitude", new Latitude (-10));
        assertPropertyEquals("northBoundLatitude", new Latitude ( 40));
        assertPropertyEquals("extentTypeCode",     Boolean.TRUE      );
    }
View Full Code Here

Examples of org.apache.sis.measure.Latitude

    @DependsOnMethod("testGet")
    public void testSet() {
        createBox();
        assertPreviousEquals("westBoundLongitude", new Longitude(-20), new Longitude(-15));
        assertPreviousEquals("eastBoundLongitude", new Longitude( 30), new Longitude( 25));
        assertPreviousEquals("southBoundLatitude", new Latitude (-10), new Latitude ( -5));
        assertPreviousEquals("northBoundLatitude", new Latitude ( 40), new Latitude ( 35));
        assertPreviousEquals("extentTypeCode",     Boolean.TRUE,       Boolean.FALSE);

        assertEquals("westBoundLongitude", -15, box.getWestBoundLongitude(), STRICT);
        assertEquals("eastBoundLongitude"25, box.getEastBoundLongitude(), STRICT);
        assertEquals("southBoundLatitude",  -5, box.getSouthBoundLatitude(), STRICT);
View Full Code Here

Examples of org.apache.sis.measure.Latitude

    @DependsOnMethod("testSet")
    public void testSetAsPrimitive() {
        createBox();
        assertPreviousEquals("westBoundLongitude", new Longitude(-20), -14.0);
        assertPreviousEquals("eastBoundLongitude", new Longitude( 30)26  );
        assertPreviousEquals("southBoundLatitude", new Latitude (-10),  -7f );
        assertPreviousEquals("northBoundLatitude", new Latitude ( 40), (short) 33);

        assertEquals("westBoundLongitude", -14, box.getWestBoundLongitude(), STRICT);
        assertEquals("eastBoundLongitude"26, box.getEastBoundLongitude(), STRICT);
        assertEquals("southBoundLatitude",  -7, box.getSouthBoundLatitude(), STRICT);
        assertEquals("northBoundLatitude"33, box.getNorthBoundLatitude(), STRICT);
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.