コード例 #1
0
ファイル: test_database.py プロジェクト: wildblow/pyproj
def test_query_utm_crs_info__aoi_datum_name(datum_name):
    aoi = BBox(west=-93.581543, south=42.032974, east=-93.581543, north=42.032974)
    crs_info_list = query_utm_crs_info(
        datum_name=datum_name,
        area_of_interest=AreaOfInterest(
            west_lon_degree=aoi.west,
            south_lat_degree=aoi.south,
            east_lon_degree=aoi.east,
            north_lat_degree=aoi.north,
        ),
    )
    assert len(crs_info_list) == 1
    crs_info = crs_info_list[0]
    bbox = BBox(*crs_info.area_of_use.bounds)
    assert bbox.intersects(aoi)
    assert "UTM zone" in crs_info.name
    assert datum_name.replace(" ", "") in crs_info.name.replace(" ", "")
    assert crs_info.auth_name == "EPSG"
    assert crs_info.type == PJType.PROJECTED_CRS
    assert not crs_info.deprecated
コード例 #2
0
ファイル: test_database.py プロジェクト: wildblow/pyproj
def test_query_crs_info__aoi():
    aoi = BBox(west=-40, south=50, east=-20, north=70)
    crs_info_list = query_crs_info(
        auth_name="ESRI",
        pj_types=PJType.PROJECTED_CRS,
        area_of_interest=AreaOfInterest(
            west_lon_degree=aoi.west,
            south_lat_degree=aoi.south,
            east_lon_degree=aoi.east,
            north_lat_degree=aoi.north,
        ),
    )
    assert crs_info_list
    not_contains_present = False
    for crs_info in crs_info_list:
        bbox = BBox(*crs_info.area_of_use.bounds)
        assert bbox.intersects(aoi)
        assert crs_info.auth_name == "ESRI"
        assert crs_info.type == PJType.PROJECTED_CRS
        assert not crs_info.deprecated
        if not bbox.contains(aoi):
            not_contains_present = True
    assert not_contains_present