Parse a NMEA-formatted latitude pair.

    Args:
        latitude (str): Latitude in DDMM.MMMM
        hemisphere (str): North or South

    Returns:
        float: Decimal representation of latitude
198501
def parse_latitude(latitude, hemisphere):
    
    latitude = int(latitude[:2]) + float(latitude[2:]) / 60
    if hemisphere == 'S':
        latitude = -latitude
    elif not hemisphere == 'N':
        raise ValueError('Incorrect North/South value %r' % hemisphere)
    return latitude
144081
def latlon(self):
        ''''''
        from MAVProxy.modules.lib.ANUGA import lat_long_UTM_conversion
        (lat, lon) = lat_long_UTM_conversion.UTMtoLL(self.northing, self.easting, self.zone, isSouthernHemisphere=(self.hemisphere=='S'))
        return (lat, lon)
244939
def parse_elem(element):
        
        ident = int(element.get('id'))
        latitude = element.get('lat')
        longitude = element.get('lon')

        flags = _parse_flags(element)

        return Node(ident, latitude, longitude, *flags)
612464
def latitude(self, dms: bool = False) -> Union[str, float]:
        
        return self._get_fs('lt', dms)
82255
def longitude(value):
    
    lon = round(float_(value), 5)
    if lon > 180.:
        raise ValueError('longitude %s > 180' % lon)
    elif lon < -180.:
        raise ValueError('longitude %s < -180' % lon)
    return lon
694554
def offset(self, heading_initial, distance, ellipse = 'WGS84'):
        '''
        
        '''
        lat1, lon1 = self.lat.decimal_degree, self.lon.decimal_degree
        g = pyproj.Geod(ellps = ellipse)
        distance = distance * 1000 # Convert km to meters
        lon2, lat2, back_bearing = g.fwd(lon1, lat1, heading_initial, distance, radians = False)
        return LatLon(Latitude(lat2), Longitude(lon2))
715113
def geometry_range(crd_range, elev, crd_type):
    

    d = OrderedDict()
    coordinates = [[] for i in range(len(crd_range))]

    # latitude
    if crd_type == "lat":
        for idx, i in enumerate(crd_range):
            coordinates[idx] = [crd_range[idx], "nan"]
            if elev:
                coordinates[idx].append(elev)

    # longitude
    elif crd_type == "lon":
        for idx, i in enumerate(crd_range):
            coordinates[idx] = ["nan", crd_range[idx]]
            if elev:
                coordinates[idx].append(elev)

    d["type"] = "Range"
    d["coordinates"] = coordinates

    return d
324590
def meters(self):
        """"""
        latitude, longitude = self.latitude_longitude
        meter_x = longitude * ORIGIN_SHIFT / 180.0
        meter_y = math.log(math.tan((90.0 + latitude) * math.pi / 360.0)) / (math.pi / 180.0)
        meter_y = meter_y * ORIGIN_SHIFT / 180.0
        return meter_x, meter_y
779660
public static void formatLatitude(Appendable out, double latitude, UnitType unit)
    {
        formatLatitude(out, Locale.getDefault(), latitude, unit);
    }
1083191
def _format_lat(self, lat):
        '''  '''
        if self.ppd in [4, 16, 64, 128]:
            return None
        else:
            if lat < 0:
                return map(lambda x: "{0:0>2}"
                           .format(int(np.abs(x))) + 'S', self._map_center('lat', lat))
            else:
                return map(lambda x: "{0:0>2}"
                           .format(int(x)) + 'N', self._map_center('lat', lat))
1319292
def rad_longitude(self):
        
        if self._rad_longitude is None:
            self._rad_longitude = math.radians(self.longitude)
        return self._rad_longitude
660767
def longitude(self):
        ''''''
        sd = dm_to_sd(self.lon)
        if self.lon_dir == 'E':
            return +sd
        elif self.lon_dir == 'W':
            return -sd
        else:
            return 0.
118046
def getUTMzone(geom):
    
    #If geom has srs properly defined, can do this
    #geom.TransformTo(wgs_srs)
    #Get centroid lat/lon
    lon, lat = geom.Centroid().GetPoint_2D()
    #Make sure we're -180 to 180
    lon180 = (lon+180) - np.floor((lon+180)/360)*360 - 180
    zonenum = int(np.floor((lon180 + 180)/6) + 1)
    #Determine N/S hemisphere
    if lat >= 0:
        zonehem = 'N'
    else:
        zonehem = 'S'
    #Deal with special cases
    if (lat >= 56.0 and lat < 64.0 and lon180 >= 3.0 and lon180 < 12.0):
        zonenum = 32
    if (lat >= 72.0 and lat < 84.0): 
        if (lon180 >= 0.0 and lon180 < 9.0): 
            zonenum = 31
        elif (lon180 >= 9.0 and lon180 < 21.0):
            zonenum = 33
        elif (lon180 >= 21.0 and lon180 < 33.0):
            zonenum = 35
        elif (lon180 >= 33.0 and lon180 < 42.0):
            zonenum = 37
    return str(zonenum)+zonehem
419965
public static void formatLatitude(Appendable out, Locale locale, double latitude, UnitType unit)
    {
        format(out, locale, latitude, unit, NS);
    }
235256
def fix_coordinate_decimal(d):
    
    try:
        for idx, n in enumerate(d["geo"]["geometry"]["coordinates"]):
            d["geo"]["geometry"]["coordinates"][idx] = round(n, 5)
    except Exception as e:
        logger_misc.error("fix_coordinate_decimal: {}".format(e))
    return d
101485
def ecliptic_latlon(self, epoch=None):
        
        vector = self.ecliptic_xyz(epoch)
        d, lat, lon = to_polar(vector.au)
        return (Angle(radians=lat, signed=True),
                Angle(radians=lon),
                Distance(au=d))
455607
private String getHemisphereFromZone(final String zone) {

		String band = null;

		switch (zone.length()) {

			case 3:
				// we can safely assume a format of "32U"
				band = zone.substring(2);
				break;

			case 2:
				// can be either single digit zone plus band
				// or double digit zone w/o band..
				if (zone.matches("\\d\\D")) {

					// single-digit zone plus band
					band = zone.substring(1);
				}
				break;
		}

		if (band != null) {

			final int pos = UTMzdlChars.indexOf(band);
			if (pos >= 0) {

				return UTMHemisphere.substring(pos, pos+1);
			}
		}

		logger.warn("Unable to determine hemisphere from UTM zone, assuming NORTHERN hemisphere.");

		return "N";
	}