3
gP]                 @   s  d Z ddlZddlmZ ddlmZmZmZmZm	Z	m
Z
 ddlmZ ddlmZmZ ddlmZmZ ddlmZ dd	lmZmZ dd
lmZmZ ddlmZmZm Z  ddl!m"Z" G dd deZ#G dd de#Z$G dd de#Z%G dd de%Z&G dd de#Z'G dd de#Z(G dd de(Z)G dd de(Z*G dd de(Z+de$d e%d!e'd"e)d#e*d$e+d%e(d&e&dej, e$d ej, e%d!ej, e'd"ej, e)d#ej, e*d$ej, e+d%ej, e(iZ-dS )'a  
 The OGRGeometry is a wrapper for using the OGR Geometry class
 (see https://gdal.org/api/ogrgeometry_cpp.html#_CPPv411OGRGeometry).
 OGRGeometry may be instantiated when reading geometries from OGR Data Sources
 (e.g. SHP files), or when given OGC WKT (a string).

 While the 'full' API is not present yet, the API is "pythonic" unlike
 the traditional and "next-generation" OGR Python bindings.  One major
 advantage OGR Geometries have over their GEOS counterparts is support
 for spatial reference systems and their transformation.

 Example:
  >>> from django.contrib.gis.gdal import OGRGeometry, OGRGeomType, SpatialReference
  >>> wkt1, wkt2 = 'POINT(-90 30)', 'POLYGON((0 0, 5 0, 5 5, 0 5)'
  >>> pnt = OGRGeometry(wkt1)
  >>> print(pnt)
  POINT (-90 30)
  >>> mpnt = OGRGeometry(OGRGeomType('MultiPoint'), SpatialReference('WGS84'))
  >>> mpnt.add(wkt1)
  >>> mpnt.add(wkt1)
  >>> print(mpnt)
  MULTIPOINT (-90 30,-90 30)
  >>> print(mpnt.srs.name)
  WGS 84
  >>> print(mpnt.srs.proj)
  +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
  >>> mpnt.transform(SpatialReference('NAD27'))
  >>> print(mpnt.proj)
  +proj=longlat +ellps=clrk66 +datum=NAD27 +no_defs
  >>> print(mpnt)
  MULTIPOINT (-89.999930378602485 29.999797886557641,-89.999930378602485 29.999797886557641)

  The OGRGeomType class is to make it easy to specify an OGR geometry type:
  >>> from django.contrib.gis.gdal import OGRGeomType
  >>> gt1 = OGRGeomType(3) # Using an integer for the type
  >>> gt2 = OGRGeomType('Polygon') # Using a string
  >>> gt3 = OGRGeomType('POLYGON') # It's case-insensitive
  >>> print(gt1 == 3, gt1 == 'Polygon') # Equivalence works w/non-OGRGeomType objects
  True True
    N)b2a_hex)byrefc_char_pc_doublec_ubytec_void_p	string_at)GDALBase)EnvelopeOGREnvelope)GDALExceptionSRSException)OGRGeomType)geomsrs)CoordTransformSpatialReference)	hex_regex
json_regex	wkt_regex)force_bytesc               @   s  e Zd ZdZejZd|ddZdd Zdd Z	e
d	d
 Zedd Ze
