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/maps/google/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/gis/maps/google/zoom.pyc
�
r�\c@s�ddlmZmZmZmZddlmZddlmZddl	m
Z
mZmZm
Z
mZe
dZde
Zdefd��YZdS(	i����(tGEOSGeometryt
LinearRingtPolygontPoint(tGoogleMapException(txrange(tpitsintlogtexptatang�f@t
GoogleZoomcBs\eZdZddd�Zd�Zd�Zd�Zd�Zd�Zd	�Z	d
�Z
RS(s
    GoogleZoom is a utility for performing operations related to the zoom
    levels on Google Maps.

    This class is inspired by the OpenStreetMap Mapnik tile generation routine
    `generate_tiles.py`, and the article "How Big Is the World" (Hack #16) in
    "Google Maps Hacks" by Rich Gibson and Schuyler Erle.

    `generate_tiles.py` may be found at:
      http://trac.openstreetmap.org/browser/applications/rendering/mapnik/generate_tiles.py

    "Google Maps Hacks" may be found at http://safari.oreilly.com/0596101619
    iicCs�||_||_g|_g|_g|_|}x^t|�D]P}|jj|d�|jj|dt�|jj|d�|d9}q@WdS(s#Initializes the Google Zoom object.g�v@iN(t	_tilesizet_nzoomt_degppt_radppt_npixRtappendR(tselftnum_zoomttilesizetzti((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pyt__init__s					cCs|jS(s"Returns the number of zoom levels.(R
(R((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pyt__len__3scCs7t|t�r!|j\}}n|\}}||fS(s:Unpacks longitude, latitude from GEOS Points and 2-tuples.(t
isinstanceRtcoords(Rtlonlattlontlat((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pytget_lon_lat7sc	Cs�|j|�\}}|j|}t|||j|�}tttt|�d�d�}t|dtd|d|�d|j	|�}||fS(sHConverts a longitude, latitude coordinate pair for the given zoom level.g��H.��g��H.��?g�?ig�(
RRtroundRtmintmaxRtDTORRR(	RRtzoomRRtnpixtpx_xtfactpx_y((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pytlonlat_to_pixel?s
"5cCs�t|�dkr!td��n|j|}|d||j|}tdtt|d|d|j|��dt}||fS(sGConverts a pixel to a longitude, latitude pair at the given zoom level.is+Pixel should be a sequence of two elements.iig�g�?(	tlent	TypeErrorRRtRTODR
R	RR(RtpxR#R$RR((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pytpixel_to_lonlatVs
9cCs�|jd}|j||�}|j|d||d|f|�}|j|d||d|f|�}tt||d|df||d|df|�dd�S(s�
        Returns a Polygon  corresponding to the region represented by a fictional
        Google Tile for the given longitude/latitude pair and zoom level. This
        tile is used to determine the size of a tile at the given point.
        iiitsridi�(RR(R-RR(RRR#tdeltaR,tlltur((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pyttilegs

((c	Cs�t|t�s|jdkr.td��n|j}|j|j�\}}|j}xvt|j	�D]e}|j|j
||�j�\}}||ks�||krh|dkr�td��n|dSqhW|j	dS(s6Returns the optimal Zoom level for the given geometry.i�s8get_zoom() expects a GEOS Geometry with an SRID of 4326.is>Geometry width and height should not exceed that of the Earth.i(RRR.R*tenvelopetget_width_heighttextenttcentroidRR
R2R(	Rtgeomtenvtenv_wtenv_htcenterRttile_wttile_h((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pytget_zoom|s		$cCs_t|d �}t|d|d�}t|d�}|j|�}|j|�}||fS(sD
        Returns the width and height for the given extent.
        iii(Rtdistance(RR5R0tulR1theighttwidth((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pyR4�s(t__name__t
__module__t__doc__RRRR(R-R2R>R4(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pyR
s
						N(tdjango.contrib.gis.geosRRRRt#django.contrib.gis.maps.google.gmapRtdjango.utils.six.movesRtmathRRRR	R
R"R+tobjectR(((sE/tmp/pip-install-XxeQeY/django/django/contrib/gis/maps/google/zoom.pyt<module>s"(



https://t.me/AnonymousX5 - 2025