pyproj4 / pyproj

Python interface to PROJ (cartographic projections and coordinate transformations library)
https://pyproj4.github.io/pyproj
MIT License
1.05k stars 212 forks source link

Test failures with PROJ 9.5.0 #1436

Closed sebastic closed 1 month ago

sebastic commented 1 month ago

Problem description

The Debian package CI shows test failures with PROJ 9.5.0-rc1:

 65s =================================== FAILURES ===================================
 65s ______________________ test_oblique_mercator_losing_gamma ______________________
 65s 
 65s     def test_oblique_mercator_losing_gamma():
 65s         crs = CRS(
 65s             "+proj=omerc +lat_0=-36.10360962430914 +lonc=147.0632291727015 "
 65s             "+alpha=-54.78622979612904 +k=1 +x_0=0 +y_0=0 +gamma=-54.78622979612904"
 65s         )
 65s         with pytest.warns(
 65s             UserWarning,
 65s             match="angle from rectified to skew grid parameter lost in conversion to CF",
 65s         ):
 65s >           crs.to_cf()
 65s 
 65s test/crs/test_crs_cf.py:724: 
 65s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 65s /usr/lib/python3/dist-packages/pyproj/crs/crs.py:743: in to_cf
 65s     _INVERSE_GRID_MAPPING_NAME_MAP[coordinate_operation_name](
 65s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
 65s 
 65s conversion = <Coordinate Operation: Conversion>
 65s Name: unknown
 65s Method: Hotine Oblique Mercator (variant B)
 65s Area of Use:
 65s - undefined
 65s 
 65s     def _oblique_mercator__to_cf(conversion):
 65s         """
 65s         http://cfconventions.org/cf-conventions/cf-conventions.html#_oblique_mercator
 65s         """
 65s         params = _to_dict(conversion)
 65s         if params["angle_from_rectified_to_skew_grid"] != 0:
 65s             warnings.warn(
 65s                 "angle from rectified to skew grid parameter lost in conversion to CF"
 65s             )
 65s         return {
 65s             "grid_mapping_name": "oblique_mercator",
 65s             "latitude_of_projection_origin": params["latitude_of_projection_centre"],
 65s             "longitude_of_projection_origin": params["longitude_of_projection_centre"],
 65s >           "azimuth_of_central_line": params["azimuth_of_initial_line"],
 65s             "scale_factor_at_projection_origin": params["scale_factor_on_initial_line"],
 65s             "false_easting": params["easting_at_projection_centre"],
 65s             "false_northing": params["northing_at_projection_centre"],
 65s         }
 65s E       KeyError: 'azimuth_of_initial_line'
 65s 
 65s /usr/lib/python3/dist-packages/pyproj/crs/_cf1x8.py:521: KeyError
 65s ______________________ test_transformer__area_of_interest ______________________
 65s 
 65s     def test_transformer__area_of_interest():
 65s         transformer = Transformer.from_crs(
 65s             "EPSG:7789",
 65s             "EPSG:4936",
 65s             area_of_interest=AreaOfInterest(-177.25, -44.64, -43.3, -175.54),
 65s         )
 65s >       assert (
 65s             transformer.description
 65s             == "Ballpark geocentric translation from ITRF2014 to ETRS89"
 65s         )
 65s E       AssertionError: assert 'unavailable ...ans is called' == 'Ballpark geo...014 to ETRS89'
 65s E         
 65s E         - Ballpark geocentric translation from ITRF2014 to ETRS89
 65s E         + unavailable until proj_trans is called
 65s 
 65s test/test_transformer.py:766: AssertionError
 65s ------------------------------ Captured log call -------------------------------
 65s DEBUG    pyproj:transformer.py:105 PROJ_ERROR: proj_operation_factory_context_set_area_of_interest: GeographicBoundingBox::create() does not accept south > north
 65s ___________________ test_transformer_proj__area_of_interest ____________________
 65s 
 65s     def test_transformer_proj__area_of_interest():
 65s         transformer = Transformer.from_proj(
 65s             "EPSG:7789",
 65s             "EPSG:4936",
 65s             area_of_interest=AreaOfInterest(-177.25, -44.64, -43.3, -175.54),
 65s         )
 65s >       assert (
 65s             transformer.description
 65s             == "Ballpark geocentric translation from ITRF2014 to ETRS89"
 65s         )
 65s E       AssertionError: assert 'unavailable ...ans is called' == 'Ballpark geo...014 to ETRS89'
 65s E         
 65s E         - Ballpark geocentric translation from ITRF2014 to ETRS89
 65s E         + unavailable until proj_trans is called
 65s 
 65s test/test_transformer.py:778: AssertionError
 65s ------------------------------ Captured log call -------------------------------
 65s DEBUG    pyproj:transformer.py:105 PROJ_ERROR: proj_operation_factory_context_set_area_of_interest: GeographicBoundingBox::create() does not accept south > north

https://ci.debian.net/packages/p/python-pyproj/unstable/amd64/51514242/

Environment Information

Installation method

snowman2 commented 1 month ago

See: