
    df|                    X   d dl mZ esdev rddlmZ nd dlZ	 d dlZd Z
d Zd Zd	 Z G d
 de      Zej                   Zej"                  Zej$                  Zej&                  Zej(                  Zej*                  Zej,                  Zej.                  Zej0                  Zej2                  Zej4                  Zej6                  Zej8                  Zej:                  Zej<                  Zej>                  Zej@                  Z ejB                  Z!ejD                  Z"ejF                  Z#ejH                  Z$ejJ                  Z%ejL                  Z&ejN                  Z'ejP                  Z(ejR                  Z)ejT                  Z*ejV                  Z+ejX                  Z,ejZ                  Z-ej\                  Z.ej^                  Z/ej`                  Z0ejb                  Z1ejd                  Z2ejf                  Z3ejh                  Z4ejj                  Z5ejl                  Z6ejn                  Z7ejp                  Z8ejr                  Z9ejt                  Z:ejv                  Z;ejx                  Z<ejz                  Z=ej|                  Z>ej~                  Z?ej                  Z@ej                  ZAej                  ZBej                  ZCej                  ZDej                  ZEej                  ZFej                  ZGej                  ZHej                  ZIej                  ZJej                  ZKej                  ZLej                  ZMej                  ZNej                  ZOej                  ZPej                  ZQej                  ZRej                  ZSej                  ZTej                  ZUej                  ZVej                  ZWej                  ZXej                  ZYej                  ZZej                  Z[ej                  Z\ej                  Z]ej                  Z^ej                  Z_ej                  Z`ej                  Zaej                  Zbej                  Zcej                  Zdej                  Zeej                  Zfej                  Zgej                  Zhej                  Ziej                  Zjej                  Zkej                  Zlej                  Zmej                  Znej                  Zoej                  Zpej                  Zqej                  Zrej                  Zsej                  Ztej                  Zuej                  Zvej                  Zwej                  Zxej                  Zyej                  Zzej                  Z{ej                  Z|ej                  Z}ej                  Z~ej                  Zej                   Zej                  Zej                  Zej                  Zej                  Zej
                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                   Zej"                  Zej$                  Zej&                  Zej(                  Zej*                  Zej,                  Zej.                  Zej0                  Zej2                  Zej4                  Zej6                  Zej8                  Zej:                  Zej<                  Zej>                  Zej@                  ZejB                  ZejD                  ZejF                  ZejH                  ZejJ                  ZejL                  ZejN                  ZejP                  ZejR                  ZejT                  ZejV                  ZejX                  ZejZ                  Zej\                  Zej^                  Zej`                  Zejb                  Zejd                  Zejf                  Zejh                  Zejj                  Zejl                  Zejn                  Zejp                  Zejr                  Zejt                  Zejv                  Zejx                  Zejz                  Zej|                  Zej~                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zej                  Zd Zd Zd Zd Zd Zd Z G d deѫ      Zd Zd ZdZd ZddlmZ  G d deѫ      Z ej                  eث       d Zd Zd Z G d deѫ      Z ej                  eݫ        G d  d!eث      Z ej                  e߫        G d" d#eث      Z ej                  e        G d$ d%eѫ      Z ej                  e        G d& d'eѫ      Z ej                  e        G d( d)eѫ      Z ej                  e        G d* d+eث      Z ej                  e        G d, d-eѫ      Z ej                  e        G d. d/eѫ      Z ej                  e        G d0 d1eѫ      Z ej                  e        G d2 d3eѫ      Z ej                  e       d4 Zd5 Zd6 Zd7 Zd8 Zd9 Zd: Zd; Zd< Zd= Zd> Zd? Zd@ Z G dA dBeѫ      Z  ej                  e         G dC dDeѫ      Z ej                  e        G dE dFeѫ      Z ej
                  e        G dG dHeѫ      Z ej                  e       dI ZdJ Z	dK Z
dL ZdM ZdN ZdO ZdP ZdQ ZdR ZdS ZdT ZdU ZdV ZdW ZdX ZdY ZdZ Zd[ Zd\ Zd] Zd^ Zd_ Zd` Zda Z db Z!dc Z"dd Z#de Z$df Z%dg Z&dh Z'di Z(ejR                  Z)y# e	$ r d dlZY w xY w)j    )version_info.   )_ogrNc                     	 d| j                   j                         z   }d| j                  j
                  d| j                  j                  d|dS # t        j                  $ r d}Y Kw xY w)Nz	proxy of  <r   z; z >)this__repr____builtin__	Exception	__class__
__module____name__)selfstrthiss     +/usr/lib/python3/dist-packages/osgeo/ogr.py
_swig_reprr      s_    		 2 2 44 "^^668O8OQXZZ    s   A A+*A+c                       fd}|S )Nc                     |dk(  r | ||       y |dk(  r| j                   j                  |       y t        | |      r.t        t	        t        |       |      t              r | ||       y t        d| z        )Nr
   thisownz(You cannot add instance attributes to %s)r
   ownhasattr
isinstancegetattrtypepropertyAttributeError)r   namevaluesets      r   set_instance_attrzE_swig_setattr_nondynamic_instance_variable.<locals>.set_instance_attr   si    6>dE"YIIMM% T4 ZT
D0I8%TdE" !Kd!RSS     )r!   r"   s   ` r   *_swig_setattr_nondynamic_instance_variabler%      s    T r#   c                       fd}|S )Nc                     t        | |      r%t        t        | |      t              s | ||       y t	        d| z        )Nz%You cannot add class attributes to %s)r   r   r   r   r   )clsr   r    r!   s      r   set_class_attrz?_swig_setattr_nondynamic_class_variable.<locals>.set_class_attr)   s:    3jd1CX&NT5! !H3!NOOr#   r$   )r!   r)   s   ` r   '_swig_setattr_nondynamic_class_variabler*   (   s    P
 r#   c                       fd}|S )zlClass decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclassc                 p     | j                   | j                  | j                  j                               S N)r   	__bases____dict__copy)r(   	metaclasss    r   wrapperz$_swig_add_metaclass.<locals>.wrapper3   s'    s}}cll6G6G6IJJr#   r$   )r1   r2   s   ` r   _swig_add_metaclassr3   1   s    KNr#   c                   4    e Zd ZdZ eej                        Zy)_SwigNonDynamicMetazKMeta class to enforce nondynamic attributes (no new attributes) for a classN)r   r   __qualname____doc__r*   r   __setattr__r$   r#   r   r5   r5   8   s    U9$:J:JKKr#   r5   c                  &    t        j                  |  S )zGetUseExceptions() -> int)r   GetUseExceptionsargss    r   r:   r:           $''r#   c                  &    t        j                  |  S )z_GetExceptionsLocal() -> int)r   _GetExceptionsLocalr;   s    r   r?   r?         ##T**r#   c                  &    t        j                  |  S )z_SetExceptionsLocal(int bVal))r   _SetExceptionsLocalr;   s    r   rB   rB     r@   r#   c                  &    t        j                  |  S )z_UseExceptions())r   _UseExceptionsr;   s    r   rD   rD         %%r#   c                  &    t        j                  |  S )z_DontUseExceptions())r   _DontUseExceptionsr;   s    r   rG   rG         ""D))r#   c                  &    t        j                  |  S )z+_UserHasSpecifiedIfUsingExceptions() -> int)r   "_UserHasSpecifiedIfUsingExceptionsr;   s    r   rJ   rJ     s    22D99r#   c                   $    e Zd ZdZddZd Zd Zy)ExceptionMgra  
    Context manager to manage Python Exception state
    for GDAL/OGR/OSR/GNM.

    Separate exception state is maintained for each
    module (gdal, ogr, etc), and this class appears independently
    in all of them. This is built in top of calls to the older
    UseExceptions()/DontUseExceptions() functions.

    Example::

        >>> print(gdal.GetUseExceptions())
        0
        >>> with gdal.ExceptionMgr():
        ...     # Exceptions are now in use
        ...     print(gdal.GetUseExceptions())
        1
        >>>
        >>> # Exception state has now been restored
        >>> print(gdal.GetUseExceptions())
        0

    c                     || _         y)zK
        Save whether or not this context will be using exceptions
        N)requestedUseExceptions)r   useExceptionss     r   __init__zExceptionMgr.__init__  s     '4#r#   c                     t               | _        t        | j                         t        j
                  dk(  r&	 ddlm} |r|j                  | j                         yyy# t        $ r d}Y -w xY w)z
        On context entry, save the current GDAL exception state, and
        set it to the state requested for the context

        
osgeo.gdalr   
gdal_arrayN)	r?   currentUseExceptionsrB   rN   rL   r   r   rT   ImportError)r   rT   s     r   	__enter__zExceptionMgr.__enter__  sl     %8$9!D778""l2"( ..t/J/JK  3  "!
"s   A A-,A-c                     t        | j                         t        j                  dk(  r&	 ddlm} |r|j                  | j                         yyy# t        $ r d}Y -w xY w)zy
        On exit, restore the GDAL/OGR/OSR/GNM exception state which was
        current on entry to the context
        rR   r   rS   N)rB   rU   rL   r   r   rT   rV   )r   exc_typeexc_valexc_tbrT   s        r   __exit__zExceptionMgr.__exit__  sa    
 	D556""l2"( ..t/H/HI  3  "!
"s   A AAN)T)r   r   r6   r7   rP   rW   r\   r$   r#   r   rL   rL     s    .4L Jr#   rL   c                     	 ddl m}  | j                          	 ddl m} |j                          	 ddl m} |j                          	 ddl m}  |j                          	 ddl m} |j                          y# t        $ r Y iw xY w# t        $ r Y aw xY w# t        $ r Y Yw xY w# t        $ r Y Pw xY w# t        $ r Y yw xY w)z Enable exceptions in all GDAL related modules (osgeo.gdal, osgeo.ogr, osgeo.osr, osgeo.gnm).
        Note: prior to GDAL 3.7, this only affected the calling moduler   gdalrS   ogrosrgnmN)r   r_   rD   rV   rT   ra   rc   re   r_   rT   ra   rc   re   s        r   UseExceptionsrg     s     !!#'  
  
  
  
  W   A6 B B B# B2 6	BB	BB	B B #	B/.B/2	B>=B>c                     	 ddl m}  | j                          	 ddl m} |j                          	 ddl m} |j                          	 ddl m}  |j                          	 ddl m} |j                          y# t        $ r Y iw xY w# t        $ r Y aw xY w# t        $ r Y Yw xY w# t        $ r Y Pw xY w# t        $ r Y yw xY w)z Disable exceptions in all GDAL related modules (osgeo.gdal, osgeo.ogr, osgeo.osr, osgeo.gnm).
        Note: prior to GDAL 3.7, this only affected the calling moduler   r^   rS   r`   rb   rd   N)r   r_   rG   rV   rT   ra   rc   re   rf   s        r   DontUseExceptionsrj   )  s    ! %%'   '  
  
  
  
  rh   Fc                      ddl m}  t        | d      s-t               s"d| _        dd l}|j                  dt               y y y )Nr   r^   2hasWarnedAboutUserHasNotSpecifiedIfUsingExceptionsTr   zNeither ogr.UseExceptions() nor ogr.DontUseExceptions() has been explicitly called. In GDAL 4.0, exceptions will be enabled by default.)r   r_   r   rJ   rl   warningswarnFutureWarning)r_   rm   s     r   +_WarnIfUserHasNotSpecifiedIfUsingExceptionsrp   L  sA    4MNWyW{BF?BCP	R X|Nr#   rb   c                   l    e Zd ZdZ ed d d      Zd ZeZd Z	d Z
d	 Zd
 Zd Zd Zd Zd ZddZy)MajorObjectz)Proxy of C++ GDALMajorObjectShadow class.c                 6    | j                   j                         S r-   r
   r   xs    r   <lambda>zMajorObject.<lambda>Y       r#   c                 8    | j                   j                  |      S r-   rt   rv   vs     r   rw   zMajorObject.<lambda>Y      AFFJJqM r#   The membership flagdocc                     t        d      NzNo constructor definedr   r   r<   kwargss      r   rP   zMajorObject.__init__[      566r#   c                 .    t        j                  | g| S )z0GetDescription(MajorObject self) -> char const *)r   MajorObject_GetDescriptionr   r<   s     r   GetDescriptionzMajorObject.GetDescription_      ..t;d;;r#   c                 .    t        j                  | g| S )z9SetDescription(MajorObject self, char const * pszNewDesc))r   MajorObject_SetDescriptionr   s     r   SetDescriptionzMajorObject.SetDescriptionc  r   r#   c                 .    t        j                  | g| S )z2GetMetadataDomainList(MajorObject self) -> char **)r   !MajorObject_GetMetadataDomainListr   s     r   GetMetadataDomainListz!MajorObject.GetMetadataDomainListg  s    55dBTBBr#   c                 .    t        j                  | g| S )zHGetMetadata_Dict(MajorObject self, char const * pszDomain="") -> char **)r   MajorObject_GetMetadata_Dictr   s     r   GetMetadata_DictzMajorObject.GetMetadata_Dictk      00===r#   c                 .    t        j                  | g| S )zHGetMetadata_List(MajorObject self, char const * pszDomain="") -> char **)r   MajorObject_GetMetadata_Listr   s     r   GetMetadata_ListzMajorObject.GetMetadata_Listo  r   r#   c                 .    t        j                  | g| S )z
        SetMetadata(MajorObject self, char ** papszMetadata, char const * pszDomain="") -> CPLErr
        SetMetadata(MajorObject self, char * pszMetadataString, char const * pszDomain="") -> CPLErr
        )r   MajorObject_SetMetadatar   s     r   SetMetadatazMajorObject.SetMetadatas  s    
 ++D8488r#   c                 .    t        j                  | g| S )zbGetMetadataItem(MajorObject self, char const * pszName, char const * pszDomain="") -> char const *)r   MajorObject_GetMetadataItemr   s     r   GetMetadataItemzMajorObject.GetMetadataItemz      //<t<<r#   c                 .    t        j                  | g| S )zsSetMetadataItem(MajorObject self, char const * pszName, char const * pszValue, char const * pszDomain="") -> CPLErr)r   MajorObject_SetMetadataItemr   s     r   SetMetadataItemzMajorObject.SetMetadataItem~  r   r#   c                 V    |d d dk(  r| j                  |      S | j                  |      S )N   zxml:)r   r   )r   domains     r   GetMetadatazMajorObject.GetMetadata  s2    	v	$$V,,""6**r#   N)r   )r   r   r6   r7   r   r   rP   r   r   r   r   r   r   r   r   r   r   r   r$   r#   r   rr   rr   V  sN    4-/IOdeG7H<<C>>9==+r#   rr   c                  &    t        j                  |  S )zGetGEOSVersionMajor() -> int)r   GetGEOSVersionMajorr;   s    r   r   r     r@   r#   c                  &    t        j                  |  S )zGetGEOSVersionMinor() -> int)r   GetGEOSVersionMinorr;   s    r   r   r     r@   r#   c                  &    t        j                  |  S )zGetGEOSVersionMicro() -> int)r   GetGEOSVersionMicror;   s    r   r   r     r@   r#   c                   v    e Zd ZdZ ed d d      ZeZd Ze	j                  Zd Zd Zd	 Zd
 Zd Zd Zd Zy)
StyleTablez'Proxy of C++ OGRStyleTableShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zStyleTable.<lambda>  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zStyleTable.<lambda>  r|   r#   r}   r~   c                 P    t        j                  | t        j                  |        y)z'__init__(StyleTable self) -> StyleTableN)r   StyleTable_swiginitnew_StyleTabler   s     r   rP   zStyleTable.__init__        t':':D'ABr#   c                 .    t        j                  | g| S )zSAddStyle(StyleTable self, char const * pszName, char const * pszStyleString) -> int)r   StyleTable_AddStyler   s     r   AddStylezStyleTable.AddStyle      ''4t44r#   c                 .    t        j                  | g| S )z>LoadStyleTable(StyleTable self, char const * utf8_path) -> int)r   StyleTable_LoadStyleTabler   s     r   LoadStyleTablezStyleTable.LoadStyleTable      --d:T::r#   c                 .    t        j                  | g| S )z>SaveStyleTable(StyleTable self, char const * utf8_path) -> int)r   StyleTable_SaveStyleTabler   s     r   SaveStyleTablezStyleTable.SaveStyleTable  r   r#   c                 .    t        j                  | g| S )z;Find(StyleTable self, char const * pszName) -> char const *)r   StyleTable_Findr   s     r   FindzStyleTable.Find      ##D0400r#   c                 .    t        j                  | g| S )z(ResetStyleStringReading(StyleTable self))r   "StyleTable_ResetStyleStringReadingr   s     r   ResetStyleStringReadingz"StyleTable.ResetStyleStringReading  s    66tCdCCr#   c                 .    t        j                  | g| S )z-GetNextStyle(StyleTable self) -> char const *)r   StyleTable_GetNextStyler   s     r   GetNextStylezStyleTable.GetNextStyle      ++D8488r#   c                 .    t        j                  | g| S )z1GetLastStyleName(StyleTable self) -> char const *)r   StyleTable_GetLastStyleNamer   s     r   GetLastStyleNamezStyleTable.GetLastStyleName  r   r#   N)r   r   r6   r7   r   r   r   r   rP   r   delete_StyleTable__swig_destroy__r   r   r   r   r   r   r   r$   r#   r   r   r     sS    2-/IOdeGHC --5;;1D9=r#   r   c                       e Zd ZdZ ed d d      Zd ZeZ ee	j                  d      Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zy)Driverz#Proxy of C++ OGRDriverShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zDriver.<lambda>  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zDriver.<lambda>  r|   r#   r}   r~   c                     t        d      r   r   r   s      r   rP   zDriver.__init__  r   r#   name : p.q(const).charc                 4    t        j                  | g|i |S )zYCreateDataSource(Driver self, char const * utf8_path, char ** options=None) -> DataSource)r   Driver_CreateDataSourcer   s      r   CreateDataSourcezDriver.CreateDataSource  s    ++DB4B6BBr#   c                 4    t        j                  | g|i |S )zkCopyDataSource(Driver self, DataSource copy_ds, char const * utf8_path, char ** options=None) -> DataSource)r   Driver_CopyDataSourcer   s      r   CopyDataSourcezDriver.CopyDataSource      ))$@@@@r#   c                 H    t                t        j                  | g|i |S )zEOpen(Driver self, char const * utf8_path, int update=0) -> DataSource)rp   r   Driver_Openr   s      r   OpenzDriver.Open  s'     	45 6t6v66r#   c                 .    t        j                  | g| S )z<DeleteDataSource(Driver self, char const * utf8_path) -> int)r   Driver_DeleteDataSourcer   s     r   DeleteDataSourcezDriver.DeleteDataSource  r   r#   c                 .    t        j                  | g| S )z5TestCapability(Driver self, char const * cap) -> bool)r   Driver_TestCapabilityr   s     r   TestCapabilityzDriver.TestCapability      ))$666r#   c                 .    t        j                  | g| S )z$GetName(Driver self) -> char const *)r   Driver_GetNamer   s     r   GetNamezDriver.GetName      ""4/$//r#   c                 .    t        j                  | g| S )zRegister(Driver self))r   Driver_Registerr   s     r   RegisterzDriver.Register  r   r#   c                 .    t        j                  | g| S )zDeregister(Driver self))r   Driver_Deregisterr   s     r   
DeregisterzDriver.Deregister      %%d2T22r#   N)r   r   r6   r7   r   r   rP   r   r   r   Driver_name_getr   r   r   r   r   r   r   r   r   r$   r#   r   r   r     s]    .-/IOdeG7HD((.KLDCA797013r#   r   c                   H   e Zd ZdZ ed d d      Zd ZeZ ee	j                  d      Ze	j                  Zd Zd	 Zd
 Zd Zd Zd Zd+dZd Zd Zd Zd Zd Zd Zd Zd,dZd Zd Zd Zd Z d Z!d Z"d Z#d Z$d  Z%d! Z&d" Z'd# Z(d$ Z)d% Z*d& Z+d' Z,d-d(Z-d.d)Z.d* Z/y)/
DataSourcez

    Python proxy of a vector :cpp:class:`GDALDataset`.

    Since GDAL 3.8, a DataSource can be used as a context manager.
    When exiting the context, the DataSource will be closed and
    features will be written to disk.

    c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zDataSource.<lambda>  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zDataSource.<lambda>  r|   r#   r}   r~   c                     t        d      r   r   r   s      r   rP   zDataSource.__init__  r   r#   r   c                 n    t        j                  | g| }d| _        d| _        | j	                          |S )af  
        Close(DataSource self) -> CPLErr

        Closes opened dataset and releases allocated resources.

        This method can be used to force the dataset to close
        when one more references to the dataset are still
        reachable. If Close is never called, the dataset will
        be closed automatically during garbage collection.

        r   N)r   DataSource_Closer   r
   _invalidate_layersr   r<   vals      r   ClosezDataSource.Close  s8     ##D040	!
r#   c                 .    t        j                  | g| S )zy
        GetRefCount(DataSource self) -> int
        int
        OGR_DS_GetRefCount(OGRDataSourceH hDataSource) 
        )r   DataSource_GetRefCountr   s     r   GetRefCountzDataSource.GetRefCount  s     **47$77r#   c                 .    t        j                  | g| S )z
        GetSummaryRefCount(DataSource self) -> int
        int
        OGR_DS_GetSummaryRefCount(OGRDataSourceH hDataSource) 
        )r   DataSource_GetSummaryRefCountr   s     r   GetSummaryRefCountzDataSource.GetSummaryRefCount"  s     11$>>>r#   c                 .    t        j                  | g| S )a  
        GetLayerCount(DataSource self) -> int
        int
        OGR_DS_GetLayerCount(OGRDataSourceH hDS)

        Get the number of layers in this data source.

        Deprecated Use GDALDatasetGetLayerCount() in GDAL 2.0

        Parameters
        -----------
        hDS:
            handle to the data source from which to get the number of
            layers.

        Returns
        --------
        int:
            layer count.

        )r   DataSource_GetLayerCountr   s     r   GetLayerCountzDataSource.GetLayerCount*      , ,,T9D99r#   c                 .    t        j                  | g| S )a  
        GetDriver(DataSource self) -> Driver
        OGRSFDriverH
        OGR_DS_GetDriver(OGRDataSourceH hDS)

        Returns the driver that the dataset was opened with.

        NOTE: Starting with GDAL 2.0, it is NOT safe to cast the returned
        handle to OGRSFDriver\*. If a C++ object is needed, the handle should
        be cast to GDALDriver\*.

        Deprecated Use GDALGetDatasetDriver() in GDAL 2.0

        Parameters
        -----------
        hDS:
            handle to the datasource

        Returns
        --------
        OGRSFDriverH:
            NULL if driver info is not available, or pointer to a driver owned by
            the OGRSFDriverManager.

        )r   DataSource_GetDriverr   s     r   	GetDriverzDataSource.GetDriverB  s    4 ((555r#   c                 .    t        j                  | g| S )a  
        GetName(DataSource self) -> char const *
        const char\*
        OGR_DS_GetName(OGRDataSourceH hDS)

        Returns the name of the data source.

        This string should be sufficient to open the data source if passed to
        the same OGRSFDriver that this data source was opened with, but it
        need not be exactly the same string that was used to open the data
        source. Normally this is a filename.

        Deprecated Use GDALGetDescription() in GDAL 2.0

        Parameters
        -----------
        hDS:
            handle to the data source to get the name from.

        Returns
        --------
        str:
            pointer to an internal name string which should not be modified or
            freed by the caller.

        )r   DataSource_GetNamer   s     r   r   zDataSource.GetName^  s    6 &&t3d33r#   c                 l   t        |t              rht        | j                               D ]>  }| j	                  |      }|j                         |k(  s(t        j                  | |      c S  t        d|z        t        |t              rt        j                  | |      S t        dt        |      z        )a  
        DeleteLayer(DataSource self, value) -> OGRErr

        Delete the indicated layer from the datasource.

        For more details: :c:func:`OGR_DS_DeleteLayer`

        Parameters
        -----------
        value: str | int
            index or name of the layer to delete.

        Returns
        -------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success, or :py:const:`osgeo.ogr.OGRERR_UNSUPPORTED_OPERATION` if deleting
            layers is not supported for this datasource.
        zLayer %s not found to delete%Input %s is not of String or Int type)r   strranger  GetLayerr   r   DataSource_DeleteLayer
ValueErrorint	TypeErrorr   )r   r    ilyrs       r   DeleteLayerzDataSource.DeleteLayer{  s    ( eS!4--/0 @mmA&;;=E)66tQ??@ ;eCDDs#..tU;;Cd5kQRRr#   c                 .    t        j                  | g| S )z
        SyncToDisk(DataSource self) -> OGRErr
        OGRErr
        OGR_DS_SyncToDisk(OGRDataSourceH hDS)

        Flush pending changes to disk.

        See GDALDataset::FlushCache() 
        )r   DataSource_SyncToDiskr   s     r   
SyncToDiskzDataSource.SyncToDisk  s     ))$666r#   c                 .    t        j                  | g| S )zFlushCache(DataSource self))r   DataSource_FlushCacher   s     r   
FlushCachezDataSource.FlushCache  r   r#   c                 Z    t        j                  | g|i |}| j                  |       |S )a0  
        CreateLayer(DataSource self, char const * name, SpatialReference srs=None, OGRwkbGeometryType geom_type=wkbUnknown, char ** options=None) -> Layer
        OGRLayerH
        OGR_DS_CreateLayer(OGRDataSourceH hDS, const char \*pszName,
        OGRSpatialReferenceH hSpatialRef, OGRwkbGeometryType eType, char
        \*\*papszOptions)

        This function attempts to create a new layer on the data source with
        the indicated name, coordinate system, geometry type.

        The papszOptions argument can be used to control driver specific
        creation options. These options are normally documented in the format
        specific documentation.

        Deprecated Use GDALDatasetCreateLayer() in GDAL 2.0

        Parameters
        -----------
        hDS:
            The dataset handle.pszName:  the name for the new layer. This should ideally not match
            any existing layer on the datasource.
        hSpatialRef:
            handle to the coordinate system to use for the new
            layer, or NULL if no coordinate system is available. The driver might
            only increase the reference counter of the object to take ownership,
            and not make a full copy, so do not use OSRDestroySpatialReference(),
            but OSRRelease() instead when you are done with the object.
        eType:
            the geometry type for the layer. Use wkbUnknown if there are
            no constraints on the types geometry to be written.
        papszOptions:
            a StringList of name=value options. Options are driver
            specific, and driver information can be found at the following
            url:http://www.gdal.org/ogr_formats.html


        Returns
        --------
        OGRLayerH:
            NULL is returned on failure, or a new OGRLayer handle on success.

        )r   DataSource_CreateLayer_add_layer_refr   r<   r   r   s       r   CreateLayerzDataSource.CreateLayer  s4    V ))$@@@C  
r#   c                 Z    t        j                  | g|i |}| j                  |       |S )a  
        CopyLayer(DataSource self, Layer src_layer, char const * new_name, char ** options=None) -> Layer
        OGRLayerH
        OGR_DS_CopyLayer(OGRDataSourceH hDS, OGRLayerH hSrcLayer, const char
        \*pszNewName, char \*\*papszOptions)

        Duplicate an existing layer.

        This function creates a new layer, duplicate the field definitions of
        the source layer and then duplicate each features of the source layer.
        The papszOptions argument can be used to control driver specific
        creation options. These options are normally documented in the format
        specific documentation. The source layer may come from another
        dataset.

        Deprecated Use GDALDatasetCopyLayer() in GDAL 2.0

        Parameters
        -----------
        hDS:
            handle to the data source where to create the new layer
        hSrcLayer:
            handle to the source layer.
        pszNewName:
            the name of the layer to create.
        papszOptions:
            a StringList of name=value options. Options are driver
            specific.

        Returns
        -------
        OGRLayerH:
            a handle to the layer, or NULL if an error occurs.

        )r   DataSource_CopyLayerr   r!  s       r   	CopyLayerzDataSource.CopyLayer  s4    H ''>t>v>C  
r#   c                 T    t        j                  | g| }| j                  |       |S )z6GetLayerByIndex(DataSource self, int index=0) -> Layer)r   DataSource_GetLayerByIndexr   r   s      r   GetLayerByIndexzDataSource.GetLayerByIndex  s,    --d:T:C  
r#   c                 T    t        j                  | g| }| j                  |       |S )a  
        GetLayerByName(DataSource self, char const * layer_name) -> Layer
        OGRLayerH
        OGR_DS_GetLayerByName(OGRDataSourceH hDS, const char \*pszLayerName)

        Fetch a layer by name.

        The returned layer remains owned by the OGRDataSource and should not
        be deleted by the application.

        Deprecated Use GDALDatasetGetLayerByName() in GDAL 2.0

        Parameters
        -----------
        hDS:
            handle to the data source from which to get the layer.
        pszLayerName:
            Layer the layer name of the layer to fetch.


        Returns
        --------
        OGRLayerH:
            a handle to the layer, or NULL if the layer is not found or an error
            occurs.

        )r   DataSource_GetLayerByNamer   r   s      r   GetLayerByNamezDataSource.GetLayerByName  s.    8 ,,T9D9C  
r#   c                 .    t        j                  | g| S )a  
        TestCapability(DataSource self, char const * cap) -> bool
        int
        OGR_DS_TestCapability(OGRDataSourceH hDS, const char \*pszCapability)

        Test if capability is available.

        One of the following data source capability names can be passed into
        this function, and a TRUE or FALSE value will be returned indicating
        whether or not the capability is available for this object.

        ODsCCreateLayer: True if this datasource can create new layers.

        ODsCDeleteLayer: True if this datasource can delete existing layers.

        ODsCCreateGeomFieldAfterCreateLayer: True if the layers of this
        datasource support CreateGeomField() just after layer creation.

        ODsCCurveGeometries: True if this datasource supports writing curve
        geometries. (GDAL 2.0). In that case, OLCCurveGeometries must also be
        declared in layers of that dataset.

        The #define macro forms of the capability names should be used in
        preference to the strings themselves to avoid misspelling.

        Deprecated Use GDALDatasetTestCapability() in GDAL 2.0

        Parameters
        -----------
        hDS:
            handle to the data source against which to test the capability.
        pszCapability:
            the capability to test.

        Returns
        --------
        int:
            TRUE if capability available otherwise FALSE.

        )r   DataSource_TestCapabilityr   s     r   r   zDataSource.TestCapability9  s    R --d:T::r#   Nc                     t        j                  | |||      }|r*ddl}d|_        |j	                  |       |_        |r| |_        |S )a

  ExecuteSQL(self, statement, spatialFilter: ogr.Geometry = None, dialect: Optional[str] = "", keep_ref_on_ds=False) -> ogr.Layer

        Execute a SQL statement against the dataset

        The result of a SQL query is:
          - None (or an exception if exceptions are enabled) for statements
            that are in error
          - or None for statements that have no results set,
          - or a ogr.Layer handle representing a results set from the query.

        Note that this ogr.Layer is in addition to the layers in the data store
        and must be released with ReleaseResultSet() before the data source is closed
        (destroyed).

        Starting with GDAL 3.7, this method can also be used as a context manager,
        as a convenient way of automatically releasing the returned result layer.

        For more information on the SQL dialect supported internally by OGR
        review the OGR SQL document (:ref:`ogr_sql_sqlite_dialect`)
        Some drivers (i.e. Oracle and PostGIS) pass the SQL directly through to the
        underlying RDBMS.

        The SQLITE dialect can also be used (:ref:`sql_sqlite_dialect`)

        Parameters
        ----------
        statement:
            the SQL statement to execute (e.g "SELECT * FROM layer")
        spatialFilter:
            a geometry which represents a spatial filter. Can be None
        dialect:
            allows control of the statement dialect. If set to None or empty string,
            the OGR SQL engine will be used, except for RDBMS drivers that will
            use their dedicated SQL engine, unless OGRSQL is explicitly passed as
            the dialect. The SQLITE dialect can also be used.
        keep_ref_on_ds:
            whether the returned layer should keep a (strong) reference on
            the current dataset. Cf example 2 for a use case.

        Returns
        -------
        ogr.Layer:
            a ogr.Layer containing the results of the query, that will be
            automatically released when the context manager goes out of scope.

        Examples
        --------
        1. Use as a context manager:

        >>> with ds.ExecuteSQL("SELECT * FROM layer") as lyr:
        ...     print(lyr.GetFeatureCount())

        2. Use keep_ref_on_ds=True to return an object that keeps a reference to its dataset:

        >>> def get_sql_lyr():
        ...     return gdal.OpenEx("test.shp").ExecuteSQL("SELECT * FROM test", keep_ref_on_ds=True)
        ...
        ... with get_sql_lyr() as lyr:
        ...     print(lyr.GetFeatureCount())
        r   NT)r   DataSource_ExecuteSQLweakref_to_releaseref_dataset_weak_ref_dataset_strong_ref)r   	statementspatialFilterdialectkeep_ref_on_dssql_lyrr0  s          r   
ExecuteSQLzDataSource.ExecuteSQLd  sJ    | ,,T9mWU"&G(/D(9G%.2+r#   c                 .    t        j                  | g| S )z#AbortSQL(DataSource self) -> OGRErr)r   DataSource_AbortSQLr   s     r   AbortSQLzDataSource.AbortSQL  r   r#   c                     |rt        |d      st        d      t        j                  | |       |rd|_        d|_        yy)a1  ReleaseResultSet(self, sql_lyr: ogr.Layer)

        Release ogr.Layer returned by ExecuteSQL() (when not called as an execution manager)

        The sql_lyr object is invalidated after this call.

        Parameters
        ----------
        sql_lyr:
            ogr.Layer got with ExecuteSQL()
        r1  z^This layer was not returned by ExecuteSQL() and should not be released with ReleaseResultSet()N)r   r   r   DataSource_ReleaseResultSetr   r
   )r   r9  s     r   ReleaseResultSetzDataSource.ReleaseResultSet  sB     77M:|}}((w7"GOGL r#   c                 .    t        j                  | g| S )z
        GetStyleTable(DataSource self) -> StyleTable
        OGRStyleTableH
        OGR_DS_GetStyleTable(OGRDataSourceH hDS)

        Get style table. 
        )r   DataSource_GetStyleTabler   s     r   GetStyleTablezDataSource.GetStyleTable       ,,T9D99r#   c                 .    t        j                  | g| S )z
        SetStyleTable(DataSource self, StyleTable table)
        void
        OGR_DS_SetStyleTable(OGRDataSourceH hDS, OGRStyleTableH hStyleTable)

        Set style table. 
        )r   DataSource_SetStyleTabler   s     r   SetStyleTablezDataSource.SetStyleTable  rD  r#   c                 4    t        j                  | g|i |S )z<StartTransaction(DataSource self, int force=FALSE) -> OGRErr)r   DataSource_StartTransactionr   s      r   StartTransactionzDataSource.StartTransaction  s    //FtFvFFr#   c                 .    t        j                  | g| S )z,CommitTransaction(DataSource self) -> OGRErr)r   DataSource_CommitTransactionr   s     r   CommitTransactionzDataSource.CommitTransaction  r   r#   c                 .    t        j                  | g| S )z.RollbackTransaction(DataSource self) -> OGRErr)r   DataSource_RollbackTransactionr   s     r   RollbackTransactionzDataSource.RollbackTransaction  s    224?$??r#   c                 j    t        j                  |        d| _        d| _        | j	                          yzbOnce called, self has effectively been destroyed.  Do not access. For backwards compatibility onlyr   Nr   delete_DataSourcer   r
   r   r   s    r   DestroyzDataSource.Destroy  *    
T"dldi
r#   c                 j    t        j                  |        d| _        d| _        | j	                          yrR  rS  rU  s    r   ReleasezDataSource.Release  rW  r#   c                 "    | j                         S )!For backwards compatibility only.)	ReferencerU  s    r   r\  zDataSource.Reference  s    ^^r#   c                 $    | j                          yr[  N)DereferencerU  s    r   r_  zDataSource.Dereference  s    
r#   c                 "    | j                         S )z.Returns the number of layers on the datasource)r  rU  s    r   __len__zDataSource.__len__  s    !!##r#   c                     | S r-   r$   rU  s    r   rW   zDataSource.__enter__  s    r#   c                 $    | j                          y r-   )r   r   s     r   r\   zDataSource.__exit__  s    

r#   c                 $    | j                          y r-   )r   rU  s    r   __del__zDataSource.__del__	  s    !r#   c                    t        |t              rlg }|j                  r|j                  nd}t        |j                  |j
                  |      D ]*  }| j                  |      }||c S |j                  |       , |S t        |t              r(|t        |       dz
  kD  rt        | j                  |      S t        |t              r| j                  |      S t        dt        |      z        )zSupport dictionary, list, and slice -like access to the datasource.
        ds[0] would return the first layer on the datasource.
        ds['aname'] would return the layer named "aname".
        ds[0:4] would return a list of the first four layers.r   r  )r   slicestepr  startstopr  appendr  len
IndexErrorr  r  r   )r   r    outputrh  r  r  s         r   __getitem__zDataSource.__getitem__  s    
 eU#F!&5::D5;;

D9 #mmA&;!Mc"	#
 MeS!s4y1}$  ==''s#==''Cd5kQRRr#   c                     t                t        |t              r| j                  t        |            S t        |t              r| j                  |      S t        dt        |      z        )z)Return the layer given an index or a namer  )rp   r   r  r+  r  r(  r  r   )r   iLayers     r   r  zDataSource.GetLayer#  sY     	45fc"&&s6{33$''//Cd6lRSSr#   c                 N    t        | d      r| j                  D ]	  }d |_         y y )N_layer_references)r   rs  r
   )r   r  s     r   r   zDataSource._invalidate_layers/  s.    4,---    .r#   c                     |sy t        | d      sdd l}|j                         | _        | j                  j	                  |       y )Nrs  r   )r   r0  WeakSetrs  add)r   r  r0  s      r   r   zDataSource._add_layer_ref5  s9    t01%,__%6D"""3'r#   returnOGRErr)Nr   F)r   r-   )0r   r   r6   r7   r   r   rP   r   r   r   DataSource_name_getr   rT  r   r   r   r  r  r	  r   r  r  r  r"  r%  r(  r+  r   r:  r=  r@  rC  rG  rJ  rM  rP  rV  rY  r\  r_  ra  rW   r\   re  ro  r  r   r   r$   r#   r   r   r     s     -/IOdeG7HD,,2OPD--.8?:0684:SB
770f)X!H);VER5 .::G>@
  $"S.
T 	(r#   r   c                   ^    e Zd ZdZ ed d d      ZeZd Ze	j                  Zd Zd Zd	 Zy
)
ArrowArrayzProxy of C++ ArrowArray class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zArrowArray.<lambda>F  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zArrowArray.<lambda>F  r|   r#   r}   r~   c                 P    t        j                  | t        j                  |        y)z'__init__(ArrowArray self) -> ArrowArrayN)r   ArrowArray_swiginitnew_ArrowArrayr   s     r   rP   zArrowArray.__init__I  r   r#   c                 .    t        j                  | g| S )z)_getPtr(ArrowArray self) -> VoidPtrAsLong)r   ArrowArray__getPtrr   s     r   _getPtrzArrowArray._getPtrN      &&t3d33r#   c                 .    t        j                  | g| S )z,GetChildrenCount(ArrowArray self) -> GIntBig)r   ArrowArray_GetChildrenCountr   s     r   GetChildrenCountzArrowArray.GetChildrenCountR  r   r#   c                 .    t        j                  | g| S )z%GetLength(ArrowArray self) -> GIntBig)r   ArrowArray_GetLengthr   s     r   	GetLengthzArrowArray.GetLengthV      ((555r#   N)r   r   r6   r7   r   r   r   r   rP   r   delete_ArrowArrayr   r  r  r  r$   r#   r   r|  r|  C  s>    )-/IOdeGHC --4=6r#   r|  c                   d    e Zd ZdZ ed d d      ZeZd Ze	j                  Zd Zd Zd	 Zd
 Zy)ArrowSchemazProxy of C++ ArrowSchema class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zArrowSchema.<lambda>_  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zArrowSchema.<lambda>_  r|   r#   r}   r~   c                 P    t        j                  | t        j                  |        y)z)__init__(ArrowSchema self) -> ArrowSchemaN)r   ArrowSchema_swiginitnew_ArrowSchemar   s     r   rP   zArrowSchema.__init__b  s    !!$(<(<d(CDr#   c                 .    t        j                  | g| S )z*_getPtr(ArrowSchema self) -> VoidPtrAsLong)r   ArrowSchema__getPtrr   s     r   r  zArrowSchema._getPtrg  r   r#   c                 .    t        j                  | g| S )z)GetName(ArrowSchema self) -> char const *)r   ArrowSchema_GetNamer   s     r   r   zArrowSchema.GetNamek  r   r#   c                 .    t        j                  | g| S )z-GetChildrenCount(ArrowSchema self) -> GIntBig)r   ArrowSchema_GetChildrenCountr   s     r   r  zArrowSchema.GetChildrenCounto  r   r#   c                 .    t        j                  | g| S )z5GetChild(ArrowSchema self, int iChild) -> ArrowSchema)r   ArrowSchema_GetChildr   s     r   GetChildzArrowSchema.GetChilds  r  r#   N)r   r   r6   r7   r   r   r   r   rP   r   delete_ArrowSchemar   r  r   r  r  r$   r#   r   r  r  \  sC    *-/IOdeGHE ..55>6r#   r  c                   X    e Zd ZdZ ed d d      Zd ZeZe	j                  Zd Zd Zy	)
ArrowArrayStreamz$Proxy of C++ ArrowArrayStream class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zArrowArrayStream.<lambda>|  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zArrowArrayStream.<lambda>|  r|   r#   r}   r~   c                     t        d      r   r   r   s      r   rP   zArrowArrayStream.__init__~  r   r#   c                 .    t        j                  | g| S )z/GetSchema(ArrowArrayStream self) -> ArrowSchema)r   ArrowArrayStream_GetSchemar   s     r   	GetSchemazArrowArrayStream.GetSchema  r   r#   c                 .    t        j                  | g| S )zMGetNextRecordBatch(ArrowArrayStream self, char ** options=None) -> ArrowArray)r   #ArrowArrayStream_GetNextRecordBatchr   s     r   GetNextRecordBatchz#ArrowArrayStream.GetNextRecordBatch  s    77DtDDr#   N)r   r   r6   r7   r   r   rP   r   r   r   delete_ArrowArrayStreamr   r  r  r$   r#   r   r  r  y  s7    /-/IOdeG7H33<Er#   r  c                      e Zd ZdZ ed d d      Zd ZeZd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d  Z"d! Z#d" Z$d# Z%d$ Z&d% Z'd& Z(d' Z)d( Z*d) Z+d* Z,d+ Z-d, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBeBZCdA ZDdB ZEdC ZFdD ZGdE ZHdF ZI eeI      ZIg fdGZJg fdHZKg fdIZLg fdJZMg fdKZNyL)MLayerz"Proxy of C++ OGRLayerShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zLayer.<lambda>  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zLayer.<lambda>  r|   r#   r}   r~   c                     t        d      r   r   r   s      r   rP   zLayer.__init__  r   r#   c                 .    t        j                  | g| S )z3Rename(Layer self, char const * new_name) -> OGRErr)r   Layer_Renamer   s     r   RenamezLayer.Rename  s      ---r#   c                 .    t        j                  | g| S )zj
        GetRefCount(Layer self) -> int

        For more details: :cpp:func:`OGR_L_GetRefCount`

        )r   Layer_GetRefCountr   s     r   r   zLayer.GetRefCount  s     %%d2T22r#   c                 .    t        j                  | g| S )a  
        SetSpatialFilter(Layer self, Geometry filter)
        SetSpatialFilter(Layer self, int iGeomField, Geometry filter)

        Set a new spatial filter.

        For more details:

        - :cpp:func:`OGR_L_SetSpatialFilter`
        - :cpp:func:`OGR_L_SetSpatialFilterEx`

        Parameters
        -----------
        iGeomField: int, optional
            index of the geometry field on which the spatial filter operates.
        filter: Geometry
            The geometry to use as a filtering region. None may
            be passed indicating that the current spatial filter should be
            cleared, but no new one instituted.

        )r   Layer_SetSpatialFilterr   s     r   SetSpatialFilterzLayer.SetSpatialFilter      , **47$77r#   c                 .    t        j                  | g| S )ao  
        SetSpatialFilterRect(Layer self, double minx, double miny, double maxx, double maxy)
        SetSpatialFilterRect(Layer self, int iGeomField, double minx, double miny, double maxx, double maxy)

        Set a new rectangular spatial filter.

        For more details:

        - :cpp:func:`OGR_L_SetSpatialFilterRect`
        - :cpp:func:`OGR_L_SetSpatialFilterRectEx`

        Parameters
        -----------
        iGeomField: int, optional
            index of the geometry field on which the spatial filter operates.
        minx: float
            the minimum X coordinate for the rectangular region.
        miny: float
            the minimum Y coordinate for the rectangular region.
        maxx: float
            the maximum X coordinate for the rectangular region.
        maxy: float
            the maximum Y coordinate for the rectangular region.

        )r   Layer_SetSpatialFilterRectr   s     r   SetSpatialFilterRectzLayer.SetSpatialFilterRect  s    4 ..t;d;;r#   c                 .    t        j                  | g| S )a   
        GetSpatialFilter(Layer self) -> Geometry

        This function returns the current spatial filter for this layer.

        For more details: :cpp:func:`OGR_L_GetSpatialFilter`

        Returns
        --------
        Geometry:
            The spatial filter geometry.

        )r   Layer_GetSpatialFilterr   s     r   GetSpatialFilterzLayer.GetSpatialFilter       **47$77r#   c                 .    t        j                  | g| S )a>  
        SetAttributeFilter(Layer self, char * filter_string) -> OGRErr

        Set a new attribute query.

        For more details: :cpp:func:`OGR_L_SetAttributeFilter`

        Parameters
        -----------
        filter_string: str
            query in restricted SQL WHERE format, or None to clear the
            current query.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` if successfully installed,
            or an error code if the query expression is in error,
            or some other failure occurs.

        )r   Layer_SetAttributeFilterr   s     r   SetAttributeFilterzLayer.SetAttributeFilter  r  r#   c                 .    t        j                  | g| S )z
        ResetReading(Layer self)

        Reset feature reading to start on the first feature.

        For more details: :cpp:func:`OGR_L_ResetReading`

        )r   Layer_ResetReadingr   s     r   ResetReadingzLayer.ResetReading  s     &&t3d33r#   c                 .    t        j                  | g| S )z
        GetName(Layer self) -> char const *

        Return the layer name.

        For more details: :cpp:func:`OGR_L_GetName`

        Returns
        --------
        str:
            The layer name

        )r   Layer_GetNamer   s     r   r   zLayer.GetName
  s     !!$...r#   c                 .    t        j                  | g| S )ac  
        GetGeomType(Layer self) -> OGRwkbGeometryType

        Return the layer geometry type.

        For more details: :cpp:func:`OGR_L_GetGeomType`

        Returns
        --------
        int:
            The geometry type code. The types can be found with
            'osgeo.ogr.wkb' prefix. For example :py:const:`osgeo.ogr.wkbPolygon`.

        )r   Layer_GetGeomTyper   s     r   GetGeomTypezLayer.GetGeomType  s     %%d2T22r#   c                 .    t        j                  | g| S )a[  
        GetGeometryColumn(Layer self) -> char const *

        This method returns the name of the underlying database column being
        used as the geometry column, or '' if not supported.

        For more details: :cpp:func:`OGR_L_GetGeometryColumn`

        Returns
        --------
        str:
            geometry column name.

        )r   Layer_GetGeometryColumnr   s     r   GetGeometryColumnzLayer.GetGeometryColumn+  s     ++D8488r#   c                 .    t        j                  | g| S )aG  
        GetFIDColumn(Layer self) -> char const *

        This method returns the name of the underlying database column being
        used as the FID column, or '' if not supported.

        For more details: :cpp:func:`OGR_L_GetFIDColumn`

        Returns
        --------
        str:
            fid column name.

        )r   Layer_GetFIDColumnr   s     r   GetFIDColumnzLayer.GetFIDColumn<  s     &&t3d33r#   c                 .    t        j                  | g| S )a]  
        GetFeature(Layer self, GIntBig fid) -> Feature

        Fetch a feature by its identifier.

        For more details: :cpp:func:`OGR_L_GetFeature`

        Use :py:func:`TestCapability` with (:py:const:`osgeo.ogr.OLCRandomRead`)
        to establish if this layer supports efficient random access reading via
        :py:func:`GetFeature`; However, the call should always work if the feature exists.

        Sequential reads (with :py:func:`GetNextFeature`) are generally
        considered interrupted by a :py:func:`GetFeature` call.

        Parameters
        -----------
        fid: int
            The feature id of the feature to read.

        Returns
        --------
        Feature:
            A new feature now owned by the caller, or None on failure.
            The returned feature should be deleted with :py:func:`Destroy`.

        )r   Layer_GetFeaturer   s     r   
GetFeaturezLayer.GetFeatureM  s    6 $$T1D11r#   c                 .    t        j                  | g| S )a#  
        GetNextFeature(Layer self) -> Feature

        Fetch the next available feature from this layer.

        For more details: :cpp:func:`OGR_L_GetNextFeature`

        Returns
        --------
        Feature:
            A feature or None if no more features are available.

        )r   Layer_GetNextFeaturer   s     r   GetNextFeaturezLayer.GetNextFeaturej       ((555r#   c                 .    t        j                  | g| S )a  
        SetNextByIndex(Layer self, GIntBig new_index) -> OGRErr

        Move read cursor to the nIndex'th feature in the current resultset.

        For more details: :cpp:func:`OGR_L_SetNextByIndex`

        Parameters
        -----------
        new_index: int
            The index indicating how many steps into the result set to seek.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success or an error code.

        )r   Layer_SetNextByIndexr   s     r   SetNextByIndexzLayer.SetNextByIndexz      & ((555r#   c                 .    t        j                  | g| S )a{  
        SetFeature(Layer self, Feature feature) -> OGRErr

        Rewrite an existing feature.

        For more details: :cpp:func:`OGR_L_SetFeature`

        To set a feature, but create it if it doesn't exist see :py:meth:`.Layer.UpsertFeature`.

        Parameters
        -----------
        feature: Feature
            The feature to write.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` if the operation works,
            otherwise an appropriate error code
            (e.g :py:const:`osgeo.ogr.OGRERR_NON_EXISTING_FEATURE` if the
            feature does not exist).

        )r   Layer_SetFeaturer   s     r   
SetFeaturezLayer.SetFeature  s    0 $$T1D11r#   c                 .    t        j                  | g| S )a  
        CreateFeature(Layer self, Feature feature) -> OGRErr

        Create and write a new feature within a layer.

        For more details: :cpp:func:`OGR_L_CreateFeature`

        To create a feature, but set it if it exists see :py:meth:`.Layer.UpsertFeature`.

        Parameters
        -----------
        feature: Feature
            The feature to write to disk.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_CreateFeaturer   s     r   CreateFeaturezLayer.CreateFeature      * ''4t44r#   c                 .    t        j                  | g| S )a  
        UpsertFeature(Layer self, Feature feature) -> OGRErr

        Rewrite an existing feature or create a new feature within a layer.

        For more details: :cpp:func:`OGR_L_UpsertFeature`

        Parameters
        -----------
        feature: Feature
            The feature to write to disk.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_UpsertFeaturer   s     r   UpsertFeaturezLayer.UpsertFeature      & ''4t44r#   c                 .    t        j                  | g| S )zUpdateFeature(Layer self, Feature feature, int nUpdatedFieldsCount, int nUpdatedGeomFieldsCount, bool bUpdateStyleString) -> OGRErr)r   Layer_UpdateFeaturer   s     r   UpdateFeaturezLayer.UpdateFeature  r   r#   c                 .    t        j                  | g| S )a'  
        DeleteFeature(Layer self, GIntBig fid) -> OGRErr

        Delete feature from layer.

        For more details: :cpp:func:`OGR_L_DeleteFeature`

        Parameters
        -----------
        fid: int
            The feature id to be deleted from the layer

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` if the operation works,
            otherwise an appropriate error code
            (e.g :py:const:`osgeo.ogr.OGRERR_NON_EXISTING_FEATURE`)
            if the feature does not exist.

        )r   Layer_DeleteFeaturer   s     r   DeleteFeaturezLayer.DeleteFeature  s    , ''4t44r#   c                 .    t        j                  | g| S )a;  
        SyncToDisk(Layer self) -> OGRErr

        Flush pending changes to disk.

        For more details: :cpp:func:`OGR_L_SyncToDisk`

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` if no error occurs
            (even if nothing is done) or an error code.

        )r   Layer_SyncToDiskr   s     r   r  zLayer.SyncToDisk  s     $$T1D11r#   c                 .    t        j                  | g| S )a  
        GetLayerDefn(Layer self) -> FeatureDefn

        Fetch the schema information for this layer.

        For more details: :cpp:func:`OGR_L_GetLayerDefn`

        Returns
        --------
        FeatureDefn:
            The feature definition.

        )r   Layer_GetLayerDefnr   s     r   GetLayerDefnzLayer.GetLayerDefn  s     &&t3d33r#   c                 4    t        j                  | g|i |S )a  
        GetFeatureCount(Layer self, int force=1) -> GIntBig

        Fetch the feature count in this layer.

        For more details: :cpp:func:`OGR_L_GetFeatureCount`

        Parameters
        -----------
        force: int
            Flag indicating whether the count should be computed even if
            it is expensive.

        Returns
        --------
        int:
            Feature count, -1 if count not known.

        )r   Layer_GetFeatureCountr   s      r   GetFeatureCountzLayer.GetFeatureCount  s    ( ))$@@@@r#   c                 4    t        j                  | g|i |S )a  
        GetExtent(Layer self, int force=1, int can_return_null=0, int geom_field=0)

        Fetch the extent of this layer.

        For more details:

        - :cpp:func:`OGR_L_GetExtent`
        - :cpp:func:`OGR_L_GetExtentEx`

        .. warning:: Check the return order of the bounds.

        Parameters
        -----------
        force: int, default=False
            Flag indicating whether the extent should be computed even if
            it is expensive.
        can_return_null: int, default=False
            Whether None can be returned in the response.
        geom_field: int, default=0
            Ithe index of the geometry field on which to compute the extent.
            Can be iterated over using :py:func:`range` and :py:func:`GetGeomFieldCount`.

        Returns
        --------
        minx: float
        maxx: float
        miny: float
        maxy: float

        )r   Layer_GetExtentr   s      r   	GetExtentzLayer.GetExtent(  s     @ ##D:4:6::r#   c                 .    t        j                  | g| S )ac  
        TestCapability(Layer self, char const * cap) -> bool

        Test if this layer supported the named capability.

        For more details: :cpp:func:`OGR_L_TestCapability`

        Parameters
        -----------
        cap: str
            The name of the capability to test. These can
            be found in the `osgeo.ogr` namespace. For example,
            :py:const:`osgeo.ogr.OLCRandomRead`.

        Returns
        --------
        int:
            True if the layer has the requested capability, or False otherwise.
            Will return False for any unrecognized capabilities.

        )r   Layer_TestCapabilityr   s     r   r   zLayer.TestCapabilityJ      , ((555r#   c                 4    t        j                  | g|i |S )aL  
        CreateField(Layer self, FieldDefn field_def, int approx_ok=1) -> OGRErr

        Create a new field on a layer.

        For more details: :cpp:func:`OGR_L_CreateField`

        Parameters
        -----------
        field_def: FieldDefn
            The field definition to write to disk.
        approx_ok: bool, default=True
            If True, the field may be created in a slightly different
            form depending on the limitations of the format driver.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_CreateFieldr   s      r   CreateFieldzLayer.CreateFieldb  s    , %%d<T<V<<r#   c                 .    t        j                  | g| S )av  
        DeleteField(Layer self, int iField) -> OGRErr

        Delete an existing field on a layer.

        For more details: :cpp:func:`OGR_L_DeleteField`

        Parameters
        -----------
        iField: int
            index of the field to delete.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_DeleteFieldr   s     r   DeleteFieldzLayer.DeleteFieldz      & %%d2T22r#   c                 .    t        j                  | g| S )aZ  
        ReorderField(Layer self, int iOldFieldPos, int iNewFieldPos) -> OGRErr

        Reorder an existing field on a layer.

        For more details: :cpp:func:`OGR_L_ReorderField`

        Parameters
        -----------
        iOldFieldPos: int
            previous position of the field to move. Must be in the
            range [0,GetFieldCount()-1].
        iNewFieldPos: int
            new position of the field to move. Must be in the range
            [0,GetFieldCount()-1].

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_ReorderFieldr   s     r   ReorderFieldzLayer.ReorderField      . &&t3d33r#   c                 .    t        j                  | g| S )a  
        ReorderFields(Layer self, int nList) -> OGRErr

        Reorder all the fields of a layer.

        For more details: :cpp:func:`OGR_L_ReorderFields`

        Parameters
        -----------
        nList: list[int]
            A list of GetLayerDefn().GetFieldCount()
            elements which is a permutation of
            [0, GetLayerDefn().GetFieldCount()-1].

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_ReorderFieldsr   s     r   ReorderFieldszLayer.ReorderFields  r  r#   c                 .    t        j                  | g| S )a  
        AlterFieldDefn(Layer self, int iField, FieldDefn field_def, int nFlags) -> OGRErr

        Alter the definition of an existing field on a layer.

        For more details: :cpp:func:`OGR_L_AlterFieldDefn`

        Parameters
        -----------
        iField: int
            index of the field whose definition must be altered.
        field_def: FieldDefn
            new field definition
        nFlags: int
            Combination of
            :py:const:`osgeo.ogr.ALTER_NAME_FLAG`,
            :py:const:`osgeo.ogr.ALTER_TYPE_FLAG`,
            :py:const:`osgeo.ogr.ALTER_WIDTH_PRECISION_FLAG`,
            :py:const:`osgeo.ogr.ALTER_NULLABLE_FLAG` and
            :py:const:`osgeo.ogr.ALTER_DEFAULT_FLAG`
            to indicate which of the name and/or type and/or width and precision
            fields and/or nullability from the new field definition must be taken
            into account.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_AlterFieldDefnr   s     r   AlterFieldDefnzLayer.AlterFieldDefn      > ((555r#   c                 .    t        j                  | g| S )z]AlterGeomFieldDefn(Layer self, int iGeomField, GeomFieldDefn field_def, int nFlags) -> OGRErr)r   Layer_AlterGeomFieldDefnr   s     r   AlterGeomFieldDefnzLayer.AlterGeomFieldDefn      ,,T9D99r#   c                 4    t        j                  | g|i |S )an  
        CreateGeomField(Layer self, GeomFieldDefn field_def, int approx_ok=1) -> OGRErr

        Create a new geometry field on a layer.

        For more details: :cpp:func:`OGR_L_CreateGeomField`

        Parameters
        -----------
        field_def: GeomFieldDefn
            The geometry field definition to write to disk.
        approx_ok: bool, default=True
            If True, the field may be created in a slightly different
            form depending on the limitations of the format driver.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_CreateGeomFieldr   s      r   CreateGeomFieldzLayer.CreateGeomField  s    , ))$@@@@r#   c                 .    t        j                  | g| S )a1  
        StartTransaction(Layer self) -> OGRErr

        For datasources which support transactions, this creates a transaction.

        For more details: :cpp:func:`OGR_L_StartTransaction`

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_StartTransactionr   s     r   rJ  zLayer.StartTransaction  r  r#   c                 .    t        j                  | g| S )a3  
        CommitTransaction(Layer self) -> OGRErr

        For datasources which support transactions, this commits a transaction.

        For more details: :cpp:func:`OGR_L_CommitTransaction`

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_CommitTransactionr   s     r   rM  zLayer.CommitTransaction       ++D8488r#   c                 .    t        j                  | g| S )a@  
        RollbackTransaction(Layer self) -> OGRErr

        Roll back a datasource to its state before the start of the current transaction.

        For more details: :cpp:func:`OGR_L_RollbackTransaction`

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success.

        )r   Layer_RollbackTransactionr   s     r   rP  zLayer.RollbackTransaction  s     --d:T::r#   c                 .    t        j                  | g| S )a2  
        FindFieldIndex(Layer self, char const * pszFieldName, int bExactMatch) -> int

        Find the index of field in a layer.

        For more details: :cpp:func:`OGR_L_FindFieldIndex`

        Returns
        --------
        int:
            field index, or -1 if the field doesn't exist

        )r   Layer_FindFieldIndexr   s     r   FindFieldIndexzLayer.FindFieldIndex,  r  r#   c                 .    t        j                  | g| S )a.  
        GetSpatialRef(Layer self) -> SpatialReference

        Fetch the spatial reference system for this layer.

        For more details: :cpp:func:`OGR_L_GetSpatialRef`

        Returns
        --------
        SpatialReference:
            spatial reference, or None if there isn't one.

        )r   Layer_GetSpatialRefr   s     r   GetSpatialRefzLayer.GetSpatialRef<       ''4t44r#   c                 .    t        j                  | g| S )zv
        GetFeaturesRead(Layer self) -> GIntBig

        For more details: :cpp:func:`OGR_L_GetFeaturesRead`

        )r   Layer_GetFeaturesReadr   s     r   GetFeaturesReadzLayer.GetFeaturesReadL  s     ))$666r#   c                 .    t        j                  | g| S )aS  
        SetIgnoredFields(Layer self, char const ** options) -> OGRErr

        Set which fields can be omitted when retrieving features from the
        layer.

        For more details: :cpp:func:`OGR_L_SetIgnoredFields`

        Parameters
        -----------
        options: list[str]
            A list of field names.
            If an empty list is passed, the ignored list is cleared.

        Returns
        -------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` if all field names have been resolved
            (even if the driver does not support this method)

        )r   Layer_SetIgnoredFieldsr   s     r   SetIgnoredFieldszLayer.SetIgnoredFieldsU  r  r#   c                 4    t        j                  | g|i |S )a-  
        Intersection(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr

        Intersection of two layers.

        For more details: :cpp:func:`OGR_L_Intersection`

        Parameters
        -----------
        method_layer: Layer
            the method layer. Should not be None.
        result_layer: Layer
            the layer where the features resulting from the
            operation are inserted. Should not be None.
        options: list[str], optional
            List of options (empty list is allowed). For example ["PROMOTE_TO_MULTI=YES"].
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            reporting progress or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        int:
            An error code if there was an error or the execution was interrupted,
            :py:const:`osgeo.ogr.OGRERR_NONE` otherwise.

        )r   Layer_Intersectionr   s      r   IntersectionzLayer.Intersectionm  s    < &&t=d=f==r#   c                 4    t        j                  | g|i |S )aJ  
        Union(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr

        Union of two layers.

        For more details: :cpp:func:`OGR_L_Union`

        The first geometry field is always used.

        Parameters
        -----------
        method_layer: Layer
            the method layer. Should not be None.
        result_layer: Layer
            the layer where the features resulting from the
            operation are inserted. Should not be None.
        options: list[str], optional
            List of options (empty list is allowed). For example ["PROMOTE_TO_MULTI=YES"].
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            reporting progress or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        int:
            An error code if there was an error or the execution was interrupted,
            :py:const:`osgeo.ogr.OGRERR_NONE` otherwise.

        )r   Layer_Unionr   s      r   UnionzLayer.Union  s     @ 6t6v66r#   c                 4    t        j                  | g|i |S )a9  
        SymDifference(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr

        Symmetrical difference of two layers.

        For more details: :cpp:func:`OGR_L_SymDifference`

        Parameters
        -----------
        method_layer: Layer
            the method layer. Should not be None.
        result_layer: Layer
            the layer where the features resulting from the
            operation are inserted. Should not be None.
        options: list[str], optional
            List of options (empty list is allowed). For example ["PROMOTE_TO_MULTI=YES"].
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            reporting progress or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        int:
            An error code if there was an error or the execution was interrupted,
            :py:const:`osgeo.ogr.OGRERR_NONE` otherwise.

        )r   Layer_SymDifferencer   s      r   SymDifferencezLayer.SymDifference  s    < ''>t>v>>r#   c                 4    t        j                  | g|i |S )aT  
        Identity(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr

        Identify the features of this layer with the ones from the identity layer.

        For more details: :cpp:func:`OGR_L_Identity`

        Parameters
        -----------
        method_layer: Layer
            the method layer. Should not be None.
        result_layer: Layer
            the layer where the features resulting from the
            operation are inserted. Should not be None.
        options: list[str], optional
            List of options (empty list is allowed). For example ["PROMOTE_TO_MULTI=YES"].
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            reporting progress or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        int:
            An error code if there was an error or the execution was interrupted,
            :py:const:`osgeo.ogr.OGRERR_NONE` otherwise.

        )r   Layer_Identityr   s      r   IdentityzLayer.Identity  s    < ""49$9&99r#   c                 4    t        j                  | g|i |S )a<  
        Update(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr

        Update this layer with features from the update layer.

        For more details: :cpp:func:`OGR_L_Update`

        Parameters
        -----------
        method_layer: Layer
            the method layer. Should not be None.
        result_layer: Layer
            the layer where the features resulting from the
            operation are inserted. Should not be None.
        options: list[str], optional
            List of options (empty list is allowed). For example ["PROMOTE_TO_MULTI=YES"].
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            reporting progress or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        int:
            An error code if there was an error or the execution was interrupted,
            :py:const:`osgeo.ogr.OGRERR_NONE` otherwise.

        )r   Layer_Updater   s      r   UpdatezLayer.Update  s    <   7777r#   c                 4    t        j                  | g|i |S )a:  
        Clip(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr

        Clip off areas that are not covered by the method layer.

        For more details: :cpp:func:`OGR_L_Clip`

        Parameters
        -----------
        method_layer: Layer
            the method layer. Should not be None.
        result_layer: Layer
            the layer where the features resulting from the
            operation are inserted. Should not be None.
        options: list[str], optional
            List of options (empty list is allowed). For example ["PROMOTE_TO_MULTI=YES"].
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            reporting progress or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        int:
            An error code if there was an error or the execution was interrupted,
            :py:const:`osgeo.ogr.OGRERR_NONE` otherwise.

        )r   
Layer_Clipr   s      r   Clipz
Layer.Clip	  s    < t5d5f55r#   c                 4    t        j                  | g|i |S )a6  
        Erase(Layer self, Layer method_layer, Layer result_layer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> OGRErr

        Remove areas that are covered by the method layer.

        For more details: :cpp:func:`OGR_L_Erase`

        Parameters
        -----------
        method_layer: Layer
            the method layer. Should not be None.
        result_layer: Layer
            the layer where the features resulting from the
            operation are inserted. Should not be None.
        options: list[str], optional
            List of options (empty list is allowed). For example ["PROMOTE_TO_MULTI=YES"].
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            reporting progress or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        int:
            An error code if there was an error or the execution was interrupted,
            :py:const:`osgeo.ogr.OGRERR_NONE` otherwise.

        )r   Layer_Eraser   s      r   ErasezLayer.Erase/	  s    < 6t6v66r#   c                 .    t        j                  | g| S )z
        GetStyleTable(Layer self) -> StyleTable

        Get style table.

        For more details: :cpp:func:`OGR_L_GetStyleTable`

        )r   Layer_GetStyleTabler   s     r   rC  zLayer.GetStyleTableO	       ''4t44r#   c                 .    t        j                  | g| S )z
        SetStyleTable(Layer self, StyleTable table)

        Set style table.

        For more details: :cpp:func:`OGR_L_SetStyleTable`

        )r   Layer_SetStyleTabler   s     r   rG  zLayer.SetStyleTableZ	  r?  r#   c                 .    t        j                  | g| S )zDGetArrowStream(Layer self, char ** options=None) -> ArrowArrayStream)r   Layer_GetArrowStreamr   s     r   GetArrowStreamzLayer.GetArrowStreame	  r  r#   c                 .    t        j                  | g| S )zLIsArrowSchemaSupported(Layer self, ArrowSchema schema, char ** options=None))r   Layer_IsArrowSchemaSupportedr   s     r   IsArrowSchemaSupportedzLayer.IsArrowSchemaSupportedi	  r   r#   c                 .    t        j                  | g| S )zZCreateFieldFromArrowSchema(Layer self, ArrowSchema schema, char ** options=None) -> OGRErr)r    Layer_CreateFieldFromArrowSchemar   s     r   CreateFieldFromArrowSchemaz Layer.CreateFieldFromArrowSchemam	  s    44TADAAr#   c                 .    t        j                  | g| S )zaWriteArrowBatch(Layer self, ArrowSchema schema, ArrowArray array, char ** options=None) -> OGRErr)r   Layer_WriteArrowBatchr   s     r   WriteArrowBatchzLayer.WriteArrowBatchq	  r   r#   c                 4    t        j                  | g|i |S )a  
        GetGeometryTypes(Layer self, int geom_field=0, int flags=0, GDALProgressFunc callback=0, void * callback_data=None)

        Get actual geometry types found in features.

        For more details: :cpp:func:`OGR_L_GetGeometryTypes`

        Parameters
        -----------
        geom_field: int, optional
            index of the geometry field
        flags: int, optional
            0, or a combination of :py:const:`osgeo.ogr.GGT_COUNT_NOT_NEEDED`,
            :py:const:`osgeo.ogr.GGT_STOP_IF_MIXED` and
            :py:const:`osgeo.ogr.GGT_GEOMCOLLECTIONZ_TINZ`
        callback: Callable, optional
            a GDALProgressFunc() compatible callback function for
            cancellation or None.
        callback_data:
            Argument to be passed to 'callback'. May be None.

        Returns
        -------
        dict:
            A dictionary whose keys are :py:const:`osgeo.ogr.wkbXXXX` constants and
            values the corresponding number of geometries of that type in the layer.

        )r   Layer_GetGeometryTypesr   s      r   GetGeometryTypeszLayer.GetGeometryTypesu	  s    : **4A$A&AAr#   c                 4    t        j                  | g|i |S )z1GetSupportedSRSList(Layer self, int geom_field=0))r   Layer_GetSupportedSRSListr   s      r   GetSupportedSRSListzLayer.GetSupportedSRSList	      --dDTDVDDr#   c                 .    t        j                  | g| S )zHSetActiveSRS(Layer self, int geom_field, SpatialReference srs) -> OGRErr)r   Layer_SetActiveSRSr   s     r   SetActiveSRSzLayer.SetActiveSRS	  r  r#   c                      yr^  r$   rU  s    r   r\  zLayer.Reference	      
