https://t.me/AnonymousX5
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/db/backends/oracle/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/gis/db/backends/oracle/operations.pyc
�
r�\c@s3dZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZdefd��YZd
efd��YZdefd��YZdefd��YZdefd��YZeeefejZdeefd��YZdS(sU
 This module contains the spatial lookup types, and the `get_geo_where_clause`
 routine for Oracle Spatial.

 Please note that WKT support is broken on the XE version, and thus
 this backend will not work on such platforms.  Specifically, XE lacks
 support for an internal JVM, and Java libraries are required to use
 the WKT constructors.
i����N(tDecimal(tDatabaseOperations(tBaseSpatialOperations(tOracleSpatialAdapter(tSpatialFunction(tGeometry(tDistance(tsixtSDOOperationcBseZdZdZd�ZRS(s&Base class for SDO* Oracle operations.sA%(function)s(%(geo_col)s, %(geometry)s) %(operator)s '%(result)s'cKs=|jdd�|jdd�tt|�j||�dS(Ntoperatort=tresulttTRUE(t
setdefaulttsuperRt__init__(tselftfunctkwargs((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyRs(t__name__t
__module__t__doc__tsql_templateR(((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyRstSDODistancecBs&eZdZdZdZdd�ZRS(sClass for Distance queries.sN%(function)s(%(geo_col)s, %(geometry)s, %(tolerance)s) %(operator)s %(result)ssSDO_GEOM.SDO_DISTANCEg�������?cCs/tt|�j|jd|d|dd�dS(Nt	toleranceR	Rs%s(RRRt	dist_func(RtopR((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyR%s(RRRRRR(((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyRst
SDODWithincBseZdZdZd�ZRS(tSDO_WITHIN_DISTANCEs5%(function)s(%(geo_col)s, %(geometry)s, %%s) = 'TRUE'cCstt|�j|j�dS(N(RRRtdwithin_func(R((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyR.s(RRRRR(((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyR*st
SDOGeomRelatecBs&eZdZdZdZdd�ZRS(s Class for using SDO_GEOM.RELATE.sSDO_GEOM.RELATEsZ%(function)s(%(geo_col)s, '%(mask)s', %(geometry)s, %(tolerance)s) %(operator)s '%(mask)s'g�������?cCs/tt|�j|jddd|d|�dS(NR	R
tmaskR(RRRtrelate_func(RRR((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyR7s(RRRR RR(((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyR1st	SDORelatecBsHeZdZdZejdeefej�ZdZdZ	d�Z
RS(sClass for using SDO_RELATE.sbTOUCH|OVERLAPBDYDISJOINT|OVERLAPBDYINTERSECT|EQUAL|INSIDE|COVEREDBY|CONTAINS|COVERS|ANYINTERACT|ONs^(%s)(\+(%s))*$sA%(function)s(%(geo_col)s, %(geometry)s, 'mask=%(mask)s') = 'TRUE't
SDO_RELATEcCsQ|jj|�s.td|j|f��ntt|�j|jd|�dS(NsInvalid %s mask: "%s"R(t
mask_regextmatcht
ValueErrorR RR!R(RR((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyRDs(RRRtmaskstretcompiletIR#RR R(((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyR!=stOracleOperationscBsNeZdZdZeZegd>D]Zed?f^q"�Z	e
ZeZdZ
dZdZdZdZd	Zd
ZdZdZd
ZeZdZdZdZdZdZdZdZied�e fd6ed�e fd6ed�e fd6ed�e fd6e!�e fd6Z"ie#d�d6e#d �d!6e#d"�d#6e$d$�d%6e#d&�d'6e#d(�d)6e#d(�d*6e#d+�d,6e#d(�d-6e%e&j'fd.6e#d/�d06e#d1�d26Z(e(j)e"�e*d3g�Z+e+j)e(�id?d.6Z,d4�Z-d5�Z.d6�Z/d7�Z0d8�Z1d9�Z2d:�Z3d;�Z4d<�Z5d=�Z6RS(@s.django.contrib.gis.db.backends.oracle.compilertoracletUniontExtentsSDO_GEOM.SDO_AREAsSDO_UTIL.TO_GMLGEOMETRYsSDO_GEOM.SDO_CENTROIDsSDO_GEOM.SDO_DIFFERENCEsSDO_GEOM.SDO_DISTANCEtSDO_AGGR_MBRsSDO_GEOM.SDO_INTERSECTIONsSDO_GEOM.SDO_LENGTHsSDO_UTIL.GETNUMELEMsSDO_UTIL.GETNUMVERTICESsSDO_GEOM.SDO_POINTONSURFACEsSDO_UTIL.REVERSE_LINESTRINGsSDO_GEOM.SDO_XORsSDO_CS.TRANSFORMsSDO_GEOM.SDO_UNIONtSDO_AGGR_UNIONsSDO_UTIL.TO_WKTGEOMETRY(%s)t>tdistance_gts>=tdistance_gtet<tdistance_lts<=tdistance_ltetdwithintSDO_CONTAINStcontainst
SDO_COVEREDBYt	coveredbyt
SDO_COVERStcoverstDISJOINTtdisjointtSDO_OVERLAPBDYINTERSECTt
intersectst	SDO_EQUALtequalstexacttSDO_OVERLAPStoverlapstsame_astrelatet	SDO_TOUCHttouchest
SDO_INSIDEtwithintisnullcCs�|r�t|j��}t|j�}|dkr\|j}|dd |dd }}n2|dkr~|jd }|}ntd|��|\}}|\}	}
|||	|
fSdSdS(NtPolygoniitPoints0Unexpected geometry type returned for extent: %s(Rtreadtstrt	geom_typetshelltcoordst	ExceptiontNone(Rtclobtext_geomtgtypeRRtllturtxmintymintxmaxtymax((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytconvert_extent�s	 
	cCs$|rt|j�|j�SdSdS(N(RROtsridRU(RRVt	geo_field((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytconvert_geom�scCsdS(s�
        Returns the geometry database type for Oracle.  Unlike other spatial
        backends, no stored procedure is necessary and it's the same for all
        geometry types.
        sMDSYS.SDO_GEOMETRY((Rtf((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytgeo_db_type�scCs�|s
gS|d}t|t�rh|j|j�rA|j}qnt|tj|j|j���}n|}|dkr�d|}n|gS(s
        Returns the distance parameters given the value and the lookup type.
        On Oracle, geometry columns with a geodetic coordinate system behave
        implicitly like a geography column, and thus meters will be used as
        the distance parameter on them.
        iR6sdistance=%s(t
isinstanceRtgeodetict
connectiontmtgetattrtunit_attnamet
units_name(RRctvaluetlookup_typet
dist_param((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytget_distance�s
'
cCs�|dkrdSd�}t|d�rj|||j�rSd|j|jf}nd}||j|�S|||j�r�d|j|j|jfSd|jSdS(	s�
        Provides a proper substitution value for Geometries that are not in the
        SRID of the field.  Specifically, this routine will substitute in the
        SDO_CS.TRANSFORM() function call.
        tNULLcSs
|j|kS(N(R`(tvalR`((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyttransform_value�st
expressions%s(%%s, %s)s%ss%s(SDO_GEOMETRY(%%s, %s), %s)sSDO_GEOMETRY(%%s, %s)N(RUthasattrR`t	transformtget_expression_column(RRcRlRrtplaceholder((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytget_geom_placeholder�s	cCs�|\}}}d||�||�f}	|jj|t�}
|
rXt|
t�r9|
\}}|d}
t|t�s�td|��nt|�dkr�td|��nt|d|�s�td|t|d�f��n|dkr||d�j|	|j	||
��S|j|	|j	||
��Sq�|
j|	|j	||��Sn,|d	kr�d
|	|rvdndfgfSt
d
t|���dS(sHReturns the SQL WHERE clause for use in Oracle spatial SQL construction.s%s.%sis$Tuple required for `%s` lookup type.is,2-element tuple required for %s lookup type.is+Argument type should be %s, got %s instead.RGRLs%s IS %sNULLtsNOT sGot invalid lookup_type: %sN(tgeometry_functionstgettFalseRettupleR%tlenttypetas_sqlRxt	TypeErrortrepr(RtlvalueRmRltfieldtqntaliastcoltdb_typetgeo_coltlookup_infotsdo_optarg_typetgeom((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytspatial_lookup_sql�s(
#& cCsc|jjj�}|dkr+|d7}n|jr=d}nd}t||�}|j||fS(ss
        Returns the spatial aggregate SQL template and function for the
        given Aggregate instance.
        tuniontaggs%(function)s(%(field)s)s2%(function)s(SDOAGGRTYPE(%(field)s,%(tolerance)s))(t	__class__Rtlowert	is_extentRitselect(RR�tagg_nameRtsql_function((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytspatial_aggregate_sqls
		cCsddlm}|S(Ni����(tGeometryColumns(t,django.contrib.gis.db.backends.oracle.modelsR�(RR�((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytgeometry_columns!scCsddlm}|S(Ni����(t
SpatialRefSys(R�R�(RR�((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytspatial_ref_sys%scCs[t|�dkst�gtjj|d|d�D]\}}|dkr6|^q6gS(sqDrop out insert parameters for NULL placeholder. Needed for Oracle Spatial
        backend due to #10888
        iiRp(R~tAssertionErrorRtmovestzip(Rtplaceholderstparamstpholdertparam((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pytmodify_insert_params)s(sUnionR-N(7RRtcompiler_moduletnametTrueR+tdicttaRUtvalid_aggregatesRtAdaptertAdaptortareatgmltcentroidt
differencetdistancetextenttintersectiontlengthtnum_geomt
num_pointst	perimetertpoint_on_surfacetreversetsym_differenceRuR�tunionaggR�RtdtypesRtdistance_functionsRRR!Rtstring_typesRztupdatetsett	gis_termsttruncate_paramsR_RbRdRoRxR�R�R�R�R�(((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyR*Lsr%












						.			(RR'tdecimalRtdjango.db.backends.oracle.baseRt#django.contrib.gis.db.backends.baseRt-django.contrib.gis.db.backends.oracle.adapterRt#django.contrib.gis.db.backends.utilRt#django.contrib.gis.geometry.backendRtdjango.contrib.gis.measureRtdjango.utilsRRRRRR!tfloatt
integer_typesR�R*(((sR/tmp/pip-install-XxeQeY/django/django/contrib/gis/db/backends/oracle/operations.pyt<module>	s 	


https://t.me/AnonymousX5 - 2025