summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--django/contrib/gis/geos/base.py6
-rw-r--r--django/contrib/gis/geos/coordseq.py3
-rw-r--r--django/contrib/gis/geos/linestring.py2
-rw-r--r--django/contrib/gis/geos/tests/test_geos.py3
-rw-r--r--django/contrib/gis/shortcuts.py6
5 files changed, 11 insertions, 9 deletions
diff --git a/django/contrib/gis/geos/base.py b/django/contrib/gis/geos/base.py
index ff54fe6695..634ed7d3d1 100644
--- a/django/contrib/gis/geos/base.py
+++ b/django/contrib/gis/geos/base.py
@@ -12,12 +12,6 @@ except ImportError:
HAS_GDAL = False
gdal = GDALInfo()
-# NumPy supported?
-try:
- import numpy
-except ImportError:
- numpy = False
-
class GEOSBase(object):
"""
diff --git a/django/contrib/gis/geos/coordseq.py b/django/contrib/gis/geos/coordseq.py
index de3583e499..ae82908f5c 100644
--- a/django/contrib/gis/geos/coordseq.py
+++ b/django/contrib/gis/geos/coordseq.py
@@ -6,9 +6,10 @@
from ctypes import byref, c_double, c_uint
from django.contrib.gis.geos import prototypes as capi
-from django.contrib.gis.geos.base import GEOSBase, numpy
+from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.error import GEOSException, GEOSIndexError
from django.contrib.gis.geos.libgeos import CS_PTR
+from django.contrib.gis.shortcuts import numpy
from django.utils.six.moves import range
diff --git a/django/contrib/gis/geos/linestring.py b/django/contrib/gis/geos/linestring.py
index 7b2cc540ba..82ae9a2a4e 100644
--- a/django/contrib/gis/geos/linestring.py
+++ b/django/contrib/gis/geos/linestring.py
@@ -1,9 +1,9 @@
from django.contrib.gis.geos import prototypes as capi
-from django.contrib.gis.geos.base import numpy
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos.point import Point
+from django.contrib.gis.shortcuts import numpy
from django.utils.six.moves import range
diff --git a/django/contrib/gis/geos/tests/test_geos.py b/django/contrib/gis/geos/tests/test_geos.py
index 7c9c1e829e..a288300f8f 100644
--- a/django/contrib/gis/geos/tests/test_geos.py
+++ b/django/contrib/gis/geos/tests/test_geos.py
@@ -10,6 +10,7 @@ from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import TestDataMixin
+from django.contrib.gis.shortcuts import numpy
from django.utils import six
from django.utils.encoding import force_bytes
from django.utils.six.moves import range
@@ -20,7 +21,7 @@ if HAS_GEOS:
from .. import (GEOSException, GEOSIndexError, GEOSGeometry,
GeometryCollection, Point, MultiPoint, Polygon, MultiPolygon, LinearRing,
LineString, MultiLineString, fromfile, fromstr, geos_version_info)
- from ..base import gdal, numpy, GEOSBase
+ from ..base import gdal, GEOSBase
@skipUnless(HAS_GEOS, "Geos is required.")
diff --git a/django/contrib/gis/shortcuts.py b/django/contrib/gis/shortcuts.py
index a530228e84..2df690c116 100644
--- a/django/contrib/gis/shortcuts.py
+++ b/django/contrib/gis/shortcuts.py
@@ -5,6 +5,12 @@ from django.conf import settings
from django.http import HttpResponse
from django.template import loader
+# NumPy supported?
+try:
+ import numpy
+except ImportError:
+ numpy = False
+
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."