Skip to content

Commit

Permalink
add warning for GeostationarySatelliteConversion where latitude_natur…
Browse files Browse the repository at this point in the history
…al_origin is nonzero (#546)
  • Loading branch information
snowman2 committed Feb 20, 2020
1 parent 59004b8 commit 7382edd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
8 changes: 8 additions & 0 deletions pyproj/crs/coordinate_operation.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from distutils.version import LooseVersion

from pyproj._crs import CoordinateOperation
Expand Down Expand Up @@ -204,6 +205,13 @@ def __new__(
if sweep_angle_axis not in valid_sweep_axis:
raise CRSError("sweep_angle_axis only supports {}".format(valid_sweep_axis))

if latitude_natural_origin != 0:
warnings.warn(
"The latitude of natural origin (lat_0) is not used "
"within PROJ. It is only supported for exporting to "
"the WKT or PROJ JSON formats."
)

geos_json = {
"$schema": "https://proj.org/schemas/v0.2/projjson.schema.json",
"type": "Conversion",
Expand Down
17 changes: 9 additions & 8 deletions test/crs/test_crs_coordinate_operation.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,15 @@ def test_geostationary_operation__defaults():


def test_geostationary_operation():
geop = GeostationarySatelliteConversion(
sweep_angle_axis="y",
satellite_height=11,
latitude_natural_origin=1,
longitude_natural_origin=2,
false_easting=3,
false_northing=4,
)
with pytest.warns(UserWarning):
geop = GeostationarySatelliteConversion(
sweep_angle_axis="y",
satellite_height=11,
latitude_natural_origin=1,
longitude_natural_origin=2,
false_easting=3,
false_northing=4,
)
assert geop.name == "unknown"
assert geop.method_name == "Geostationary Satellite (Sweep Y)"
assert _to_dict(geop) == {
Expand Down

0 comments on commit 7382edd

Please sign in to comment.