Skip to content
Commits on Source (10)
......@@ -266,7 +266,8 @@
"profile": "https://evers.dev/",
"contributions": [
"question",
"ideas"
"ideas",
"doc"
]
},
{
......
......@@ -11,7 +11,7 @@ env:
global:
- PROJ_BASE_DIR=$HOME/proj_install
- CYTHON_COVERAGE=True
- PROJSOURCE=6.2.0
- PROJSOURCE=6.2.1
# Following generated with
- WHEELHOUSE_UPLOADER_USERNAME=travis-worker
# Following generated by
......@@ -26,18 +26,23 @@ matrix:
os: osx
env:
- PYTHON=3.6.8
- PROJSOURCE=6.2.0
- PROJSOURCE=6.2.1
- python: 3.5
env:
- PROJSOURCE=6.2.0
- PROJSOURCE=6.2.1
- python: 3.6
env:
- PROJSOURCE=6.2.0
- python: 3.6
env:
- PROJSOURCE=6.2.1
- python: 3.7
dist: xenial
env:
- PROJSOURCE=6.2.0
- PROJSOURCE=6.2.1
- DOC=true
- python: 3.8
env:
- PROJSOURCE=6.2.1
- python: "nightly"
env:
- PROJSOURCE=git
......
......@@ -32,7 +32,8 @@ Python interface to [PROJ](http://proj.org) (cartographic projections and coordi
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="https://github.com/jswhit"><img src="https://avatars2.githubusercontent.com/u/579593?v=4" width="100px;" alt="Jeff Whitaker"/><br /><sub><b>Jeff Whitaker</b></sub></a><br /><a href="https://github.com/snowman2/pyproj/commits?author=jswhit" title="Documentation">📖</a> <a href="https://github.com/snowman2/pyproj/commits?author=jswhit" title="Tests">⚠️</a> <a href="https://github.com/snowman2/pyproj/commits?author=jswhit" title="Code">💻</a> <a href="#example-jswhit" title="Examples">💡</a> <a href="#ideas-jswhit" title="Ideas, Planning, & Feedback">🤔</a> <a href="#review-jswhit" title="Reviewed Pull Requests">👀</a> <a href="#question-jswhit" title="Answering Questions">💬</a> <a href="#maintenance-jswhit" title="Maintenance">🚧</a> <a href="#infra-jswhit" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
......@@ -65,13 +66,15 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center"><a href="http://lizards.opensuse.org/author/bmwiedemann/"><img src="https://avatars3.githubusercontent.com/u/637990?v=4" width="100px;" alt="Bernhard M. Wiedemann"/><br /><sub><b>Bernhard M. Wiedemann</b></sub></a><br /><a href="https://github.com/snowman2/pyproj/commits?author=bmwiedemann" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ReallyNiceGuy"><img src="https://avatars0.githubusercontent.com/u/6545730?v=4" width="100px;" alt="Marco Aurélio da Costa"/><br /><sub><b>Marco Aurélio da Costa</b></sub></a><br /><a href="https://github.com/snowman2/pyproj/commits?author=ReallyNiceGuy" title="Code">💻</a></td>
<td align="center"><a href="https://github.com/ChrisBarker-NOAA"><img src="https://avatars2.githubusercontent.com/u/916576?v=4" width="100px;" alt="Christopher H. Barker"/><br /><sub><b>Christopher H. Barker</b></sub></a><br /><a href="https://github.com/snowman2/pyproj/commits?author=ChrisBarker-NOAA" title="Code">💻</a></td>
<td align="center"><a href="https://evers.dev/"><img src="https://avatars3.githubusercontent.com/u/13132571?v=4" width="100px;" alt="Kristian Evers"/><br /><sub><b>Kristian Evers</b></sub></a><br /><a href="#question-kbevers" title="Answering Questions">💬</a> <a href="#ideas-kbevers" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center"><a href="https://evers.dev/"><img src="https://avatars3.githubusercontent.com/u/13132571?v=4" width="100px;" alt="Kristian Evers"/><br /><sub><b>Kristian Evers</b></sub></a><br /><a href="#question-kbevers" title="Answering Questions">💬</a> <a href="#ideas-kbevers" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/snowman2/pyproj/commits?author=kbevers" title="Documentation">📖</a></td>
<td align="center"><a href="http://www.spatialys.com/en/about/"><img src="https://avatars2.githubusercontent.com/u/1192433?v=4" width="100px;" alt="Even Rouault"/><br /><sub><b>Even Rouault</b></sub></a><br /><a href="#question-rouault" title="Answering Questions">💬</a></td>
<td align="center"><a href="https://github.com/cgohlke"><img src="https://avatars3.githubusercontent.com/u/483428?v=4" width="100px;" alt="Christoph Gohlke"/><br /><sub><b>Christoph Gohlke</b></sub></a><br /><a href="#platform-cgohlke" title="Packaging/porting to new platform">📦</a> <a href="#question-cgohlke" title="Answering Questions">💬</a> <a href="https://github.com/snowman2/pyproj/issues?q=author%3Acgohlke" title="Bug reports">🐛</a></td>
<td align="center"><a href="https://github.com/chrrrisw"><img src="https://avatars0.githubusercontent.com/u/5555320?v=4" width="100px;" alt="Chris Willoughby"/><br /><sub><b>Chris Willoughby</b></sub></a><br /><a href="https://github.com/snowman2/pyproj/commits?author=chrrrisw" title="Code">💻</a></td>
</tr>
</table>
<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
\ No newline at end of file
......@@ -21,19 +21,19 @@ environment:
# PYTHON_ARCH: "64"
# VS_VERSION: Visual Studio 14
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PROJSOURCE: 6.2.0
# PROJSOURCE: 6.2.1
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
VS_VERSION: Visual Studio 14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PROJSOURCE: 6.2.0
PROJSOURCE: 6.2.1
# - PYTHON: "C:\\Python37-x64"
# PYTHON_VERSION: "3.7"
# PYTHON_ARCH: "64"
# VS_VERSION: Visual Studio 14
# APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
# PROJSOURCE: 6.2.0
# PROJSOURCE: 6.2.1
# - PYTHON: "C:\\Python36-x64"
# PYTHON_VERSION: "3.6"
# PYTHON_ARCH: "64"
......
python-pyproj (2.4.0+ds-2) UNRELEASED; urgency=medium
python-pyproj (2.4.1+ds-1) unstable; urgency=medium
* New upstream release.
* Move from experimental to unstable.
-- Bas Couwenberg <sebastic@debian.org> Wed, 06 Nov 2019 14:28:09 +0100
python-pyproj (2.4.1~rc0+ds-1~exp1) experimental; urgency=medium
* New upstream release candidate.
* Bump Standards-Version to 4.4.1, no changes.
-- Bas Couwenberg <sebastic@debian.org> Mon, 30 Sep 2019 19:54:44 +0200
-- Bas Couwenberg <sebastic@debian.org> Sat, 02 Nov 2019 07:03:53 +0100
python-pyproj (2.4.0+ds-1) unstable; urgency=medium
......
......@@ -47,7 +47,7 @@ CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. """
__version__ = "2.4.0"
__version__ = "2.4.1"
__all__ = [
"Proj",
"Geod",
......
......@@ -109,6 +109,7 @@ cdef class CoordinateOperation(Base):
cdef readonly object has_ballpark_transformation
cdef readonly object _towgs84
cdef readonly object _operations
cdef readonly type_name
@staticmethod
cdef create(PJ_CONTEXT* context, PJ* coordinate_operation_pj)
......
......@@ -1327,6 +1327,14 @@ cdef class Grid:
)
_COORDINATE_OPERATION_TYPE_MAP = {
PJ_TYPE_UNKNOWN: "Unknown",
PJ_TYPE_CONVERSION: "Conversion",
PJ_TYPE_TRANSFORMATION: "Transformation",
PJ_TYPE_CONCATENATED_OPERATION: "Concatenated Operation",
PJ_TYPE_OTHER_COORDINATE_OPERATION: "Other Coordinate Operation",
}
cdef class CoordinateOperation(Base):
"""
.. versionadded:: 2.2.0
......@@ -1405,6 +1413,8 @@ cdef class CoordinateOperation(Base):
coord_operation.context,
coord_operation.projobj
) == 1
cdef PJ_TYPE operation_type = proj_get_type(coord_operation.projobj)
coord_operation.type_name = _COORDINATE_OPERATION_TYPE_MAP[operation_type]
CRSError.clear()
return coord_operation
......@@ -1665,6 +1675,18 @@ cdef class CoordinateOperation(Base):
self._operations = _get_concatenated_operations(self.context, self.projobj)
return self._operations
def __repr__(self):
return (
"<Coordinate Operation: {type_name}>\n"
"{name}\n"
"Area of Use:\n{area_of_use}"
).format(
type_name=self.type_name,
name=self.name,
area_of_use=self.area_of_use or "- undefined",
)
_CRS_TYPE_MAP = {
PJ_TYPE_UNKNOWN: "Unknown CRS",
PJ_TYPE_CRS: "CRS",
......
......@@ -41,8 +41,8 @@ INVERSE_GRID_MAPPING_NAME_MAP = {
PROJ_PARAM_MAP = {
"azimuth_of_central_line": "alpha",
"earth_radius": "R",
"fase_easting": "x_0",
"fase_northing": "y_0",
"false_easting": "x_0",
"false_northing": "y_0",
"latitude_of_projection_origin": "lat_0",
"north_pole_grid_longitude": "lon_0",
"straight_vertical_longitude_from_pole": "lon_0",
......@@ -95,8 +95,8 @@ PARAM_TO_CF_MAP = {
"Scale factor at natural origin": "scale_factor_at_central_meridian",
"Easting at projection centre": "false_easting",
"Northing at projection centre": "false_northing",
"Easting at false origin": "fase_easting",
"Northing at false origin": "fase_northing",
"Easting at false origin": "false_easting",
"Northing at false origin": "false_northing",
"False easting": "false_easting",
"False northing": "false_northing",
}
......@@ -226,7 +226,7 @@ class CRS(_CRS):
ORDER[2],
LENGTHUNIT["metre",1,
ID["EPSG",9001]]]
>>> crs_utm.coordinate_operation
>>> print(crs_utm.coordinate_operation.to_wkt(pretty=True))
CONVERSION["UTM zone 15N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
......@@ -720,12 +720,15 @@ class CRS(_CRS):
"""
cf_dict = {"crs_wkt": self.to_wkt(wkt_version)}
if self.is_geographic and self.name != "unknown":
missing_names = ("unknown", "unnamed")
if self.is_geographic and self.name not in missing_names:
cf_dict["geographic_crs_name"] = self.name
elif self.is_projected and self.name != "unknown":
elif self.is_projected and self.name not in missing_names:
cf_dict["projected_crs_name"] = self.name
proj_dict = self.to_dict()
if not proj_dict:
return cf_dict
proj_name = proj_dict.pop("proj")
lonlat_possible_names = ("lonlat", "latlon", "longlat", "latlong")
if proj_name in lonlat_possible_names:
......@@ -775,6 +778,8 @@ class CRS(_CRS):
]
elif "lat_1" in proj_dict:
cf_dict["standard_parallel"] = proj_dict.pop("lat_1")
elif "lat_ts" in proj_dict:
cf_dict["standard_parallel"] = proj_dict.pop("lat_ts")
skipped_params = []
for proj_param, proj_val in proj_dict.items():
......@@ -828,7 +833,7 @@ class CRS(_CRS):
)
proj_dict = {"proj": proj_name}
if grid_mapping_name == "rotated_latitude_longitude":
proj_dict["o_proj"] = "latlon"
proj_dict["o_proj"] = "longlat"
elif grid_mapping_name == "oblique_mercator":
try:
proj_dict["lonc"] = in_cf.pop("longitude_of_projection_origin")
......@@ -840,6 +845,8 @@ class CRS(_CRS):
if isinstance(standard_parallel, list):
proj_dict["lat_1"] = standard_parallel[0]
proj_dict["lat_2"] = standard_parallel[1]
elif proj_name == "merc":
proj_dict["lat_ts"] = standard_parallel
else:
proj_dict["lat_1"] = standard_parallel
......
......@@ -18,7 +18,7 @@ def set_data_dir(proj_data_dir):
Parameters
----------
proj_data_dir: str
The path to rhe PROJ data directory.
The path to the PROJ data directory.
"""
global _USER_PROJ_DATA
global _VALIDATED_PROJ_DATA
......@@ -40,7 +40,7 @@ def append_data_dir(proj_data_dir):
Parameters
----------
proj_data_dir: str
The path to rhe PROJ data directory.
The path to the PROJ data directory.
"""
set_data_dir(os.pathsep.join([get_data_dir(), proj_data_dir]))
......
......@@ -82,6 +82,15 @@ class TransformerGroup(_TransformerGroup):
The area of interest to help order the transformations based on the
best operation for the area.
Example:
>>> from pyproj.transformer import TransformerGroup
>>> trans_group = TransformerGroup(4326, 2964)
>>> trans_group
<TransformerGroup: best_available=True>
- transformers: 8
- unavailable_operations: 1
"""
super(TransformerGroup, self).__init__(
CRS.from_user_input(crs_from),
......@@ -118,6 +127,17 @@ class TransformerGroup(_TransformerGroup):
"""
return self._best_available
def __repr__(self):
return (
"<TransformerGroup: best_available={best_available}>\n"
"- transformers: {transformers}\n"
"- unavailable_operations: {unavailable_operations}"
).format(
best_available=self.best_available,
transformers=len(self.transformers),
unavailable_operations=len(self.unavailable_operations),
)
class Transformer:
"""
......
......@@ -226,6 +226,7 @@ setup(
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Mathematics",
......
from distutils.version import LooseVersion
import pytest
from pyproj import CRS, Transformer
from pyproj import CRS, Transformer, proj_version_str
from pyproj._crs import CoordinateSystem
from pyproj.crs import CoordinateOperation, Datum, Ellipsoid, PrimeMeridian
from pyproj.enums import ProjVersion, WktVersion
......@@ -463,7 +465,13 @@ def test_coordinate_system_geog():
def test_coordinate_operation():
crs = CRS.from_epsg(26915)
assert repr(crs.coordinate_operation).startswith('CONVERSION["UTM zone 15N"')
assert repr(crs.coordinate_operation) == (
"<Coordinate Operation: Conversion>\n"
"UTM zone 15N\n"
"Area of Use:\n"
"- name: World - N hemisphere - 96°W to 90°W\n"
"- bounds: (-96.0, 0.0, -90.0, 84.0)"
)
assert crs.coordinate_operation.method_name == "Transverse Mercator"
assert crs.coordinate_operation.name == str(crs.coordinate_operation)
assert crs.coordinate_operation.method_auth_name == "EPSG"
......@@ -874,6 +882,22 @@ def test_to_dict_no_proj4():
"proj": "ob_tran",
}
)
if LooseVersion(proj_version_str) >= LooseVersion("6.3.0"):
assert crs.to_proj4() == (
"+proj=ob_tran +o_proj=longlat +lon_0=-10 +o_lat_p=30 "
"+o_lon_p=0 +R=6371229 +no_defs +type=crs"
)
assert crs.to_dict() == {
"R": 6371229,
"lon_0": -10,
"no_defs": None,
"o_lat_p": 30,
"o_lon_p": 0,
"o_proj": "longlat",
"proj": "ob_tran",
"type": "crs",
}
else:
assert crs.to_proj4() is None
assert crs.to_dict() == {}
......
from distutils.version import LooseVersion
import pytest
from numpy.testing import assert_almost_equal
from pyproj import CRS
from pyproj import CRS, proj_version_str
from pyproj.exceptions import CRSError
......@@ -25,8 +27,8 @@ def test_to_cf_transverse_mercator():
"grid_mapping_name": "transverse_mercator",
"latitude_of_projection_origin": 0,
"longitude_of_central_meridian": 15,
"fase_easting": 2520000,
"fase_northing": 0,
"false_easting": 2520000,
"false_northing": 0,
"reference_ellipsoid_name": "intl",
"towgs84": towgs84_test,
"unit": "m",
......@@ -53,8 +55,8 @@ def test_from_cf_transverse_mercator():
"grid_mapping_name": "transverse_mercator",
"latitude_of_projection_origin": 0,
"longitude_of_central_meridian": 15,
"fase_easting": 2520000,
"fase_northing": 0,
"false_easting": 2520000,
"false_northing": 0,
"reference_ellipsoid_name": "intl",
"towgs84": towgs84_test,
"unit": "m",
......@@ -67,8 +69,8 @@ def test_from_cf_transverse_mercator():
assert cf_dict["grid_mapping_name"] == "transverse_mercator"
assert cf_dict["latitude_of_projection_origin"] == 0
assert cf_dict["longitude_of_central_meridian"] == 15
assert cf_dict["fase_easting"] == 2520000
assert cf_dict["fase_northing"] == 0
assert cf_dict["false_easting"] == 2520000
assert cf_dict["false_northing"] == 0
assert cf_dict["reference_ellipsoid_name"] == "intl"
assert cf_dict["unit"] == "m"
assert_almost_equal(cf_dict["towgs84"], list(towgs84_test))
......@@ -147,20 +149,27 @@ def test_cf_rotated_latlon():
grid_north_pole_longitude=170.0,
)
)
cf_dict = crs.to_cf()
assert cf_dict.pop("crs_wkt").startswith("GEOGCRS[")
if LooseVersion(proj_version_str) >= LooseVersion("6.3.0"):
assert crs.to_dict() == {
"proj": "ob_tran",
"o_proj": "latlon",
"o_proj": "longlat",
"o_lat_p": 32.5,
"o_lon_p": 170.0,
"datum": "WGS84",
"no_defs": None,
"type": "crs",
}
cf_dict = crs.to_cf()
assert cf_dict.pop("crs_wkt").startswith("PROJCRS[")
assert cf_dict == dict(
grid_mapping_name="rotated_latitude_longitude",
grid_north_pole_latitude=32.5,
grid_north_pole_longitude=170.0,
horizontal_datum_name="WGS84",
)
else:
assert cf_dict == {}
assert crs.to_dict() == {}
def test_cf_rotated_latlon__grid():
......@@ -172,14 +181,19 @@ def test_cf_rotated_latlon__grid():
north_pole_grid_longitude=0,
)
)
if LooseVersion(proj_version_str) >= LooseVersion("6.3.0"):
assert crs.to_dict() == {
"proj": "ob_tran",
"o_proj": "latlon",
"o_proj": "longlat",
"o_lat_p": 32.5,
"o_lon_p": 170.0,
"lon_0": 0,
"datum": "WGS84",
"no_defs": None,
"type": "crs",
}
else:
assert crs.to_dict() == {}
def test_cf_lambert_conformal_conic():
......@@ -200,8 +214,8 @@ def test_cf_lambert_conformal_conic():
"scale_factor_at_projection_origin": 1,
"standard_parallel": 25,
"latitude_of_projection_origin": 25,
"fase_easting": 0,
"fase_northing": 0,
"false_easting": 0,
"false_northing": 0,
"horizontal_datum_name": "WGS84",
"unit": "m",
}
......@@ -225,8 +239,8 @@ def test_cf_lambert_conformal_conic_1sp():
"scale_factor_at_projection_origin": 1,
"standard_parallel": 25,
"latitude_of_projection_origin": 25,
"fase_easting": 0,
"fase_northing": 0,
"false_easting": 0,
"false_northing": 0,
"horizontal_datum_name": "WGS84",
"unit": "m",
}
......@@ -263,8 +277,8 @@ def test_cf_lambert_conformal_conic_2sp():
"longitude_of_central_meridian": 265,
"standard_parallel": [25, 30],
"latitude_of_projection_origin": 25,
"fase_easting": 0,
"fase_northing": 0,
"false_easting": 0,
"false_northing": 0,
"horizontal_datum_name": "WGS84",
"unit": "m",
}
......@@ -303,8 +317,8 @@ def test_oblique_mercator():
"latitude_of_projection_origin": 10,
"longitude_of_projection_origin": 15,
"azimuth_of_central_line": 0.35,
"fase_easting": 0,
"fase_northing": 0,
"false_easting": 0,
"false_northing": 0,
"reference_ellipsoid_name": "WGS84",
"unit": "m",
}
......@@ -372,8 +386,8 @@ def test_crs_sweep():
"longitude_of_projection_origin": 0,
"sweep_angle_axis": "x",
"perspective_point_height": 1,
"fase_easting": 0,
"fase_northing": 0,
"false_easting": 0,
"false_northing": 0,
"horizontal_datum_name": "WGS84",
"unit": "m",
}
......@@ -394,8 +408,8 @@ def test_crs_fixed_angle_axis():
"longitude_of_projection_origin": 0,
"sweep_angle_axis": "x",
"perspective_point_height": 1,
"fase_easting": 0,
"fase_northing": 0,
"false_easting": 0,
"false_northing": 0,
"horizontal_datum_name": "WGS84",
"unit": "m",
}
......@@ -411,3 +425,37 @@ def test_ob_tran_not_rotated_latlon():
"grid_north_pole_latitude": 45,
"grid_north_pole_longitude": -90,
}
def test_mercator():
crs = CRS.from_cf(
{
"grid_mapping_name": "mercator",
"longitude_of_projection_origin": 10,
"standard_parallel": 21.354,
"false_easting": 0,
"false_northing": 0,
}
)
assert crs.to_dict() == {
"datum": "WGS84",
"lat_ts": 21.354,
"lon_0": 10,
"no_defs": None,
"proj": "merc",
"type": "crs",
"units": "m",
"x_0": 0,
"y_0": 0,
}
cf_dict = crs.to_cf()
assert cf_dict.pop("crs_wkt").startswith("PROJCRS[")
assert cf_dict == {
"grid_mapping_name": "mercator",
"longitude_of_projection_origin": 10,
"standard_parallel": 21.354,
"false_easting": 0,
"false_northing": 0,
"horizontal_datum_name": "WGS84",
"unit": "m",
}
......@@ -5,6 +5,7 @@ pytest can conveniently run all the tests in a single command line.
import doctest
import os
import platform
import sys
import pyproj
......@@ -25,12 +26,16 @@ def test_doctests():
+ failure_count_geod
+ failure_count_transform
)
# shapely wheels not on windows, so allow failures there
# Missing shapely wheels for Windows, non x86_64 platforms, and python 3.8
expected_failure_count = 0
try:
import shapely # noqa
except ImportError:
if os.name == "nt" or platform.uname()[4] != "x86_64":
if (
os.name == "nt"
or platform.uname()[4] != "x86_64"
or (sys.version_info.major, sys.version_info.minor) >= (3, 8)
):
expected_failure_count = 6
# if the below line fails, doctests have failed
......
......@@ -3,6 +3,7 @@ import os
import pickle
import platform
import shutil
import sys
import tempfile
from contextlib import contextmanager
......@@ -28,8 +29,13 @@ except ImportError:
skip_shapely = pytest.mark.skipif(
not SHAPELY_LOADED and (os.name == "nt" or platform.uname()[4] != "x86_64"),
reason="Missing shapely wheels for Windows.",
not SHAPELY_LOADED
and (
os.name == "nt"
or platform.uname()[4] != "x86_64"
or (sys.version_info.major, sys.version_info.minor) >= (3, 8)
),
reason="Missing shapely wheels for Windows, non x86_64 platforms, and python 3.8.",
)
......
import os
import shutil
import tempfile
from distutils.version import LooseVersion
import numpy as np
import pytest
from numpy.testing import assert_almost_equal
import pyproj
from pyproj import Proj, Transformer, itransform, transform
from pyproj import Proj, Transformer, itransform, proj_version_str, transform
from pyproj.enums import TransformDirection
from pyproj.exceptions import ProjError
from pyproj.transformer import AreaOfInterest, TransformerGroup
......@@ -260,6 +261,10 @@ def test_transform_no_exception():
def test_transform__out_of_bounds():
with pytest.warns(DeprecationWarning):
transformer = Transformer.from_proj("+init=epsg:4326", "+init=epsg:27700")
if LooseVersion(proj_version_str) >= LooseVersion("6.3.0"):
with pytest.raises(ProjError):
transformer.transform(100000, 100000, errcheck=True)
else:
assert np.all(np.isinf(transformer.transform(100000, 100000, errcheck=True)))
......