dd Zedd Ze
dd Zdd Zdd Zdd Zdd Zdd Zdd Zedd  Zd!d" Zd#d$ ZeeeZed%d& Zed'd( Zed)d* Zed+d, Zed-d. Z ed/d0 Z!ed1d2 Z"ed3d4 Z#ed5d6 Z$ed7d8 Z%d9d: Z&d;d< Z'ee&e'Z(d=d> Z)d?d@ Z*ee)e*Z+dAdB Z,edCdD Z-edEdF Z.edGdH Z/edIdJ Z0e0Z1edKdL Z2edMdN Z3edOdP Z4edQdR Z5edSdT Z6dUdV Z7dWdX Z8d}dZd[Z9d\d] Z:d^d_ Z;d`da Z<dbdc Z=ddde Z>dfdg Z?dhdi Z@djdk ZAdldm ZBd~dndoZCedpdq ZDedrds ZEdtdu ZFdvdw ZGdxdy ZHdzd{ ZIdS )OGRGeometryzEncapsulate an OGR geometry.Nc             C   s|  t |t}|r*tj|r*ttj|}d}|rtj|}tj|}|r|d rZt	|d }|d j
 dkrtjt|d j}tj|tt|d j  qtjtt|d j dtt }n,|r| j|j }nt| tjt|j}nVt |tr| j|}n>t |tr"tj|j}n$t || jr6|}ntdt| |sXtd| || _|rj|| _t| jj | _dS )	z=Initialize Geometry on either WKT or an OGR pointer as input.FsridtypeZ
