a
     1$e˜  ã                   @   s^   d Z ddlmZ ddlmZmZ ddlmZ ddlm	Z	 ddl
mZmZ dd„ Zddd„ZdS )z0Coordinate and geometry warping and reprojectioné    )Úwarn)Ú
_transformÚ_transform_geom)Ú
DICT_TYPES)ÚFionaDeprecationWarning)Údecode_objectÚGeometryc                 C   s   t | |||ƒS )a’  Transform coordinates from one reference system to another.

    Parameters
    ----------
    src_crs: str or dict
        A string like 'EPSG:4326' or a dict of proj4 parameters like
        {'proj': 'lcc', 'lat_0': 18.0, 'lat_1': 18.0, 'lon_0': -77.0}
        representing the coordinate reference system on the "source"
        or "from" side of the transformation.
    dst_crs: str or dict
        A string or dict representing the coordinate reference system
        on the "destination" or "to" side of the transformation.
    xs: sequence of float
        A list or tuple of x coordinate values. Must have the same
        length as the ``ys`` parameter.
    ys: sequence of float
        A list or tuple of y coordinate values. Must have the same
        length as the ``xs`` parameter.

    Returns
    -------
    xp, yp: list of float
        A pair of transformed coordinate sequences. The elements of
        ``xp`` and ``yp`` correspond exactly to the elements of the
        ``xs`` and ``ys`` input parameters.

    Examples
    --------

    >>> transform('EPSG:4326', 'EPSG:26953', [-105.0], [40.0])
    ([957097.0952383667], [378940.8419189212])

    )r   )Úsrc_crsÚdst_crsZxsZys© r   úK/var/www/html/django/DPS/env/lib/python3.9/site-packages/fiona/transform.pyÚ	transform   s    #r   Fç      $@éÿÿÿÿc                 C   sX   |dkrt dtƒ t|tft ƒr8t| |t|ƒ|||ƒS t| |dd„ |D ƒ|||ƒS dS )aÛ  Transform a geometry obj from one reference system to another.

    Parameters
    ----------
    src_crs: str or dict
        A string like 'EPSG:4326' or a dict of proj4 parameters like
        {'proj': 'lcc', 'lat_0': 18.0, 'lat_1': 18.0, 'lon_0': -77.0}
        representing the coordinate reference system on the "source"
        or "from" side of the transformation.
    dst_crs: str or dict
        A string or dict representing the coordinate reference system
        on the "destination" or "to" side of the transformation.
    geom: obj
        A GeoJSON-like geometry object with 'type' and 'coordinates'
        members or an iterable of GeoJSON-like geometry objects.
    antimeridian_cutting: bool, optional
        ``True`` to cut output geometries in two at the antimeridian,
        the default is ``False`.
    antimeridian_offset: float, optional
        A distance in decimal degrees from the antimeridian, outside of
        which geometries will not be cut.
    precision: int, optional
        Round geometry coordinates to this number of decimal places.
        This parameter is deprecated and will be removed in 2.0.

    Returns
    -------
    obj
        A new GeoJSON-like geometry (or a list of GeoJSON-like geometries
        if an iterable was given as input) with transformed coordinates. Note
        that if the output is at the antimeridian, it may be cut and
        of a different geometry ``type`` than the input, e.g., a
        polygon input may result in multi-polygon output.

    Examples
    --------

    >>> transform_geom(
    ...     'EPSG:4326', 'EPSG:26953',
    ...     {'type': 'Point', 'coordinates': [-105.0, 40.0]})
    {'type': 'Point', 'coordinates': (957097.0952383667, 378940.8419189212)}

    r   zGThe precision keyword argument is deprecated and will be removed in 2.0c                 s   s   | ]}t |ƒV  qd S )N)r   )Ú.0Úgr   r   r   Ú	<genexpr>x   ó    z!transform_geom.<locals>.<genexpr>N)r   r   Ú
isinstancer   r   r   r   )r	   r
   ZgeomZantimeridian_cuttingZantimeridian_offsetÚ	precisionr   r   r   Útransform_geom1   s,    3þú	úr   N)Fr   r   )Ú__doc__Úwarningsr   Zfiona._transformr   r   Zfiona.compatr   Zfiona.errorsr   Zfiona.modelr   r   r   r   r   r   r   r   Ú<module>   s   *   ú