|
6 | 6 | reference system to another. |
7 | 7 |
|
8 | 8 | Driver: Wraps an OGR data source driver. |
9 | | - |
| 9 | +
|
10 | 10 | DataSource: Wrapper for the OGR data source object, supports |
11 | 11 | OGR-supported data sources. |
12 | 12 |
|
|
20 | 20 |
|
21 | 21 | SpatialReference: Represents OSR Spatial Reference objects. |
22 | 22 |
|
23 | | - The GDAL library will be imported from the system path using the default |
| 23 | + The GDAL library will be imported from the system path using the default |
24 | 24 | library name for the current OS. The default library path may be overridden |
25 | | - by setting `GDAL_LIBRARY_PATH` in your settings with the path to the GDAL C |
26 | | - library on your system. |
| 25 | + by setting `GDAL_LIBRARY_PATH` in your settings with the path to the GDAL C |
| 26 | + library on your system. |
27 | 27 |
|
28 | | - GDAL links to a large number of external libraries that consume RAM when |
| 28 | + GDAL links to a large number of external libraries that consume RAM when |
29 | 29 | loaded. Thus, it may desirable to disable GDAL on systems with limited |
30 | 30 | RAM resources -- this may be accomplished by setting `GDAL_LIBRARY_PATH` |
31 | | - to a non-existant file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; |
| 31 | + to a non-existant file location (e.g., `GDAL_LIBRARY_PATH='/null/path'`; |
32 | 32 | setting to None/False/'' will not work as a string must be given). |
33 | 33 | """ |
34 | 34 | # Attempting to import objects that depend on the GDAL library. The |
|
44 | 44 | except: |
45 | 45 | HAS_GDAL, GEOJSON = False, False |
46 | 46 |
|
| 47 | +from django.contrib.gis.tests.utils import no_mysql, oracle, postgis, spatialite |
| 48 | +HAS_SPATIALREFSYS = True |
| 49 | +if oracle: |
| 50 | + from django.contrib.gis.db.backends.oracle.models import SpatialRefSys |
| 51 | +elif postgis: |
| 52 | + from django.contrib.gis.db.backends.postgis.models import SpatialRefSys |
| 53 | +elif spatialite: |
| 54 | + from django.contrib.gis.db.backends.spatialite.models import SpatialRefSys |
| 55 | +else: |
| 56 | + HAS_SPATIALREFSYS = False |
| 57 | + SpatialRefSys = None |
| 58 | + |
47 | 59 | try: |
48 | 60 | from django.contrib.gis.gdal.envelope import Envelope |
49 | 61 | except ImportError: |
|
0 commit comments