text: /* ----------------------------------------------------------------------------
   * This file was automatically generated by SWIG (http://www.swig.org).
   * Version 3.0.5
   *
   * This file is not intended to be easily readable and contains a number of
   * coding conventions designed to improve portability and efficiency. Do not make
   * changes to this file unless you know what you are doing--modify the SWIG
   * interface file instead.
   * ----------------------------------------------------------------------------- */
  
  #define SWIGRUBY
  
  
  #ifdef __cplusplus
  /* SwigValueWrapper is described in swig.swg */
  template<typename T> class SwigValueWrapper {
    struct SwigMovePointer {
      T *ptr;
      SwigMovePointer(T *p) : ptr(p) { }
      ~SwigMovePointer() { delete ptr; }
      SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
    } pointer;
    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
    SwigValueWrapper(const SwigValueWrapper<T>& rhs);
  public:
    SwigValueWrapper() : pointer(0) { }
    SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
    operator T&() const { return *pointer.ptr; }
    T *operator&() { return pointer.ptr; }
  };
  
  template <typename T> T SwigValueInit() {
    return T();
  }
  #endif
  
  /* -----------------------------------------------------------------------------
   *  This section contains generic SWIG labels for method/variable
   *  declarations/attributes, and other compiler dependent labels.
   * ----------------------------------------------------------------------------- */
  
  /* template workaround for compilers that cannot correctly implement the C++ standard */
  #ifndef SWIGTEMPLATEDISAMBIGUATOR
  # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  #  define SWIGTEMPLATEDISAMBIGUATOR template
  # elif defined(__HP_aCC)
  /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  #  define SWIGTEMPLATEDISAMBIGUATOR template
  # else
  #  define SWIGTEMPLATEDISAMBIGUATOR
  # endif
  #endif
  
  /* inline attribute */
  #ifndef SWIGINLINE
  # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  #   define SWIGINLINE inline
  # else
  #   define SWIGINLINE
  # endif
  #endif
  
  /* attribute recognised by some compilers to avoid 'unused' warnings */
  #ifndef SWIGUNUSED
  # if defined(__GNUC__)
  #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  #     define SWIGUNUSED __attribute__ ((__unused__))
  #   else
  #     define SWIGUNUSED
  #   endif
  # elif defined(__ICC)
  #   define SWIGUNUSED __attribute__ ((__unused__))
  # else
  #   define SWIGUNUSED
  # endif
  #endif
  
  #ifndef SWIG_MSC_UNSUPPRESS_4505
  # if defined(_MSC_VER)
  #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
  # endif
  #endif
  
  #ifndef SWIGUNUSEDPARM
  # ifdef __cplusplus
  #   define SWIGUNUSEDPARM(p)
  # else
  #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
  # endif
  #endif
  
  /* internal SWIG method */
  #ifndef SWIGINTERN
  # define SWIGINTERN static SWIGUNUSED
  #endif
  
  /* internal inline SWIG method */
  #ifndef SWIGINTERNINLINE
  # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  #endif
  
  /* exporting methods */
  #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  #  ifndef GCC_HASCLASSVISIBILITY
  #    define GCC_HASCLASSVISIBILITY
  #  endif
  #endif
  
  #ifndef SWIGEXPORT
  # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  #   if defined(STATIC_LINKED)
  #     define SWIGEXPORT
  #   else
  #     define SWIGEXPORT __declspec(dllexport)
  #   endif
  # else
  #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  #     define SWIGEXPORT __attribute__ ((visibility("default")))
  #   else
  #     define SWIGEXPORT
  #   endif
  # endif
  #endif
  
  /* calling conventions for Windows */
  #ifndef SWIGSTDCALL
  # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  #   define SWIGSTDCALL __stdcall
  # else
  #   define SWIGSTDCALL
  # endif
  #endif
  
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  # define _CRT_SECURE_NO_DEPRECATE
  #endif
  
  /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  # define _SCL_SECURE_NO_DEPRECATE
  #endif
  
  
  /* -----------------------------------------------------------------------------
   *  This section contains generic SWIG labels for method/variable
   *  declarations/attributes, and other compiler dependent labels.
   * ----------------------------------------------------------------------------- */
  
  /* template workaround for compilers that cannot correctly implement the C++ standard */
  #ifndef SWIGTEMPLATEDISAMBIGUATOR
  # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
  #  define SWIGTEMPLATEDISAMBIGUATOR template
  # elif defined(__HP_aCC)
  /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
  /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
  #  define SWIGTEMPLATEDISAMBIGUATOR template
  # else
  #  define SWIGTEMPLATEDISAMBIGUATOR
  # endif
  #endif
  
  /* inline attribute */
  #ifndef SWIGINLINE
  # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
  #   define SWIGINLINE inline
  # else
  #   define SWIGINLINE
  # endif
  #endif
  
  /* attribute recognised by some compilers to avoid 'unused' warnings */
  #ifndef SWIGUNUSED
  # if defined(__GNUC__)
  #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  #     define SWIGUNUSED __attribute__ ((__unused__))
  #   else
  #     define SWIGUNUSED
  #   endif
  # elif defined(__ICC)
  #   define SWIGUNUSED __attribute__ ((__unused__))
  # else
  #   define SWIGUNUSED
  # endif
  #endif
  
  #ifndef SWIG_MSC_UNSUPPRESS_4505
  # if defined(_MSC_VER)
  #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
  # endif
  #endif
  
  #ifndef SWIGUNUSEDPARM
  # ifdef __cplusplus
  #   define SWIGUNUSEDPARM(p)
  # else
  #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
  # endif
  #endif
  
  /* internal SWIG method */
  #ifndef SWIGINTERN
  # define SWIGINTERN static SWIGUNUSED
  #endif
  
  /* internal inline SWIG method */
  #ifndef SWIGINTERNINLINE
  # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
  #endif
  
  /* exporting methods */
  #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
  #  ifndef GCC_HASCLASSVISIBILITY
  #    define GCC_HASCLASSVISIBILITY
  #  endif
  #endif
  
  #ifndef SWIGEXPORT
  # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  #   if defined(STATIC_LINKED)
  #     define SWIGEXPORT
  #   else
  #     define SWIGEXPORT __declspec(dllexport)
  #   endif
  # else
  #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
  #     define SWIGEXPORT __attribute__ ((visibility("default")))
  #   else
  #     define SWIGEXPORT
  #   endif
  # endif
  #endif
  
  /* calling conventions for Windows */
  #ifndef SWIGSTDCALL
  # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
  #   define SWIGSTDCALL __stdcall
  # else
  #   define SWIGSTDCALL
  # endif
  #endif
  
  /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
  #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
  # define _CRT_SECURE_NO_DEPRECATE
  #endif
  
  /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
  #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
  # define _SCL_SECURE_NO_DEPRECATE
  #endif
  
  
  /* -----------------------------------------------------------------------------
   * swigrun.swg
   *
   * This file contains generic C API SWIG runtime support for pointer
   * type checking.
   * ----------------------------------------------------------------------------- */
  
  /* This should only be incremented when either the layout of swig_type_info changes,
     or for whatever reason, the runtime changes incompatibly */
  #define SWIG_RUNTIME_VERSION "4"
  
  /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
  #ifdef SWIG_TYPE_TABLE
  # define SWIG_QUOTE_STRING(x) #x
  # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
  # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
  #else
  # define SWIG_TYPE_TABLE_NAME
  #endif
  
  /*
    You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
    creating a static or dynamic library from the SWIG runtime code.
    In 99.9% of the cases, SWIG just needs to declare them as 'static'.
  
    But only do this if strictly necessary, ie, if you have problems
    with your compiler or suchlike.
  */
  
  #ifndef SWIGRUNTIME
  # define SWIGRUNTIME SWIGINTERN
  #endif
  
  #ifndef SWIGRUNTIMEINLINE
  # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
  #endif
  
  /*  Generic buffer size */
  #ifndef SWIG_BUFFER_SIZE
  # define SWIG_BUFFER_SIZE 1024
  #endif
  
  /* Flags for pointer conversions */
  #define SWIG_POINTER_DISOWN        0x1
  #define SWIG_CAST_NEW_MEMORY       0x2
  
  /* Flags for new pointer objects */
  #define SWIG_POINTER_OWN           0x1
  
  
  /*
     Flags/methods for returning states.
  
     The SWIG conversion methods, as ConvertPtr, return an integer
     that tells if the conversion was successful or not. And if not,
     an error code can be returned (see swigerrors.swg for the codes).
  
     Use the following macros/flags to set or process the returning
     states.
  
     In old versions of SWIG, code such as the following was usually written:
  
       if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
         // success code
       } else {
         //fail code
       }
  
     Now you can be more explicit:
  
      int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
      if (SWIG_IsOK(res)) {
        // success code
      } else {
        // fail code
      }
  
     which is the same really, but now you can also do
  
      Type *ptr;
      int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
      if (SWIG_IsOK(res)) {
        // success code
        if (SWIG_IsNewObj(res) {
          ...
  	delete *ptr;
        } else {
          ...
        }
      } else {
        // fail code
      }
  
     I.e., now SWIG_ConvertPtr can return new objects and you can
     identify the case and take care of the deallocation. Of course that
     also requires SWIG_ConvertPtr to return new result values, such as
  
        int SWIG_ConvertPtr(obj, ptr,...) {
          if (<obj is ok>) {
            if (<need new object>) {
              *ptr = <ptr to new allocated object>;
              return SWIG_NEWOBJ;
            } else {
              *ptr = <ptr to old object>;
              return SWIG_OLDOBJ;
            }
          } else {
            return SWIG_BADOBJ;
          }
        }
  
     Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
     more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
     SWIG errors code.
  
     Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
     allows to return the 'cast rank', for example, if you have this
  
         int food(double)
         int fooi(int);
  
     and you call
  
        food(1)   // cast rank '1'  (1 -> 1.0)
        fooi(1)   // cast rank '0'
  
     just use the SWIG_AddCast()/SWIG_CheckState()
  */
  
  #define SWIG_OK                    (0)
  #define SWIG_ERROR                 (-1)
  #define SWIG_IsOK(r)               (r >= 0)
  #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
  
  /* The CastRankLimit says how many bits are used for the cast rank */
  #define SWIG_CASTRANKLIMIT         (1 << 8)
  /* The NewMask denotes the object was created (using new/malloc) */
  #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
  /* The TmpMask is for in/out typemaps that use temporal objects */
  #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
  /* Simple returning values */
  #define SWIG_BADOBJ                (SWIG_ERROR)
  #define SWIG_OLDOBJ                (SWIG_OK)
  #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
  #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
  /* Check, add and del mask methods */
  #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
  #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
  #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
  #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
  #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
  #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
  
  /* Cast-Rank Mode */
  #if defined(SWIG_CASTRANK_MODE)
  #  ifndef SWIG_TypeRank
  #    define SWIG_TypeRank             unsigned long
  #  endif
  #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
  #    define SWIG_MAXCASTRANK          (2)
  #  endif
  #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
  #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
  SWIGINTERNINLINE int SWIG_AddCast(int r) {
    return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
  }
  SWIGINTERNINLINE int SWIG_CheckState(int r) {
    return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
  }
  #else /* no cast-rank mode */
  #  define SWIG_AddCast(r) (r)
  #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
  #endif
  
  
  #include <string.h>
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  typedef void *(*swig_converter_func)(void *, int *);
  typedef struct swig_type_info *(*swig_dycast_func)(void **);
  
  /* Structure to store information on one type */
  typedef struct swig_type_info {
    const char             *name;			/* mangled name of this type */
    const char             *str;			/* human readable name of this type */
    swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
    struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
    void                   *clientdata;		/* language specific type data */
    int                    owndata;		/* flag if the structure owns the clientdata */
  } swig_type_info;
  
  /* Structure to store a type and conversion function used for casting */
  typedef struct swig_cast_info {
    swig_type_info         *type;			/* pointer to type that is equivalent to this type */
    swig_converter_func     converter;		/* function to cast the void pointers */
    struct swig_cast_info  *next;			/* pointer to next cast in linked list */
    struct swig_cast_info  *prev;			/* pointer to the previous cast */
  } swig_cast_info;
  
  /* Structure used to store module information
   * Each module generates one structure like this, and the runtime collects
   * all of these structures and stores them in a circularly linked list.*/
  typedef struct swig_module_info {
    swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
    size_t                 size;		        /* Number of types in this module */
    struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
    swig_type_info         **type_initial;	/* Array of initially generated type structures */
    swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
    void                    *clientdata;		/* Language specific module data */
  } swig_module_info;
  
  /*
    Compare two type names skipping the space characters, therefore
    "char*" == "char *" and "Class<int>" == "Class<int >", etc.
  
    Return 0 when the two name types are equivalent, as in
    strncmp, but skipping ' '.
  */
  SWIGRUNTIME int
  SWIG_TypeNameComp(const char *f1, const char *l1,
  		  const char *f2, const char *l2) {
    for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
      while ((*f1 == ' ') && (f1 != l1)) ++f1;
      while ((*f2 == ' ') && (f2 != l2)) ++f2;
      if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
    }
    return (int)((l1 - f1) - (l2 - f2));
  }
  
  /*
    Check type equivalence in a name list like <name1>|<name2>|...
    Return 0 if equal, -1 if nb < tb, 1 if nb > tb
  */
  SWIGRUNTIME int
  SWIG_TypeCmp(const char *nb, const char *tb) {
    int equiv = 1;
    const char* te = tb + strlen(tb);
    const char* ne = nb;
    while (equiv != 0 && *ne) {
      for (nb = ne; *ne; ++ne) {
        if (*ne == '|') break;
      }
      equiv = SWIG_TypeNameComp(nb, ne, tb, te);
      if (*ne) ++ne;
    }
    return equiv;
  }
  
  /*
    Check type equivalence in a name list like <name1>|<name2>|...
    Return 0 if not equal, 1 if equal
  */
  SWIGRUNTIME int
  SWIG_TypeEquiv(const char *nb, const char *tb) {
    return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
  }
  
  /*
    Check the typename
  */
  SWIGRUNTIME swig_cast_info *
  SWIG_TypeCheck(const char *c, swig_type_info *ty) {
    if (ty) {
      swig_cast_info *iter = ty->cast;
      while (iter) {
        if (strcmp(iter->type->name, c) == 0) {
          if (iter == ty->cast)
            return iter;
          /* Move iter to the top of the linked list */
          iter->prev->next = iter->next;
          if (iter->next)
            iter->next->prev = iter->prev;
          iter->next = ty->cast;
          iter->prev = 0;
          if (ty->cast) ty->cast->prev = iter;
          ty->cast = iter;
          return iter;
        }
        iter = iter->next;
      }
    }
    return 0;
  }
  
  /*
    Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
  */
  SWIGRUNTIME swig_cast_info *
  SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
    if (ty) {
      swig_cast_info *iter = ty->cast;
      while (iter) {
        if (iter->type == from) {
          if (iter == ty->cast)
            return iter;
          /* Move iter to the top of the linked list */
          iter->prev->next = iter->next;
          if (iter->next)
            iter->next->prev = iter->prev;
          iter->next = ty->cast;
          iter->prev = 0;
          if (ty->cast) ty->cast->prev = iter;
          ty->cast = iter;
          return iter;
        }
        iter = iter->next;
      }
    }
    return 0;
  }
  
  /*
    Cast a pointer up an inheritance hierarchy
  */
  SWIGRUNTIMEINLINE void *
  SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
    return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
  }
  
  /*
     Dynamic pointer casting. Down an inheritance hierarchy
  */
  SWIGRUNTIME swig_type_info *
  SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
    swig_type_info *lastty = ty;
    if (!ty || !ty->dcast) return ty;
    while (ty && (ty->dcast)) {
      ty = (*ty->dcast)(ptr);
      if (ty) lastty = ty;
    }
    return lastty;
  }
  
  /*
    Return the name associated with this type
  */
  SWIGRUNTIMEINLINE const char *
  SWIG_TypeName(const swig_type_info *ty) {
    return ty->name;
  }
  
  /*
    Return the pretty name associated with this type,
    that is an unmangled type name in a form presentable to the user.
  */
  SWIGRUNTIME const char *
  SWIG_TypePrettyName(const swig_type_info *type) {
    /* The "str" field contains the equivalent pretty names of the
       type, separated by vertical-bar characters.  We choose
       to print the last name, as it is often (?) the most
       specific. */
    if (!type) return NULL;
    if (type->str != NULL) {
      const char *last_name = type->str;
      const char *s;
      for (s = type->str; *s; s++)
        if (*s == '|') last_name = s+1;
      return last_name;
    }
    else
      return type->name;
  }
  
  /*
     Set the clientdata field for a type
  */
  SWIGRUNTIME void
  SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
    swig_cast_info *cast = ti->cast;
    /* if (ti->clientdata == clientdata) return; */
    ti->clientdata = clientdata;
  
    while (cast) {
      if (!cast->converter) {
        swig_type_info *tc = cast->type;
        if (!tc->clientdata) {
  	SWIG_TypeClientData(tc, clientdata);
        }
      }
      cast = cast->next;
    }
  }
  SWIGRUNTIME void
  SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
    SWIG_TypeClientData(ti, clientdata);
    ti->owndata = 1;
  }
  
  /*
    Search for a swig_type_info structure only by mangled name
    Search is a O(log #types)
  
    We start searching at module start, and finish searching when start == end.
    Note: if start == end at the beginning of the function, we go all the way around
    the circular list.
  */
  SWIGRUNTIME swig_type_info *
  SWIG_MangledTypeQueryModule(swig_module_info *start,
                              swig_module_info *end,
  		            const char *name) {
    swig_module_info *iter = start;
    do {
      if (iter->size) {
        size_t l = 0;
        size_t r = iter->size - 1;
        do {
  	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
  	size_t i = (l + r) >> 1;
  	const char *iname = iter->types[i]->name;
  	if (iname) {
  	  int compare = strcmp(name, iname);
  	  if (compare == 0) {
  	    return iter->types[i];
  	  } else if (compare < 0) {
  	    if (i) {
  	      r = i - 1;
  	    } else {
  	      break;
  	    }
  	  } else if (compare > 0) {
  	    l = i + 1;
  	  }
  	} else {
  	  break; /* should never happen */
  	}
        } while (l <= r);
      }
      iter = iter->next;
    } while (iter != end);
    return 0;
  }
  
  /*
    Search for a swig_type_info structure for either a mangled name or a human readable name.
    It first searches the mangled names of the types, which is a O(log #types)
    If a type is not found it then searches the human readable names, which is O(#types).
  
    We start searching at module start, and finish searching when start == end.
    Note: if start == end at the beginning of the function, we go all the way around
    the circular list.
  */
  SWIGRUNTIME swig_type_info *
  SWIG_TypeQueryModule(swig_module_info *start,
                       swig_module_info *end,
  		     const char *name) {
    /* STEP 1: Search the name field using binary search */
    swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
    if (ret) {
      return ret;
    } else {
      /* STEP 2: If the type hasn't been found, do a complete search
         of the str field (the human readable name) */
      swig_module_info *iter = start;
      do {
        size_t i = 0;
        for (; i < iter->size; ++i) {
  	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
  	  return iter->types[i];
        }
        iter = iter->next;
      } while (iter != end);
    }
  
    /* neither found a match */
    return 0;
  }
  
  /*
     Pack binary data into a string
  */
  SWIGRUNTIME char *
  SWIG_PackData(char *c, void *ptr, size_t sz) {
    static const char hex[17] = "0123456789abcdef";
    const unsigned char *u = (unsigned char *) ptr;
    const unsigned char *eu =  u + sz;
    for (; u != eu; ++u) {
      unsigned char uu = *u;
      *(c++) = hex[(uu & 0xf0) >> 4];
      *(c++) = hex[uu & 0xf];
    }
    return c;
  }
  
  /*
     Unpack binary data from a string
  */
  SWIGRUNTIME const char *
  SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
    unsigned char *u = (unsigned char *) ptr;
    const unsigned char *eu = u + sz;
    for (; u != eu; ++u) {
      char d = *(c++);
      unsigned char uu;
      if ((d >= '0') && (d <= '9'))
        uu = ((d - '0') << 4);
      else if ((d >= 'a') && (d <= 'f'))
        uu = ((d - ('a'-10)) << 4);
      else
        return (char *) 0;
      d = *(c++);
      if ((d >= '0') && (d <= '9'))
        uu |= (d - '0');
      else if ((d >= 'a') && (d <= 'f'))
        uu |= (d - ('a'-10));
      else
        return (char *) 0;
      *u = uu;
    }
    return c;
  }
  
  /*
     Pack 'void *' into a string buffer.
  */
  SWIGRUNTIME char *
  SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
    char *r = buff;
    if ((2*sizeof(void *) + 2) > bsz) return 0;
    *(r++) = '_';
    r = SWIG_PackData(r,&ptr,sizeof(void *));
    if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
    strcpy(r,name);
    return buff;
  }
  
  SWIGRUNTIME const char *
  SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
    if (*c != '_') {
      if (strcmp(c,"NULL") == 0) {
        *ptr = (void *) 0;
        return name;
      } else {
        return 0;
      }
    }
    return SWIG_UnpackData(++c,ptr,sizeof(void *));
  }
  
  SWIGRUNTIME char *
  SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
    char *r = buff;
    size_t lname = (name ? strlen(name) : 0);
    if ((2*sz + 2 + lname) > bsz) return 0;
    *(r++) = '_';
    r = SWIG_PackData(r,ptr,sz);
    if (lname) {
      strncpy(r,name,lname+1);
    } else {
      *r = 0;
    }
    return buff;
  }
  
  SWIGRUNTIME const char *
  SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
    if (*c != '_') {
      if (strcmp(c,"NULL") == 0) {
        memset(ptr,0,sz);
        return name;
      } else {
        return 0;
      }
    }
    return SWIG_UnpackData(++c,ptr,sz);
  }
  
  #ifdef __cplusplus
  }
  #endif
  
  /*  Errors in SWIG */
  #define  SWIG_UnknownError    	   -1
  #define  SWIG_IOError        	   -2
  #define  SWIG_RuntimeError   	   -3
  #define  SWIG_IndexError     	   -4
  #define  SWIG_TypeError      	   -5
  #define  SWIG_DivisionByZero 	   -6
  #define  SWIG_OverflowError  	   -7
  #define  SWIG_SyntaxError    	   -8
  #define  SWIG_ValueError     	   -9
  #define  SWIG_SystemError    	   -10
  #define  SWIG_AttributeError 	   -11
  #define  SWIG_MemoryError    	   -12
  #define  SWIG_NullReferenceError   -13
  
  
  
  #include <ruby.h>
  
  /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
   * breaks using rb_intern as an lvalue, as SWIG does.  We work around this
   * issue for now by disabling this.
   * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
   */
  #ifdef rb_intern
  # undef rb_intern
  #endif
  
  /* Remove global macros defined in Ruby's win32.h */
  #ifdef write
  # undef write
  #endif
  #ifdef read
  # undef read
  #endif
  #ifdef bind
  # undef bind
  #endif
  #ifdef close
  # undef close
  #endif
  #ifdef connect
  # undef connect
  #endif
  
  
  /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
  #ifndef NUM2LL
  #define NUM2LL(x) NUM2LONG((x))
  #endif
  #ifndef LL2NUM
  #define LL2NUM(x) INT2NUM((long) (x))
  #endif
  #ifndef ULL2NUM
  #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
  #endif
  
  /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
  #ifndef NUM2ULL
  #ifdef HAVE_LONG_LONG
  #define NUM2ULL(x) rb_num2ull((x))
  #else
  #define NUM2ULL(x) NUM2ULONG(x)
  #endif
  #endif
  
  /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
  /* Define these for older versions so we can just write code the new way */
  #ifndef RSTRING_LEN
  # define RSTRING_LEN(x) RSTRING(x)->len
  #endif
  #ifndef RSTRING_PTR
  # define RSTRING_PTR(x) RSTRING(x)->ptr
  #endif
  #ifndef RSTRING_END
  # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
  #endif
  #ifndef RARRAY_LEN
  # define RARRAY_LEN(x) RARRAY(x)->len
  #endif
  #ifndef RARRAY_PTR
  # define RARRAY_PTR(x) RARRAY(x)->ptr
  #endif
  #ifndef RFLOAT_VALUE
  # define RFLOAT_VALUE(x) RFLOAT(x)->value
  #endif
  #ifndef DOUBLE2NUM
  # define DOUBLE2NUM(x) rb_float_new(x)
  #endif
  #ifndef RHASH_TBL
  # define RHASH_TBL(x) (RHASH(x)->tbl)
  #endif
  #ifndef RHASH_ITER_LEV
  # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
  #endif
  #ifndef RHASH_IFNONE
  # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
  #endif
  #ifndef RHASH_SIZE
  # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
  #endif
  #ifndef RHASH_EMPTY_P
  # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
  #endif
  #ifndef RSTRUCT_LEN
  # define RSTRUCT_LEN(x) RSTRUCT(x)->len
  #endif
  #ifndef RSTRUCT_PTR
  # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
  #endif
  
  
  
  /*
   * Need to be very careful about how these macros are defined, especially
   * when compiling C++ code or C code with an ANSI C compiler.
   *
   * VALUEFUNC(f) is a macro used to typecast a C function that implements
   * a Ruby method so that it can be passed as an argument to API functions
   * like rb_define_method() and rb_define_singleton_method().
   *
   * VOIDFUNC(f) is a macro used to typecast a C function that implements
   * either the "mark" or "free" stuff for a Ruby Data object, so that it
   * can be passed as an argument to API functions like Data_Wrap_Struct()
   * and Data_Make_Struct().
   */
   
  #ifdef __cplusplus
  #  ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
  #    define PROTECTFUNC(f) ((VALUE (*)()) f)
  #    define VALUEFUNC(f) ((VALUE (*)()) f)
  #    define VOIDFUNC(f)  ((void (*)()) f)
  #  else
  #    ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
  #      define PROTECTFUNC(f) ((VALUE (*)()) f)
  #      define VALUEFUNC(f) ((VALUE (*)()) f)
  #      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
  #    else /* These definitions should work for Ruby 1.7+ */
  #      define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
  #      define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
  #      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
  #    endif
  #  endif
  #else
  #  define VALUEFUNC(f) (f)
  #  define VOIDFUNC(f) (f)
  #endif
  
  /* Don't use for expressions have side effect */
  #ifndef RB_STRING_VALUE
  #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
  #endif
  #ifndef StringValue
  #define StringValue(s) RB_STRING_VALUE(s)
  #endif
  #ifndef StringValuePtr
  #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
  #endif
  #ifndef StringValueLen
  #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
  #endif
  #ifndef SafeStringValue
  #define SafeStringValue(v) do {\
      StringValue(v);\
      rb_check_safe_str(v);\
  } while (0)
  #endif
  
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
  #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
  #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
  #endif
  
  static VALUE _mSWIG = Qnil;
  
  /* -----------------------------------------------------------------------------
   * error manipulation
   * ----------------------------------------------------------------------------- */
  
  
  /* Define some additional error types */
  #define SWIG_ObjectPreviouslyDeletedError  -100
  
  
  /* Define custom exceptions for errors that do not map to existing Ruby
     exceptions.  Note this only works for C++ since a global cannot be
     initialized by a function in C.  For C, fallback to rb_eRuntimeError.*/
  
  SWIGINTERN VALUE 
  getNullReferenceError(void) {
    static int init = 0;
    static VALUE rb_eNullReferenceError ;
    if (!init) {
      init = 1;
      rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
    }
    return rb_eNullReferenceError;
  } 
  
  SWIGINTERN VALUE 
  getObjectPreviouslyDeletedError(void) {
    static int init = 0;
    static VALUE rb_eObjectPreviouslyDeleted ;
    if (!init) {
      init = 1;
      rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
    }
    return rb_eObjectPreviouslyDeleted;
  } 
  
  
  SWIGINTERN VALUE
  SWIG_Ruby_ErrorType(int SWIG_code) {
    VALUE type;
    switch (SWIG_code) {
    case SWIG_MemoryError:
      type = rb_eNoMemError;
      break;
    case SWIG_IOError:
      type = rb_eIOError;
      break;
    case SWIG_RuntimeError:
      type = rb_eRuntimeError;
      break;
    case SWIG_IndexError:
      type = rb_eIndexError;
      break;
    case SWIG_TypeError:
      type = rb_eTypeError;
      break;
    case SWIG_DivisionByZero:
      type = rb_eZeroDivError;
      break;
    case SWIG_OverflowError:
      type = rb_eRangeError;
      break;
    case SWIG_SyntaxError:
      type = rb_eSyntaxError;
      break;
    case SWIG_ValueError:
      type = rb_eArgError;
      break;
    case SWIG_SystemError:
      type = rb_eFatal;
      break;
    case SWIG_AttributeError:
      type = rb_eRuntimeError;
      break;
    case SWIG_NullReferenceError:
      type = getNullReferenceError();
      break;
    case SWIG_ObjectPreviouslyDeletedError:
      type = getObjectPreviouslyDeletedError();
      break;
    case SWIG_UnknownError:
      type = rb_eRuntimeError;
      break;
    default:
      type = rb_eRuntimeError;
    }
    return type;
  }
  
  
  /* This function is called when a user inputs a wrong argument to
     a method.
   */
  SWIGINTERN 
  const char* Ruby_Format_TypeError( const char* msg,
  				   const char* type, 
  				   const char* name, 
  				   const int argn,
  				   VALUE input )
  {
    char buf[128];
    VALUE str;
    VALUE asStr;
    if ( msg && *msg )
      {
        str = rb_str_new2(msg);
      }
    else
      {
        str = rb_str_new(NULL, 0);
      }
  
    str = rb_str_cat2( str, "Expected argument " );
    sprintf( buf, "%d of type ", argn-1 );
    str = rb_str_cat2( str, buf );
    str = rb_str_cat2( str, type );
    str = rb_str_cat2( str, ", but got " );
    str = rb_str_cat2( str, rb_obj_classname(input) );
    str = rb_str_cat2( str, " " );
    asStr = rb_inspect(input);
    if ( RSTRING_LEN(asStr) > 30 )
      {
        str = rb_str_cat( str, StringValuePtr(asStr), 30 );
        str = rb_str_cat2( str, "..." );
      }
    else
      {
        str = rb_str_append( str, asStr );
      }
  
    if ( name )
      {
        str = rb_str_cat2( str, "\n\tin SWIG method '" );
        str = rb_str_cat2( str, name );
        str = rb_str_cat2( str, "'" );
      }
  
    return StringValuePtr( str );
  }
  
  /* This function is called when an overloaded method fails */
  SWIGINTERN 
  void Ruby_Format_OverloadedError(
  				 const int argc,
  				 const int maxargs,
  				 const char* method, 
  				 const char* prototypes 
  				 )
  {
    const char* msg = "Wrong # of arguments";
    if ( argc <= maxargs ) msg = "Wrong arguments";
    rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"  
  	   "Possible C/C++ prototypes are:\n%s",
  	   msg, method, prototypes);
  }
  
  /* -----------------------------------------------------------------------------
   * rubytracking.swg
   *
   * This file contains support for tracking mappings from 
   * Ruby objects to C++ objects.  This functionality is needed
   * to implement mark functions for Ruby's mark and sweep
   * garbage collector.
   * ----------------------------------------------------------------------------- */
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /* Ruby 1.8 actually assumes the first case. */
  #if SIZEOF_VOIDP == SIZEOF_LONG
  #  define SWIG2NUM(v) LONG2NUM((unsigned long)v)
  #  define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
  #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
  #  define SWIG2NUM(v) LL2NUM((unsigned long long)v)
  #  define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
  #else
  #  error sizeof(void*) is not the same as long or long long
  #endif
  
  
  /* Global Ruby hash table to store Trackings from C/C++
     structs to Ruby Objects. 
  */
  static VALUE swig_ruby_trackings = Qnil;
  
  /* Global variable that stores a reference to the ruby
     hash table delete function. */
  static ID swig_ruby_hash_delete;
  
  /* Setup a Ruby hash table to store Trackings */
  SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
    /* Create a ruby hash table to store Trackings from C++ 
       objects to Ruby objects. */
  
    /* Try to see if some other .so has already created a 
       tracking hash table, which we keep hidden in an instance var
       in the SWIG module.
       This is done to allow multiple DSOs to share the same
       tracking table.
    */
    ID trackings_id = rb_intern( "@__trackings__" );
    VALUE verbose = rb_gv_get("VERBOSE");
    rb_gv_set("VERBOSE", Qfalse);
    swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
    rb_gv_set("VERBOSE", verbose);
  
    /* No, it hasn't.  Create one ourselves */ 
    if ( swig_ruby_trackings == Qnil )
      {
        swig_ruby_trackings = rb_hash_new();
        rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
      }
  
    /* Now store a reference to the hash table delete function
       so that we only have to look it up once.*/
    swig_ruby_hash_delete = rb_intern("delete");
  }
  
  /* Get a Ruby number to reference a pointer */
  SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
    /* We cast the pointer to an unsigned long
       and then store a reference to it using
       a Ruby number object. */
  
    /* Convert the pointer to a Ruby number */
    return SWIG2NUM(ptr);
  }
  
  /* Get a Ruby number to reference an object */
  SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
    /* We cast the object to an unsigned long
       and then store a reference to it using
       a Ruby number object. */
  
    /* Convert the Object to a Ruby number */
    return SWIG2NUM(object);
  }
  
  /* Get a Ruby object from a previously stored reference */
  SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
    /* The provided Ruby number object is a reference
       to the Ruby object we want.*/
  
    /* Convert the Ruby number to a Ruby object */
    return NUM2SWIG(reference);
  }
  
  /* Add a Tracking from a C/C++ struct to a Ruby object */
  SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
    /* In a Ruby hash table we store the pointer and
       the associated Ruby object.  The trick here is
       that we cannot store the Ruby object directly - if
       we do then it cannot be garbage collected.  So
       instead we typecast it as a unsigned long and
       convert it to a Ruby number object.*/
  
    /* Get a reference to the pointer as a Ruby number */
    VALUE key = SWIG_RubyPtrToReference(ptr);
  
    /* Get a reference to the Ruby object as a Ruby number */
    VALUE value = SWIG_RubyObjectToReference(object);
  
    /* Store the mapping to the global hash table. */
    rb_hash_aset(swig_ruby_trackings, key, value);
  }
  
  /* Get the Ruby object that owns the specified C/C++ struct */
  SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
    /* Get a reference to the pointer as a Ruby number */
    VALUE key = SWIG_RubyPtrToReference(ptr);
  
    /* Now lookup the value stored in the global hash table */
    VALUE value = rb_hash_aref(swig_ruby_trackings, key);
  	
    if (value == Qnil) {
      /* No object exists - return nil. */
      return Qnil;
    }
    else {
      /* Convert this value to Ruby object */
      return SWIG_RubyReferenceToObject(value);
    }
  }
  
  /* Remove a Tracking from a C/C++ struct to a Ruby object.  It
     is very important to remove objects once they are destroyed
     since the same memory address may be reused later to create
     a new object. */
  SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
    /* Get a reference to the pointer as a Ruby number */
    VALUE key = SWIG_RubyPtrToReference(ptr);
  
    /* Delete the object from the hash table by calling Ruby's
       do this we need to call the Hash.delete method.*/
    rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
  }
  
  /* This is a helper method that unlinks a Ruby object from its
     underlying C++ object.  This is needed if the lifetime of the
     Ruby object is longer than the C++ object */
  SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
    VALUE object = SWIG_RubyInstanceFor(ptr);
  
    if (object != Qnil) {
      DATA_PTR(object) = 0;
    }
  }
  
  
  #ifdef __cplusplus
  }
  #endif
  
  /* -----------------------------------------------------------------------------
   * Ruby API portion that goes into the runtime
   * ----------------------------------------------------------------------------- */
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  SWIGINTERN VALUE
  SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
    if (NIL_P(target)) {
      target = o;
    } else {
      if (TYPE(target) != T_ARRAY) {
        VALUE o2 = target;
        target = rb_ary_new();
        rb_ary_push(target, o2);
      }
      rb_ary_push(target, o);
    }
    return target;
  }
  
  /* For ruby1.8.4 and earlier. */
  #ifndef RUBY_INIT_STACK
     RUBY_EXTERN void Init_stack(VALUE* addr);
  #  define RUBY_INIT_STACK \
     VALUE variable_in_this_stack_frame; \
     Init_stack(&variable_in_this_stack_frame);
  #endif
  
  
  #ifdef __cplusplus
  }
  #endif
  
  
  /* -----------------------------------------------------------------------------
   * rubyrun.swg
   *
   * This file contains the runtime support for Ruby modules
   * and includes code for managing global variables and pointer
   * type checking.
   * ----------------------------------------------------------------------------- */
  
  /* For backward compatibility only */
  #define SWIG_POINTER_EXCEPTION  0
  
  /* for raw pointers */
  #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
  #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
  #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Ruby_NewPointerObj(ptr, type, flags)
  #define SWIG_AcquirePtr(ptr, own)                       SWIG_Ruby_AcquirePtr(ptr, own)
  #define swig_owntype                                    ruby_owntype
  
  /* for raw packed data */
  #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
  #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)
  
  /* for class or struct pointers */
  #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
  #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
  
  /* for C or C++ function pointers */
  #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
  #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
  
  /* for C++ member pointers, ie, member methods */
  #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
  #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)
  
  
  /* Runtime API */
  
  #define SWIG_GetModule(clientdata)                      SWIG_Ruby_GetModule(clientdata)
  #define SWIG_SetModule(clientdata, pointer) 		SWIG_Ruby_SetModule(pointer)
  
  
  /* Error manipulation */
  
  #define SWIG_ErrorType(code)                            SWIG_Ruby_ErrorType(code)               
  #define SWIG_Error(code, msg)            		rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
  #define SWIG_fail                        		goto fail				 
  
  
  /* Ruby-specific SWIG API */
  
  #define SWIG_InitRuntime()                              SWIG_Ruby_InitRuntime()              
  #define SWIG_define_class(ty)                        	SWIG_Ruby_define_class(ty)
  #define SWIG_NewClassInstance(value, ty)             	SWIG_Ruby_NewClassInstance(value, ty)
  #define SWIG_MangleStr(value)                        	SWIG_Ruby_MangleStr(value)		  
  #define SWIG_CheckConvert(value, ty)                 	SWIG_Ruby_CheckConvert(value, ty)	  
  
  #include "assert.h"
  
  /* -----------------------------------------------------------------------------
   * pointers/data manipulation
   * ----------------------------------------------------------------------------- */
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  typedef struct {
    VALUE klass;
    VALUE mImpl;
    void  (*mark)(void *);
    void  (*destroy)(void *);
    int trackObjects;
  } swig_class;
  
  
  /* Global pointer used to keep some internal SWIG stuff */
  static VALUE _cSWIG_Pointer = Qnil;
  static VALUE swig_runtime_data_type_pointer = Qnil;
  
  /* Global IDs used to keep some internal SWIG stuff */
  static ID swig_arity_id = 0;
  static ID swig_call_id  = 0;
  
  /*
    If your swig extension is to be run within an embedded ruby and has
    director callbacks, you should set -DRUBY_EMBEDDED during compilation.  
    This will reset ruby's stack frame on each entry point from the main 
    program the first time a virtual director function is invoked (in a 
    non-recursive way).
    If this is not done, you run the risk of Ruby trashing the stack.
  */
  
  #ifdef RUBY_EMBEDDED
  
  #  define SWIG_INIT_STACK                            \
        if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
        ++swig_virtual_calls;
  #  define SWIG_RELEASE_STACK --swig_virtual_calls;
  #  define Ruby_DirectorTypeMismatchException(x) \
            rb_raise( rb_eTypeError, "%s", x ); return c_result;
  
        static unsigned int swig_virtual_calls = 0;
  
  #else  /* normal non-embedded extension */
  
  #  define SWIG_INIT_STACK
  #  define SWIG_RELEASE_STACK
  #  define Ruby_DirectorTypeMismatchException(x) \
            throw Swig::DirectorTypeMismatchException( x );
  
  #endif  /* RUBY_EMBEDDED */
  
  
  SWIGRUNTIME VALUE 
  getExceptionClass(void) {
    static int init = 0;
    static VALUE rubyExceptionClass ;
    if (!init) {
      init = 1;
      rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
    }
    return rubyExceptionClass;
  } 
  
  /* This code checks to see if the Ruby object being raised as part
     of an exception inherits from the Ruby class Exception.  If so,
     the object is simply returned.  If not, then a new Ruby exception
     object is created and that will be returned to Ruby.*/
  SWIGRUNTIME VALUE
  SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
    VALUE exceptionClass = getExceptionClass();
    if (rb_obj_is_kind_of(obj, exceptionClass)) {
      return obj;
    }  else {
      return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
    }
  }
  
  /* Initialize Ruby runtime support */
  SWIGRUNTIME void
  SWIG_Ruby_InitRuntime(void)
  {
    if (_mSWIG == Qnil) {
      _mSWIG = rb_define_module("SWIG");
      swig_call_id  = rb_intern("call");
      swig_arity_id = rb_intern("arity");
    }
  }
  
  /* Define Ruby class for C type */
  SWIGRUNTIME void
  SWIG_Ruby_define_class(swig_type_info *type)
  {
    char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
    sprintf(klass_name, "TYPE%s", type->name);
    if (NIL_P(_cSWIG_Pointer)) {
      _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
      rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
    }
    rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
    free((void *) klass_name);
  }
  
  /* Create a new pointer object */
  SWIGRUNTIME VALUE
  SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
  {
    int own =  flags & SWIG_POINTER_OWN; 
    int track;
    char *klass_name;
    swig_class *sklass;
    VALUE klass;
    VALUE obj;
    
    if (!ptr)
      return Qnil;
    
    if (type->clientdata) {
      sklass = (swig_class *) type->clientdata;
  		
      /* Are we tracking this class and have we already returned this Ruby object? */
      track = sklass->trackObjects;
      if (track) {
        obj = SWIG_RubyInstanceFor(ptr);
        
        /* Check the object's type and make sure it has the correct type.
          It might not in cases where methods do things like 
          downcast methods. */
        if (obj != Qnil) {
          VALUE value = rb_iv_get(obj, "@__swigtype__");
          const char* type_name = RSTRING_PTR(value);
  				
          if (strcmp(type->name, type_name) == 0) {
            return obj;
          }
        }
      }
  
      /* Create a new Ruby object */
      obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), 
  			   ( own ? VOIDFUNC(sklass->destroy) : 
  			     (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
  			     ), ptr);
  
      /* If tracking is on for this class then track this object. */
      if (track) {
        SWIG_RubyAddTracking(ptr, obj);
      }
    } else {
      klass_name = (char *) malloc(4 + strlen(type->name) + 1);
      sprintf(klass_name, "TYPE%s", type->name);
      klass = rb_const_get(_mSWIG, rb_intern(klass_name));
      free((void *) klass_name);
      obj = Data_Wrap_Struct(klass, 0, 0, ptr);
    }
    rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
    
    return obj;
  }
  
  /* Create a new class instance (always owned) */
  SWIGRUNTIME VALUE
  SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
  {
    VALUE obj;
    swig_class *sklass = (swig_class *) type->clientdata;
    obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
    rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
    return obj;
  }
  
  /* Get type mangle from class name */
  SWIGRUNTIMEINLINE char *
  SWIG_Ruby_MangleStr(VALUE obj)
  {
    VALUE stype = rb_iv_get(obj, "@__swigtype__");
    return StringValuePtr(stype);
  }
  
  /* Acquire a pointer value */
  typedef void (*ruby_owntype)(void*);
  
  SWIGRUNTIME ruby_owntype
  SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
    if (obj) {
      ruby_owntype oldown = RDATA(obj)->dfree;
      RDATA(obj)->dfree = own;
      return oldown;
    } else {
      return 0;
    }
  }
  
  /* Convert a pointer value */
  SWIGRUNTIME int
  SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
  {
    char *c;
    swig_cast_info *tc;
    void *vptr = 0;
  
    /* Grab the pointer */
    if (NIL_P(obj)) {
      *ptr = 0;
      return SWIG_OK;
    } else {
      if (TYPE(obj) != T_DATA) {
        return SWIG_ERROR;
      }
      Data_Get_Struct(obj, void, vptr);
    }
    
    if (own) *own = RDATA(obj)->dfree;
      
    /* Check to see if the input object is giving up ownership
       of the underlying C struct or C++ object.  If so then we
       need to reset the destructor since the Ruby object no 
       longer owns the underlying C++ object.*/ 
    if (flags & SWIG_POINTER_DISOWN) {
      /* Is tracking on for this class? */
      int track = 0;
      if (ty && ty->clientdata) {
        swig_class *sklass = (swig_class *) ty->clientdata;
        track = sklass->trackObjects;
      }
  		
      if (track) {
        /* We are tracking objects for this class.  Thus we change the destructor
         * to SWIG_RubyRemoveTracking.  This allows us to
         * remove the mapping from the C++ to Ruby object
         * when the Ruby object is garbage collected.  If we don't
         * do this, then it is possible we will return a reference 
         * to a Ruby object that no longer exists thereby crashing Ruby. */
        RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
      } else {    
        RDATA(obj)->dfree = 0;
      }
    }
  
    /* Do type-checking if type info was provided */
    if (ty) {
      if (ty->clientdata) {
        if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
          if (vptr == 0) {
            /* The object has already been deleted */
            return SWIG_ObjectPreviouslyDeletedError;
          }
          *ptr = vptr;
          return SWIG_OK;
        }
      }
      if ((c = SWIG_MangleStr(obj)) == NULL) {
        return SWIG_ERROR;
      }
      tc = SWIG_TypeCheck(c, ty);
      if (!tc) {
        return SWIG_ERROR;
      } else {
        int newmemory = 0;
        *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
        assert(!newmemory); /* newmemory handling not yet implemented */
      }
    } else {
      *ptr = vptr;
    }
    
    return SWIG_OK;
  }
  
  /* Check convert */
  SWIGRUNTIMEINLINE int
  SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
  {
    char *c = SWIG_MangleStr(obj);
    if (!c) return 0;
    return SWIG_TypeCheck(c,ty) != 0;
  }
  
  SWIGRUNTIME VALUE
  SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
    char result[1024];
    char *r = result;
    if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
    *(r++) = '_';
    r = SWIG_PackData(r, ptr, sz);
    strcpy(r, type->name);
    return rb_str_new2(result);
  }
  
  /* Convert a packed value value */
  SWIGRUNTIME int
  SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
    swig_cast_info *tc;
    const char  *c;
  
    if (TYPE(obj) != T_STRING) goto type_error;
    c = StringValuePtr(obj);
    /* Pointer values must start with leading underscore */
    if (*c != '_') goto type_error;
    c++;
    c = SWIG_UnpackData(c, ptr, sz);
    if (ty) {
      tc = SWIG_TypeCheck(c, ty);
      if (!tc) goto type_error;
    }
    return SWIG_OK;
  
   type_error:
    return SWIG_ERROR;
  }
  
  SWIGRUNTIME swig_module_info *
  SWIG_Ruby_GetModule(void *SWIGUNUSEDPARM(clientdata))
  {
    VALUE pointer;
    swig_module_info *ret = 0;
    VALUE verbose = rb_gv_get("VERBOSE");
  
   /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
    rb_gv_set("VERBOSE", Qfalse);
    
    /* first check if pointer already created */
    pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
    if (pointer != Qnil) {
      Data_Get_Struct(pointer, swig_module_info, ret);
    }
  
    /* reinstate warnings */
    rb_gv_set("VERBOSE", verbose);
    return ret;
  }
  
  SWIGRUNTIME void 
  SWIG_Ruby_SetModule(swig_module_info *pointer)
  {
    /* register a new class */
    VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
    /* create and store the structure pointer to a global variable */
    swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
    rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
  }
  
  /* This function can be used to check whether a proc or method or similarly
     callable function has been passed.  Usually used in a %typecheck, like:
  
     %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
          $result = SWIG_Ruby_isCallable( $input );
     }
   */
  SWIGINTERN
  int SWIG_Ruby_isCallable( VALUE proc )
  {
    if ( rb_respond_to( proc, swig_call_id ) )
      return 1;
    return 0;
  }
  
  /* This function can be used to check the arity (number of arguments)
     a proc or method can take.  Usually used in a %typecheck.
     Valid arities will be that equal to minimal or those < 0
     which indicate a variable number of parameters at the end.
   */
  SWIGINTERN
  int SWIG_Ruby_arity( VALUE proc, int minimal )
  {
    if ( rb_respond_to( proc, swig_arity_id ) )
      {
        VALUE num = rb_funcall( proc, swig_arity_id, 0 );
        int arity = NUM2INT(num);
        if ( arity < 0 && (arity+1) < -minimal ) return 1;
        if ( arity == minimal ) return 1;
        return 1;
      }
    return 0;
  }
  
  
  #ifdef __cplusplus
  }
  #endif
  
  
  
  #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
  
  #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
  
  
  
    #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0) 
  
  
  /* -------- TYPES TABLE (BEGIN) -------- */
  
  #define SWIGTYPE_p_GDALProgressFunc swig_types[0]
  #define SWIGTYPE_p_GIntBig swig_types[1]
  #define SWIGTYPE_p_OGRDataSourceShadow swig_types[2]
  #define SWIGTYPE_p_OGRDriverShadow swig_types[3]
  #define SWIGTYPE_p_OGRFeatureDefnShadow swig_types[4]
  #define SWIGTYPE_p_OGRFeatureShadow swig_types[5]
  #define SWIGTYPE_p_OGRFieldDefnShadow swig_types[6]
  #define SWIGTYPE_p_OGRGeometryShadow swig_types[7]
  #define SWIGTYPE_p_OGRLayerShadow swig_types[8]
  #define SWIGTYPE_p_OSRCoordinateTransformationShadow swig_types[9]
  #define SWIGTYPE_p_OSRSpatialReferenceShadow swig_types[10]
  #define SWIGTYPE_p_char swig_types[11]
  #define SWIGTYPE_p_double swig_types[12]
  #define SWIGTYPE_p_f_double_p_q_const__char_p_void__int swig_types[13]
  #define SWIGTYPE_p_int swig_types[14]
  #define SWIGTYPE_p_p_char swig_types[15]
  #define SWIGTYPE_p_p_double swig_types[16]
  #define SWIGTYPE_p_p_int swig_types[17]
  #define SWIGTYPE_p_p_p_char swig_types[18]
  static swig_type_info *swig_types[20];
  static swig_module_info swig_module = {swig_types, 19, 0, 0, 0, 0};
  #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
  #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
  
  /* -------- TYPES TABLE (END) -------- */
  
  #define SWIG_init    Init_ogr
  #define SWIG_name    "Gdal::Ogr"
  
  static VALUE mOgr;
  
  #define SWIG_RUBY_THREAD_BEGIN_BLOCK
  #define SWIG_RUBY_THREAD_END_BLOCK
  
  
  #define SWIGVERSION 0x030005 
  #define SWIG_VERSION SWIGVERSION
  
  
  #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
  #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
  
  
  #include <stdexcept>
  
  
  typedef char retStringAndCPLFree;
  
  
  #include <iostream>
  using namespace std;
  
  #include "ogr_api.h"
  #include "ogr_p.h"
  #include "ogr_core.h"
  #include "cpl_port.h"
  #include "cpl_string.h"
  #include "ogr_srs_api.h"
  
  #ifdef DEBUG 
  typedef struct OGRSpatialReferenceHS OSRSpatialReferenceShadow;
  typedef struct OGRDriverHS OGRDriverShadow;
  typedef struct OGRDataSourceHS OGRDataSourceShadow;
  typedef struct OGRLayerHS OGRLayerShadow;
  typedef struct OGRFeatureHS OGRFeatureShadow;
  typedef struct OGRFeatureDefnHS OGRFeatureDefnShadow;
  typedef struct OGRGeometryHS OGRGeometryShadow;
  typedef struct OGRCoordinateTransformationHS OSRCoordinateTransformationShadow;
  typedef struct OGRCoordinateTransformationHS OGRCoordinateTransformationShadow;
  typedef struct OGRFieldDefnHS OGRFieldDefnShadow;
  #else
  typedef void OSRSpatialReferenceShadow;
  typedef void OGRDriverShadow;
  typedef void OGRDataSourceShadow;
  typedef void OGRLayerShadow;
  typedef void OGRFeatureShadow;
  typedef void OGRFeatureDefnShadow;
  typedef void OGRGeometryShadow;
  typedef void OSRCoordinateTransformationShadow;
  typedef void OGRFieldDefnShadow;
  #endif
  
  
  #include <limits.h>
  #if !defined(SWIG_NO_LLONG_MAX)
  # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
  #   define LLONG_MAX __LONG_LONG_MAX__
  #   define LLONG_MIN (-LLONG_MAX - 1LL)
  #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
  # endif
  #endif
  
  
    #define SWIG_From_long   LONG2NUM 
  
  
  SWIGINTERNINLINE VALUE
  SWIG_From_int  (int value)
  {    
    return SWIG_From_long  (value);
  }
  
  
  SWIGINTERN swig_type_info*
  SWIG_pchar_descriptor(void)
  {
    static int init = 0;
    static swig_type_info* info = 0;
    if (!init) {
      info = SWIG_TypeQuery("_p_char");
      init = 1;
    }
    return info;
  }
  
  
  SWIGINTERNINLINE VALUE 
  SWIG_FromCharPtrAndSize(const char* carray, size_t size)
  {
    if (carray) {
      if (size > LONG_MAX) {
        swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
        return pchar_descriptor ? 
  	SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
      } else {
        return rb_str_new(carray, static_cast< long >(size));
      }
    } else {
      return Qnil;
    }
  }
  
  
  SWIGINTERNINLINE VALUE 
  SWIG_FromCharPtr(const char *cptr)
  { 
    return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
  }
  
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /* Ruby 1.9 changed the file name of this header */
  #ifdef HAVE_RUBY_IO_H
  #include "ruby/io.h"
  #else
  #include "rubyio.h"
  #endif
  
  #ifdef __cplusplus
  }
  #endif
  
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  #ifdef HAVE_SYS_TIME_H
  # include <sys/time.h>
  struct timeval rb_time_timeval(VALUE);
  #endif
  #ifdef __cplusplus
  }
  #endif
  
  
  
  #include "ogr_core.h"
  static char const *
  OGRErrMessages( int rc ) {
    switch( rc ) {
    case OGRERR_NONE:
      return "OGR Error: None";
    case OGRERR_NOT_ENOUGH_DATA:
      return "OGR Error: Not enough data to deserialize";
    case OGRERR_NOT_ENOUGH_MEMORY:
      return "OGR Error: Not enough memory";
    case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
      return "OGR Error: Unsupported geometry type";
    case OGRERR_UNSUPPORTED_OPERATION:
      return "OGR Error: Unsupported operation";
    case OGRERR_CORRUPT_DATA:
      return "OGR Error: Corrupt data";
    case OGRERR_FAILURE:
      return "OGR Error: General Error";
    case OGRERR_UNSUPPORTED_SRS:
      return "OGR Error: Unsupported SRS";
    case OGRERR_INVALID_HANDLE:
      return "OGR Error: Invalid handle";
    default:
      return "OGR Error: Unknown";
    }
  }
  
  
  void VeryQuiteErrorHandler(CPLErr eclass, int code, const char *msg ) {
    /* If the error class is CE_Fatal, we want to have a message issued
       because the CPL support code does an abort() before any exception
       can be generated */
    if (eclass == CE_Fatal ) {
      CPLDefaultErrorHandler(eclass, code, msg );
    }
  }
  
  
  void UseExceptions() {
    CPLSetErrorHandler( (CPLErrorHandler) VeryQuiteErrorHandler );
  }
  
  void DontUseExceptions() {
    CPLSetErrorHandler( CPLDefaultErrorHandler );
  }
  
  
  SWIGINTERN int
  SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
  {
    if (TYPE(obj) == T_STRING) {
      char *cstr = StringValuePtr(obj); 
      size_t size = RSTRING_LEN(obj) + 1;
      if (cptr)  {
        if (alloc) {
  	if (*alloc == SWIG_NEWOBJ) {
  	  *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
  	} else {
  	  *cptr = cstr;
  	  *alloc = SWIG_OLDOBJ;
  	}
        }
      }
      if (psize) *psize = size;
      return SWIG_OK;
    } else {
      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
      if (pchar_descriptor) {
        void* vptr = 0;
        if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
  	if (cptr) *cptr = (char *)vptr;
  	if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
  	if (alloc) *alloc = SWIG_OLDOBJ;
  	return SWIG_OK;
        }
      }
    }  
    return SWIG_TypeError;
  }
  
  
  
  
  SWIGINTERN OGRDataSourceShadow *OGRDriverShadow_CreateDataSource(OGRDriverShadow *self,char const *utf8_path,char **options=0){
      OGRDataSourceShadow *ds = (OGRDataSourceShadow*) OGR_Dr_CreateDataSource( self, utf8_path, options);
      return ds;
    }
  SWIGINTERN OGRDataSourceShadow *OGRDriverShadow_CopyDataSource(OGRDriverShadow *self,OGRDataSourceShadow *copy_ds,char const *utf8_path,char **options=0){
      OGRDataSourceShadow *ds = (OGRDataSourceShadow*) OGR_Dr_CopyDataSource(self, copy_ds, utf8_path, options);
      return ds;
    }
  
  SWIGINTERN VALUE
  SWIG_ruby_failed(void)
  {
    return Qnil;
  } 
  
  
  /*@SWIG:/usr/local/Cellar/swig/3.0.5/share/swig/3.0.5/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
  {
    VALUE obj = args[0];
    VALUE type = TYPE(obj);
    long *res = (long *)(args[1]);
    *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
    return obj;
  }
  /*@SWIG@*/
  
  SWIGINTERN int
  SWIG_AsVal_long (VALUE obj, long* val)
  {
    VALUE type = TYPE(obj);
    if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
      long v;
      VALUE a[2];
      a[0] = obj;
      a[1] = (VALUE)(&v);
      if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
        if (val) *val = v;
        return SWIG_OK;
      }
    }
    return SWIG_TypeError;
  }
  
  
  SWIGINTERN int
  SWIG_AsVal_int (VALUE obj, int *val)
  {
    long v;
    int res = SWIG_AsVal_long (obj, &v);
    if (SWIG_IsOK(res)) {
      if ((v < INT_MIN || v > INT_MAX)) {
        return SWIG_OverflowError;
      } else {
        if (val) *val = static_cast< int >(v);
      }
    }  
    return res;
  }
  
  SWIGINTERN OGRDataSourceShadow *OGRDriverShadow_Open(OGRDriverShadow *self,char const *utf8_path,int update=0){
      CPLErrorReset();
      OGRDataSourceShadow* ds = (OGRDataSourceShadow*) OGR_Dr_Open(self, utf8_path, update);
      if( CPLGetLastErrorType() == CE_Failure && ds != NULL )
      {
          CPLDebug(
              "SWIG",
              "OGR_Dr_Open() succeeded, but an error is posted, so we destroy"
              " the datasource and fail at swig level.\nError:%s",
              CPLGetLastErrorMsg() );
          OGRReleaseDataSource(ds);
          ds = NULL;
      }
      return ds;
    }
  SWIGINTERN int OGRDriverShadow_DeleteDataSource(OGRDriverShadow *self,char const *utf8_path){
  
      return OGR_Dr_DeleteDataSource( self, utf8_path );
    }
  SWIGINTERN bool OGRDriverShadow_TestCapability(OGRDriverShadow *self,char const *cap){
      return (OGR_Dr_TestCapability(self, cap) > 0);
    }
  
  SWIGINTERNINLINE VALUE
  SWIG_From_bool  (bool value)
  {
    return value ? Qtrue : Qfalse;
  }
  
  SWIGINTERN char const *OGRDriverShadow_GetName(OGRDriverShadow *self){
      return OGR_Dr_GetName( self );
    }
  SWIGINTERN void OGRDriverShadow_Register(OGRDriverShadow *self){
      OGRRegisterDriver( self );
    }
  SWIGINTERN void OGRDriverShadow_Deregister(OGRDriverShadow *self){
      OGRDeregisterDriver( self );
    }
  SWIGINTERN int OGRDataSourceShadow_GetRefCount(OGRDataSourceShadow *self){
      return OGR_DS_GetRefCount(self);
    }
  SWIGINTERN int OGRDataSourceShadow_GetSummaryRefCount(OGRDataSourceShadow *self){
      return OGR_DS_GetSummaryRefCount(self);
    }
  SWIGINTERN int OGRDataSourceShadow_GetLayerCount(OGRDataSourceShadow *self){
      return OGR_DS_GetLayerCount(self);
    }
  SWIGINTERN OGRDriverShadow *OGRDataSourceShadow_GetDriver(OGRDataSourceShadow *self){
      return (OGRDriverShadow *) OGR_DS_GetDriver( self );
    }
  SWIGINTERN char const *OGRDataSourceShadow_GetName(OGRDataSourceShadow *self){
      return OGR_DS_GetName(self);
    }
  SWIGINTERN OGRErr OGRDataSourceShadow_DeleteLayer(OGRDataSourceShadow *self,int index){
      return OGR_DS_DeleteLayer(self, index);
    }
  SWIGINTERN OGRErr OGRDataSourceShadow_SyncToDisk(OGRDataSourceShadow *self){
      return OGR_DS_SyncToDisk(self);
    }
  SWIGINTERN OGRLayerShadow *OGRDataSourceShadow_CreateLayer(OGRDataSourceShadow *self,char const *name,OSRSpatialReferenceShadow *srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char **options=0){
      OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_CreateLayer( self,
  								  name,
  								  srs,
  								  geom_type,
  								  options);
      return layer;
    }
  SWIGINTERN OGRLayerShadow *OGRDataSourceShadow_CopyLayer(OGRDataSourceShadow *self,OGRLayerShadow *src_layer,char const *new_name,char **options=0){
      OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_CopyLayer( self,
                                                        src_layer,
                                                        new_name,
                                                        options);
      return layer;
    }
  SWIGINTERN bool OGRDataSourceShadow_TestCapability(OGRDataSourceShadow *self,char const *cap){
      return (OGR_DS_TestCapability(self, cap) > 0);
    }
  SWIGINTERN OGRLayerShadow *OGRDataSourceShadow_ExecuteSQL(OGRDataSourceShadow *self,char const *statement,OGRGeometryShadow *spatialFilter=NULL,char const *dialect=""){
      OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_ExecuteSQL((OGRDataSourceShadow*)self,
                                                        statement,
                                                        spatialFilter,
                                                        dialect);
      return layer;
    }
  SWIGINTERN void OGRDataSourceShadow_ReleaseResultSet(OGRDataSourceShadow *self,OGRLayerShadow *layer){
      OGR_DS_ReleaseResultSet(self, layer);
    }
  SWIGINTERN OGRLayerShadow *OGRDataSourceShadow_GetLayer(OGRDataSourceShadow *self,VALUE whichLayer){
  		// get field index
  		switch (TYPE(whichLayer)) {
  			case T_STRING: {
  				char* name = StringValuePtr(whichLayer);
  				return OGR_DS_GetLayerByName(self, name);
  				break;
  			}
  			case T_FIXNUM: {
  				int index = NUM2INT(whichLayer);
  				return OGR_DS_GetLayer(self, index);
  				break;
  			}
  			default:
  				SWIG_exception(SWIG_TypeError, "Value must be a string or integer.");
  		}
  	}
  SWIGINTERN int OGRLayerShadow_GetRefCount(OGRLayerShadow *self){
      return OGR_L_GetRefCount(self);
    }
  SWIGINTERN void OGRLayerShadow_SetSpatialFilter(OGRLayerShadow *self,OGRGeometryShadow *filter){
      OGR_L_SetSpatialFilter (self, filter);
    }
  
  /*@SWIG:/usr/local/Cellar/swig/3.0.5/share/swig/3.0.5/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
  SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
  {
    VALUE obj = args[0];
    VALUE type = TYPE(obj);
    double *res = (double *)(args[1]);
    *res = NUM2DBL(obj); (void)type;
    return obj;
  }
  /*@SWIG@*/
  
  SWIGINTERN int
  SWIG_AsVal_double (VALUE obj, double *val)
  {
    VALUE type = TYPE(obj);
    if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
      double v;
      VALUE a[2];
      a[0] = obj;
      a[1] = (VALUE)(&v);
      if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
        if (val) *val = v;
        return SWIG_OK;
      }
    }
    return SWIG_TypeError;
  }
  
  SWIGINTERN void OGRLayerShadow_SetSpatialFilterRect(OGRLayerShadow *self,double minx,double miny,double maxx,double maxy){
      OGR_L_SetSpatialFilterRect(self, minx, miny, maxx, maxy);                          
    }
  SWIGINTERN OGRGeometryShadow *OGRLayerShadow_GetSpatialFilter(OGRLayerShadow *self){
      return (OGRGeometryShadow *) OGR_L_GetSpatialFilter(self);
    }
  SWIGINTERN OGRErr OGRLayerShadow_SetAttributeFilter(OGRLayerShadow *self,char *filter_string){
      return OGR_L_SetAttributeFilter((OGRLayerShadow*)self, filter_string);
    }
  SWIGINTERN void OGRLayerShadow_ResetReading(OGRLayerShadow *self){
      OGR_L_ResetReading(self);
    }
  SWIGINTERN char const *OGRLayerShadow_GetName(OGRLayerShadow *self){
      return OGR_L_GetName(self);
    }
  SWIGINTERN OGRwkbGeometryType OGRLayerShadow_GetGeomType(OGRLayerShadow *self){
      return (OGRwkbGeometryType) OGR_L_GetGeomType(self);
    }
  SWIGINTERN char const *OGRLayerShadow_GetGeometryColumn(OGRLayerShadow *self){
      return OGR_L_GetGeometryColumn(self);
    }
  SWIGINTERN char const *OGRLayerShadow_GetFIDColumn(OGRLayerShadow *self){
      return OGR_L_GetFIDColumn(self);
    }
  SWIGINTERN OGRFeatureShadow *OGRLayerShadow_GetFeature(OGRLayerShadow *self,long fid){
      return (OGRFeatureShadow*) OGR_L_GetFeature(self, fid);
    }
  SWIGINTERN OGRFeatureShadow *OGRLayerShadow_GetNextFeature(OGRLayerShadow *self){
      return (OGRFeatureShadow*) OGR_L_GetNextFeature(self);
    }
  SWIGINTERN OGRErr OGRLayerShadow_SetNextByIndex(OGRLayerShadow *self,long new_index){
      return OGR_L_SetNextByIndex(self, new_index);
    }
  SWIGINTERN OGRErr OGRLayerShadow_SetFeature(OGRLayerShadow *self,OGRFeatureShadow *feature){
      return OGR_L_SetFeature(self, feature);
    }
  SWIGINTERN OGRErr OGRLayerShadow_CreateFeature(OGRLayerShadow *self,OGRFeatureShadow *feature){
      return OGR_L_CreateFeature(self, feature);
    }
  SWIGINTERN OGRErr OGRLayerShadow_DeleteFeature(OGRLayerShadow *self,long fid){
      return OGR_L_DeleteFeature(self, fid);
    }
  SWIGINTERN OGRErr OGRLayerShadow_SyncToDisk(OGRLayerShadow *self){
      return OGR_L_SyncToDisk(self);
    }
  SWIGINTERN OGRFeatureDefnShadow *OGRLayerShadow_GetLayerDefn(OGRLayerShadow *self){
      return (OGRFeatureDefnShadow*) OGR_L_GetLayerDefn(self);
    }
  SWIGINTERN int OGRLayerShadow_GetFeatureCount(OGRLayerShadow *self,int force=1){
      return OGR_L_GetFeatureCount(self, force);
    }
  SWIGINTERN OGRErr OGRLayerShadow_GetExtent(OGRLayerShadow *self,double argout[4],int force=1){
  
  
  
      return OGR_L_GetExtent(self, (OGREnvelope*)argout, force);
    }
  SWIGINTERN bool OGRLayerShadow_TestCapability(OGRLayerShadow *self,char const *cap){
      return (OGR_L_TestCapability(self, cap) > 0);
    }
  SWIGINTERN OGRErr OGRLayerShadow_CreateField(OGRLayerShadow *self,OGRFieldDefnShadow *field_def,int approx_ok=1){
      return OGR_L_CreateField(self, field_def, approx_ok);
    }
  SWIGINTERN OGRErr OGRLayerShadow_DeleteField(OGRLayerShadow *self,int iField){
      return OGR_L_DeleteField(self, iField);
    }
  SWIGINTERN OGRErr OGRLayerShadow_ReorderField(OGRLayerShadow *self,int iOldFieldPos,int iNewFieldPos){
      return OGR_L_ReorderField(self, iOldFieldPos, iNewFieldPos);
    }
  SWIGINTERN OGRErr OGRLayerShadow_ReorderFields(OGRLayerShadow *self,int nList,int *pList){
      if (nList != OGR_FD_GetFieldCount(OGR_L_GetLayerDefn(self)))
      {
        CPLError(CE_Failure, CPLE_IllegalArg,
                 "List should have %d elements",
                 OGR_FD_GetFieldCount(OGR_L_GetLayerDefn(self)));
        return OGRERR_FAILURE;
      }
      return OGR_L_ReorderFields(self, pList);
    }
  SWIGINTERN OGRErr OGRLayerShadow_AlterFieldDefn(OGRLayerShadow *self,int iField,OGRFieldDefnShadow *field_def,int nFlags){
      return OGR_L_AlterFieldDefn(self, iField, field_def, nFlags);
    }
  SWIGINTERN OGRErr OGRLayerShadow_StartTransaction(OGRLayerShadow *self){
      return OGR_L_StartTransaction(self);
    }
  SWIGINTERN OGRErr OGRLayerShadow_CommitTransaction(OGRLayerShadow *self){
      return OGR_L_CommitTransaction(self);
    }
  SWIGINTERN OGRErr OGRLayerShadow_RollbackTransaction(OGRLayerShadow *self){
      return OGR_L_RollbackTransaction(self);
    }
  SWIGINTERN OSRSpatialReferenceShadow *OGRLayerShadow_GetSpatialRef(OGRLayerShadow *self){
      OGRSpatialReferenceH ref =  OGR_L_GetSpatialRef(self);
      if( ref )
          OSRReference(ref);
      return (OSRSpatialReferenceShadow*) ref;
    }
  SWIGINTERN GIntBig OGRLayerShadow_GetFeaturesRead(OGRLayerShadow *self){
      return OGR_L_GetFeaturesRead(self);
    }
  SWIGINTERN OGRErr OGRLayerShadow_SetIgnoredFields(OGRLayerShadow *self,char const **options){
      return OGR_L_SetIgnoredFields( self, options );
    }
  SWIGINTERN OGRErr OGRLayerShadow_Intersection(OGRLayerShadow *self,OGRLayerShadow *method_layer,OGRLayerShadow *result_layer,char **options=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
      return OGR_L_Intersection( self, method_layer, result_layer, options, callback, callback_data );
    }
  SWIGINTERN OGRErr OGRLayerShadow_Union(OGRLayerShadow *self,OGRLayerShadow *method_layer,OGRLayerShadow *result_layer,char **options=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
      return OGR_L_Union( self, method_layer, result_layer, options, callback, callback_data );
    }
  SWIGINTERN OGRErr OGRLayerShadow_SymDifference(OGRLayerShadow *self,OGRLayerShadow *method_layer,OGRLayerShadow *result_layer,char **options=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
      return OGR_L_SymDifference( self, method_layer, result_layer, options, callback, callback_data );
    }
  SWIGINTERN OGRErr OGRLayerShadow_Identity(OGRLayerShadow *self,OGRLayerShadow *method_layer,OGRLayerShadow *result_layer,char **options=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
      return OGR_L_Identity( self, method_layer, result_layer, options, callback, callback_data );
    }
  SWIGINTERN OGRErr OGRLayerShadow_Update(OGRLayerShadow *self,OGRLayerShadow *method_layer,OGRLayerShadow *result_layer,char **options=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
      return OGR_L_Update( self, method_layer, result_layer, options, callback, callback_data );
    }
  SWIGINTERN OGRErr OGRLayerShadow_Clip(OGRLayerShadow *self,OGRLayerShadow *method_layer,OGRLayerShadow *result_layer,char **options=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
      return OGR_L_Clip( self, method_layer, result_layer, options, callback, callback_data );
    }
  SWIGINTERN OGRErr OGRLayerShadow_Erase(OGRLayerShadow *self,OGRLayerShadow *method_layer,OGRLayerShadow *result_layer,char **options=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
      return OGR_L_Erase( self, method_layer, result_layer, options, callback, callback_data );
    }
  SWIGINTERN void OGRLayerShadow_each(OGRLayerShadow *self){
  		OGRFeatureShadow* feature = NULL;
  
   		while (feature = (OGRFeatureShadow*) OGR_L_GetNextFeature(self))
   		{
  			/* Convert the pointer to a Ruby object.  Note we set the flag
  		   to one manually to show this is a new object */
  			VALUE object = SWIG_NewPointerObj((void *) feature, SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_OWN);			
  
  			/* Now invoke the block specified for this method. */
  			rb_yield(object);
  		}
    }
  SWIGINTERN OGRFeatureShadow *new_OGRFeatureShadow(OGRFeatureDefnShadow *feature_def){
        return (OGRFeatureShadow*) OGR_F_Create( feature_def );
    }
  SWIGINTERN OGRFeatureDefnShadow *OGRFeatureShadow_GetDefnRef(OGRFeatureShadow *self){
      return (OGRFeatureDefnShadow*) OGR_F_GetDefnRef(self);
    }
  SWIGINTERN OGRErr OGRFeatureShadow_SetGeometry(OGRFeatureShadow *self,OGRGeometryShadow *geom){
      return OGR_F_SetGeometry(self, geom);
    }
  SWIGINTERN OGRErr OGRFeatureShadow_SetGeometryDirectly(OGRFeatureShadow *self,OGRGeometryShadow *geom){
      return OGR_F_SetGeometryDirectly(self, geom);
    }
  SWIGINTERN OGRGeometryShadow *OGRFeatureShadow_GetGeometryRef(OGRFeatureShadow *self){
      return (OGRGeometryShadow*) OGR_F_GetGeometryRef(self);
    }
  SWIGINTERN OGRFeatureShadow *OGRFeatureShadow_Clone(OGRFeatureShadow *self){
      return (OGRFeatureShadow*) OGR_F_Clone(self);
    }
  SWIGINTERN bool OGRFeatureShadow_Equal(OGRFeatureShadow *self,OGRFeatureShadow *feature){
      return (OGR_F_Equal(self, feature) > 0);
    }
  SWIGINTERN int OGRFeatureShadow_GetFieldCount(OGRFeatureShadow *self){
      return OGR_F_GetFieldCount(self);
    }
  SWIGINTERN OGRFieldDefnShadow *OGRFeatureShadow_GetFieldDefnRef__SWIG_0(OGRFeatureShadow *self,int id){
      return (OGRFieldDefnShadow *) OGR_F_GetFieldDefnRef(self, id);
    }
  SWIGINTERN OGRFieldDefnShadow *OGRFeatureShadow_GetFieldDefnRef__SWIG_1(OGRFeatureShadow *self,char const *name){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  return (OGRFieldDefnShadow *) OGR_F_GetFieldDefnRef(self, i);
        return NULL;
    }
  SWIGINTERN char const *OGRFeatureShadow_GetFieldAsString__SWIG_0(OGRFeatureShadow *self,int id){
      return (const char *) OGR_F_GetFieldAsString(self, id);
    }
  SWIGINTERN char const *OGRFeatureShadow_GetFieldAsString__SWIG_1(OGRFeatureShadow *self,char const *name){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  return (const char *) OGR_F_GetFieldAsString(self, i);
        return NULL;
    }
  SWIGINTERN int OGRFeatureShadow_GetFieldAsInteger__SWIG_0(OGRFeatureShadow *self,int id){
      return OGR_F_GetFieldAsInteger(self, id);
    }
  SWIGINTERN int OGRFeatureShadow_GetFieldAsInteger__SWIG_1(OGRFeatureShadow *self,char const *name){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  return OGR_F_GetFieldAsInteger(self, i);
        return 0;
    }
  SWIGINTERN double OGRFeatureShadow_GetFieldAsDouble__SWIG_0(OGRFeatureShadow *self,int id){
      return OGR_F_GetFieldAsDouble(self, id);
    }
  
    #define SWIG_From_double   rb_float_new 
  
  SWIGINTERN double OGRFeatureShadow_GetFieldAsDouble__SWIG_1(OGRFeatureShadow *self,char const *name){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  return OGR_F_GetFieldAsDouble(self, i);
        return 0;
    }
  SWIGINTERN void OGRFeatureShadow_GetFieldAsDateTime(OGRFeatureShadow *self,int id,int *pnYear,int *pnMonth,int *pnDay,int *pnHour,int *pnMinute,int *pnSecond,int *pnTZFlag){
        OGR_F_GetFieldAsDateTime(self, id, pnYear, pnMonth, pnDay,
  			       pnHour, pnMinute, pnSecond,
  			       pnTZFlag);
    }
  SWIGINTERN void OGRFeatureShadow_GetFieldAsIntegerList(OGRFeatureShadow *self,int id,int *nLen,int const **pList){
        *pList = OGR_F_GetFieldAsIntegerList(self, id, nLen);
    }
  SWIGINTERN void OGRFeatureShadow_GetFieldAsDoubleList(OGRFeatureShadow *self,int id,int *nLen,double const **pList){
        *pList = OGR_F_GetFieldAsDoubleList(self, id, nLen);
    }
  SWIGINTERN void OGRFeatureShadow_GetFieldAsStringList(OGRFeatureShadow *self,int id,char ***pList){
        *pList = OGR_F_GetFieldAsStringList(self, id);
    }
  SWIGINTERN bool OGRFeatureShadow_IsFieldSet__SWIG_0(OGRFeatureShadow *self,int id){
      return (OGR_F_IsFieldSet(self, id) > 0);
    }
  SWIGINTERN bool OGRFeatureShadow_IsFieldSet__SWIG_1(OGRFeatureShadow *self,char const *name){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  return (OGR_F_IsFieldSet(self, i) > 0);
        return false;
    }
  SWIGINTERN int OGRFeatureShadow_GetFieldIndex(OGRFeatureShadow *self,char const *name){
        return OGR_F_GetFieldIndex(self, name);
    }
  SWIGINTERN int OGRFeatureShadow_GetFID(OGRFeatureShadow *self){
      return OGR_F_GetFID(self);
    }
  SWIGINTERN OGRErr OGRFeatureShadow_SetFID(OGRFeatureShadow *self,int fid){
      return OGR_F_SetFID(self, fid);
    }
  SWIGINTERN void OGRFeatureShadow_DumpReadable(OGRFeatureShadow *self){
      OGR_F_DumpReadable(self, NULL);
    }
  SWIGINTERN void OGRFeatureShadow_UnsetField__SWIG_0(OGRFeatureShadow *self,int id){
      OGR_F_UnsetField(self, id);
    }
  SWIGINTERN void OGRFeatureShadow_UnsetField__SWIG_1(OGRFeatureShadow *self,char const *name){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  OGR_F_UnsetField(self, i);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_0(OGRFeatureShadow *self,int id,char const *value){
      OGR_F_SetFieldString(self, id, value);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_1(OGRFeatureShadow *self,char const *name,char const *value){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  OGR_F_SetFieldString(self, i, value);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_2(OGRFeatureShadow *self,int id,int value){
      OGR_F_SetFieldInteger(self, id, value);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_3(OGRFeatureShadow *self,char const *name,int value){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  OGR_F_SetFieldInteger(self, i, value);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_4(OGRFeatureShadow *self,int id,double value){
      OGR_F_SetFieldDouble(self, id, value);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_5(OGRFeatureShadow *self,char const *name,double value){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  OGR_F_SetFieldDouble(self, i, value);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_6(OGRFeatureShadow *self,int id,int year,int month,int day,int hour,int minute,int second,int tzflag){
      OGR_F_SetFieldDateTime(self, id, year, month, day,
                               hour, minute, second, 
                               tzflag);
    }
  SWIGINTERN void OGRFeatureShadow_SetField__SWIG_7(OGRFeatureShadow *self,char const *name,int year,int month,int day,int hour,int minute,int second,int tzflag){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
  	  OGR_F_SetFieldDateTime(self, i, year, month, day,
  				 hour, minute, second, 
  				 tzflag);
    }
  SWIGINTERN void OGRFeatureShadow_SetFieldIntegerList(OGRFeatureShadow *self,int id,int nList,int *pList){
        OGR_F_SetFieldIntegerList(self, id, nList, pList);
    }
  SWIGINTERN void OGRFeatureShadow_SetFieldDoubleList(OGRFeatureShadow *self,int id,int nList,double *pList){
        OGR_F_SetFieldDoubleList(self, id, nList, pList);
    }
  SWIGINTERN void OGRFeatureShadow_SetFieldStringList(OGRFeatureShadow *self,int id,char **pList){
        OGR_F_SetFieldStringList(self, id, pList);
    }
  SWIGINTERN OGRErr OGRFeatureShadow_SetFrom(OGRFeatureShadow *self,OGRFeatureShadow *other,int forgiving=1){
      return OGR_F_SetFrom(self, other, forgiving);
    }
  SWIGINTERN OGRErr OGRFeatureShadow_SetFromWithMap(OGRFeatureShadow *self,OGRFeatureShadow *other,int forgiving,int nList,int *pList){
      if (nList != OGR_F_GetFieldCount(other))
      {
          CPLError(CE_Failure, CPLE_AppDefined,
                   "The size of map doesn't match with the field count of the source feature");
          return OGRERR_FAILURE;
      }
      return OGR_F_SetFromWithMap(self, other, forgiving, pList);
    }
  SWIGINTERN char const *OGRFeatureShadow_GetStyleString(OGRFeatureShadow *self){
      return (const char*) OGR_F_GetStyleString(self);
    }
  SWIGINTERN void OGRFeatureShadow_SetStyleString(OGRFeatureShadow *self,char const *the_string){
      OGR_F_SetStyleString(self, the_string);
    }
  SWIGINTERN OGRFieldType OGRFeatureShadow_GetFieldType__SWIG_0(OGRFeatureShadow *self,int id){
      return (OGRFieldType) OGR_Fld_GetType( OGR_F_GetFieldDefnRef( self, id));
    }
  SWIGINTERN OGRFieldType OGRFeatureShadow_GetFieldType__SWIG_1(OGRFeatureShadow *self,char const *name){
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1) {
  	  CPLError(CE_Failure, 1, "No such field: '%s'", name);
  	  return (OGRFieldType)0;
        } else
  	  return (OGRFieldType) OGR_Fld_GetType( 
  	      OGR_F_GetFieldDefnRef( self,  i )
  	      );
    }
  SWIGINTERN VALUE OGRFeatureShadow_GetField(OGRFeatureShadow *self,VALUE object){
  		VALUE result;
  
  		int index;
  
  		// get field index
  		switch (TYPE(object)) {
  			case T_STRING:
  				index = OGR_F_GetFieldIndex(self, StringValuePtr(object));
  				break;
  			case T_FIXNUM:
  				index = NUM2INT(object);
  				break;
  			default:
  				SWIG_exception(SWIG_TypeError, "Value must be a string or integer.");
  		}
  		
  		int count = OGR_F_GetFieldCount(self);
  		
  		if (index < 0 || index > count) {
  			SWIG_exception(SWIG_IndexError, "Illegal field requested.");
  		}
  
  		// is the field unset?
  	  if (!OGR_F_IsFieldSet(self, index)) {
  	  	result = Qnil;
  	  	return result;
  	  }
  	  
  	  // get field type
      OGRFieldType field_type = (OGRFieldType) OGR_Fld_GetType(OGR_F_GetFieldDefnRef( self, index));
  
  		switch (field_type) {
  			case OFTInteger: {
  				const int value = OGR_F_GetFieldAsInteger(self, index);
  				result = INT2NUM(value);
  				break;
  			}
  
  			case OFTIntegerList: {
  				int len = 0;
  				const int* list = OGR_F_GetFieldAsIntegerList(self, index, &len);
  				
  				result = rb_ary_new2(len);
  				
  		    for ( int i = 0; i < len; ++i, ++list ) {
  					VALUE item = INT2NUM(*list);
  		      rb_ary_store(result, item, i);
  		    }
  		    break;
  			}
  
  			case OFTReal: {
  				const double value = OGR_F_GetFieldAsDouble(self, index);
  				return rb_float_new(value);
  				break;
  			}
  
  			case OFTRealList: {
  				int len = 0;
  				const double* list = OGR_F_GetFieldAsDoubleList(self, index, &len);
  				
  				result = rb_ary_new2(len);
  				
  		    for ( int i = 0; i < len; ++i, ++list ) {
  					VALUE item = rb_float_new(*list);
  		      rb_ary_store(result, item, i);
  		    }
  		    break;
  			}
  
  			case OFTString: {
  				const char* value = (const char *) OGR_F_GetFieldAsString(self, index);
  				return rb_str_new2(value);
  				break;
  			}
  
  			case OFTStringList:
  /*				int len3 = 0;
  				const char** string_list = OGR_F_GetFieldAsStringList(self, index, &len);
  				
  				result = rb_ary_new2(len3);
  				
  		    for ( int i = 0; i < len; ++i, ++string_list ) {
  					VALUE item = rb_str_new2(*string_list);
  		      rb_ary_store(result, item, i);
  		    }*/
  		    result = Qnil;
  		    break;
  			default:
  				SWIG_exception(SWIG_TypeError, "Unsupported field type.");
  		}
  	
  		return result;		
  	}
  SWIGINTERN OGRFeatureDefnShadow *new_OGRFeatureDefnShadow(char const *name_null_ok=NULL){
      OGRFeatureDefnH h = OGR_FD_Create(name_null_ok);
      OGR_FD_Reference(h);
      return (OGRFeatureDefnShadow* )h;
    }
  SWIGINTERN char const *OGRFeatureDefnShadow_GetName(OGRFeatureDefnShadow *self){
      return OGR_FD_GetName(self);
    }
  SWIGINTERN int OGRFeatureDefnShadow_GetFieldCount(OGRFeatureDefnShadow *self){
      return OGR_FD_GetFieldCount(self);
    }
  SWIGINTERN OGRFieldDefnShadow *OGRFeatureDefnShadow_GetFieldDefn(OGRFeatureDefnShadow *self,int i){
      return (OGRFieldDefnShadow*) OGR_FD_GetFieldDefn(self, i);
    }
  SWIGINTERN int OGRFeatureDefnShadow_GetFieldIndex(OGRFeatureDefnShadow *self,char const *name){
        return OGR_FD_GetFieldIndex(self, name);
    }
  SWIGINTERN void OGRFeatureDefnShadow_AddFieldDefn(OGRFeatureDefnShadow *self,OGRFieldDefnShadow *defn){
      OGR_FD_AddFieldDefn(self, defn);
    }
  SWIGINTERN OGRwkbGeometryType OGRFeatureDefnShadow_GetGeomType(OGRFeatureDefnShadow *self){
      return (OGRwkbGeometryType) OGR_FD_GetGeomType(self);
    }
  SWIGINTERN void OGRFeatureDefnShadow_SetGeomType(OGRFeatureDefnShadow *self,OGRwkbGeometryType geom_type){
      OGR_FD_SetGeomType(self, geom_type);
    }
  SWIGINTERN int OGRFeatureDefnShadow_GetReferenceCount(OGRFeatureDefnShadow *self){
      return OGR_FD_GetReferenceCount(self);
    }
  SWIGINTERN int OGRFeatureDefnShadow_IsGeometryIgnored(OGRFeatureDefnShadow *self){
      return OGR_FD_IsGeometryIgnored(self);
    }
  SWIGINTERN void OGRFeatureDefnShadow_SetGeometryIgnored(OGRFeatureDefnShadow *self,int bIgnored){
      return OGR_FD_SetGeometryIgnored(self,bIgnored);
    }
  SWIGINTERN int OGRFeatureDefnShadow_IsStyleIgnored(OGRFeatureDefnShadow *self){
      return OGR_FD_IsStyleIgnored(self);
    }
  SWIGINTERN void OGRFeatureDefnShadow_SetStyleIgnored(OGRFeatureDefnShadow *self,int bIgnored){
      return OGR_FD_SetStyleIgnored(self,bIgnored);
    }
  
      static int ValidateOGRFieldType(OGRFieldType field_type)
      {
          switch(field_type)
          {
              case OFTInteger:
              case OFTIntegerList:
              case OFTReal:
              case OFTRealList:
              case OFTString:
              case OFTStringList:
              case OFTBinary:
              case OFTDate:
              case OFTTime:
              case OFTDateTime:
                  return TRUE;
              default:
                  CPLError(CE_Failure, CPLE_IllegalArg, "Illegal field type value");
                  return FALSE;
          }
      }
  
  SWIGINTERN OGRFieldDefnShadow *new_OGRFieldDefnShadow(char const *name_null_ok="unnamed",OGRFieldType field_type=OFTString){
      if (ValidateOGRFieldType(field_type))
          return (OGRFieldDefnShadow*) OGR_Fld_Create(name_null_ok, field_type);
      else
          return NULL;
    }
  SWIGINTERN char const *OGRFieldDefnShadow_GetName(OGRFieldDefnShadow *self){
      return (const char *) OGR_Fld_GetNameRef(self);
    }
  SWIGINTERN char const *OGRFieldDefnShadow_GetNameRef(OGRFieldDefnShadow *self){
      return (const char *) OGR_Fld_GetNameRef(self);
    }
  SWIGINTERN void OGRFieldDefnShadow_SetName(OGRFieldDefnShadow *self,char const *name){
      OGR_Fld_SetName(self, name);
    }
  SWIGINTERN OGRFieldType OGRFieldDefnShadow_GetType(OGRFieldDefnShadow *self){
      return OGR_Fld_GetType(self);
    }
  SWIGINTERN void OGRFieldDefnShadow_SetType(OGRFieldDefnShadow *self,OGRFieldType type){
      if (ValidateOGRFieldType(type))
          OGR_Fld_SetType(self, type);
    }
  SWIGINTERN OGRJustification OGRFieldDefnShadow_GetJustify(OGRFieldDefnShadow *self){
      return OGR_Fld_GetJustify(self);
    }
  SWIGINTERN void OGRFieldDefnShadow_SetJustify(OGRFieldDefnShadow *self,OGRJustification justify){
      OGR_Fld_SetJustify(self, justify);
    }
  SWIGINTERN int OGRFieldDefnShadow_GetWidth(OGRFieldDefnShadow *self){
      return OGR_Fld_GetWidth(self);
    }
  SWIGINTERN void OGRFieldDefnShadow_SetWidth(OGRFieldDefnShadow *self,int width){
      OGR_Fld_SetWidth(self, width);
    }
  SWIGINTERN int OGRFieldDefnShadow_GetPrecision(OGRFieldDefnShadow *self){
      return OGR_Fld_GetPrecision(self);
    }
  SWIGINTERN void OGRFieldDefnShadow_SetPrecision(OGRFieldDefnShadow *self,int precision){
      OGR_Fld_SetPrecision(self, precision);
    }
  SWIGINTERN char const *OGRFieldDefnShadow_GetTypeName(OGRFieldDefnShadow *self){
        return OGR_GetFieldTypeName(OGR_Fld_GetType(self));
    }
  SWIGINTERN char const *OGRFieldDefnShadow_GetFieldTypeName(OGRFieldDefnShadow *self,OGRFieldType type){
      return OGR_GetFieldTypeName(type);
    }
  SWIGINTERN int OGRFieldDefnShadow_IsIgnored(OGRFieldDefnShadow *self){
      return OGR_Fld_IsIgnored( self );
    }
  SWIGINTERN void OGRFieldDefnShadow_SetIgnored(OGRFieldDefnShadow *self,int bIgnored){
      return OGR_Fld_SetIgnored( self, bIgnored );
    }
  
    OGRGeometryShadow* CreateGeometryFromWkb( int len, char *bin_string, 
                                              OSRSpatialReferenceShadow *reference=NULL ) {
      OGRGeometryH geom = NULL;
      OGRErr err = OGR_G_CreateFromWkb( (unsigned char *) bin_string,
                                        reference,
                                        &geom,
                                        len );
      if (err != 0 ) {
         CPLError(CE_Failure, err, "%s", OGRErrMessages(err));
         return NULL;
      }
      return (OGRGeometryShadow*) geom;
    }
   
  
  
    OGRGeometryShadow* CreateGeometryFromWkt( char **val, 
                                        OSRSpatialReferenceShadow *reference=NULL ) {
      OGRGeometryH geom = NULL;
      OGRErr err = OGR_G_CreateFromWkt(val,
                                        reference,
                                        &geom);
      if (err != 0 ) {
         CPLError(CE_Failure, err, "%s", OGRErrMessages(err));
         return NULL;
      }
      return (OGRGeometryShadow*) geom;
    }
   
  
  
    OGRGeometryShadow *CreateGeometryFromGML( const char * input_string ) {
      OGRGeometryShadow* geom = (OGRGeometryShadow*)OGR_G_CreateFromGML(input_string);
      return geom;
    }
   
  
  
    OGRGeometryShadow *CreateGeometryFromJson( const char * input_string ) {
      OGRGeometryShadow* geom = (OGRGeometryShadow*)OGR_G_CreateGeometryFromJson(input_string);
      return geom;
    }
   
  
  
    OGRGeometryShadow* BuildPolygonFromEdges( OGRGeometryShadow*  hLineCollection,  
                                              int bBestEffort = 0, 
                                              int bAutoClose = 0, 
                                              double dfTolerance=0) {
    
    OGRGeometryH hPolygon = NULL;
    
    OGRErr eErr;
  
    hPolygon = OGRBuildPolygonFromEdges( hLineCollection, bBestEffort, 
                                         bAutoClose, dfTolerance, &eErr );
  
    if (eErr != OGRERR_NONE ) {
      CPLError(CE_Failure, eErr, "%s", OGRErrMessages(eErr));
      return NULL;
    }
  
    return (OGRGeometryShadow* )hPolygon;
    }
  
  
    OGRGeometryShadow* ApproximateArcAngles( 
          double dfCenterX, double dfCenterY, double dfZ,
    	double dfPrimaryRadius, double dfSecondaryAxis, double dfRotation, 
          double dfStartAngle, double dfEndAngle,
          double dfMaxAngleStepSizeDegrees ) {
    
    return (OGRGeometryShadow* )OGR_G_ApproximateArcAngles( 
               dfCenterX, dfCenterY, dfZ, 
               dfPrimaryRadius, dfSecondaryAxis, dfRotation,
               dfStartAngle, dfEndAngle, dfMaxAngleStepSizeDegrees );
    }
  
  
  OGRGeometryShadow* ForceToPolygon( OGRGeometryShadow *geom_in ) {
   if (geom_in == NULL)
       return NULL;
   return (OGRGeometryShadow* )OGR_G_ForceToPolygon( OGR_G_Clone(geom_in) );
  }
  
  
  OGRGeometryShadow* ForceToLineString( OGRGeometryShadow *geom_in ) {
   if (geom_in == NULL)
       return NULL;
   return (OGRGeometryShadow* )OGR_G_ForceToLineString( OGR_G_Clone(geom_in) );
  }
  
  
  OGRGeometryShadow* ForceToMultiPolygon( OGRGeometryShadow *geom_in ) {
   if (geom_in == NULL)
       return NULL;
   return (OGRGeometryShadow* )OGR_G_ForceToMultiPolygon( OGR_G_Clone(geom_in) );
  }
  
  
  OGRGeometryShadow* ForceToMultiPoint( OGRGeometryShadow *geom_in ) {
   if (geom_in == NULL)
       return NULL;
   return (OGRGeometryShadow* )OGR_G_ForceToMultiPoint( OGR_G_Clone(geom_in) );
  }
  
  
  OGRGeometryShadow* ForceToMultiLineString( OGRGeometryShadow *geom_in ) {
   if (geom_in == NULL)
       return NULL;
   return (OGRGeometryShadow* )OGR_G_ForceToMultiLineString( OGR_G_Clone(geom_in) );
  }
  
  SWIGINTERN OGRGeometryShadow *new_OGRGeometryShadow(OGRwkbGeometryType type=wkbUnknown,char *wkt=0,int wkb=0,char *wkb_buf=0,char *gml=0){
      if (type != wkbUnknown ) {
        return (OGRGeometryShadow*) OGR_G_CreateGeometry( type );
      }
      else if ( wkt != 0 ) {
        return CreateGeometryFromWkt( &wkt );
      }
      else if ( wkb != 0 ) {
        return CreateGeometryFromWkb( wkb, wkb_buf );
      }
      else if ( gml != 0 ) {
        return CreateGeometryFromGML( gml );
      }
      // throw?
      else {
          CPLError(CE_Failure, 1, "Empty geometries cannot be constructed");
          return NULL;}
  
    }
  
  #define output_helper SWIG_Ruby_AppendOutput
  
  SWIGINTERN OGRErr OGRGeometryShadow_ExportToWkt(OGRGeometryShadow *self,char **argout){
      return OGR_G_ExportToWkt(self, argout);
    }
  SWIGINTERN OGRErr OGRGeometryShadow_ExportToWkb(OGRGeometryShadow *self,int *nLen,char **pBuf,OGRwkbByteOrder byte_order=wkbXDR){
      *nLen = OGR_G_WkbSize( self );
      *pBuf = (char *) malloc( *nLen * sizeof(unsigned char) );
      return OGR_G_ExportToWkb(self, byte_order, (unsigned char*) *pBuf );
    }
  SWIGINTERN char const *OGRGeometryShadow_ExportToGML(OGRGeometryShadow *self){
      return (const char *) OGR_G_ExportToGML(self);
    }
  SWIGINTERN char const *OGRGeometryShadow_ExportToKML(OGRGeometryShadow *self,char const *altitude_mode=NULL){
      return (const char *) OGR_G_ExportToKML(self, altitude_mode);
    }
  SWIGINTERN char const *OGRGeometryShadow_ExportToJson(OGRGeometryShadow *self){
      return (const char *) OGR_G_ExportToJson(self);
    }
  SWIGINTERN void OGRGeometryShadow_AddPoint(OGRGeometryShadow *self,double x,double y,double z=0){
      OGR_G_AddPoint( self, x, y, z );
    }
  SWIGINTERN void OGRGeometryShadow_AddPoint_2D(OGRGeometryShadow *self,double x,double y){
      OGR_G_AddPoint_2D( self, x, y );
    }
  SWIGINTERN OGRErr OGRGeometryShadow_AddGeometryDirectly(OGRGeometryShadow *self,OGRGeometryShadow *other_disown){
      return OGR_G_AddGeometryDirectly( self, other_disown );
    }
  SWIGINTERN OGRErr OGRGeometryShadow_AddGeometry(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return OGR_G_AddGeometry( self, other );
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Clone(OGRGeometryShadow *self){
      return (OGRGeometryShadow*) OGR_G_Clone(self);
    }
  SWIGINTERN OGRwkbGeometryType OGRGeometryShadow_GetGeometryType(OGRGeometryShadow *self){
      return (OGRwkbGeometryType) OGR_G_GetGeometryType(self);
    }
  SWIGINTERN char const *OGRGeometryShadow_GetGeometryName(OGRGeometryShadow *self){
      return (const char *) OGR_G_GetGeometryName(self);
    }
  SWIGINTERN double OGRGeometryShadow_Length(OGRGeometryShadow *self){
      return OGR_G_Length(self);
    }
  SWIGINTERN double OGRGeometryShadow_Area(OGRGeometryShadow *self){
      return OGR_G_Area(self);
    }
  SWIGINTERN double OGRGeometryShadow_GetArea(OGRGeometryShadow *self){
      return OGR_G_Area(self);
    }
  SWIGINTERN int OGRGeometryShadow_GetPointCount(OGRGeometryShadow *self){
      return OGR_G_GetPointCount(self);
    }
  SWIGINTERN double OGRGeometryShadow_GetX(OGRGeometryShadow *self,int point=0){
      return OGR_G_GetX(self, point);
    }
  SWIGINTERN double OGRGeometryShadow_GetY(OGRGeometryShadow *self,int point=0){
      return OGR_G_GetY(self, point);
    }
  SWIGINTERN double OGRGeometryShadow_GetZ(OGRGeometryShadow *self,int point=0){
      return OGR_G_GetZ(self, point);
    }
  SWIGINTERN void OGRGeometryShadow_GetPoint(OGRGeometryShadow *self,int iPoint=0,double argout[3]=NULL){
  
      OGR_G_GetPoint( self, iPoint, argout+0, argout+1, argout+2 );
    }
  SWIGINTERN void OGRGeometryShadow_GetPoint_2D(OGRGeometryShadow *self,int iPoint=0,double argout[2]=NULL){
  
      OGR_G_GetPoint( self, iPoint, argout+0, argout+1, NULL );
    }
  SWIGINTERN int OGRGeometryShadow_GetGeometryCount(OGRGeometryShadow *self){
      return OGR_G_GetGeometryCount(self);
    }
  SWIGINTERN void OGRGeometryShadow_SetPoint(OGRGeometryShadow *self,int point,double x,double y,double z=0){
      OGR_G_SetPoint(self, point, x, y, z);
    }
  SWIGINTERN void OGRGeometryShadow_SetPoint_2D(OGRGeometryShadow *self,int point,double x,double y){
      OGR_G_SetPoint_2D(self, point, x, y);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_GetGeometryRef(OGRGeometryShadow *self,int geom){
      return (OGRGeometryShadow*) OGR_G_GetGeometryRef(self, geom);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Simplify(OGRGeometryShadow *self,double tolerance){
      return (OGRGeometryShadow*) OGR_G_Simplify(self, tolerance);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_SimplifyPreserveTopology(OGRGeometryShadow *self,double tolerance){
      return (OGRGeometryShadow*) OGR_G_SimplifyPreserveTopology(self, tolerance);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Boundary(OGRGeometryShadow *self){
      return (OGRGeometryShadow*) OGR_G_Boundary(self);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_GetBoundary(OGRGeometryShadow *self){
      return (OGRGeometryShadow*) OGR_G_Boundary(self);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_ConvexHull(OGRGeometryShadow *self){
      return (OGRGeometryShadow*) OGR_G_ConvexHull(self);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Buffer(OGRGeometryShadow *self,double distance,int quadsecs=30){
      return (OGRGeometryShadow*) OGR_G_Buffer( self, distance, quadsecs );
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Intersection(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGRGeometryShadow*) OGR_G_Intersection( self, other );
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Union(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGRGeometryShadow*) OGR_G_Union( self, other );
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_UnionCascaded(OGRGeometryShadow *self){
      return (OGRGeometryShadow*) OGR_G_UnionCascaded( self );
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Difference(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGRGeometryShadow*) OGR_G_Difference( self, other );
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_SymDifference(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGRGeometryShadow*) OGR_G_SymDifference( self, other );
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_SymmetricDifference(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGRGeometryShadow*) OGR_G_SymDifference( self, other );
    }
  SWIGINTERN double OGRGeometryShadow_Distance(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return OGR_G_Distance(self, other);
    }
  SWIGINTERN void OGRGeometryShadow_Empty(OGRGeometryShadow *self){
      OGR_G_Empty(self);
    }
  SWIGINTERN bool OGRGeometryShadow_IsEmpty(OGRGeometryShadow *self){
      return (OGR_G_IsEmpty(self) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_IsValid(OGRGeometryShadow *self){
      return (OGR_G_IsValid(self) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_IsSimple(OGRGeometryShadow *self){
      return (OGR_G_IsSimple(self) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_IsRing(OGRGeometryShadow *self){
      return (OGR_G_IsRing(self) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Intersects(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Intersects(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Intersect(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Intersects(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Equals(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Equals(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Equal(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Equals(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Disjoint(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Disjoint(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Touches(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Touches(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Crosses(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Crosses(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Within(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Within(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Contains(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Contains(self, other) > 0);
    }
  SWIGINTERN bool OGRGeometryShadow_Overlaps(OGRGeometryShadow *self,OGRGeometryShadow *other){
      return (OGR_G_Overlaps(self, other) > 0);
    }
  SWIGINTERN OGRErr OGRGeometryShadow_TransformTo(OGRGeometryShadow *self,OSRSpatialReferenceShadow *reference){
      return OGR_G_TransformTo(self, reference);
    }
  SWIGINTERN OGRErr OGRGeometryShadow_Transform(OGRGeometryShadow *self,OSRCoordinateTransformationShadow *trans){
      return OGR_G_Transform(self, trans);
    }
  SWIGINTERN OSRSpatialReferenceShadow *OGRGeometryShadow_GetSpatialReference(OGRGeometryShadow *self){
      OGRSpatialReferenceH ref =  OGR_G_GetSpatialReference(self);
      if( ref )
          OSRReference(ref);
      return (OSRSpatialReferenceShadow*) ref;
    }
  SWIGINTERN void OGRGeometryShadow_AssignSpatialReference(OGRGeometryShadow *self,OSRSpatialReferenceShadow *reference){
      OGR_G_AssignSpatialReference(self, reference);
    }
  SWIGINTERN void OGRGeometryShadow_CloseRings(OGRGeometryShadow *self){
      OGR_G_CloseRings(self);
    }
  SWIGINTERN void OGRGeometryShadow_FlattenTo2D(OGRGeometryShadow *self){
      OGR_G_FlattenTo2D(self);
    }
  SWIGINTERN void OGRGeometryShadow_Segmentize(OGRGeometryShadow *self,double dfMaxLength){
      OGR_G_Segmentize(self, dfMaxLength);
    }
  SWIGINTERN void OGRGeometryShadow_GetEnvelope(OGRGeometryShadow *self,double argout[4]){
      OGR_G_GetEnvelope(self, (OGREnvelope*)argout);
    }
  SWIGINTERN void OGRGeometryShadow_GetEnvelope3D(OGRGeometryShadow *self,double argout[6]){
      OGR_G_GetEnvelope3D(self, (OGREnvelope3D*)argout);
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Centroid(OGRGeometryShadow *self){
      OGRGeometryShadow *pt = (OGRGeometryShadow*) OGR_G_CreateGeometry( wkbPoint );
      OGR_G_Centroid( self, pt );
      return pt;
    }
  SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_PointOnSurface(OGRGeometryShadow *self){
      return (OGRGeometryShadow*) OGR_G_PointOnSurface( self );
    }
  SWIGINTERN int OGRGeometryShadow_WkbSize(OGRGeometryShadow *self){
      return OGR_G_WkbSize(self);
    }
  SWIGINTERN int OGRGeometryShadow_GetCoordinateDimension(OGRGeometryShadow *self){
      return OGR_G_GetCoordinateDimension(self);
    }
  SWIGINTERN void OGRGeometryShadow_SetCoordinateDimension(OGRGeometryShadow *self,int dimension){
      OGR_G_SetCoordinateDimension(self, dimension);
    }
  SWIGINTERN int OGRGeometryShadow_GetDimension(OGRGeometryShadow *self){
      return OGR_G_GetDimension(self);
    }
  
  char const *OGRDriverShadow_get_name( OGRDriverShadow *h ) {
    return OGR_Dr_GetName( h );
  }
  
  char const *OGRDataSourceShadow_get_name( OGRDataSourceShadow *h ) {
    return OGR_DS_GetName( h );
  }
  
  char const *OGRDriverShadow_name_get( OGRDriverShadow *h ) {
    return OGR_Dr_GetName( h );
  }
  
  char const *OGRDataSourceShadow_name_get( OGRDataSourceShadow *h ) {
    return OGR_DS_GetName( h );
  }
  
  
    OGRDataSourceShadow* GetOpenDS(int ds_number) {
      OGRDataSourceShadow* layer = (OGRDataSourceShadow*) OGRGetOpenDS(ds_number);
      return layer;
    }
  
  
    OGRDataSourceShadow* Open( const char *utf8_path, int update =0 ) {
      CPLErrorReset();
      OGRDataSourceShadow* ds = (OGRDataSourceShadow*)OGROpen(utf8_path,update,NULL);
      if( CPLGetLastErrorType() == CE_Failure && ds != NULL )
      {
          CPLDebug( "SWIG", 
  		  "OGROpen() succeeded, but an error is posted, so we destroy"
  		  " the datasource and fail at swig level." );
          OGRReleaseDataSource(ds);
          ds = NULL;
      }
  	
      return ds;
    }
  
  
    OGRDataSourceShadow* OpenShared( const char *utf8_path, int update =0 ) {
      CPLErrorReset();
      OGRDataSourceShadow* ds = (OGRDataSourceShadow*)OGROpenShared(utf8_path,update,NULL);
      if( CPLGetLastErrorType() == CE_Failure && ds != NULL )
      {
          OGRReleaseDataSource(ds);
          ds = NULL;
      }
  	
      return ds;
    }
  
  
  OGRDriverShadow* GetDriverByName( char const *name ) {
    return (OGRDriverShadow*) OGRGetDriverByName( name );
  }
  
  OGRDriverShadow* GetDriver(int driver_number) {
    return (OGRDriverShadow*) OGRGetDriver(driver_number);
  }
  
  
    char **GeneralCmdLineProcessor( char **papszArgv, int nOptions = 0 ) {
      int nResArgCount;
  
      nResArgCount = 
        OGRGeneralCmdLineProcessor( CSLCount(papszArgv), &papszArgv, nOptions ); 
  
      if( nResArgCount <= 0 )
          return NULL;
      else
          return papszArgv;
    }
  
  
  int GDALTermProgress_nocb( double dfProgress, const char * pszMessage=NULL, void *pData=NULL ) {
    return GDALTermProgress( dfProgress, pszMessage, pData);
  }
  
  
  /*
    Document-method: Gdal::Ogr.use_exceptions
  
    call-seq:
      use_exceptions
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_use_exceptions(int argc, VALUE *argv, VALUE self) {
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    UseExceptions();
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.dont_use_exceptions
  
    call-seq:
      dont_use_exceptions
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_dont_use_exceptions(int argc, VALUE *argv, VALUE self) {
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    DontUseExceptions();
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-class: Gdal::Ogr::Driver
  
    Proxy of C++ Gdal::Ogr::Driver class
  
  
  */
  static swig_class SwigClassDriver;
  
  
  /*
    Document-method: Gdal::Ogr::Driver.name
  
    call-seq:
      name -> char const *
  
  Get value of attribute.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_name_get(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","name", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDriverShadow_name_get(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.create_data_source
  
    call-seq:
      create_data_source(char const * utf8_path, char ** options=None) -> DataSource
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_create_data_source(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char **arg3 = (char **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    const char *kwnames[] = {
      "self","utf8_path","options", NULL 
    };
    OGRDataSourceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","CreateDataSource", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","CreateDataSource", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    if (argc > 1) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[1], T_ARRAY);
        
        int size = RARRAY_LEN(argv[1]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[1], i);
          char *pszItem = StringValuePtr(item);
          arg3 = CSLAddString( arg3, pszItem );
        }
      }
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OGRDriverShadow_CreateDataSource(arg1,(char const *)arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_POINTER_OWN |  0 );
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg3 );
    }
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg3 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.copy_data_source
  
    call-seq:
      copy_data_source(DataSource copy_ds, char const * utf8_path, char ** options=None) -> DataSource
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_copy_data_source(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    OGRDataSourceShadow *arg2 = (OGRDataSourceShadow *) 0 ;
    char *arg3 = (char *) 0 ;
    char **arg4 = (char **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int res3 ;
    char *buf3 = 0 ;
    int alloc3 = 0 ;
    const char *kwnames[] = {
      "self","copy_ds","utf8_path","options", NULL 
    };
    OGRDataSourceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","CopyDataSource", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","CopyDataSource", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRDataSourceShadow * >(argp2);
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","CopyDataSource", 3, argv[1] ));
    }
    arg3 = reinterpret_cast< char * >(buf3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OGRDriverShadow_CopyDataSource(arg1,arg2,(char const *)arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_POINTER_OWN |  0 );
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return vresult;
  fail:
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.open
  
    call-seq:
      open(char const * utf8_path, int update=0) -> DataSource
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_open(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int arg3 = (int) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    const char *kwnames[] = {
      "self","utf8_path","update", NULL 
    };
    OGRDataSourceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","Open", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","Open", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    if (argc > 1) {
      ecode3 = SWIG_AsVal_int(argv[1], &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Open", 3, argv[1] ));
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OGRDriverShadow_Open(arg1,(char const *)arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_POINTER_OWN |  0 );
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.delete_data_source
  
    call-seq:
      delete_data_source(char const * utf8_path) -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_delete_data_source(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","DeleteDataSource", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","DeleteDataSource", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      CPLErrorReset();
      result = (int)OGRDriverShadow_DeleteDataSource(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.test_capability
  
    call-seq:
      test_capability(char const * cap) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_test_capability(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","TestCapability", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","TestCapability", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRDriverShadow_TestCapability(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.get_name
  
    call-seq:
      get_name -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_get_name(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","GetName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDriverShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.register
  
    call-seq:
      register
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_register(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","Register", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    {
      CPLErrorReset();
      OGRDriverShadow_Register(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Driver.deregister
  
    call-seq:
      deregister
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Driver_deregister(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDriverShadow *","Deregister", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    {
      CPLErrorReset();
      OGRDriverShadow_Deregister(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-class: Gdal::Ogr::DataSource
  
    Proxy of C++ Gdal::Ogr::DataSource class
  
  
  */
  static swig_class SwigClassDataSource;
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.name
  
    call-seq:
      name -> char const *
  
  Get value of attribute.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_name_get(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","name", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDataSourceShadow_name_get(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN void delete_OGRDataSourceShadow(OGRDataSourceShadow *self){
      OGRReleaseDataSource(self);
    }
  SWIGINTERN void
  free_OGRDataSourceShadow(OGRDataSourceShadow *arg1) {
      delete_OGRDataSourceShadow(arg1);
  }
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.get_ref_count
  
    call-seq:
      get_ref_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_get_ref_count(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","GetRefCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRDataSourceShadow_GetRefCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.get_summary_ref_count
  
    call-seq:
      get_summary_ref_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_get_summary_ref_count(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","GetSummaryRefCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRDataSourceShadow_GetSummaryRefCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.get_layer_count
  
    call-seq:
      get_layer_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_get_layer_count(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","GetLayerCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRDataSourceShadow_GetLayerCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.get_driver
  
    call-seq:
      get_driver -> Driver
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_get_driver(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRDriverShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","GetDriver", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRDriverShadow *)OGRDataSourceShadow_GetDriver(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.get_name
  
    call-seq:
      get_name -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_get_name(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","GetName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDataSourceShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.delete_layer
  
    call-seq:
      delete_layer(int index) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_delete_layer(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","DeleteLayer", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","DeleteLayer", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRDataSourceShadow_DeleteLayer(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.sync_to_disk
  
    call-seq:
      sync_to_disk -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_sync_to_disk(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","SyncToDisk", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRDataSourceShadow_SyncToDisk(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.create_layer
  
    call-seq:
      create_layer(char const * name, SpatialReference srs=nil, OGRwkbGeometryType geom_type=WKBUNKNOWN, 
      char ** options=None) -> Layer
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_create_layer(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
    OGRwkbGeometryType arg4 = (OGRwkbGeometryType) wkbUnknown ;
    char **arg5 = (char **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    const char *kwnames[] = {
      "self","name","srs","geom_type","options", NULL 
    };
    OGRLayerShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 4)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","CreateLayer", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","CreateLayer", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    if (argc > 1) {
      res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OSRSpatialReferenceShadow *","CreateLayer", 3, argv[1] )); 
      }
      arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
    }
    if (argc > 2) {
      {
        /* %typemap(in) CPLErr */
        arg4 = (OGRwkbGeometryType) NUM2INT(argv[2]);
      }
    }
    if (argc > 3) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[3], T_ARRAY);
        
        int size = RARRAY_LEN(argv[3]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[3], i);
          char *pszItem = StringValuePtr(item);
          arg5 = CSLAddString( arg5, pszItem );
        }
      }
    }
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg5 );
    }
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg5 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.copy_layer
  
    call-seq:
      copy_layer(Layer src_layer, char const * new_name, char ** options=None) -> Layer
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_copy_layer(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    char *arg3 = (char *) 0 ;
    char **arg4 = (char **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int res3 ;
    char *buf3 = 0 ;
    int alloc3 = 0 ;
    const char *kwnames[] = {
      "self","src_layer","new_name","options", NULL 
    };
    OGRLayerShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","CopyLayer", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","CopyLayer", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","CopyLayer", 3, argv[1] ));
    }
    arg3 = reinterpret_cast< char * >(buf3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return vresult;
  fail:
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.test_capability
  
    call-seq:
      test_capability(char const * cap) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_test_capability(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","TestCapability", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","TestCapability", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRDataSourceShadow_TestCapability(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.execute_sql
  
    call-seq:
      execute_sql(char const * statement, Geometry spatialFilter=nil, char const * dialect="") -> Layer
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_execute_sql(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRGeometryShadow *arg3 = (OGRGeometryShadow *) NULL ;
    char *arg4 = (char *) "" ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    int res4 ;
    char *buf4 = 0 ;
    int alloc4 = 0 ;
    const char *kwnames[] = {
      "self","statement","spatialFilter","dialect", NULL 
    };
    OGRLayerShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","ExecuteSQL", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","ExecuteSQL", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    if (argc > 1) {
      res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ExecuteSQL", 3, argv[1] )); 
      }
      arg3 = reinterpret_cast< OGRGeometryShadow * >(argp3);
    }
    if (argc > 2) {
      res4 = SWIG_AsCharPtrAndSize(argv[2], &buf4, NULL, &alloc4);
      if (!SWIG_IsOK(res4)) {
        SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","ExecuteSQL", 4, argv[2] ));
      }
      arg4 = reinterpret_cast< char * >(buf4);
    }
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_ExecuteSQL(arg1,(char const *)arg2,arg3,(char const *)arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.release_result_set
  
    call-seq:
      release_result_set(Layer layer)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_release_result_set(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","ReleaseResultSet", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","ReleaseResultSet", 2, argv[0] ));
    }
    {
      CPLErrorReset();
      OGRDataSourceShadow_ReleaseResultSet(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::DataSource.get_layer
  
    call-seq:
      get_layer(VALUE whichLayer) -> Layer
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_DataSource_get_layer(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    VALUE arg2 = (VALUE) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRLayerShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRDataSourceShadow *","GetLayer", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    arg2 = argv[0];
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_GetLayer(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-class: Gdal::Ogr::Layer
  
    Proxy of C++ Gdal::Ogr::Layer class
  
  
  */
  static swig_class SwigClassLayer;
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_ref_count
  
    call-seq:
      get_ref_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_ref_count(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetRefCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRLayerShadow_GetRefCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.set_spatial_filter
  
    call-seq:
      set_spatial_filter(Geometry filter)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_set_spatial_filter(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SetSpatialFilter", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SetSpatialFilter", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      OGRLayerShadow_SetSpatialFilter(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.set_spatial_filter_rect
  
    call-seq:
      set_spatial_filter_rect(double minx, double miny, double maxx, double maxy)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_set_spatial_filter_rect(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    double arg2 ;
    double arg3 ;
    double arg4 ;
    double arg5 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    double val5 ;
    int ecode5 = 0 ;
    
    if ((argc < 4) || (argc > 4)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SetSpatialFilterRect", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_double(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","SetSpatialFilterRect", 2, argv[0] ));
    } 
    arg2 = static_cast< double >(val2);
    ecode3 = SWIG_AsVal_double(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","SetSpatialFilterRect", 3, argv[1] ));
    } 
    arg3 = static_cast< double >(val3);
    ecode4 = SWIG_AsVal_double(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","SetSpatialFilterRect", 4, argv[2] ));
    } 
    arg4 = static_cast< double >(val4);
    ecode5 = SWIG_AsVal_double(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","SetSpatialFilterRect", 5, argv[3] ));
    } 
    arg5 = static_cast< double >(val5);
    {
      CPLErrorReset();
      OGRLayerShadow_SetSpatialFilterRect(arg1,arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_spatial_filter
  
    call-seq:
      get_spatial_filter -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_spatial_filter(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetSpatialFilter", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRLayerShadow_GetSpatialFilter(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.set_attribute_filter
  
    call-seq:
      set_attribute_filter(char * filter_string) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_set_attribute_filter(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SetAttributeFilter", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","SetAttributeFilter", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SetAttributeFilter(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.reset_reading
  
    call-seq:
      reset_reading
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_reset_reading(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","ResetReading", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      OGRLayerShadow_ResetReading(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_name
  
    call-seq:
      get_name -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_name(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRLayerShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_geom_type
  
    call-seq:
      get_geom_type -> OGRwkbGeometryType
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_geom_type(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRwkbGeometryType result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetGeomType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRwkbGeometryType)OGRLayerShadow_GetGeomType(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_geometry_column
  
    call-seq:
      get_geometry_column -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_geometry_column(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetGeometryColumn", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRLayerShadow_GetGeometryColumn(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_fidcolumn
  
    call-seq:
      get_fidcolumn -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_fidcolumn(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetFIDColumn", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRLayerShadow_GetFIDColumn(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_feature
  
    call-seq:
      get_feature(long fid) -> Feature
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_feature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    long val2 ;
    int ecode2 = 0 ;
    OGRFeatureShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetFeature", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_long(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","GetFeature", 2, argv[0] ));
    } 
    arg2 = static_cast< long >(val2);
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)OGRLayerShadow_GetFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_next_feature
  
    call-seq:
      get_next_feature -> Feature
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_next_feature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRFeatureShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetNextFeature", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)OGRLayerShadow_GetNextFeature(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.set_next_by_index
  
    call-seq:
      set_next_by_index(long new_index) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_set_next_by_index(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    long val2 ;
    int ecode2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SetNextByIndex", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_long(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","SetNextByIndex", 2, argv[0] ));
    } 
    arg2 = static_cast< long >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SetNextByIndex(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.set_feature
  
    call-seq:
      set_feature(Feature feature) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_set_feature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SetFeature", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFeature", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SetFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.create_feature
  
    call-seq:
      create_feature(Feature feature) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_create_feature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","CreateFeature", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRFeatureShadow *","CreateFeature", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_CreateFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.delete_feature
  
    call-seq:
      delete_feature(long fid) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_delete_feature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    long val2 ;
    int ecode2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","DeleteFeature", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_long(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "long","DeleteFeature", 2, argv[0] ));
    } 
    arg2 = static_cast< long >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_DeleteFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.sync_to_disk
  
    call-seq:
      sync_to_disk -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_sync_to_disk(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SyncToDisk", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SyncToDisk(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_layer_defn
  
    call-seq:
      get_layer_defn -> FeatureDefn
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_layer_defn(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRFeatureDefnShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetLayerDefn", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureDefnShadow *)OGRLayerShadow_GetLayerDefn(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_feature_count
  
    call-seq:
      get_feature_count(int force=1) -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_feature_count(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int arg2 = (int) 1 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    const char *kwnames[] = {
      "self","force", NULL 
    };
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetFeatureCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    if (argc > 0) {
      ecode2 = SWIG_AsVal_int(argv[0], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFeatureCount", 2, argv[0] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (int)OGRLayerShadow_GetFeatureCount(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_extent
  
    call-seq:
      get_extent(int force=1) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_extent(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    double *arg2 ;
    int arg3 = (int) 1 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double argout2[4] ;
    int val3 ;
    int ecode3 = 0 ;
    const char *kwnames[] = {
      "self","force", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    {
      /* %typemap(in,numinputs=0) (double argout2[ANY]) */
      arg2 = argout2;
    }
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetExtent", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    if (argc > 0) {
      ecode3 = SWIG_AsVal_int(argv[0], &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","GetExtent", 3, argv[0] ));
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_GetExtent(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(argout) (double argout[ANY]) */
      VALUE outArr = rb_ary_new();
      
      for(int i=0; i<4; i++)
      {
        VALUE value = rb_float_new((arg2)[i]);
        rb_ary_push(outArr, value);
      }
      
      /* Add the output to the result */
      vresult = SWIG_Ruby_AppendOutput(vresult, outArr);	
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.test_capability
  
    call-seq:
      test_capability(char const * cap) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_test_capability(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","TestCapability", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","TestCapability", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRLayerShadow_TestCapability(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.create_field
  
    call-seq:
      create_field(FieldDefn field_def, int approx_ok=1) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_create_field(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFieldDefnShadow *arg2 = (OGRFieldDefnShadow *) 0 ;
    int arg3 = (int) 1 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    const char *kwnames[] = {
      "self","field_def","approx_ok", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","CreateField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","CreateField", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRFieldDefnShadow * >(argp2);
    if (argc > 1) {
      ecode3 = SWIG_AsVal_int(argv[1], &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","CreateField", 3, argv[1] ));
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_CreateField(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.delete_field
  
    call-seq:
      delete_field(int iField) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_delete_field(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","DeleteField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","DeleteField", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_DeleteField(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.reorder_field
  
    call-seq:
      reorder_field(int iOldFieldPos, int iNewFieldPos) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_reorder_field(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int arg2 ;
    int arg3 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","ReorderField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ReorderField", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","ReorderField", 3, argv[1] ));
    } 
    arg3 = static_cast< int >(val3);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_ReorderField(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.reorder_fields
  
    call-seq:
      reorder_fields(int nList) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_reorder_fields(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int arg2 ;
    int *arg3 = (int *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","ReorderFields", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      /* %typemap(in,numinputs=1) (int nList, int* pList) */
      
      /* Make sure this is an array. */
      Check_Type(argv[0], T_ARRAY);
      
      /* Get the length */
      arg2 = RARRAY_LEN(argv[0]);
      
      /* Allocate space for the C array. */
      arg3 = (int*) malloc(arg2*sizeof(int));
      
      for( int i = 0; i<arg2; i++ ) {
        /* Get the Ruby Object */
        VALUE item = rb_ary_entry(argv[0],i);
        /* Conver to an integer */
        arg3[i] = NUM2INT(item);
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_ReorderFields(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) (int nList, int* pList) */
      if (arg3) {
        free((void*) arg3);
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) (int nList, int* pList) */
      if (arg3) {
        free((void*) arg3);
      }
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.alter_field_defn
  
    call-seq:
      alter_field_defn(int iField, FieldDefn field_def, int nFlags) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_alter_field_defn(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int arg2 ;
    OGRFieldDefnShadow *arg3 = (OGRFieldDefnShadow *) 0 ;
    int arg4 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    int val4 ;
    int ecode4 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 3) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","AlterFieldDefn", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","AlterFieldDefn", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","AlterFieldDefn", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRFieldDefnShadow * >(argp3);
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","AlterFieldDefn", 4, argv[2] ));
    } 
    arg4 = static_cast< int >(val4);
    {
      if (!arg3) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_AlterFieldDefn(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.start_transaction
  
    call-seq:
      start_transaction -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_start_transaction(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","StartTransaction", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_StartTransaction(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.commit_transaction
  
    call-seq:
      commit_transaction -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_commit_transaction(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","CommitTransaction", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_CommitTransaction(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.rollback_transaction
  
    call-seq:
      rollback_transaction -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_rollback_transaction(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","RollbackTransaction", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_RollbackTransaction(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_spatial_ref
  
    call-seq:
      get_spatial_ref -> SpatialReference
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_spatial_ref(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OSRSpatialReferenceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetSpatialRef", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OSRSpatialReferenceShadow *)OGRLayerShadow_GetSpatialRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.get_features_read
  
    call-seq:
      get_features_read -> GIntBig
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_get_features_read(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    GIntBig result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","GetFeaturesRead", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = OGRLayerShadow_GetFeaturesRead(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj((new GIntBig(static_cast< const GIntBig& >(result))), SWIGTYPE_p_GIntBig, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.set_ignored_fields
  
    call-seq:
      set_ignored_fields(char const ** options) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_set_ignored_fields(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char **arg2 = (char **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SetIgnoredFields", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      /* %typemap(in) char **options */
      
      /* Check if is a list */
      Check_Type(argv[0], T_ARRAY);
      
      int size = RARRAY_LEN(argv[0]);
      for (int i = 0; i < size; i++) {
        VALUE item = rb_ary_entry(argv[0], i);
        char *pszItem = StringValuePtr(item);
        arg2 = CSLAddString( arg2, pszItem );
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SetIgnoredFields(arg1,(char const **)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg2 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg2 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.intersection
  
    call-seq:
      intersection(Layer method_layer, Layer result_layer, char ** options=nil, GDALProgressFunc callback=0, 
      void * callback_data=nil) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_intersection(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
    char **arg4 = (char **) NULL ;
    GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
    void *arg6 = (void *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp5 ;
    int res5 = 0 ;
    int res6 ;
    const char *kwnames[] = {
      "self","method_layer","result_layer","options","callback","callback_data", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 5)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","Intersection", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","Intersection", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRLayerShadow *","Intersection", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    if (argc > 3) {
      {
        res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_GDALProgressFunc,  0 );
        if (!SWIG_IsOK(res5)) {
          SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "GDALProgressFunc","Intersection", 5, argv[3] )); 
        }  
        if (!argp5) {
          SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "GDALProgressFunc","Intersection", 5, argv[3]));
        } else {
          arg5 = *(reinterpret_cast< GDALProgressFunc * >(argp5));
        }
      }
    }
    if (argc > 4) {
      res6 = SWIG_ConvertPtr(argv[4],SWIG_as_voidptrptr(&arg6), 0, 0);
      if (!SWIG_IsOK(res6)) {
        SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "void *","Intersection", 6, argv[4] )); 
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_Intersection(arg1,arg2,arg3,arg4,arg5,arg6);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.union
  
    call-seq:
      union(Layer method_layer, Layer result_layer, char ** options=nil, GDALProgressFunc callback=0, 
      void * callback_data=nil) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_union(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
    char **arg4 = (char **) NULL ;
    GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
    void *arg6 = (void *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp5 ;
    int res5 = 0 ;
    int res6 ;
    const char *kwnames[] = {
      "self","method_layer","result_layer","options","callback","callback_data", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 5)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","Union", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","Union", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRLayerShadow *","Union", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    if (argc > 3) {
      {
        res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_GDALProgressFunc,  0 );
        if (!SWIG_IsOK(res5)) {
          SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "GDALProgressFunc","Union", 5, argv[3] )); 
        }  
        if (!argp5) {
          SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "GDALProgressFunc","Union", 5, argv[3]));
        } else {
          arg5 = *(reinterpret_cast< GDALProgressFunc * >(argp5));
        }
      }
    }
    if (argc > 4) {
      res6 = SWIG_ConvertPtr(argv[4],SWIG_as_voidptrptr(&arg6), 0, 0);
      if (!SWIG_IsOK(res6)) {
        SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "void *","Union", 6, argv[4] )); 
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_Union(arg1,arg2,arg3,arg4,arg5,arg6);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.sym_difference
  
    call-seq:
      sym_difference(Layer method_layer, Layer result_layer, char ** options=nil, GDALProgressFunc callback=0, 
      void * callback_data=nil) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_sym_difference(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
    char **arg4 = (char **) NULL ;
    GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
    void *arg6 = (void *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp5 ;
    int res5 = 0 ;
    int res6 ;
    const char *kwnames[] = {
      "self","method_layer","result_layer","options","callback","callback_data", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 5)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","SymDifference", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","SymDifference", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRLayerShadow *","SymDifference", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    if (argc > 3) {
      {
        res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_GDALProgressFunc,  0 );
        if (!SWIG_IsOK(res5)) {
          SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "GDALProgressFunc","SymDifference", 5, argv[3] )); 
        }  
        if (!argp5) {
          SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "GDALProgressFunc","SymDifference", 5, argv[3]));
        } else {
          arg5 = *(reinterpret_cast< GDALProgressFunc * >(argp5));
        }
      }
    }
    if (argc > 4) {
      res6 = SWIG_ConvertPtr(argv[4],SWIG_as_voidptrptr(&arg6), 0, 0);
      if (!SWIG_IsOK(res6)) {
        SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "void *","SymDifference", 6, argv[4] )); 
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SymDifference(arg1,arg2,arg3,arg4,arg5,arg6);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.identity
  
    call-seq:
      identity(Layer method_layer, Layer result_layer, char ** options=nil, GDALProgressFunc callback=0, 
      void * callback_data=nil) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_identity(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
    char **arg4 = (char **) NULL ;
    GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
    void *arg6 = (void *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp5 ;
    int res5 = 0 ;
    int res6 ;
    const char *kwnames[] = {
      "self","method_layer","result_layer","options","callback","callback_data", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 5)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","Identity", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","Identity", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRLayerShadow *","Identity", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    if (argc > 3) {
      {
        res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_GDALProgressFunc,  0 );
        if (!SWIG_IsOK(res5)) {
          SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "GDALProgressFunc","Identity", 5, argv[3] )); 
        }  
        if (!argp5) {
          SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "GDALProgressFunc","Identity", 5, argv[3]));
        } else {
          arg5 = *(reinterpret_cast< GDALProgressFunc * >(argp5));
        }
      }
    }
    if (argc > 4) {
      res6 = SWIG_ConvertPtr(argv[4],SWIG_as_voidptrptr(&arg6), 0, 0);
      if (!SWIG_IsOK(res6)) {
        SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "void *","Identity", 6, argv[4] )); 
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_Identity(arg1,arg2,arg3,arg4,arg5,arg6);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.update
  
    call-seq:
      update(Layer method_layer, Layer result_layer, char ** options=nil, GDALProgressFunc callback=0, 
      void * callback_data=nil) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_update(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
    char **arg4 = (char **) NULL ;
    GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
    void *arg6 = (void *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp5 ;
    int res5 = 0 ;
    int res6 ;
    const char *kwnames[] = {
      "self","method_layer","result_layer","options","callback","callback_data", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 5)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","Update", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","Update", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRLayerShadow *","Update", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    if (argc > 3) {
      {
        res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_GDALProgressFunc,  0 );
        if (!SWIG_IsOK(res5)) {
          SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "GDALProgressFunc","Update", 5, argv[3] )); 
        }  
        if (!argp5) {
          SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "GDALProgressFunc","Update", 5, argv[3]));
        } else {
          arg5 = *(reinterpret_cast< GDALProgressFunc * >(argp5));
        }
      }
    }
    if (argc > 4) {
      res6 = SWIG_ConvertPtr(argv[4],SWIG_as_voidptrptr(&arg6), 0, 0);
      if (!SWIG_IsOK(res6)) {
        SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "void *","Update", 6, argv[4] )); 
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_Update(arg1,arg2,arg3,arg4,arg5,arg6);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.clip
  
    call-seq:
      clip(Layer method_layer, Layer result_layer, char ** options=nil, GDALProgressFunc callback=0, 
      void * callback_data=nil) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_clip(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
    char **arg4 = (char **) NULL ;
    GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
    void *arg6 = (void *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp5 ;
    int res5 = 0 ;
    int res6 ;
    const char *kwnames[] = {
      "self","method_layer","result_layer","options","callback","callback_data", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 5)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","Clip", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","Clip", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRLayerShadow *","Clip", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    if (argc > 3) {
      {
        res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_GDALProgressFunc,  0 );
        if (!SWIG_IsOK(res5)) {
          SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "GDALProgressFunc","Clip", 5, argv[3] )); 
        }  
        if (!argp5) {
          SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "GDALProgressFunc","Clip", 5, argv[3]));
        } else {
          arg5 = *(reinterpret_cast< GDALProgressFunc * >(argp5));
        }
      }
    }
    if (argc > 4) {
      res6 = SWIG_ConvertPtr(argv[4],SWIG_as_voidptrptr(&arg6), 0, 0);
      if (!SWIG_IsOK(res6)) {
        SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "void *","Clip", 6, argv[4] )); 
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_Clip(arg1,arg2,arg3,arg4,arg5,arg6);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.erase
  
    call-seq:
      erase(Layer method_layer, Layer result_layer, char ** options=nil, GDALProgressFunc callback=0, 
      void * callback_data=nil) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Layer_erase(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
    char **arg4 = (char **) NULL ;
    GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
    void *arg6 = (void *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp5 ;
    int res5 = 0 ;
    int res6 ;
    const char *kwnames[] = {
      "self","method_layer","result_layer","options","callback","callback_data", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 5)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","Erase", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRLayerShadow *","Erase", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OGRLayerShadow *","Erase", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
    if (argc > 2) {
      {
        /* %typemap(in) char **options */
        
        /* Check if is a list */
        Check_Type(argv[2], T_ARRAY);
        
        int size = RARRAY_LEN(argv[2]);
        for (int i = 0; i < size; i++) {
          VALUE item = rb_ary_entry(argv[2], i);
          char *pszItem = StringValuePtr(item);
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    if (argc > 3) {
      {
        res5 = SWIG_ConvertPtr(argv[3], &argp5, SWIGTYPE_p_GDALProgressFunc,  0 );
        if (!SWIG_IsOK(res5)) {
          SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "GDALProgressFunc","Erase", 5, argv[3] )); 
        }  
        if (!argp5) {
          SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "GDALProgressFunc","Erase", 5, argv[3]));
        } else {
          arg5 = *(reinterpret_cast< GDALProgressFunc * >(argp5));
        }
      }
    }
    if (argc > 4) {
      res6 = SWIG_ConvertPtr(argv[4],SWIG_as_voidptrptr(&arg6), 0, 0);
      if (!SWIG_IsOK(res6)) {
        SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "void *","Erase", 6, argv[4] )); 
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_Erase(arg1,arg2,arg3,arg4,arg5,arg6);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg4 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Layer.each
  
    call-seq:
      each
  
  Iterate thru each element in the Layer.  A block must be provided.
  */
  SWIGINTERN VALUE
  _wrap_Layer_each(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRLayerShadow *","each", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      OGRLayerShadow_each(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-class: Gdal::Ogr::Feature
  
    Proxy of C++ Gdal::Ogr::Feature class
  
  
  */
  static swig_class SwigClassFeature;
  
  SWIGINTERN void delete_OGRFeatureShadow(OGRFeatureShadow *self){
      OGR_F_Destroy(self);
    }
  SWIGINTERN void
  free_OGRFeatureShadow(OGRFeatureShadow *arg1) {
      delete_OGRFeatureShadow(arg1);
  }
  
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
  SWIGINTERN VALUE
  _wrap_Feature_allocate(VALUE self) {
  #else
    SWIGINTERN VALUE
    _wrap_Feature_allocate(int argc, VALUE *argv, VALUE self) {
  #endif
      
      
      VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_OGRFeatureShadow);
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
      rb_obj_call_init(vresult, argc, argv);
  #endif
      return vresult;
    }
    
  
  
  /*
    Document-method: Gdal::Ogr::Feature.new
  
    call-seq:
      Feature.new(FeatureDefn feature_def)
  
  Class constructor.
  
  */
  SWIGINTERN VALUE
  _wrap_new_Feature(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    const char *kwnames[] = {
      "feature_def", NULL 
    };
    OGRFeatureShadow *result = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","OGRFeatureShadow", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      if (!arg1) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)new_OGRFeatureShadow(arg1);
      DATA_PTR(self) = result;
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return self;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_defn_ref
  
    call-seq:
      get_defn_ref -> FeatureDefn
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_defn_ref(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRFeatureDefnShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetDefnRef", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureDefnShadow *)OGRFeatureShadow_GetDefnRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_geometry
  
    call-seq:
      set_geometry(Geometry geom) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_geometry(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetGeometry", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SetGeometry", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetGeometry(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_geometry_directly
  
    call-seq:
      set_geometry_directly(Geometry geom) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_geometry_directly(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetGeometryDirectly", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SetGeometryDirectly", 2, argv[0] ));
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetGeometryDirectly(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_geometry_ref
  
    call-seq:
      get_geometry_ref -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_geometry_ref(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetGeometryRef", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRFeatureShadow_GetGeometryRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.clone
  
    call-seq:
      clone -> Feature
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_clone(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRFeatureShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","Clone", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)OGRFeatureShadow_Clone(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.equal
  
    call-seq:
      equal(Feature feature) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_equal(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","Equal", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRFeatureShadow *","Equal", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRFeatureShadow_Equal(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_count
  
    call-seq:
      get_field_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_count(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_defn_ref
  
    call-seq:
      get_field_defn_ref(int id) -> FieldDefn
      get_field_defn_ref(char const * name) -> FieldDefn
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_defn_ref__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    OGRFieldDefnShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldDefnRef", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldDefnRef", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)OGRFeatureShadow_GetFieldDefnRef__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_get_field_defn_ref__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    OGRFieldDefnShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldDefnRef", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GetFieldDefnRef", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)OGRFeatureShadow_GetFieldDefnRef__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_get_field_defn_ref(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 3) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Feature_get_field_defn_ref__SWIG_0(nargs, args, self);
        }
      }
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Feature_get_field_defn_ref__SWIG_1(nargs, args, self);
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 3, "get_field_defn_ref", 
      "    OGRFieldDefnShadow * get_field_defn_ref(int id)\n"
      "    OGRFieldDefnShadow * get_field_defn_ref(char const *name)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_as_string
  
    call-seq:
      get_field_as_string(int id) -> char const *
      get_field_as_string(char const * name) -> char const
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_string__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsString", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldAsString", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_string__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsString", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GetFieldAsString", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_get_field_as_string(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 3) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Feature_get_field_as_string__SWIG_0(nargs, args, self);
        }
      }
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Feature_get_field_as_string__SWIG_1(nargs, args, self);
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 3, "get_field_as_string", 
      "    char const * get_field_as_string(int id)\n"
      "    char const * get_field_as_string(char const *name)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_as_integer
  
    call-seq:
      get_field_as_integer(int id) -> int
      get_field_as_integer(char const * name) -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_integer__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsInteger", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldAsInteger", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldAsInteger__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_integer__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsInteger", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GetFieldAsInteger", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldAsInteger__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_get_field_as_integer(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 3) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Feature_get_field_as_integer__SWIG_0(nargs, args, self);
        }
      }
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Feature_get_field_as_integer__SWIG_1(nargs, args, self);
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 3, "get_field_as_integer", 
      "    int get_field_as_integer(int id)\n"
      "    int get_field_as_integer(char const *name)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_as_double
  
    call-seq:
      get_field_as_double(int id) -> double
      get_field_as_double(char const * name) -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_double__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsDouble", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldAsDouble", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (double)OGRFeatureShadow_GetFieldAsDouble__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_double__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsDouble", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GetFieldAsDouble", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (double)OGRFeatureShadow_GetFieldAsDouble__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_get_field_as_double(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 3) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Feature_get_field_as_double__SWIG_0(nargs, args, self);
        }
      }
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Feature_get_field_as_double__SWIG_1(nargs, args, self);
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 3, "get_field_as_double", 
      "    double get_field_as_double(int id)\n"
      "    double get_field_as_double(char const *name)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_as_date_time
  
    call-seq:
      get_field_as_date_time(int id)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_date_time(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int *arg3 = (int *) 0 ;
    int *arg4 = (int *) 0 ;
    int *arg5 = (int *) 0 ;
    int *arg6 = (int *) 0 ;
    int *arg7 = (int *) 0 ;
    int *arg8 = (int *) 0 ;
    int *arg9 = (int *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int temp3 ;
    int res3 = SWIG_TMPOBJ ;
    int temp4 ;
    int res4 = SWIG_TMPOBJ ;
    int temp5 ;
    int res5 = SWIG_TMPOBJ ;
    int temp6 ;
    int res6 = SWIG_TMPOBJ ;
    int temp7 ;
    int res7 = SWIG_TMPOBJ ;
    int temp8 ;
    int res8 = SWIG_TMPOBJ ;
    int temp9 ;
    int res9 = SWIG_TMPOBJ ;
    VALUE vresult = Qnil;
    
    arg3 = &temp3;
    arg4 = &temp4;
    arg5 = &temp5;
    arg6 = &temp6;
    arg7 = &temp7;
    arg8 = &temp8;
    arg9 = &temp9;
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsDateTime", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldAsDateTime", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFeatureShadow_GetFieldAsDateTime(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = rb_ary_new();
    if (SWIG_IsTmpObj(res3)) {
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_int((*arg3)));
    } else {
      int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags));
    }
    if (SWIG_IsTmpObj(res4)) {
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_int((*arg4)));
    } else {
      int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
    }
    if (SWIG_IsTmpObj(res5)) {
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_int((*arg5)));
    } else {
      int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_int, new_flags));
    }
    if (SWIG_IsTmpObj(res6)) {
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_int((*arg6)));
    } else {
      int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, new_flags));
    }
    if (SWIG_IsTmpObj(res7)) {
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_int((*arg7)));
    } else {
      int new_flags = SWIG_IsNewObj(res7) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_int, new_flags));
    }
    if (SWIG_IsTmpObj(res8)) {
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_int((*arg8)));
    } else {
      int new_flags = SWIG_IsNewObj(res8) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg8), SWIGTYPE_p_int, new_flags));
    }
    if (SWIG_IsTmpObj(res9)) {
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_From_int((*arg9)));
    } else {
      int new_flags = SWIG_IsNewObj(res9) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
      vresult = SWIG_Ruby_AppendOutput(vresult, SWIG_NewPointerObj((void*)(arg9), SWIGTYPE_p_int, new_flags));
    }
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_as_integer_list
  
    call-seq:
      get_field_as_integer_list(int id, int * nLen, int const ** pList)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_integer_list(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int *arg3 = (int *) 0 ;
    int **arg4 = (int **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp4 = 0 ;
    int res4 = 0 ;
    
    if ((argc < 3) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsIntegerList", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldAsIntegerList", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_int, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","GetFieldAsIntegerList", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< int * >(argp3);
    res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_p_int, 0 |  0 );
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "int const **","GetFieldAsIntegerList", 4, argv[2] )); 
    }
    arg4 = reinterpret_cast< int ** >(argp4);
    {
      CPLErrorReset();
      OGRFeatureShadow_GetFieldAsIntegerList(arg1,arg2,arg3,(int const **)arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_as_double_list
  
    call-seq:
      get_field_as_double_list(int id, int * nLen, double const ** pList)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_double_list(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int *arg3 = (int *) 0 ;
    double **arg4 = (double **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    void *argp4 = 0 ;
    int res4 = 0 ;
    
    if ((argc < 3) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsDoubleList", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldAsDoubleList", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_int, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","GetFieldAsDoubleList", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< int * >(argp3);
    res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_p_double, 0 |  0 );
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double const **","GetFieldAsDoubleList", 4, argv[2] )); 
    }
    arg4 = reinterpret_cast< double ** >(argp4);
    {
      CPLErrorReset();
      OGRFeatureShadow_GetFieldAsDoubleList(arg1,arg2,arg3,(double const **)arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_as_string_list
  
    call-seq:
      get_field_as_string_list(int id, char *** pList)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_as_string_list(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char ***arg3 = (char ***) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldAsStringList", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldAsStringList", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_p_p_char, 0 |  0 );
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char ***","GetFieldAsStringList", 3, argv[1] )); 
    }
    arg3 = reinterpret_cast< char *** >(argp3);
    {
      CPLErrorReset();
      OGRFeatureShadow_GetFieldAsStringList(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.is_field_set
  
    call-seq:
      is_field_set(int id) -> bool
      is_field_set(char const * name) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_is_field_set__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","IsFieldSet", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","IsFieldSet", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (bool)OGRFeatureShadow_IsFieldSet__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_is_field_set__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","IsFieldSet", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","IsFieldSet", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRFeatureShadow_IsFieldSet__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_is_field_set(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 3) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Feature_is_field_set__SWIG_0(nargs, args, self);
        }
      }
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Feature_is_field_set__SWIG_1(nargs, args, self);
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 3, "is_field_set", 
      "    bool is_field_set(int id)\n"
      "    bool is_field_set(char const *name)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_index
  
    call-seq:
      get_field_index(char const * name) -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_index(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldIndex", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GetFieldIndex", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldIndex(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_fid
  
    call-seq:
      get_fid -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_fid(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFID", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFID(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_fid
  
    call-seq:
      set_fid(int fid) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_fid(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFID", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetFID", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetFID(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.dump_readable
  
    call-seq:
      dump_readable
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_dump_readable(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","DumpReadable", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      OGRFeatureShadow_DumpReadable(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.unset_field
  
    call-seq:
      unset_field(int id)
      unset_field(char const * name)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_unset_field__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","UnsetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","UnsetField", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFeatureShadow_UnsetField__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_unset_field__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","UnsetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","UnsetField", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_UnsetField__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_unset_field(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 3) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Feature_unset_field__SWIG_0(nargs, args, self);
        }
      }
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Feature_unset_field__SWIG_1(nargs, args, self);
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 3, "unset_field", 
      "    void unset_field(int id)\n"
      "    void unset_field(char const *name)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_field
  
    call-seq:
      set_field(int id, char const * value)
      set_field(char const * name, char const * value)
      set_field(int id, int value)
      set_field(char const * name, int value)
      set_field(int id, double value)
      set_field(char const * name, double value)
      set_field(int id, int year, int month, int day, int hour, int minute, int second, int tzflag)
      set_field(char const * name, int year, int month, int day, int hour, int minute, int second, 
      int tzflag)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char *arg3 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int res3 ;
    char *buf3 = 0 ;
    int alloc3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetField", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SetField", 3, argv[1] ));
    }
    arg3 = reinterpret_cast< char * >(buf3);
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_0(arg1,arg2,(char const *)arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    return Qnil;
  fail:
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char *arg3 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int res3 ;
    char *buf3 = 0 ;
    int alloc3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SetField", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    res3 = SWIG_AsCharPtrAndSize(argv[1], &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","SetField", 3, argv[1] ));
    }
    arg3 = reinterpret_cast< char * >(buf3);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_1(arg1,(char const *)arg2,(char const *)arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    return Qnil;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_2(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int arg3 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetField", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","SetField", 3, argv[1] ));
    } 
    arg3 = static_cast< int >(val3);
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_2(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_3(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int arg3 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SetField", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","SetField", 3, argv[1] ));
    } 
    arg3 = static_cast< int >(val3);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_3(arg1,(char const *)arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_4(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    double arg3 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetField", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_double(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","SetField", 3, argv[1] ));
    } 
    arg3 = static_cast< double >(val3);
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_4(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_5(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    double arg3 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SetField", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    ecode3 = SWIG_AsVal_double(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","SetField", 3, argv[1] ));
    } 
    arg3 = static_cast< double >(val3);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_5(arg1,(char const *)arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_6(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int arg3 ;
    int arg4 ;
    int arg5 ;
    int arg6 ;
    int arg7 ;
    int arg8 ;
    int arg9 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    int val4 ;
    int ecode4 = 0 ;
    int val5 ;
    int ecode5 = 0 ;
    int val6 ;
    int ecode6 = 0 ;
    int val7 ;
    int ecode7 = 0 ;
    int val8 ;
    int ecode8 = 0 ;
    int val9 ;
    int ecode9 = 0 ;
    
    if ((argc < 8) || (argc > 8)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetField", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","SetField", 3, argv[1] ));
    } 
    arg3 = static_cast< int >(val3);
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","SetField", 4, argv[2] ));
    } 
    arg4 = static_cast< int >(val4);
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","SetField", 5, argv[3] ));
    } 
    arg5 = static_cast< int >(val5);
    ecode6 = SWIG_AsVal_int(argv[4], &val6);
    if (!SWIG_IsOK(ecode6)) {
      SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "int","SetField", 6, argv[4] ));
    } 
    arg6 = static_cast< int >(val6);
    ecode7 = SWIG_AsVal_int(argv[5], &val7);
    if (!SWIG_IsOK(ecode7)) {
      SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","SetField", 7, argv[5] ));
    } 
    arg7 = static_cast< int >(val7);
    ecode8 = SWIG_AsVal_int(argv[6], &val8);
    if (!SWIG_IsOK(ecode8)) {
      SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "int","SetField", 8, argv[6] ));
    } 
    arg8 = static_cast< int >(val8);
    ecode9 = SWIG_AsVal_int(argv[7], &val9);
    if (!SWIG_IsOK(ecode9)) {
      SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "int","SetField", 9, argv[7] ));
    } 
    arg9 = static_cast< int >(val9);
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_6(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_set_field__SWIG_7(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int arg3 ;
    int arg4 ;
    int arg5 ;
    int arg6 ;
    int arg7 ;
    int arg8 ;
    int arg9 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    int val4 ;
    int ecode4 = 0 ;
    int val5 ;
    int ecode5 = 0 ;
    int val6 ;
    int ecode6 = 0 ;
    int val7 ;
    int ecode7 = 0 ;
    int val8 ;
    int ecode8 = 0 ;
    int val9 ;
    int ecode9 = 0 ;
    
    if ((argc < 8) || (argc > 8)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 8)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SetField", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","SetField", 3, argv[1] ));
    } 
    arg3 = static_cast< int >(val3);
    ecode4 = SWIG_AsVal_int(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","SetField", 4, argv[2] ));
    } 
    arg4 = static_cast< int >(val4);
    ecode5 = SWIG_AsVal_int(argv[3], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","SetField", 5, argv[3] ));
    } 
    arg5 = static_cast< int >(val5);
    ecode6 = SWIG_AsVal_int(argv[4], &val6);
    if (!SWIG_IsOK(ecode6)) {
      SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "int","SetField", 6, argv[4] ));
    } 
    arg6 = static_cast< int >(val6);
    ecode7 = SWIG_AsVal_int(argv[5], &val7);
    if (!SWIG_IsOK(ecode7)) {
      SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "int","SetField", 7, argv[5] ));
    } 
    arg7 = static_cast< int >(val7);
    ecode8 = SWIG_AsVal_int(argv[6], &val8);
    if (!SWIG_IsOK(ecode8)) {
      SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "int","SetField", 8, argv[6] ));
    } 
    arg8 = static_cast< int >(val8);
    ecode9 = SWIG_AsVal_int(argv[7], &val9);
    if (!SWIG_IsOK(ecode9)) {
      SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "int","SetField", 9, argv[7] ));
    } 
    arg9 = static_cast< int >(val9);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_7(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_set_field(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[10];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 10) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 3) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[2], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Feature_set_field__SWIG_2(nargs, args, self);
          }
        }
      }
    }
    if (argc == 3) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[2], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Feature_set_field__SWIG_4(nargs, args, self);
          }
        }
      }
    }
    if (argc == 3) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_Feature_set_field__SWIG_0(nargs, args, self);
          }
        }
      }
    }
    if (argc == 3) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[2], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Feature_set_field__SWIG_3(nargs, args, self);
          }
        }
      }
    }
    if (argc == 3) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_double(argv[2], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            return _wrap_Feature_set_field__SWIG_5(nargs, args, self);
          }
        }
      }
    }
    if (argc == 3) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
          _v = SWIG_CheckState(res);
          if (_v) {
            return _wrap_Feature_set_field__SWIG_1(nargs, args, self);
          }
        }
      }
    }
    if (argc == 9) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[2], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_int(argv[3], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              {
                int res = SWIG_AsVal_int(argv[4], NULL);
                _v = SWIG_CheckState(res);
              }
              if (_v) {
                {
                  int res = SWIG_AsVal_int(argv[5], NULL);
                  _v = SWIG_CheckState(res);
                }
                if (_v) {
                  {
                    int res = SWIG_AsVal_int(argv[6], NULL);
                    _v = SWIG_CheckState(res);
                  }
                  if (_v) {
                    {
                      int res = SWIG_AsVal_int(argv[7], NULL);
                      _v = SWIG_CheckState(res);
                    }
                    if (_v) {
                      {
                        int res = SWIG_AsVal_int(argv[8], NULL);
                        _v = SWIG_CheckState(res);
                      }
                      if (_v) {
                        return _wrap_Feature_set_field__SWIG_6(nargs, args, self);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    if (argc == 9) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          {
            int res = SWIG_AsVal_int(argv[2], NULL);
            _v = SWIG_CheckState(res);
          }
          if (_v) {
            {
              int res = SWIG_AsVal_int(argv[3], NULL);
              _v = SWIG_CheckState(res);
            }
            if (_v) {
              {
                int res = SWIG_AsVal_int(argv[4], NULL);
                _v = SWIG_CheckState(res);
              }
              if (_v) {
                {
                  int res = SWIG_AsVal_int(argv[5], NULL);
                  _v = SWIG_CheckState(res);
                }
                if (_v) {
                  {
                    int res = SWIG_AsVal_int(argv[6], NULL);
                    _v = SWIG_CheckState(res);
                  }
                  if (_v) {
                    {
                      int res = SWIG_AsVal_int(argv[7], NULL);
                      _v = SWIG_CheckState(res);
                    }
                    if (_v) {
                      {
                        int res = SWIG_AsVal_int(argv[8], NULL);
                        _v = SWIG_CheckState(res);
                      }
                      if (_v) {
                        return _wrap_Feature_set_field__SWIG_7(nargs, args, self);
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 10, "set_field", 
      "    void set_field(int id, char const *value)\n"
      "    void set_field(char const *name, char const *value)\n"
      "    void set_field(int id, int value)\n"
      "    void set_field(char const *name, int value)\n"
      "    void set_field(int id, double value)\n"
      "    void set_field(char const *name, double value)\n"
      "    void set_field(int id, int year, int month, int day, int hour, int minute, int second, int tzflag)\n"
      "    void set_field(char const *name, int year, int month, int day, int hour, int minute, int second, int tzflag)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_field_integer_list
  
    call-seq:
      set_field_integer_list(int id, int nList)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_field_integer_list(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int arg3 ;
    int *arg4 = (int *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFieldIntegerList", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetFieldIntegerList", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      /* %typemap(in,numinputs=1) (int nList, int* pList) */
      
      /* Make sure this is an array. */
      Check_Type(argv[1], T_ARRAY);
      
      /* Get the length */
      arg3 = RARRAY_LEN(argv[1]);
      
      /* Allocate space for the C array. */
      arg4 = (int*) malloc(arg3*sizeof(int));
      
      for( int i = 0; i<arg3; i++ ) {
        /* Get the Ruby Object */
        VALUE item = rb_ary_entry(argv[1],i);
        /* Conver to an integer */
        arg4[i] = NUM2INT(item);
      }
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetFieldIntegerList(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(freearg) (int nList, int* pList) */
      if (arg4) {
        free((void*) arg4);
      }
    }
    return Qnil;
  fail:
    {
      /* %typemap(freearg) (int nList, int* pList) */
      if (arg4) {
        free((void*) arg4);
      }
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_field_double_list
  
    call-seq:
      set_field_double_list(int id, int nList, double * pList)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_field_double_list(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int arg3 ;
    double *arg4 = (double *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    void *argp4 = 0 ;
    int res4 = 0 ;
    
    if ((argc < 3) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFieldDoubleList", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetFieldDoubleList", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","SetFieldDoubleList", 3, argv[1] ));
    } 
    arg3 = static_cast< int >(val3);
    res4 = SWIG_ConvertPtr(argv[2], &argp4,SWIGTYPE_p_double, 0 |  0 );
    if (!SWIG_IsOK(res4)) {
      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double *","SetFieldDoubleList", 4, argv[2] )); 
    }
    arg4 = reinterpret_cast< double * >(argp4);
    {
      CPLErrorReset();
      OGRFeatureShadow_SetFieldDoubleList(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_field_string_list
  
    call-seq:
      set_field_string_list(int id, char ** pList)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_field_string_list(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char **arg3 = (char **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFieldStringList", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetFieldStringList", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      /* %typemap(in) char **options */
      
      /* Check if is a list */
      Check_Type(argv[1], T_ARRAY);
      
      int size = RARRAY_LEN(argv[1]);
      for (int i = 0; i < size; i++) {
        VALUE item = rb_ary_entry(argv[1], i);
        char *pszItem = StringValuePtr(item);
        arg3 = CSLAddString( arg3, pszItem );
      }
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetFieldStringList(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg3 );
    }
    return Qnil;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg3 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_from
  
    call-seq:
      set_from(Feature other, int forgiving=1) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_from(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    int arg3 = (int) 1 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    const char *kwnames[] = {
      "self","other","forgiving", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFrom", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFrom", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    if (argc > 1) {
      ecode3 = SWIG_AsVal_int(argv[1], &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","SetFrom", 3, argv[1] ));
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetFrom(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_from_with_map
  
    call-seq:
      set_from_with_map(Feature other, int forgiving, int nList) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_from_with_map(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    int arg3 ;
    int arg4 ;
    int *arg5 = (int *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 3) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFromWithMap", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetFromWithMap", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    ecode3 = SWIG_AsVal_int(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","SetFromWithMap", 3, argv[1] ));
    } 
    arg3 = static_cast< int >(val3);
    {
      /* %typemap(in,numinputs=1) (int nList, int* pList) */
      
      /* Make sure this is an array. */
      Check_Type(argv[2], T_ARRAY);
      
      /* Get the length */
      arg4 = RARRAY_LEN(argv[2]);
      
      /* Allocate space for the C array. */
      arg5 = (int*) malloc(arg4*sizeof(int));
      
      for( int i = 0; i<arg4; i++ ) {
        /* Get the Ruby Object */
        VALUE item = rb_ary_entry(argv[2],i);
        /* Conver to an integer */
        arg5[i] = NUM2INT(item);
      }
    }
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetFromWithMap(arg1,arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(freearg) (int nList, int* pList) */
      if (arg5) {
        free((void*) arg5);
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) (int nList, int* pList) */
      if (arg5) {
        free((void*) arg5);
      }
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_style_string
  
    call-seq:
      get_style_string -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_style_string(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetStyleString", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetStyleString(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.set_style_string
  
    call-seq:
      set_style_string(char const * the_string)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_set_style_string(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","SetStyleString", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SetStyleString", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      CPLErrorReset();
      OGRFeatureShadow_SetStyleString(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field_type
  
    call-seq:
      get_field_type(int id) -> OGRFieldType
      get_field_type(char const * name) -> OGRFieldType
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field_type__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    OGRFieldType result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldType", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRFieldType)OGRFeatureShadow_GetFieldType__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  SWIGINTERN VALUE
  _wrap_Feature_get_field_type__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    OGRFieldType result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetFieldType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GetFieldType", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRFieldType)OGRFeatureShadow_GetFieldType__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  SWIGINTERN VALUE _wrap_Feature_get_field_type(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    if (argc > 3) SWIG_fail;
    for (ii = 1; (ii < argc); ++ii) {
      argv[ii] = args[ii-1];
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        {
          int res = SWIG_AsVal_int(argv[1], NULL);
          _v = SWIG_CheckState(res);
        }
        if (_v) {
          return _wrap_Feature_get_field_type__SWIG_0(nargs, args, self);
        }
      }
    }
    if (argc == 2) {
      int _v;
      void *vptr = 0;
      int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
      _v = SWIG_CheckState(res);
      if (_v) {
        int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
        _v = SWIG_CheckState(res);
        if (_v) {
          return _wrap_Feature_get_field_type__SWIG_1(nargs, args, self);
        }
      }
    }
    
  fail:
    Ruby_Format_OverloadedError( argc, 3, "get_field_type", 
      "    OGRFieldType get_field_type(int id)\n"
      "    OGRFieldType get_field_type(char const *name)\n");
    
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Feature.get_field
  
    call-seq:
      get_field(VALUE object) -> VALUE
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Feature_get_field(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    VALUE arg2 = (VALUE) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    VALUE result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureShadow *","GetField", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    arg2 = argv[0];
    {
      CPLErrorReset();
      result = (VALUE)OGRFeatureShadow_GetField(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = result;
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-class: Gdal::Ogr::FeatureDefn
  
    Proxy of C++ Gdal::Ogr::FeatureDefn class
  
  
  */
  static swig_class SwigClassFeatureDefn;
  
  SWIGINTERN void delete_OGRFeatureDefnShadow(OGRFeatureDefnShadow *self){
      /*OGR_FD_Destroy(self);*/
      OGR_FD_Release( OGRFeatureDefnH(self) );
    }
  SWIGINTERN void
  free_OGRFeatureDefnShadow(OGRFeatureDefnShadow *arg1) {
      delete_OGRFeatureDefnShadow(arg1);
  }
  
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
  SWIGINTERN VALUE
  _wrap_FeatureDefn_allocate(VALUE self) {
  #else
    SWIGINTERN VALUE
    _wrap_FeatureDefn_allocate(int argc, VALUE *argv, VALUE self) {
  #endif
      
      
      VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_OGRFeatureDefnShadow);
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
      rb_obj_call_init(vresult, argc, argv);
  #endif
      return vresult;
    }
    
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.new
  
    call-seq:
      FeatureDefn.new(char const * name_null_ok=nil)
  
  Class constructor.
  
  */
  SWIGINTERN VALUE
  _wrap_new_FeatureDefn(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) NULL ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    const char *kwnames[] = {
      "name_null_ok", NULL 
    };
    OGRFeatureDefnShadow *result = 0 ;
    
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    if (argc > 0) {
      res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
      if (!SWIG_IsOK(res1)) {
        SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","OGRFeatureDefnShadow", 1, argv[0] ));
      }
      arg1 = reinterpret_cast< char * >(buf1);
    }
    {
      CPLErrorReset();
      result = (OGRFeatureDefnShadow *)new_OGRFeatureDefnShadow((char const *)arg1);
      DATA_PTR(self) = result;
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return self;
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.get_name
  
    call-seq:
      get_name -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_get_name(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","GetName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFeatureDefnShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.get_field_count
  
    call-seq:
      get_field_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_get_field_count(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","GetFieldCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_GetFieldCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.get_field_defn
  
    call-seq:
      get_field_defn(int i) -> FieldDefn
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_get_field_defn(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    OGRFieldDefnShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","GetFieldDefn", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetFieldDefn", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)OGRFeatureDefnShadow_GetFieldDefn(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.get_field_index
  
    call-seq:
      get_field_index(char const * name) -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_get_field_index(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","GetFieldIndex", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GetFieldIndex", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_GetFieldIndex(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.add_field_defn
  
    call-seq:
      add_field_defn(FieldDefn defn)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_add_field_defn(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRFieldDefnShadow *arg2 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","AddFieldDefn", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","AddFieldDefn", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRFieldDefnShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      OGRFeatureDefnShadow_AddFieldDefn(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.get_geom_type
  
    call-seq:
      get_geom_type -> OGRwkbGeometryType
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_get_geom_type(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRwkbGeometryType result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","GetGeomType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRwkbGeometryType)OGRFeatureDefnShadow_GetGeomType(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.set_geom_type
  
    call-seq:
      set_geom_type(OGRwkbGeometryType geom_type)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_set_geom_type(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRwkbGeometryType arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","SetGeomType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      /* %typemap(in) CPLErr */
      arg2 = (OGRwkbGeometryType) NUM2INT(argv[0]);
    }
    {
      CPLErrorReset();
      OGRFeatureDefnShadow_SetGeomType(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.get_reference_count
  
    call-seq:
      get_reference_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_get_reference_count(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","GetReferenceCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_GetReferenceCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.is_geometry_ignored
  
    call-seq:
      is_geometry_ignored -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_is_geometry_ignored(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","IsGeometryIgnored", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_IsGeometryIgnored(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.set_geometry_ignored
  
    call-seq:
      set_geometry_ignored(int bIgnored)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_set_geometry_ignored(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","SetGeometryIgnored", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetGeometryIgnored", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFeatureDefnShadow_SetGeometryIgnored(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.is_style_ignored
  
    call-seq:
      is_style_ignored -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_is_style_ignored(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","IsStyleIgnored", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_IsStyleIgnored(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FeatureDefn.set_style_ignored
  
    call-seq:
      set_style_ignored(int bIgnored)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FeatureDefn_set_style_ignored(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFeatureDefnShadow *","SetStyleIgnored", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetStyleIgnored", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFeatureDefnShadow_SetStyleIgnored(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-class: Gdal::Ogr::FieldDefn
  
    Proxy of C++ Gdal::Ogr::FieldDefn class
  
  
  */
  static swig_class SwigClassFieldDefn;
  
  SWIGINTERN void delete_OGRFieldDefnShadow(OGRFieldDefnShadow *self){
      OGR_Fld_Destroy(self);
    }
  SWIGINTERN void
  free_OGRFieldDefnShadow(OGRFieldDefnShadow *arg1) {
      delete_OGRFieldDefnShadow(arg1);
  }
  
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
  SWIGINTERN VALUE
  _wrap_FieldDefn_allocate(VALUE self) {
  #else
    SWIGINTERN VALUE
    _wrap_FieldDefn_allocate(int argc, VALUE *argv, VALUE self) {
  #endif
      
      
      VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_OGRFieldDefnShadow);
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
      rb_obj_call_init(vresult, argc, argv);
  #endif
      return vresult;
    }
    
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.new
  
    call-seq:
      FieldDefn.new(char const * name_null_ok="unnamed", OGRFieldType field_type=OFTSTRING)
  
  Class constructor.
  
  */
  SWIGINTERN VALUE
  _wrap_new_FieldDefn(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) "unnamed" ;
    OGRFieldType arg2 = (OGRFieldType) OFTString ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    const char *kwnames[] = {
      "name_null_ok","field_type", NULL 
    };
    OGRFieldDefnShadow *result = 0 ;
    
    if ((argc < 0) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    if (argc > 0) {
      res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
      if (!SWIG_IsOK(res1)) {
        SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","OGRFieldDefnShadow", 1, argv[0] ));
      }
      arg1 = reinterpret_cast< char * >(buf1);
    }
    if (argc > 1) {
      {
        /* %typemap(in) CPLErr */
        arg2 = (OGRFieldType) NUM2INT(argv[1]);
      }
    }
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)new_OGRFieldDefnShadow((char const *)arg1,arg2);
      DATA_PTR(self) = result;
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return self;
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_name
  
    call-seq:
      get_name -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_name(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFieldDefnShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_name_ref
  
    call-seq:
      get_name_ref -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_name_ref(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetNameRef", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFieldDefnShadow_GetNameRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.set_name
  
    call-seq:
      set_name(char const * name)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_set_name(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","SetName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","SetName", 2, argv[0] ));
    }
    arg2 = reinterpret_cast< char * >(buf2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetName(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_type
  
    call-seq:
      get_type -> OGRFieldType
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_type(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRFieldType result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFieldType)OGRFieldDefnShadow_GetType(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.set_type
  
    call-seq:
      set_type(OGRFieldType type)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_set_type(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRFieldType arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","SetType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      /* %typemap(in) CPLErr */
      arg2 = (OGRFieldType) NUM2INT(argv[0]);
    }
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetType(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_justify
  
    call-seq:
      get_justify -> OGRJustification
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_justify(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRJustification result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetJustify", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRJustification)OGRFieldDefnShadow_GetJustify(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.set_justify
  
    call-seq:
      set_justify(OGRJustification justify)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_set_justify(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRJustification arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","SetJustify", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      /* %typemap(in) CPLErr */
      arg2 = (OGRJustification) NUM2INT(argv[0]);
    }
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetJustify(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_width
  
    call-seq:
      get_width -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_width(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetWidth", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFieldDefnShadow_GetWidth(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.set_width
  
    call-seq:
      set_width(int width)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_set_width(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","SetWidth", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetWidth", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetWidth(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_precision
  
    call-seq:
      get_precision -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_precision(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetPrecision", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFieldDefnShadow_GetPrecision(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.set_precision
  
    call-seq:
      set_precision(int precision)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_set_precision(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","SetPrecision", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetPrecision", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetPrecision(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_type_name
  
    call-seq:
      get_type_name -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_type_name(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetTypeName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFieldDefnShadow_GetTypeName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.get_field_type_name
  
    call-seq:
      get_field_type_name(OGRFieldType type) -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_get_field_type_name(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRFieldType arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","GetFieldTypeName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      /* %typemap(in) CPLErr */
      arg2 = (OGRFieldType) NUM2INT(argv[0]);
    }
    {
      CPLErrorReset();
      result = (char *)OGRFieldDefnShadow_GetFieldTypeName(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.is_ignored
  
    call-seq:
      is_ignored -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_is_ignored(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","IsIgnored", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFieldDefnShadow_IsIgnored(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::FieldDefn.set_ignored
  
    call-seq:
      set_ignored(int bIgnored)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_FieldDefn_set_ignored(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRFieldDefnShadow *","SetIgnored", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetIgnored", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetIgnored(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.create_geometry_from_wkb
  
    call-seq:
      create_geometry_from_wkb(int len, SpatialReference reference=nil) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_create_geometry_from_wkb(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    char *arg2 = (char *) 0 ;
    OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
    int res1 ;
    char *buf1 = 0 ;
    size_t size1 = 0 ;
    int alloc1 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    const char *kwnames[] = {
      "len","reference", NULL 
    };
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, &size1, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "int","CreateGeometryFromWkb", 1, argv[0] ));
    }  
    arg2 = reinterpret_cast< char * >(buf1) ;
    arg1 = static_cast< int >(size1 - 1) ;
    if (argc > 1) {
      res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "OSRSpatialReferenceShadow *","CreateGeometryFromWkb", 3, argv[1] )); 
      }
      arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)CreateGeometryFromWkb(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.create_geometry_from_wkt
  
    call-seq:
      create_geometry_from_wkt(char ** val, SpatialReference reference=nil) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_create_geometry_from_wkt(int argc, VALUE *argv, VALUE self) {
    char **arg1 = (char **) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) NULL ;
    char *val1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    const char *kwnames[] = {
      "val","reference", NULL 
    };
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    {
      /* %typemap(in) char ** ( char *val1=0 ) */
      
      val1 = StringValuePtr(argv[0]);
      arg1 = &val1;
    }
    if (argc > 1) {
      res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
      if (!SWIG_IsOK(res2)) {
        SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OSRSpatialReferenceShadow *","CreateGeometryFromWkt", 2, argv[1] )); 
      }
      arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)CreateGeometryFromWkt(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.create_geometry_from_gml
  
    call-seq:
      create_geometry_from_gml(char const * input_string) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_create_geometry_from_gml(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","CreateGeometryFromGML", 1, argv[0] ));
    }
    arg1 = reinterpret_cast< char * >(buf1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)CreateGeometryFromGML((char const *)arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return vresult;
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.create_geometry_from_json
  
    call-seq:
      create_geometry_from_json(char const * input_string) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_create_geometry_from_json(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","CreateGeometryFromJson", 1, argv[0] ));
    }
    arg1 = reinterpret_cast< char * >(buf1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)CreateGeometryFromJson((char const *)arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return vresult;
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.build_polygon_from_edges
  
    call-seq:
      build_polygon_from_edges(Geometry hLineCollection, int bBestEffort=0, int bAutoClose=0, double dfTolerance=0) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_build_polygon_from_edges(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    int arg3 = (int) 0 ;
    double arg4 = (double) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    const char *kwnames[] = {
      "hLineCollection","bBestEffort","bAutoClose","dfTolerance", NULL 
    };
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 4)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","BuildPolygonFromEdges", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 1) {
      ecode2 = SWIG_AsVal_int(argv[1], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","BuildPolygonFromEdges", 2, argv[1] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    if (argc > 2) {
      ecode3 = SWIG_AsVal_int(argv[2], &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","BuildPolygonFromEdges", 3, argv[2] ));
      } 
      arg3 = static_cast< int >(val3);
    }
    if (argc > 3) {
      ecode4 = SWIG_AsVal_double(argv[3], &val4);
      if (!SWIG_IsOK(ecode4)) {
        SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","BuildPolygonFromEdges", 4, argv[3] ));
      } 
      arg4 = static_cast< double >(val4);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)BuildPolygonFromEdges(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.approximate_arc_angles
  
    call-seq:
      approximate_arc_angles(double dfCenterX, double dfCenterY, double dfZ, double dfPrimaryRadius, double dfSecondaryAxis, 
      double dfRotation, double dfStartAngle, double dfEndAngle, double dfMaxAngleStepSizeDegrees) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_approximate_arc_angles(int argc, VALUE *argv, VALUE self) {
    double arg1 ;
    double arg2 ;
    double arg3 ;
    double arg4 ;
    double arg5 ;
    double arg6 ;
    double arg7 ;
    double arg8 ;
    double arg9 ;
    double val1 ;
    int ecode1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    double val5 ;
    int ecode5 = 0 ;
    double val6 ;
    int ecode6 = 0 ;
    double val7 ;
    int ecode7 = 0 ;
    double val8 ;
    int ecode8 = 0 ;
    double val9 ;
    int ecode9 = 0 ;
    const char *kwnames[] = {
      "dfCenterX","dfCenterY","dfZ","dfPrimaryRadius","dfSecondaryAxis","dfRotation","dfStartAngle","dfEndAngle","dfMaxAngleStepSizeDegrees", NULL 
    };
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 9) || (argc > 9)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 9)",argc); SWIG_fail;
    }
    ecode1 = SWIG_AsVal_double(argv[0], &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 1, argv[0] ));
    } 
    arg1 = static_cast< double >(val1);
    ecode2 = SWIG_AsVal_double(argv[1], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 2, argv[1] ));
    } 
    arg2 = static_cast< double >(val2);
    ecode3 = SWIG_AsVal_double(argv[2], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 3, argv[2] ));
    } 
    arg3 = static_cast< double >(val3);
    ecode4 = SWIG_AsVal_double(argv[3], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 4, argv[3] ));
    } 
    arg4 = static_cast< double >(val4);
    ecode5 = SWIG_AsVal_double(argv[4], &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 5, argv[4] ));
    } 
    arg5 = static_cast< double >(val5);
    ecode6 = SWIG_AsVal_double(argv[5], &val6);
    if (!SWIG_IsOK(ecode6)) {
      SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 6, argv[5] ));
    } 
    arg6 = static_cast< double >(val6);
    ecode7 = SWIG_AsVal_double(argv[6], &val7);
    if (!SWIG_IsOK(ecode7)) {
      SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 7, argv[6] ));
    } 
    arg7 = static_cast< double >(val7);
    ecode8 = SWIG_AsVal_double(argv[7], &val8);
    if (!SWIG_IsOK(ecode8)) {
      SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 8, argv[7] ));
    } 
    arg8 = static_cast< double >(val8);
    ecode9 = SWIG_AsVal_double(argv[8], &val9);
    if (!SWIG_IsOK(ecode9)) {
      SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "double","ApproximateArcAngles", 9, argv[8] ));
    } 
    arg9 = static_cast< double >(val9);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)ApproximateArcAngles(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.force_to_polygon
  
    call-seq:
      force_to_polygon(Geometry geom_in) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_force_to_polygon(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ForceToPolygon", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)ForceToPolygon(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.force_to_line_string
  
    call-seq:
      force_to_line_string(Geometry geom_in) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_force_to_line_string(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ForceToLineString", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)ForceToLineString(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.force_to_multi_polygon
  
    call-seq:
      force_to_multi_polygon(Geometry geom_in) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_force_to_multi_polygon(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ForceToMultiPolygon", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)ForceToMultiPolygon(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.force_to_multi_point
  
    call-seq:
      force_to_multi_point(Geometry geom_in) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_force_to_multi_point(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ForceToMultiPoint", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)ForceToMultiPoint(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.force_to_multi_line_string
  
    call-seq:
      force_to_multi_line_string(Geometry geom_in) -> Geometry
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_force_to_multi_line_string(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ForceToMultiLineString", 1, argv[0] )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)ForceToMultiLineString(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-class: Gdal::Ogr::Geometry
  
    Proxy of C++ Gdal::Ogr::Geometry class
  
  
  */
  static swig_class SwigClassGeometry;
  
  SWIGINTERN void delete_OGRGeometryShadow(OGRGeometryShadow *self){
      OGR_G_DestroyGeometry( self );
    }
  SWIGINTERN void
  free_OGRGeometryShadow(OGRGeometryShadow *arg1) {
      delete_OGRGeometryShadow(arg1);
  }
  
  #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
  SWIGINTERN VALUE
  _wrap_Geometry_allocate(VALUE self) {
  #else
    SWIGINTERN VALUE
    _wrap_Geometry_allocate(int argc, VALUE *argv, VALUE self) {
  #endif
      
      
      VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_OGRGeometryShadow);
  #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
      rb_obj_call_init(vresult, argc, argv);
  #endif
      return vresult;
    }
    
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.new
  
    call-seq:
      Geometry.new(OGRwkbGeometryType type=WKBUNKNOWN, char * wkt=None, int wkb=0, char * gml=None)
  
  Class constructor.
  
  */
  SWIGINTERN VALUE
  _wrap_new_Geometry(int argc, VALUE *argv, VALUE self) {
    OGRwkbGeometryType arg1 = (OGRwkbGeometryType) wkbUnknown ;
    char *arg2 = (char *) 0 ;
    int arg3 = (int) 0 ;
    char *arg4 = (char *) 0 ;
    char *arg5 = (char *) 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int res3 ;
    char *buf3 = 0 ;
    size_t size3 = 0 ;
    int alloc3 = 0 ;
    int res5 ;
    char *buf5 = 0 ;
    int alloc5 = 0 ;
    const char *kwnames[] = {
      "type","wkt","wkb","gml", NULL 
    };
    OGRGeometryShadow *result = 0 ;
    
    if ((argc < 0) || (argc > 4)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    if (argc > 0) {
      {
        /* %typemap(in) CPLErr */
        arg1 = (OGRwkbGeometryType) NUM2INT(argv[0]);
      }
    }
    if (argc > 1) {
      res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
      if (!SWIG_IsOK(res2)) {
        SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","OGRGeometryShadow", 2, argv[1] ));
      }
      arg2 = reinterpret_cast< char * >(buf2);
    }
    if (argc > 2) {
      res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, &size3, &alloc3);
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int","OGRGeometryShadow", 3, argv[2] ));
      }  
      arg4 = reinterpret_cast< char * >(buf3) ;
      arg3 = static_cast< int >(size3 - 1) ;
    }
    if (argc > 3) {
      res5 = SWIG_AsCharPtrAndSize(argv[3], &buf5, NULL, &alloc5);
      if (!SWIG_IsOK(res5)) {
        SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char *","OGRGeometryShadow", 5, argv[3] ));
      }
      arg5 = reinterpret_cast< char * >(buf5);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)new_OGRGeometryShadow(arg1,arg2,arg3,arg4,arg5);
      DATA_PTR(self) = result;
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
    return self;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.export_to_wkt
  
    call-seq:
      export_to_wkt -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_export_to_wkt(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char **arg2 = (char **) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *argout2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    {
      /* %typemap(in,numinputs=0) (char **argout2) ( char *argout2=0 ) */
      arg2 = &argout2;
    }
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ExportToWkt", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_ExportToWkt(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(argout) (char **argout) */
      VALUE outArg;
      if ( arg2 ) {
        outArg = rb_str_new2( *arg2 );
      }
      else {
        outArg = Qnil;
      }
      
      vresult = SWIG_Ruby_AppendOutput(vresult, outArg);
    }
    {
      /* %typemap(freearg) (char **argout) */
      
      if ( *arg2 )
      CPLFree( *arg2 );
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) (char **argout) */
      
      if ( *arg2 )
      CPLFree( *arg2 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.export_to_wkb
  
    call-seq:
      export_to_wkb(OGRwkbByteOrder byte_order=WKBXDR) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_export_to_wkb(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int *arg2 = (int *) 0 ;
    char **arg3 = (char **) 0 ;
    OGRwkbByteOrder arg4 = (OGRwkbByteOrder) wkbXDR ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int nLen2 = 0 ;
    char *pBuf2 = 0 ;
    const char *kwnames[] = {
      "self","byte_order", NULL 
    };
    OGRErr result;
    VALUE vresult = Qnil;
    
    {
      /* %typemap(in,numinputs=0) (int *nLen2, char **pBuf2 ) ( int nLen2 = 0, char *pBuf2 = 0 ) */
      arg2 = &nLen2;
      arg3 = &pBuf2;
    }
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ExportToWkb", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 0) {
      {
        /* %typemap(in) CPLErr */
        arg4 = (OGRwkbByteOrder) NUM2INT(argv[0]);
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_ExportToWkb(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(argout) (int *nLen, char **pBuf ) */
      vresult = rb_str_new(*arg3, *arg2);
    }
    {
      /* %typemap(freearg) (int *nLen, char **pBuf ) */
      if( *arg3 ) {
        free( *arg3 );
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    {
      /* %typemap(freearg) (int *nLen, char **pBuf ) */
      if( *arg3 ) {
        free( *arg3 );
      }
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.export_to_gml
  
    call-seq:
      export_to_gml -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_export_to_gml(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ExportToGML", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRGeometryShadow_ExportToGML(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.export_to_kml
  
    call-seq:
      export_to_kml(char const * altitude_mode=nil) -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_export_to_kml(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char *arg2 = (char *) NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ExportToKML", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 0) {
      res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
      if (!SWIG_IsOK(res2)) {
        SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","ExportToKML", 2, argv[0] ));
      }
      arg2 = reinterpret_cast< char * >(buf2);
    }
    {
      CPLErrorReset();
      result = (char *)OGRGeometryShadow_ExportToKML(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.export_to_json
  
    call-seq:
      export_to_json -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_export_to_json(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ExportToJson", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRGeometryShadow_ExportToJson(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.add_point
  
    call-seq:
      add_point(double x, double y, double z=0)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_add_point(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    double arg3 ;
    double arg4 = (double) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    const char *kwnames[] = {
      "self","x","y","z", NULL 
    };
    
    if ((argc < 2) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","AddPoint", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","AddPoint", 2, argv[0] ));
    } 
    arg2 = static_cast< double >(val2);
    ecode3 = SWIG_AsVal_double(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","AddPoint", 3, argv[1] ));
    } 
    arg3 = static_cast< double >(val3);
    if (argc > 2) {
      ecode4 = SWIG_AsVal_double(argv[2], &val4);
      if (!SWIG_IsOK(ecode4)) {
        SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","AddPoint", 4, argv[2] ));
      } 
      arg4 = static_cast< double >(val4);
    }
    {
      CPLErrorReset();
      OGRGeometryShadow_AddPoint(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.add_point_2d
  
    call-seq:
      add_point_2d(double x, double y)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_add_point_2d(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    double arg3 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    
    if ((argc < 2) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","AddPoint_2D", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","AddPoint_2D", 2, argv[0] ));
    } 
    arg2 = static_cast< double >(val2);
    ecode3 = SWIG_AsVal_double(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","AddPoint_2D", 3, argv[1] ));
    } 
    arg3 = static_cast< double >(val3);
    {
      CPLErrorReset();
      OGRGeometryShadow_AddPoint_2D(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.add_geometry_directly
  
    call-seq:
      add_geometry_directly(Geometry other_disown) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_add_geometry_directly(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","AddGeometryDirectly", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","AddGeometryDirectly", 2, argv[0] ));
    }
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_AddGeometryDirectly(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.add_geometry
  
    call-seq:
      add_geometry(Geometry other) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_add_geometry(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","AddGeometry", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","AddGeometry", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_AddGeometry(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.clone
  
    call-seq:
      clone -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_clone(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Clone", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Clone(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_geometry_type
  
    call-seq:
      get_geometry_type -> OGRwkbGeometryType
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_geometry_type(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRwkbGeometryType result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetGeometryType", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRwkbGeometryType)OGRGeometryShadow_GetGeometryType(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_geometry_name
  
    call-seq:
      get_geometry_name -> char const *
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_geometry_name(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetGeometryName", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRGeometryShadow_GetGeometryName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.length
  
    call-seq:
      length -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_length(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Length", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_Length(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.area
  
    call-seq:
      area -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_area(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Area", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_Area(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_area
  
    call-seq:
      get_area -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_area(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetArea", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetArea(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_point_count
  
    call-seq:
      get_point_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_point_count(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetPointCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetPointCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_x
  
    call-seq:
      get_x(int point=0) -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_x(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    const char *kwnames[] = {
      "self","point", NULL 
    };
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetX", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 0) {
      ecode2 = SWIG_AsVal_int(argv[0], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetX", 2, argv[0] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetX(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_y
  
    call-seq:
      get_y(int point=0) -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_y(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    const char *kwnames[] = {
      "self","point", NULL 
    };
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetY", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 0) {
      ecode2 = SWIG_AsVal_int(argv[0], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetY", 2, argv[0] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetY(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_z
  
    call-seq:
      get_z(int point=0) -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_z(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    const char *kwnames[] = {
      "self","point", NULL 
    };
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetZ", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 0) {
      ecode2 = SWIG_AsVal_int(argv[0], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetZ", 2, argv[0] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetZ(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_point
  
    call-seq:
      get_point(int iPoint=0)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_point(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double *arg3 = (double *) (double *)NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    double argout3[3] ;
    VALUE vresult = Qnil;
    
    {
      /* %typemap(in,numinputs=0) (double argout3[ANY]) */
      arg3 = argout3;
    }
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetPoint", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 0) {
      ecode2 = SWIG_AsVal_int(argv[0], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetPoint", 2, argv[0] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      OGRGeometryShadow_GetPoint(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(argout) (double argout[ANY]) */
      VALUE outArr = rb_ary_new();
      
      for(int i=0; i<3; i++)
      {
        VALUE value = rb_float_new((arg3)[i]);
        rb_ary_push(outArr, value);
      }
      
      /* Add the output to the result */
      vresult = SWIG_Ruby_AppendOutput(vresult, outArr);	
    }
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_point_2d
  
    call-seq:
      get_point_2d(int iPoint=0)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_point_2d(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double *arg3 = (double *) (double *)NULL ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    double argout3[2] ;
    VALUE vresult = Qnil;
    
    {
      /* %typemap(in,numinputs=0) (double argout3[ANY]) */
      arg3 = argout3;
    }
    if ((argc < 0) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetPoint_2D", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (argc > 0) {
      ecode2 = SWIG_AsVal_int(argv[0], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetPoint_2D", 2, argv[0] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      OGRGeometryShadow_GetPoint_2D(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(argout) (double argout[ANY]) */
      VALUE outArr = rb_ary_new();
      
      for(int i=0; i<2; i++)
      {
        VALUE value = rb_float_new((arg3)[i]);
        rb_ary_push(outArr, value);
      }
      
      /* Add the output to the result */
      vresult = SWIG_Ruby_AppendOutput(vresult, outArr);	
    }
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_geometry_count
  
    call-seq:
      get_geometry_count -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_geometry_count(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetGeometryCount", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetGeometryCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.set_point
  
    call-seq:
      set_point(int point, double x, double y, double z=0)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_set_point(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    double arg3 ;
    double arg4 ;
    double arg5 = (double) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    double val5 ;
    int ecode5 = 0 ;
    const char *kwnames[] = {
      "self","point","x","y","z", NULL 
    };
    
    if ((argc < 3) || (argc > 4)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SetPoint", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetPoint", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_double(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","SetPoint", 3, argv[1] ));
    } 
    arg3 = static_cast< double >(val3);
    ecode4 = SWIG_AsVal_double(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","SetPoint", 4, argv[2] ));
    } 
    arg4 = static_cast< double >(val4);
    if (argc > 3) {
      ecode5 = SWIG_AsVal_double(argv[3], &val5);
      if (!SWIG_IsOK(ecode5)) {
        SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","SetPoint", 5, argv[3] ));
      } 
      arg5 = static_cast< double >(val5);
    }
    {
      CPLErrorReset();
      OGRGeometryShadow_SetPoint(arg1,arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.set_point_2d
  
    call-seq:
      set_point_2d(int point, double x, double y)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_set_point_2d(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    double arg3 ;
    double arg4 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    const char *kwnames[] = {
      "self","point","x","y", NULL 
    };
    
    if ((argc < 3) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SetPoint_2D", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetPoint_2D", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_double(argv[1], &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","SetPoint_2D", 3, argv[1] ));
    } 
    arg3 = static_cast< double >(val3);
    ecode4 = SWIG_AsVal_double(argv[2], &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","SetPoint_2D", 4, argv[2] ));
    } 
    arg4 = static_cast< double >(val4);
    {
      CPLErrorReset();
      OGRGeometryShadow_SetPoint_2D(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_geometry_ref
  
    call-seq:
      get_geometry_ref(int geom) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_geometry_ref(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetGeometryRef", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GetGeometryRef", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_GetGeometryRef(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.simplify
  
    call-seq:
      simplify(double tolerance) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_simplify(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Simplify", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Simplify", 2, argv[0] ));
    } 
    arg2 = static_cast< double >(val2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Simplify(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.simplify_preserve_topology
  
    call-seq:
      simplify_preserve_topology(double tolerance) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_simplify_preserve_topology(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SimplifyPreserveTopology", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","SimplifyPreserveTopology", 2, argv[0] ));
    } 
    arg2 = static_cast< double >(val2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_SimplifyPreserveTopology(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.boundary
  
    call-seq:
      boundary -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_boundary(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Boundary", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Boundary(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_boundary
  
    call-seq:
      get_boundary -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_boundary(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetBoundary", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_GetBoundary(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.convex_hull
  
    call-seq:
      convex_hull -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_convex_hull(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","ConvexHull", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_ConvexHull(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.buffer
  
    call-seq:
      buffer(double distance, int quadsecs=30) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_buffer(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    int arg3 = (int) 30 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    const char *kwnames[] = {
      "self","distance","quadsecs", NULL 
    };
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Buffer", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Buffer", 2, argv[0] ));
    } 
    arg2 = static_cast< double >(val2);
    if (argc > 1) {
      ecode3 = SWIG_AsVal_int(argv[1], &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Buffer", 3, argv[1] ));
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Buffer(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.intersection
  
    call-seq:
      intersection(Geometry other) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_intersection(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Intersection", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Intersection", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Intersection(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.union
  
    call-seq:
      union(Geometry other) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_union(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Union", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Union", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Union(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.union_cascaded
  
    call-seq:
      union_cascaded -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_union_cascaded(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","UnionCascaded", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_UnionCascaded(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.difference
  
    call-seq:
      difference(Geometry other) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_difference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Difference", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Difference", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Difference(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.sym_difference
  
    call-seq:
      sym_difference(Geometry other) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_sym_difference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SymDifference", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SymDifference", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_SymDifference(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.symmetric_difference
  
    call-seq:
      symmetric_difference(Geometry other) -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_symmetric_difference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SymmetricDifference", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SymmetricDifference", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_SymmetricDifference(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.distance
  
    call-seq:
      distance(Geometry other) -> double
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_distance(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Distance", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Distance", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_Distance(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_double(static_cast< double >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.empty
  
    call-seq:
      empty
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_empty(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Empty", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_Empty(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.is_empty
  
    call-seq:
      is_empty -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_is_empty(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","IsEmpty", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_IsEmpty(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.is_valid
  
    call-seq:
      is_valid -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_is_valid(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","IsValid", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_IsValid(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.is_simple
  
    call-seq:
      is_simple -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_is_simple(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","IsSimple", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_IsSimple(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.is_ring
  
    call-seq:
      is_ring -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_is_ring(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","IsRing", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_IsRing(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.intersects
  
    call-seq:
      intersects(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_intersects(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Intersects", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Intersects", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Intersects(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.intersect
  
    call-seq:
      intersect(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_intersect(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Intersect", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Intersect", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Intersect(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.equals
  
    call-seq:
      equals(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_equals(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Equals", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Equals", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Equals(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.equal
  
    call-seq:
      equal(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_equal(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Equal", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Equal", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Equal(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.disjoint
  
    call-seq:
      disjoint(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_disjoint(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Disjoint", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Disjoint", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Disjoint(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.touches
  
    call-seq:
      touches(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_touches(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Touches", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Touches", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Touches(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.crosses
  
    call-seq:
      crosses(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_crosses(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Crosses", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Crosses", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Crosses(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.within
  
    call-seq:
      within(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_within(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Within", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Within", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Within(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.contains
  
    call-seq:
      contains(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_contains(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Contains", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Contains", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Contains(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.overlaps
  
    call-seq:
      overlaps(Geometry other) -> bool
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_overlaps(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    bool result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Overlaps", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Overlaps", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Overlaps(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_bool(static_cast< bool >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.transform_to
  
    call-seq:
      transform_to(SpatialReference reference) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_transform_to(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","TransformTo", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OSRSpatialReferenceShadow *","TransformTo", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_TransformTo(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.transform
  
    call-seq:
      transform(CoordinateTransformation trans) -> OGRErr
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_transform(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRCoordinateTransformationShadow *arg2 = (OSRCoordinateTransformationShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Transform", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OSRCoordinateTransformationShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OSRCoordinateTransformationShadow *","Transform", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OSRCoordinateTransformationShadow * >(argp2);
    {
      if (!arg2) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_Transform(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_spatial_reference
  
    call-seq:
      get_spatial_reference -> SpatialReference
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_spatial_reference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OSRSpatialReferenceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetSpatialReference", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OSRSpatialReferenceShadow *)OGRGeometryShadow_GetSpatialReference(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.assign_spatial_reference
  
    call-seq:
      assign_spatial_reference(SpatialReference reference)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_assign_spatial_reference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","AssignSpatialReference", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "OSRSpatialReferenceShadow *","AssignSpatialReference", 2, argv[0] )); 
    }
    arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
    {
      CPLErrorReset();
      OGRGeometryShadow_AssignSpatialReference(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.close_rings
  
    call-seq:
      close_rings
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_close_rings(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","CloseRings", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_CloseRings(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.flatten_to_2d
  
    call-seq:
      flatten_to_2d
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_flatten_to_2d(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","FlattenTo2D", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_FlattenTo2D(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.segmentize
  
    call-seq:
      segmentize(double dfMaxLength)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_segmentize(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Segmentize", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","Segmentize", 2, argv[0] ));
    } 
    arg2 = static_cast< double >(val2);
    {
      CPLErrorReset();
      OGRGeometryShadow_Segmentize(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_envelope
  
    call-seq:
      get_envelope
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_envelope(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double *arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double argout2[4] ;
    VALUE vresult = Qnil;
    
    {
      /* %typemap(in,numinputs=0) (double argout2[ANY]) */
      arg2 = argout2;
    }
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetEnvelope", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_GetEnvelope(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(argout) (double argout[ANY]) */
      VALUE outArr = rb_ary_new();
      
      for(int i=0; i<4; i++)
      {
        VALUE value = rb_float_new((arg2)[i]);
        rb_ary_push(outArr, value);
      }
      
      /* Add the output to the result */
      vresult = SWIG_Ruby_AppendOutput(vresult, outArr);	
    }
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_envelope_3d
  
    call-seq:
      get_envelope_3d
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_envelope_3d(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double *arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double argout2[6] ;
    VALUE vresult = Qnil;
    
    {
      /* %typemap(in,numinputs=0) (double argout2[ANY]) */
      arg2 = argout2;
    }
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetEnvelope3D", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_GetEnvelope3D(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(argout) (double argout[ANY]) */
      VALUE outArr = rb_ary_new();
      
      for(int i=0; i<6; i++)
      {
        VALUE value = rb_float_new((arg2)[i]);
        rb_ary_push(outArr, value);
      }
      
      /* Add the output to the result */
      vresult = SWIG_Ruby_AppendOutput(vresult, outArr);	
    }
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.centroid
  
    call-seq:
      centroid -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_centroid(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","Centroid", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Centroid(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.point_on_surface
  
    call-seq:
      point_on_surface -> Geometry
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_point_on_surface(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    OGRGeometryShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","PointOnSurface", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_PointOnSurface(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_OWN |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.wkb_size
  
    call-seq:
      wkb_size -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_wkb_size(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","WkbSize", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_WkbSize(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_coordinate_dimension
  
    call-seq:
      get_coordinate_dimension -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_coordinate_dimension(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetCoordinateDimension", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetCoordinateDimension(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.set_coordinate_dimension
  
    call-seq:
      set_coordinate_dimension(int dimension)
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_set_coordinate_dimension(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","SetCoordinateDimension", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_int(argv[0], &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","SetCoordinateDimension", 2, argv[0] ));
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRGeometryShadow_SetCoordinateDimension(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr::Geometry.get_dimension
  
    call-seq:
      get_dimension -> int
  
  An instance method.
  
  */
  SWIGINTERN VALUE
  _wrap_Geometry_get_dimension(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "OGRGeometryShadow *","GetDimension", 1, self )); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetDimension(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.get_driver_count
  
    call-seq:
      get_driver_count -> int
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_get_driver_count(int argc, VALUE *argv, VALUE self) {
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    {
      CPLErrorReset();
      result = (int)OGRGetDriverCount();
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.get_open_dscount
  
    call-seq:
      get_open_dscount -> int
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_get_open_dscount(int argc, VALUE *argv, VALUE self) {
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    {
      CPLErrorReset();
      result = (int)OGRGetOpenDSCount();
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.set_generate_db2_v72_byte_order
  
    call-seq:
      set_generate_db2_v72_byte_order(int bGenerate_DB2_V72_BYTE_ORDER) -> OGRErr
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_set_generate_db2_v72_byte_order(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    int val1 ;
    int ecode1 = 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    ecode1 = SWIG_AsVal_int(argv[0], &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","OGRSetGenerate_DB2_V72_BYTE_ORDER", 1, argv[0] ));
    } 
    arg1 = static_cast< int >(val1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRSetGenerate_DB2_V72_BYTE_ORDER(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) OGRErr */
      if (result != 0) {
        rb_raise(rb_eRuntimeError, OGRErrMessages(result));
      }
    }
    {
      /* %typemap(ret) OGRErr */
      if (vresult == Qnil) {
        vresult = INT2NUM(0);
      }
    }    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.register_all
  
    call-seq:
      register_all
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_register_all(int argc, VALUE *argv, VALUE self) {
    if ((argc < 0) || (argc > 0)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
    }
    {
      CPLErrorReset();
      OGRRegisterAll();
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    return Qnil;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.GeometryTypeToName
  
    call-seq:
      GeometryTypeToName(OGRwkbGeometryType eType) -> char const *
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_GeometryTypeToName(int argc, VALUE *argv, VALUE self) {
    OGRwkbGeometryType arg1 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    {
      /* %typemap(in) CPLErr */
      arg1 = (OGRwkbGeometryType) NUM2INT(argv[0]);
    }
    {
      CPLErrorReset();
      result = (char *)OGRGeometryTypeToName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.GetFieldTypeName
  
    call-seq:
      GetFieldTypeName(OGRFieldType type) -> char const *
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_GetFieldTypeName(int argc, VALUE *argv, VALUE self) {
    OGRFieldType arg1 ;
    char *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    {
      /* %typemap(in) CPLErr */
      arg1 = (OGRFieldType) NUM2INT(argv[0]);
    }
    {
      CPLErrorReset();
      result = (char *)OGR_GetFieldTypeName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_FromCharPtr((const char *)result);
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.get_open_ds
  
    call-seq:
      get_open_ds(int ds_number) -> DataSource
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_get_open_ds(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    int val1 ;
    int ecode1 = 0 ;
    OGRDataSourceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    ecode1 = SWIG_AsVal_int(argv[0], &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","GetOpenDS", 1, argv[0] ));
    } 
    arg1 = static_cast< int >(val1);
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)GetOpenDS(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.open
  
    call-seq:
      open(char const * utf8_path, int update=0) -> DataSource
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_open(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    int arg2 = (int) 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    const char *kwnames[] = {
      "utf8_path","update", NULL 
    };
    OGRDataSourceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","Open", 1, argv[0] ));
    }
    arg1 = reinterpret_cast< char * >(buf1);
    if (argc > 1) {
      ecode2 = SWIG_AsVal_int(argv[1], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Open", 2, argv[1] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)Open((char const *)arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_POINTER_OWN |  0 );
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return vresult;
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.open_shared
  
    call-seq:
      open_shared(char const * utf8_path, int update=0) -> DataSource
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_open_shared(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    int arg2 = (int) 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    const char *kwnames[] = {
      "utf8_path","update", NULL 
    };
    OGRDataSourceShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","OpenShared", 1, argv[0] ));
    }
    arg1 = reinterpret_cast< char * >(buf1);
    if (argc > 1) {
      ecode2 = SWIG_AsVal_int(argv[1], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","OpenShared", 2, argv[1] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OpenShared((char const *)arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_POINTER_OWN |  0 );
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return vresult;
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.get_driver_by_name
  
    call-seq:
      get_driver_by_name(char const * name) -> Driver
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_get_driver_by_name(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    OGRDriverShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","GetDriverByName", 1, argv[0] ));
    }
    arg1 = reinterpret_cast< char * >(buf1);
    {
      if (!arg1) {
        SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
      }
    }
    {
      CPLErrorReset();
      result = (OGRDriverShadow *)GetDriverByName((char const *)arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return vresult;
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.get_driver
  
    call-seq:
      get_driver(int driver_number) -> Driver
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_get_driver(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    int val1 ;
    int ecode1 = 0 ;
    OGRDriverShadow *result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    ecode1 = SWIG_AsVal_int(argv[0], &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","GetDriver", 1, argv[0] ));
    } 
    arg1 = static_cast< int >(val1);
    {
      CPLErrorReset();
      result = (OGRDriverShadow *)GetDriver(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    return vresult;
  fail:
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.general_cmd_line_processor
  
    call-seq:
      general_cmd_line_processor(char ** papszArgv, int nOptions=0) -> char **
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_general_cmd_line_processor(int argc, VALUE *argv, VALUE self) {
    char **arg1 = (char **) 0 ;
    int arg2 = (int) 0 ;
    int val2 ;
    int ecode2 = 0 ;
    char **result = 0 ;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    {
      /* %typemap(in) char **options */
      
      /* Check if is a list */
      Check_Type(argv[0], T_ARRAY);
      
      int size = RARRAY_LEN(argv[0]);
      for (int i = 0; i < size; i++) {
        VALUE item = rb_ary_entry(argv[0], i);
        char *pszItem = StringValuePtr(item);
        arg1 = CSLAddString( arg1, pszItem );
      }
    }
    if (argc > 1) {
      ecode2 = SWIG_AsVal_int(argv[1], &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","GeneralCmdLineProcessor", 2, argv[1] ));
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (char **)GeneralCmdLineProcessor(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    {
      /* %typemap(out) char **options */
      
      char **stringarray = result;
      if ( stringarray == NULL ) {
        vresult = Qnil;
      }
      else {
        int len = CSLCount( stringarray );
        vresult = rb_ary_new2( len );
        for ( int i = 0; i < len; ++i, ++stringarray ) {
          VALUE nm = rb_str_new2( *stringarray );
          rb_ary_push(vresult, nm);
        }
      }
    }
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg1 );
    }
    return vresult;
  fail:
    {
      /* %typemap(freearg) char **options */
      
      CSLDestroy( arg1 );
    }
    return Qnil;
  }
  
  
  
  /*
    Document-method: Gdal::Ogr.TermProgress_nocb
  
    call-seq:
      TermProgress_nocb(double dfProgress, char const * pszMessage=nil, void * pData=nil) -> int
  
  A module function.
  
  */
  SWIGINTERN VALUE
  _wrap_TermProgress_nocb(int argc, VALUE *argv, VALUE self) {
    double arg1 ;
    char *arg2 = (char *) NULL ;
    void *arg3 = (void *) NULL ;
    double val1 ;
    int ecode1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int res3 ;
    const char *kwnames[] = {
      "dfProgress","pszMessage","pData", NULL 
    };
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 3)) {
      rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
    }
    ecode1 = SWIG_AsVal_double(argv[0], &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","GDALTermProgress_nocb", 1, argv[0] ));
    } 
    arg1 = static_cast< double >(val1);
    if (argc > 1) {
      res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
      if (!SWIG_IsOK(res2)) {
        SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","GDALTermProgress_nocb", 2, argv[1] ));
      }
      arg2 = reinterpret_cast< char * >(buf2);
    }
    if (argc > 2) {
      res3 = SWIG_ConvertPtr(argv[2],SWIG_as_voidptrptr(&arg3), 0, 0);
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "void *","GDALTermProgress_nocb", 3, argv[2] )); 
      }
    }
    {
      CPLErrorReset();
      result = (int)GDALTermProgress_nocb(arg1,(char const *)arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
      }
      
      
      
      
      
      
      
      
      
      
      
    }
    vresult = SWIG_From_int(static_cast< int >(result));
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return vresult;
  fail:
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    return Qnil;
  }
  
  
  
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
  
  static swig_type_info _swigt__p_GDALProgressFunc = {"_p_GDALProgressFunc", "GDALProgressFunc *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_GIntBig = {"_p_GIntBig", "GIntBig *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OGRDataSourceShadow = {"_p_OGRDataSourceShadow", "OGRDataSourceShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OGRDriverShadow = {"_p_OGRDriverShadow", "OGRDriverShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OGRFeatureDefnShadow = {"_p_OGRFeatureDefnShadow", "OGRFeatureDefnShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OGRFieldDefnShadow = {"_p_OGRFieldDefnShadow", "OGRFieldDefnShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OGRGeometryShadow = {"_p_OGRGeometryShadow", "OGRGeometryShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OSRCoordinateTransformationShadow = {"_p_OSRCoordinateTransformationShadow", "OSRCoordinateTransformationShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_char = {"_p_char", "char *|retStringAndCPLFree *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_f_double_p_q_const__char_p_void__int = {"_p_f_double_p_q_const__char_p_void__int", "int (*)(double,char const *,void *)", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_int = {"_p_int", "OGRFieldType *|int *|OGRwkbGeometryType *|OGRJustification *|OGRwkbByteOrder *|OGRErr *", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_p_double = {"_p_p_double", "double **", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_p_int = {"_p_p_int", "int **", 0, 0, (void*)0, 0};
  static swig_type_info _swigt__p_p_p_char = {"_p_p_p_char", "char ***", 0, 0, (void*)0, 0};
  
  static swig_type_info *swig_type_initial[] = {
    &_swigt__p_GDALProgressFunc,
    &_swigt__p_GIntBig,
    &_swigt__p_OGRDataSourceShadow,
    &_swigt__p_OGRDriverShadow,
    &_swigt__p_OGRFeatureDefnShadow,
    &_swigt__p_OGRFeatureShadow,
    &_swigt__p_OGRFieldDefnShadow,
    &_swigt__p_OGRGeometryShadow,
    &_swigt__p_OGRLayerShadow,
    &_swigt__p_OSRCoordinateTransformationShadow,
    &_swigt__p_OSRSpatialReferenceShadow,
    &_swigt__p_char,
    &_swigt__p_double,
    &_swigt__p_f_double_p_q_const__char_p_void__int,
    &_swigt__p_int,
    &_swigt__p_p_char,
    &_swigt__p_p_double,
    &_swigt__p_p_int,
    &_swigt__p_p_p_char,
  };
  
  static swig_cast_info _swigc__p_GDALProgressFunc[] = {  {&_swigt__p_GDALProgressFunc, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_GIntBig[] = {  {&_swigt__p_GIntBig, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OGRDataSourceShadow[] = {  {&_swigt__p_OGRDataSourceShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OGRDriverShadow[] = {  {&_swigt__p_OGRDriverShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OGRFeatureDefnShadow[] = {  {&_swigt__p_OGRFeatureDefnShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OGRFeatureShadow[] = {  {&_swigt__p_OGRFeatureShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OGRFieldDefnShadow[] = {  {&_swigt__p_OGRFieldDefnShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OGRGeometryShadow[] = {  {&_swigt__p_OGRGeometryShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OSRCoordinateTransformationShadow[] = {  {&_swigt__p_OSRCoordinateTransformationShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_OSRSpatialReferenceShadow[] = {  {&_swigt__p_OSRSpatialReferenceShadow, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_f_double_p_q_const__char_p_void__int[] = {  {&_swigt__p_f_double_p_q_const__char_p_void__int, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_p_int[] = {  {&_swigt__p_p_int, 0, 0, 0},{0, 0, 0, 0}};
  static swig_cast_info _swigc__p_p_p_char[] = {  {&_swigt__p_p_p_char, 0, 0, 0},{0, 0, 0, 0}};
  
  static swig_cast_info *swig_cast_initial[] = {
    _swigc__p_GDALProgressFunc,
    _swigc__p_GIntBig,
    _swigc__p_OGRDataSourceShadow,
    _swigc__p_OGRDriverShadow,
    _swigc__p_OGRFeatureDefnShadow,
    _swigc__p_OGRFeatureShadow,
    _swigc__p_OGRFieldDefnShadow,
    _swigc__p_OGRGeometryShadow,
    _swigc__p_OGRLayerShadow,
    _swigc__p_OSRCoordinateTransformationShadow,
    _swigc__p_OSRSpatialReferenceShadow,
    _swigc__p_char,
    _swigc__p_double,
    _swigc__p_f_double_p_q_const__char_p_void__int,
    _swigc__p_int,
    _swigc__p_p_char,
    _swigc__p_p_double,
    _swigc__p_p_int,
    _swigc__p_p_p_char,
  };
  
  
  /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
  
  /* -----------------------------------------------------------------------------
   * Type initialization:
   * This problem is tough by the requirement that no dynamic
   * memory is used. Also, since swig_type_info structures store pointers to
   * swig_cast_info structures and swig_cast_info structures store pointers back
   * to swig_type_info structures, we need some lookup code at initialization.
   * The idea is that swig generates all the structures that are needed.
   * The runtime then collects these partially filled structures.
   * The SWIG_InitializeModule function takes these initial arrays out of
   * swig_module, and does all the lookup, filling in the swig_module.types
   * array with the correct data and linking the correct swig_cast_info
   * structures together.
   *
   * The generated swig_type_info structures are assigned statically to an initial
   * array. We just loop through that array, and handle each type individually.
   * First we lookup if this type has been already loaded, and if so, use the
   * loaded structure instead of the generated one. Then we have to fill in the
   * cast linked list. The cast data is initially stored in something like a
   * two-dimensional array. Each row corresponds to a type (there are the same
   * number of rows as there are in the swig_type_initial array). Each entry in
   * a column is one of the swig_cast_info structures for that type.
   * The cast_initial array is actually an array of arrays, because each row has
   * a variable number of columns. So to actually build the cast linked list,
   * we find the array of casts associated with the type, and loop through it
   * adding the casts to the list. The one last trick we need to do is making
   * sure the type pointer in the swig_cast_info struct is correct.
   *
   * First off, we lookup the cast->type name to see if it is already loaded.
   * There are three cases to handle:
   *  1) If the cast->type has already been loaded AND the type we are adding
   *     casting info to has not been loaded (it is in this module), THEN we
   *     replace the cast->type pointer with the type pointer that has already
   *     been loaded.
   *  2) If BOTH types (the one we are adding casting info to, and the
   *     cast->type) are loaded, THEN the cast info has already been loaded by
   *     the previous module so we just ignore it.
   *  3) Finally, if cast->type has not already been loaded, then we add that
   *     swig_cast_info to the linked list (because the cast->type) pointer will
   *     be correct.
   * ----------------------------------------------------------------------------- */
  
  #ifdef __cplusplus
  extern "C" {
  #if 0
  } /* c-mode */
  #endif
  #endif
  
  #if 0
  #define SWIGRUNTIME_DEBUG
  #endif
  
  
  SWIGRUNTIME void
  SWIG_InitializeModule(void *clientdata) {
    size_t i;
    swig_module_info *module_head, *iter;
    int init;
  
    /* check to see if the circular list has been setup, if not, set it up */
    if (swig_module.next==0) {
      /* Initialize the swig_module */
      swig_module.type_initial = swig_type_initial;
      swig_module.cast_initial = swig_cast_initial;
      swig_module.next = &swig_module;
      init = 1;
    } else {
      init = 0;
    }
  
    /* Try and load any already created modules */
    module_head = SWIG_GetModule(clientdata);
    if (!module_head) {
      /* This is the first module loaded for this interpreter */
      /* so set the swig module into the interpreter */
      SWIG_SetModule(clientdata, &swig_module);
    } else {
      /* the interpreter has loaded a SWIG module, but has it loaded this one? */
      iter=module_head;
      do {
        if (iter==&swig_module) {
          /* Our module is already in the list, so there's nothing more to do. */
          return;
        }
        iter=iter->next;
      } while (iter!= module_head);
  
      /* otherwise we must add our module into the list */
      swig_module.next = module_head->next;
      module_head->next = &swig_module;
    }
  
    /* When multiple interpreters are used, a module could have already been initialized in
       a different interpreter, but not yet have a pointer in this interpreter.
       In this case, we do not want to continue adding types... everything should be
       set up already */
    if (init == 0) return;
  
    /* Now work on filling in swig_module.types */
  #ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: size %d\n", swig_module.size);
  #endif
    for (i = 0; i < swig_module.size; ++i) {
      swig_type_info *type = 0;
      swig_type_info *ret;
      swig_cast_info *cast;
  
  #ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
  #endif
  
      /* if there is another module already loaded */
      if (swig_module.next != &swig_module) {
        type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
      }
      if (type) {
        /* Overwrite clientdata field */
  #ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: found type %s\n", type->name);
  #endif
        if (swig_module.type_initial[i]->clientdata) {
  	type->clientdata = swig_module.type_initial[i]->clientdata;
  #ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
  #endif
        }
      } else {
        type = swig_module.type_initial[i];
      }
  
      /* Insert casting types */
      cast = swig_module.cast_initial[i];
      while (cast->type) {
  
        /* Don't need to add information already in the list */
        ret = 0;
  #ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
  #endif
        if (swig_module.next != &swig_module) {
          ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
  #ifdef SWIGRUNTIME_DEBUG
  	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
  #endif
        }
        if (ret) {
  	if (type == swig_module.type_initial[i]) {
  #ifdef SWIGRUNTIME_DEBUG
  	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
  #endif
  	  cast->type = ret;
  	  ret = 0;
  	} else {
  	  /* Check for casting already in the list */
  	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
  #ifdef SWIGRUNTIME_DEBUG
  	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
  #endif
  	  if (!ocast) ret = 0;
  	}
        }
  
        if (!ret) {
  #ifdef SWIGRUNTIME_DEBUG
  	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
  #endif
          if (type->cast) {
            type->cast->prev = cast;
            cast->next = type->cast;
          }
          type->cast = cast;
        }
        cast++;
      }
      /* Set entry in modules->types array equal to the type */
      swig_module.types[i] = type;
    }
    swig_module.types[i] = 0;
  
  #ifdef SWIGRUNTIME_DEBUG
    printf("**** SWIG_InitializeModule: Cast List ******\n");
    for (i = 0; i < swig_module.size; ++i) {
      int j = 0;
      swig_cast_info *cast = swig_module.cast_initial[i];
      printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
      while (cast->type) {
        printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
        cast++;
        ++j;
      }
    printf("---- Total casts: %d\n",j);
    }
    printf("**** SWIG_InitializeModule: Cast List ******\n");
  #endif
  }
  
  /* This function will propagate the clientdata field of type to
  * any new swig_type_info structures that have been added into the list
  * of equivalent types.  It is like calling
  * SWIG_TypeClientData(type, clientdata) a second time.
  */
  SWIGRUNTIME void
  SWIG_PropagateClientData(void) {
    size_t i;
    swig_cast_info *equiv;
    static int init_run = 0;
  
    if (init_run) return;
    init_run = 1;
  
    for (i = 0; i < swig_module.size; i++) {
      if (swig_module.types[i]->clientdata) {
        equiv = swig_module.types[i]->cast;
        while (equiv) {
          if (!equiv->converter) {
            if (equiv->type && !equiv->type->clientdata)
              SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
          }
          equiv = equiv->next;
        }
      }
    }
  }
  
  #ifdef __cplusplus
  #if 0
  { /* c-mode */
  #endif
  }
  #endif
  
  /*
  
  */
  #ifdef __cplusplus
  extern "C"
  #endif
  SWIGEXPORT void Init_ogr(void) {
    size_t i;
    
    SWIG_InitRuntime();
    mOgr = rb_define_module("Gdal");
    mOgr = rb_define_module_under(mOgr, "Ogr");
    
    SWIG_InitializeModule(0);
    for (i = 0; i < swig_module.size; i++) {
      SWIG_define_class(swig_module.types[i]);
    }
    
    SWIG_RubyInitializeTrackings();
    rb_define_const(mOgr, "WKB25DBIT", SWIG_From_int(static_cast< int >(0x80000000)));
    rb_define_const(mOgr, "WKB25BIT", SWIG_From_int(static_cast< int >(0x80000000)));
    rb_define_const(mOgr, "WKBUNKNOWN", SWIG_From_int(static_cast< int >(0)));
    rb_define_const(mOgr, "WKBPOINT", SWIG_From_int(static_cast< int >(1)));
    rb_define_const(mOgr, "WKBLINESTRING", SWIG_From_int(static_cast< int >(2)));
    rb_define_const(mOgr, "WKBPOLYGON", SWIG_From_int(static_cast< int >(3)));
    rb_define_const(mOgr, "WKBMULTIPOINT", SWIG_From_int(static_cast< int >(4)));
    rb_define_const(mOgr, "WKBMULTILINESTRING", SWIG_From_int(static_cast< int >(5)));
    rb_define_const(mOgr, "WKBMULTIPOLYGON", SWIG_From_int(static_cast< int >(6)));
    rb_define_const(mOgr, "WKBGEOMETRYCOLLECTION", SWIG_From_int(static_cast< int >(7)));
    rb_define_const(mOgr, "WKBNONE", SWIG_From_int(static_cast< int >(100)));
    rb_define_const(mOgr, "WKBLINEARRING", SWIG_From_int(static_cast< int >(101)));
    rb_define_const(mOgr, "WKBPOINT25D", SWIG_From_int(static_cast< int >(wkbPoint+wkb25DBit)));
    rb_define_const(mOgr, "WKBLINESTRING25D", SWIG_From_int(static_cast< int >(wkbLineString+wkb25DBit)));
    rb_define_const(mOgr, "WKBPOLYGON25D", SWIG_From_int(static_cast< int >(wkbPolygon+wkb25DBit)));
    rb_define_const(mOgr, "WKBMULTIPOINT25D", SWIG_From_int(static_cast< int >(wkbMultiPoint+wkb25DBit)));
    rb_define_const(mOgr, "WKBMULTILINESTRING25D", SWIG_From_int(static_cast< int >(wkbMultiLineString+wkb25DBit)));
    rb_define_const(mOgr, "WKBMULTIPOLYGON25D", SWIG_From_int(static_cast< int >(wkbMultiPolygon+wkb25DBit)));
    rb_define_const(mOgr, "WKBGEOMETRYCOLLECTION25D", SWIG_From_int(static_cast< int >(wkbGeometryCollection+wkb25DBit)));
    rb_define_const(mOgr, "OFTINTEGER", SWIG_From_int(static_cast< int >(0)));
    rb_define_const(mOgr, "OFTINTEGERLIST", SWIG_From_int(static_cast< int >(1)));
    rb_define_const(mOgr, "OFTREAL", SWIG_From_int(static_cast< int >(2)));
    rb_define_const(mOgr, "OFTREALLIST", SWIG_From_int(static_cast< int >(3)));
    rb_define_const(mOgr, "OFTSTRING", SWIG_From_int(static_cast< int >(4)));
    rb_define_const(mOgr, "OFTSTRINGLIST", SWIG_From_int(static_cast< int >(5)));
    rb_define_const(mOgr, "OFTWIDESTRING", SWIG_From_int(static_cast< int >(6)));
    rb_define_const(mOgr, "OFTWIDESTRINGLIST", SWIG_From_int(static_cast< int >(7)));
    rb_define_const(mOgr, "OFTBINARY", SWIG_From_int(static_cast< int >(8)));
    rb_define_const(mOgr, "OFTDATE", SWIG_From_int(static_cast< int >(9)));
    rb_define_const(mOgr, "OFTTIME", SWIG_From_int(static_cast< int >(10)));
    rb_define_const(mOgr, "OFTDATETIME", SWIG_From_int(static_cast< int >(11)));
    rb_define_const(mOgr, "OJUNDEFINED", SWIG_From_int(static_cast< int >(0)));
    rb_define_const(mOgr, "OJLEFT", SWIG_From_int(static_cast< int >(1)));
    rb_define_const(mOgr, "OJRIGHT", SWIG_From_int(static_cast< int >(2)));
    rb_define_const(mOgr, "WKBXDR", SWIG_From_int(static_cast< int >(0)));
    rb_define_const(mOgr, "WKBNDR", SWIG_From_int(static_cast< int >(1)));
    rb_define_const(mOgr, "NULLFID", SWIG_From_int(static_cast< int >(-1)));
    rb_define_const(mOgr, "ALTER_NAME_FLAG", SWIG_From_int(static_cast< int >(1)));
    rb_define_const(mOgr, "ALTER_TYPE_FLAG", SWIG_From_int(static_cast< int >(2)));
    rb_define_const(mOgr, "ALTER_WIDTH_PRECISION_FLAG", SWIG_From_int(static_cast< int >(4)));
    rb_define_const(mOgr, "ALTER_ALL_FLAG", SWIG_From_int(static_cast< int >(1+2+4)));
    rb_define_const(mOgr, "OLCRANDOMREAD", SWIG_FromCharPtr("RandomRead"));
    rb_define_const(mOgr, "OLCSEQUENTIALWRITE", SWIG_FromCharPtr("SequentialWrite"));
    rb_define_const(mOgr, "OLCRANDOMWRITE", SWIG_FromCharPtr("RandomWrite"));
    rb_define_const(mOgr, "OLCFASTSPATIALFILTER", SWIG_FromCharPtr("FastSpatialFilter"));
    rb_define_const(mOgr, "OLCFASTFEATURECOUNT", SWIG_FromCharPtr("FastFeatureCount"));
    rb_define_const(mOgr, "OLCFASTGETEXTENT", SWIG_FromCharPtr("FastGetExtent"));
    rb_define_const(mOgr, "OLCCREATEFIELD", SWIG_FromCharPtr("CreateField"));
    rb_define_const(mOgr, "OLCDELETEFIELD", SWIG_FromCharPtr("DeleteField"));
    rb_define_const(mOgr, "OLCREORDERFIELDS", SWIG_FromCharPtr("ReorderFields"));
    rb_define_const(mOgr, "OLCALTERFIELDDEFN", SWIG_FromCharPtr("AlterFieldDefn"));
    rb_define_const(mOgr, "OLCTRANSACTIONS", SWIG_FromCharPtr("Transactions"));
    rb_define_const(mOgr, "OLCDELETEFEATURE", SWIG_FromCharPtr("DeleteFeature"));
    rb_define_const(mOgr, "OLCFASTSETNEXTBYINDEX", SWIG_FromCharPtr("FastSetNextByIndex"));
    rb_define_const(mOgr, "OLCSTRINGSASUTF8", SWIG_FromCharPtr("StringsAsUTF8"));
    rb_define_const(mOgr, "OLCIGNOREFIELDS", SWIG_FromCharPtr("IgnoreFields"));
    rb_define_const(mOgr, "ODSCCREATELAYER", SWIG_FromCharPtr("CreateLayer"));
    rb_define_const(mOgr, "ODSCDELETELAYER", SWIG_FromCharPtr("DeleteLayer"));
    rb_define_const(mOgr, "ODRCCREATEDATASOURCE", SWIG_FromCharPtr("CreateDataSource"));
    rb_define_const(mOgr, "ODRCDELETEDATASOURCE", SWIG_FromCharPtr("DeleteDataSource"));
    rb_define_module_function(mOgr, "use_exceptions", VALUEFUNC(_wrap_use_exceptions), -1);
    rb_define_module_function(mOgr, "dont_use_exceptions", VALUEFUNC(_wrap_dont_use_exceptions), -1);
    
    
    if ( OGRGetDriverCount() == 0 ) {
      OGRRegisterAll();
    }
    
    /* Setup exception handling */
    UseExceptions();
    
    rb_require("gdal-ruby/osr");
    
    SwigClassDriver.klass = rb_define_class_under(mOgr, "Driver", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRDriverShadow, (void *) &SwigClassDriver);
    rb_undef_alloc_func(SwigClassDriver.klass);
    rb_define_method(SwigClassDriver.klass, "name", VALUEFUNC(_wrap_Driver_name_get), -1);
    rb_define_method(SwigClassDriver.klass, "create_data_source", VALUEFUNC(_wrap_Driver_create_data_source), -1);
    rb_define_method(SwigClassDriver.klass, "copy_data_source", VALUEFUNC(_wrap_Driver_copy_data_source), -1);
    rb_define_method(SwigClassDriver.klass, "open", VALUEFUNC(_wrap_Driver_open), -1);
    rb_define_method(SwigClassDriver.klass, "delete_data_source", VALUEFUNC(_wrap_Driver_delete_data_source), -1);
    rb_define_method(SwigClassDriver.klass, "test_capability", VALUEFUNC(_wrap_Driver_test_capability), -1);
    rb_define_method(SwigClassDriver.klass, "get_name", VALUEFUNC(_wrap_Driver_get_name), -1);
    rb_define_method(SwigClassDriver.klass, "register", VALUEFUNC(_wrap_Driver_register), -1);
    rb_define_method(SwigClassDriver.klass, "deregister", VALUEFUNC(_wrap_Driver_deregister), -1);
    SwigClassDriver.mark = 0;
    SwigClassDriver.trackObjects = 0;
    
    SwigClassDataSource.klass = rb_define_class_under(mOgr, "DataSource", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRDataSourceShadow, (void *) &SwigClassDataSource);
    rb_undef_alloc_func(SwigClassDataSource.klass);
    rb_define_method(SwigClassDataSource.klass, "name", VALUEFUNC(_wrap_DataSource_name_get), -1);
    rb_define_method(SwigClassDataSource.klass, "get_ref_count", VALUEFUNC(_wrap_DataSource_get_ref_count), -1);
    rb_define_method(SwigClassDataSource.klass, "get_summary_ref_count", VALUEFUNC(_wrap_DataSource_get_summary_ref_count), -1);
    rb_define_method(SwigClassDataSource.klass, "get_layer_count", VALUEFUNC(_wrap_DataSource_get_layer_count), -1);
    rb_define_method(SwigClassDataSource.klass, "get_driver", VALUEFUNC(_wrap_DataSource_get_driver), -1);
    rb_define_method(SwigClassDataSource.klass, "get_name", VALUEFUNC(_wrap_DataSource_get_name), -1);
    rb_define_method(SwigClassDataSource.klass, "delete_layer", VALUEFUNC(_wrap_DataSource_delete_layer), -1);
    rb_define_method(SwigClassDataSource.klass, "sync_to_disk", VALUEFUNC(_wrap_DataSource_sync_to_disk), -1);
    rb_define_method(SwigClassDataSource.klass, "create_layer", VALUEFUNC(_wrap_DataSource_create_layer), -1);
    rb_define_method(SwigClassDataSource.klass, "copy_layer", VALUEFUNC(_wrap_DataSource_copy_layer), -1);
    rb_define_method(SwigClassDataSource.klass, "test_capability", VALUEFUNC(_wrap_DataSource_test_capability), -1);
    rb_define_method(SwigClassDataSource.klass, "execute_sql", VALUEFUNC(_wrap_DataSource_execute_sql), -1);
    rb_define_method(SwigClassDataSource.klass, "release_result_set", VALUEFUNC(_wrap_DataSource_release_result_set), -1);
    rb_define_method(SwigClassDataSource.klass, "get_layer", VALUEFUNC(_wrap_DataSource_get_layer), -1);
    SwigClassDataSource.mark = 0;
    SwigClassDataSource.destroy = (void (*)(void *)) free_OGRDataSourceShadow;
    SwigClassDataSource.trackObjects = 0;
    
    SwigClassLayer.klass = rb_define_class_under(mOgr, "Layer", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRLayerShadow, (void *) &SwigClassLayer);
    rb_include_module(SwigClassLayer.klass, rb_eval_string("Enumerable"));
    rb_undef_alloc_func(SwigClassLayer.klass);
    rb_define_method(SwigClassLayer.klass, "get_ref_count", VALUEFUNC(_wrap_Layer_get_ref_count), -1);
    rb_define_method(SwigClassLayer.klass, "set_spatial_filter", VALUEFUNC(_wrap_Layer_set_spatial_filter), -1);
    rb_define_method(SwigClassLayer.klass, "set_spatial_filter_rect", VALUEFUNC(_wrap_Layer_set_spatial_filter_rect), -1);
    rb_define_method(SwigClassLayer.klass, "get_spatial_filter", VALUEFUNC(_wrap_Layer_get_spatial_filter), -1);
    rb_define_method(SwigClassLayer.klass, "set_attribute_filter", VALUEFUNC(_wrap_Layer_set_attribute_filter), -1);
    rb_define_method(SwigClassLayer.klass, "reset_reading", VALUEFUNC(_wrap_Layer_reset_reading), -1);
    rb_define_method(SwigClassLayer.klass, "get_name", VALUEFUNC(_wrap_Layer_get_name), -1);
    rb_define_method(SwigClassLayer.klass, "get_geom_type", VALUEFUNC(_wrap_Layer_get_geom_type), -1);
    rb_define_method(SwigClassLayer.klass, "get_geometry_column", VALUEFUNC(_wrap_Layer_get_geometry_column), -1);
    rb_define_method(SwigClassLayer.klass, "get_fidcolumn", VALUEFUNC(_wrap_Layer_get_fidcolumn), -1);
    rb_define_method(SwigClassLayer.klass, "get_feature", VALUEFUNC(_wrap_Layer_get_feature), -1);
    rb_define_method(SwigClassLayer.klass, "get_next_feature", VALUEFUNC(_wrap_Layer_get_next_feature), -1);
    rb_define_method(SwigClassLayer.klass, "set_next_by_index", VALUEFUNC(_wrap_Layer_set_next_by_index), -1);
    rb_define_method(SwigClassLayer.klass, "set_feature", VALUEFUNC(_wrap_Layer_set_feature), -1);
    rb_define_method(SwigClassLayer.klass, "create_feature", VALUEFUNC(_wrap_Layer_create_feature), -1);
    rb_define_method(SwigClassLayer.klass, "delete_feature", VALUEFUNC(_wrap_Layer_delete_feature), -1);
    rb_define_method(SwigClassLayer.klass, "sync_to_disk", VALUEFUNC(_wrap_Layer_sync_to_disk), -1);
    rb_define_method(SwigClassLayer.klass, "get_layer_defn", VALUEFUNC(_wrap_Layer_get_layer_defn), -1);
    rb_define_method(SwigClassLayer.klass, "get_feature_count", VALUEFUNC(_wrap_Layer_get_feature_count), -1);
    rb_define_method(SwigClassLayer.klass, "get_extent", VALUEFUNC(_wrap_Layer_get_extent), -1);
    rb_define_method(SwigClassLayer.klass, "test_capability", VALUEFUNC(_wrap_Layer_test_capability), -1);
    rb_define_method(SwigClassLayer.klass, "create_field", VALUEFUNC(_wrap_Layer_create_field), -1);
    rb_define_method(SwigClassLayer.klass, "delete_field", VALUEFUNC(_wrap_Layer_delete_field), -1);
    rb_define_method(SwigClassLayer.klass, "reorder_field", VALUEFUNC(_wrap_Layer_reorder_field), -1);
    rb_define_method(SwigClassLayer.klass, "reorder_fields", VALUEFUNC(_wrap_Layer_reorder_fields), -1);
    rb_define_method(SwigClassLayer.klass, "alter_field_defn", VALUEFUNC(_wrap_Layer_alter_field_defn), -1);
    rb_define_method(SwigClassLayer.klass, "start_transaction", VALUEFUNC(_wrap_Layer_start_transaction), -1);
    rb_define_method(SwigClassLayer.klass, "commit_transaction", VALUEFUNC(_wrap_Layer_commit_transaction), -1);
    rb_define_method(SwigClassLayer.klass, "rollback_transaction", VALUEFUNC(_wrap_Layer_rollback_transaction), -1);
    rb_define_method(SwigClassLayer.klass, "get_spatial_ref", VALUEFUNC(_wrap_Layer_get_spatial_ref), -1);
    rb_define_method(SwigClassLayer.klass, "get_features_read", VALUEFUNC(_wrap_Layer_get_features_read), -1);
    rb_define_method(SwigClassLayer.klass, "set_ignored_fields", VALUEFUNC(_wrap_Layer_set_ignored_fields), -1);
    rb_define_method(SwigClassLayer.klass, "intersection", VALUEFUNC(_wrap_Layer_intersection), -1);
    rb_define_method(SwigClassLayer.klass, "union", VALUEFUNC(_wrap_Layer_union), -1);
    rb_define_method(SwigClassLayer.klass, "sym_difference", VALUEFUNC(_wrap_Layer_sym_difference), -1);
    rb_define_method(SwigClassLayer.klass, "identity", VALUEFUNC(_wrap_Layer_identity), -1);
    rb_define_method(SwigClassLayer.klass, "update", VALUEFUNC(_wrap_Layer_update), -1);
    rb_define_method(SwigClassLayer.klass, "clip", VALUEFUNC(_wrap_Layer_clip), -1);
    rb_define_method(SwigClassLayer.klass, "erase", VALUEFUNC(_wrap_Layer_erase), -1);
    rb_define_method(SwigClassLayer.klass, "each", VALUEFUNC(_wrap_Layer_each), -1);
    SwigClassLayer.mark = 0;
    SwigClassLayer.trackObjects = 0;
    
    SwigClassFeature.klass = rb_define_class_under(mOgr, "Feature", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRFeatureShadow, (void *) &SwigClassFeature);
    rb_define_alloc_func(SwigClassFeature.klass, _wrap_Feature_allocate);
    rb_define_method(SwigClassFeature.klass, "initialize", VALUEFUNC(_wrap_new_Feature), -1);
    rb_define_method(SwigClassFeature.klass, "get_defn_ref", VALUEFUNC(_wrap_Feature_get_defn_ref), -1);
    rb_define_method(SwigClassFeature.klass, "set_geometry", VALUEFUNC(_wrap_Feature_set_geometry), -1);
    rb_define_method(SwigClassFeature.klass, "set_geometry_directly", VALUEFUNC(_wrap_Feature_set_geometry_directly), -1);
    rb_define_method(SwigClassFeature.klass, "get_geometry_ref", VALUEFUNC(_wrap_Feature_get_geometry_ref), -1);
    rb_define_method(SwigClassFeature.klass, "clone", VALUEFUNC(_wrap_Feature_clone), -1);
    rb_define_method(SwigClassFeature.klass, "equal", VALUEFUNC(_wrap_Feature_equal), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_count", VALUEFUNC(_wrap_Feature_get_field_count), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_defn_ref", VALUEFUNC(_wrap_Feature_get_field_defn_ref), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_as_string", VALUEFUNC(_wrap_Feature_get_field_as_string), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_as_integer", VALUEFUNC(_wrap_Feature_get_field_as_integer), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_as_double", VALUEFUNC(_wrap_Feature_get_field_as_double), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_as_date_time", VALUEFUNC(_wrap_Feature_get_field_as_date_time), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_as_integer_list", VALUEFUNC(_wrap_Feature_get_field_as_integer_list), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_as_double_list", VALUEFUNC(_wrap_Feature_get_field_as_double_list), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_as_string_list", VALUEFUNC(_wrap_Feature_get_field_as_string_list), -1);
    rb_define_method(SwigClassFeature.klass, "is_field_set", VALUEFUNC(_wrap_Feature_is_field_set), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_index", VALUEFUNC(_wrap_Feature_get_field_index), -1);
    rb_define_method(SwigClassFeature.klass, "get_fid", VALUEFUNC(_wrap_Feature_get_fid), -1);
    rb_define_method(SwigClassFeature.klass, "set_fid", VALUEFUNC(_wrap_Feature_set_fid), -1);
    rb_define_method(SwigClassFeature.klass, "dump_readable", VALUEFUNC(_wrap_Feature_dump_readable), -1);
    rb_define_method(SwigClassFeature.klass, "unset_field", VALUEFUNC(_wrap_Feature_unset_field), -1);
    rb_define_method(SwigClassFeature.klass, "set_field", VALUEFUNC(_wrap_Feature_set_field), -1);
    rb_define_method(SwigClassFeature.klass, "set_field_integer_list", VALUEFUNC(_wrap_Feature_set_field_integer_list), -1);
    rb_define_method(SwigClassFeature.klass, "set_field_double_list", VALUEFUNC(_wrap_Feature_set_field_double_list), -1);
    rb_define_method(SwigClassFeature.klass, "set_field_string_list", VALUEFUNC(_wrap_Feature_set_field_string_list), -1);
    rb_define_method(SwigClassFeature.klass, "set_from", VALUEFUNC(_wrap_Feature_set_from), -1);
    rb_define_method(SwigClassFeature.klass, "set_from_with_map", VALUEFUNC(_wrap_Feature_set_from_with_map), -1);
    rb_define_method(SwigClassFeature.klass, "get_style_string", VALUEFUNC(_wrap_Feature_get_style_string), -1);
    rb_define_method(SwigClassFeature.klass, "set_style_string", VALUEFUNC(_wrap_Feature_set_style_string), -1);
    rb_define_method(SwigClassFeature.klass, "get_field_type", VALUEFUNC(_wrap_Feature_get_field_type), -1);
    rb_define_method(SwigClassFeature.klass, "get_field", VALUEFUNC(_wrap_Feature_get_field), -1);
    SwigClassFeature.mark = 0;
    SwigClassFeature.destroy = (void (*)(void *)) free_OGRFeatureShadow;
    SwigClassFeature.trackObjects = 0;
    
    SwigClassFeatureDefn.klass = rb_define_class_under(mOgr, "FeatureDefn", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRFeatureDefnShadow, (void *) &SwigClassFeatureDefn);
    rb_define_alloc_func(SwigClassFeatureDefn.klass, _wrap_FeatureDefn_allocate);
    rb_define_method(SwigClassFeatureDefn.klass, "initialize", VALUEFUNC(_wrap_new_FeatureDefn), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "get_name", VALUEFUNC(_wrap_FeatureDefn_get_name), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "get_field_count", VALUEFUNC(_wrap_FeatureDefn_get_field_count), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "get_field_defn", VALUEFUNC(_wrap_FeatureDefn_get_field_defn), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "get_field_index", VALUEFUNC(_wrap_FeatureDefn_get_field_index), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "add_field_defn", VALUEFUNC(_wrap_FeatureDefn_add_field_defn), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "get_geom_type", VALUEFUNC(_wrap_FeatureDefn_get_geom_type), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "set_geom_type", VALUEFUNC(_wrap_FeatureDefn_set_geom_type), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "get_reference_count", VALUEFUNC(_wrap_FeatureDefn_get_reference_count), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "is_geometry_ignored", VALUEFUNC(_wrap_FeatureDefn_is_geometry_ignored), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "set_geometry_ignored", VALUEFUNC(_wrap_FeatureDefn_set_geometry_ignored), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "is_style_ignored", VALUEFUNC(_wrap_FeatureDefn_is_style_ignored), -1);
    rb_define_method(SwigClassFeatureDefn.klass, "set_style_ignored", VALUEFUNC(_wrap_FeatureDefn_set_style_ignored), -1);
    SwigClassFeatureDefn.mark = 0;
    SwigClassFeatureDefn.destroy = (void (*)(void *)) free_OGRFeatureDefnShadow;
    SwigClassFeatureDefn.trackObjects = 0;
    
    SwigClassFieldDefn.klass = rb_define_class_under(mOgr, "FieldDefn", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRFieldDefnShadow, (void *) &SwigClassFieldDefn);
    rb_define_alloc_func(SwigClassFieldDefn.klass, _wrap_FieldDefn_allocate);
    rb_define_method(SwigClassFieldDefn.klass, "initialize", VALUEFUNC(_wrap_new_FieldDefn), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_name", VALUEFUNC(_wrap_FieldDefn_get_name), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_name_ref", VALUEFUNC(_wrap_FieldDefn_get_name_ref), -1);
    rb_define_method(SwigClassFieldDefn.klass, "set_name", VALUEFUNC(_wrap_FieldDefn_set_name), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_type", VALUEFUNC(_wrap_FieldDefn_get_type), -1);
    rb_define_method(SwigClassFieldDefn.klass, "set_type", VALUEFUNC(_wrap_FieldDefn_set_type), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_justify", VALUEFUNC(_wrap_FieldDefn_get_justify), -1);
    rb_define_method(SwigClassFieldDefn.klass, "set_justify", VALUEFUNC(_wrap_FieldDefn_set_justify), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_width", VALUEFUNC(_wrap_FieldDefn_get_width), -1);
    rb_define_method(SwigClassFieldDefn.klass, "set_width", VALUEFUNC(_wrap_FieldDefn_set_width), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_precision", VALUEFUNC(_wrap_FieldDefn_get_precision), -1);
    rb_define_method(SwigClassFieldDefn.klass, "set_precision", VALUEFUNC(_wrap_FieldDefn_set_precision), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_type_name", VALUEFUNC(_wrap_FieldDefn_get_type_name), -1);
    rb_define_method(SwigClassFieldDefn.klass, "get_field_type_name", VALUEFUNC(_wrap_FieldDefn_get_field_type_name), -1);
    rb_define_method(SwigClassFieldDefn.klass, "is_ignored", VALUEFUNC(_wrap_FieldDefn_is_ignored), -1);
    rb_define_method(SwigClassFieldDefn.klass, "set_ignored", VALUEFUNC(_wrap_FieldDefn_set_ignored), -1);
    SwigClassFieldDefn.mark = 0;
    SwigClassFieldDefn.destroy = (void (*)(void *)) free_OGRFieldDefnShadow;
    SwigClassFieldDefn.trackObjects = 0;
    rb_define_module_function(mOgr, "create_geometry_from_wkb", VALUEFUNC(_wrap_create_geometry_from_wkb), -1);
    rb_define_module_function(mOgr, "create_geometry_from_wkt", VALUEFUNC(_wrap_create_geometry_from_wkt), -1);
    rb_define_module_function(mOgr, "create_geometry_from_gml", VALUEFUNC(_wrap_create_geometry_from_gml), -1);
    rb_define_module_function(mOgr, "create_geometry_from_json", VALUEFUNC(_wrap_create_geometry_from_json), -1);
    rb_define_module_function(mOgr, "build_polygon_from_edges", VALUEFUNC(_wrap_build_polygon_from_edges), -1);
    rb_define_module_function(mOgr, "approximate_arc_angles", VALUEFUNC(_wrap_approximate_arc_angles), -1);
    rb_define_module_function(mOgr, "force_to_polygon", VALUEFUNC(_wrap_force_to_polygon), -1);
    rb_define_module_function(mOgr, "force_to_line_string", VALUEFUNC(_wrap_force_to_line_string), -1);
    rb_define_module_function(mOgr, "force_to_multi_polygon", VALUEFUNC(_wrap_force_to_multi_polygon), -1);
    rb_define_module_function(mOgr, "force_to_multi_point", VALUEFUNC(_wrap_force_to_multi_point), -1);
    rb_define_module_function(mOgr, "force_to_multi_line_string", VALUEFUNC(_wrap_force_to_multi_line_string), -1);
    
    SwigClassGeometry.klass = rb_define_class_under(mOgr, "Geometry", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRGeometryShadow, (void *) &SwigClassGeometry);
    rb_define_alloc_func(SwigClassGeometry.klass, _wrap_Geometry_allocate);
    rb_define_method(SwigClassGeometry.klass, "initialize", VALUEFUNC(_wrap_new_Geometry), -1);
    rb_define_method(SwigClassGeometry.klass, "export_to_wkt", VALUEFUNC(_wrap_Geometry_export_to_wkt), -1);
    rb_define_method(SwigClassGeometry.klass, "export_to_wkb", VALUEFUNC(_wrap_Geometry_export_to_wkb), -1);
    rb_define_method(SwigClassGeometry.klass, "export_to_gml", VALUEFUNC(_wrap_Geometry_export_to_gml), -1);
    rb_define_method(SwigClassGeometry.klass, "export_to_kml", VALUEFUNC(_wrap_Geometry_export_to_kml), -1);
    rb_define_method(SwigClassGeometry.klass, "export_to_json", VALUEFUNC(_wrap_Geometry_export_to_json), -1);
    rb_define_method(SwigClassGeometry.klass, "add_point", VALUEFUNC(_wrap_Geometry_add_point), -1);
    rb_define_method(SwigClassGeometry.klass, "add_point_2d", VALUEFUNC(_wrap_Geometry_add_point_2d), -1);
    rb_define_method(SwigClassGeometry.klass, "add_geometry_directly", VALUEFUNC(_wrap_Geometry_add_geometry_directly), -1);
    rb_define_method(SwigClassGeometry.klass, "add_geometry", VALUEFUNC(_wrap_Geometry_add_geometry), -1);
    rb_define_method(SwigClassGeometry.klass, "clone", VALUEFUNC(_wrap_Geometry_clone), -1);
    rb_define_method(SwigClassGeometry.klass, "get_geometry_type", VALUEFUNC(_wrap_Geometry_get_geometry_type), -1);
    rb_define_method(SwigClassGeometry.klass, "get_geometry_name", VALUEFUNC(_wrap_Geometry_get_geometry_name), -1);
    rb_define_method(SwigClassGeometry.klass, "length", VALUEFUNC(_wrap_Geometry_length), -1);
    rb_define_method(SwigClassGeometry.klass, "area", VALUEFUNC(_wrap_Geometry_area), -1);
    rb_define_method(SwigClassGeometry.klass, "get_area", VALUEFUNC(_wrap_Geometry_get_area), -1);
    rb_define_method(SwigClassGeometry.klass, "get_point_count", VALUEFUNC(_wrap_Geometry_get_point_count), -1);
    rb_define_method(SwigClassGeometry.klass, "get_x", VALUEFUNC(_wrap_Geometry_get_x), -1);
    rb_define_method(SwigClassGeometry.klass, "get_y", VALUEFUNC(_wrap_Geometry_get_y), -1);
    rb_define_method(SwigClassGeometry.klass, "get_z", VALUEFUNC(_wrap_Geometry_get_z), -1);
    rb_define_method(SwigClassGeometry.klass, "get_point", VALUEFUNC(_wrap_Geometry_get_point), -1);
    rb_define_method(SwigClassGeometry.klass, "get_point_2d", VALUEFUNC(_wrap_Geometry_get_point_2d), -1);
    rb_define_method(SwigClassGeometry.klass, "get_geometry_count", VALUEFUNC(_wrap_Geometry_get_geometry_count), -1);
    rb_define_method(SwigClassGeometry.klass, "set_point", VALUEFUNC(_wrap_Geometry_set_point), -1);
    rb_define_method(SwigClassGeometry.klass, "set_point_2d", VALUEFUNC(_wrap_Geometry_set_point_2d), -1);
    rb_define_method(SwigClassGeometry.klass, "get_geometry_ref", VALUEFUNC(_wrap_Geometry_get_geometry_ref), -1);
    rb_define_method(SwigClassGeometry.klass, "simplify", VALUEFUNC(_wrap_Geometry_simplify), -1);
    rb_define_method(SwigClassGeometry.klass, "simplify_preserve_topology", VALUEFUNC(_wrap_Geometry_simplify_preserve_topology), -1);
    rb_define_method(SwigClassGeometry.klass, "boundary", VALUEFUNC(_wrap_Geometry_boundary), -1);
    rb_define_method(SwigClassGeometry.klass, "get_boundary", VALUEFUNC(_wrap_Geometry_get_boundary), -1);
    rb_define_method(SwigClassGeometry.klass, "convex_hull", VALUEFUNC(_wrap_Geometry_convex_hull), -1);
    rb_define_method(SwigClassGeometry.klass, "buffer", VALUEFUNC(_wrap_Geometry_buffer), -1);
    rb_define_method(SwigClassGeometry.klass, "intersection", VALUEFUNC(_wrap_Geometry_intersection), -1);
    rb_define_method(SwigClassGeometry.klass, "union", VALUEFUNC(_wrap_Geometry_union), -1);
    rb_define_method(SwigClassGeometry.klass, "union_cascaded", VALUEFUNC(_wrap_Geometry_union_cascaded), -1);
    rb_define_method(SwigClassGeometry.klass, "difference", VALUEFUNC(_wrap_Geometry_difference), -1);
    rb_define_method(SwigClassGeometry.klass, "sym_difference", VALUEFUNC(_wrap_Geometry_sym_difference), -1);
    rb_define_method(SwigClassGeometry.klass, "symmetric_difference", VALUEFUNC(_wrap_Geometry_symmetric_difference), -1);
    rb_define_method(SwigClassGeometry.klass, "distance", VALUEFUNC(_wrap_Geometry_distance), -1);
    rb_define_method(SwigClassGeometry.klass, "empty", VALUEFUNC(_wrap_Geometry_empty), -1);
    rb_define_method(SwigClassGeometry.klass, "is_empty", VALUEFUNC(_wrap_Geometry_is_empty), -1);
    rb_define_method(SwigClassGeometry.klass, "is_valid", VALUEFUNC(_wrap_Geometry_is_valid), -1);
    rb_define_method(SwigClassGeometry.klass, "is_simple", VALUEFUNC(_wrap_Geometry_is_simple), -1);
    rb_define_method(SwigClassGeometry.klass, "is_ring", VALUEFUNC(_wrap_Geometry_is_ring), -1);
    rb_define_method(SwigClassGeometry.klass, "intersects", VALUEFUNC(_wrap_Geometry_intersects), -1);
    rb_define_method(SwigClassGeometry.klass, "intersect", VALUEFUNC(_wrap_Geometry_intersect), -1);
    rb_define_method(SwigClassGeometry.klass, "equals", VALUEFUNC(_wrap_Geometry_equals), -1);
    rb_define_method(SwigClassGeometry.klass, "equal", VALUEFUNC(_wrap_Geometry_equal), -1);
    rb_define_method(SwigClassGeometry.klass, "disjoint", VALUEFUNC(_wrap_Geometry_disjoint), -1);
    rb_define_method(SwigClassGeometry.klass, "touches", VALUEFUNC(_wrap_Geometry_touches), -1);
    rb_define_method(SwigClassGeometry.klass, "crosses", VALUEFUNC(_wrap_Geometry_crosses), -1);
    rb_define_method(SwigClassGeometry.klass, "within", VALUEFUNC(_wrap_Geometry_within), -1);
    rb_define_method(SwigClassGeometry.klass, "contains", VALUEFUNC(_wrap_Geometry_contains), -1);
    rb_define_method(SwigClassGeometry.klass, "overlaps", VALUEFUNC(_wrap_Geometry_overlaps), -1);
    rb_define_method(SwigClassGeometry.klass, "transform_to", VALUEFUNC(_wrap_Geometry_transform_to), -1);
    rb_define_method(SwigClassGeometry.klass, "transform", VALUEFUNC(_wrap_Geometry_transform), -1);
    rb_define_method(SwigClassGeometry.klass, "get_spatial_reference", VALUEFUNC(_wrap_Geometry_get_spatial_reference), -1);
    rb_define_method(SwigClassGeometry.klass, "assign_spatial_reference", VALUEFUNC(_wrap_Geometry_assign_spatial_reference), -1);
    rb_define_method(SwigClassGeometry.klass, "close_rings", VALUEFUNC(_wrap_Geometry_close_rings), -1);
    rb_define_method(SwigClassGeometry.klass, "flatten_to_2d", VALUEFUNC(_wrap_Geometry_flatten_to_2d), -1);
    rb_define_method(SwigClassGeometry.klass, "segmentize", VALUEFUNC(_wrap_Geometry_segmentize), -1);
    rb_define_method(SwigClassGeometry.klass, "get_envelope", VALUEFUNC(_wrap_Geometry_get_envelope), -1);
    rb_define_method(SwigClassGeometry.klass, "get_envelope_3d", VALUEFUNC(_wrap_Geometry_get_envelope_3d), -1);
    rb_define_method(SwigClassGeometry.klass, "centroid", VALUEFUNC(_wrap_Geometry_centroid), -1);
    rb_define_method(SwigClassGeometry.klass, "point_on_surface", VALUEFUNC(_wrap_Geometry_point_on_surface), -1);
    rb_define_method(SwigClassGeometry.klass, "wkb_size", VALUEFUNC(_wrap_Geometry_wkb_size), -1);
    rb_define_method(SwigClassGeometry.klass, "get_coordinate_dimension", VALUEFUNC(_wrap_Geometry_get_coordinate_dimension), -1);
    rb_define_method(SwigClassGeometry.klass, "set_coordinate_dimension", VALUEFUNC(_wrap_Geometry_set_coordinate_dimension), -1);
    rb_define_method(SwigClassGeometry.klass, "get_dimension", VALUEFUNC(_wrap_Geometry_get_dimension), -1);
    SwigClassGeometry.mark = 0;
    SwigClassGeometry.destroy = (void (*)(void *)) free_OGRGeometryShadow;
    SwigClassGeometry.trackObjects = 0;
    rb_define_module_function(mOgr, "get_driver_count", VALUEFUNC(_wrap_get_driver_count), -1);
    rb_define_module_function(mOgr, "get_open_dscount", VALUEFUNC(_wrap_get_open_dscount), -1);
    rb_define_module_function(mOgr, "set_generate_db2_v72_byte_order", VALUEFUNC(_wrap_set_generate_db2_v72_byte_order), -1);
    rb_define_module_function(mOgr, "register_all", VALUEFUNC(_wrap_register_all), -1);
    rb_define_module_function(mOgr, "GeometryTypeToName", VALUEFUNC(_wrap_GeometryTypeToName), -1);
    rb_define_module_function(mOgr, "GetFieldTypeName", VALUEFUNC(_wrap_GetFieldTypeName), -1);
    rb_define_module_function(mOgr, "get_open_ds", VALUEFUNC(_wrap_get_open_ds), -1);
    rb_define_module_function(mOgr, "open", VALUEFUNC(_wrap_open), -1);
    rb_define_module_function(mOgr, "open_shared", VALUEFUNC(_wrap_open_shared), -1);
    rb_define_module_function(mOgr, "get_driver_by_name", VALUEFUNC(_wrap_get_driver_by_name), -1);
    rb_define_module_function(mOgr, "get_driver", VALUEFUNC(_wrap_get_driver), -1);
    rb_define_module_function(mOgr, "general_cmd_line_processor", VALUEFUNC(_wrap_general_cmd_line_processor), -1);
    rb_define_module_function(mOgr, "TermProgress_nocb", VALUEFUNC(_wrap_TermProgress_nocb), -1);
    rb_define_const(mOgr, "TermProgress", SWIG_NewFunctionPtrObj((void *)(int (*)(double,char const *,void *))(GDALTermProgress), SWIGTYPE_p_f_double_p_q_const__char_p_void__int));
  }
  
  