LINEARRINGwktNz4Invalid input type for OGR Geometry construction: %sz)Cannot create OGR Geometry from input: %s)
isinstancestrr   match
memoryviewbytesfromhexr   r   intuppercapicreate_geomr   numZ
import_wktr   r   encodeZfrom_wktr   
_from_json	_from_wkbZptr_typer   r   ptrr   GEO_CLASSES	geom_type	__class__)self
geom_inputr   Zstr_instanceZwkt_mZjson_mg r0   `/var/www/tester-filtro-web/env/lib/python3.6/site-packages/django/contrib/gis/gdal/geometries.py__init__?   s>    


&zOGRGeometry.__init__c             C   s$   | j }|r|j}nd }t| j|fS )N)r   r   r   wkb)r-   r   r0   r0   r1   __getstate__x   s
    zOGRGeometry.__getstate__c             C   s>   |\}}t j|d tt t|}|s.td|| _|| _d S )Nz.Invalid OGRGeometry loaded from pickled state.)r#   from_wkbr   r   lenr   r)   r   )r-   stater3   r   r)   r0   r0   r1   __setstate__   s    zOGRGeometry.__setstate__c             C   s   t jt|d tt t|S )N)r#   r5   r   r   r   r6   )clsr.   r0   r0   r1   r(      s    zOGRGeometry._from_wkbc             C   s
   t j| S )N)r#   	from_json)r.   r0   r0   r1   r'      s    zOGRGeometry._from_jsonc             C   s,   |\}}}}t d||||||||||f
 S )z2Construct a Polygon from a bounding box (4-tuple).z,POLYGON((%s %s, %s %s, %s %s, %s %s, %s %s)))r   )r9   ZbboxZx0Zy0x1y1r0   r0   r1   	from_bbox   s    zOGRGeometry.from_bboxc             C   s   t t jt| S )N)r   r'   r   )r.   r0   r0   r1   r:      s    zOGRGeometry.from_jsonc             C   s   | t jt|S )N)r#   from_gmlr   )r9   Z
gml_stringr0   r0   r1   r>      s    zOGRGeometry.from_gmlc             C   s
   | j |S )z'Return the union of the two geometries.)union)r-   otherr0   r0   r1   __or__   s    zOGRGeometry.__or__c             C   s
   | j |S )z7Return the intersection of this Geometry and the other.)intersection)r-   r@   r0   r0   r1   __and__   s    zOGRGeometry.__and__c             C   s
   | j |S )z2Return the difference this Geometry and the other.)
difference)r-   r@   r0   r0   r1   __sub__   s    zOGRGeometry.__sub__c             C   s
   | j |S )z?Return the symmetric difference of this Geometry and the other.)sym_difference)r-   r@   r0   r0   r1   __xor__   s    zOGRGeometry.__xor__c             C   s   t |to| j|S )z$Is this Geometry equal to the other?)r   r   equals)r-   r@   r0   r0   r1   __eq__   s    zOGRGeometry.__eq__c             C   s   | j S )z*WKT is used for the string representation.)r   )r-   r0   r0   r1   __str__   s    zOGRGeometry.__str__c             C   s   t j| jS )z5Return 0 for points, 1 for lines, and 2 for surfaces.)r#   Zget_dimsr)   )r-   r0   r0   r1   	dimension   s    zOGRGeometry.dimensionc             C   s   t j| jS )z0Return the coordinate dimension of the Geometry.)r#   Zget_coord_dimr)   )r-   r0   r0   r1   _get_coord_dim   s    zOGRGeometry._get_coord_dimc             C   s"   |dkrt dtj| j| dS )z.Set the coordinate dimension of this Geometry.      z(Geometry dimension must be either 2 or 3N)rM   rN   )
ValueErrorr#   Zset_coord_dimr)   )r-   dimr0   r0   r1   _set_coord_dim   s    zOGRGeometry._set_coord_dimc             C   s   t j| jS )z/Return the number of elements in this Geometry.)r#   Zget_geom_countr)   )r-   r0   r0   r1   
geom_count   s    zOGRGeometry.geom_countc             C   s   t j| jS )z-Return the number of Points in this Geometry.)r#   Zget_point_countr)   )r-   r0   r0   r1   point_count   s    zOGRGeometry.point_countc             C   s   | j S )z7Alias for `point_count` (same name method in GEOS API.))rS   )r-   r0   r0   r1   
num_points   s    zOGRGeometry.num_pointsc             C   s   | j S )zAlias for `point_count`.)rS   )r-   r0   r0   r1   
num_coords   s    zOGRGeometry.num_coordsc             C   s   t tj| jS )z"Return the Type for this Geometry.)r   r#   Zget_geom_typer)   )r-   r0   r0   r1   r+      s    zOGRGeometry.geom_typec             C   s   t j| jS )z!Return the Name of this Geometry.)r#   Zget_geom_namer)   )r-   r0   r0   r1   	geom_name   s    zOGRGeometry.geom_namec             C   s   t j| jS )zHReturn the area for a LinearRing, Polygon, or MultiPolygon; 0 otherwise.)r#   Zget_arear)   )r-   r0   r0   r1   area   s    zOGRGeometry.areac             C   s   t tj| jtt S )z&Return the envelope for this Geometry.)r
   r#   Zget_enveloper)   r   r   )r-   r0   r0   r1   envelope   s    zOGRGeometry.envelopec             C   s   t j| jS )N)r#   Zis_emptyr)   )r-   r0   r0   r1   empty   s    zOGRGeometry.emptyc             C   s   | j jS )zCReturn the envelope as a 4-tuple, instead of as an Envelope object.)rX   tuple)r-   r0   r0   r1   extent   s    zOGRGeometry.extentc             C   s4   yt j| j}ttj|S  tk
r.   dS X dS )z/Return the Spatial Reference for this Geometry.N)r#   Zget_geom_srsr)   r   srs_apiZ	clone_srsr   )r-   srs_ptrr0   r0   r1   _get_srs  s
    zOGRGeometry._get_srsc             C   s`   t |tr|j}n<t |ttfr0t|}|j}n|dkr>d}ntdt| tj| j| dS )z+Set the SpatialReference for this geometry.Nz7Cannot assign spatial reference with object of type: %s)	r   r   r)   r!   r   	TypeErrorr   r#   Z
