|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /usr/lib64/python2.7/site-packages/django/contrib/gis/utils/ |
Upload File : |
�
r�\c @ s/ d d l m Z d d d d d � Z e Z d S( i����( t SpatialReferencet EPSGc C s� d d l m } m } | s% | } n | | } t | j d � sP t d � � n | j j sh | j j rw t d � � n | j j � } t | t
� s� t
| � } n | j d
k r� t d � � n i | j d 6| d 6| p� | j d 6| j
d
6} | j j r| j | d <n | j j r1| p'| j | d <n y% | j j | � j d | j � }
Wn/ | j k
r�| j j | � j | � }
n Xd
S( s�
This function takes a GDAL SpatialReference system and adds its information
to the `spatial_ref_sys` table of the spatial backend. Doing this enables
database-level spatial transformations for the backend. Thus, this utility
is useful for adding spatial reference systems not included by default with
the backend -- for example, the so-called "Google Maps Mercator Projection"
is excluded in PostGIS 1.3 and below, and the following adds it to the
`spatial_ref_sys` table:
>>> from django.contrib.gis.utils import add_srs_entry
>>> add_srs_entry(900913)
Keyword Arguments:
auth_name:
This keyword may be customized with the value of the `auth_name` field.
Defaults to 'EPSG'.
auth_srid:
This keyword may be customized with the value of the `auth_srid` field.
Defaults to the SRID determined by GDAL.
ref_sys_name:
For SpatiaLite users only, sets the value of the `ref_sys_name` field.
Defaults to the name determined by GDAL.
database:
The name of the database connection to use; the default is the value
of `django.db.DEFAULT_DB_ALIAS` (at the time of this writing, it's value
is 'default').
i����( t connectionst DEFAULT_DB_ALIASt spatial_versions= The `add_srs_entry` utility only works with spatial backends.sC This utility does not support the Oracle or MySQL spatial backends.sM Spatial reference requires an SRID to be compatible with the spatial backend.t sridt auth_namet auth_sridt proj4textt srtextt ref_sys_nameN( t django.dbR R t hasattrt opst Exceptiont oraclet mysqlt spatial_ref_syst
isinstanceR R t Nonet proj4t postgist wktt
spatialitet namet objectst usingt gett DoesNotExistt create( t srsR R R
t databaseR R t
connectiont
SpatialRefSyst kwargst sr( ( s>