Codebase list python-pyproj / 9329204
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
6 changed file(s) with 25 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
2727 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2828 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2929 """
30 __version__ = "2.6.1rc0"
30 __version__ = "2.6.1rc1"
3131 __all__ = [
3232 "Proj",
3333 "Geod",
423423 return
424424 if radians and self.is_pipeline:
425425 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."
428428 )
429429
430430 tmp_pj_direction = _PJ_DIRECTION_MAP[TransformDirection.create(direction)]
136136 latitude: Any,
137137 inverse: bool = False,
138138 errcheck: bool = False,
139 radians: bool = False,
139140 ) -> Tuple[Any, Any]:
140141 """
141142 Calling a Proj class instance with the arguments lon, lat will
157158 inverse: boolean, optional
158159 If inverse is True the inverse transformation from x/y to
159160 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.
160166 errcheck: boolean, optional
161167 If True an exception is raised if the errors are found in the process.
162168 By default errcheck=False and ``inf`` is returned.
166172 Tuple[Any, Any]:
167173 The transformed coordinates.
168174 """
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 )
169180 # process inputs, making copies that support buffer API.
170181 inx, xisfloat, xislist, xistuple = _copytobuffer(longitude)
171182 iny, yisfloat, yislist, yistuple = _copytobuffer(latitude)
362362 radians: boolean, optional
363363 If True, will expect input data to be in radians and will return radians
364364 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.
366366 errcheck: boolean, optional
367367 If True an exception is raised if the transformation is invalid.
368368 By default errcheck=False and an invalid transformation
521521 proj="utm", zone=32, ellipsis="WGS84", datum="WGS84", units="m", south=south
522522 )
523523 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)
593593 )
594594
595595 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()
598598 else:
599599 # assuming all grids avaiable or PROJ_NETWORK=ON
600600 trans_group = pyproj.transformer.TransformerGroup(
601601 lat_lon_proj.crs, alaska_aea_proj.crs
602602 )
603603 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
606605
607606
608607 def test_transform_group__area_of_interest():
737736
738737 def test_pipeline_radian_transform_warning():
739738 trans = Transformer.from_pipeline("+proj=pipeline +ellps=GRS80 +step +proj=cart")
740 with pytest.warns(UserWarning):
739 with pytest.warns(UserWarning, match="radian"):
741740 trans.transform(0.1, 0.1, 0, radians=True)