r#   c                      yr^  r$   rU  s    r   r_  zLayer.Dereference	  rY  r#   c                 "    | j                         S )z+Returns the number of features in the layer)r  rU  s    r   ra  zLayer.__len__	  s    ##%%r#   c                      yNTr$   rU  s    r   __nonzero__zLayer.__nonzero__	  s    r#   c                    t        |t              rddl}g }|j                  |j                  k(  rt        |       dz
  }n|j                  }t        |j                  ||j                        D ]*  }| j                  |      }|r|j                  |       (|c S  |S t        |t              r(|t        |       dz
  kD  rt        | j                  |      S t        dt        |      z        )zSupport list and slice -like access to the layer.
        layer[0] would return the first feature on the layer.
        layer[0:4] would return a list of the first four features.r   Nr   z'Input %s is not of IntType or SliceType)r   rg  sysrj  maxsizerl  r  ri  rh  r  rk  r  rm  r  r   )r   r    r`  rn  rj  r  features          r   ro  zLayer.__getitem__	  s     eU#FzzS[[( 4y1}zz5;;ejj9 "//!,MM'*!M" MeS!s4y1}$  ??5))EUSTTr#   c                 4    |D ]  }| j                  |        y)z$Create a list of fields on the LayerN)r  )r   fieldsr  s      r   CreateFieldszLayer.CreateFields	  s     	 AQ	 r#   c                 ~    t        | d      r'| j                         | _        | j                  J | `| S t        d      )BMethod called when using Dataset.ExecuteSQL() as a context managerr3  z*__enter__() called in unexpected situation)r   r3  r4  r   rU  s    r   rW   zLayer.__enter__	  sG    4,-'+'='='?D$++777&KDEEr#   c                 X    t        | d      r| j                  j                  |        | `yy)rg  r4  N)r   r4  r@  r   s     r   r\   zLayer.__exit__	  s,    4./$$55d;( 0r#   c              #   \   K   | j                          	 | j                         }|sy | wr-   )r  r  )r   rb  s     r   __iter__zLayer.__iter__	  s3     ))+GM	 s   *,c                     g }| j                         }t        |j                               D ]"  }|j                  |j	                  |             $ |S r-   )r  r  GetFieldCountrk  GetFieldDefn)r   rn  defnns       r   schemazLayer.schema	  sN      "t))+, 	0AMM$++A./	0r#   c                 p    ddl  G fdd      }| j                  |      }|st        d       ||      S )z; Return an ArrowStream as PyArrow Schema and Array objects r   Nc                   J    e Zd Zd Z fdZ ee      Zd Zd Z fdZd Z	y)-Layer.GetArrowStreamAsPyArrow.<locals>.Streamc                      || _         d| _        y NF)streamend_of_stream)r   rv  s     r   rP   z6Layer.GetArrowStreamAsPyArrow.<locals>.Stream.__init__	  s    $%*"r#   c                     | j                   j                         }|t        d      j                  j	                  |j                               S )z) Return the schema as a PyArrow DataType zcannot get schema)rv  r  r   DataType_import_from_cr  )r   rp  pas     r   rp  z4Layer.GetArrowStreamAsPyArrow.<locals>.Stream.schema	  sD     ..0>#$788{{11&..2BCCr#   c                     | S r-   r$   rU  s    r   rW   z7Layer.GetArrowStreamAsPyArrow.<locals>.Stream.__enter__
      r#   c                      d| _         d | _        y r]  )rw  rv  r   r   r    tbs       r   r\   z6Layer.GetArrowStreamAsPyArrow.<locals>.Stream.__exit__
  s    %)""r#   c                     | j                   j                         }|yj                  j                  |j	                         | j
                        S )zS Return the next RecordBatch as a PyArrow StructArray, or None at end of iteration N)rv  r  Arrayrz  r  rp  )r   arrayr{  s     r   r  z@Layer.GetArrowStreamAsPyArrow.<locals>.Stream.GetNextRecordBatch
  s@     668=xx..u}}LLr#   c              3      K   | j                   rt        d      	 | j                         }|sn| d| _         d| _        yw)zA Return an iterator over record batches as a PyArrow StructArray %Stream has already been iterated overTNrw  r   r  rv  r   batchs     r   rj  z6Layer.GetArrowStreamAsPyArrow.<locals>.Stream.__iter__
  sM     %%#$KLL 335E K	 
 &*""s   A AN)
