Convert gps coordonnates in decimal
508408
function(lat){
        // TK103 sample 4737.1024,N for 47°37'.1024
        var deg= parseInt (lat[0]/100) || 0;
        var min= lat[0] - (deg*100);
        var dec= deg + (min/60);
    
        if (lat [1] === 'S' || lat [1] === 'W') dec= dec * -1;
        return (dec);
    }
612304
def _control_longitude(self):
        '''  '''

        if self.lonm < 0.0:
            self.lonm = 360.0 + self.lonm
        if self.lonM < 0.0:
            self.lonM = 360.0 + self.lonM
        if self.lonm > 360.0:
            self.lonm = self.lonm - 360.0
        if self.lonM > 360.0:
            self.lonM = self.lonM - 360.0
409638
def longitude(self, longitude):
        """"""
        if not (-180 <= longitude <= 180):
            raise ValueError('longitude was {}, but has to be in [-180, 180]'
                             .format(longitude))
        self._longitude = longitude
29512
def decimal_date(dateobs, timeobs=None):
    """"""

    year, month, day = dateobs.split('-')
    if timeobs is not None:
        hr, min, sec = timeobs.split(':')
    else:
        hr, min, sec = 0, 0, 0

    rdate = datetime.datetime(int(year), int(month), int(day), int(hr),
                              int(min), int(sec))
    dday = (float(rdate.strftime("%j")) + rdate.hour / 24.0 +
            rdate.minute / (60. * 24) + rdate.second / (3600 * 24.)) / 365.25
    ddate = int(year) + dday

    return ddate
327844
def validate_gps(value):
    """"""
    try:
        latitude, longitude, altitude = value.split(',')
        vol.Coerce(float)(latitude)
        vol.Coerce(float)(longitude)
        vol.Coerce(float)(altitude)
    except (TypeError, ValueError, vol.Invalid):
        raise vol.Invalid(
            'GPS value should be of format "latitude,longitude,altitude"')
    return value
941549
def lat_to_deg(lat):
    """"""
    if isinstance(lat, str) and (':' in lat):
        # TODO: handle other coordinate systems
        lat_deg = dmsStrToDeg(lat)
    else:
        lat_deg = float(lat)
    return lat_deg
240261
def _inc_lat(self, latitude, delta):
        """"""
        y = self._convert_latitude(latitude)
        y += delta
        return 360 / pi * atan(
            exp((180 - y * 360 / (2 ** self._zoom) / self._size) * pi / 180)) - 90
159978
def to_global(s):
  
  if s.startswith('GPSTime'):
    s = 'Gps' + s[3:]

  if '_' in s:
    s = "".join([i.capitalize() for i in s.split("_")])
  return s[0].lower() + s[1:]
1329523
function dst(lat1, lon1, lat2, lon2) {
  // generally used geo measurement function
  var dLat = lat2 * Math.PI / 180 - lat1 * Math.PI / 180;
  var dLon = lon2 * Math.PI / 180 - lon1 * Math.PI / 180;
  var a =
    Math.sin(dLat / 2) * Math.sin(dLat / 2) +
    Math.cos(lat1 * Math.PI / 180) *
      Math.cos(lat2 * Math.PI / 180) *
      Math.sin(dLon / 2) *
      Math.sin(dLon / 2);
  var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
  var d = R * c;
  return d * 1000; // meters
}
1244187
String formatLngLat() {
        DecimalFormat df = new DecimalFormat("##0.0###########");

        // Explicitly test for differences less than 1.0e-12 and
        // force them to be zero.  Otherwise you may find a case
        // where two points differ in the less significant bits, but
        // they format as the same number.
        double lng = (Math.abs(m_longitude) < EPSILON) ? 0 : m_longitude;
        double lat = (Math.abs(m_latitude) < EPSILON) ? 0 : m_latitude;
        return df.format(lng) + " " + df.format(lat);
    }
220288
def distance_from(self, lat, lon):
        ''''''
        lat1 = self.pkt['I105']['Lat']['val']
        lon1 = self.pkt['I105']['Lon']['val']
        return mp_util.gps_distance(lat1, lon1, lat, lon)
1363391
def gps_velocity_old(GPS_RAW_INT):
    ''''''
    return Vector3(GPS_RAW_INT.vel*0.01*cos(radians(GPS_RAW_INT.cog*0.01)),
                   GPS_RAW_INT.vel*0.01*sin(radians(GPS_RAW_INT.cog*0.01)), 0)
559973
public static double bearingRad(double latS, double lngS, double latE, double lngE) {
    final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine
    final double slatS = sinAndCos(latS, tmp), clatS = tmp.value;
    final double slatE = sinAndCos(latE, tmp), clatE = tmp.value;
    return atan2(-sin(lngS - lngE) * clatE, clatS * slatE - slatS * clatE * cos(lngS - lngE));
  }
1193786
def coord_from_area(self, x, y, lat, lon, width, ground_width):
		''''''

		pixel_width = ground_width / float(width)
		dx = x * pixel_width
		dy = y * pixel_width

		return mp_util.gps_offset(lat, lon, dx, -dy)
1244835
function convertTime(value, fromUnit, toUnit)
{
    if(fromUnit != toUnit && value !== 0)
    {
        return value * (toUnit == 's'? 0.001 : 1000);
    }
    return value;
}
50891
public static double dateTime2gps( double dateTimeMillis ) {
        dateTimeMillis = dateTimeMillis / 1000;
        double ipart = Math.floor(dateTimeMillis);
        double fpart = dateTimeMillis % 1;
        double gpsTime = ipart - 315964800;
        if (isunixtimeleap(Math.ceil(dateTimeMillis))) {
            fpart *= 2;
        }
        return gpsTime + fpart + countleaps(gpsTime, true);
    }
392713
def latitude(self):
        ''''''
        sd = dm_to_sd(self.lat)
        if self.lat_dir == 'N':
            return +sd
        elif self.lat_dir == 'S':
            return -sd
        else:
            return 0.