assign_srs)r-   r   r]   srr0   r0   r1   _set_srs  s    
zOGRGeometry._set_srsc             C   s   | j }|r|jS d S )N)r   r   )r-   r   r0   r0   r1   	_get_srid  s    zOGRGeometry._get_sridc             C   s&   t |ts|d kr|| _ntdd S )Nz!SRID must be set with an integer.)r   r!   r   r_   )r-   r   r0   r0   r1   	_set_srid%  s    zOGRGeometry._set_sridc             C   s   ddl m} |j| jS )Nr   )GEOSGeometry)django.contrib.gis.geosrd   r(   r3   )r-   rd   r0   r0   r1   	_geos_ptr.  s    zOGRGeometry._geos_ptrc             C   s   ddl m} || j | jS )z3Return a GEOSGeometry object from this OGRGeometry.r   )rd   )re   rd   rf   r   )r-   rd   r0   r0   r1   geos2  s    zOGRGeometry.geosc             C   s   t j| jS )z.Return the GML representation of the Geometry.)r#   Zto_gmlr)   )r-   r0   r0   r1   gml8  s    zOGRGeometry.gmlc             C   s   t | jj S )z<Return the hexadecimal representation of the WKB (a string).)r   r3   r"   )r-   r0   r0   r1   hex=  s    zOGRGeometry.hexc             C   s   t j| jS )zE
        Return the GeoJSON representation of this Geometry.
        )r#   to_jsonr)   )r-   r0   r0   r1   jsonB  s    zOGRGeometry.jsonc             C   s   t j| jdS )z.Return the KML representation of the Geometry.N)r#   Zto_kmlr)   )r-   r0   r0   r1   kmlJ  s    zOGRGeometry.kmlc             C   s   t j| jS )z"Return the size of the WKB buffer.)r#   Zget_wkbsizer)   )r-   r0   r0   r1   wkb_sizeO  s    zOGRGeometry.wkb_sizec             C   sF   t jdkrd}nd}| j}t|  }tj| j|t| tt	||S )z.Return the WKB representation of the Geometry.little   r   )
sys	byteorderrm   r   r#   Zto_wkbr)   r   r   r   )r-   rq   szbufr0   r0   r1   r3   T  s    

zOGRGeometry.wkbc             C   s   t j| jtt S )z.Return the WKT representation of the Geometry.)r#   Zto_wktr)   r   r   )r-   r0   r0   r1   r   b  s    zOGRGeometry.wktc             C   s*   | j }|r |jr d|j| jf S | jS dS )z/Return the EWKT representation of the Geometry.z
SRID=%s;%sN)r   r   r   )r-   r   r0   r0   r1   ewktg  s    
zOGRGeometry.ewktc             C   s   t tj| j| jS )zClone this OGR Geometry.)r   r#   
clone_geomr)   r   )r-   r0   r0   r1   cloneq  s    zOGRGeometry.clonec             C   s   t j| j dS )z
        If there are any rings within this geometry that have not been
        closed, this routine will do so by adding the starting point at the
        end.
        N)r#   Zgeom_close_ringsr)   )r-   r0   r0   r1   close_ringsu  s    zOGRGeometry.close_ringsFc             C   s   |r| j  }|j| |S t|tr6tj| j|j nLt|trRtj| j|j n0t|t	t
frzt|}tj| j|j ntddS )aq  
        Transform this geometry to a different spatial reference system.
        May take a CoordTransform object, a SpatialReference object, string
        WKT or PROJ, and/or an integer SRID.  By default, return nothing
        and transform the geometry in-place. However, if the `clone` keyword is
        set, return a transformed clone of this geometry.
        zUTransform only accepts CoordTransform, SpatialReference, string, and integer objects.N)rv   	transformr   r   r#   Zgeom_transformr)   r   Zgeom_transform_tor!   r   r_   )r-   Zcoord_transrv   Zkloner`   r0   r0   r1   rx   ~  s    


zOGRGeometry.transformc             C   s    t |tstd|| j|jS )zA generalized function for topology operations, takes a GDAL function and
        the other geometry to perform the operation on.z<Must use another OGRGeometry object for topology operations!)r   r   r_   r)   )r-   funcr@   r0   r0   r1   	_topology  s    