r   r   r6   rP   rp  r   rW   r\   r  rj  )r{  s   r   Streamrs  	  s/    +D f%F#M#r#   r  GetArrowStream() failed)pyarrowrD  r   )r   optionsr  rv  r{  s       @r   GetArrowStreamAsPyArrowzLayer.GetArrowStreamAsPyArrow	  s>     	)	# )	#V $$W-566f~r#   c                     ddl m  G fdd      }| j                  |      }|st        d      d}|D ]4  }|j	                         }|j                  d      s%|t        d      d d	v }6  |||      S )
z Return an ArrowStream as NumPy Array objects.
            A specific option to this method is USE_MASKED_ARRAYS=YES/NO (default is YES).
        r   rS   c                   0    e Zd Zd Zd Zd Z fdZd Zy)+Layer.GetArrowStreamAsNumPy.<locals>.Streamc                 X    || _         |j                         | _        d| _        || _        y ru  )rv  r  rp  rw  use_masked_arrays)r   rv  r  s      r   rP   z4Layer.GetArrowStreamAsNumPy.<locals>.Stream.__init__/
  s)    $$..0%*"):&r#   c                     | S r-   r$   rU  s    r   rW   z5Layer.GetArrowStreamAsNumPy.<locals>.Stream.__enter__5
  r}  r#   c                 .    d| _         d | _        d | _        y r]  )rw  rp  rv  r  s       r   r\   z4Layer.GetArrowStreamAsNumPy.<locals>.Stream.__exit__8
  s    %)"""r#   c                    | j                   j                         }|yj                  |j                         | j                  j                         |      }|j                          |S |j                         D ]L  \  }}t        |t              s| j                  r"ddl
m} |j                  |d   |d         ||<   E|d   ||<   N |S )zZ Return the next RecordBatch as a dictionary of Numpy arrays, or None at end of iteration Nr   datamask)rv  r  _RecordBatchAsNumpyr  rp  _RaiseExceptionitemsr   dictr  numpy.mamamasked_array)r   r  retkeyr   r  rT   s         r   r  z>Layer.GetArrowStreamAsNumPy.<locals>.Stream.GetNextRecordBatch=
  s     668= 44U]]_59[[5H5H5J5:< ;..0J #		 3HC!#t,111')s6{CK'PCH'*6{CH3 
r#   c              3      K   | j                   rt        d      	 	 | j                         }|sn| 	 d| _         d| _        y# d| _         d| _        w xY ww)zH Return an iterator over record batches as a dictionary of Numpy arrays r  TNr  r  s     r   rj  z4Layer.GetArrowStreamAsNumPy.<locals>.Stream.__iter__S
  sk      %%#$KLL' $ 7 7 9$!#	  " *.D&"&DK *.D&"&DKs   AA AAAN)r   r   r6   rP   rW   r\   r  rj  rS   s   r   r  r  .
  s    ;#
,'r#   r  r  TzUSE_MASKED_ARRAYS=N)YESTRUEON1)osgeorT   rD  r   upper
startswithrl  )r   r  r  rv  r  optrT   s         @r   GetArrowStreamAsNumPyzLayer.GetArrowStreamAsNumPy'
  s    
 	%3	' 3	'j $$W-566  	bC))+C~~23$',@(A(B$CGa$a!	b
 f/00r#   c                     ddl }t               }|j                  |j                                | j	                  ||      S )zReturns whether the passed pyarrow Schema is supported by the layer, as a tuple (success: bool, errorMsg: str).

           This may be used as a preliminary check before calling WritePyArrowBatch()
        r   N)r  r  _export_to_cr  rG  r   	pa_schemar  r{  rp  s        r   IsPyArrowSchemaSupportedzLayer.IsPyArrowSchemaSupportedp
  s6     	v~~/0**67;;r#   c                     ddl }t               }|j                  |j                                | j	                  ||      S )z.Create a field from the passed pyarrow Schema.r   N)r  r  r  r  rJ  r  s        r   CreateFieldFromPyArrowSchemaz"Layer.CreateFieldFromPyArrowSchema|
  s6     	v~~/0..vw??r#   c                    ddl }t        |d      r=|j                         D ]$  }| j                  ||      t        k7  st
        c S  t        S t        |d      rZt        |d      rN|j                  j                  |j                  |j                  j                        }| j                  ||      S t               }t               }|j                  |j                         |j                                | j                  |||      S )zWrite the content of the passed PyArrow batch (either a pyarrow.Table, a pyarrow.RecordBatch or a pyarrow.StructArray) into the layer.r   N
to_batchesr  columnsrp  )names)r  r   r  WritePyArrowOGRERR_NONEOGRERR_FAILUREStructArrayfrom_arraysr  rp  r  r  r|  r  r  rM  )r   pa_batchr  r{  r  r  rp  s          r   r  zLayer.WritePyArrow
  s     	 8\*!,,. *$$UG$<K))*  8Y'GHh,GNN..x/?/?xG\G\.]E$$UG$<< emmov~~/?@##FE7;;r#   N)Or   r   r6   r7   r   r   rP   r   r   r  r   r  r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r   r  r  r  r  r  rJ  rM  rP  r  r   r$  r'  r*  r-  r0  r3  r6  r9  r<  rC  rG  rD  rG  rJ  rM  rP  rS  rW  r\  r_  ra  r^  __bool__ro  re  rW   r\   rj  rp  r  r  r  r  r  r$   r#   r   r  r    s   --/IOdeG7H.380<88 :0	4/ 3"9"4"2:6 6*245.5*5502"4 A, ;D60=03*425.6B:A08 9 ; 6 5 780>@ 7D?@:@8@6@7@	5	56>B7B>E4& HU8 
F) fF 13 3l /1 F1R ;= 	< ?A @ .0 <r#   r  c                   $    e Zd ZdZ ed d d      ZeZej                  Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d Z$d  Z%d! Z&d" Z'd# Z(d$ Z)d% Z*d& Z+d' Z,d( Z-d) Z.d* Z/dSd+Z0d, Z1d- Z2d. Z3d/ Z4d0 Z5d1 Z6d2 Z7d3 Z8d4 Z9d5 Z:d6 Z;d7 Z<d8 Z=d9 Z>d: Z?d; Z@d< ZAd= ZBd> ZCd? ZDd@ ZEdA ZFdB ZGdC ZHdD ZI fdEZJdF ZKdG ZLdH ZMdI ZNdJ ZOdK ZPdL ZQdM ZRdN ZSdO ZdTdPZTdQ ZUdR ZV xZWS )UFeaturez$Proxy of C++ OGRFeatureShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zFeature.<lambda>
  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zFeature.<lambda>
  r|   r#   r}   r~   c                 V    t        j                  | t        j                  |i |       y)z:__init__(Feature self, FeatureDefn feature_def) -> FeatureN)r   Feature_swiginitnew_Featurer   s      r   rP   zFeature.__init__
  s"    dD$4$4d$Ef$EFr#   c                 .    t        j                  | g| S )a  
        GetDefnRef(Feature self) -> FeatureDefn

        OGRFeatureDefnH OGR_F_GetDefnRef(OGRFeatureH hFeat)

        Fetch feature definition.

        This function is the same as the C++ method OGRFeature::GetDefnRef().

        Parameters
        -----------
        hFeat:
            handle to the feature to get the feature definition from.

        Returns
        --------
        OGRFeatureDefnH:
            a handle to the feature definition object on which feature depends.

        )r   Feature_GetDefnRefr   s     r   
GetDefnRefzFeature.GetDefnRef
  s    * &&t3d33r#   c                 .    t        j                  | g| S )a  
        SetGeometry(Feature self, Geometry geom) -> OGRErr

        OGRErr OGR_F_SetGeometry(OGRFeatureH hFeat, OGRGeometryH hGeom)

        Set feature geometry.

        This function updates the features geometry, and operate exactly as
        SetGeometryDirectly(), except that this function does not assume
        ownership of the passed geometry, but instead makes a copy of it.

        This function is the same as the C++ OGRFeature::SetGeometry().

        This method has only an effect on the in-memory feature object. If
        this object comes from a layer and the modifications must be
        serialized back to the datasource, OGR_L_SetFeature() must be used
        afterwards. Or if this is a new feature, OGR_L_CreateFeature() must be
        used afterwards.

        Parameters
        -----------
        hFeat:
            handle to the feature on which new geometry is applied to.
        hGeom:
            handle to the new geometry to apply to feature.

        Returns
        --------
        OGRErr:
            OGRERR_NONE if successful, or OGR_UNSUPPORTED_GEOMETRY_TYPE if the
            geometry type is illegal for the OGRFeatureDefn (checking not yet
            implemented).

        )r   Feature_SetGeometryr   s     r   SetGeometryzFeature.SetGeometry
  s    F ''4t44r#   c                 f    t        j                  | |      }|t        k(  r| j                  |       |S r-   )r   Feature_SetGeometryDirectlyr  _add_geom_ref)r   geomr  s      r   SetGeometryDirectlyzFeature.SetGeometryDirectly
  s/    ..tT:+t$
r#   c                 T    t        j                  | g| }| j                  |       |S )a  
        GetGeometryRef(Feature self) -> Geometry

        Return the feature geometry

        The lifetime of the returned geometry is bound to the one of its belonging
        feature.

        For more details: :cpp:func:`OGR_F_GetGeometryRef`

        The geometry() method is also available as an alias of GetGeometryRef()

        Returns
        --------
        Geometry:
            the geometry, or None.

        )r   Feature_GetGeometryRefr  r   s      r   GetGeometryRefzFeature.GetGeometryRef
  s.    & ))$663 
r#   c                 .    t        j                  | g| S )aP  
        SetGeomField(Feature self, int iField, Geometry geom) -> OGRErr
        SetGeomField(Feature self, char const * field_name, Geometry geom) -> OGRErr
        OGRErr
        OGR_F_SetGeomField(OGRFeatureH hFeat, int iField, OGRGeometryH hGeom)

        Set feature geometry of a specified geometry field.

        This function updates the features geometry, and operate exactly as
        SetGeometryDirectly(), except that this function does not assume
        ownership of the passed geometry, but instead makes a copy of it.

        This function is the same as the C++ OGRFeature::SetGeomField().

        Parameters
        -----------
        hFeat:
            handle to the feature on which new geometry is applied to.
        iField:
            geometry field to set.
        hGeom:
            handle to the new geometry to apply to feature.

        Returns
        --------
        OGRErr:
            OGRERR_NONE if successful, or OGR_UNSUPPORTED_GEOMETRY_TYPE if the
            geometry type is illegal for the OGRFeatureDefn (checking not yet
            implemented).

        )r   Feature_SetGeomFieldr   s     r   SetGeomFieldzFeature.SetGeomField
  s    @ ((555r#   c                 h    t        j                  | ||      }|t        k(  r| j                  |       |S r-   )r   Feature_SetGeomFieldDirectlyr  r  )r   fieldr  r  s       r   SetGeomFieldDirectlyzFeature.SetGeomFieldDirectly,  s1    //eTB+t$
r#   c                 T    t        j                  | g| }| j                  |       |S )a  
        GetGeomFieldRef(Feature self, int iField) -> Geometry
        GetGeomFieldRef(Feature self, char const * field_name) -> Geometry
        OGRGeometryH
        OGR_F_GetGeomFieldRef(OGRFeatureH hFeat, int iField)

        Fetch a handle to feature geometry.

        This function is the same as the C++ method
        OGRFeature::GetGeomFieldRef().

        Parameters
        -----------
        hFeat:
            handle to the feature to get geometry from.
        iField:
            geometry field to get.

        a handle to internal feature geometry. This object should not be
        modified.

        GDAL 1.11 
        )r   Feature_GetGeomFieldRefr  r   s      r   GetGeomFieldRefzFeature.GetGeomFieldRef4  s.    0 **47$73 
r#   c                 .    t        j                  | g| S )a'  
        Clone(Feature self) -> Feature

        OGRFeatureH OGR_F_Clone(OGRFeatureH hFeat)

        Duplicate feature.

        The newly created feature is owned by the caller, and will have its
        own reference to the OGRFeatureDefn.

        This function is the same as the C++ method OGRFeature::Clone().

        Parameters
        -----------
        hFeat:
            handle to the feature to clone.

        Returns
        --------
        OGRFeatureH:
            a handle to the new feature, exactly matching this feature.

        )r   Feature_Cloner   s     r   ClonezFeature.CloneT  s    0 !!$...r#   c                 .    t        j                  | g| S )a  
        Equal(Feature self, Feature feature) -> bool
        int OGR_F_Equal(OGRFeatureH hFeat,
        OGRFeatureH hOtherFeat)

        Test if two features are the same.

        Two features are considered equal if the share them (handle equality)
        same OGRFeatureDefn, have the same field values, and the same geometry
        (as tested by OGR_G_Equal()) as well as the same feature id.

        This function is the same as the C++ method OGRFeature::Equal().

        Parameters
        -----------
        hFeat:
            handle to one of the feature.
        hOtherFeat:
            handle to the other feature to test this one against.

        Returns
        --------
        int:
            TRUE if they are equal, otherwise FALSE.

        )r   Feature_Equalr   s     r   EqualzFeature.Equaln  s    6 !!$...r#   c                 .    t        j                  | g| S )a  
        GetFieldCount(Feature self) -> int

        int OGR_F_GetFieldCount(OGRFeatureH hFeat)

        Fetch number of fields on this feature This will always be the same as
        the field count for the OGRFeatureDefn.

        This function is the same as the C++ method
        OGRFeature::GetFieldCount().

        Parameters
        -----------
        hFeat:
            handle to the feature to get the fields count from.

        Returns
        --------
        int:
            count of fields.

        )r   Feature_GetFieldCountr   s     r   rl  zFeature.GetFieldCount  s    . ))$666r#   c                 .    t        j                  | g| S )a  
        GetFieldDefnRef(Feature self, int id) -> FieldDefn
        GetFieldDefnRef(Feature self, char const * field_name) -> FieldDefn

        OGRFieldDefnH OGR_F_GetFieldDefnRef(OGRFeatureH hFeat, int i)

        Fetch definition for this field.

        This function is the same as the C++ method
        OGRFeature::GetFieldDefnRef().

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is found.
        i:
            the field to fetch, from 0 to GetFieldCount()-1.

        Returns
        --------
        OGRFieldDefnH:
            a handle to the field definition (from the OGRFeatureDefn). This is an
            internal reference, and should not be deleted or modified.

        )r   Feature_GetFieldDefnRefr   s     r   GetFieldDefnRefzFeature.GetFieldDefnRef  s    4 ++D8488r#   c                 .    t        j                  | g| S )aW  
        GetGeomFieldCount(Feature self) -> int

        int OGR_F_GetGeomFieldCount(OGRFeatureH hFeat)

        Fetch number of geometry fields on this feature This will always be
        the same as the geometry field count for the OGRFeatureDefn.

        This function is the same as the C++ method
        OGRFeature::GetGeomFieldCount().

        .. versionadded:: 1.11

        Parameters
        -----------
        hFeat:
            handle to the feature to get the geometry fields count from.


        Returns
        --------
        int:
            count of geometry fields.

        )r   Feature_GetGeomFieldCountr   s     r   GetGeomFieldCountzFeature.GetGeomFieldCount  s    4 --d:T::r#   c                 .    t        j                  | g| S )a=  
        GetGeomFieldDefnRef(Feature self, int id) -> GeomFieldDefn
        GetGeomFieldDefnRef(Feature self, char const * field_name) -> GeomFieldDefn

        OGRGeomFieldDefnH OGR_F_GetGeomFieldDefnRef(OGRFeatureH hFeat, int i)

        Fetch definition for this geometry field.

        This function is the same as the C++ method
        OGRFeature::GetGeomFieldDefnRef().

        .. versionadded:: 1.11

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is found.
        i:
            the field to fetch, from 0 to GetGeomFieldCount()-1.


        Returns
        --------
        OGRGeomFieldDefnH:
            a handle to the field definition (from the OGRFeatureDefn). This is an
            internal reference, and should not be deleted or modified.

        )r   Feature_GetGeomFieldDefnRefr   s     r   GetGeomFieldDefnRefzFeature.GetGeomFieldDefnRef  s    : //<t<<r#   c                 .    t        j                  | g| S )a  
        GetFieldAsString(Feature self, int id) -> char const
        GetFieldAsString(Feature self, char const * field_name) -> char const *

        const char\* OGR_F_GetFieldAsString(OGRFeatureH hFeat, int iField)

        Fetch field value as a string.

        OFTReal and OFTInteger fields will be translated to string using
        sprintf(), but not necessarily using the established formatting rules.
        Other field types, or errors will result in a return value of zero.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsString().

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.

        Returns
        --------
        str:
            the field value. This string is internal, and should not be modified,
            or freed. Its lifetime may be very brief.

        )r   Feature_GetFieldAsStringr   s     r   GetFieldAsStringzFeature.GetFieldAsString  s    < ,,T9D99r#   c                 .    t        j                  | g| S )z
        GetFieldAsISO8601DateTime(Feature self, int id, char ** options=None) -> char const
        GetFieldAsISO8601DateTime(Feature self, char const * field_name, char ** options=None) -> char const *
        )r   !Feature_GetFieldAsISO8601DateTimer   s     r   GetFieldAsISO8601DateTimez!Feature.GetFieldAsISO8601DateTime  s    
 55dBTBBr#   c                 .    t        j                  | g| S )a  
        GetFieldAsInteger(Feature self, int id) -> int
        GetFieldAsInteger(Feature self, char const * field_name) -> int

        int OGR_F_GetFieldAsInteger(OGRFeatureH hFeat, int iField)

        Fetch field value as integer.

        OFTString features will be translated using atoi(). OFTReal fields
        will be cast to integer. Other field types, or errors will result in a
        return value of zero.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsInteger().

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.

        Returns
        --------
        int:
            the field value.

        )r   Feature_GetFieldAsIntegerr   s     r   GetFieldAsIntegerzFeature.GetFieldAsInteger"      : --d:T::r#   c                 .    t        j                  | g| S )a  
        GetFieldAsInteger64(Feature self, int id) -> GIntBig
        GetFieldAsInteger64(Feature self, char const * field_name) -> GIntBig

        GIntBig OGR_F_GetFieldAsInteger64(OGRFeatureH hFeat, int iField)

        Fetch field value as integer 64 bit.

        OFTInteger are promoted to 64 bit. OFTString features will be
        translated using CPLAtoGIntBig(). OFTReal fields will be cast to
        integer. Other field types, or errors will result in a return value of
        zero.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsInteger64().

        .. versionadded:: 2.0

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.

        Returns
        --------
        int:
            the field value.

        )r   Feature_GetFieldAsInteger64r   s     r   GetFieldAsInteger64zFeature.GetFieldAsInteger64A      @ //<t<<r#   c                 .    t        j                  | g| S )a   
        GetFieldAsDouble(Feature self, int id) -> double
        GetFieldAsDouble(Feature self, char const * field_name) -> double

        double OGR_F_GetFieldAsDouble(OGRFeatureH hFeat, int iField)

        Fetch field value as a double.

        OFTString features will be translated using CPLAtof(). OFTInteger
        fields will be cast to double. Other field types, or errors will
        result in a return value of zero.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsDouble().

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.

        Returns
        --------
        float:
            the field value.

        )r   Feature_GetFieldAsDoubler   s     r   GetFieldAsDoublezFeature.GetFieldAsDoublec  s    : ,,T9D99r#   c                 .    t        j                  | g| S )a  
        GetFieldAsDateTime(Feature self, int id)
        GetFieldAsDateTime(Feature self, char const * field_name)
        int
        OGR_F_GetFieldAsDateTime(OGRFeatureH hFeat, int iField, int \*pnYear,
        int \*pnMonth, int \*pnDay, int \*pnHour, int \*pnMinute, int \*pnSecond,
        int \*pnTZFlag)

        Fetch field value as date and time.

        Currently this method only works for OFTDate, OFTTime and OFTDateTime
        fields.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsDateTime().

        .. note:: Use OGR_F_GetFieldAsDateTimeEx() for second with millisecond accuracy.

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.
        pnYear:
            (including century)
        pnMonth:
            (1-12)
        pnDay:
            (1-31)
        pnHour:
            (0-23)
        pnMinute:
            (0-59)
        pnSecond:
            (0-59)
        pnTZFlag:
            (0=unknown, 1=localtime, 100=GMT, see data model for
        details)

        Returns
        --------
        int:
            TRUE on success or FALSE on failure.

        )r   Feature_GetFieldAsDateTimer   s     r   GetFieldAsDateTimezFeature.GetFieldAsDateTime  s    ^ ..t;d;;r#   c                 .    t        j                  | g| S )a  
        GetFieldAsIntegerList(Feature self, int id)
        GetFieldAsIntegerList(Feature self, char const * field_name)

        const int\* OGR_F_GetFieldAsIntegerList(OGRFeatureH hFeat, int iField, int
        \*pnCount)

        Fetch field value as a list of integers.

        Currently this function only works for OFTIntegerList fields.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsIntegerList().

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.
        pnCount:
            an integer to put the list count (number of integers) into.

        Returns
        --------
        list[int]:
            the field value. This list is internal, and should not be modified, or
            freed. Its lifetime may be very brief. If \*pnCount is zero on return
            the returned pointer may be NULL or non-NULL.

        )r   Feature_GetFieldAsIntegerListr   s     r   GetFieldAsIntegerListzFeature.GetFieldAsIntegerList  s    @ 11$>>>r#   c                 .    t        j                  | g| S )a  
        GetFieldAsInteger64List(Feature self, int id)
        const GIntBig\*
        OGR_F_GetFieldAsInteger64List(OGRFeatureH hFeat, int iField, int
        \*pnCount)

        Fetch field value as a list of 64 bit integers.

        Currently this function only works for OFTInteger64List fields.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsInteger64List().

        .. versionadded:: 2.0

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.
        pnCount:
            an integer to put the list count (number of integers) into.

        Returns
        --------
        list[int]:
            the field value. This list is internal, and should not be modified, or
            freed. Its lifetime may be very brief. If \*pnCount is zero on return
            the returned pointer may be NULL or non-NULL.

        )r   Feature_GetFieldAsInteger64Listr   s     r   GetFieldAsInteger64ListzFeature.GetFieldAsInteger64List      B 33D@4@@r#   c                 .    t        j                  | g| S )a  
        GetFieldAsDoubleList(Feature self, int id)
        GetFieldAsDoubleList(Feature self, char const * field_name)
        const double\*
        OGR_F_GetFieldAsDoubleList(OGRFeatureH hFeat, int iField, int
        \*pnCount)

        Fetch field value as a list of doubles.

        Currently this function only works for OFTRealList fields.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsDoubleList().

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.
        pnCount:
            an integer to put the list count (number of doubles) into.

        Returns
        --------
        list[float]:
            the field value. This list is internal, and should not be modified, or
            freed. Its lifetime may be very brief. If \*pnCount is zero on return
            the returned pointer may be NULL or non-NULL.

        )r   Feature_GetFieldAsDoubleListr   s     r   GetFieldAsDoubleListzFeature.GetFieldAsDoubleList  s    @ 00===r#   c                 .    t        j                  | g| S )al  
        GetFieldAsStringList(Feature self, int id) -> char **
        char\*\*
        OGR_F_GetFieldAsStringList(OGRFeatureH hFeat, int iField)

        Fetch field value as a list of strings.

        Currently this method only works for OFTStringList fields.

        The returned list is terminated by a NULL pointer. The number of
        elements can also be calculated using CSLCount().

        This function is the same as the C++ method
        OGRFeature::GetFieldAsStringList().

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.

        Returns
        --------
        list[str]:
            the field value. This list is internal, and should not be modified, or
            freed. Its lifetime may be very brief.

        )r   Feature_GetFieldAsStringListr   s     r   GetFieldAsStringListzFeature.GetFieldAsStringList      < 00===r#   c                 .    t        j                  | g| S )al  
        GetFieldAsBinary(Feature self, int id) -> OGRErr
        GetFieldAsBinary(Feature self, char const * field_name) -> OGRErr
        GByte\*
        OGR_F_GetFieldAsBinary(OGRFeatureH hFeat, int iField, int \*pnBytes)

        Fetch field value as binary.

        This method only works for OFTBinary and OFTString fields.

        This function is the same as the C++ method
        OGRFeature::GetFieldAsBinary().

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.
        pnBytes:
            location to place count of bytes returned.


        Returns
        --------
        list:
            the field value. This list is internal, and should not be modified, or
            freed. Its lifetime may be very brief.

        )r   Feature_GetFieldAsBinaryr   s     r   GetFieldAsBinaryzFeature.GetFieldAsBinary:  s    > ,,T9D99r#   c                 .    t        j                  | g| S )aT  
        IsFieldSet(Feature self, int id) -> bool
        IsFieldSet(Feature self, char const * field_name) -> bool

        int OGR_F_IsFieldSet(OGRFeatureH hFeat, int iField)

        Test if a field has ever been assigned a value or not.

        This function is the same as the C++ method OGRFeature::IsFieldSet().

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is.
        iField:
            the field to test.

        Returns
        --------
        int:
            TRUE if the field has been set, otherwise false.

        )r   Feature_IsFieldSetr   s     r   
IsFieldSetzFeature.IsFieldSet[  s    0 &&t3d33r#   c                 .    t        j                  | g| S )aT  
        IsFieldNull(Feature self, int id) -> bool
        IsFieldNull(Feature self, char const * field_name) -> bool

        int OGR_F_IsFieldNull(OGRFeatureH hFeat, int iField)

        Test if a field is null.

        This function is the same as the C++ method OGRFeature::IsFieldNull().

        .. versionadded:: 2.2

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is.
        iField:
            the field to test.

        Returns
        --------
        int:
            TRUE if the field is null, otherwise false.

        )r   Feature_IsFieldNullr   s     r   IsFieldNullzFeature.IsFieldNullu  s    4 ''4t44r#   c                 .    t        j                  | g| S )a  
        IsFieldSetAndNotNull(Feature self, int id) -> bool
        IsFieldSetAndNotNull(Feature self, char const * field_name) -> bool

        int OGR_F_IsFieldSetAndNotNull(OGRFeatureH hFeat, int iField)

        Test if a field is set and not null.

        This function is the same as the C++ method
        OGRFeature::IsFieldSetAndNotNull().

        .. versionadded:: 2.2

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is.
        iField:
            the field to test.

        Returns
        --------
        int:
            TRUE if the field is set and not null, otherwise false.

        )r   Feature_IsFieldSetAndNotNullr   s     r   IsFieldSetAndNotNullzFeature.IsFieldSetAndNotNull      6 00===r#   c                 .    t        j                  | g| S )a  
        GetFieldIndex(Feature self, char const * field_name) -> int

        int OGR_F_GetFieldIndex(OGRFeatureH hFeat, const char \*pszName)

        Fetch the field index given field name.

        This is a cover for the OGRFeatureDefn::GetFieldIndex() method.

        This function is the same as the C++ method
        OGRFeature::GetFieldIndex().

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is found.
        pszName:
            the name of the field to search for.

        Returns
        --------
        int:
            the field index, or -1 if no matching field is found.

        )r   Feature_GetFieldIndexr   s     r   GetFieldIndexzFeature.GetFieldIndex      4 ))$666r#   c                 .    t        j                  | g| S )a  
        GetGeomFieldIndex(Feature self, char const * field_name) -> int

        int OGR_F_GetGeomFieldIndex(OGRFeatureH hFeat, const char \*pszName)

        Fetch the geometry field index given geometry field name.

        This is a cover for the OGRFeatureDefn::GetGeomFieldIndex() method.

        This function is the same as the C++ method
        OGRFeature::GetGeomFieldIndex().

        .. versionadded:: 1.11

        Parameters
        -----------
        hFeat:
            handle to the feature on which the geometry field is found.
        pszName:
            the name of the geometry field to search for.


        Returns
        --------
        int:
            the geometry field index, or -1 if no matching geometry field is found.

        )r   Feature_GetGeomFieldIndexr   s     r   GetGeomFieldIndexzFeature.GetGeomFieldIndex  r  r#   c                 .    t        j                  | g| S )a'  
        GetFID(Feature self) -> GIntBig
        GIntBig OGR_F_GetFID(OGRFeatureH
        hFeat)

        Get feature identifier.

        This function is the same as the C++ method OGRFeature::GetFID().
        Note: since GDAL 2.0, this method returns a GIntBig (previously a
        long)

        Parameters
        -----------
        hFeat:
            handle to the feature from which to get the feature
        identifier.

        Returns
        -------
        int:
            feature id or OGRNullFID if none has been assigned.

        )r   Feature_GetFIDr   s     r   GetFIDzFeature.GetFID  s    0 ""4/$//r#   c                 .    t        j                  | g| S )a7  
        SetFID(Feature self, GIntBig fid) -> OGRErr
        OGRErr OGR_F_SetFID(OGRFeatureH hFeat,
        GIntBig nFID)

        Set the feature identifier.

        For specific types of features this operation may fail on illegal
        features ids. Generally it always succeeds. Feature ids should be
        greater than or equal to zero, with the exception of OGRNullFID (-1)
        indicating that the feature id is unknown.

        This function is the same as the C++ method OGRFeature::SetFID().

        Parameters
        -----------
        hFeat:
            handle to the feature to set the feature id to.
        nFID:
            the new feature identifier value to assign.

        Returns
        --------
        OGRErr:
            On success OGRERR_NONE, or on failure some other value.

        )r   Feature_SetFIDr   s     r   SetFIDzFeature.SetFID  s    8 ""4/$//r#   c                 .    t        j                  | g| S )at  
        DumpReadable(Feature self)
        void
        OGR_F_DumpReadable(OGRFeatureH hFeat, FILE \*fpOut)

        Dump this feature in a human readable form.

        This dumps the attributes, and geometry; however, it doesn't
        definition information (other than field types and names), nor does it
        report the geometry spatial reference system.

        This function is the same as the C++ method
        OGRFeature::DumpReadable().

        Parameters
        -----------
        hFeat:
            handle to the feature to dump.
        fpOut:
            the stream to write to, such as strout.

        )r   Feature_DumpReadabler   s     r   DumpReadablezFeature.DumpReadable!  s    . ((555r#   c                 .    t        j                  | g| S )zQDumpReadableAsString(Feature self, char ** options=None) -> retStringAndCPLFree *)r   Feature_DumpReadableAsStringr   s     r   DumpReadableAsStringzFeature.DumpReadableAsString:  r   r#   c                 .    t        j                  | g| S )a  
        UnsetField(Feature self, int id)
        UnsetField(Feature self, char const * field_name)

        void OGR_F_UnsetField(OGRFeatureH hFeat, int iField)

        Clear a field, marking it as unset.

        This function is the same as the C++ method OGRFeature::UnsetField().

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is.
        iField:
            the field to unset.

        )r   Feature_UnsetFieldr   s     r   
UnsetFieldzFeature.UnsetField>  s    & &&t3d33r#   c                 .    t        j                  | g| S )a  
        SetFieldNull(Feature self, int id)
        SetFieldNull(Feature self, char const * field_name)

        void OGR_F_SetFieldNull(OGRFeatureH hFeat, int iField)

        Clear a field, marking it as null.

        This function is the same as the C++ method
        OGRFeature::SetFieldNull().

        .. versionadded:: 2.2

        Parameters
        -----------
        hFeat:
            handle to the feature on which the field is.
        iField:
            the field to set to null.

        )r   Feature_SetFieldNullr   s     r   SetFieldNullzFeature.SetFieldNullS  r  r#   c                 .    t        j                  | g| S )a  
        SetFieldInteger64(Feature self, int id, GIntBig value)
        void
        OGR_F_SetFieldInteger64(OGRFeatureH hFeat, int iField, GIntBig nValue)

        Set field to 64 bit integer value.

        OFTInteger, OFTInteger64 and OFTReal fields will be set directly.
        OFTString fields will be assigned a string representation of the
        value, but not necessarily taking into account formatting constraints
        on this field. Other field types may be unaffected.

        This function is the same as the C++ method OGRFeature::SetField().

        This method has only an effect on the in-memory feature object. If
        this object comes from a layer and the modifications must be
        serialized back to the datasource, OGR_L_SetFeature() must be used
        afterwards. Or if this is a new feature, OGR_L_CreateFeature() must be
        used afterwards.

        .. versionadded:: 2.0

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.
        nValue:
            the value to assign.

        )r   Feature_SetFieldInteger64r   s     r   SetFieldInteger64zFeature.SetFieldInteger64k  s    B --d:T::r#   c                    t        |      dk(  r|d   t        j                  | |d         S t        |      dk(  rSt        |d   t              r@|d   }t        |t
              r| j                  |      }t        j                  | ||d         S t        |      dk(  rSt        |d   t
              r@|d   }t        |t
              r| j                  |      }t        j                  | ||d         S t        |      dk(  rqt        |d   t        t        t        f      rS|d   }t        |t
              r| j                  |      }| j                  |      t        k(  r| j                  ||d         S t        j                  | g| S )ar  
        SetField(self, fld_index, value: str)
        SetField(self, fld_name, value: str)
        SetField(self, fld_index, value: int)
        SetField(self, fld_name, value: int)
        SetField(self, fld_index, value: float)
        SetField(self, fld_name, value: float)
        SetField(self, fld_index, year: int, month: int, day: int, hour: int, minute: int, second: int|float, tzflag: int)
        SetField(self, fld_name, year: int, month: int, day: int, hour: int, minute: int, second: int|float, tzflag: int)
        SetField(self, fld_index, value: bytes)
        SetField(self, fld_name, value: bytes)
           r   r   )rl  r   r4  r   r  r  _getfieldindexr7  Feature_SetFieldStringbytes	bytearray
memoryviewGetFieldType	OFTBinary_SetFieldBinaryFeature_SetField)r   r<   	fld_indexs      r   SetFieldzFeature.SetField  sX    t9>d1go,,T47;;t9>ja#6QI)S) //	:	11$	47KKt9>ja#6QI)S) //	:	..tYQHHt9>ja5)Z2PQQI)S) //	:	  +y8++ItAw??$$T1D11r#   c                 .    t        j                  | g| S )a1  
        SetFieldIntegerList(Feature self, int id, int nList)
        void
        OGR_F_SetFieldIntegerList(OGRFeatureH hFeat, int iField, int nCount,
        const int \*panValues)

        Set field to list of integers value.

        This function currently on has an effect of OFTIntegerList,
        OFTInteger64List and OFTRealList fields.

        This function is the same as the C++ method OGRFeature::SetField().

        This method has only an effect on the in-memory feature object. If
        this object comes from a layer and the modifications must be
        serialized back to the datasource, OGR_L_SetFeature() must be used
        afterwards. Or if this is a new feature, OGR_L_CreateFeature() must be
        used afterwards.

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to set, from 0 to GetFieldCount()-1.
        nCount:
            the number of values in the list being assigned.
        panValues:
            the values to assign.

        )r   Feature_SetFieldIntegerListr   s     r   SetFieldIntegerListzFeature.SetFieldIntegerList  r  r#   c                 .    t        j                  | g| S )a_  
        SetFieldInteger64List(Feature self, int id, int nList)
        void
        OGR_F_SetFieldInteger64List(OGRFeatureH hFeat, int iField, int nCount,
        const GIntBig \*panValues)

        Set field to list of 64 bit integers value.

        This function currently on has an effect of OFTIntegerList,
        OFTInteger64List and OFTRealList fields.

        This function is the same as the C++ method OGRFeature::SetField().

        This method has only an effect on the in-memory feature object. If
        this object comes from a layer and the modifications must be
        serialized back to the datasource, OGR_L_SetFeature() must be used
        afterwards. Or if this is a new feature, OGR_L_CreateFeature() must be
        used afterwards.

        .. versionadded:: 2.0

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to set, from 0 to GetFieldCount()-1.
        nCount:
            the number of values in the list being assigned.
        panValues:
            the values to assign.

        )r   Feature_SetFieldInteger64Listr   s     r   SetFieldInteger64ListzFeature.SetFieldInteger64List  s    D 11$>>>r#   c                 .    t        j                  | g| S )a0  
        SetFieldDoubleList(Feature self, int id, int nList)
        void
        OGR_F_SetFieldDoubleList(OGRFeatureH hFeat, int iField, int nCount,
        const double \*padfValues)

        Set field to list of doubles value.

        This function currently on has an effect of OFTIntegerList,
        OFTInteger64List, OFTRealList fields.

        This function is the same as the C++ method OGRFeature::SetField().

        This method has only an effect on the in-memory feature object. If
        this object comes from a layer and the modifications must be
        serialized back to the datasource, OGR_L_SetFeature() must be used
        afterwards. Or if this is a new feature, OGR_L_CreateFeature() must be
        used afterwards.

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to set, from 0 to GetFieldCount()-1.
        nCount:
            the number of values in the list being assigned.
        padfValues:
            the values to assign.

        )r   Feature_SetFieldDoubleListr   s     r   SetFieldDoubleListzFeature.SetFieldDoubleList      @ ..t;d;;r#   c                 .    t        j                  | g| S )a  
        SetFieldStringList(Feature self, int id, char ** pList)
        void
        OGR_F_SetFieldStringList(OGRFeatureH hFeat, int iField, CSLConstList
        papszValues)

        Set field to list of strings value.

        This function currently on has an effect of OFTStringList fields.

        This function is the same as the C++ method OGRFeature::SetField().

        This method has only an effect on the in-memory feature object. If
        this object comes from a layer and the modifications must be
        serialized back to the datasource, OGR_L_SetFeature() must be used
        afterwards. Or if this is a new feature, OGR_L_CreateFeature() must be
        used afterwards.

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to set, from 0 to GetFieldCount()-1.
        papszValues:
            the values to assign. List of NUL-terminated string,
        ending with a NULL pointer.

        )r   Feature_SetFieldStringListr   s     r   SetFieldStringListzFeature.SetFieldStringList       < ..t;d;;r#   c                 .    t        j                  | g| S )z/_SetFieldBinary(Feature self, int id, int nLen))r   Feature__SetFieldBinaryr   s     r   rB  zFeature._SetFieldBinary@  r   r#   c                 .    t        j                  | g| S )z
        SetFieldBinaryFromHexString(Feature self, int id, char const * pszValue)
        SetFieldBinaryFromHexString(Feature self, char const * field_name, char const * pszValue)
        )r   #Feature_SetFieldBinaryFromHexStringr   s     r   SetFieldBinaryFromHexStringz#Feature.SetFieldBinaryFromHexStringD  s    
 77DtDDr#   c                 4    t        j                  | g|i |S )a  
        SetFrom(Feature self, Feature other, int forgiving=1) -> OGRErr
        OGRErr OGR_F_SetFrom(OGRFeatureH
        hFeat, OGRFeatureH hOtherFeat, int bForgiving)

        Set one feature from another.

        Overwrite the contents of this feature from the geometry and
        attributes of another. The hOtherFeature does not need to have the
        same OGRFeatureDefn. Field values are copied by corresponding field
        names. Field types do not have to exactly match. OGR_F_SetField\*()
        function conversion rules will be applied as needed.

        This function is the same as the C++ method OGRFeature::SetFrom().

        Parameters
        -----------
        hFeat:
            handle to the feature to set to.
        hOtherFeat:
            handle to the feature from which geometry, and field
            values will be copied.
        bForgiving:
            TRUE if the operation should continue despite lacking
            output fields matching some of the source fields.

        Returns
        --------
        OGRErr:
            OGRERR_NONE if the operation succeeds, even if some values are not
            transferred, otherwise an error code.

        )r   Feature_SetFromr   s      r   SetFromzFeature.SetFromK  s     D ##D:4:6::r#   c                 .    t        j                  | g| S )a  
        SetFromWithMap(Feature self, Feature other, int forgiving, int nList) -> OGRErr
        OGRErr
        OGR_F_SetFromWithMap(OGRFeatureH hFeat, OGRFeatureH hOtherFeat, int
        bForgiving, const int \*panMap)

        Set one feature from another.

        Overwrite the contents of this feature from the geometry and
        attributes of another. The hOtherFeature does not need to have the
        same OGRFeatureDefn. Field values are copied according to the provided
        indices map. Field types do not have to exactly match.
        OGR_F_SetField\*() function conversion rules will be applied as needed.
        This is more efficient than OGR_F_SetFrom() in that this doesn't
        lookup the fields by their names. Particularly useful when the field
        names don't match.

        This function is the same as the C++ method OGRFeature::SetFrom().

        Parameters
        -----------
        hFeat:
            handle to the feature to set to.
        hOtherFeat:
            handle to the feature from which geometry, and field
            values will be copied.
        panMap:
            Array of the indices of the destination feature's fields
            stored at the corresponding index of the source feature's fields. A
            value of -1 should be used to ignore the source's field. The array
            should not be NULL and be as long as the number of fields in the
            source feature.
        bForgiving:
            TRUE if the operation should continue despite lacking
            output fields matching some of the source fields.

        Returns
        --------
        OGRErr:
            OGRERR_NONE if the operation succeeds, even if some values are not
            transferred, otherwise an error code.

        )r   Feature_SetFromWithMapr   s     r   SetFromWithMapzFeature.SetFromWithMapo  s    X **47$77r#   c                 .    t        j                  | g| S )a  
        GetStyleString(Feature self) -> char const *
        const char\*
        OGR_F_GetStyleString(OGRFeatureH hFeat)

        Fetch style string for this feature.

        Set the OGR Feature Style Specification for details on the format of
        this string, and ogr_featurestyle.h for services available to parse
        it.

        This function is the same as the C++ method
        OGRFeature::GetStyleString().

        Parameters
        -----------
        hFeat:
            handle to the feature to get the style from.

        Returns
        --------
        str:
            a reference to a representation in string format, or NULL if there
            isn't one.

        )r   Feature_GetStyleStringr   s     r   GetStyleStringzFeature.GetStyleString  s    6 **47$77r#   c                 .    t        j                  | g| S )a  
        SetStyleString(Feature self, char const * the_string)
        void
        OGR_F_SetStyleString(OGRFeatureH hFeat, const char \*pszStyle)

        Set feature style string.

        This method operate exactly as OGR_F_SetStyleStringDirectly() except
        that it does not assume ownership of the passed string, but instead
        makes a copy of it.

        This function is the same as the C++ method
        OGRFeature::SetStyleString().

        Parameters
        -----------
        hFeat:
            handle to the feature to set style to.
        pszStyle:
            the style string to apply to this feature, cannot be NULL.

        )r   Feature_SetStyleStringr   s     r   SetStyleStringzFeature.SetStyleString  s    . **47$77r#   c                 .    t        j                  | g| S )z
        GetFieldType(Feature self, int id) -> OGRFieldType
        GetFieldType(Feature self, char const * field_name) -> OGRFieldType
        )r   Feature_GetFieldTyper   s     r   r@  zFeature.GetFieldType  s    
 ((555r#   c                 .    t        j                  | g| S )a  
        Validate(Feature self, int flags=OGR_F_VAL_ALL, int bEmitError=TRUE) -> int
        int OGR_F_Validate(OGRFeatureH
        hFeat, int nValidateFlags, int bEmitError)

        Validate that a feature meets constraints of its schema.

        The scope of test is specified with the nValidateFlags parameter.

        Regarding OGR_F_VAL_WIDTH, the test is done assuming the string width
        must be interpreted as the number of UTF-8 characters. Some drivers
        might interpret the width as the number of bytes instead. So this test
        is rather conservative (if it fails, then it will fail for all
        interpretations).

        This function is the same as the C++ method OGRFeature::Validate().

        .. versionadded:: 2.0

        Parameters
        -----------
        hFeat:
            handle to the feature to validate.
        nValidateFlags:
            OGR_F_VAL_ALL or combination of OGR_F_VAL_NULL,
            OGR_F_VAL_GEOM_TYPE, OGR_F_VAL_WIDTH and
            OGR_F_VAL_ALLOW_NULL_WHEN_DEFAULT with '|' operator
        bEmitError:
            TRUE if a CPLError() must be emitted when a check fails

        Returns
        -------
        int:
            TRUE if all enabled validation tests pass.

        )r   Feature_Validater   s     r   ValidatezFeature.Validate  s    J $$T1D11r#   c                 .    t        j                  | g| S )a  
        FillUnsetWithDefault(Feature self, int bNotNullableOnly=FALSE, char ** options=None)
        void
        OGR_F_FillUnsetWithDefault(OGRFeatureH hFeat, int bNotNullableOnly,
        char \*\*papszOptions)

        Fill unset fields with default values that might be defined.

        This function is the same as the C++ method
        OGRFeature::FillUnsetWithDefault().

        .. versionadded:: 2.0

        Parameters
        -----------
        hFeat:
            handle to the feature.
        bNotNullableOnly:
            if we should fill only unset fields with a not-null
            constraint.
        papszOptions:
            unused currently. Must be set to NULL.

        )r   Feature_FillUnsetWithDefaultr   s     r   FillUnsetWithDefaultzFeature.FillUnsetWithDefault  s    2 00===r#   c                 .    t        j                  | g| S )at  
        GetNativeData(Feature self) -> char const *
        const char\*
        OGR_F_GetNativeData(OGRFeatureH hFeat)

        Returns the native data for the feature.

        The native data is the representation in a "natural" form that comes
        from the driver that created this feature, or that is aimed at an
        output driver. The native data may be in different format, which is
        indicated by OGR_F_GetNativeMediaType().

        Note that most drivers do not support storing the native data in the
        feature object, and if they do, generally the NATIVE_DATA open option
        must be passed at dataset opening.

        The "native data" does not imply it is something more performant or
        powerful than what can be obtained with the rest of the API, but it
        may be useful in round-tripping scenarios where some characteristics
        of the underlying format are not captured otherwise by the OGR
        abstraction.

        This function is the same as the C++ method
        OGRFeature::GetNativeData().

        .. note:: See https://trac.osgeo.org/gdal/wiki/rfc60_improved_roundtripping_in_ogr

        .. versionadded:: 2.1

        Parameters
        -----------
        hFeat:
            handle to the feature.

        Returns
        -------
        str:
            a string with the native data, or NULL if there is none.

        )r   Feature_GetNativeDatar   s     r   GetNativeDatazFeature.GetNativeData  s    R ))$666r#   c                 .    t        j                  | g| S )aO  
        GetNativeMediaType(Feature self) -> char const *
        const char\*
        OGR_F_GetNativeMediaType(OGRFeatureH hFeat)

        Returns the native media type for the feature.

        The native media type is the identifier for the format of the native
        data. It follows the IANA RFC 2045
        (seehttps://en.wikipedia.org/wiki/Media_type), e.g.
        "application/vnd.geo+json" for JSon.

        This function is the same as the C function
        OGR_F_GetNativeMediaType().

        .. note:: See https://trac.osgeo.org/gdal/wiki/rfc60_improved_roundtripping_in_ogr

        .. versionadded:: 2.1

        Parameters
        -----------
        hFeat:
            handle to the feature.


        Returns
        --------
        str:
            a string with the native media type, or NULL if there is none.

        )r   Feature_GetNativeMediaTyper   s     r   GetNativeMediaTypezFeature.GetNativeMediaTypeG  rO  r#   c                 .    t        j                  | g| S )an  
        SetNativeData(Feature self, char const * nativeData)
        void
        OGR_F_SetNativeData(OGRFeatureH hFeat, const char \*pszNativeData)

        Sets the native data for the feature.

        The native data is the representation in a "natural" form that comes
        from the driver that created this feature, or that is aimed at an
        output driver. The native data may be in different format, which is
        indicated by OGR_F_GetNativeMediaType().

        This function is the same as the C++ method
        OGRFeature::SetNativeData().

        .. note:: See https://trac.osgeo.org/gdal/wiki/rfc60_improved_roundtripping_in_ogr

        .. versionadded:: 2.1

        Parameters
        -----------
        hFeat:
            handle to the feature.
        pszNativeData:
            a string with the native data, or NULL if there is none.

        )r   Feature_SetNativeDatar   s     r   SetNativeDatazFeature.SetNativeDatai  s    8 ))$666r#   c                 .    t        j                  | g| S )an  
        SetNativeMediaType(Feature self, char const * nativeMediaType)
        void
        OGR_F_SetNativeMediaType(OGRFeatureH hFeat, const char
        \*pszNativeMediaType)

        Sets the native media type for the feature.

        The native media type is the identifier for the format of the native
        data. It follows the IANA RFC 2045
        (seehttps://en.wikipedia.org/wiki/Media_type), e.g.
        "application/vnd.geo+json" for JSon.

        This function is the same as the C++ method
        OGRFeature::SetNativeMediaType().

        .. note:: See https://trac.osgeo.org/gdal/wiki/rfc60_improved_roundtripping_in_ogr

        .. versionadded:: 2.1


        Parameters
        -----------
        hFeat:
            handle to the feature.
        pszNativeMediaType:
            a string with the native media type, or NULL if there is none.

        )r   Feature_SetNativeMediaTyper   s     r   SetNativeMediaTypezFeature.SetNativeMediaType  rS  r#   c                 .    t        j                  | g| S )a  
        SetFieldString(Feature self, int id, char const * value)
        void
        OGR_F_SetFieldString(OGRFeatureH hFeat, int iField, const char
        \*pszValue)

        Set field to string value.

        OFTInteger fields will be set based on an atoi() conversion of the
        string. OFTInteger64 fields will be set based on an CPLAtoGIntBig()
        conversion of the string. OFTReal fields will be set based on an
        CPLAtof() conversion of the string. Other field types may be
        unaffected.

        This function is the same as the C++ method OGRFeature::SetField().

        This method has only an effect on the in-memory feature object. If
        this object comes from a layer and the modifications must be
        serialized back to the datasource, OGR_L_SetFeature() must be used
        afterwards. Or if this is a new feature, OGR_L_CreateFeature() must be
        used afterwards.

        Parameters
        -----------
        hFeat:
            handle to the feature that owned the field.
        iField:
            the field to fetch, from 0 to GetFieldCount()-1.
        pszValue:
            the value to assign.

        )r   r<  r   s     r   SetFieldStringzFeature.SetFieldString  s    B **47$77r#   c                      y r-   r$   rU  s    r   r\  zFeature.Reference      
r#   c                      y r-   r$   rU  s    r   r_  zFeature.Dereference  r|  r#   c                 j    t        j                  |        | j                          d| _        d| _        yrR  )r   delete_Feature_invalidate_geom_refsr   r
   rU  s    r   rV  zFeature.Destroy  s*    
$
  "dldir#   c                 $    | j                  |      S )z*Compares a feature to another for equality)r  )r   others     r   __cmp__zFeature.__cmp__  s    zz%  r#   c                 "    | j                         S r-   r  rU  s    r   __copy__zFeature.__copy__  s    zz|r#   c                    d}t        j                  |       }t        |j                               D ]T  }|j	                  |      j                         }||k(  r|c S |dk  s1|j                         |j                         k(  sS|}V |S )Nr   )r   r  r  rl  rm  r   lower)r   	fieldnamecase_insensitive_idxfdefnr  r   s         r   r;  zFeature._getfieldindex  s    !''-u**,- 	)A%%a(002Dy %)djjlioo>O.O'($	) $#r#   c                     |dv r| j                  |      S | j                  |      }|dk  r2| j                  |      }|dk  rt        |      | j	                  |      S | j                  |      S )z.Returns the values of fields by the given namer
   r   _geom_referencesr   )__getattribute__r;  r#  r   r  GetField)r   r  idxs      r   __getattr__zFeature.__getattr__  su    99((--!!#&7((-CQw$S))++C00==%%r#   c                     |dv rt         |   ||       y| j                  |      }|dk7  r| j                  ||       y| j	                  |      }|dk7  r| j                  ||       y|| j                  |<   y)z*Set the values of fields by the given namer  r  N)superr8   r;  
_SetField2r#  r  r/   )r   r  r    r  r   s       r   r8   zFeature.__setattr__  su    99GU+%%c*CbyU+,,S1"9%%c51).DMM#&r#   c                 ,   t        |t              r| j                  |      }n|}|| j                         k(  rt        |dk  rBt        |t              r| j                  |      }|dk  rt        d      | j                  |      S | j                  |      S )z<Returns the values of fields by the given name / field_indexr   %Illegal field requested in GetField())	r   r  r;  rl  rm  r#  KeyErrorr  r  )r   r  rD  s      r   ro  zFeature.__getitem__  s    c3++C0IId((**  q=#s# 2237	1}FGG++I66==++r#   c                 0   t        |t              r| j                  |      }n|}|| j                         k(  rt        |dk  rCt        |t              r| j                  |      }|dk  rt        d      | j                  ||      S | j                  ||      S )z2Returns the value of a field by field name / indexr   z%Illegal field requested in SetField())	r   r  r;  rl  rm  r#  r  r  r  )r   r  r    rD  s       r   __setitem__zFeature.__setitem__  s    c3++C0IId((**  q=#s# 2237	1}FGG((E::??9e44r#   c                    t        |t              r| j                  |      }|dk  s|| j                         kD  rt	        d      | j                  |      r| j                  |      ry | j                  |      }|t        k(  rQ| j                  |      j                         t        k(  rt        | j                  |            S | j                  |      S |t        k(  r| j                  |      S |t         k(  r| j#                  |      S |t$        k(  r| j'                  |      S |t(        k(  rQ| j+                  |      }| j                  |      j                         t        k(  r|D cg c]  }t        |       }}|S |t,        k(  r| j/                  |      S |t0        k(  r| j3                  |      S 	 | j5                  |      S c c}w #  | j7                  |      cY S xY w)Nr   r  )r   r  r;  rl  r  r  r  r@  
OFTIntegerr  
GetSubTypeOFSTBooleanboolr  OFTInteger64r  OFTRealr  OFTStringListr  OFTIntegerListr  OFTInteger64Listr  OFTRealListr  r  r  )r   rD  fld_typer  rv   s        r   r  zFeature.GetField1  s   i%++I6IMy4+=+=+??BCC	*t/?/?	/J$$Y/z!##I.99;{JD229=>>)))44|#++I66w((33}$,,Y77~%,,Y7C##I.99;{J),-AQ--J''//	::{",,Y77	4((33 .	4((33s   %G0G Gc                 p    t        |t              r| j                  |      }n|}| j                  ||       y)a  
        SetFieldBinary(Feature self, field_index_or_name: int | str, value: bytes)

        Set field to binary data.
        This function currently only has an effect on OFTBinary fields.
        This function is the same as the C++ method OGRFeature::SetField().

        Parameters
        -----------
        field_index_or_name:
            the field to set, from 0 to GetFieldCount()-1. Or the field name
        values:
            the data to apply.
        N)r   r  r;  rB  )r   field_index_or_namer    rD  s       r   SetFieldBinaryzFeature.SetFieldBinaryU  s5      )3/++,?@I+IY.r#   c           	      V   t        |t              r| j                  |      }|dk  s|| j                         kD  rt	        d      || j                  |       y t        |t              r|s| j                  |       y t        |d   t        d            st        |d   t        d            r| j                  ||       y t        |d   t              r| j                  ||       y t        |d   t              r| j                  ||       y t        dt        t        |d               z        t        |t        t        t        f      r+| j!                  |      t"        k(  r| j%                  ||       y 	 | j'                  ||       y #  | j'                  |t        |             Y y xY w)Nr   z'Illegal field requested in _SetField2()r   l   /g,z?Unsupported type of list in _SetField2(). Type of element is %s)r   r  r;  rl  r  r5  listr   rK  floatrN  rR  r  r=  r>  r?  r@  rA  rB  rE  )r   rD  r    s      r   r  zFeature._SetField2k  s|   i%++I6IMy4+=+=+??DEE=i(eT"!!),%(DG,
58T.EY0Z**9e<E!He,''	59E!Hc*''	59 adghlmrstmuhvdw wxxeeY
;<ARARS\A]ajAj  E2	1MM)U+ 		1MM)SZ0s   6F	 	F(c                     g }t        | j                               D ]2  }| j                  |      j                         }|j	                  |       4 |S )z8Return the list of field names (of the layer definition))r  rl  r  r   rk  )r   r  r  r  s       r   keyszFeature.keys  sP    t))+, 	$A,,Q/779ILL#	$ r#   c                 `    | j                         }i }|D ]  }| j                  |      ||<    |S )zOReturn a dictionary with the field names as key, and their value in the feature)r  r  )r   r  rn  r  s       r   r  zFeature.items  s8    yy{ 	-C--,F3K	-r#   c                 "    | j                         S )a   Return the feature geometry

            The lifetime of the returned geometry is bound to the one of its belonging
            feature.

            For more details: :cpp:func:`OGR_F_GetGeometryRef`

            The GetGeometryRef() method is also available as an alias of geometry()

            Returns
            --------
            Geometry:
                the geometry, or None.
        )r  rU  s    r   geometryzFeature.geometry  s      ""$$r#   c                 $    | j                          y r-   )r  rU  s    r   re  zFeature.__del__  s    ""$r#   c                 "    | j                         S r-   )r/  rU  s    r   r   zFeature.__repr__  s    ((**r#   c                    	 ddl }| j                         }|(|g }|j	                  |      }|j                  |      }nd}d|i d}| j                         }|t        k7  r||d<   | j                         D ]  }	| j                  | j                  |	            }
|
j                         t        j                  k(  rB|
j                         t        j                  k(  r!t!        | j#                  |	            |d   |	<   | j#                  |	      |d   |	<    |s|j%                  |      }|S # t        $ r" 	 ddl}n# t        $ r t        d      w xY wY Nw xY w)	a  Exports a GeoJSON object which represents the Feature. The
           as_object parameter determines whether the returned value
           should be a Python object instead of a string. Defaults to False.
           The options parameter is passed to Geometry.ExportToJson()r   Nz=Unable to import simplejson or json, needed for ExportToJson.r  r  )r   r  
propertiesidr  )
simplejsonrV   jsonr  ExportToJsonloadsr&  NullFIDr  r  r  GetTyper   r  r  r  r  r  dumps)r   	as_objectr  r  r  geom_json_stringgeom_json_objectrn  fidr  fld_defns              r   r  zFeature.ExportToJson  sn   	c ""$#000A)//0@A#"/!#
 kkm'>F4L99; 	?C++D,>,>s,CDH!T__49L9L9NRVRbRb9b,0s1C,D|$S),0MM#,>|$S)	? %%f-FE  	cc) c!"abbc *	cs)   D* *	E4D98E9EEEc                     |y t        | d      sdd l}|j                         | _        | j                  j	                  |       y )Nr  r   )r   r0  ru  r  rv  )r   r  r0  s      r   r  zFeature._add_geom_ref  s;    <t/0$+OO$5D!!!$'r#   c                 N    t        | d      r| j                  D ]	  }d |_         y y )Nr  )r   r  r
   )r   r  s     r   r  zFeature._invalidate_geom_refs  s.    4+,-- ! 	! -r#   rw  )FN)Xr   r   r6   r7   r   r   r   r   r   r  r   rP   r  r  r  r  r  r  r  r  r  rl  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r#  r&  r)  r,  r/  r2  r5  r8  rE  rH  rK  rN  rR  rB  rX  r[  r^  ra  rd  r@  ri  rl  ro  rr  ru  rx  rz  r\  r_  rV  r  r  r;  r  r8   ro  r  r  r  r  r  r  r  re  r  r  r  __classcell__)r   s   @r   r  r  
  s   /-/IOdeGH**G4.#5J6 6D@/4/:7298;8=>:@C;> =D:>/<b ?D!AF >D>@:B4458>:78;>040<62>4*60!;J$2P =D"?H <D<@9E";H,8\8:826%2N>6)7V <D7<<@!8F!	$&"/ ,&5$"4H/,"H%$%+*Z	(!r#   r  c                       e Zd ZdZ ed d d      ZeZej                  Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)FeatureDefnz(Proxy of C++ OGRFeatureDefnShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zFeatureDefn.<lambda>  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zFeatureDefn.<lambda>  r|   r#   r}   r~   c                 V    t        j                  | t        j                  |i |       y)zI__init__(FeatureDefn self, char const * name_null_ok=None) -> FeatureDefnN)r   FeatureDefn_swiginitnew_FeatureDefnr   s      r   rP   zFeatureDefn.__init__  s"    !!$(<(<d(Mf(MNr#   c                 .    t        j                  | g| S )a	  
        GetName(FeatureDefn self) -> char const *
        const char\*
        OGR_FD_GetName(OGRFeatureDefnH hDefn)

        Get name of the OGRFeatureDefn passed as an argument.

        This function is the same as the C++ method OGRFeatureDefn::GetName().

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get the name from.

        Returns
        --------
        str:
            the name. This name is internal and should not be modified, or freed.

        )r   FeatureDefn_GetNamer   s     r   r   zFeatureDefn.GetName  r  r#   c                 .    t        j                  | g| S )a  
        GetFieldCount(FeatureDefn self) -> int
        int
        OGR_FD_GetFieldCount(OGRFeatureDefnH hDefn)

        Fetch number of fields on the passed feature definition.

        This function is the same as the C++ OGRFeatureDefn::GetFieldCount().

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get the fields count from.

        Returns
        --------
        int:
            count of fields.

        )r   FeatureDefn_GetFieldCountr   s     r   rl  zFeatureDefn.GetFieldCount  s    * --d:T::r#   c                 .    t        j                  | g| S )a  
        GetFieldDefn(FeatureDefn self, int i) -> FieldDefn
        OGRFieldDefnH
        OGR_FD_GetFieldDefn(OGRFeatureDefnH hDefn, int iField)

        Fetch field definition of the passed feature definition.

        This function is the same as the C++ method
        OGRFeatureDefn::GetFieldDefn().

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get the field definition from.
        iField:
            the field to fetch, between 0 and GetFieldCount()-1.

        Returns
        --------
        OGRFieldDefnH:
            a handle to an internal field definition object or NULL if invalid
            index. This object should not be modified or freed by the application.

        )r   FeatureDefn_GetFieldDefnr   s     r   rm  zFeatureDefn.GetFieldDefn3  s    2 ,,T9D99r#   c                 .    t        j                  | g| S )a  
        GetFieldIndex(FeatureDefn self, char const * field_name) -> int
        int
        OGR_FD_GetFieldIndex(OGRFeatureDefnH hDefn, const char \*pszFieldName)

        Find field by name.

        The field index of the first field matching the passed field name
        (case insensitively) is returned.

        This function is the same as the C++ method
        OGRFeatureDefn::GetFieldIndex.

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get field index from.
        pszFieldName:
            the field name to search for.

        Returns
        --------
        int:
            the field index, or -1 if no match found.

        )r   FeatureDefn_GetFieldIndexr   s     r   r  zFeatureDefn.GetFieldIndexN  s    6 --d:T::r#   c                 .    t        j                  | g| S )at  
        AddFieldDefn(FeatureDefn self, FieldDefn defn)
        void
        OGR_FD_AddFieldDefn(OGRFeatureDefnH hDefn, OGRFieldDefnH hNewField)

        Add a new field definition to the passed feature definition.

        To add a new field definition to a layer definition, do not use this
        function directly, but use OGR_L_CreateField() instead.

        This function should only be called while there are no OGRFeature
        objects in existence based on this OGRFeatureDefn. The OGRFieldDefn
        passed in is copied, and remains the responsibility of the caller.

        This function is the same as the C++ method
        OGRFeatureDefn::AddFieldDefn().

        Parameters
        -----------
        hDefn:
            handle to the feature definition to add the field definition to.
        hNewField:
            handle to the new field definition.

        )r   FeatureDefn_AddFieldDefnr   s     r   AddFieldDefnzFeatureDefn.AddFieldDefnk  s    4 ,,T9D99r#   c                 .    t        j                  | g| S )a  
        GetGeomFieldCount(FeatureDefn self) -> int
        int
        OGR_FD_GetGeomFieldCount(OGRFeatureDefnH hDefn)

        Fetch number of geometry fields on the passed feature definition.

        This function is the same as the C++
        OGRFeatureDefn::GetGeomFieldCount().

        .. versionadded:: 1.11

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get the fields count from.

        Returns
        --------
        int:
            count of geometry fields.

        )r   FeatureDefn_GetGeomFieldCountr   s     r   r  zFeatureDefn.GetGeomFieldCount  s    0 11$>>>r#   c                 .    t        j                  | g| S )aC  
        GetGeomFieldDefn(FeatureDefn self, int i) -> GeomFieldDefn
        OGRGeomFieldDefnH
        OGR_FD_GetGeomFieldDefn(OGRFeatureDefnH hDefn, int iGeomField)

        Fetch geometry field definition of the passed feature definition.

        This function is the same as the C++ method
        OGRFeatureDefn::GetGeomFieldDefn().

        .. versionadded:: 1.11

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get the field definition from.
        iGeomField:
            the geometry field to fetch, between 0 and GetGeomFieldCount() - 1.

        Returns
        --------
        OGRGeomFieldDefnH:
            a handle to an internal field definition object or NULL if invalid
            index. This object should not be modified or freed by the application.

        )r   FeatureDefn_GetGeomFieldDefnr   s     r   GetGeomFieldDefnzFeatureDefn.GetGeomFieldDefn  r  r#   c                 .    t        j                  | g| S )a  
        GetGeomFieldIndex(FeatureDefn self, char const * field_name) -> int
        int
        OGR_FD_GetGeomFieldIndex(OGRFeatureDefnH hDefn, const char
        \*pszGeomFieldName)

        Find geometry field by name.

        The geometry field index of the first geometry field matching the
        passed field name (case insensitively) is returned.

        This function is the same as the C++ method
        OGRFeatureDefn::GetGeomFieldIndex.

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get field index from.
        pszGeomFieldName:
            the geometry field name to search for.

        Returns
        --------
        int:
            the geometry field index, or -1 if no match found.

        )r   FeatureDefn_GetGeomFieldIndexr   s     r   r#  zFeatureDefn.GetGeomFieldIndex  s    8 11$>>>r#   c                 .    t        j                  | g| S )a  
        AddGeomFieldDefn(FeatureDefn self, GeomFieldDefn defn)
        void
        OGR_FD_AddGeomFieldDefn(OGRFeatureDefnH hDefn, OGRGeomFieldDefnH
        hNewGeomField)

        Add a new field definition to the passed feature definition.

        To add a new field definition to a layer definition, do not use this
        function directly, but use OGR_L_CreateGeomField() instead.

        This function should only be called while there are no OGRFeature
        objects in existence based on this OGRFeatureDefn. The
        OGRGeomFieldDefn passed in is copied, and remains the responsibility
        of the caller.

        This function is the same as the C++ method
        OGRFeatureDefn::AddGeomFieldDefn().

        .. versionadded:: 1.11

        Parameters
        -----------
        hDefn:
            handle to the feature definition to add the geometry field
            definition to.
        hNewGeomField:
            handle to the new field definition.

        )r   FeatureDefn_AddGeomFieldDefnr   s     r   AddGeomFieldDefnzFeatureDefn.AddGeomFieldDefn  s    > 00===r#   c                 .    t        j                  | g| S )a  
        DeleteGeomFieldDefn(FeatureDefn self, int idx) -> OGRErr
        OGRErr
        OGR_FD_DeleteGeomFieldDefn(OGRFeatureDefnH hDefn, int iGeomField)

        Delete an existing geometry field definition.

        To delete an existing geometry field definition from a layer
        definition, do not use this function directly, but use
        OGR_L_DeleteGeomField() instead ( not implemented yet).

        This method should only be called while there are no OGRFeature
        objects in existence based on this OGRFeatureDefn.

        This method is the same as the C++ method
        OGRFeatureDefn::DeleteGeomFieldDefn().

        .. versionadded:: 1.11

        Parameters
        -----------
        hDefn:
            handle to the feature definition.
        iGeomField:
            the index of the geometry field definition.

        Returns
        --------
        OGRErr:
            OGRERR_NONE in case of success.

        )r   FeatureDefn_DeleteGeomFieldDefnr   s     r   DeleteGeomFieldDefnzFeatureDefn.DeleteGeomFieldDefn  r  r#   c                 .    t        j                  | g| S )a  
        GetGeomType(FeatureDefn self) -> OGRwkbGeometryType
        OGRwkbGeometryType
        OGR_FD_GetGeomType(OGRFeatureDefnH hDefn)

        Fetch the geometry base type of the passed feature definition.

        This function is the same as the C++ method
        OGRFeatureDefn::GetGeomType().

        Starting with GDAL 1.11, this method returns
        GetGeomFieldDefn(0)->GetType().

        Parameters
        -----------
        hDefn:
            handle to the feature definition to get the geometry type from.

        Returns
        --------
        OGRwkbGeometryType:
            the base type for all geometry related to this definition.

        )r   FeatureDefn_GetGeomTyper   s     r   r  zFeatureDefn.GetGeomType   s    2 ++D8488r#   c                 .    t        j                  | g| S )a  
        SetGeomType(FeatureDefn self, OGRwkbGeometryType geom_type)
        void
        OGR_FD_SetGeomType(OGRFeatureDefnH hDefn, OGRwkbGeometryType eType)

        Assign the base geometry type for the passed layer (the same as the
        feature definition).

        All geometry objects using this type must be of the defined type or a
        derived type. The default upon creation is wkbUnknown which allows for
        any geometry type. The geometry type should generally not be changed
        after any OGRFeatures have been created against this definition.

        This function is the same as the C++ method
        OGRFeatureDefn::SetGeomType().

        Starting with GDAL 1.11, this method calls
        GetGeomFieldDefn(0)->SetType().

        Parameters
        -----------
        hDefn:
            handle to the layer or feature definition to set the geometry type to.
        eType:
            the new type to assign.

        )r   FeatureDefn_SetGeomTyper   s     r   SetGeomTypezFeatureDefn.SetGeomType;  s    8 ++D8488r#   c                 .    t        j                  | g| S )a  
        GetReferenceCount(FeatureDefn self) -> int
        int
        OGR_FD_GetReferenceCount(OGRFeatureDefnH hDefn)

        Fetch current reference count.

        This function is the same as the C++ method
        OGRFeatureDefn::GetReferenceCount().

        Parameters
        -----------
        hDefn:
            handle to the feature definition on witch OGRFeature are based on.

        Returns
        --------
        int:
            the current reference count.

        )r   FeatureDefn_GetReferenceCountr   s     r   GetReferenceCountzFeatureDefn.GetReferenceCountY  s    , 11$>>>r#   c                 .    t        j                  | g| S )a`  
        IsGeometryIgnored(FeatureDefn self) -> int
        int
        OGR_FD_IsGeometryIgnored(OGRFeatureDefnH hDefn)

        Determine whether the geometry can be omitted when fetching features.

        This function is the same as the C++ method
        OGRFeatureDefn::IsGeometryIgnored().

        Starting with GDAL 1.11, this method returns
        GetGeomFieldDefn(0)->IsIgnored().

        Parameters
        -----------
        hDefn:
            handle to the feature definition on witch OGRFeature are based on.

        Returns
        --------
        int:
            ignore state

        )r   FeatureDefn_IsGeometryIgnoredr   s     r   IsGeometryIgnoredzFeatureDefn.IsGeometryIgnoredq  s    2 11$>>>r#   c                 .    t        j                  | g| S )aS  
        SetGeometryIgnored(FeatureDefn self, int bIgnored)
        void
        OGR_FD_SetGeometryIgnored(OGRFeatureDefnH hDefn, int bIgnore)

        Set whether the geometry can be omitted when fetching features.

        This function is the same as the C++ method
        OGRFeatureDefn::SetGeometryIgnored().

        Starting with GDAL 1.11, this method calls
        GetGeomFieldDefn(0)->SetIgnored().

        Parameters
        -----------
        hDefn:
            handle to the feature definition on witch OGRFeature are based on.
        bIgnore:
            ignore state

        )r   FeatureDefn_SetGeometryIgnoredr   s     r   SetGeometryIgnoredzFeatureDefn.SetGeometryIgnored  s    , 224?$??r#   c                 .    t        j                  | g| S )a  
        IsStyleIgnored(FeatureDefn self) -> int
        int
        OGR_FD_IsStyleIgnored(OGRFeatureDefnH hDefn)

        Determine whether the style can be omitted when fetching features.

        This function is the same as the C++ method
        OGRFeatureDefn::IsStyleIgnored().

        Parameters
        -----------
        hDefn:
            handle to the feature definition on which OGRFeature are based on.

        Returns
        --------
        int:
            ignore state

        )r   FeatureDefn_IsStyleIgnoredr   s     r   IsStyleIgnoredzFeatureDefn.IsStyleIgnored  s    , ..t;d;;r#   c                 .    t        j                  | g| S )a  
        SetStyleIgnored(FeatureDefn self, int bIgnored)
        void
        OGR_FD_SetStyleIgnored(OGRFeatureDefnH hDefn, int bIgnore)

        Set whether the style can be omitted when fetching features.

        This function is the same as the C++ method
        OGRFeatureDefn::SetStyleIgnored().

        Parameters
        -----------
        hDefn:
            handle to the feature definition on witch OGRFeature are based on.
        bIgnore:
            ignore state

        )r   FeatureDefn_SetStyleIgnoredr   s     r   SetStyleIgnoredzFeatureDefn.SetStyleIgnored  s    & //<t<<r#   c                 .    t        j                  | g| S )a_  
        IsSame(FeatureDefn self, FeatureDefn other_defn) -> int
        int OGR_FD_IsSame(OGRFeatureDefnH
        hFDefn, OGRFeatureDefnH hOtherFDefn)

        Test if the feature definition is identical to the other one.

        .. versionadded:: 1.11

        Parameters
        -----------
        hFDefn:
            handle to the feature definition on witch OGRFeature are based on.
        hOtherFDefn:
            handle to the other feature definition to compare to.

        Returns
        --------
        int:
            TRUE if the feature definition is identical to the other one.

        )r   FeatureDefn_IsSamer   s     r   IsSamezFeatureDefn.IsSame  r  r#   c                 <    t        j                  |        d| _        yrR  )r   delete_FeatureDefnr   rU  s    r   rV  zFeatureDefn.Destroy  s    
d#dlr#   N)r   r   r6   r7   r   r   r   r   r   r  r   rP   r   rl  rm  r  r  r  r  r#  r  r  r  r  r  r  r  r  r  r  rV  r$   r#   r   r  r    s    3-/IOdeGH..O5.;.:6;::8?4>:?<>B!AF969<?0?6@0<0=*42r#   r  c                   r   e Zd ZdZ ed d d      ZeZej                  Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d Z$d  Z%d! Z&d" Z'd# Z(d$ Z)d% Z*d& Z+d' Z, eee      Z- eee      Z. eee      Z/ eee      Z0 eee      Z1d( Z2y))*	FieldDefnz&Proxy of C++ OGRFieldDefnShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zFieldDefn.<lambda>  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zFieldDefn.<lambda>  r|   r#   r}   r~   c                 V    t        j                  | t        j                  |i |       y)zm__init__(FieldDefn self, char const * name_null_ok="unnamed", OGRFieldType field_type=OFTString) -> FieldDefnN)r   FieldDefn_swiginitnew_FieldDefnr   s      r   rP   zFieldDefn.__init__  s"    d&8&8$&I&&IJr#   c                 .    t        j                  | g| S )z'GetName(FieldDefn self) -> char const *)r   FieldDefn_GetNamer   s     r   r   zFieldDefn.GetName  r   r#   c                 .    t        j                  | g| S )a  
        GetNameRef(FieldDefn self) -> char const *
        const char\*
        OGR_Fld_GetNameRef(OGRFieldDefnH hDefn)

        Fetch name of this field.

        This function is the same as the CPP method
        OGRFieldDefn::GetNameRef().

        Parameters
        -----------
        hDefn:
            handle to the field definition.

        Returns
        --------
        str:
            the name of the field definition.

        )r   FieldDefn_GetNameRefr   s     r   
GetNameRefzFieldDefn.GetNameRef  r  r#   c                 .    t        j                  | g| S )a  
        SetName(FieldDefn self, char const * name)
        void OGR_Fld_SetName(OGRFieldDefnH
        hDefn, const char \*pszName)

        Reset the name of this field.

        This function is the same as the CPP method OGRFieldDefn::SetName().

        Parameters
        -----------
        hDefn:
            handle to the field definition to apply the new name to.
        pszName:
            the new name to apply.

        )r   FieldDefn_SetNamer   s     r   SetNamezFieldDefn.SetName  s    $ %%d2T22r#   c                 .    t        j                  | g| S )z2GetAlternativeName(FieldDefn self) -> char const *)r   FieldDefn_GetAlternativeNamer   s     r   GetAlternativeNamezFieldDefn.GetAlternativeName.  r   r#   c                 .    t        j                  | g| S )a  
        GetAlternativeNameRef(FieldDefn self) -> char const *
        const char\*
        OGR_Fld_GetAlternativeNameRef(OGRFieldDefnH hDefn)

        Fetch the alternative name (or "alias") for this field.

        The alternative name is an optional attribute for a field which can
        provide a more user-friendly, descriptive name of a field which is not
        subject to the usual naming constraints defined by the data provider.

        This is a metadata style attribute only: the alternative name cannot
        be used in place of the actual field name during SQL queries or other
        field name dependent API calls.

        This function is the same as the CPP method
        OGRFieldDefn::GetAlternativeNameRef().

        .. versionadded:: 3.2

        Parameters
        -----------
        hDefn:
            handle to the field definition.

        Returns
        --------
        str:
            the alternative name of the field definition.

        )r   FieldDefn_GetAlternativeNameRefr   s     r   GetAlternativeNameRefzFieldDefn.GetAlternativeNameRef2  s    @ 33D@4@@r#   c                 .    t        j                  | g| S )a  
        SetAlternativeName(FieldDefn self, char const * alternativeName)
        void
        OGR_Fld_SetAlternativeName(OGRFieldDefnH hDefn, const char
        \*pszAlternativeName)

        Reset the alternative name (or "alias") for this field.

        The alternative name is an optional attribute for a field which can
        provide a more user-friendly, descriptive name of a field which is not
        subject to the usual naming constraints defined by the data provider.

        This is a metadata style attribute only: the alternative name cannot
        be used in place of the actual field name during SQL queries or other
        field name dependent API calls.

        This function is the same as the CPP method
        OGRFieldDefn::SetAlternativeName().

        .. versionadded:: 3.2

        Parameters
        -----------
        hDefn:
            handle to the field definition to apply the new alternative name to.
        pszAlternativeName:
            the new alternative name to apply.

        )r   FieldDefn_SetAlternativeNamer   s     r   SetAlternativeNamezFieldDefn.SetAlternativeNameT  r  r#   c                 .    t        j                  | g| S )a  
        GetType(FieldDefn self) -> OGRFieldType
        OGRFieldType
        OGR_Fld_GetType(OGRFieldDefnH hDefn)

        Fetch type of this field.

        This function is the same as the CPP method OGRFieldDefn::GetType().

        Parameters
        -----------
        hDefn:
            handle to the field definition to get type from.

        Returns
        --------
        OGRFieldType:
            field type.

        )r   FieldDefn_GetTyper   s     r   r  zFieldDefn.GetTypet      * %%d2T22r#   c                 .    t        j                  | g| S )a  
        SetType(FieldDefn self, OGRFieldType type)
        void OGR_Fld_SetType(OGRFieldDefnH
        hDefn, OGRFieldType eType)

        Set the type of this field.

        This should never be done to an OGRFieldDefn that is already part of
        an OGRFeatureDefn.

        This function is the same as the CPP method OGRFieldDefn::SetType().

        Parameters
        -----------
        hDefn:
            handle to the field definition to set type to.
        eType:
            the new field type.

        )r   FieldDefn_SetTyper   s     r   SetTypezFieldDefn.SetType  r  r#   c                 .    t        j                  | g| S )a  
        GetSubType(FieldDefn self) -> OGRFieldSubType
        OGRFieldSubType
        OGR_Fld_GetSubType(OGRFieldDefnH hDefn)

        Fetch subtype of this field.

        This function is the same as the CPP method
        OGRFieldDefn::GetSubType().

        .. versionadded:: 2.0

        Parameters
        -----------
        hDefn:
            handle to the field definition to get subtype from.

        Returns
        --------
        OGRFieldSubType:
            field subtype.

        )r   FieldDefn_GetSubTyper   s     r   r  zFieldDefn.GetSubType      0 ((555r#   c                 .    t        j                  | g| S )aJ  
        SetSubType(FieldDefn self, OGRFieldSubType type)
        void
        OGR_Fld_SetSubType(OGRFieldDefnH hDefn, OGRFieldSubType eSubType)

        Set the subtype of this field.

        This should never be done to an OGRFieldDefn that is already part of
        an OGRFeatureDefn.

        This function is the same as the CPP method
        OGRFieldDefn::SetSubType().

        .. versionadded:: 2.0

        Parameters
        -----------
        hDefn:
            handle to the field definition to set type to.
        eSubType:
            the new field subtype.

        )r   FieldDefn_SetSubTyper   s     r   
SetSubTypezFieldDefn.SetSubType  r  r#   c                 .    t        j                  | g| S )a6  
        GetJustify(FieldDefn self) -> OGRJustification
        OGRJustification
        OGR_Fld_GetJustify(OGRFieldDefnH hDefn)

        Get the justification for this field.

        This function is the same as the CPP method
        OGRFieldDefn::GetJustify().

        Note: no driver is know to use the concept of field justification.

        Parameters
        -----------
        hDefn:
            handle to the field definition to get justification from.

        Returns
        --------
        OGRJustification:
            the justification.

        )r   FieldDefn_GetJustifyr   s     r   
GetJustifyzFieldDefn.GetJustify  r  r#   c                 .    t        j                  | g| S )a#  
        SetJustify(FieldDefn self, OGRJustification justify)
        void
        OGR_Fld_SetJustify(OGRFieldDefnH hDefn, OGRJustification eJustify)

        Set the justification for this field.

        Note: no driver is know to use the concept of field justification.

        This function is the same as the CPP method
        OGRFieldDefn::SetJustify().

        Parameters
        -----------
        hDefn:
            handle to the field definition to set justification to.
        eJustify:
            the new justification.

        )r   FieldDefn_SetJustifyr   s     r   
SetJustifyzFieldDefn.SetJustify  s    * ((555r#   c                 .    t        j                  | g| S )a  
        GetWidth(FieldDefn self) -> int
        int OGR_Fld_GetWidth(OGRFieldDefnH
        hDefn)

        Get the formatting width for this field.

        This function is the same as the CPP method OGRFieldDefn::GetWidth().

        Parameters
        -----------
        hDefn:
            handle to the field definition to get width from.


        Returns
        --------
        int:
            the width, zero means no specified width.

        )r   FieldDefn_GetWidthr   s     r   GetWidthzFieldDefn.GetWidth  s    , &&t3d33r#   c                 .    t        j                  | g| S )a  
        SetWidth(FieldDefn self, int width)
        void OGR_Fld_SetWidth(OGRFieldDefnH
        hDefn, int nNewWidth)

        Set the formatting width for this field in characters.

        This function is the same as the CPP method OGRFieldDefn::SetWidth().

        Parameters
        -----------
        hDefn:
            handle to the field definition to set width to.
        nNewWidth:
            the new width.

        )r   FieldDefn_SetWidthr   s     r   SetWidthzFieldDefn.SetWidth  s    $ &&t3d33r#   c                 .    t        j                  | g| S )a  
        GetPrecision(FieldDefn self) -> int
        int
        OGR_Fld_GetPrecision(OGRFieldDefnH hDefn)

        Get the formatting precision for this field.

        This should normally be zero for fields of types other than OFTReal.

        This function is the same as the CPP method
        OGRFieldDefn::GetPrecision().

        Parameters
        -----------
        hDefn:
            handle to the field definition to get precision from.

        Returns
        --------
        int:
            the precision.

        )r   FieldDefn_GetPrecisionr   s     r   GetPrecisionzFieldDefn.GetPrecision3  s    0 **47$77r#   c                 .    t        j                  | g| S )a$  
        SetPrecision(FieldDefn self, int precision)
        void
        OGR_Fld_SetPrecision(OGRFieldDefnH hDefn, int nPrecision)

        Set the formatting precision for this field in characters.

        This should normally be zero for fields of types other than OFTReal.

        This function is the same as the CPP method
        OGRFieldDefn::SetPrecision().

        Parameters
        -----------
        hDefn:
            handle to the field definition to set precision to.
        nPrecision:
            the new precision.

        )r   FieldDefn_SetPrecisionr   s     r   SetPrecisionzFieldDefn.SetPrecisionM      * **47$77r#   c                 .    t        j                  | g| S )z GetTZFlag(FieldDefn self) -> int)r   FieldDefn_GetTZFlagr   s     r   	GetTZFlagzFieldDefn.GetTZFlagd  r   r#   c                 .    t        j                  | g| S )z%SetTZFlag(FieldDefn self, int tzflag))r   FieldDefn_SetTZFlagr   s     r   	SetTZFlagzFieldDefn.SetTZFlagh  r   r#   c                 .    t        j                  | g| S )z+GetTypeName(FieldDefn self) -> char const *)r   FieldDefn_GetTypeNamer   s     r   GetTypeNamezFieldDefn.GetTypeNamel  r   r#   c                 .    t        j                  | g| S )zCGetFieldTypeName(FieldDefn self, OGRFieldType type) -> char const *)r   FieldDefn_GetFieldTypeNamer   s     r   GetFieldTypeNamezFieldDefn.GetFieldTypeNamep  r   r#   c                 .    t        j                  | g| S )a  
        IsIgnored(FieldDefn self) -> int
        int OGR_Fld_IsIgnored(OGRFieldDefnH
        hDefn)

        Return whether this field should be omitted when fetching features.

        This method is the same as the C++ method OGRFieldDefn::IsIgnored().

        Parameters
        -----------
        hDefn:
            handle to the field definition

        Returns
        --------
        int:
            ignore state

        )r   FieldDefn_IsIgnoredr   s     r   	IsIgnoredzFieldDefn.IsIgnoredt  r  r#   c                 .    t        j                  | g| S )a  
        SetIgnored(FieldDefn self, int bIgnored)
        void
        OGR_Fld_SetIgnored(OGRFieldDefnH hDefn, int ignore)

        Set whether this field should be omitted when fetching features.

        This method is the same as the C++ method OGRFieldDefn::SetIgnored().

        Parameters
        -----------
        hDefn:
            handle to the field definition
        ignore:
            ignore state

        )r   FieldDefn_SetIgnoredr   s     r   
SetIgnoredzFieldDefn.SetIgnored  s    $ ((555r#   c                 .    t        j                  | g| S )a:  
        IsNullable(FieldDefn self) -> int
        int
        OGR_Fld_IsNullable(OGRFieldDefnH hDefn)

        Return whether this field can receive null values.

        By default, fields are nullable.

        Even if this method returns FALSE (i.e not-nullable field), it doesn't
        mean that OGRFeature::IsFieldSet() will necessary return TRUE, as
        fields can be temporary unset and null/not-null validation is usually
        done when OGRLayer::CreateFeature()/SetFeature() is called.

        This method is the same as the C++ method OGRFieldDefn::IsNullable().

        .. versionadded:: 2.0

        Parameters
        -----------
        hDefn:
            handle to the field definition


        Returns
        --------
        int:
            TRUE if the field is authorized to be null.

        )r   FieldDefn_IsNullabler   s     r   
IsNullablezFieldDefn.IsNullable  r  r#   c                 .    t        j                  | g| S )a  
        SetNullable(FieldDefn self, int bNullable)
        void
        OGR_Fld_SetNullable(OGRFieldDefnH hDefn, int bNullableIn)

        Set whether this field can receive null values.

        By default, fields are nullable, so this method is generally called
        with FALSE to set a not-null constraint.

        Drivers that support writing not-null constraint will advertise the
        GDAL_DCAP_NOTNULL_FIELDS driver metadata item.

        This method is the same as the C++ method OGRFieldDefn::SetNullable().

        .. versionadded:: 2.0

        Parameters
        -----------
        hDefn:
            handle to the field definition
        bNullableIn:
            FALSE if the field must have a not-null constraint.

        )r   FieldDefn_SetNullabler   s     r   SetNullablezFieldDefn.SetNullable  r   r#   c                 .    t        j                  | g| S )a  
        IsUnique(FieldDefn self) -> int
        int OGR_Fld_IsUnique(OGRFieldDefnH
        hDefn)

        Return whether this field has a unique constraint.

        By default, fields have no unique constraint.

        This method is the same as the C++ method OGRFieldDefn::IsUnique().

        .. versionadded:: 3.2

        Parameters
        -----------
        hDefn:
            handle to the field definition


        Returns
        --------
        int:
            TRUE if the field has a unique constraint.

        )r   FieldDefn_IsUniquer   s     r   IsUniquezFieldDefn.IsUnique  s    4 &&t3d33r#   c                 .    t        j                  | g| S )a  
        SetUnique(FieldDefn self, int bUnique)
        void
        OGR_Fld_SetUnique(OGRFieldDefnH hDefn, int bUniqueIn)

        Set whether this field has a unique constraint.

        By default, fields have no unique constraint, so this method is
        generally called with TRUE to set a unique constraint.

        Drivers that support writing unique constraint will advertise the
        GDAL_DCAP_UNIQUE_FIELDS driver metadata item. field can receive null
        values.

        This method is the same as the C++ method OGRFieldDefn::SetUnique().

        .. versionadded:: 3.2

        Parameters
        -----------
        hDefn:
            handle to the field definition
        bUniqueIn:
            TRUE if the field must have a unique constraint.

        )r   FieldDefn_SetUniquer   s     r   	SetUniquezFieldDefn.SetUnique  s    6 ''4t44r#   c                 .    t        j                  | g| S )a  
        GetDefault(FieldDefn self) -> char const *
        const char\*
        OGR_Fld_GetDefault(OGRFieldDefnH hDefn)

        Get default field value.

        This function is the same as the C++ method
        OGRFieldDefn::GetDefault().

        .. versionadded:: 2.0

        Parameters
        -----------
        hDefn:
            handle to the field definition.

        Returns
        --------
        str:
            default field value or NULL.

        )r   FieldDefn_GetDefaultr   s     r   
GetDefaultzFieldDefn.GetDefault  r  r#   c                 .    t        j                  | g| S )a  
        SetDefault(FieldDefn self, char const * pszValue)
        void
        OGR_Fld_SetDefault(OGRFieldDefnH hDefn, const char \*pszDefault)

        Set default field value.

        The default field value is taken into account by drivers (generally
        those with a SQL interface) that support it at field creation time.
        OGR will generally not automatically set the default field value to
        null fields by itself when calling OGRFeature::CreateFeature() /
        OGRFeature::SetFeature(), but will let the low-level layers to do the
        job. So retrieving the feature from the layer is recommended.

        The accepted values are NULL, a numeric value, a literal value
        enclosed between single quote characters (and inner single quote
        characters escaped by repetition of the single quote character),
        CURRENT_TIMESTAMP, CURRENT_TIME, CURRENT_DATE or a driver specific
        expression (that might be ignored by other drivers). For a datetime
        literal value, format should be 'YYYY/MM/DD HH:MM:SS[.sss]'
        (considered as UTC time).

        Drivers that support writing DEFAULT clauses will advertise the
        GDAL_DCAP_DEFAULT_FIELDS driver metadata item.

        This function is the same as the C++ method
        OGRFieldDefn::SetDefault().

        .. versionadded:: 2.0

        Parameters
        -----------
        hDefn:
            handle to the field definition.
        pszDefault:
            new default field value or NULL pointer.

        )r   FieldDefn_SetDefaultr   s     r   
SetDefaultzFieldDefn.SetDefault/  s    N ((555r#   c                 .    t        j                  | g| S )a  
        IsDefaultDriverSpecific(FieldDefn self) -> int
        int
        OGR_Fld_IsDefaultDriverSpecific(OGRFieldDefnH hDefn)

        Returns whether the default value is driver specific.

        Driver specific default values are those that are not NULL, a numeric
        value, a literal value enclosed between single quote characters,
        CURRENT_TIMESTAMP, CURRENT_TIME, CURRENT_DATE or datetime literal
        value.

        This function is the same as the C++ method
        OGRFieldDefn::IsDefaultDriverSpecific().

        .. versionadded:: 2.0

        Parameters
        -----------
        hDefn:
            handle to the field definition


        Returns
        --------
        int:
            TRUE if the default value is driver specific.

        )r   !FieldDefn_IsDefaultDriverSpecificr   s     r   IsDefaultDriverSpecificz!FieldDefn.IsDefaultDriverSpecificX  s    < 55dBTBBr#   c                 .    t        j                  | g| S )a  
        GetDomainName(FieldDefn self) -> char const *
        const char\*
        OGR_Fld_GetDomainName(OGRFieldDefnH hDefn)

        Return the name of the field domain for this field.

        By default, none (empty string) is returned.

        Field domains ( OGRFieldDomain class) are attached at the GDALDataset
        level and should be retrieved with GDALDatasetGetFieldDomain().

        This method is the same as the C++ method
        OGRFieldDefn::GetDomainName().

        .. versionadded:: 3.3

        Parameters
        -----------
        hDefn:
            handle to the field definition

        Returns
        --------
        str:
            the field domain name, or an empty string if there is none.

        )r   FieldDefn_GetDomainNamer   s     r   GetDomainNamezFieldDefn.GetDomainNamex  s    : ++D8488r#   c                 .    t        j                  | g| S )a8  
        SetDomainName(FieldDefn self, char const * name)
        void
        OGR_Fld_SetDomainName(OGRFieldDefnH hDefn, const char \*pszFieldName)

        Set the name of the field domain for this field.

        Field domains ( OGRFieldDomain) are attached at the GDALDataset level.

        This method is the same as the C++ method
        OGRFieldDefn::SetDomainName().

        .. versionadded:: 3.3

        Parameters
        -----------
        hDefn:
            handle to the field definition
        pszFieldName:
            Field domain name.

        )r   FieldDefn_SetDomainNamer   s     r   SetDomainNamezFieldDefn.SetDomainName  s    . ++D8488r#   c                 .    t        j                  | g| S )z*GetComment(FieldDefn self) -> char const *)r   FieldDefn_GetCommentr   s     r   
GetCommentzFieldDefn.GetComment  r  r#   c                 .    t        j                  | g| S )z0SetComment(FieldDefn self, char const * comment))r   FieldDefn_SetCommentr   s     r   
SetCommentzFieldDefn.SetComment  r  r#   c                 <    t        j                  |        d| _        yrR  )r   delete_FieldDefnr   rU  s    r   rV  zFieldDefn.Destroy  s    
D!dlr#   N)3r   r   r6   r7   r   r   r   r   r   rj  r   rP   r   r
  r  r  r  r  r  r  r  r"  r%  r(  r+  r.  r1  r4  r8  r;  r>  rA  rD  rG  rJ  rM  rP  rS  rV  rY  r\  r_  rb  re  rh  widthr   	precisionr   justifyrV  r$   r#   r   r   r     s   1-/IOdeGH,,K3603(> AD>@3.3.6464646.404(848.557<5.6(6B78485:64'6RC@9>9266 Xx(EGW%D|4IGW%Dz:.Gr#   r   c                       e Zd ZdZ ed d d      ZeZej                  Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Z eee      Z eee      Z eee      Zy)GeomFieldDefnz*Proxy of C++ OGRGeomFieldDefnShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zGeomFieldDefn.<lambda>  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zGeomFieldDefn.<lambda>  r|   r#   r}   r~   c                 V    t        j                  | t        j                  |i |       y)zu__init__(GeomFieldDefn self, char const * name_null_ok="", OGRwkbGeometryType field_type=wkbUnknown) -> GeomFieldDefnN)r   GeomFieldDefn_swiginitnew_GeomFieldDefnr   s      r   rP   zGeomFieldDefn.__init__  s"    ##D$*@*@$*Q&*QRr#   c                 .    t        j                  | g| S )z+GetName(GeomFieldDefn self) -> char const *)r   GeomFieldDefn_GetNamer   s     r   r   zGeomFieldDefn.GetName  r   r#   c                 .    t        j                  | g| S )z.GetNameRef(GeomFieldDefn self) -> char const *)r   GeomFieldDefn_GetNameRefr   s     r   r
  zGeomFieldDefn.GetNameRef  r  r#   c                 .    t        j                  | g| S )z.SetName(GeomFieldDefn self, char const * name))r   GeomFieldDefn_SetNamer   s     r   r  zGeomFieldDefn.SetName  r   r#   c                 .    t        j                  | g| S )z1GetType(GeomFieldDefn self) -> OGRwkbGeometryType)r   GeomFieldDefn_GetTyper   s     r   r  zGeomFieldDefn.GetType  r   r#   c                 .    t        j                  | g| S )z4SetType(GeomFieldDefn self, OGRwkbGeometryType type))r   GeomFieldDefn_SetTyper   s     r   r  zGeomFieldDefn.SetType  r   r#   c                 .    t        j                  | g| S )z5GetSpatialRef(GeomFieldDefn self) -> SpatialReference)r   GeomFieldDefn_GetSpatialRefr   s     r   r   zGeomFieldDefn.GetSpatialRef  r   r#   c                 .    t        j                  | g| S )z7SetSpatialRef(GeomFieldDefn self, SpatialReference srs))r   GeomFieldDefn_SetSpatialRefr   s     r   SetSpatialRefzGeomFieldDefn.SetSpatialRef  r   r#   c                 .    t        j                  | g| S )z$IsIgnored(GeomFieldDefn self) -> int)r   GeomFieldDefn_IsIgnoredr   s     r   rD  zGeomFieldDefn.IsIgnored  r   r#   c                 .    t        j                  | g| S )z,SetIgnored(GeomFieldDefn self, int bIgnored))r   GeomFieldDefn_SetIgnoredr   s     r   rG  zGeomFieldDefn.SetIgnored  r  r#   c                 .    t        j                  | g| S )z%IsNullable(GeomFieldDefn self) -> int)r   GeomFieldDefn_IsNullabler   s     r   rJ  zGeomFieldDefn.IsNullable  r  r#   c                 .    t        j                  | g| S )z.SetNullable(GeomFieldDefn self, int bNullable))r   GeomFieldDefn_SetNullabler   s     r   rM  zGeomFieldDefn.SetNullable  r   r#   N)r   r   r6   r7   r   r   r   r   r   delete_GeomFieldDefnr   rP   r   r
  r  r  r  r   r  rD  rG  rJ  rM  r   r   srsr$   r#   r   ro  ro    s    5-/IOdeGH00S7:777==9::; GW%DGW%D
=-
0Cr#   ro  c                  ,    t        j                  | i |S )zNCreateGeometryFromWkb(size_t len, SpatialReference reference=None) -> Geometry)r   CreateGeometryFromWkbr<   r   s     r   r  r        %%t6v66r#   c                  ,    t        j                  | i |S )zOCreateGeometryFromWkt(char ** val, SpatialReference reference=None) -> Geometry)r   CreateGeometryFromWktr  s     r   r  r  
  r  r#   c                  &    t        j                  |  S )z<CreateGeometryFromGML(char const * input_string) -> Geometry)r   CreateGeometryFromGMLr;   s    r   r  r        %%t,,r#   c                  &    t        j                  |  S )z=CreateGeometryFromJson(char const * input_string) -> Geometry)r   CreateGeometryFromJsonr;   s    r   r  r        &&--r#   c                  &    t        j                  |  S )zACreateGeometryFromEsriJson(char const * input_string) -> Geometry)r   CreateGeometryFromEsriJsonr;   s    r   r  r    s    **D11r#   c                  ,    t        j                  | i |S )zvBuildPolygonFromEdges(Geometry hLineCollection, int bBestEffort=0, int bAutoClose=0, double dfTolerance=0) -> Geometry)r   BuildPolygonFromEdgesr  s     r   r  r    r  r#   c                  ,    t        j                  | i |S )zApproximateArcAngles(double dfCenterX, double dfCenterY, double dfZ, double dfPrimaryRadius, double dfSecondaryAxis, double dfRotation, double dfStartAngle, double dfEndAngle, double dfMaxAngleStepSizeDegrees) -> Geometry)r   ApproximateArcAnglesr  s     r   r  r    s    $$d5f55r#   c                  &    t        j                  |  S )z,ForceToPolygon(Geometry geom_in) -> Geometry)r   ForceToPolygonr;   s    r   r  r  "  rE   r#   c                  &    t        j                  |  S )z/ForceToLineString(Geometry geom_in) -> Geometry)r   ForceToLineStringr;   s    r   r  r  &      !!4((r#   c                  &    t        j                  |  S )z1ForceToMultiPolygon(Geometry geom_in) -> Geometry)r   ForceToMultiPolygonr;   s    r   r  r  *  r@   r#   c                  &    t        j                  |  S )z/ForceToMultiPoint(Geometry geom_in) -> Geometry)r   ForceToMultiPointr;   s    r   r  r  .  r  r#   c                  &    t        j                  |  S )z4ForceToMultiLineString(Geometry geom_in) -> Geometry)r   ForceToMultiLineStringr;   s    r   r  r  2  r  r#   c                  &    t        j                  |  S )z[ForceTo(Geometry geom_in, OGRwkbGeometryType eTargetType, char ** options=None) -> Geometry)r   ForceTor;   s    r   r  r  6      <<r#   c                      e Zd ZdZ ed d d      ZeZej                  Z
d Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d Z$d  Z%d! Z&d" Z'd# Z(d$ Z)d% Z*d& Z+d' Z,d( Z-d) Z.d* Z/d+ Z0d, Z1d- Z2d. Z3d/ Z4d0 Z5d1 Z6d2 Z7d3 Z8d4 Z9d5 Z:d6 Z;d7 Z<d8 Z=d9 Z>d: Z?d; Z@d< ZAd= ZBd> ZCd? ZDd@ ZEdA ZFdB ZGdC ZHdD ZIdE ZJdF ZKdG ZLdH ZMdI ZNdJ ZOdK ZPdL ZQdM ZRdN ZSdO ZTdP ZUdQ ZVdR ZWdS ZXdT ZYdU ZZdV Z[dW Z\dX Z]dY Z^dZ Z_d[ Z`d\ Zad] Zbd^ Zcd_ Zdd` Zeda Zfdb Zgdc Zhdd Zide Zjdf Zkdg Zldh Zmdi Zndj Zodk Zpdl Zqdm Zrdn Zsyo)pGeometryz%Proxy of C++ OGRGeometryShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zGeometry.<lambda><  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zGeometry.<lambda><  r|   r#   r}   r~   c                 V    t        j                  | t        j                  |i |       y)zt__init__(Geometry self, OGRwkbGeometryType type=wkbUnknown, char * wkt=None, int wkb=0, char * gml=None) -> GeometryN)r   Geometry_swiginitnew_Geometryr   s      r   rP   zGeometry.__init__@  s"    tT%6%6%G%GHr#   c                 .    t        j                  | g| S )z
        ExportToWkt(Geometry self) -> OGRErr

        Convert a geometry into well known text format.

        For more details: :cpp:func:`OGR_G_ExportToWkt`

        Returns
        --------
        str

        )r   Geometry_ExportToWktr   s     r   ExportToWktzGeometry.ExportToWktD       ((555r#   c                 .    t        j                  | g| S )a"  
        ExportToIsoWkt(Geometry self) -> OGRErr

        Convert a geometry into SFSQL 1.2 / ISO SQL/MM Part 3 well known text
        format.

        For more details: :cpp:func:`OGR_G_ExportToIsoWkt`

        .. versionadded:: 2.0

        Returns
        --------
        str

        )r   Geometry_ExportToIsoWktr   s     r   ExportToIsoWktzGeometry.ExportToIsoWktS  s      ++D8488r#   c                 4    t        j                  | g|i |S )a  
        ExportToWkb(Geometry self, OGRwkbByteOrder byte_order=wkbNDR) -> OGRErr

        Convert a geometry well known binary format.

        For more details: :cpp:func:`OGR_G_ExportToWkb`

        Parameters
        -----------
        byte_order: osgeo.ogr.wkbXDR | osgeo.ogr.wkbNDR, default=osgeo.ogr.wkbNDR
            One of wkbXDR or wkbNDR indicating MSB or LSB byte order respectively.

        Returns
        --------
        bytes

        )r   Geometry_ExportToWkbr   s      r   ExportToWkbzGeometry.ExportToWkbe  s    $ ((????r#   c                 4    t        j                  | g|i |S )a  
        ExportToIsoWkb(Geometry self, OGRwkbByteOrder byte_order=wkbNDR) -> OGRErr

        Convert a geometry into SFSQL 1.2 / ISO SQL/MM Part 3 well known
        binary format.

        For more details: :cpp:func:`OGR_G_ExportToIsoWkb`

        .. versionadded:: 2.0

        Parameters
        -----------
        byte_order: osgeo.ogr.wkbXDR | osgeo.ogr.wkbNDR, default=osgeo.ogr.wkbNDR
            One of wkbXDR or wkbNDR indicating MSB or LSB byte order respectively.

        Returns
        --------
        bytes

        )r   Geometry_ExportToIsoWkbr   s      r   ExportToIsoWkbzGeometry.ExportToIsoWkby  s    * ++DB4B6BBr#   c                 4    t        j                  | g|i |S )zIExportToGML(Geometry self, char ** options=None) -> retStringAndCPLFree *)r   Geometry_ExportToGMLr   s      r   ExportToGMLzGeometry.ExportToGML      ((????r#   c                 .    t        j                  | g| S )zTExportToKML(Geometry self, char const * altitude_mode=None) -> retStringAndCPLFree *)r   Geometry_ExportToKMLr   s     r   ExportToKMLzGeometry.ExportToKML  r  r#   c                 4    t        j                  | g|i |S )zJExportToJson(Geometry self, char ** options=None) -> retStringAndCPLFree *)r   Geometry_ExportToJsonr   s      r   r  zGeometry.ExportToJson  r   r#   c                 4    t        j                  | g|i |S )z7AddPoint(Geometry self, double x, double y, double z=0))r   Geometry_AddPointr   s      r   AddPointzGeometry.AddPoint      %%d<T<V<<r#   c                 4    t        j                  | g|i |S )z6AddPointM(Geometry self, double x, double y, double m))r   Geometry_AddPointMr   s      r   	AddPointMzGeometry.AddPointM      &&t=d=f==r#   c                 4    t        j                  | g|i |S )zAAddPointZM(Geometry self, double x, double y, double z, double m))r   Geometry_AddPointZMr   s      r   
AddPointZMzGeometry.AddPointZM      ''>t>v>>r#   c                 .    t        j                  | g| S )z.AddPoint_2D(Geometry self, double x, double y))r   Geometry_AddPoint_2Dr   s     r   AddPoint_2DzGeometry.AddPoint_2D  r  r#   c                 .    t        j                  | g| S )zCAddGeometryDirectly(Geometry self, Geometry other_disown) -> OGRErr)r   Geometry_AddGeometryDirectlyr   s     r   AddGeometryDirectlyzGeometry.AddGeometryDirectly  r   r#   c                 .    t        j                  | g| S )z4AddGeometry(Geometry self, Geometry other) -> OGRErr)r   Geometry_AddGeometryr   s     r   AddGeometryzGeometry.AddGeometry  r  r#   c                 .    t        j                  | g| S )z5RemoveGeometry(Geometry self, int iSubGeom) -> OGRErr)r   Geometry_RemoveGeometryr   s     r   RemoveGeometryzGeometry.RemoveGeometry  r   r#   c                 .    t        j                  | g| S )a(  
        Clone(Geometry self) -> Geometry

        Make a copy of this object.

        For more details: :cpp:func:`OGR_G_Clone`

        Returns
        --------
        Geometry:
            The copy of the geometry with the same spatial reference system
            as the original.

        )r   Geometry_Cloner   s     r   r  zGeometry.Clone  s     ""4/$//r#   c                 .    t        j                  | g| S )ac  
        GetGeometryType(Geometry self) -> OGRwkbGeometryType

        Fetch geometry type.

        For more details: :cpp:func:`OGR_G_GetGeometryType`

        Returns
        --------
        int:
            The geometry type code. The types can be found with
            'osgeo.ogr.wkb' prefix. For example :py:const:`osgeo.ogr.wkbPolygon`.

        )r   Geometry_GetGeometryTyper   s     r   GetGeometryTypezGeometry.GetGeometryType       ,,T9D99r#   c                 .    t        j                  | g| S )z
        GetGeometryName(Geometry self) -> char const *

        Fetch WKT name for geometry type.

        For more details: :cpp:func:`OGR_G_GetGeometryName`

        geometry to get name from.

        Returns
        --------
        str

        )r   Geometry_GetGeometryNamer   s     r   GetGeometryNamezGeometry.GetGeometryName  r  r#   c                 .    t        j                  | g| S )zLength(Geometry self) -> double)r   Geometry_Lengthr   s     r   LengthzGeometry.Length  r   r#   c                 .    t        j                  | g| S )zArea(Geometry self) -> double)r   Geometry_Arear   s     r   AreazGeometry.Area  s    !!$...r#   c                 .    t        j                  | g| S )z"IsClockwise(Geometry self) -> bool)r   Geometry_IsClockwiser   s     r   IsClockwisezGeometry.IsClockwise  r  r#   c                 .    t        j                  | g| S )z GetArea(Geometry self) -> double)r   Geometry_GetArear   s     r   GetAreazGeometry.GetArea  s    $$T1D11r#   c                 .    t        j                  | g| S )z#GetPointCount(Geometry self) -> int)r   Geometry_GetPointCountr   s     r   GetPointCountzGeometry.GetPointCount  s    **47$77r#   c                 4    t        j                  | g|i |S )z/GetPoints(Geometry self, int nCoordDimension=0))r   Geometry_GetPointsr   s      r   	GetPointszGeometry.GetPoints  r  r#   c                 4    t        j                  | g|i |S )z*GetX(Geometry self, int point=0) -> double)r   Geometry_GetXr   s      r   GetXzGeometry.GetX      !!$8888r#   c                 4    t        j                  | g|i |S )z*GetY(Geometry self, int point=0) -> double)r   Geometry_GetYr   s      r   GetYzGeometry.GetY  r  r#   c                 4    t        j                  | g|i |S )z*GetZ(Geometry self, int point=0) -> double)r   Geometry_GetZr   s      r   GetZzGeometry.GetZ  r  r#   c                 4    t        j                  | g|i |S )z*GetM(Geometry self, int point=0) -> double)r   Geometry_GetMr   s      r   GetMzGeometry.GetM  r  r#   c                 .    t        j                  | g| S )z%GetPoint(Geometry self, int iPoint=0))r   Geometry_GetPointr   s     r   GetPointzGeometry.GetPoint  r   r#   c                 .    t        j                  | g| S )z'GetPointZM(Geometry self, int iPoint=0))r   Geometry_GetPointZMr   s     r   
GetPointZMzGeometry.GetPointZM  r   r#   c                 .    t        j                  | g| S )z(GetPoint_2D(Geometry self, int iPoint=0))r   Geometry_GetPoint_2Dr   s     r   GetPoint_2DzGeometry.GetPoint_2D  r  r#   c                 .    t        j                  | g| S )z&GetGeometryCount(Geometry self) -> int)r   Geometry_GetGeometryCountr   s     r   GetGeometryCountzGeometry.GetGeometryCount  r   r#   c                 4    t        j                  | g|i |S )zBSetPoint(Geometry self, int point, double x, double y, double z=0))r   Geometry_SetPointr   s      r   SetPointzGeometry.SetPoint#  r  r#   c                 4    t        j                  | g|i |S )zASetPointM(Geometry self, int point, double x, double y, double m))r   Geometry_SetPointMr   s      r   	SetPointMzGeometry.SetPointM'  r  r#   c                 4    t        j                  | g|i |S )zLSetPointZM(Geometry self, int point, double x, double y, double z, double m))r   Geometry_SetPointZMr   s      r   
SetPointZMzGeometry.SetPointZM+  r  r#   c                 4    t        j                  | g|i |S )z9SetPoint_2D(Geometry self, int point, double x, double y))r   Geometry_SetPoint_2Dr   s      r   SetPoint_2DzGeometry.SetPoint_2D/  r  r#   c                 .    t        j                  | g| S )z
        SwapXY(Geometry self)

        Swap x and y coordinates.

        For more details: :cpp:func:`OGR_G_SwapXY`

        .. versionadded:: 2.3.0


        )r   Geometry_SwapXYr   s     r   SwapXYzGeometry.SwapXY3  s     ##D0400r#   c                 .    t        j                  | g| S )z3GetGeometryRef(Geometry self, int geom) -> Geometry)r   Geometry_GetGeometryRefr   s     r   r  zGeometry.GetGeometryRefA  r   r#   c                 .    t        j                  | g| S )a  
        Simplify(Geometry self, double tolerance) -> Geometry

        Compute a simplified geometry.

        For more details: :cpp:func:`OGR_G_Simplify`

        Parameters
        -----------
        tolerance: float
            The distance tolerance for the simplification.

        Returns
        --------
        Geometry:
            The simplified geometry or None if an error occurs.

        )r   Geometry_Simplifyr   s     r   SimplifyzGeometry.SimplifyE  r  r#   c                 .    t        j                  | g| S )a  
        SimplifyPreserveTopology(Geometry self, double tolerance) -> Geometry

        Simplify the geometry while preserving topology.

        For more details: :cpp:func:`OGR_G_SimplifyPreserveTopology`

        Parameters
        -----------
        tolerance: float
            The distance tolerance for the simplification.

        Returns
        --------
        Geometry:
            The simplified geometry or None if an error occurs.

        )r   !Geometry_SimplifyPreserveTopologyr   s     r   SimplifyPreserveTopologyz!Geometry.SimplifyPreserveTopologyZ  s    & 55dBTBBr#   c                 4    t        j                  | g|i |S )a  
        DelaunayTriangulation(Geometry self, double dfTolerance=0.0, int bOnlyEdges=FALSE) -> Geometry

        Return a Delaunay triangulation of the vertices of the geometry.

        For more details: :cpp:func:`OGR_G_DelaunayTriangulation`

        .. versionadded:: 2.1

        Parameters
        -----------
        dfTolerance: float
            optional snapping tolerance to use for improved robustness
        bOnlyEdges: bool
            If True, will return a MULTILINESTRING, otherwise it will
            return a GEOMETRYCOLLECTION containing triangular POLYGONs.

        Returns
        --------
        Geometry:
            The geometry resulting from the Delaunay triangulation or None if an
            error occurs.

        )r   Geometry_DelaunayTriangulationr   s      r   DelaunayTriangulationzGeometry.DelaunayTriangulationo  s    2 224I$I&IIr#   c                 .    t        j                  | g| S )z
        Polygonize(Geometry self) -> Geometry

        Polygonizes a set of sparse edges.

        For more details: :cpp:func:`OGR_G_Polygonize`

        Returns
        --------
        Geometry:
            A new geometry or None on failure.

        )r   Geometry_Polygonizer   s     r   
PolygonizezGeometry.Polygonize  r!  r#   c                 .    t        j                  | g| S )z
        Boundary(Geometry self) -> Geometry

        Compute boundary.

        For more details: :cpp:func:`OGR_G_Boundary`

        Returns
        --------
        Geometry:
            A new geometry or None on failure.

        )r   Geometry_Boundaryr   s     r   BoundaryzGeometry.Boundary       %%d2T22r#   c                 .    t        j                  | g| S )z
        GetBoundary(Geometry self) -> Geometry

        Compute boundary (deprecated)

        For more details: :cpp:func:`OGR_G_GetBoundary`

        ..warning:: Deprecated

        See: :cpp:func:`OGR_G_Boundary`

        )r   Geometry_GetBoundaryr   s     r   GetBoundaryzGeometry.GetBoundary  r  r#   c                 .    t        j                  | g| S )a.  
        ConvexHull(Geometry self) -> Geometry

        Compute convex hull.

        For more details: :cpp:func:`OGR_G_ConvexHull`

        Returns
        --------
        Geometry:
            a handle to A newly allocated geometry now owned by the caller, or
            None on failure.

        )r   Geometry_ConvexHullr   s     r   
ConvexHullzGeometry.ConvexHull       ''4t44r#   c                 .    t        j                  | g| S )zEConcaveHull(Geometry self, double ratio, bool allowHoles) -> Geometry)r   Geometry_ConcaveHullr   s     r   ConcaveHullzGeometry.ConcaveHull  r  r#   c                 .    t        j                  | g| S )aF  
        MakeValid(Geometry self, char ** options=None) -> Geometry

        Attempts to make an invalid geometry valid without losing vertices.

        For more details: :cpp:func:`OGR_G_MakeValidEx`

        .. versionadded:: 3.0
        .. versionadded:: 3.4 options

        Parameters
        -----------
        options: list[str], optional
            papszOptions to be passed in. For example: ["METHOD=STRUCTURE"].

        Returns
        --------
        Geometry:
            A newly allocated geometry now owned by the caller, or None on
            failure.

        )r   Geometry_MakeValidr   s     r   	MakeValidzGeometry.MakeValid  r  r#   c                 .    t        j                  | g| S )ae  
        Normalize(Geometry self) -> Geometry

        Attempts to bring geometry into normalized/canonical form.

        For more details: :cpp:func:`OGR_G_Normalize`

        .. versionadded:: 3.3

        Returns
        --------
        Geometry:
            A newly allocated geometry now owned by the caller, or None on
            failure.

        )r   Geometry_Normalizer   s     r   	NormalizezGeometry.Normalize  s    " &&t3d33r#   c                 .    t        j                  | g| S )z7RemoveLowerDimensionSubGeoms(Geometry self) -> Geometry)r   %Geometry_RemoveLowerDimensionSubGeomsr   s     r   RemoveLowerDimensionSubGeomsz%Geometry.RemoveLowerDimensionSubGeoms  s    99$FFFr#   c                 4    t        j                  | g|i |S )av  
        Buffer(Geometry self, double distance, int quadsecs=30) -> Geometry

        Compute buffer of geometry.

        For more details: :cpp:func:`OGR_G_Buffer`

        Parameters
        -----------
        distance: float
            The buffer distance to be applied. Should be expressed into
            the same unit as the coordinates of the geometry.
        quadsecs: int, default=30
            The number of segments used to approximate a 90 degree
            (quadrant) of curvature.

        Returns
        --------
        Geometry:
            The newly created geometry or None if an error occurs.

        )r   Geometry_Bufferr   s      r   BufferzGeometry.Buffer  s    . ##D:4:6::r#   c                 .    t        j                  | g| S )a  
        Intersection(Geometry self, Geometry other) -> Geometry

        Compute intersection.

        For more details: :cpp:func:`OGR_G_Intersection`

        Parameters
        -----------
        other: Geometry
            The other geometry.

        Returns
        --------
        Geometry:
            A new geometry representing the intersection or None if there is no
            intersection or an error occurs.

        )r   Geometry_Intersectionr   s     r   r*  zGeometry.Intersection  s    ( ))$666r#   c                 .    t        j                  | g| S )ap  
        Union(Geometry self, Geometry other) -> Geometry

        Compute union.

        For more details: :cpp:func:`OGR_G_Union`

        Parameters
        -----------
        other: Geometry
            The other geometry.

        Returns
        --------
        Geometry:
            A new geometry representing the union or None if an error occurs.

        )r   Geometry_Unionr   s     r   r-  zGeometry.Union-  s    & ""4/$//r#   c                 .    t        j                  | g| S )a  
        UnionCascaded(Geometry self) -> Geometry

        Compute union using cascading.

        For more deails: :cpp:func:`OGR_G_UnionCascaded`

        Returns
        --------
        Geometry:
            A new geometry representing the union or None if an error occurs.

        )r   Geometry_UnionCascadedr   s     r   UnionCascadedzGeometry.UnionCascadedB  r  r#   c                 .    t        j                  | g| S )a  
        Difference(Geometry self, Geometry other) -> Geometry

        Compute difference.

        For more details: :cpp:func:`OGR_G_Difference`

        Parameters
        -----------
        other: Geometry
            The other geometry.

        Returns
        --------
        Geometry:
            A new geometry representing the difference or None if the difference
            is empty or an error occurs.

        )r   Geometry_Differencer   s     r   
DifferencezGeometry.DifferenceR  s    ( ''4t44r#   c                 .    t        j                  | g| S )a  
        SymDifference(Geometry self, Geometry other) -> Geometry

        Compute symmetric difference.

        For more details: :cpp:func:`OGR_G_SymDifference`

        Parameters
        -----------
        other:
            the other geometry.

        Returns
        --------
        Geometry:
            A new geometry representing the symmetric difference or None if the
            difference is empty or an error occurs.

        )r   Geometry_SymDifferencer   s     r   r0  zGeometry.SymDifferenceh  s    ( **47$77r#   c                 .    t        j                  | g| S )z
        SymmetricDifference(Geometry self, Geometry other) -> Geometry

        Compute symmetric difference (deprecated)

        For more details: :cpp:func:`OGR_G_SymmetricDifference`

        .. warning:: Deprecated


        )r   Geometry_SymmetricDifferencer   s     r   SymmetricDifferencezGeometry.SymmetricDifference~  s     00===r#   c                 .    t        j                  | g| S )a  
        Distance(Geometry self, Geometry other) -> double

        Compute distance between two geometries.

        For more details: :cpp:func:`OGR_G_Distance`

        Parameters
        -----------
        other: Geometry
            The other geometry to compare against.

        Returns
        --------
        float:
            The distance between the geometries or -1 if an error occurs.

        )r   Geometry_Distancer   s     r   DistancezGeometry.Distance  r  r#   c                 .    t        j                  | g| S )a  
        Distance3D(Geometry self, Geometry other) -> double

        Returns the 3D distance between two geometries.

        For more details: :cpp:func:`OGR_G_Distance3D`

        .. versionadded:: 2.2

        Parameters
        -----------
        other: Geometry
            The other geometry to compare against.

        Returns
        --------
        float:
            The distance between the geometries or -1 if an error occurs.

        )r   Geometry_Distance3Dr   s     r   
Distance3DzGeometry.Distance3D  r  r#   c                 .    t        j                  | g| S )z
        Empty(Geometry self)

        Clear geometry information.

        For more details: :cpp:func:`OGR_G_Empty`

        )r   Geometry_Emptyr   s     r   EmptyzGeometry.Empty  s     ""4/$//r#   c                 .    t        j                  | g| S )z
        IsEmpty(Geometry self) -> bool

        Test if the geometry is empty.

        For more details: :cpp:func:`OGR_G_IsEmpty`

        Returns
        --------
        int:
            True if the geometry has no points, otherwise False.

        )r   Geometry_IsEmptyr   s     r   IsEmptyzGeometry.IsEmpty       $$T1D11r#   c                 .    t        j                  | g| S )z
        IsValid(Geometry self) -> bool

        Test if the geometry is valid.

        For more details: :cpp:func:`OGR_G_IsValid`

        Returns
        --------
        int:
            True if the geometry has no points, otherwise False.

        )r   Geometry_IsValidr   s     r   IsValidzGeometry.IsValid  ri  r#   c                 .    t        j                  | g| S )z
        IsSimple(Geometry self) -> bool

        Returns True if the geometry is simple.

        For more details: :cpp:func:`OGR_G_IsSimple`

        Returns
        --------
        int:
            True if object is simple, otherwise False.

        )r   Geometry_IsSimpler   s     r   IsSimplezGeometry.IsSimple  r7  r#   c                 .    t        j                  | g| S )z
        IsRing(Geometry self) -> bool

        Test if the geometry is a ring.

        For more details: :cpp:func:`OGR_G_IsRing`

        Returns
        --------
        int:
            True if the geometry has no points, otherwise False.

        )r   Geometry_IsRingr   s     r   IsRingzGeometry.IsRing  s     ##D0400r#   c                 .    t        j                  | g| S )a  
        Intersects(Geometry self, Geometry other) -> bool

        Determines whether two geometries intersect.

        For more details: :cpp:func:`OGR_G_Intersects`

        Parameters
        -----------
        other: Geometry
            The other geometry to test against.

        Returns
        --------
        int:
            True if the geometries intersect, otherwise False.

        )r   Geometry_Intersectsr   s     r   
IntersectszGeometry.Intersects  r  r#   c                 .    t        j                  | g| S )z0Intersect(Geometry self, Geometry other) -> bool)r   Geometry_Intersectr   s     r   	IntersectzGeometry.Intersect  r  r#   c                 .    t        j                  | g| S )a~  
        Equals(Geometry self, Geometry other) -> bool

        Returns True if two geometries are equivalent.

        For more details: :cpp:func:`OGR_G_Equals`

        Parameters
        -----------
        other: Geometry
            The other geometry to test against.

        Returns
        --------
        int:
            True if equivalent or False otherwise.

        )r   Geometry_Equalsr   s     r   EqualszGeometry.Equals      & ##D0400r#   c                 .    t        j                  | g| S )z,Equal(Geometry self, Geometry other) -> bool)r   Geometry_Equalr   s     r   r  zGeometry.Equal1  r   r#   c                 .    t        j                  | g| S )aj  
        Disjoint(Geometry self, Geometry other) -> bool

        Test for disjointness.

        For more details: :cpp:func:`OGR_G_Disjoint`

        Parameters
        -----------
        other: Geometry
            The other geometry to compare.

        Returns
        --------
        int:
            True if they are disjoint, otherwise False.

        )r   Geometry_Disjointr   s     r   DisjointzGeometry.Disjoint5  r  r#   c                 .    t        j                  | g| S )a[  
        Touches(Geometry self, Geometry other) -> bool

        Test for touching.

        For more details: :cpp:func:`OGR_G_Touches`

        Parameters
        -----------
        other:
            the other geometry to compare.

        Returns
        --------
        int:
            True if they are touching, otherwise False.

        )r   Geometry_Touchesr   s     r   ToucheszGeometry.TouchesJ      & $$T1D11r#   c                 .    t        j                  | g| S )ad  
        Crosses(Geometry self, Geometry other) -> bool

        Test for crossing.

        For more details: :cpp:func:`OGR_G_Crosses`

        Parameters
        -----------
        other: Geometry
            the other geometry to compare.

        Returns
        --------
        int:
            True if they are crossing, otherwise False.

        )r   Geometry_Crossesr   s     r   CrosseszGeometry.Crosses_  r  r#   c                 .    t        j                  | g| S )ah  
        Within(Geometry self, Geometry other) -> bool

        Test for containment.

        For more details: :cpp:func:`OGR_G_Within`

        Parameters
        -----------
        other: Geometry
            the other geometry to compare.

        Returns
        --------
        int:
            True if this is within other, otherwise False.

        )r   Geometry_Withinr   s     r   WithinzGeometry.Withint  r|  r#   c                 .    t        j                  | g| S )ax  
        Contains(Geometry self, Geometry other) -> bool

        Test for containment.

        For more details: :cpp:func:`OGR_G_Contains`

        Parameters
        -----------
        other: Geometry
            the other geometry to compare.

        Returns
        --------
        int:
            True if this contains the other geometry, otherwise False.

        )r   Geometry_Containsr   s     r   ContainszGeometry.Contains  r  r#   c                 .    t        j                  | g| S )ah  
        Overlaps(Geometry self, Geometry other) -> bool

        Test for overlap.

        For more details: :cpp:func:`OGR_G_Overlaps`

        Parameters
        -----------
        other: Geometry
            the other geometry to compare.

        Returns
        --------
        int:
            True if they are overlapping, otherwise False.

        )r   Geometry_Overlapsr   s     r   OverlapszGeometry.Overlaps  r  r#   c                 .    t        j                  | g| S )a  
        TransformTo(Geometry self, SpatialReference reference) -> OGRErr

        Transform geometry to new spatial reference system.

        For more details: :cpp:func:`OGR_G_TransformTo`

        Parameters
        -----------
        reference: SpatialReference
           The spatial reference system to apply.

        Returns
        --------
        int:
            :py:const:`osgeo.ogr.OGRERR_NONE` on success, or an error code.

        )r   Geometry_TransformTor   s     r   TransformTozGeometry.TransformTo  r  r#   c                 .    t        j                  | g| S )z
        GetSpatialReference(Geometry self) -> SpatialReference

        For more details: :cpp:func:`OGR_G_GetSpatialReference`

        Returns spatial reference system for geometry.

        Returns
        --------
        SpatialReference

        )r   Geometry_GetSpatialReferencer   s     r   GetSpatialReferencezGeometry.GetSpatialReference  s     00===r#   c                 .    t        j                  | g| S )aM  
        AssignSpatialReference(Geometry self, SpatialReference reference)

        Assign spatial reference to this object.

        For more details: :cpp:func:`OGR_G_AssignSpatialReference`

        Parameters
        -----------
        reference: SpatialReference
            The new spatial reference system to apply.

        )r   Geometry_AssignSpatialReferencer   s     r   AssignSpatialReferencezGeometry.AssignSpatialReference  s     33D@4@@r#   c                 .    t        j                  | g| S )z
        CloseRings(Geometry self)

        Force rings to be closed.

        For more details: :cpp:func:`OGR_G_CloseRings`

        )r   Geometry_CloseRingsr   s     r   
CloseRingszGeometry.CloseRings  r?  r#   c                 .    t        j                  | g| S )z
        FlattenTo2D(Geometry self)

        Convert geometry to strictly 2D.

        For more details: :cpp:func:`OGR_G_FlattenTo2D`

        )r   Geometry_FlattenTo2Dr   s     r   FlattenTo2DzGeometry.FlattenTo2D  s     ((555r#   c                 .    t        j                  | g| S )a^  
        Segmentize(Geometry self, double dfMaxLength)

        Modify the geometry such it has no segment longer then the given
        distance.

        For more details: :cpp:func:`OGR_G_Segmentize`

        Parameters
        -----------
        dfMaxLength: float
            the maximum distance between 2 points after segmentization

        )r   Geometry_Segmentizer   s     r   
SegmentizezGeometry.Segmentize  r>  r#   c                 .    t        j                  | g| S )a  
        GetEnvelope(Geometry self)

        Computes and returns the bounding envelope for this geometry in the
        passed psEnvelope structure.

        For more details: :cpp:func:`OGR_G_GetEnvelope`

        .. warning:: Check the return order of the bounds.

        Returns
        --------
        minx: float
        maxx: float
        miny: float
        maxy: float

        )r   Geometry_GetEnveloper   s     r   GetEnvelopezGeometry.GetEnvelope  r  r#   c                 .    t        j                  | g| S )a  
        GetEnvelope3D(Geometry self)

        Computes and returns the bounding envelope (3D) for this geometry in
        the passed psEnvelope structure.

        For more details: :cpp:func:`OGR_G_GetEnvelope3D`

        .. warning:: Check the return order of the bounds.

        Returns
        --------
        minx: float
        maxx: float
        miny: float
        maxy: float
        minz: float
        maxz: float

        )r   Geometry_GetEnvelope3Dr   s     r   GetEnvelope3DzGeometry.GetEnvelope3D#  r5  r#   c                 .    t        j                  | g| S )z
        Centroid(Geometry self) -> Geometry

        Compute the geometry centroid.

        For more details: :cpp:func:`OGR_G_Centroid`

        Returns
        --------
        Geometry

        )r   Geometry_Centroidr   s     r   CentroidzGeometry.Centroid:  s     %%d2T22r#   c                 .    t        j                  | g| S )a:  
        PointOnSurface(Geometry self) -> Geometry

        Returns a point guaranteed to lie on the surface.

        For more details: :cpp:func:`OGR_G_PointOnSurface`

        Returns
        --------
        Geometry:
            A point guaranteed to lie on the surface or None if an error occurred.

        )r   Geometry_PointOnSurfacer   s     r   PointOnSurfacezGeometry.PointOnSurfaceI  r  r#   c                 .    t        j                  | g| S )z
        WkbSize(Geometry self) -> size_t

        Returns size of related binary representation.

        For more details: :cpp:func:`OGR_G_WkbSize`

        Returns
        --------
        int

        )r   Geometry_WkbSizer   s     r   WkbSizezGeometry.WkbSizeY  s     $$T1D11r#   c                 .    t        j                  | g| S )a  
        GetCoordinateDimension(Geometry self) -> int

        Get the dimension of the coordinates in this geometry.

        For more details: :cpp:func:`OGR_G_GetCoordinateDimension`

        .. warning:: Deprecated. Use :py:func:`CoordinateDimension`,
            :py:func:`Is3D`, or :py:func:`IsMeasured`.

        Returns
        --------
        int:
            This will return 2 or 3.

        )r   Geometry_GetCoordinateDimensionr   s     r   GetCoordinateDimensionzGeometry.GetCoordinateDimensionh  s    " 33D@4@@r#   c                 .    t        j                  | g| S )aZ  
        CoordinateDimension(Geometry self) -> int

        Get the dimension of the coordinates in this geometry.

        For more details: :cpp:func:`OGR_G_CoordinateDimension`

        .. versionadded:: 2.1

        Returns
        --------
        int:
            This will return 2 for XY, 3 for XYZ and XYM, and 4 for XYZM data.

        )r   Geometry_CoordinateDimensionr   s     r   CoordinateDimensionzGeometry.CoordinateDimension{  s      00===r#   c                 .    t        j                  | g| S )a  
        Is3D(Geometry self) -> int

        See whether this geometry has Z coordinates.

        For more details: :cpp:func:`OGR_G_Is3D`

        .. versionadded:: 2.1

        Returns
        --------
        int:
            True if the geometry has Z coordinates.

        )r   Geometry_Is3Dr   s     r   Is3DzGeometry.Is3D  s      !!$...r#   c                 .    t        j                  | g| S )a  
        IsMeasured(Geometry self) -> int

        See whether this geometry is measured.

        For more details: :cpp:func:`OGR_G_IsMeasured`

        .. versionadded:: 2.1

        Returns
        --------
        int:
            True if the geometry has M coordinates.

        )r   Geometry_IsMeasuredr   s     r   
IsMeasuredzGeometry.IsMeasured  s      ''4t44r#   c                 .    t        j                  | g| S )a~  
        SetCoordinateDimension(Geometry self, int dimension)

        Set the coordinate dimension.

        For more details: :cpp:func:`OGR_G_SetCoordinateDimension`

        .. warning:: Deprecated. Use :py:func:`Set3D` or :py:func:`SetMeasured`.

        Parameters
        -----------
        dimension: int
            New coordinate dimension value, either 2 or 3.

        )r   Geometry_SetCoordinateDimensionr   s     r   SetCoordinateDimensionzGeometry.SetCoordinateDimension  s      33D@4@@r#   c                 .    t        j                  | g| S )a;  
        Set3D(Geometry self, int b3D)

        Add or remove the Z coordinate dimension.

        For more details: :cpp:func:`OGR_G_Set3D`

        .. versionadded:: 2.1

        Parameters
        -----------
        bIs3D: bool
            Should the geometry have a Z dimension, either True or False.

        )r   Geometry_Set3Dr   s     r   Set3DzGeometry.Set3D  s      ""4/$//r#   c                 .    t        j                  | g| S )aS  
        SetMeasured(Geometry self, int bMeasured)

        Add or remove the M coordinate dimension.

        For more details: :cpp:func:`OGR_G_SetMeasured`

        .. versionadded:: 2.1

        Parameters
        -----------
        bIsMeasured: bool
            Should the geometry have a M dimension, either True or False.

        )r   Geometry_SetMeasuredr   s     r   SetMeasuredzGeometry.SetMeasured  s      ((555r#   c                 .    t        j                  | g| S )a  
        GetDimension(Geometry self) -> int

        Get the dimension of this geometry.

        For more details: :cpp:func:`OGR_G_GetDimension`

        Returns
        --------
        int:
            0 for points, 1 for lines, and 2 for surfaces.

        )r   Geometry_GetDimensionr   s     r   GetDimensionzGeometry.GetDimension  s     ))$666r#   c                 .    t        j                  | g| S )zBHasCurveGeometry(Geometry self, int bLookForCircular=FALSE) -> int)r   Geometry_HasCurveGeometryr   s     r   HasCurveGeometryzGeometry.HasCurveGeometry  r   r#   c                 4    t        j                  | g|i |S )zhGetLinearGeometry(Geometry self, double dfMaxAngleStepSizeDegrees=0.0, char ** options=None) -> Geometry)r   Geometry_GetLinearGeometryr   s      r   GetLinearGeometryzGeometry.GetLinearGeometry  s    ..tEdEfEEr#   c                 4    t        j                  | g|i |S )zAGetCurveGeometry(Geometry self, char ** options=None) -> Geometry)r   Geometry_GetCurveGeometryr   s      r   GetCurveGeometryzGeometry.GetCurveGeometry  rT  r#   c                 .    t        j                  | g| S )z3Value(Geometry self, double dfDistance) -> Geometry)r   Geometry_Valuer   s     r   ValuezGeometry.Value  r   r#   c                 .    t        j                  | g| S )a  
        Transform(Geometry self, CoordinateTransformation trans) -> OGRErr
        Transform(Geometry self, GeomTransformer transformer) -> Geometry

        Apply arbitrary coordinate transformation to geometry.

        For more details: :cpp:func:`OGR_G_Transform`

        Parameters
        -----------
        trans: CoordinateTransform
            The transformation to apply.

        Returns
        --------
        Geometry:
            The transformed geometry.

        )r   Geometry_Transformr   s     r   	TransformzGeometry.Transform  s    ( &&t3d33r#   c                 .    t        j                  | g| S )z9CreatePreparedGeometry(Geometry self) -> PreparedGeometry)r   Geometry_CreatePreparedGeometryr   s     r   CreatePreparedGeometryzGeometry.CreatePreparedGeometry  s    33D@4@@r#   c                 4    | j                  |        d| _        y )Nr   )r   r   rU  s    r   rV  zGeometry.Destroy!  s    
D!dlr#   c                 "    | j                         S r-   )r  rU  s    r   __str__zGeometry.__str__%  s      ""r#   c                 "    | j                         S r-   r  rU  s    r   r  zGeometry.__copy__(  s    ZZ\r#   c                     | j                         }| j                         }|r|j                  |j                                |S r-   )r  r  r  )r   memogr  s       r   __deepcopy__zGeometry.__deepcopy__+  s7    
**,a$$&c	

"
"399;
/hr#   c                 <    | j                   d| j                         fS )Nr$   )r   r  rU  s    r   
__reduce__zGeometry.__reduce__2  s    nnb$"2"2"455r#   c                 <    t        |      }|j                  | _        y r-   )r  r
   )r   stateresults      r   __setstate__zGeometry.__setstate__5  s    &u-KK	r#   c              #   n   K   t        | j                               D ]  }| j                  |        y wr-   )r  r  r  )r   r  s     r   rj  zGeometry.__iter__9  s4     t,,./ 	)A%%a((	)s   35N)tr   r   r6   r7   r   r   r   r   r   delete_Geometryr   rP   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r
  r  r  r  r  r  r  r  r"  r%  r  r*  r-  r0  r3  r6  r:  r=  rA  rD  rG  rJ  rM  r*  r-  rT  rW  r0  r\  r_  rb  re  rh  rl  ro  rr  ru  rx  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rV  r  r  r  r  r  rj  r$   r#   r   r  r  9  sC   0-/IOdeGH++I69$@(C.@6A=>?6>690":":"1/628>9999356;=>?@193*C*J65 3 65"6424&G;27,0*8 5,8,>3*5.	02 2 3 1 5*41*03*2*2*1*3*3*6*>A 	5	65"6*8.39 2A&>$/$5$A$0$6$7 ;FE04,A#6 )r#   r  c                   X    e Zd ZdZ ed d d      Zd ZeZe	j                  Zd Zd Zy	)
PreparedGeometryz-Proxy of C++ OGRPreparedGeometryShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zPreparedGeometry.<lambda>D  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zPreparedGeometry.<lambda>D  r|   r#   r}   r~   c                     t        d      r   r   r   s      r   rP   zPreparedGeometry.__init__F  r   r#   c                 .    t        j                  | g| S )z=Intersects(PreparedGeometry self, Geometry otherGeom) -> bool)r   PreparedGeometry_Intersectsr   s     r   ru  zPreparedGeometry.IntersectsK  r   r#   c                 .    t        j                  | g| S )z;Contains(PreparedGeometry self, Geometry otherGeom) -> bool)r   PreparedGeometry_Containsr   s     r   r  zPreparedGeometry.ContainsO  r   r#   N)r   r   r6   r7   r   r   rP   r   r   r   delete_PreparedGeometryr   ru  r  r$   r#   r   r  r  A  s6    8-/IOdeG7H33=;r#   r  c                   R    e Zd ZdZ ed d d      ZeZd Ze	j                  Zd Zy)	GeomTransformerz,Proxy of C++ OGRGeomTransformerShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zGeomTransformer.<lambda>X  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zGeomTransformer.<lambda>X  r|   r#   r}   r~   c                 P    t        j                  | t        j                  |        y)zd__init__(GeomTransformer self, CoordinateTransformation ct, char ** options=None) -> GeomTransformerN)r   GeomTransformer_swiginitnew_GeomTransformerr   s     r   rP   zGeomTransformer.__init__[  s    %%dD,D,Dd,KLr#   c                 .    t        j                  | g| S )z>Transform(GeomTransformer self, Geometry src_geom) -> Geometry)r   GeomTransformer_Transformr   s     r   r  zGeomTransformer.Transform`  r   r#   N)r   r   r6   r7   r   r   r   r   rP   r   delete_GeomTransformerr   r  r$   r#   r   r  r  U  s4    7-/IOdeGHM 22;r#   r  c                       e Zd ZdZ ed d d      Zd ZeZe	j                  Zd Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zy)FieldDomainz(Proxy of C++ OGRFieldDomainShadow class.c                 6    | j                   j                         S r-   rt   ru   s    r   rw   zFieldDomain.<lambda>i  rx   r#   c                 8    | j                   j                  |      S r-   rt   rz   s     r   rw   zFieldDomain.<lambda>i  r|   r#   r}   r~   c                     t        d      r   r   r   s      r   rP   zFieldDomain.__init__k  r   r#   c                 .    t        j                  | g| S )z)GetName(FieldDomain self) -> char const *)r   FieldDomain_GetNamer   s     r   r   zFieldDomain.GetNamep  r   r#   c                 .    t        j                  | g| S )z0GetDescription(FieldDomain self) -> char const *)r   FieldDomain_GetDescriptionr   s     r   r   zFieldDomain.GetDescriptiont  r   r#   c                 .    t        j                  | g| S )z.GetFieldType(FieldDomain self) -> OGRFieldType)r   FieldDomain_GetFieldTyper   s     r   r@  zFieldDomain.GetFieldTypex  r  r#   c                 .    t        j                  | g| S )z4GetFieldSubType(FieldDomain self) -> OGRFieldSubType)r   FieldDomain_GetFieldSubTyper   s     r   GetFieldSubTypezFieldDomain.GetFieldSubType|  r   r#   c                 .    t        j                  | g| S )z5GetDomainType(FieldDomain self) -> OGRFieldDomainType)r   FieldDomain_GetDomainTyper   s     r   GetDomainTypezFieldDomain.GetDomainType  r   r#   c                 .    t        j                  | g| S )z=GetSplitPolicy(FieldDomain self) -> OGRFieldDomainSplitPolicy)r   FieldDomain_GetSplitPolicyr   s     r   GetSplitPolicyzFieldDomain.GetSplitPolicy  r   r#   c                 .    t        j                  | g| S )zBSetSplitPolicy(FieldDomain self, OGRFieldDomainSplitPolicy policy))r   FieldDomain_SetSplitPolicyr   s     r   SetSplitPolicyzFieldDomain.SetSplitPolicy  r   r#   c                 .    t        j                  | g| S )z=GetMergePolicy(FieldDomain self) -> OGRFieldDomainMergePolicy)r   FieldDomain_GetMergePolicyr   s     r   GetMergePolicyzFieldDomain.GetMergePolicy  r   r#   c                 .    t        j                  | g| S )zBSetMergePolicy(FieldDomain self, OGRFieldDomainMergePolicy policy))r   FieldDomain_SetMergePolicyr   s     r   SetMergePolicyzFieldDomain.SetMergePolicy  r   r#   c                 .    t        j                  | g| S )z9GetEnumeration(FieldDomain self) -> OGRCodedValue const *)r   FieldDomain_GetEnumerationr   s     r   GetEnumerationzFieldDomain.GetEnumeration  r   r#   c                 .    t        j                  | g| S )z*GetMinAsDouble(FieldDomain self) -> double)r   FieldDomain_GetMinAsDoubler   s     r   GetMinAsDoublezFieldDomain.GetMinAsDouble  r   r#   c                 .    t        j                  | g| S )z0GetMinAsString(FieldDomain self) -> char const *)r   FieldDomain_GetMinAsStringr   s     r   GetMinAsStringzFieldDomain.GetMinAsString  r   r#   c                 .    t        j                  | g| S )z(IsMinInclusive(FieldDomain self) -> bool)r   FieldDomain_IsMinInclusiver   s     r   IsMinInclusivezFieldDomain.IsMinInclusive  r   r#   c                 .    t        j                  | g| S )z*GetMaxAsDouble(FieldDomain self) -> double)r   FieldDomain_GetMaxAsDoubler   s     r   GetMaxAsDoublezFieldDomain.GetMaxAsDouble  r   r#   c                 .    t        j                  | g| S )z0GetMaxAsString(FieldDomain self) -> char const *)r   FieldDomain_GetMaxAsStringr   s     r   GetMaxAsStringzFieldDomain.GetMaxAsString  r   r#   c                 .    t        j                  | g| S )z(IsMaxInclusive(FieldDomain self) -> bool)r   FieldDomain_IsMaxInclusiver   s     r   IsMaxInclusivezFieldDomain.IsMaxInclusive  r   r#   c                 .    t        j                  | g| S )z)GetGlob(FieldDomain self) -> char const *)r   FieldDomain_GetGlobr   s     r   GetGlobzFieldDomain.GetGlob  r   r#   N)r   r   r6   r7   r   r   rP   r   r   r   delete_FieldDomainr   r   r   r@  r  r  r  r  r  r  r   r#  r&  r)  r,  r/  r2  r5  r$   r#   r   r  r  f  s    3-/IOdeG7H..5<:=;<<<<<<<<<<<5r#   r  c                  &    t        j                  |  S )zCreateCodedFieldDomain(char const * name, char const * description, OGRFieldType type, OGRFieldSubType subtype, OGRCodedValue const * enumeration) -> FieldDomain)r   CreateCodedFieldDomainr;   s    r   r8  r8    r  r#   c                  &    t        j                  |  S )zCreateRangeFieldDomain(char const * name, char const * description, OGRFieldType type, OGRFieldSubType subtype, double min, bool minIsInclusive, double max, double maxIsInclusive) -> FieldDomain)r   CreateRangeFieldDomainr;   s    r   r:  r:    r  r#   c                  &    t        j                  |  S )zCreateRangeFieldDomainDateTime(char const * name, char const * description, char const * min, bool minIsInclusive, char const * max, double maxIsInclusive) -> FieldDomain)r   CreateRangeFieldDomainDateTimer;   s    r   r<  r<        ..55r#   c                  &    t        j                  |  S )zCreateGlobFieldDomain(char const * name, char const * description, OGRFieldType type, OGRFieldSubType subtype, char const * glob) -> FieldDomain)r   CreateGlobFieldDomainr;   s    r   r?  r?    r  r#   c                  &    t        j                  |  S )zGetDriverCount() -> int)r   GetDriverCountr;   s    r   rA  rA    rE   r#   c                  &    t        j                  |  S )zGetOpenDSCount() -> int)r   GetOpenDSCountr;   s    r   rC  rC    rE   r#   c                  &    t        j                  |  S )zJSetGenerate_DB2_V72_BYTE_ORDER(int bGenerate_DB2_V72_BYTE_ORDER) -> OGRErr)r   SetGenerate_DB2_V72_BYTE_ORDERr;   s    r   rE  rE    r=  r#   c                  &    t        j                  |  S )zRegisterAll())r   RegisterAllr;   s    r   rG  rG        T""r#   c                  &    t        j                  |  S )z<GeometryTypeToName(OGRwkbGeometryType eType) -> char const *)r   GeometryTypeToNamer;   s    r   rJ  rJ    rH   r#   c                  &    t        j                  |  S )z3GetFieldTypeName(OGRFieldType type) -> char const *)r   rA  r;   s    r   rA  rA    r=   r#   c                  &    t        j                  |  S )z9GetFieldSubTypeName(OGRFieldSubType type) -> char const *)r   GetFieldSubTypeNamer;   s    r   rM  rM    r@   r#   c                  &    t        j                  |  S )z:GT_Flatten(OGRwkbGeometryType eType) -> OGRwkbGeometryType)r   
GT_Flattenr;   s    r   rO  rO        ??D!!r#   c                  &    t        j                  |  S )z7GT_SetZ(OGRwkbGeometryType eType) -> OGRwkbGeometryType)r   GT_SetZr;   s    r   rR  rR    r  r#   c                  &    t        j                  |  S )z7GT_SetM(OGRwkbGeometryType eType) -> OGRwkbGeometryType)r   GT_SetMr;   s    r   rT  rT    r  r#   c                  &    t        j                  |  S )zZGT_SetModifier(OGRwkbGeometryType eType, int bSetZ, int bSetM=FALSE) -> OGRwkbGeometryType)r   GT_SetModifierr;   s    r   rV  rV    rE   r#   c                  &    t        j                  |  S )z(GT_HasZ(OGRwkbGeometryType eType) -> int)r   GT_HasZr;   s    r   rX  rX    r  r#   c                  &    t        j                  |  S )z(GT_HasM(OGRwkbGeometryType eType) -> int)r   GT_HasMr;   s    r   rZ  rZ    r  r#   c                  &    t        j                  |  S )zOGT_IsSubClassOf(OGRwkbGeometryType eType, OGRwkbGeometryType eSuperType) -> int)r   GT_IsSubClassOfr;   s    r   r\  r\        &&r#   c                  &    t        j                  |  S )z*GT_IsCurve(OGRwkbGeometryType arg1) -> int)r   
GT_IsCurver;   s    r   r_  r_    rP  r#   c                  &    t        j                  |  S )z,GT_IsSurface(OGRwkbGeometryType arg1) -> int)r   GT_IsSurfacer;   s    r   ra  ra        d##r#   c                  &    t        j                  |  S )z.GT_IsNonLinear(OGRwkbGeometryType arg1) -> int)r   GT_IsNonLinearr;   s    r   rd  rd    rE   r#   c                  &    t        j                  |  S )z@GT_GetCollection(OGRwkbGeometryType eType) -> OGRwkbGeometryType)r   GT_GetCollectionr;   s    r   rf  rf    r=   r#   c                  &    t        j                  |  S )z;GT_GetCurve(OGRwkbGeometryType eType) -> OGRwkbGeometryType)r   GT_GetCurver;   s    r   rh  rh    rH  r#   c                  &    t        j                  |  S )z<GT_GetLinear(OGRwkbGeometryType eType) -> OGRwkbGeometryType)r   GT_GetLinearr;   s    r   rj  rj    rb  r#   c                  &    t        j                  |  S )z,SetNonLinearGeometriesEnabledFlag(int bFlag))r   !SetNonLinearGeometriesEnabledFlagr;   s    r   rl  rl        11488r#   c                  &    t        j                  |  S )z*GetNonLinearGeometriesEnabledFlag() -> int)r   !GetNonLinearGeometriesEnabledFlagr;   s    r   ro  ro    rm  r#   c                  &    t        j                  |  S )z&GetOpenDS(int ds_number) -> DataSource)r   	GetOpenDSr;   s    r   rq  rq        >>4  r#   c                  @    t                t        j                  | i |S )z8Open(char const * utf8_path, int update=0) -> DataSource)rp   r   r   r  s     r   r   r   #  s      01 99d%f%%r#   c                  ,    t        j                  | i |S )z>OpenShared(char const * utf8_path, int update=0) -> DataSource)r   
OpenSharedr  s     r   ru  ru  +  s    ??D+F++r#   c                  &    t        j                  |  S )z,GetDriverByName(char const * name) -> Driver)r   GetDriverByNamer;   s    r   rw  rw  /  r]  r#   c                  &    t        j                  |  S )z&GetDriver(int driver_number) -> Driver)r   r	  r;   s    r   r	  r	  3  rr  r#   c                  &    t        j                  |  S )zEGeneralCmdLineProcessor(char ** papszArgv, int nOptions=0) -> char **)r   GeneralCmdLineProcessorr;   s    r   rz  rz  7  s    ''..r#   c                  ,    t        j                  | i |S )z\TermProgress_nocb(double dfProgress, char const * pszMessage=None, void * pData=None) -> int)r   TermProgress_nocbr  s     r   r|  r|  ;  s    !!42622r#   (*  r`  r   _swig_python_version_info__package__r   r   r   builtinsr   rV   r   r%   r*   r3   r   r5   	wkb25DBitwkb25Bit
wkbUnknownwkbPointwkbLineString
wkbPolygonwkbMultiPointwkbMultiLineStringwkbMultiPolygonwkbGeometryCollectionwkbCircularStringwkbCompoundCurvewkbCurvePolygonwkbMultiCurvewkbMultiSurfacewkbCurve
wkbSurfacewkbPolyhedralSurfacewkbTINwkbTrianglewkbNonewkbLinearRingwkbCircularStringZwkbCompoundCurveZwkbCurvePolygonZwkbMultiCurveZwkbMultiSurfaceZ	wkbCurveZwkbSurfaceZwkbPolyhedralSurfaceZwkbTINZwkbTriangleZ	wkbPointMwkbLineStringMwkbPolygonMwkbMultiPointMwkbMultiLineStringMwkbMultiPolygonMwkbGeometryCollectionMwkbCircularStringMwkbCompoundCurveMwkbCurvePolygonMwkbMultiCurveMwkbMultiSurfaceM	wkbCurveMwkbSurfaceMwkbPolyhedralSurfaceMwkbTINMwkbTriangleM
wkbPointZMwkbLineStringZMwkbPolygonZMwkbMultiPointZMwkbMultiLineStringZMwkbMultiPolygonZMwkbGeometryCollectionZMwkbCircularStringZMwkbCompoundCurveZMwkbCurvePolygonZMwkbMultiCurveZMwkbMultiSurfaceZM
wkbCurveZMwkbSurfaceZMwkbPolyhedralSurfaceZMwkbTINZMwkbTriangleZMwkbPoint25DwkbLineString25DwkbPolygon25DwkbMultiPoint25DwkbMultiLineString25DwkbMultiPolygon25DwkbGeometryCollection25Dr  r  r  r  	OFTStringr  OFTWideStringOFTWideStringListrA  OFTDateOFTTimeOFTDateTimer  r  OFSTNoner  	OFSTInt16OFSTFloat32OFSTJSONOFSTUUIDOJUndefinedOJLeftOJRight
OFDT_CODED
OFDT_RANGE	OFDT_GLOBOFDSP_DEFAULT_VALUEOFDSP_DUPLICATEOFDSP_GEOMETRY_RATIOOFDMP_DEFAULT_VALUE	OFDMP_SUMOFDMP_GEOMETRY_WEIGHTEDwkbXDRwkbNDRr  ALTER_NAME_FLAGALTER_TYPE_FLAGALTER_WIDTH_PRECISION_FLAGALTER_NULLABLE_FLAGALTER__FLAGALTER_DEFAULT_FLAGALTER_UNIQUE_FLAGALTER_DOMAIN_FLAGALTER_ALTERNATIVE_NAME_FLAGALTER_COMMENT_FLAGALTER_ALL_FLAGALTER_GEOM_FIELD_DEFN_NAME_FLAGALTER_GEOM_FIELD_DEFN_TYPE_FLAG#ALTER_GEOM_FIELD_DEFN_NULLABLE_FLAGALTER_GEOM_FIELD_DEFN_SRS_FLAG*ALTER_GEOM_FIELD_DEFN_SRS_COORD_EPOCH_FLAGALTER_GEOM_FIELD_DEFN_ALL_FLAG
F_VAL_NULLF_VAL_GEOM_TYPEF_VAL_WIDTHF_VAL_ALLOW_NULL_WHEN_DEFAULT	F_VAL_ALLTZFLAG_UNKNOWNTZFLAG_LOCALTIMETZFLAG_MIXED_TZ
TZFLAG_UTCGGT_COUNT_NOT_NEEDEDGGT_STOP_IF_MIXEDGGT_GEOMCOLLECTIONZ_TINZOLCRandomReadOLCSequentialWriteOLCRandomWriteOLCFastSpatialFilterOLCFastFeatureCountOLCFastGetExtentOLCCreateFieldOLCDeleteFieldOLCReorderFieldsOLCAlterFieldDefnOLCAlterGeomFieldDefnOLCTransactionsOLCDeleteFeatureOLCUpsertFeatureOLCUpdateFeatureOLCFastSetNextByIndexOLCStringsAsUTF8OLCIgnoreFieldsOLCCreateGeomFieldOLCCurveGeometriesOLCMeasuredGeometriesOLCZGeometries	OLCRenameOLCFastGetArrowStreamODsCCreateLayerODsCDeleteLayer#ODsCCreateGeomFieldAfterCreateLayerODsCCurveGeometriesODsCTransactionsODsCEmulatedTransactionsODsCMeasuredGeometriesODsCZGeometriesODsCRandomLayerReadODsCRandomLayerWriteODsCAddFieldDomainODsCDeleteFieldDomainODsCUpdateFieldDomainODrCCreateDataSourceODrCDeleteDataSource
OLMD_FID64r  OGRERR_NOT_ENOUGH_DATAOGRERR_NOT_ENOUGH_MEMORY OGRERR_UNSUPPORTED_GEOMETRY_TYPEOGRERR_UNSUPPORTED_OPERATIONOGRERR_CORRUPT_DATAr  OGRERR_UNSUPPORTED_SRSOGRERR_INVALID_HANDLEOGRERR_NON_EXISTING_FEATUREr:   r?   rB   rD   rG   rJ   objectrL   rg   rj   rl   rp   rc   rr   MajorObject_swigregisterr   r   r   r   StyleTable_swigregisterr   Driver_swigregisterr   DataSource_swigregisterr|  ArrowArray_swigregisterr  ArrowSchema_swigregisterr  ArrowArrayStream_swigregisterr  Layer_swigregisterr  Feature_swigregisterr  FeatureDefn_swigregisterr   FieldDefn_swigregisterro  GeomFieldDefn_swigregisterr  r  r  r  r  r  r  r  r  r  r  r  r  r  Geometry_swigregisterr  PreparedGeometry_swigregisterr  GeomTransformer_swigregisterr  FieldDomain_swigregisterr8  r:  r<  r?  rA  rC  rE  rG  rJ  rA  rM  rO  rR  rT  rV  rX  rZ  r\  r_  ra  rd  rf  rh  rj  rl  ro  rq  r   ru  rw  r	  rz  r|  TermProgressr$   r#   r   <module>rA     s   :#/"[
L$ L
 NN	==__
==""__
"",, &&22 ** (( &&""&&==__
00 	
,,"",, ** (( $$(( NN	22 
,,  NN	$$$$.. (( 44 ,, ** (( $$(( NN	22 
,,  __
&&  &&00 ** 66 .. ,, ** &&** __
  44 ==""(( ""(( 22 ,, 88 __
$$
,,NN	""""** NN	
,,
,,  (( ==NN	====	
,,__
__
NN	.. &&00 .. NN	66 		
,,&&&&!<< .. ,, ** ** ">> ,, $$"&"F"F "&"F"F &*&N&N #!%!D!D -1-\-\ *!%!D!D __
&& $ B B NN	$$(( &&__
00 ** 88 "",, $$00 .. (( $$$$(( ** 22 &&(( (( (( 22 (( &&,, ,, 22 $$NN	22 &&&&&*&N&N #.. (( 88 44 &&.. 00 ,, 22 22 00 00 __
44 88 #'#H#H  #@@ .. $$44 22 ">> (++&*::J6 :J~<B 6; 2R /+& /+f   k *+++%= %=P   Z (-3[ -3`     N	( N	(d   Z (6 60   Z (6& 68   k *Ev E& # " "#3 4M<K M<d(    T!f T!r:   ' "s& sp   k *O Of   I &91F 91z     .77-.276&)+).B)v B)N(   8 $;v ;& # " "#3 4;f ;  " ! !/ 2L5& L5^   k *..6-&&6#*(+"&'"$&(#$99!&,'!/3   ]i  s   p 	p)(p)