Update upstream source from tag 'upstream/2.6.1_rc1+ds'
Update to upstream version '2.6.1~rc1+ds'
with Debian dir feced5cf834cdbc6abb203eaf6962d41074dbb0b
Bas Couwenberg
4 years ago
27 | 27 |
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
28 | 28 |
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
29 | 29 |
"""
|
30 | |
__version__ = "2.6.1rc0"
|
|
30 |
__version__ = "2.6.1rc1"
|
31 | 31 |
__all__ = [
|
32 | 32 |
"Proj",
|
33 | 33 |
"Geod",
|
423 | 423 |
return
|
424 | 424 |
if radians and self.is_pipeline:
|
425 | 425 |
warnings.warn(
|
426 | |
"radian input with pipelines is not supported and may result "
|
427 | |
"in unexpected transformations."
|
|
426 |
"radian input with pipelines is not supported in pyproj 2. "
|
|
427 |
"support for raidans will be added in pyproj 3."
|
428 | 428 |
)
|
429 | 429 |
|
430 | 430 |
tmp_pj_direction = _PJ_DIRECTION_MAP[TransformDirection.create(direction)]
|
136 | 136 |
latitude: Any,
|
137 | 137 |
inverse: bool = False,
|
138 | 138 |
errcheck: bool = False,
|
|
139 |
radians: bool = False,
|
139 | 140 |
) -> Tuple[Any, Any]:
|
140 | 141 |
"""
|
141 | 142 |
Calling a Proj class instance with the arguments lon, lat will
|
|
157 | 158 |
inverse: boolean, optional
|
158 | 159 |
If inverse is True the inverse transformation from x/y to
|
159 | 160 |
lon/lat is performed. Default is False.
|
|
161 |
radians: boolean, optional
|
|
162 |
If True, will expect input data to be in radians and will return radians
|
|
163 |
if the projection is geographic. Default is False (degrees).
|
|
164 |
This does not work with pyproj 2 and is ignored. It will be enabled again
|
|
165 |
in pyproj 3.
|
160 | 166 |
errcheck: boolean, optional
|
161 | 167 |
If True an exception is raised if the errors are found in the process.
|
162 | 168 |
By default errcheck=False and ``inf`` is returned.
|
|
166 | 172 |
Tuple[Any, Any]:
|
167 | 173 |
The transformed coordinates.
|
168 | 174 |
"""
|
|
175 |
if radians:
|
|
176 |
warnings.warn(
|
|
177 |
"radian input is currently not supported in pyproj 2. "
|
|
178 |
"Support for radian input will be added in pyproj 3."
|
|
179 |
)
|
169 | 180 |
# process inputs, making copies that support buffer API.
|
170 | 181 |
inx, xisfloat, xislist, xistuple = _copytobuffer(longitude)
|
171 | 182 |
iny, yisfloat, yislist, yistuple = _copytobuffer(latitude)
|
362 | 362 |
radians: boolean, optional
|
363 | 363 |
If True, will expect input data to be in radians and will return radians
|
364 | 364 |
if the projection is geographic. Default is False (degrees). Ignored for
|
365 | |
pipeline transformations.
|
|
365 |
pipeline transformations with pyproj 2, but will work in pyproj 3.
|
366 | 366 |
errcheck: boolean, optional
|
367 | 367 |
If True an exception is raised if the transformation is invalid.
|
368 | 368 |
By default errcheck=False and an invalid transformation
|
521 | 521 |
proj="utm", zone=32, ellipsis="WGS84", datum="WGS84", units="m", south=south
|
522 | 522 |
)
|
523 | 523 |
assert "+south " in proj.srs
|
|
524 |
|
|
525 |
|
|
526 |
def test_proj_radians_warning():
|
|
527 |
proj = Proj("epsg:4326")
|
|
528 |
with pytest.warns(UserWarning, match="radian"):
|
|
529 |
proj(1, 2, radians=True)
|
593 | 593 |
)
|
594 | 594 |
|
595 | 595 |
assert not trans_group.best_available
|
596 | |
assert len(trans_group.transformers) == 37
|
597 | |
assert len(trans_group.unavailable_operations) == 41
|
|
596 |
assert "ntv2_0" not in trans_group.transformers[0].definition
|
|
597 |
assert "ntv2_0" in trans_group.unavailable_operations[0].to_proj4()
|
598 | 598 |
else:
|
599 | 599 |
# assuming all grids avaiable or PROJ_NETWORK=ON
|
600 | 600 |
trans_group = pyproj.transformer.TransformerGroup(
|
601 | 601 |
lat_lon_proj.crs, alaska_aea_proj.crs
|
602 | 602 |
)
|
603 | 603 |
assert trans_group.best_available
|
604 | |
assert len(trans_group.transformers) == 78
|
605 | |
assert len(trans_group.unavailable_operations) == 0
|
|
604 |
assert "ntv2_0" in trans_group.transformers[0].definition
|
606 | 605 |
|
607 | 606 |
|
608 | 607 |
def test_transform_group__area_of_interest():
|
|
737 | 736 |
|
738 | 737 |
def test_pipeline_radian_transform_warning():
|
739 | 738 |
trans = Transformer.from_pipeline("+proj=pipeline +ellps=GRS80 +step +proj=cart")
|
740 | |
with pytest.warns(UserWarning):
|
|
739 |
with pytest.warns(UserWarning, match="radian"):
|
741 | 740 |
trans.transform(0.1, 0.1, 0, radians=True)
|