zOGRGeometry._topologyc             C   s   | j tj|S )z7Return True if this geometry intersects with the other.)rz   r#   Zogr_intersects)r-   r@   r0   r0   r1   
intersects  s    zOGRGeometry.intersectsc             C   s   | j tj|S )z8Return True if this geometry is equivalent to the other.)rz   r#   Z
ogr_equals)r-   r@   r0   r0   r1   rH     s    zOGRGeometry.equalsc             C   s   | j tj|S )zBReturn True if this geometry and the other are spatially disjoint.)rz   r#   Zogr_disjoint)r-   r@   r0   r0   r1   disjoint  s    zOGRGeometry.disjointc             C   s   | j tj|S )z/Return True if this geometry touches the other.)rz   r#   Zogr_touches)r-   r@   r0   r0   r1   touches  s    zOGRGeometry.touchesc             C   s   | j tj|S )z/Return True if this geometry crosses the other.)rz   r#   Zogr_crosses)r-   r@   r0   r0   r1   crosses  s    zOGRGeometry.crossesc             C   s   | j tj|S )z1Return True if this geometry is within the other.)rz   r#   Z
ogr_within)r-   r@   r0   r0   r1   within  s    zOGRGeometry.withinc             C   s   | j tj|S )z0Return True if this geometry contains the other.)rz   r#   Zogr_contains)r-   r@   r0   r0   r1   contains  s    zOGRGeometry.containsc             C   s   | j tj|S )z0Return True if this geometry overlaps the other.)rz   r#   Zogr_overlaps)r-   r@   r0   r0   r1   overlaps  s    zOGRGeometry.overlapsc             C   s6   t |tr t|| j|j| jS t|| j| jS dS )z?A helper routine for the OGR routines that generate geometries.N)r   r   r)   r   )r-   Zgen_funcr@   r0   r0   r1   _geomgen  s    
zOGRGeometry._geomgenc             C   s   | j tjS )z%Return the boundary of this geometry.)r   r#   get_boundary)r-   r0   r0   r1   boundary  s    zOGRGeometry.boundaryc             C   s   | j tjS )zk
        Return the smallest convex Polygon that contains all the points in
        this Geometry.
        )r   r#   Zgeom_convex_hull)r-   r0   r0   r1   convex_hull  s    zOGRGeometry.convex_hullc             C   s   | j tj|S )z
        Return a new geometry consisting of the region which is the difference
        of this geometry and the other.
        )r   r#   Z	geom_diff)r-   r@   r0   r0   r1   rD     s    zOGRGeometry.differencec             C   s   | j tj|S )zx
        Return a new geometry consisting of the region of intersection of this
        geometry and the other.
        )r   r#   Zgeom_intersection)r-   r@   r0   r0   r1   rB     s    zOGRGeometry.intersectionc             C   s   | j tj|S )zq
        Return a new geometry which is the symmetric difference of this
        geometry and the other.
        )r   r#   Zgeom_sym_diff)r-   r@   r0   r0   r1   rF     s    zOGRGeometry.sym_differencec             C   s   | j tj|S )z{
        Return a new geometry consisting of the region which is the union of
        this geometry and the other.
        )r   r#   Z
geom_union)r-   r@   r0   r0   r1   r?     s    zOGRGeometry.union)N)F)N)J__name__
__module____qualname____doc__r#   Zdestroy_geomZ
destructorr2   r4   r8   classmethodr(   staticmethodr'   r=   r:   r>   rA   rC   rE   rG   rI   rJ   propertyrK   rL   rQ   	coord_dimrR   rS   rT   rU   r+   rV   rW   rX   rY   r[   r^   ra   r   rb   rc   r   rf   rg   rh   ri   rk   Zgeojsonrl   rm   r3   r   rt   rv   rw   rx   rz   r{   rH   r|   r}   r~   r   r   r   r   r   r   rD   rB   rF   r?   r0   r0   r0   r1   r   ;   s   
9



	


r   c                   s\   e Zd Z fddZedd Zedd Zedd Zed	d
 Z	edd Z
e
Z  ZS )Pointc                s&   ddl m} | jr|jj S t j S )Nr   )rg   )Zdjango.contrib.gisrg   rY   r   _create_emptysuperrf   )r-   rg   )r,   r0   r1   rf     s    zPoint._geos_ptrc             C   s   t jtdjS )NZpoint)r#   r$   r   r%   )r9   r0   r0   r1   r     s    zPoint._create_emptyc             C   s   t j| jdS )z'Return the X coordinate for this Point.r   )r#   getxr)   )r-   r0   r0   r1   x   s    zPoint.xc             C   s   t j| jdS )z'Return the Y coordinate for this Point.r   )r#   getyr)   )r-   r0   r0   r1   y  s    zPoint.yc             C   s   | j dkrtj| jdS dS )z'Return the Z coordinate for this Point.rN   r   N)r   r#   getzr)   )r-   r0   r0   r1   z
  s    
