當前位置: 首頁>>代碼示例>>Python>>正文


Python utm.to_latlon方法代碼示例

本文整理匯總了Python中utm.to_latlon方法的典型用法代碼示例。如果您正苦於以下問題:Python utm.to_latlon方法的具體用法?Python utm.to_latlon怎麽用?Python utm.to_latlon使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在utm的用法示例。


在下文中一共展示了utm.to_latlon方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: latlong

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def latlong(pos, zone=None, origin=None):
    """Convert local coordinate system position to latitude/longitude.

    To convert a UTM position into a global latitude/longitude, the local coordinate
    system has to be specified in terms of a UTM zone 2-tuple, e.g. ``(32, 'U')``.
    Alternatively a local coordinate system can be specified in terms of an origin
    latitude/longitude.
    """
    opos = (0,0)
    if origin is not None:
        if zone is not None:
            raise ValueError('zone and origin cannot be concurrently specified')
        origin = _normalize(origin)
        opos = _utm.from_latlon(origin[0], origin[1])
        zone = (opos[2], opos[3])
    geo = _utm.to_latlon(pos[0]+opos[0], pos[1]+opos[1], zone[0], zone[1])
    return (geo[0], geo[1], 0.0 if len(pos) < 3 else pos[2]) 
開發者ID:org-arl,項目名稱:arlpy,代碼行數:19,代碼來源:geo.py

示例2: test_utm_converter

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def test_utm_converter(reader):
    converter = LongLatToUTMConverter(reader)

    p_east = float('-inf')
    assert converter.zone_number is None

    for long, (time, detections) in zip(range(-3, 4), converter):
        detection = detections.pop()

        assert converter.zone_number == 30
        assert converter.northern

        assert p_east < detection.state_vector[0]
        p_east = detection.state_vector[0]

        assert pytest.approx((50, long), rel=1e-2, abs=1e-4) == utm.to_latlon(
            *detection.state_vector[0:2], zone_number=30, northern=True) 
開發者ID:dstl,項目名稱:Stone-Soup,代碼行數:19,代碼來源:test_geo.py

示例3: read

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def read(self, filename, **kwargs):
        header = self.parseHeaderFile(filename)

        def load_data(filename):
            self._log.debug('Loading %s' % filename)
            return num.flipud(
                num.fromfile(filename, dtype=num.float32)
                .reshape((header.lines, header.samples)))

        displacement = load_data(filename)
        theta_file, phi_file = self.getLOSFiles(filename)

        if not theta_file:
            theta = num.full_like(displacement, 0.)
        else:
            theta = load_data(theta_file)
            theta = num.deg2rad(theta)

        if not phi_file:
            phi = num.full_like(displacement, num.pi/2)
        else:
            phi = load_data(phi_file)
            phi = num.pi/2 - num.rad2deg(phi)

        c = self.container
        c.displacement = displacement
        c.phi = phi
        c.theta = theta

        map_info = header.map_info
        c.frame.dE = float(map_info[5])
        c.frame.dN = dN = float(map_info[6])
        c.frame.spacing = 'meter'

        c.frame.llLat, c.frame.llLon = utm.to_latlon(
            float(map_info[3]) - header.lines * dN,
            float(map_info[4]),
            zone_number=int(map_info[7]),
            northern=True if map_info[8] == 'Northern' else False)

        return c 
開發者ID:pyrocko,項目名稱:kite,代碼行數:43,代碼來源:scene_io.py

示例4: test_to_latlon

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def test_to_latlon(self):
        '''to_latlon should give known result with known input'''
        for latlon, utm, utm_kw in self.known_values:
            result = UTM.to_latlon(*utm)
            self.assert_latlon_equal(latlon, result)

            result = UTM.to_latlon(*utm[0:3], **utm_kw)
            self.assert_latlon_equal(latlon, result) 
開發者ID:daniilidis-group,項目名稱:mvsec,代碼行數:10,代碼來源:test_utm.py

示例5: convert_utm_lat

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def convert_utm_lat(row):
    return utm.to_latlon(row[1], row[2], 11, 'T')[0] 
開發者ID:metemaad,項目名稱:TrajLib,代碼行數:4,代碼來源:collect_animal_data.py

示例6: convert_utm_long

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def convert_utm_long(row):
    return utm.to_latlon(row[1], row[2], 11, 'T')[1] 
開發者ID:metemaad,項目名稱:TrajLib,代碼行數:4,代碼來源:collect_animal_data.py

示例7: latlon_rectangle_centered_at

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def latlon_rectangle_centered_at(lat, lon, w, h):
    """
    """
    x, y, number, letter = utm.from_latlon(lat, lon)
    rectangle = [utm.to_latlon(x - .5*w, y - .5*h, number, letter),
                 utm.to_latlon(x - .5*w, y + .5*h, number, letter),
                 utm.to_latlon(x + .5*w, y + .5*h, number, letter),
                 utm.to_latlon(x + .5*w, y - .5*h, number, letter)]
    rectangle.append(rectangle[0])  # close the polygon
    return rectangle 
開發者ID:cmla,項目名稱:tsd,代碼行數:12,代碼來源:utils.py

示例8: pix_2_latlon

# 需要導入模塊: import utm [as 別名]
# 或者: from utm import to_latlon [as 別名]
def pix_2_latlon(gt, px, py, zone_number, northern):
    x = px * gt[1] + gt[0]
    y = py * gt[5] + gt[3]

    if zone_number is not None:
        lat, lon = utm.to_latlon(x, y, zone_number, northern=northern)
    else:
        lat, lon = y, x

    return lon, lat, 0 
開發者ID:cmla,項目名稱:s2p,代碼行數:12,代碼來源:kml_tilemap.py


注:本文中的utm.to_latlon方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。