Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warning for GeostationarySatelliteConversion where latitude_natural_origin is nonzero #546

Merged
merged 1 commit into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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