zPoint.zc             C   s4   | j dkr| j| jfS | j dkr0| j| j| jfS dS )zReturn the tuple of this point.rM   rN   N)r   r   r   r   )r-   r0   r0   r1   rZ     s    

zPoint.tuple)r   r   r   rf   r   r   r   r   r   r   rZ   coords__classcell__r0   r0   )r,   r1   r     s   r   c               @   sX   e Zd Zdd Zdd Zedd ZeZdd Zed	d
 Z	edd Z
edd ZdS )
LineStringc             C   s   d|  ko| j k n  rt t t   }}}tj| j|t|t|t| | j}|dkrf|jfS |dkrz|j|jfS |dkr|j|j|jfS ntd| dS )z$Return the Point at the given index.r   ro   rM   rN   z>Index out of range when accessing points of a line string: %s.N)	rS   r   r#   Z	get_pointr)   r   r   value
IndexError)r-   indexr   r   r   rP   r0   r0   r1   __getitem__  s     zLineString.__getitem__c             C   s   | j S )z.Return the number of points in the LineString.)rS   )r-   r0   r0   r1   __len__+  s    zLineString.__len__c                s   t  fddtt D S )z3Return the tuple representation of this LineString.c             3   s   | ]} | V  qd S )Nr0   ).0i)r-   r0   r1   	<genexpr>2  s    z#LineString.tuple.<locals>.<genexpr>)rZ   ranger6   )r-   r0   )r-   r1   rZ   /  s    zLineString.tuplec                s    fddt tD S )zp
        Internal routine that returns a sequence (list) corresponding with
        the given function.
        c                s   g | ]} j |qS r0   )r)   )r   r   )ry   r-   r0   r1   
<listcomp>:  s    z'LineString._listarr.<locals>.<listcomp>)r   r6   )r-   ry   r0   )ry   r-   r1   _listarr5  s    zLineString._listarrc             C   s   | j tjS )z#Return the X coordinates in a list.)r   r#   r   )r-   r0   r0   r1   r   <  s    zLineString.xc             C   s   | j tjS )z#Return the Y coordinates in a list.)r   r#   r   )r-   r0   r0   r1   r   A  s    zLineString.yc             C   s   | j dkr| jtjS dS )z#Return the Z coordinates in a list.rN   N)r   r   r#   r   )r-   r0   r0   r1   r   F  s    
zLineString.zN)r   r   r   r   r   r   rZ   r   r   r   r   r   r0   r0   r0   r1   r     s   r   c               @   s   e Zd ZdS )
LinearRingN)r   r   r   r0   r0   r0   r1   r   N  s   r   c               @   sT   e Zd Zdd Zdd Zedd ZeZedd ZeZ	ed	d
 Z
