Skip to content

Commit

Permalink
Merge pull request #829 from geopython/test-for-pyproj
Browse files Browse the repository at this point in the history
handle pyproj installations/dependencies
  • Loading branch information
tomkralidis authored Aug 28, 2022
2 parents a3317d3 + 26d71fc commit e9bef5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 12 additions & 2 deletions owslib/feature/wfs100.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# =============================================================================

import itertools
import logging

from owslib import util

from io import BytesIO
Expand All @@ -31,7 +33,15 @@
AbstractContentMetadata,
)

import pyproj
LOGGER = logging.getLogger(__name__)

has_pyproj = False

try:
import pyproj
has_pyproj = True
except ImportError:
LOGGER.warning('pyproj not installed')

n = Namespaces()
WFS_NAMESPACE = n.get_namespace("wfs")
Expand Down Expand Up @@ -394,7 +404,7 @@ def __init__(
# transform wgs84 bbox from given default bboxt
self.boundingBoxWGS84 = None

if b is not None and srs is not None:
if has_pyproj and b is not None and srs is not None:
wgs84 = pyproj.CRS.from_epsg(4326)
try:
src_srs = pyproj.CRS.from_string(srs.text)
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
python-dateutil>=1.5
pytz
requests>=1.0
pyproj
pyyaml
dataclasses; python_version < '3.7'

0 comments on commit e9bef5e

Please sign in to comment.