edd ZdS )Polygonc             C   s   | j S )z4Return the number of interior rings in this Polygon.)rR   )r-   r0   r0   r1   r   T  s    zPolygon.__len__c             C   sF   d|  ko| j k n  r6ttjtj| j|| jS td| dS )z$Get the ring at the specified index.r   z9Index out of range when accessing rings of a polygon: %s.N)rR   r   r#   ru   get_geom_refr)   r   r   )r-   r   r0   r0   r1   r   X  s    zPolygon.__getitem__c             C   s   | d S )z!Return the shell of this Polygon.r   r0   )r-   r0   r0   r1   shell`  s    zPolygon.shellc                s   t  fddt jD S )z/Return a tuple of LinearRing coordinate tuples.c             3   s   | ]} | j V  qd S )N)rZ   )r   r   )r-   r0   r1   r   i  s    z Polygon.tuple.<locals>.<genexpr>)rZ   r   rR   )r-   r0   )r-   r1   rZ   f  s    zPolygon.tuplec                s   t  fddt jD S )z,Return the number of Points in this Polygon.c             3   s   | ]} | j V  qd S )N)rS   )r   r   )r-   r0   r1   r   p  s    z&Polygon.point_count.<locals>.<genexpr>)sumr   rR   )r-   r0   )r-   r1   rS   l  s    zPolygon.point_countc             C   s    t td}tj| j|j |S )z.Return the centroid (a Point) of this Polygon.r   )r   r   r#   Zget_centroidr)   )r-   pr0   r0   r1   centroidr  s    zPolygon.centroidN)r   r   r   r   r   r   r   Zexterior_ringrZ   r   rS   r   r0   r0   r0   r1   r   R  s   r   c               @   sD   e Zd ZdZdd Zdd Zdd Zedd	 Zed
d Z	e	Z
dS )GeometryCollectionzThe Geometry Collection class.c             C   sF   d|  ko| j k n  r6ttjtj| j|| jS td| dS )z(Get the Geometry at the specified index.r   z?Index out of range when accessing geometry in a collection: %s.N)rR   r   r#   ru   r   r)   r   r   )r-   r   r0   r0   r1   r     s    zGeometryCollection.__getitem__c             C   s   | j S )z<Return the number of geometries in this Geometry Collection.)rR   )r-   r0   r0   r1   r     s    zGeometryCollection.__len__c             C   sx   t |trHt || jr6x.|D ]}tj| j|j qW qttj| j|j n,t |trlt|}tj| j|j ntddS )z-Add the geometry to this Geometry Collection.zMust add an OGRGeometry.N)r   r   r,   r#   Zadd_geomr)   r   r   )r-   r   r/   tmpr0   r0   r1   add  s    


zGeometryCollection.addc                s   t  fddt jD S )z8Return the number of Points in this Geometry Collection.c             3   s   | ]} | j V  qd S )N)rS   )r   r   )r-   r0   r1   r     s    z1GeometryCollection.point_count.<locals>.<genexpr>)r   r   rR   )r-   r0   )r-   r1   rS     s    zGeometryCollection.point_countc                s   t  fddt jD S )z:Return a tuple representation of this Geometry Collection.c             3   s   | ]} | j V  qd S )N)rZ   )r   r   )r-   r0   r1   r     s    z+GeometryCollection.tuple.<locals>.<genexpr>)rZ   r   rR   )r-   r0   )r-   r1   rZ     s    zGeometryCollection.tupleN)r   r   r   r   r   r   r   r   rS   rZ   r   r0   r0   r0   r1   r   |  s   r   c               @   s   e Zd ZdS )
MultiPointN)r   r   r   r0   r0   r0   r1   r     s   r   c               @   s   e Zd ZdS )MultiLineStringN)r   r   r   r0   r0   r0   r1   r     s   r   c               @   s   e Zd ZdS )MultiPolygonN)r   r   r   r0   r0   r0   r1   r     s   r   ro   rM   rN               e   ).r   rp   binasciir   ctypesr   r   r   r   r   r   Zdjango.contrib.gis.gdal.baser	   Z django.contrib.gis.gdal.enveloper
   r   Zdjango.contrib.gis.gdal.errorr   r   Z django.contrib.gis.gdal.geomtyper   Z"django.contrib.gis.gdal.prototypesr   r#   r   r\   Zdjango.contrib.gis.gdal.srsr   r   Zdjango.contrib.gis.geometryr   r   r   Zdjango.utils.encodingr   r   r   r   r   r   r   r   r   r   Zwkb25bitr*   r0   r0   r0   r1   <module>(   sL       >$4**





