/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.25
 * 
 * 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. 
 * ----------------------------------------------------------------------------- */


#ifdef __cplusplus
template<class T> class SwigValueWrapper {
    T *tt;
public:
    SwigValueWrapper() : tt(0) { }
    SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
    SwigValueWrapper(const T& t) : tt(new T(t)) { }
    ~SwigValueWrapper() { delete tt; } 
    SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
    operator T&() const { return *tt; }
    T *operator&() { return tt; }
private:
    SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
};
#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
#  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__) || defined(__ICC)
#   define SWIGUNUSED __attribute__ ((unused)) 
# else
#   define 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 for Windows DLLs */
#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   define SWIGEXPORT
# endif
#endif

/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   define SWIGSTDCALL __stdcall
# else
#   define SWIGSTDCALL
# endif 
#endif


/* ruby.swg */
/* Implementation : RUBY */
#define SWIGRUBY 1

#include "ruby.h"

/* Flags for pointer conversion */
#define SWIG_POINTER_EXCEPTION     0x1
#define SWIG_POINTER_DISOWN        0x2

#define NUM2USHRT(n) (\
    (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
    ? (unsigned short) NUM2UINT(n) \
    : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
               NUM2UINT(n)), (short)0)\
)

#define NUM2SHRT(n) (\
    (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
    ? (short)NUM2INT(n)\
    : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
               NUM2INT(n)), (short)0)\
)

/* 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

/*
 * 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

typedef struct {
  VALUE klass;
  VALUE mImpl;
  void  (*mark)(void *);
  void  (*destroy)(void *);
} swig_class;

/* 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(RB_STRING_VALUE(s))->ptr
#endif
#ifndef StringValueLen
#define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
#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

/* Contract support */

#define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else


/***********************************************************************
 * swigrun.swg
 *
 *     This file contains generic CAPI 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 "2"

/* 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 is strictly necessary, ie, if you have problems
  with your compiler or so.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store inforomation 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 */
} 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 (int)(*f1 - *f2);
  }
  return (l1 - f1) - (l2 - f2);
}

/*
  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) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  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_TypeCompare(const char *nb, const char *tb) {
  int equiv = 0;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (!equiv && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
    if (*ne) ++ne;
  }
  return equiv;
}


/* think of this as a c++ template<> or a scheme macro */
#define SWIG_TypeCheck_Template(comparison, ty)         \
  if (ty) {                                             \
    swig_cast_info *iter = ty->cast;                    \
    while (iter) {                                      \
      if (comparison) {                                 \
        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

/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
}

/* Same as previous function, except strcmp is replaced with a pointer comparison */
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
  SWIG_TypeCheck_Template(iter->type == from, into);
}

/*
  Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
}

/* 
   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->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) {
  if (!ti->clientdata) {
    swig_cast_info *cast = ti->cast;
    /* if (ti->clientdata == clientdata) return; */
    ti->clientdata = clientdata;
    
    while (cast) {
      if (!cast->converter)
	SWIG_TypeClientData(cast->type, clientdata);
      cast = cast->next;
    }
  }
}

/*
  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) {
      register size_t l = 0;
      register size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	register size_t i = (l + r) >> 1; 
	const char *iname = iter->types[i]->name;
	if (iname) {
	  register 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 {
      register 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";
  register const unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    register 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) {
  register unsigned char *u = (unsigned char *) ptr;
  register const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    register char d = *(c++);
    register unsigned char uu = 0;
    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

/* Common SWIG API */
#define SWIG_ConvertPtr(obj, pp, type, flags) \
  SWIG_Ruby_ConvertPtr(obj, pp, type, flags)
#define SWIG_NewPointerObj(p, type, flags) \
  SWIG_Ruby_NewPointerObj(p, type, flags)
#define SWIG_MustGetPtr(p, type, argnum, flags) \
  SWIG_Ruby_MustGetPtr(p, type, argnum, flags)
#define SWIG_GetModule(clientdata) \
  SWIG_Ruby_GetModule()
#define SWIG_SetModule(clientdata, pointer) \
  SWIG_Ruby_SetModule(pointer)

/* 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)
#define SWIG_NewPackedObj(ptr, sz, ty) \
  SWIG_Ruby_NewPackedObj(ptr, sz, ty)
#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \
  SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)

/* rubydef.swg */
#ifdef __cplusplus
extern "C" {
#endif

static VALUE _mSWIG = Qnil;
static VALUE _cSWIG_Pointer = Qnil;
static VALUE swig_runtime_data_type_pointer = Qnil;

/* Initialize Ruby runtime support */
static void
SWIG_Ruby_InitRuntime(void)
{
    if (_mSWIG == Qnil) {
        _mSWIG = rb_define_module("SWIG");
    }
}

/* Define Ruby class for C type */
static void
SWIG_Ruby_define_class(swig_type_info *type)
{
    VALUE klass;
    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");
    }
    klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
    free((void *) klass_name);
}

/* Create a new pointer object */
static VALUE
SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int own)
{
    char *klass_name;
    swig_class *sklass;
    VALUE klass;
    VALUE obj;
    
    if (!ptr)
	return Qnil;
    
    if (type->clientdata) {
      sklass = (swig_class *) type->clientdata;
      obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
    } 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) */
static 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 */
static SWIGINLINE char *
SWIG_Ruby_MangleStr(VALUE obj)
{
  VALUE stype = rb_iv_get(obj, "__swigtype__");
  return StringValuePtr(stype);
}

/* Convert a pointer value */
static int
SWIG_Ruby_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
{
  char *c;
  swig_cast_info *tc;

  /* Grab the pointer */
  if (NIL_P(obj)) {
    *ptr = 0;
    return 0;
  } else {
    Data_Get_Struct(obj, void, *ptr);
  }
  
  /* 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 (*ptr == 0)
            rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
          return 0;
        }
    }
    if ((c = SWIG_MangleStr(obj)) == NULL) {
      if (flags & SWIG_POINTER_EXCEPTION)
        rb_raise(rb_eTypeError, "Expected %s", ty->str);
      else
        return -1;
    }
    tc = SWIG_TypeCheck(c, ty);
    if (!tc) {
      if (flags & SWIG_POINTER_EXCEPTION)
        rb_raise(rb_eTypeError, "Expected %s", ty->str);
      else
        return -1;
    }
    *ptr = SWIG_TypeCast(tc, *ptr);
  }
  return 0;
}

/* Convert a pointer value, signal an exception on a type mismatch */
static SWIGINLINE void *
SWIG_Ruby_MustGetPtr(VALUE obj, swig_type_info *ty, int argnum, int flags)
{
  void *result;
  SWIG_ConvertPtr(obj, &result, ty, flags | SWIG_POINTER_EXCEPTION);
  return result;
}

/* Check convert */
static SWIGINLINE 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;
}

static 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 */
static void
SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty, int flags) {
  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;

type_error:

  if (flags) {
    if (ty) {
      rb_raise(rb_eTypeError, "Type error. Expected %s", ty->name);
    } else {
      rb_raise(rb_eTypeError, "Expected a pointer");
    }
  }
}

static swig_module_info *SWIG_Ruby_GetModule() {
    VALUE pointer;
    swig_module_info *ret = 0;

   /* 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);
    }
    return ret;
}

static 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);
}

#ifdef __cplusplus
}
#endif



/* -------- TYPES TABLE (BEGIN) -------- */

#define SWIGTYPE_p_GIntBig swig_types[0]
#define SWIGTYPE_p_OGRDataSourceShadow swig_types[1]
#define SWIGTYPE_p_OGRDriverShadow swig_types[2]
#define SWIGTYPE_p_OGRFeatureDefnShadow swig_types[3]
#define SWIGTYPE_p_OGRFeatureShadow swig_types[4]
#define SWIGTYPE_p_OGRFieldDefnShadow swig_types[5]
#define SWIGTYPE_p_OGRGeometryShadow swig_types[6]
#define SWIGTYPE_p_OGRLayerShadow swig_types[7]
#define SWIGTYPE_p_OSRCoordinateTransformationShadow swig_types[8]
#define SWIGTYPE_p_OSRSpatialReferenceShadow swig_types[9]
#define SWIGTYPE_p_double swig_types[10]
#define SWIGTYPE_p_int swig_types[11]
#define SWIGTYPE_p_p_char swig_types[12]
#define SWIGTYPE_p_unsigned_long swig_types[13]
static swig_type_info *swig_types[14];
static swig_module_info swig_module = {swig_types, 14, 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    "Ogr"

static VALUE mOgr;

static void SWIG_AsVal(VALUE obj, int *val)
{
    *val = (int) NUM2INT(obj);
}


#define  SWIG_MemoryError    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_UnknownError  99


SWIGINTERN void SWIG_exception_(int code, const char *msg) {
    switch (code) {
        case SWIG_MemoryError:
            rb_raise(rb_eNoMemError, msg);
            break;
        case SWIG_IOError:
            rb_raise(rb_eIOError, msg);
            break;
        case SWIG_RuntimeError:
            rb_raise(rb_eRuntimeError, msg);
            break;
        case SWIG_IndexError:
            rb_raise(rb_eIndexError, msg);
            break;
        case SWIG_TypeError:
            rb_raise(rb_eTypeError, msg);
            break;
        case SWIG_DivisionByZero:
            rb_raise(rb_eZeroDivError, msg);
            break;
        case SWIG_OverflowError:
            rb_raise(rb_eRangeError, msg);
            break;
        case SWIG_SyntaxError:
            rb_raise(rb_eSyntaxError, msg);
            break;
        case SWIG_ValueError:
            rb_raise(rb_eArgError, msg);
            break;
        case SWIG_SystemError:
            rb_raise(rb_eFatal, msg);
            break;
        case SWIG_UnknownError:
            rb_raise(rb_eRuntimeError, msg);
            break;
        default:
            break;
    }
}

#define SWIG_exception(a, b) SWIG_exception_((a), (b))


#include <stdexcept>


#include <iostream>
using namespace std;

#include "ogr_api.h"
#include "ogr_core.h"
#include "cpl_port.h"
#include "cpl_string.h"

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;

const unsigned long wkb25bit = -2147483648;

static OGRDataSourceShadow *OGRDriverShadow_CreateDataSource(OGRDriverShadow *self,char const *name,char **options=0){
    OGRDataSourceShadow *ds = (OGRDataSourceShadow*) OGR_Dr_CreateDataSource( self, name, options);
    return ds;
  }
static OGRDataSourceShadow *OGRDriverShadow_CopyDataSource(OGRDriverShadow *self,OGRDataSourceShadow *copy_ds,char const *name,char **options=0){
    OGRDataSourceShadow *ds = (OGRDataSourceShadow*) OGR_Dr_CopyDataSource(self, copy_ds, name, options);
    return ds;
  }
static OGRDataSourceShadow *OGRDriverShadow_Open(OGRDriverShadow *self,char const *name,int update=0){
    OGRDataSourceShadow* ds = (OGRDataSourceShadow*) OGR_Dr_Open(self, name, update);
    return ds;
  }
static int OGRDriverShadow_DeleteDataSource(OGRDriverShadow *self,char const *name){
    return OGR_Dr_DeleteDataSource( self, name );
  }
static int OGRDriverShadow_TestCapability(OGRDriverShadow *self,char const *cap){
    return OGR_Dr_TestCapability(self, cap);
  }
static char const *OGRDriverShadow_GetName(OGRDriverShadow *self){
    return OGR_Dr_GetName( self );
  }
static OGRDriverShadow *OGRDriverShadow_GetDriverByName(char const *name){
  	return (OGRDriverShadow*) OGRGetDriverByName( name );
	}
static OGRDriverShadow *OGRDriverShadow_GetDriver(int driver_number){
  	return (OGRDriverShadow*) OGRGetDriver(driver_number);
	}
static void OGRDataSourceShadow_Destroy(OGRDataSourceShadow *self){
    OGR_DS_Destroy(self);
  }
static void OGRDataSourceShadow_Release(OGRDataSourceShadow *self){
    OGRReleaseDataSource(self);
  }
static int OGRDataSourceShadow_Reference(OGRDataSourceShadow *self){
    return OGR_DS_Reference(self);
  }
static int OGRDataSourceShadow_Dereference(OGRDataSourceShadow *self){
    return OGR_DS_Dereference(self);
  }
static int OGRDataSourceShadow_GetRefCount(OGRDataSourceShadow *self){
    return OGR_DS_GetRefCount(self);
  }
static int OGRDataSourceShadow_GetSummaryRefCount(OGRDataSourceShadow *self){
    return OGR_DS_GetSummaryRefCount(self);
  }
static int OGRDataSourceShadow_GetLayerCount(OGRDataSourceShadow *self){
    return OGR_DS_GetLayerCount(self);
  }
static char const *OGRDataSourceShadow_GetName(OGRDataSourceShadow *self){
    return OGR_DS_GetName(self);
  }
static OGRErr OGRDataSourceShadow_DeleteLayer(OGRDataSourceShadow *self,int index){
    return OGR_DS_DeleteLayer(self, index);
  }
static OGRLayerShadow *OGRDataSourceShadow_CreateLayer(OGRDataSourceShadow *self,char const *name,OSRSpatialReferenceShadow *reference=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char **options=0){
    OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_CreateLayer( self,
                                                        name,
                                                        reference,
                                                        geom_type,
                                                        options);
    return layer;
  }
static 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;
  }
static OGRLayerShadow *OGRDataSourceShadow_GetLayerByIndex(OGRDataSourceShadow *self,int index=0){
    OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_GetLayer(self, index);
    return layer;
  }
static OGRLayerShadow *OGRDataSourceShadow_GetLayerByName(OGRDataSourceShadow *self,char const *layer_name){
    OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_GetLayerByName(self, layer_name);
    return layer;
  }
static int OGRDataSourceShadow_TestCapability(OGRDataSourceShadow *self,char const *cap){
    return OGR_DS_TestCapability(self, cap);
  }
static OGRLayerShadow *OGRDataSourceShadow_ExecuteSQL(OGRDataSourceShadow *self,char const *statement,OGRGeometryShadow *geom=NULL,char const *dialect=""){
    OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_ExecuteSQL((OGRDataSourceShadow*)self,
                                                      statement,
                                                      geom,
                                                      dialect);
    return layer;
  }
static void OGRDataSourceShadow_ReleaseResultSet(OGRDataSourceShadow *self,OGRLayerShadow *layer){
    OGR_DS_ReleaseResultSet(self, layer);
  }
static OGRDataSourceShadow *OGRDataSourceShadow_Open__SWIG_0(char const *filename,int update=0){
	    OGRDataSourceShadow* ds = (OGRDataSourceShadow*)OGROpen(filename,update, NULL);
	    return ds;
	  }
static OGRDataSourceShadow *OGRDataSourceShadow_OpenShared__SWIG_0(char const *filename,int update=0){
	    OGRDataSourceShadow* ds = (OGRDataSourceShadow*)OGROpenShared(filename,update, NULL);
	    return ds;
	}
static int OGRLayerShadow_Reference(OGRLayerShadow *self){
    return OGR_L_Reference(self);
  }
static int OGRLayerShadow_Dereference(OGRLayerShadow *self){
    return OGR_L_Dereference(self);
  }
static int OGRLayerShadow_GetRefCount(OGRLayerShadow *self){
    return OGR_L_GetRefCount(self);
  }
static void OGRLayerShadow_SetSpatialFilter(OGRLayerShadow *self,OGRGeometryShadow *filter){
    OGR_L_SetSpatialFilter (self, filter);
  }
static void OGRLayerShadow_SetSpatialFilterRect(OGRLayerShadow *self,double minx,double miny,double maxx,double maxy){
    OGR_L_SetSpatialFilterRect(self, minx, miny, maxx, maxy);                          
  }
static OGRGeometryShadow *OGRLayerShadow_GetSpatialFilter(OGRLayerShadow *self){
    return (OGRGeometryShadow *) OGR_L_GetSpatialFilter(self);
  }
static OGRErr OGRLayerShadow_SetAttributeFilter(OGRLayerShadow *self,char *filter_string){
    OGRErr err = OGR_L_SetAttributeFilter((OGRLayerShadow*)self, filter_string);
    if (err != 0) {
      throw err;
    } 
    return 0;
  }
static void OGRLayerShadow_ResetReading(OGRLayerShadow *self){
    OGR_L_ResetReading(self);
  }
static char const *OGRLayerShadow_GetName(OGRLayerShadow *self){
    return OGR_FD_GetName(OGR_L_GetLayerDefn(self));
  }
static OGRFeatureShadow *OGRLayerShadow_GetFeature(OGRLayerShadow *self,long fid){
    return (OGRFeatureShadow*) OGR_L_GetFeature(self, fid);
  }
static OGRFeatureShadow *OGRLayerShadow_GetNextFeature(OGRLayerShadow *self){
    return (OGRFeatureShadow*) OGR_L_GetNextFeature(self);
  }
static OGRErr OGRLayerShadow_SetNextByIndex(OGRLayerShadow *self,long new_index){
    OGRErr err = OGR_L_SetNextByIndex(self, new_index);
    if (err != 0) {
      throw err;
    }
    return 0;
  }
static OGRErr OGRLayerShadow_SetFeature(OGRLayerShadow *self,OGRFeatureShadow *feature){
    OGRErr err = OGR_L_SetFeature(self, feature);
    if (err != 0) {
      throw err;
    }
    return 0;
  }
static OGRErr OGRLayerShadow_CreateFeature(OGRLayerShadow *self,OGRFeatureShadow *feature){
    OGRErr err = OGR_L_CreateFeature(self, feature);
    if (err != 0) {
      throw err;
    }
    return 0;
  }
static OGRErr OGRLayerShadow_DeleteFeature(OGRLayerShadow *self,long fid){
    OGRErr err = OGR_L_DeleteFeature(self, fid);
    if (err != 0) {
      throw err;
    }
    return 0;
  }
static OGRErr OGRLayerShadow_SyncToDisk(OGRLayerShadow *self){
    OGRErr err = OGR_L_SyncToDisk(self);
    if (err != 0) {
      throw err;
    }
    return 0;
  }
static OGRFeatureDefnShadow *OGRLayerShadow_GetLayerDefn(OGRLayerShadow *self){
    return (OGRFeatureDefnShadow*) OGR_L_GetLayerDefn(self);
  }
static int OGRLayerShadow_GetFeatureCount(OGRLayerShadow *self,int force=1){
    return OGR_L_GetFeatureCount(self, force);
  }
static void OGRLayerShadow_GetExtent(OGRLayerShadow *self,double argout[4],int force=1){
    OGRErr err = OGR_L_GetExtent(self, (OGREnvelope*)argout, force);
    if (err != 0)
      throw err;
  }
static int OGRLayerShadow_TestCapability(OGRLayerShadow *self,char const *cap){
    return OGR_L_TestCapability(self, cap);
  }
static OGRErr OGRLayerShadow_CreateField(OGRLayerShadow *self,OGRFieldDefnShadow *field_def,int approx_ok=1){
    OGRErr err = OGR_L_CreateField(self, field_def, approx_ok);
    if (err != 0)
      throw err;
    return 0;
  }
static OGRErr OGRLayerShadow_StartTransaction(OGRLayerShadow *self){
    OGRErr err = OGR_L_StartTransaction(self);
    if (err != 0)
      throw err;
    return 0;
  }
static OGRErr OGRLayerShadow_CommitTransaction(OGRLayerShadow *self){
    OGRErr err = OGR_L_CommitTransaction(self);
    if (err != 0)
      throw err;
    return 0;
  }
static OGRErr OGRLayerShadow_RollbackTransaction(OGRLayerShadow *self){
    OGRErr err = OGR_L_RollbackTransaction(self);
    if (err != 0)
      throw err;
    return 0;
  }
static OSRSpatialReferenceShadow *OGRLayerShadow_GetSpatialRef(OGRLayerShadow *self){
    return (OSRSpatialReferenceShadow*) OGR_L_GetSpatialRef(self);
  }
static GIntBig OGRLayerShadow_GetFeatureRead(OGRLayerShadow *self){
    return OGR_L_GetFeaturesRead(self);
  }
static void OGRLayerShadow_each(OGRLayerShadow *self){
		OGRFeatureShadow* feature = NULL;
	 	while (feature = (OGRFeatureShadow*) OGR_L_GetNextFeature(self))
	 	{
			rb_yield(SWIG_NewPointerObj((void *) feature, SWIGTYPE_p_OGRFeatureShadow, 0));
    }
	}
static OGRFeatureShadow *new_OGRFeatureShadow(OGRFeatureDefnShadow *feature_def=0){
    return (OGRFeatureShadow*) OGR_F_Create( feature_def );
  }
static void OGRFeatureShadow_Destroy(OGRFeatureShadow *self){
    OGR_F_Destroy(self);
  }
static OGRFeatureDefnShadow *OGRFeatureShadow_GetDefnRef(OGRFeatureShadow *self){
    return (OGRFeatureDefnShadow*) OGR_F_GetDefnRef(self);
  }
static OGRErr OGRFeatureShadow_SetGeometry(OGRFeatureShadow *self,OGRGeometryShadow *geom){
    OGRErr err = OGR_F_SetGeometry(self, geom);
    if (err != 0)
      throw err;
    return 0;
  }
static OGRErr OGRFeatureShadow_SetGeometryDirectly(OGRFeatureShadow *self,OGRGeometryShadow *geom){
    OGRErr err = OGR_F_SetGeometryDirectly(self, geom);
    if (err != 0)
      throw err;
    return 0;
  }
static OGRGeometryShadow *OGRFeatureShadow_GetGeometryRef(OGRFeatureShadow *self){
    return (OGRGeometryShadow*) OGR_F_GetGeometryRef(self);
  }
static OGRFeatureShadow *OGRFeatureShadow_Clone(OGRFeatureShadow *self){
    return (OGRFeatureShadow*) OGR_F_Clone(self);
  }
static int OGRFeatureShadow_Equal(OGRFeatureShadow *self,OGRFeatureShadow *feature){
    return OGR_F_Equal(self, feature);
  }
static int OGRFeatureShadow_GetFieldCount(OGRFeatureShadow *self){
    return OGR_F_GetFieldCount(self);
  }
static OGRFieldDefnShadow *OGRFeatureShadow_GetFieldDefnRef__SWIG_0(OGRFeatureShadow *self,int id){
    return (OGRFieldDefnShadow *) OGR_F_GetFieldDefnRef(self, id);
  }
static OGRFieldDefnShadow *OGRFeatureShadow_GetFieldDefnRef__SWIG_1(OGRFeatureShadow *self,char const *name){
    return (OGRFieldDefnShadow *) OGR_F_GetFieldDefnRef(self, OGR_F_GetFieldIndex(self, name));
  }
static char const *OGRFeatureShadow_GetFieldAsString__SWIG_0(OGRFeatureShadow *self,int id){
    return (const char *) OGR_F_GetFieldAsString(self, id);
  }
static char const *OGRFeatureShadow_GetFieldAsString__SWIG_1(OGRFeatureShadow *self,char const *name){
    return (const char *) OGR_F_GetFieldAsString(self, OGR_F_GetFieldIndex(self, name));
  }
static int OGRFeatureShadow_GetFieldAsInteger__SWIG_0(OGRFeatureShadow *self,int id){
    return OGR_F_GetFieldAsInteger(self, id);
  }
static int OGRFeatureShadow_GetFieldAsInteger__SWIG_1(OGRFeatureShadow *self,char const *name){
    return OGR_F_GetFieldAsInteger(self, OGR_F_GetFieldIndex(self, name));
  }
static double OGRFeatureShadow_GetFieldAsDouble__SWIG_0(OGRFeatureShadow *self,int id){
    return OGR_F_GetFieldAsDouble(self, id);
  }
static double OGRFeatureShadow_GetFieldAsDouble__SWIG_1(OGRFeatureShadow *self,char const *name){
    return OGR_F_GetFieldAsDouble(self, OGR_F_GetFieldIndex(self, name));
  }
static int OGRFeatureShadow_IsFieldSet__SWIG_0(OGRFeatureShadow *self,int id){
    return OGR_F_IsFieldSet(self, id);
  }
static int OGRFeatureShadow_IsFieldSet__SWIG_1(OGRFeatureShadow *self,char const *name){
    return OGR_F_IsFieldSet(self, OGR_F_GetFieldIndex(self, name));
  }
static int OGRFeatureShadow_GetFieldIndex(OGRFeatureShadow *self,char const *name){
    return OGR_F_GetFieldIndex(self, name);
  }
static int OGRFeatureShadow_GetFID(OGRFeatureShadow *self){
    return OGR_F_GetFID(self);
  }
static OGRErr OGRFeatureShadow_SetFID(OGRFeatureShadow *self,int fid){
    OGRErr err = OGR_F_SetFID(self, fid);
    if (err != 0)
      throw err;
    return 0;
  }
static void OGRFeatureShadow_DumpReadable(OGRFeatureShadow *self){
    OGR_F_DumpReadable(self, NULL);
  }
static void OGRFeatureShadow_UnsetField__SWIG_0(OGRFeatureShadow *self,int id){
    OGR_F_UnsetField(self, id);
  }
static void OGRFeatureShadow_UnsetField__SWIG_1(OGRFeatureShadow *self,char const *name){
    OGR_F_UnsetField(self, OGR_F_GetFieldIndex(self, name));
  }
static void OGRFeatureShadow_SetField__SWIG_0(OGRFeatureShadow *self,int id,char const *value){
    OGR_F_SetFieldString(self, id, value);
  }
static void OGRFeatureShadow_SetField__SWIG_1(OGRFeatureShadow *self,char const *name,char const *value){
    OGR_F_SetFieldString(self, OGR_F_GetFieldIndex(self, name), value);
  }
static OGRErr OGRFeatureShadow_SetFrom(OGRFeatureShadow *self,OGRFeatureShadow *other,int forgiving=1){
    OGRErr err = OGR_F_SetFrom(self, other, forgiving);
    if (err != 0)
      throw err;
    return 0;
  }
static char const *OGRFeatureShadow_GetStyleString(OGRFeatureShadow *self){
    return (const char*) OGR_F_GetStyleString(self);
  }
static void OGRFeatureShadow_SetStyleString(OGRFeatureShadow *self,char const *the_string){
    OGR_F_SetStyleString(self, the_string);
  }
static OGRFieldType OGRFeatureShadow_GetFieldType__SWIG_0(OGRFeatureShadow *self,int id){
    return (OGRFieldType) OGR_Fld_GetType( OGR_F_GetFieldDefnRef( self, id));
  }
static OGRFieldType OGRFeatureShadow_GetFieldType__SWIG_1(OGRFeatureShadow *self,char const *name,char const *value){
    return (OGRFieldType) OGR_Fld_GetType( 
                            OGR_F_GetFieldDefnRef( self,  
                                                   OGR_F_GetFieldIndex(self, 
                                                                       name)
                                                  )
                                          );
    
  }
static 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;		
	}
static OGRFeatureDefnShadow *new_OGRFeatureDefnShadow(char const *name=NULL){
    return (OGRFeatureDefnShadow* )OGR_FD_Create(name);
  }
static void OGRFeatureDefnShadow_Destroy(OGRFeatureDefnShadow *self){
    OGR_FD_Destroy(self);
  }
static char const *OGRFeatureDefnShadow_GetName(OGRFeatureDefnShadow *self){
    return OGR_FD_GetName(self);
  }
static int OGRFeatureDefnShadow_GetFieldCount(OGRFeatureDefnShadow *self){
    return OGR_FD_GetFieldCount(self);
  }
static OGRFieldDefnShadow *OGRFeatureDefnShadow_GetFieldDefn(OGRFeatureDefnShadow *self,int i){
    return (OGRFieldDefnShadow*) OGR_FD_GetFieldDefn(self, i);
  }
static int OGRFeatureDefnShadow_GetFieldIndex(OGRFeatureDefnShadow *self,char const *name){
    return OGR_FD_GetFieldIndex(self, name);
  }
static void OGRFeatureDefnShadow_AddFieldDefn(OGRFeatureDefnShadow *self,OGRFieldDefnShadow *defn){
    OGR_FD_AddFieldDefn(self, defn);
  }
static OGRwkbGeometryType OGRFeatureDefnShadow_GetGeomType(OGRFeatureDefnShadow *self){
    return (OGRwkbGeometryType) OGR_FD_GetGeomType(self);
  }
static void OGRFeatureDefnShadow_SetGeomType(OGRFeatureDefnShadow *self,OGRwkbGeometryType geom_type){
    OGR_FD_SetGeomType(self, geom_type);
  }
static int OGRFeatureDefnShadow_Reference(OGRFeatureDefnShadow *self){
    return OGR_FD_Reference(self);
  }
static int OGRFeatureDefnShadow_Dereference(OGRFeatureDefnShadow *self){
    return OGR_FD_Dereference(self);
  }
static int OGRFeatureDefnShadow_GetReferenceCount(OGRFeatureDefnShadow *self){
    return OGR_FD_GetReferenceCount(self);
  }
static OGRFieldDefnShadow *new_OGRFieldDefnShadow(char const *name="unnamed",OGRFieldType field_type=OFTString){
    return (OGRFieldDefnShadow*) OGR_Fld_Create(name, field_type);
  }
static void OGRFieldDefnShadow_Destroy(OGRFieldDefnShadow *self){
    OGR_Fld_Destroy(self);
  }
static char const *OGRFieldDefnShadow_GetName(OGRFieldDefnShadow *self){
    return (const char *) OGR_Fld_GetNameRef(self);
  }
static char const *OGRFieldDefnShadow_GetNameRef(OGRFieldDefnShadow *self){
    return (const char *) OGR_Fld_GetNameRef(self);
  }
static void OGRFieldDefnShadow_SetName(OGRFieldDefnShadow *self,char const *name){
    OGR_Fld_SetName(self, name);
  }
static OGRFieldType OGRFieldDefnShadow_GetType(OGRFieldDefnShadow *self){
    return OGR_Fld_GetType(self);
  }
static void OGRFieldDefnShadow_SetType(OGRFieldDefnShadow *self,OGRFieldType type){
    OGR_Fld_SetType(self, type);
  }
static OGRJustification OGRFieldDefnShadow_GetJustify(OGRFieldDefnShadow *self){
    return OGR_Fld_GetJustify(self);
  }
static void OGRFieldDefnShadow_SetJustify(OGRFieldDefnShadow *self,OGRJustification justify){
    OGR_Fld_SetJustify(self, justify);
  }
static int OGRFieldDefnShadow_GetWidth(OGRFieldDefnShadow *self){
    return OGR_Fld_GetWidth(self);
  }
static void OGRFieldDefnShadow_SetWidth(OGRFieldDefnShadow *self,int width){
    OGR_Fld_SetWidth(self, width);
  }
static int OGRFieldDefnShadow_GetPrecision(OGRFieldDefnShadow *self){
    return OGR_Fld_GetPrecision(self);
  }
static void OGRFieldDefnShadow_SetPrecision(OGRFieldDefnShadow *self,int precision){
    OGR_Fld_SetPrecision(self, precision);
  }

  OGRGeometryShadow* CreateGeometryFromWkb( int len, char *bin_string, 
                                            OSRSpatialReferenceShadow *reference=NULL ) {
    void *geom;
    OGRErr err = OGR_G_CreateFromWkb( (unsigned char *) bin_string,
                                      reference,
                                      &geom,
                                      len );
    if (err != 0 )
       throw err;
    return (OGRGeometryShadow*) geom;
  }
 


  OGRGeometryShadow* CreateGeometryFromWkt( char **val, 
                                      OSRSpatialReferenceShadow *reference=NULL ) {
    void *geom;
    OGRErr err = OGR_G_CreateFromWkt(val,
                                      reference,
                                      &geom);
    if (err != 0 )
       throw err;
    return (OGRGeometryShadow*) geom;
  }
 


  OGRGeometryShadow *CreateGeometryFromGML( const char * input_string ) {
    OGRGeometryShadow* geom = (OGRGeometryShadow*)OGR_G_CreateFromGML(input_string);
    return geom;
  }
 

static 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 return 0;
  }
static char const *OGRGeometryShadow_ExportToWkt(OGRGeometryShadow *self){
    char * output;
    OGRErr err = OGR_G_ExportToWkt(self, &output);
    if (err != 0) 
      throw err;
    return output;
  }
static 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 );
  }
static char const *OGRGeometryShadow_ExportToGML(OGRGeometryShadow *self){
    return (const char *) OGR_G_ExportToGML(self);
  }
static void OGRGeometryShadow_AddPoint(OGRGeometryShadow *self,double x,double y,double z=0){
    OGR_G_AddPoint( self, x, y, z );
  }
static OGRErr OGRGeometryShadow_AddGeometryDirectly(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_AddGeometryDirectly( self, other );
  }
static OGRErr OGRGeometryShadow_AddGeometry(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_AddGeometry( self, other );
  }
static OGRGeometryShadow *OGRGeometryShadow_Clone(OGRGeometryShadow *self){
    return (OGRGeometryShadow*) OGR_G_Clone(self);
  }
static void OGRGeometryShadow_Destroy(OGRGeometryShadow *self){
    OGR_G_DestroyGeometry( self );
  }
static OGRwkbGeometryType OGRGeometryShadow_GetGeometryType(OGRGeometryShadow *self){
    return (OGRwkbGeometryType) OGR_G_GetGeometryType(self);
  }
static char const *OGRGeometryShadow_GetGeometryName(OGRGeometryShadow *self){
    return (const char *) OGR_G_GetGeometryName(self);
  }
static double OGRGeometryShadow_GetArea(OGRGeometryShadow *self){
    return OGR_G_GetArea(self);
  }
static int OGRGeometryShadow_GetPointCount(OGRGeometryShadow *self){
    return OGR_G_GetPointCount(self);
  }
static double OGRGeometryShadow_GetX(OGRGeometryShadow *self,int point=0){
    return OGR_G_GetX(self, point);
  }
static double OGRGeometryShadow_GetY(OGRGeometryShadow *self,int point=0){
    return OGR_G_GetY(self, point);
  }
static double OGRGeometryShadow_GetZ(OGRGeometryShadow *self,int point=0){
    return OGR_G_GetZ(self, point);
  }
static int OGRGeometryShadow_GetGeometryCount(OGRGeometryShadow *self){
    return OGR_G_GetGeometryCount(self);
  }
static void OGRGeometryShadow_SetPoint(OGRGeometryShadow *self,int point,double x,double y,double z=0){
    OGR_G_SetPoint(self, point, x, y, z);
  }
static OGRGeometryShadow *OGRGeometryShadow_GetGeometryRef(OGRGeometryShadow *self,int geom){
    return (OGRGeometryShadow*) OGR_G_GetGeometryRef(self, geom);
  }
static OGRGeometryShadow *OGRGeometryShadow_GetBoundary(OGRGeometryShadow *self){
    return (OGRGeometryShadow*) OGR_G_GetBoundary(self);
  }
static OGRGeometryShadow *OGRGeometryShadow_ConvexHull(OGRGeometryShadow *self){
    return (OGRGeometryShadow*) OGR_G_ConvexHull(self);
  }
static OGRGeometryShadow *OGRGeometryShadow_Buffer(OGRGeometryShadow *self,double distance,int quadsecs=30){
    return (OGRGeometryShadow*) OGR_G_Buffer( self, distance, quadsecs );
  }
static OGRGeometryShadow *OGRGeometryShadow_Intersection(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_Intersection( self, other );
  }
static OGRGeometryShadow *OGRGeometryShadow_Union(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_Union( self, other );
  }
static OGRGeometryShadow *OGRGeometryShadow_Difference(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_Difference( self, other );
  }
static OGRGeometryShadow *OGRGeometryShadow_SymmetricDifference(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_SymmetricDifference( self, other );
  }
static double OGRGeometryShadow_Distance(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Distance(self, other);
  }
static void OGRGeometryShadow_Empty(OGRGeometryShadow *self){
    OGR_G_Empty(self);
  }
static int OGRGeometryShadow_Intersect(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Intersect(self, other);
  }
static int OGRGeometryShadow_Equal(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Equal(self, other);
  }
static int OGRGeometryShadow_Disjoint(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Disjoint(self, other);
  }
static int OGRGeometryShadow_Touches(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Touches(self, other);
  }
static int OGRGeometryShadow_Crosses(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Crosses(self, other);
  }
static int OGRGeometryShadow_Within(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Within(self, other);
  }
static int OGRGeometryShadow_Contains(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Contains(self, other);
  }
static int OGRGeometryShadow_Overlaps(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Overlaps(self, other);
  }
static OGRErr OGRGeometryShadow_TransformTo(OGRGeometryShadow *self,OSRSpatialReferenceShadow *reference){
    return OGR_G_TransformTo(self, reference);
  }
static OGRErr OGRGeometryShadow_Transform(OGRGeometryShadow *self,OSRCoordinateTransformationShadow *trans){
    return OGR_G_Transform(self, trans);
  }
static OSRSpatialReferenceShadow *OGRGeometryShadow_GetSpatialReference(OGRGeometryShadow *self){
    return (OSRSpatialReferenceShadow*)OGR_G_GetSpatialReference(self);
  }
static void OGRGeometryShadow_AssignSpatialReference(OGRGeometryShadow *self,OSRSpatialReferenceShadow *reference){
    OGR_G_AssignSpatialReference(self, reference);
  }
static void OGRGeometryShadow_CloseRings(OGRGeometryShadow *self){
    OGR_G_CloseRings(self);
  }
static void OGRGeometryShadow_FlattenTo2D(OGRGeometryShadow *self){
    OGR_G_FlattenTo2D(self);
  }
static void OGRGeometryShadow_GetEnvelope(OGRGeometryShadow *self,double argout[4]){
    OGR_G_GetEnvelope(self, (OGREnvelope*)argout);
  }
static OGRGeometryShadow *OGRGeometryShadow_Centroid(OGRGeometryShadow *self){
    OGRGeometryShadow *pt = new_OGRGeometryShadow( wkbPoint );
    OGRErr rcode = OGR_G_Centroid( self, pt );
    return pt;
  }
static int OGRGeometryShadow_WkbSize(OGRGeometryShadow *self){
    return OGR_G_WkbSize(self);
  }
static int OGRGeometryShadow_GetCoordinateDimension(OGRGeometryShadow *self){
    return OGR_G_GetCoordinateDimension(self);
  }
static 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;
  }

swig_class cDriver;

static VALUE
_wrap_Driver_name_get(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDriverShadow, 1);
    result = (char *)OGRDriverShadow_name_get(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Driver_CreateDataSource(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char **arg3 = (char **) 0 ;
    OGRDataSourceShadow *result;
    char *kwnames[] = {
        "self","name","options", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDriverShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    if (argc > 1) {
        {
            /* %typemap(ruby,in) char **options */
            
            /* Check if is a list */
            Check_Type(argv[1], T_ARRAY);
            
            int size = RARRAY(argv[1])->len;
            for (int i = 0; i < size; i++) {
                VALUE item = rb_ary_entry(argv[1], i);
                char *pszItem = StringValuePtr(item);
                arg3 = CSLAddString( arg3, pszItem );
            }
        }
    }
    result = (OGRDataSourceShadow *)OGRDriverShadow_CreateDataSource(arg1,(char const *)arg2,arg3);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    {
        /* %typemap(ruby,freearg) char **options */
        
        CSLDestroy( arg3 );
    }
    return vresult;
}


static VALUE
_wrap_Driver_CopyDataSource(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    OGRDataSourceShadow *arg2 = (OGRDataSourceShadow *) 0 ;
    char *arg3 = (char *) 0 ;
    char **arg4 = (char **) 0 ;
    OGRDataSourceShadow *result;
    char *kwnames[] = {
        "self","copy_ds","name","options", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 3))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDriverShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRDataSourceShadow, 1);
    arg3 = StringValuePtr(argv[1]);
    if (argc > 2) {
        {
            /* %typemap(ruby,in) char **options */
            
            /* Check if is a list */
            Check_Type(argv[2], T_ARRAY);
            
            int size = RARRAY(argv[2])->len;
            for (int i = 0; i < size; i++) {
                VALUE item = rb_ary_entry(argv[2], i);
                char *pszItem = StringValuePtr(item);
                arg4 = CSLAddString( arg4, pszItem );
            }
        }
    }
    result = (OGRDataSourceShadow *)OGRDriverShadow_CopyDataSource(arg1,arg2,(char const *)arg3,arg4);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    {
        /* %typemap(ruby,freearg) char **options */
        
        CSLDestroy( arg4 );
    }
    return vresult;
}


static VALUE
_wrap_Driver_Open(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int arg3 = (int) 0 ;
    OGRDataSourceShadow *result;
    char *kwnames[] = {
        "self","name","update", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDriverShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    if (argc > 1) {
        arg3 = NUM2INT(argv[1]);
    }
    result = (OGRDataSourceShadow *)OGRDriverShadow_Open(arg1,(char const *)arg2,arg3);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    return vresult;
}


static VALUE
_wrap_Driver_DeleteDataSource(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDriverShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRDriverShadow_DeleteDataSource(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Driver_TestCapability(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDriverShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRDriverShadow_TestCapability(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Driver_GetName(int argc, VALUE *argv, VALUE self) {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDriverShadow, 1);
    result = (char *)OGRDriverShadow_GetName(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Driver_GetDriverByName(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    OGRDriverShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    arg1 = StringValuePtr(argv[0]);
    result = (OGRDriverShadow *)OGRDriverShadow_GetDriverByName((char const *)arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDriverShadow,0);
    return vresult;
}


static VALUE
_wrap_Driver_GetDriver(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    OGRDriverShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    arg1 = NUM2INT(argv[0]);
    result = (OGRDriverShadow *)OGRDriverShadow_GetDriver(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDriverShadow,0);
    return vresult;
}


swig_class cDataSource;

static VALUE
_wrap_DataSource_name_get(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    result = (char *)OGRDataSourceShadow_name_get(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_DataSource_Destroy(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    OGRDataSourceShadow_Destroy(arg1);
    
    return Qnil;
}


static VALUE
_wrap_DataSource_Release(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    OGRDataSourceShadow_Release(arg1);
    
    return Qnil;
}


static VALUE
_wrap_DataSource_Reference(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    result = (int)OGRDataSourceShadow_Reference(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_DataSource_Dereference(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    result = (int)OGRDataSourceShadow_Dereference(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_DataSource_GetRefCount(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    result = (int)OGRDataSourceShadow_GetRefCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_DataSource_GetSummaryRefCount(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    result = (int)OGRDataSourceShadow_GetSummaryRefCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_DataSource_GetLayerCount(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    result = (int)OGRDataSourceShadow_GetLayerCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_DataSource_GetName(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    result = (char *)OGRDataSourceShadow_GetName(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_DataSource_DeleteLayer(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int arg2 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (OGRErr)OGRDataSourceShadow_DeleteLayer(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_DataSource_CreateLayer(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 ;
    OGRLayerShadow *result;
    char *kwnames[] = {
        "self","name","reference","geom_type","options", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 4))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    if (argc > 1) {
        SWIG_ConvertPtr(argv[1], (void **) &arg3, SWIGTYPE_p_OSRSpatialReferenceShadow, 1);
    }
    if (argc > 2) {
        {
            /* %typemap(ruby,in) CPLErr */
            arg4 = (OGRwkbGeometryType) NUM2INT(argv[2]);
        }
    }
    if (argc > 3) {
        {
            /* %typemap(ruby,in) char **options */
            
            /* Check if is a list */
            Check_Type(argv[3], T_ARRAY);
            
            int size = RARRAY(argv[3])->len;
            for (int i = 0; i < size; i++) {
                VALUE item = rb_ary_entry(argv[3], i);
                char *pszItem = StringValuePtr(item);
                arg5 = CSLAddString( arg5, pszItem );
            }
        }
    }
    result = (OGRLayerShadow *)OGRDataSourceShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRLayerShadow,0);
    {
        /* %typemap(ruby,freearg) char **options */
        
        CSLDestroy( arg5 );
    }
    return vresult;
}


static VALUE
_wrap_DataSource_CopyLayer(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    char *arg3 = (char *) 0 ;
    char **arg4 = (char **) 0 ;
    OGRLayerShadow *result;
    char *kwnames[] = {
        "self","src_layer","new_name","options", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 3))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRLayerShadow, 1);
    arg3 = StringValuePtr(argv[1]);
    if (argc > 2) {
        {
            /* %typemap(ruby,in) char **options */
            
            /* Check if is a list */
            Check_Type(argv[2], T_ARRAY);
            
            int size = RARRAY(argv[2])->len;
            for (int i = 0; i < size; i++) {
                VALUE item = rb_ary_entry(argv[2], i);
                char *pszItem = StringValuePtr(item);
                arg4 = CSLAddString( arg4, pszItem );
            }
        }
    }
    result = (OGRLayerShadow *)OGRDataSourceShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRLayerShadow,0);
    {
        /* %typemap(ruby,freearg) char **options */
        
        CSLDestroy( arg4 );
    }
    return vresult;
}


static VALUE
_wrap_DataSource_GetLayerByIndex(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int arg2 = (int) 0 ;
    OGRLayerShadow *result;
    char *kwnames[] = {
        "self","index", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    if (argc > 0) {
        arg2 = NUM2INT(argv[0]);
    }
    result = (OGRLayerShadow *)OGRDataSourceShadow_GetLayerByIndex(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRLayerShadow,0);
    return vresult;
}


static VALUE
_wrap_DataSource_GetLayerByName(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRLayerShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (OGRLayerShadow *)OGRDataSourceShadow_GetLayerByName(arg1,(char const *)arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRLayerShadow,0);
    return vresult;
}


static VALUE
_wrap_DataSource_TestCapability(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRDataSourceShadow_TestCapability(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_DataSource_ExecuteSQL(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRGeometryShadow *arg3 = (OGRGeometryShadow *) NULL ;
    char *arg4 = (char *) "" ;
    OGRLayerShadow *result;
    char *kwnames[] = {
        "self","statement","geom","dialect", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 3))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    if (argc > 1) {
        SWIG_ConvertPtr(argv[1], (void **) &arg3, SWIGTYPE_p_OGRGeometryShadow, 1);
    }
    if (argc > 2) {
        arg4 = StringValuePtr(argv[2]);
    }
    result = (OGRLayerShadow *)OGRDataSourceShadow_ExecuteSQL(arg1,(char const *)arg2,arg3,(char const *)arg4);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRLayerShadow,1);
    return vresult;
}


static VALUE
_wrap_DataSource_ReleaseResultSet(int argc, VALUE *argv, VALUE self) {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRDataSourceShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRLayerShadow, 1);
    OGRDataSourceShadow_ReleaseResultSet(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_DataSource_Open__SWIG_0(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    int arg2 ;
    OGRDataSourceShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    arg1 = StringValuePtr(argv[0]);
    arg2 = NUM2INT(argv[1]);
    result = (OGRDataSourceShadow *)OGRDataSourceShadow_Open__SWIG_0((char const *)arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    return vresult;
}


static VALUE
_wrap_DataSource_Open__SWIG_1(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    OGRDataSourceShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    arg1 = StringValuePtr(argv[0]);
    result = (OGRDataSourceShadow *)OGRDataSourceShadow_Open__SWIG_0((char const *)arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    return vresult;
}


static VALUE _wrap_DataSource_Open(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[2];
    int ii;
    
    argc = nargs;
    for (ii = 0; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii];
    }
    if (argc == 1) {
        int _v;
        {
            _v = (TYPE(argv[0]) == T_STRING) ? 1 : 0;
        }
        if (_v) {
            return _wrap_DataSource_Open__SWIG_1(nargs, args, self);
        }
    }
    if (argc == 2) {
        int _v;
        {
            _v = (TYPE(argv[0]) == T_STRING) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_DataSource_Open__SWIG_0(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'DataSource_Open'");
    return Qnil;
}


static VALUE
_wrap_DataSource_OpenShared__SWIG_0(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    int arg2 ;
    OGRDataSourceShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    arg1 = StringValuePtr(argv[0]);
    arg2 = NUM2INT(argv[1]);
    result = (OGRDataSourceShadow *)OGRDataSourceShadow_OpenShared__SWIG_0((char const *)arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    return vresult;
}


static VALUE
_wrap_DataSource_OpenShared__SWIG_1(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    OGRDataSourceShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    arg1 = StringValuePtr(argv[0]);
    result = (OGRDataSourceShadow *)OGRDataSourceShadow_OpenShared__SWIG_0((char const *)arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    return vresult;
}


static VALUE _wrap_DataSource_OpenShared(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[2];
    int ii;
    
    argc = nargs;
    for (ii = 0; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii];
    }
    if (argc == 1) {
        int _v;
        {
            _v = (TYPE(argv[0]) == T_STRING) ? 1 : 0;
        }
        if (_v) {
            return _wrap_DataSource_OpenShared__SWIG_1(nargs, args, self);
        }
    }
    if (argc == 2) {
        int _v;
        {
            _v = (TYPE(argv[0]) == T_STRING) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_DataSource_OpenShared__SWIG_0(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'DataSource_OpenShared'");
    return Qnil;
}


swig_class cLayer;

static VALUE
_wrap_Layer_Reference(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (int)OGRLayerShadow_Reference(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_Dereference(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (int)OGRLayerShadow_Dereference(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_GetRefCount(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (int)OGRLayerShadow_GetRefCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_SetSpatialFilter(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    OGRLayerShadow_SetSpatialFilter(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_Layer_SetSpatialFilterRect(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    double arg2 ;
    double arg3 ;
    double arg4 ;
    double arg5 ;
    
    if ((argc < 4) || (argc > 4))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    arg2 = (double) NUM2DBL(argv[0]);
    arg3 = (double) NUM2DBL(argv[1]);
    arg4 = (double) NUM2DBL(argv[2]);
    arg5 = (double) NUM2DBL(argv[3]);
    OGRLayerShadow_SetSpatialFilterRect(arg1,arg2,arg3,arg4,arg5);
    
    return Qnil;
}


static VALUE
_wrap_Layer_GetSpatialFilter(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OGRGeometryShadow *)OGRLayerShadow_GetSpatialFilter(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Layer_SetAttributeFilter(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (OGRErr)OGRLayerShadow_SetAttributeFilter(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_ResetReading(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    OGRLayerShadow_ResetReading(arg1);
    
    return Qnil;
}


static VALUE
_wrap_Layer_GetName(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (char *)OGRLayerShadow_GetName(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Layer_GetFeature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    OGRFeatureShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    arg2 = NUM2LONG(argv[0]);
    result = (OGRFeatureShadow *)OGRLayerShadow_GetFeature(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFeatureShadow,0);
    return vresult;
}


static VALUE
_wrap_Layer_GetNextFeature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OGRFeatureShadow *)OGRLayerShadow_GetNextFeature(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFeatureShadow,0);
    return vresult;
}


static VALUE
_wrap_Layer_SetNextByIndex(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    arg2 = NUM2LONG(argv[0]);
    result = (OGRErr)OGRLayerShadow_SetNextByIndex(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_SetFeature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (OGRErr)OGRLayerShadow_SetFeature(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_CreateFeature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (OGRErr)OGRLayerShadow_CreateFeature(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_DeleteFeature(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    arg2 = NUM2LONG(argv[0]);
    result = (OGRErr)OGRLayerShadow_DeleteFeature(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_SyncToDisk(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OGRErr)OGRLayerShadow_SyncToDisk(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_GetLayerDefn(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureDefnShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OGRFeatureDefnShadow *)OGRLayerShadow_GetLayerDefn(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFeatureDefnShadow,0);
    return vresult;
}


static VALUE
_wrap_Layer_GetFeatureCount(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int arg2 = (int) 1 ;
    int result;
    char *kwnames[] = {
        "self","force", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    if (argc > 0) {
        arg2 = NUM2INT(argv[0]);
    }
    result = (int)OGRLayerShadow_GetFeatureCount(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_GetExtent(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    double *arg2 ;
    int arg3 = (int) 1 ;
    double argout2[4] ;
    char *kwnames[] = {
        "self","force", NULL 
    };
    VALUE vresult = Qnil;
    
    {
        /* %typemap(ruby,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_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    if (argc > 0) {
        arg3 = NUM2INT(argv[0]);
    }
    OGRLayerShadow_GetExtent(arg1,arg2,arg3);
    
    {
        /* %typemap(ruby,argout) (double argout[ANY]) */
        vresult = rb_ary_new();
        
        for(int i=0; i<4; i++)
        {
            VALUE value = rb_float_new(arg2[i]);
            rb_ary_push(vresult, value);
        }
    }
    return vresult;
}


static VALUE
_wrap_Layer_TestCapability(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRLayerShadow_TestCapability(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_CreateField(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFieldDefnShadow *arg2 = (OGRFieldDefnShadow *) 0 ;
    int arg3 = (int) 1 ;
    OGRErr result;
    char *kwnames[] = {
        "self","field_def","approx_ok", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    if (argc > 1) {
        arg3 = NUM2INT(argv[1]);
    }
    result = (OGRErr)OGRLayerShadow_CreateField(arg1,arg2,arg3);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_StartTransaction(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OGRErr)OGRLayerShadow_StartTransaction(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_CommitTransaction(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OGRErr)OGRLayerShadow_CommitTransaction(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_RollbackTransaction(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OGRErr)OGRLayerShadow_RollbackTransaction(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Layer_GetSpatialRef(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OSRSpatialReferenceShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = (OSRSpatialReferenceShadow *)OGRLayerShadow_GetSpatialRef(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OSRSpatialReferenceShadow,0);
    return vresult;
}


static VALUE
_wrap_Layer_GetFeatureRead(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    GIntBig result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    result = OGRLayerShadow_GetFeatureRead(arg1);
    
    {
        GIntBig * resultptr;
        resultptr = new GIntBig((GIntBig &)result);
        vresult = SWIG_NewPointerObj((void *) resultptr, SWIGTYPE_p_GIntBig, 1);
    }
    return vresult;
}


static VALUE
_wrap_Layer_each(int argc, VALUE *argv, VALUE self) {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRLayerShadow, 1);
    OGRLayerShadow_each(arg1);
    
    return Qnil;
}


swig_class cFeature;

#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
static VALUE
_wrap_Feature_allocate(VALUE self) {
#else
    static 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;
    }
    

static VALUE
_wrap_new_Feature(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRFeatureShadow *result;
    char *kwnames[] = {
        "feature_def", NULL 
    };
    
    if ((argc < 0) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    if (argc > 0) {
        SWIG_ConvertPtr(argv[0], (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    }
    result = (OGRFeatureShadow *)new_OGRFeatureShadow(arg1);
    DATA_PTR(self) = result;
    return self;
}


static VALUE
_wrap_Feature_Destroy(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    OGRFeatureShadow_Destroy(arg1);
    
    return Qnil;
}


static VALUE
_wrap_Feature_GetDefnRef(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureDefnShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (OGRFeatureDefnShadow *)OGRFeatureShadow_GetDefnRef(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFeatureDefnShadow,0);
    return vresult;
}


static VALUE
_wrap_Feature_SetGeometry(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRErr)OGRFeatureShadow_SetGeometry(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_SetGeometryDirectly(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRErr)OGRFeatureShadow_SetGeometryDirectly(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetGeometryRef(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (OGRGeometryShadow *)OGRFeatureShadow_GetGeometryRef(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,0);
    return vresult;
}


static VALUE
_wrap_Feature_Clone(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (OGRFeatureShadow *)OGRFeatureShadow_Clone(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFeatureShadow,1);
    return vresult;
}


static VALUE
_wrap_Feature_Equal(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (int)OGRFeatureShadow_Equal(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetFieldCount(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (int)OGRFeatureShadow_GetFieldCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetFieldDefnRef__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    OGRFieldDefnShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (OGRFieldDefnShadow *)OGRFeatureShadow_GetFieldDefnRef__SWIG_0(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFieldDefnShadow,1);
    return vresult;
}


static VALUE
_wrap_Feature_GetFieldDefnRef__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRFieldDefnShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (OGRFieldDefnShadow *)OGRFeatureShadow_GetFieldDefnRef__SWIG_1(arg1,(char const *)arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFieldDefnShadow,1);
    return vresult;
}


static VALUE _wrap_Feature_GetFieldDefnRef(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldDefnRef__SWIG_0(nargs, args, self);
            }
        }
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldDefnRef__SWIG_1(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_GetFieldDefnRef'");
    return Qnil;
}


static VALUE
_wrap_Feature_GetFieldAsString__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_0(arg1,arg2);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetFieldAsString__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_1(arg1,(char const *)arg2);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE _wrap_Feature_GetFieldAsString(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldAsString__SWIG_0(nargs, args, self);
            }
        }
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldAsString__SWIG_1(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_GetFieldAsString'");
    return Qnil;
}


static VALUE
_wrap_Feature_GetFieldAsInteger__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (int)OGRFeatureShadow_GetFieldAsInteger__SWIG_0(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetFieldAsInteger__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRFeatureShadow_GetFieldAsInteger__SWIG_1(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE _wrap_Feature_GetFieldAsInteger(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldAsInteger__SWIG_0(nargs, args, self);
            }
        }
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldAsInteger__SWIG_1(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_GetFieldAsInteger'");
    return Qnil;
}


static VALUE
_wrap_Feature_GetFieldAsDouble__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (double)OGRFeatureShadow_GetFieldAsDouble__SWIG_0(arg1,arg2);
    
    vresult = rb_float_new(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetFieldAsDouble__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (double)OGRFeatureShadow_GetFieldAsDouble__SWIG_1(arg1,(char const *)arg2);
    
    vresult = rb_float_new(result);
    return vresult;
}


static VALUE _wrap_Feature_GetFieldAsDouble(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldAsDouble__SWIG_0(nargs, args, self);
            }
        }
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldAsDouble__SWIG_1(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_GetFieldAsDouble'");
    return Qnil;
}


static VALUE
_wrap_Feature_IsFieldSet__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (int)OGRFeatureShadow_IsFieldSet__SWIG_0(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_IsFieldSet__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRFeatureShadow_IsFieldSet__SWIG_1(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE _wrap_Feature_IsFieldSet(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_IsFieldSet__SWIG_0(nargs, args, self);
            }
        }
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_IsFieldSet__SWIG_1(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_IsFieldSet'");
    return Qnil;
}


static VALUE
_wrap_Feature_GetFieldIndex(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRFeatureShadow_GetFieldIndex(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetFID(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (int)OGRFeatureShadow_GetFID(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_SetFID(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (OGRErr)OGRFeatureShadow_SetFID(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_DumpReadable(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    OGRFeatureShadow_DumpReadable(arg1);
    
    return Qnil;
}


static VALUE
_wrap_Feature_UnsetField__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    OGRFeatureShadow_UnsetField__SWIG_0(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_Feature_UnsetField__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    OGRFeatureShadow_UnsetField__SWIG_1(arg1,(char const *)arg2);
    
    return Qnil;
}


static VALUE _wrap_Feature_UnsetField(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[3];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 2); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_UnsetField__SWIG_0(nargs, args, self);
            }
        }
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_UnsetField__SWIG_1(nargs, args, self);
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_UnsetField'");
    return Qnil;
}


static VALUE
_wrap_Feature_SetField__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char *arg3 = (char *) 0 ;
    
    if ((argc < 2) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    arg3 = StringValuePtr(argv[1]);
    OGRFeatureShadow_SetField__SWIG_0(arg1,arg2,(char const *)arg3);
    
    return Qnil;
}


static VALUE
_wrap_Feature_SetField__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char *arg3 = (char *) 0 ;
    
    if ((argc < 2) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    arg3 = StringValuePtr(argv[1]);
    OGRFeatureShadow_SetField__SWIG_1(arg1,(char const *)arg2,(char const *)arg3);
    
    return Qnil;
}


static VALUE _wrap_Feature_SetField(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[4];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 3); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 3) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                {
                    _v = (TYPE(argv[2]) == T_STRING) ? 1 : 0;
                }
                if (_v) {
                    return _wrap_Feature_SetField__SWIG_0(nargs, args, self);
                }
            }
        }
    }
    if (argc == 3) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                {
                    _v = (TYPE(argv[2]) == T_STRING) ? 1 : 0;
                }
                if (_v) {
                    return _wrap_Feature_SetField__SWIG_1(nargs, args, self);
                }
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_SetField'");
    return Qnil;
}


static VALUE
_wrap_Feature_SetFrom(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    int arg3 = (int) 1 ;
    OGRErr result;
    char *kwnames[] = {
        "self","other","forgiving", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRFeatureShadow, 1);
    if (argc > 1) {
        arg3 = NUM2INT(argv[1]);
    }
    result = (OGRErr)OGRFeatureShadow_SetFrom(arg1,arg2,arg3);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetStyleString(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    result = (char *)OGRFeatureShadow_GetStyleString(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Feature_SetStyleString(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    OGRFeatureShadow_SetStyleString(arg1,(char const *)arg2);
    
    return Qnil;
}


static VALUE
_wrap_Feature_GetFieldType__SWIG_0(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    OGRFieldType result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (OGRFieldType)OGRFeatureShadow_GetFieldType__SWIG_0(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Feature_GetFieldType__SWIG_1(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char *arg3 = (char *) 0 ;
    OGRFieldType result;
    VALUE vresult = Qnil;
    
    if ((argc < 2) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    arg3 = StringValuePtr(argv[1]);
    result = (OGRFieldType)OGRFeatureShadow_GetFieldType__SWIG_1(arg1,(char const *)arg2,(char const *)arg3);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE _wrap_Feature_GetFieldType(int nargs, VALUE *args, VALUE self) {
    int argc;
    VALUE argv[4];
    int ii;
    
    argc = nargs + 1;
    argv[0] = self;
    for (ii = 1; (ii < argc) && (ii < 3); ii++) {
        argv[ii] = args[ii-1];
    }
    if (argc == 2) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = ((TYPE(argv[1]) == T_FIXNUM) || (TYPE(argv[1]) == T_BIGNUM)) ? 1 : 0;
            }
            if (_v) {
                return _wrap_Feature_GetFieldType__SWIG_0(nargs, args, self);
            }
        }
    }
    if (argc == 3) {
        int _v;
        {
            void *ptr;
            _v = (NIL_P(argv[0]) || (TYPE(argv[0]) == T_DATA && SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_OGRFeatureShadow, 0) != -1)) ? 1 : 0;
        }
        if (_v) {
            {
                _v = (TYPE(argv[1]) == T_STRING) ? 1 : 0;
            }
            if (_v) {
                {
                    _v = (TYPE(argv[2]) == T_STRING) ? 1 : 0;
                }
                if (_v) {
                    return _wrap_Feature_GetFieldType__SWIG_1(nargs, args, self);
                }
            }
        }
    }
    
    rb_raise(rb_eArgError, "No matching function for overloaded 'Feature_GetFieldType'");
    return Qnil;
}


static VALUE
_wrap_Feature_GetField(int argc, VALUE *argv, VALUE self) {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    VALUE arg2 ;
    VALUE result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureShadow, 1);
    arg2 = argv[0];
    result = (VALUE)OGRFeatureShadow_GetField(arg1,arg2);
    
    vresult = result;
    return vresult;
}


swig_class cFeatureDefn;

#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
static VALUE
_wrap_FeatureDefn_allocate(VALUE self) {
#else
    static 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;
    }
    

static VALUE
_wrap_new_FeatureDefn(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) NULL ;
    OGRFeatureDefnShadow *result;
    char *kwnames[] = {
        "name", NULL 
    };
    
    if ((argc < 0) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    if (argc > 0) {
        arg1 = StringValuePtr(argv[0]);
    }
    result = (OGRFeatureDefnShadow *)new_OGRFeatureDefnShadow((char const *)arg1);
    DATA_PTR(self) = result;
    return self;
}


static VALUE
_wrap_FeatureDefn_Destroy(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    OGRFeatureDefnShadow_Destroy(arg1);
    
    return Qnil;
}


static VALUE
_wrap_FeatureDefn_GetName(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    result = (char *)OGRFeatureDefnShadow_GetName(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_FeatureDefn_GetFieldCount(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    result = (int)OGRFeatureDefnShadow_GetFieldCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FeatureDefn_GetFieldDefn(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int arg2 ;
    OGRFieldDefnShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (OGRFieldDefnShadow *)OGRFeatureDefnShadow_GetFieldDefn(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRFieldDefnShadow,1);
    return vresult;
}


static VALUE
_wrap_FeatureDefn_GetFieldIndex(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    result = (int)OGRFeatureDefnShadow_GetFieldIndex(arg1,(char const *)arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FeatureDefn_AddFieldDefn(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRFieldDefnShadow *arg2 = (OGRFieldDefnShadow *) 0 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    OGRFeatureDefnShadow_AddFieldDefn(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_FeatureDefn_GetGeomType(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRwkbGeometryType result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    result = (OGRwkbGeometryType)OGRFeatureDefnShadow_GetGeomType(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FeatureDefn_SetGeomType(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRwkbGeometryType arg2 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    {
        /* %typemap(ruby,in) CPLErr */
        arg2 = (OGRwkbGeometryType) NUM2INT(argv[0]);
    }
    OGRFeatureDefnShadow_SetGeomType(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_FeatureDefn_Reference(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    result = (int)OGRFeatureDefnShadow_Reference(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FeatureDefn_Dereference(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    result = (int)OGRFeatureDefnShadow_Dereference(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FeatureDefn_GetReferenceCount(int argc, VALUE *argv, VALUE self) {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFeatureDefnShadow, 1);
    result = (int)OGRFeatureDefnShadow_GetReferenceCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


swig_class cFieldDefn;

#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
static VALUE
_wrap_FieldDefn_allocate(VALUE self) {
#else
    static 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;
    }
    

static VALUE
_wrap_new_FieldDefn(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) "unnamed" ;
    OGRFieldType arg2 = (OGRFieldType) OFTString ;
    OGRFieldDefnShadow *result;
    char *kwnames[] = {
        "name","field_type", NULL 
    };
    
    if ((argc < 0) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    if (argc > 0) {
        arg1 = StringValuePtr(argv[0]);
    }
    if (argc > 1) {
        {
            /* %typemap(ruby,in) CPLErr */
            arg2 = (OGRFieldType) NUM2INT(argv[1]);
        }
    }
    result = (OGRFieldDefnShadow *)new_OGRFieldDefnShadow((char const *)arg1,arg2);
    DATA_PTR(self) = result;
    return self;
}


static VALUE
_wrap_FieldDefn_Destroy(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    OGRFieldDefnShadow_Destroy(arg1);
    
    return Qnil;
}


static VALUE
_wrap_FieldDefn_GetName(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    result = (char *)OGRFieldDefnShadow_GetName(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_FieldDefn_GetNameRef(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    result = (char *)OGRFieldDefnShadow_GetNameRef(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_FieldDefn_SetName(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    arg2 = StringValuePtr(argv[0]);
    OGRFieldDefnShadow_SetName(arg1,(char const *)arg2);
    
    return Qnil;
}


static VALUE
_wrap_FieldDefn_GetType(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRFieldType result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    result = (OGRFieldType)OGRFieldDefnShadow_GetType(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FieldDefn_SetType(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRFieldType arg2 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    {
        /* %typemap(ruby,in) CPLErr */
        arg2 = (OGRFieldType) NUM2INT(argv[0]);
    }
    OGRFieldDefnShadow_SetType(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_FieldDefn_GetJustify(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRJustification result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    result = (OGRJustification)OGRFieldDefnShadow_GetJustify(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FieldDefn_SetJustify(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRJustification arg2 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    {
        /* %typemap(ruby,in) CPLErr */
        arg2 = (OGRJustification) NUM2INT(argv[0]);
    }
    OGRFieldDefnShadow_SetJustify(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_FieldDefn_GetWidth(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    result = (int)OGRFieldDefnShadow_GetWidth(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FieldDefn_SetWidth(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int arg2 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    arg2 = NUM2INT(argv[0]);
    OGRFieldDefnShadow_SetWidth(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_FieldDefn_GetPrecision(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    result = (int)OGRFieldDefnShadow_GetPrecision(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_FieldDefn_SetPrecision(int argc, VALUE *argv, VALUE self) {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int arg2 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRFieldDefnShadow, 1);
    arg2 = NUM2INT(argv[0]);
    OGRFieldDefnShadow_SetPrecision(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_CreateGeometryFromWkb(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    char *arg2 = (char *) 0 ;
    OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
    OGRGeometryShadow *result;
    char *kwnames[] = {
        "len","reference", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    {
        /* %typemap(ruby,in,numinputs=0) (int nLen, char *pBuf ) */
        arg1 = (int) StringValueLen(argv[0]);
        arg2 = (char *) StringValuePtr(argv[0]);
    }
    if (argc > 1) {
        SWIG_ConvertPtr(argv[1], (void **) &arg3, SWIGTYPE_p_OSRSpatialReferenceShadow, 1);
    }
    result = (OGRGeometryShadow *)CreateGeometryFromWkb(arg1,arg2,arg3);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_CreateGeometryFromWkt(int argc, VALUE *argv, VALUE self) {
    char **arg1 = (char **) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) NULL ;
    OGRGeometryShadow *result;
    char *val1 = 0 ;
    char *kwnames[] = {
        "val","reference", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    {
        /* %typemap(ruby,in) char ** ( char *val1=0 ) */
        
        val1 = StringValuePtr(argv[0]);
        arg1 = &val1;
    }
    if (argc > 1) {
        SWIG_ConvertPtr(argv[1], (void **) &arg2, SWIGTYPE_p_OSRSpatialReferenceShadow, 1);
    }
    result = (OGRGeometryShadow *)CreateGeometryFromWkt(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_CreateGeometryFromGML(int argc, VALUE *argv, VALUE self) {
    char *arg1 = (char *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    arg1 = StringValuePtr(argv[0]);
    result = (OGRGeometryShadow *)CreateGeometryFromGML((char const *)arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


swig_class cGeometry;

#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
static VALUE
_wrap_Geometry_allocate(VALUE self) {
#else
    static 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;
    }
    

static 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 ;
    OGRGeometryShadow *result;
    char *kwnames[] = {
        "type","wkt","wkb","wkb_buf","gml", NULL 
    };
    
    if ((argc < 0) || (argc > 5))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    if (argc > 0) {
        {
            /* %typemap(ruby,in) CPLErr */
            arg1 = (OGRwkbGeometryType) NUM2INT(argv[0]);
        }
    }
    if (argc > 1) {
        arg2 = StringValuePtr(argv[1]);
    }
    if (argc > 2) {
        arg3 = NUM2INT(argv[2]);
    }
    if (argc > 3) {
        arg4 = StringValuePtr(argv[3]);
    }
    if (argc > 4) {
        arg5 = StringValuePtr(argv[4]);
    }
    result = (OGRGeometryShadow *)new_OGRGeometryShadow(arg1,arg2,arg3,arg4,arg5);
    DATA_PTR(self) = result;
    return self;
}


static VALUE
_wrap_Geometry_ExportToWkt(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (char *)OGRGeometryShadow_ExportToWkt(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Geometry_ExportToWkb(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int *arg2 = (int *) 0 ;
    char **arg3 = (char **) 0 ;
    OGRwkbByteOrder arg4 = (OGRwkbByteOrder) wkbXDR ;
    OGRErr result;
    int nLen2 = 0 ;
    char *pBuf2 = 0 ;
    char *kwnames[] = {
        "self","byte_order", NULL 
    };
    VALUE vresult = Qnil;
    
    {
        /* %typemap(ruby,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_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    if (argc > 0) {
        {
            /* %typemap(ruby,in) CPLErr */
            arg4 = (OGRwkbByteOrder) NUM2INT(argv[0]);
        }
    }
    result = (OGRErr)OGRGeometryShadow_ExportToWkb(arg1,arg2,arg3,arg4);
    
    vresult = INT2NUM(result);
    {
        /* %typemap(ruby,argout) (int *nLen, char **pBuf ) */
        vresult = rb_str_new(*arg3, *arg2);
    }
    {
        /* %typemap(ruby,freearg) (int *nLen, char **pBuf ) */
        if( *arg3 ) {
            free( *arg3 );
        }
    }
    return vresult;
}


static VALUE
_wrap_Geometry_ExportToGML(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (char *)OGRGeometryShadow_ExportToGML(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Geometry_AddPoint(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    double arg3 ;
    double arg4 = (double) 0 ;
    char *kwnames[] = {
        "self","x","y","z", NULL 
    };
    
    if ((argc < 2) || (argc > 3))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    arg2 = (double) NUM2DBL(argv[0]);
    arg3 = (double) NUM2DBL(argv[1]);
    if (argc > 2) {
        arg4 = (double) NUM2DBL(argv[2]);
    }
    OGRGeometryShadow_AddPoint(arg1,arg2,arg3,arg4);
    
    return Qnil;
}


static VALUE
_wrap_Geometry_AddGeometryDirectly(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRErr)OGRGeometryShadow_AddGeometryDirectly(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_AddGeometry(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRErr)OGRGeometryShadow_AddGeometry(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Clone(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_Clone(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_Destroy(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    OGRGeometryShadow_Destroy(arg1);
    
    return Qnil;
}


static VALUE
_wrap_Geometry_GetGeometryType(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRwkbGeometryType result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRwkbGeometryType)OGRGeometryShadow_GetGeometryType(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetGeometryName(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (char *)OGRGeometryShadow_GetGeometryName(arg1);
    
    vresult = rb_str_new2(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetArea(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (double)OGRGeometryShadow_GetArea(arg1);
    
    vresult = rb_float_new(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetPointCount(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_GetPointCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetX(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double result;
    char *kwnames[] = {
        "self","point", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    if (argc > 0) {
        arg2 = NUM2INT(argv[0]);
    }
    result = (double)OGRGeometryShadow_GetX(arg1,arg2);
    
    vresult = rb_float_new(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetY(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double result;
    char *kwnames[] = {
        "self","point", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    if (argc > 0) {
        arg2 = NUM2INT(argv[0]);
    }
    result = (double)OGRGeometryShadow_GetY(arg1,arg2);
    
    vresult = rb_float_new(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetZ(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double result;
    char *kwnames[] = {
        "self","point", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    if (argc > 0) {
        arg2 = NUM2INT(argv[0]);
    }
    result = (double)OGRGeometryShadow_GetZ(arg1,arg2);
    
    vresult = rb_float_new(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetGeometryCount(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_GetGeometryCount(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_SetPoint(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    double arg3 ;
    double arg4 ;
    double arg5 = (double) 0 ;
    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_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    arg2 = NUM2INT(argv[0]);
    arg3 = (double) NUM2DBL(argv[1]);
    arg4 = (double) NUM2DBL(argv[2]);
    if (argc > 3) {
        arg5 = (double) NUM2DBL(argv[3]);
    }
    OGRGeometryShadow_SetPoint(arg1,arg2,arg3,arg4,arg5);
    
    return Qnil;
}


static VALUE
_wrap_Geometry_GetGeometryRef(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    arg2 = NUM2INT(argv[0]);
    result = (OGRGeometryShadow *)OGRGeometryShadow_GetGeometryRef(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_GetBoundary(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_GetBoundary(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_ConvexHull(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_ConvexHull(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_Buffer(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    int arg3 = (int) 30 ;
    OGRGeometryShadow *result;
    char *kwnames[] = {
        "self","distance","quadsecs", NULL 
    };
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 2))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    arg2 = (double) NUM2DBL(argv[0]);
    if (argc > 1) {
        arg3 = NUM2INT(argv[1]);
    }
    result = (OGRGeometryShadow *)OGRGeometryShadow_Buffer(arg1,arg2,arg3);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_Intersection(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_Intersection(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_Union(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_Union(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_Difference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_Difference(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_SymmetricDifference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_SymmetricDifference(arg1,arg2);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_Distance(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    double result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (double)OGRGeometryShadow_Distance(arg1,arg2);
    
    vresult = rb_float_new(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Empty(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    OGRGeometryShadow_Empty(arg1);
    
    return Qnil;
}


static VALUE
_wrap_Geometry_Intersect(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Intersect(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Equal(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Equal(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Disjoint(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Disjoint(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Touches(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Touches(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Crosses(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Crosses(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Within(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Within(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Contains(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Contains(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Overlaps(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_Overlaps(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_TransformTo(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OSRSpatialReferenceShadow, 1);
    result = (OGRErr)OGRGeometryShadow_TransformTo(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_Transform(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRCoordinateTransformationShadow *arg2 = (OSRCoordinateTransformationShadow *) 0 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OSRCoordinateTransformationShadow, 1);
    result = (OGRErr)OGRGeometryShadow_Transform(arg1,arg2);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetSpatialReference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OSRSpatialReferenceShadow *)OGRGeometryShadow_GetSpatialReference(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OSRSpatialReferenceShadow,0);
    return vresult;
}


static VALUE
_wrap_Geometry_AssignSpatialReference(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    SWIG_ConvertPtr(argv[0], (void **) &arg2, SWIGTYPE_p_OSRSpatialReferenceShadow, 1);
    OGRGeometryShadow_AssignSpatialReference(arg1,arg2);
    
    return Qnil;
}


static VALUE
_wrap_Geometry_CloseRings(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    OGRGeometryShadow_CloseRings(arg1);
    
    return Qnil;
}


static VALUE
_wrap_Geometry_FlattenTo2D(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    OGRGeometryShadow_FlattenTo2D(arg1);
    
    return Qnil;
}


static VALUE
_wrap_Geometry_GetEnvelope(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double *arg2 ;
    double argout2[4] ;
    VALUE vresult = Qnil;
    
    {
        /* %typemap(ruby,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_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    OGRGeometryShadow_GetEnvelope(arg1,arg2);
    
    {
        /* %typemap(ruby,argout) (double argout[ANY]) */
        vresult = rb_ary_new();
        
        for(int i=0; i<4; i++)
        {
            VALUE value = rb_float_new(arg2[i]);
            rb_ary_push(vresult, value);
        }
    }
    return vresult;
}


static VALUE
_wrap_Geometry_Centroid(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (OGRGeometryShadow *)OGRGeometryShadow_Centroid(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRGeometryShadow,1);
    return vresult;
}


static VALUE
_wrap_Geometry_WkbSize(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_WkbSize(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetCoordinateDimension(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_GetCoordinateDimension(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_Geometry_GetDimension(int argc, VALUE *argv, VALUE self) {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    VALUE vresult = Qnil;
    
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    SWIG_ConvertPtr(self, (void **) &arg1, SWIGTYPE_p_OGRGeometryShadow, 1);
    result = (int)OGRGeometryShadow_GetDimension(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_GetDriverCount(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);
    result = (int)OGRGetDriverCount();
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_GetOpenDSCount(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);
    result = (int)OGRGetOpenDSCount();
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_SetGenerate_DB2_V72_BYTE_ORDER(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    OGRErr result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    arg1 = NUM2INT(argv[0]);
    result = (OGRErr)OGRSetGenerate_DB2_V72_BYTE_ORDER(arg1);
    
    vresult = INT2NUM(result);
    return vresult;
}


static VALUE
_wrap_RegisterAll(int argc, VALUE *argv, VALUE self) {
    if ((argc < 0) || (argc > 0))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc);
    OGRRegisterAll();
    
    return Qnil;
}


static VALUE
_wrap_GetOpenDS(int argc, VALUE *argv, VALUE self) {
    int arg1 ;
    OGRDataSourceShadow *result;
    VALUE vresult = Qnil;
    
    if ((argc < 1) || (argc > 1))
    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc);
    arg1 = NUM2INT(argv[0]);
    result = (OGRDataSourceShadow *)GetOpenDS(arg1);
    
    vresult = SWIG_NewPointerObj((void *) result, SWIGTYPE_p_OGRDataSourceShadow,1);
    return vresult;
}



/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static swig_type_info _swigt__p_GIntBig = {"_p_GIntBig", "GIntBig *", 0, 0, 0};
static swig_type_info _swigt__p_OGRDataSourceShadow = {"_p_OGRDataSourceShadow", "OGRDataSourceShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OGRDriverShadow = {"_p_OGRDriverShadow", "OGRDriverShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OGRFeatureDefnShadow = {"_p_OGRFeatureDefnShadow", "OGRFeatureDefnShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OGRFieldDefnShadow = {"_p_OGRFieldDefnShadow", "OGRFieldDefnShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OGRGeometryShadow = {"_p_OGRGeometryShadow", "OGRGeometryShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OSRCoordinateTransformationShadow = {"_p_OSRCoordinateTransformationShadow", "OSRCoordinateTransformationShadow *", 0, 0, 0};
static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, 0};
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *|VALUE *", 0, 0, 0};

static swig_type_info *swig_type_initial[] = {
  &_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_double,
  &_swigt__p_int,
  &_swigt__p_p_char,
  &_swigt__p_unsigned_long,
};

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_double[] = {  {&_swigt__p_double, 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_unsigned_long[] = {  {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _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_double,
  _swigc__p_int,
  _swigc__p_p_char,
  _swigc__p_unsigned_long,
};


/* -------- 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 staticly to an initial 
 * array. We just loop though 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" {
#endif

SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  swig_type_info *type, *ret;
  swig_cast_info *cast;
  size_t i;
  swig_module_info *module_head;
  static int init_run = 0;

  clientdata = clientdata;

  if (init_run) return;
  init_run = 1;

  /* Initialize the swig_module */
  swig_module.type_initial = swig_type_initial;
  swig_module.cast_initial = swig_cast_initial;

  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (module_head) {
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  } else {
    /* This is the first module loaded */
    swig_module.next = &swig_module;
    SWIG_SetModule(clientdata, &swig_module);
  }
		 
  /* Now work on filling in swig_module.types */
  for (i = 0; i < swig_module.size; ++i) {
    type = 0;

    /* 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 */
      if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
    } 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;
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
      }
      if (ret && type == swig_module.type_initial[i]) {
        cast->type = ret;
        ret = 0;
      }
      
      if (!ret) {
        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;
  }
}

/* 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
}
#endif


#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT void Init_ogr(void) {
    int i;
    
    SWIG_InitRuntime();
    mOgr = rb_define_module("Ogr");
    
    SWIG_InitializeModule(0);
    for (i = 0; i < swig_module.size; i++) {
        SWIG_define_class(swig_module.types[i]);
    }
    
    
    
    if ( OGRGetDriverCount() == 0 ) {
        OGRRegisterAll();
    }
    
    
    rb_define_const(mOgr,"Wkb25Bit", INT2NUM(-2147483648));
    rb_define_const(mOgr,"WkbUnknown", INT2NUM(0));
    rb_define_const(mOgr,"WkbPoint", INT2NUM(1));
    rb_define_const(mOgr,"WkbLineString", INT2NUM(2));
    rb_define_const(mOgr,"WkbPolygon", INT2NUM(3));
    rb_define_const(mOgr,"WkbMultiPoint", INT2NUM(4));
    rb_define_const(mOgr,"WkbMultiLineString", INT2NUM(5));
    rb_define_const(mOgr,"WkbMultiPolygon", INT2NUM(6));
    rb_define_const(mOgr,"WkbGeometryCollection", INT2NUM(7));
    rb_define_const(mOgr,"WkbNone", INT2NUM(100));
    rb_define_const(mOgr,"WkbLinearRing", INT2NUM(101));
    rb_define_const(mOgr,"WkbPoint25D", INT2NUM(wkbPoint+wkb25DBit));
    rb_define_const(mOgr,"WkbLineString25D", INT2NUM(wkbLineString+wkb25DBit));
    rb_define_const(mOgr,"WkbPolygon25D", INT2NUM(wkbPolygon+wkb25DBit));
    rb_define_const(mOgr,"WkbMultiPoint25D", INT2NUM(wkbMultiPoint+wkb25DBit));
    rb_define_const(mOgr,"WkbMultiLineString25D", INT2NUM(wkbMultiLineString+wkb25DBit));
    rb_define_const(mOgr,"WkbMultiPolygon25D", INT2NUM(wkbMultiPolygon+wkb25DBit));
    rb_define_const(mOgr,"WkbGeometryCollection25D", INT2NUM(wkbGeometryCollection+wkb25DBit));
    rb_define_const(mOgr,"OFTInteger", INT2NUM(0));
    rb_define_const(mOgr,"OFTIntegerList", INT2NUM(1));
    rb_define_const(mOgr,"OFTReal", INT2NUM(2));
    rb_define_const(mOgr,"OFTRealList", INT2NUM(3));
    rb_define_const(mOgr,"OFTString", INT2NUM(4));
    rb_define_const(mOgr,"OFTStringList", INT2NUM(5));
    rb_define_const(mOgr,"OFTWideString", INT2NUM(6));
    rb_define_const(mOgr,"OFTWideStringList", INT2NUM(7));
    rb_define_const(mOgr,"OFTBinary", INT2NUM(8));
    rb_define_const(mOgr,"OJUndefined", INT2NUM(0));
    rb_define_const(mOgr,"OJLeft", INT2NUM(1));
    rb_define_const(mOgr,"OJRight", INT2NUM(2));
    rb_define_const(mOgr,"WkbXDR", INT2NUM(0));
    rb_define_const(mOgr,"WkbNDR", INT2NUM(1));
    rb_define_const(mOgr,"OLCRandomRead", rb_str_new2("RandomRead"));
    rb_define_const(mOgr,"OLCSequentialWrite", rb_str_new2("SequentialWrite"));
    rb_define_const(mOgr,"OLCRandomWrite", rb_str_new2("RandomWrite"));
    rb_define_const(mOgr,"OLCFastSpatialFilter", rb_str_new2("FastSpatialFilter"));
    rb_define_const(mOgr,"OLCFastFeatureCount", rb_str_new2("FastFeatureCount"));
    rb_define_const(mOgr,"OLCFastGetExtent", rb_str_new2("FastGetExtent"));
    rb_define_const(mOgr,"OLCCreateField", rb_str_new2("CreateField"));
    rb_define_const(mOgr,"OLCTransactions", rb_str_new2("Transactions"));
    rb_define_const(mOgr,"OLCDeleteFeature", rb_str_new2("DeleteFeature"));
    rb_define_const(mOgr,"OLCFastSetNextByIndex", rb_str_new2("FastSetNextByIndex"));
    rb_define_const(mOgr,"ODsCCreateLayer", rb_str_new2("CreateLayer"));
    rb_define_const(mOgr,"ODsCDeleteLayer", rb_str_new2("DeleteLayer"));
    rb_define_const(mOgr,"ODrCCreateDataSource", rb_str_new2("CreateDataSource"));
    rb_define_const(mOgr,"ODrCDeleteDataSource", rb_str_new2("DeleteDataSource"));
    
    cDriver.klass = rb_define_class_under(mOgr, "Driver", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRDriverShadow, (void *) &cDriver);
    rb_undef_alloc_func(cDriver.klass);
    rb_define_method(cDriver.klass, "name", VALUEFUNC(_wrap_Driver_name_get), -1);
    rb_define_method(cDriver.klass, "CreateDataSource", VALUEFUNC(_wrap_Driver_CreateDataSource), -1);
    rb_define_method(cDriver.klass, "CopyDataSource", VALUEFUNC(_wrap_Driver_CopyDataSource), -1);
    rb_define_method(cDriver.klass, "Open", VALUEFUNC(_wrap_Driver_Open), -1);
    rb_define_method(cDriver.klass, "DeleteDataSource", VALUEFUNC(_wrap_Driver_DeleteDataSource), -1);
    rb_define_method(cDriver.klass, "TestCapability", VALUEFUNC(_wrap_Driver_TestCapability), -1);
    rb_define_method(cDriver.klass, "GetName", VALUEFUNC(_wrap_Driver_GetName), -1);
    rb_define_singleton_method(cDriver.klass, "GetDriverByName", VALUEFUNC(_wrap_Driver_GetDriverByName), -1);
    rb_define_singleton_method(cDriver.klass, "GetDriver", VALUEFUNC(_wrap_Driver_GetDriver), -1);
    cDriver.mark = 0;
    
    cDataSource.klass = rb_define_class_under(mOgr, "DataSource", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRDataSourceShadow, (void *) &cDataSource);
    rb_undef_alloc_func(cDataSource.klass);
    rb_define_method(cDataSource.klass, "name", VALUEFUNC(_wrap_DataSource_name_get), -1);
    rb_define_method(cDataSource.klass, "Destroy", VALUEFUNC(_wrap_DataSource_Destroy), -1);
    rb_define_method(cDataSource.klass, "Release", VALUEFUNC(_wrap_DataSource_Release), -1);
    rb_define_method(cDataSource.klass, "Reference", VALUEFUNC(_wrap_DataSource_Reference), -1);
    rb_define_method(cDataSource.klass, "Dereference", VALUEFUNC(_wrap_DataSource_Dereference), -1);
    rb_define_method(cDataSource.klass, "GetRefCount", VALUEFUNC(_wrap_DataSource_GetRefCount), -1);
    rb_define_method(cDataSource.klass, "GetSummaryRefCount", VALUEFUNC(_wrap_DataSource_GetSummaryRefCount), -1);
    rb_define_method(cDataSource.klass, "GetLayerCount", VALUEFUNC(_wrap_DataSource_GetLayerCount), -1);
    rb_define_method(cDataSource.klass, "GetName", VALUEFUNC(_wrap_DataSource_GetName), -1);
    rb_define_method(cDataSource.klass, "DeleteLayer", VALUEFUNC(_wrap_DataSource_DeleteLayer), -1);
    rb_define_method(cDataSource.klass, "CreateLayer", VALUEFUNC(_wrap_DataSource_CreateLayer), -1);
    rb_define_method(cDataSource.klass, "CopyLayer", VALUEFUNC(_wrap_DataSource_CopyLayer), -1);
    rb_define_method(cDataSource.klass, "GetLayerByIndex", VALUEFUNC(_wrap_DataSource_GetLayerByIndex), -1);
    rb_define_method(cDataSource.klass, "GetLayerByName", VALUEFUNC(_wrap_DataSource_GetLayerByName), -1);
    rb_define_method(cDataSource.klass, "TestCapability", VALUEFUNC(_wrap_DataSource_TestCapability), -1);
    rb_define_method(cDataSource.klass, "ExecuteSQL", VALUEFUNC(_wrap_DataSource_ExecuteSQL), -1);
    rb_define_method(cDataSource.klass, "ReleaseResultSet", VALUEFUNC(_wrap_DataSource_ReleaseResultSet), -1);
    rb_define_singleton_method(cDataSource.klass, "Open", VALUEFUNC(_wrap_DataSource_Open), -1);
    rb_define_singleton_method(cDataSource.klass, "OpenShared", VALUEFUNC(_wrap_DataSource_OpenShared), -1);
    cDataSource.mark = 0;
    
    cLayer.klass = rb_define_class_under(mOgr, "Layer", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRLayerShadow, (void *) &cLayer);
    rb_include_module(cLayer.klass, rb_eval_string("Enumerable"));
    rb_undef_alloc_func(cLayer.klass);
    rb_define_method(cLayer.klass, "Reference", VALUEFUNC(_wrap_Layer_Reference), -1);
    rb_define_method(cLayer.klass, "Dereference", VALUEFUNC(_wrap_Layer_Dereference), -1);
    rb_define_method(cLayer.klass, "GetRefCount", VALUEFUNC(_wrap_Layer_GetRefCount), -1);
    rb_define_method(cLayer.klass, "SetSpatialFilter", VALUEFUNC(_wrap_Layer_SetSpatialFilter), -1);
    rb_define_method(cLayer.klass, "SetSpatialFilterRect", VALUEFUNC(_wrap_Layer_SetSpatialFilterRect), -1);
    rb_define_method(cLayer.klass, "GetSpatialFilter", VALUEFUNC(_wrap_Layer_GetSpatialFilter), -1);
    rb_define_method(cLayer.klass, "SetAttributeFilter", VALUEFUNC(_wrap_Layer_SetAttributeFilter), -1);
    rb_define_method(cLayer.klass, "ResetReading", VALUEFUNC(_wrap_Layer_ResetReading), -1);
    rb_define_method(cLayer.klass, "GetName", VALUEFUNC(_wrap_Layer_GetName), -1);
    rb_define_method(cLayer.klass, "GetFeature", VALUEFUNC(_wrap_Layer_GetFeature), -1);
    rb_define_method(cLayer.klass, "GetNextFeature", VALUEFUNC(_wrap_Layer_GetNextFeature), -1);
    rb_define_method(cLayer.klass, "SetNextByIndex", VALUEFUNC(_wrap_Layer_SetNextByIndex), -1);
    rb_define_method(cLayer.klass, "SetFeature", VALUEFUNC(_wrap_Layer_SetFeature), -1);
    rb_define_method(cLayer.klass, "CreateFeature", VALUEFUNC(_wrap_Layer_CreateFeature), -1);
    rb_define_method(cLayer.klass, "DeleteFeature", VALUEFUNC(_wrap_Layer_DeleteFeature), -1);
    rb_define_method(cLayer.klass, "SyncToDisk", VALUEFUNC(_wrap_Layer_SyncToDisk), -1);
    rb_define_method(cLayer.klass, "GetLayerDefn", VALUEFUNC(_wrap_Layer_GetLayerDefn), -1);
    rb_define_method(cLayer.klass, "GetFeatureCount", VALUEFUNC(_wrap_Layer_GetFeatureCount), -1);
    rb_define_method(cLayer.klass, "GetExtent", VALUEFUNC(_wrap_Layer_GetExtent), -1);
    rb_define_method(cLayer.klass, "TestCapability", VALUEFUNC(_wrap_Layer_TestCapability), -1);
    rb_define_method(cLayer.klass, "CreateField", VALUEFUNC(_wrap_Layer_CreateField), -1);
    rb_define_method(cLayer.klass, "StartTransaction", VALUEFUNC(_wrap_Layer_StartTransaction), -1);
    rb_define_method(cLayer.klass, "CommitTransaction", VALUEFUNC(_wrap_Layer_CommitTransaction), -1);
    rb_define_method(cLayer.klass, "RollbackTransaction", VALUEFUNC(_wrap_Layer_RollbackTransaction), -1);
    rb_define_method(cLayer.klass, "GetSpatialRef", VALUEFUNC(_wrap_Layer_GetSpatialRef), -1);
    rb_define_method(cLayer.klass, "GetFeatureRead", VALUEFUNC(_wrap_Layer_GetFeatureRead), -1);
    rb_define_method(cLayer.klass, "each", VALUEFUNC(_wrap_Layer_each), -1);
    cLayer.mark = 0;
    
    cFeature.klass = rb_define_class_under(mOgr, "Feature", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRFeatureShadow, (void *) &cFeature);
    rb_define_alloc_func(cFeature.klass, _wrap_Feature_allocate);
    rb_define_method(cFeature.klass, "initialize", VALUEFUNC(_wrap_new_Feature), -1);
    rb_define_method(cFeature.klass, "Destroy", VALUEFUNC(_wrap_Feature_Destroy), -1);
    rb_define_method(cFeature.klass, "GetDefnRef", VALUEFUNC(_wrap_Feature_GetDefnRef), -1);
    rb_define_method(cFeature.klass, "SetGeometry", VALUEFUNC(_wrap_Feature_SetGeometry), -1);
    rb_define_method(cFeature.klass, "SetGeometryDirectly", VALUEFUNC(_wrap_Feature_SetGeometryDirectly), -1);
    rb_define_method(cFeature.klass, "GetGeometryRef", VALUEFUNC(_wrap_Feature_GetGeometryRef), -1);
    rb_define_method(cFeature.klass, "Clone", VALUEFUNC(_wrap_Feature_Clone), -1);
    rb_define_method(cFeature.klass, "Equal", VALUEFUNC(_wrap_Feature_Equal), -1);
    rb_define_method(cFeature.klass, "GetFieldCount", VALUEFUNC(_wrap_Feature_GetFieldCount), -1);
    rb_define_method(cFeature.klass, "GetFieldDefnRef", VALUEFUNC(_wrap_Feature_GetFieldDefnRef), -1);
    rb_define_method(cFeature.klass, "GetFieldAsString", VALUEFUNC(_wrap_Feature_GetFieldAsString), -1);
    rb_define_method(cFeature.klass, "GetFieldAsInteger", VALUEFUNC(_wrap_Feature_GetFieldAsInteger), -1);
    rb_define_method(cFeature.klass, "GetFieldAsDouble", VALUEFUNC(_wrap_Feature_GetFieldAsDouble), -1);
    rb_define_method(cFeature.klass, "IsFieldSet", VALUEFUNC(_wrap_Feature_IsFieldSet), -1);
    rb_define_method(cFeature.klass, "GetFieldIndex", VALUEFUNC(_wrap_Feature_GetFieldIndex), -1);
    rb_define_method(cFeature.klass, "GetFID", VALUEFUNC(_wrap_Feature_GetFID), -1);
    rb_define_method(cFeature.klass, "SetFID", VALUEFUNC(_wrap_Feature_SetFID), -1);
    rb_define_method(cFeature.klass, "DumpReadable", VALUEFUNC(_wrap_Feature_DumpReadable), -1);
    rb_define_method(cFeature.klass, "UnsetField", VALUEFUNC(_wrap_Feature_UnsetField), -1);
    rb_define_method(cFeature.klass, "SetField", VALUEFUNC(_wrap_Feature_SetField), -1);
    rb_define_method(cFeature.klass, "SetFrom", VALUEFUNC(_wrap_Feature_SetFrom), -1);
    rb_define_method(cFeature.klass, "GetStyleString", VALUEFUNC(_wrap_Feature_GetStyleString), -1);
    rb_define_method(cFeature.klass, "SetStyleString", VALUEFUNC(_wrap_Feature_SetStyleString), -1);
    rb_define_method(cFeature.klass, "GetFieldType", VALUEFUNC(_wrap_Feature_GetFieldType), -1);
    rb_define_method(cFeature.klass, "GetField", VALUEFUNC(_wrap_Feature_GetField), -1);
    cFeature.mark = 0;
    
    cFeatureDefn.klass = rb_define_class_under(mOgr, "FeatureDefn", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRFeatureDefnShadow, (void *) &cFeatureDefn);
    rb_define_alloc_func(cFeatureDefn.klass, _wrap_FeatureDefn_allocate);
    rb_define_method(cFeatureDefn.klass, "initialize", VALUEFUNC(_wrap_new_FeatureDefn), -1);
    rb_define_method(cFeatureDefn.klass, "Destroy", VALUEFUNC(_wrap_FeatureDefn_Destroy), -1);
    rb_define_method(cFeatureDefn.klass, "GetName", VALUEFUNC(_wrap_FeatureDefn_GetName), -1);
    rb_define_method(cFeatureDefn.klass, "GetFieldCount", VALUEFUNC(_wrap_FeatureDefn_GetFieldCount), -1);
    rb_define_method(cFeatureDefn.klass, "GetFieldDefn", VALUEFUNC(_wrap_FeatureDefn_GetFieldDefn), -1);
    rb_define_method(cFeatureDefn.klass, "GetFieldIndex", VALUEFUNC(_wrap_FeatureDefn_GetFieldIndex), -1);
    rb_define_method(cFeatureDefn.klass, "AddFieldDefn", VALUEFUNC(_wrap_FeatureDefn_AddFieldDefn), -1);
    rb_define_method(cFeatureDefn.klass, "GetGeomType", VALUEFUNC(_wrap_FeatureDefn_GetGeomType), -1);
    rb_define_method(cFeatureDefn.klass, "SetGeomType", VALUEFUNC(_wrap_FeatureDefn_SetGeomType), -1);
    rb_define_method(cFeatureDefn.klass, "Reference", VALUEFUNC(_wrap_FeatureDefn_Reference), -1);
    rb_define_method(cFeatureDefn.klass, "Dereference", VALUEFUNC(_wrap_FeatureDefn_Dereference), -1);
    rb_define_method(cFeatureDefn.klass, "GetReferenceCount", VALUEFUNC(_wrap_FeatureDefn_GetReferenceCount), -1);
    cFeatureDefn.mark = 0;
    
    cFieldDefn.klass = rb_define_class_under(mOgr, "FieldDefn", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRFieldDefnShadow, (void *) &cFieldDefn);
    rb_define_alloc_func(cFieldDefn.klass, _wrap_FieldDefn_allocate);
    rb_define_method(cFieldDefn.klass, "initialize", VALUEFUNC(_wrap_new_FieldDefn), -1);
    rb_define_method(cFieldDefn.klass, "Destroy", VALUEFUNC(_wrap_FieldDefn_Destroy), -1);
    rb_define_method(cFieldDefn.klass, "GetName", VALUEFUNC(_wrap_FieldDefn_GetName), -1);
    rb_define_method(cFieldDefn.klass, "GetNameRef", VALUEFUNC(_wrap_FieldDefn_GetNameRef), -1);
    rb_define_method(cFieldDefn.klass, "SetName", VALUEFUNC(_wrap_FieldDefn_SetName), -1);
    rb_define_method(cFieldDefn.klass, "GetType", VALUEFUNC(_wrap_FieldDefn_GetType), -1);
    rb_define_method(cFieldDefn.klass, "SetType", VALUEFUNC(_wrap_FieldDefn_SetType), -1);
    rb_define_method(cFieldDefn.klass, "GetJustify", VALUEFUNC(_wrap_FieldDefn_GetJustify), -1);
    rb_define_method(cFieldDefn.klass, "SetJustify", VALUEFUNC(_wrap_FieldDefn_SetJustify), -1);
    rb_define_method(cFieldDefn.klass, "GetWidth", VALUEFUNC(_wrap_FieldDefn_GetWidth), -1);
    rb_define_method(cFieldDefn.klass, "SetWidth", VALUEFUNC(_wrap_FieldDefn_SetWidth), -1);
    rb_define_method(cFieldDefn.klass, "GetPrecision", VALUEFUNC(_wrap_FieldDefn_GetPrecision), -1);
    rb_define_method(cFieldDefn.klass, "SetPrecision", VALUEFUNC(_wrap_FieldDefn_SetPrecision), -1);
    cFieldDefn.mark = 0;
    rb_define_module_function(mOgr, "CreateGeometryFromWkb", VALUEFUNC(_wrap_CreateGeometryFromWkb), -1);
    rb_define_module_function(mOgr, "CreateGeometryFromWkt", VALUEFUNC(_wrap_CreateGeometryFromWkt), -1);
    rb_define_module_function(mOgr, "CreateGeometryFromGML", VALUEFUNC(_wrap_CreateGeometryFromGML), -1);
    
    cGeometry.klass = rb_define_class_under(mOgr, "Geometry", rb_cObject);
    SWIG_TypeClientData(SWIGTYPE_p_OGRGeometryShadow, (void *) &cGeometry);
    rb_define_alloc_func(cGeometry.klass, _wrap_Geometry_allocate);
    rb_define_method(cGeometry.klass, "initialize", VALUEFUNC(_wrap_new_Geometry), -1);
    rb_define_method(cGeometry.klass, "ExportToWkt", VALUEFUNC(_wrap_Geometry_ExportToWkt), -1);
    rb_define_method(cGeometry.klass, "ExportToWkb", VALUEFUNC(_wrap_Geometry_ExportToWkb), -1);
    rb_define_method(cGeometry.klass, "ExportToGML", VALUEFUNC(_wrap_Geometry_ExportToGML), -1);
    rb_define_method(cGeometry.klass, "AddPoint", VALUEFUNC(_wrap_Geometry_AddPoint), -1);
    rb_define_method(cGeometry.klass, "AddGeometryDirectly", VALUEFUNC(_wrap_Geometry_AddGeometryDirectly), -1);
    rb_define_method(cGeometry.klass, "AddGeometry", VALUEFUNC(_wrap_Geometry_AddGeometry), -1);
    rb_define_method(cGeometry.klass, "Clone", VALUEFUNC(_wrap_Geometry_Clone), -1);
    rb_define_method(cGeometry.klass, "Destroy", VALUEFUNC(_wrap_Geometry_Destroy), -1);
    rb_define_method(cGeometry.klass, "GetGeometryType", VALUEFUNC(_wrap_Geometry_GetGeometryType), -1);
    rb_define_method(cGeometry.klass, "GetGeometryName", VALUEFUNC(_wrap_Geometry_GetGeometryName), -1);
    rb_define_method(cGeometry.klass, "GetArea", VALUEFUNC(_wrap_Geometry_GetArea), -1);
    rb_define_method(cGeometry.klass, "GetPointCount", VALUEFUNC(_wrap_Geometry_GetPointCount), -1);
    rb_define_method(cGeometry.klass, "GetX", VALUEFUNC(_wrap_Geometry_GetX), -1);
    rb_define_method(cGeometry.klass, "GetY", VALUEFUNC(_wrap_Geometry_GetY), -1);
    rb_define_method(cGeometry.klass, "GetZ", VALUEFUNC(_wrap_Geometry_GetZ), -1);
    rb_define_method(cGeometry.klass, "GetGeometryCount", VALUEFUNC(_wrap_Geometry_GetGeometryCount), -1);
    rb_define_method(cGeometry.klass, "SetPoint", VALUEFUNC(_wrap_Geometry_SetPoint), -1);
    rb_define_method(cGeometry.klass, "GetGeometryRef", VALUEFUNC(_wrap_Geometry_GetGeometryRef), -1);
    rb_define_method(cGeometry.klass, "GetBoundary", VALUEFUNC(_wrap_Geometry_GetBoundary), -1);
    rb_define_method(cGeometry.klass, "ConvexHull", VALUEFUNC(_wrap_Geometry_ConvexHull), -1);
    rb_define_method(cGeometry.klass, "Buffer", VALUEFUNC(_wrap_Geometry_Buffer), -1);
    rb_define_method(cGeometry.klass, "Intersection", VALUEFUNC(_wrap_Geometry_Intersection), -1);
    rb_define_method(cGeometry.klass, "Union", VALUEFUNC(_wrap_Geometry_Union), -1);
    rb_define_method(cGeometry.klass, "Difference", VALUEFUNC(_wrap_Geometry_Difference), -1);
    rb_define_method(cGeometry.klass, "SymmetricDifference", VALUEFUNC(_wrap_Geometry_SymmetricDifference), -1);
    rb_define_method(cGeometry.klass, "Distance", VALUEFUNC(_wrap_Geometry_Distance), -1);
    rb_define_method(cGeometry.klass, "Empty", VALUEFUNC(_wrap_Geometry_Empty), -1);
    rb_define_method(cGeometry.klass, "Intersect", VALUEFUNC(_wrap_Geometry_Intersect), -1);
    rb_define_method(cGeometry.klass, "Equal", VALUEFUNC(_wrap_Geometry_Equal), -1);
    rb_define_method(cGeometry.klass, "Disjoint", VALUEFUNC(_wrap_Geometry_Disjoint), -1);
    rb_define_method(cGeometry.klass, "Touches", VALUEFUNC(_wrap_Geometry_Touches), -1);
    rb_define_method(cGeometry.klass, "Crosses", VALUEFUNC(_wrap_Geometry_Crosses), -1);
    rb_define_method(cGeometry.klass, "Within", VALUEFUNC(_wrap_Geometry_Within), -1);
    rb_define_method(cGeometry.klass, "Contains", VALUEFUNC(_wrap_Geometry_Contains), -1);
    rb_define_method(cGeometry.klass, "Overlaps", VALUEFUNC(_wrap_Geometry_Overlaps), -1);
    rb_define_method(cGeometry.klass, "TransformTo", VALUEFUNC(_wrap_Geometry_TransformTo), -1);
    rb_define_method(cGeometry.klass, "Transform", VALUEFUNC(_wrap_Geometry_Transform), -1);
    rb_define_method(cGeometry.klass, "GetSpatialReference", VALUEFUNC(_wrap_Geometry_GetSpatialReference), -1);
    rb_define_method(cGeometry.klass, "AssignSpatialReference", VALUEFUNC(_wrap_Geometry_AssignSpatialReference), -1);
    rb_define_method(cGeometry.klass, "CloseRings", VALUEFUNC(_wrap_Geometry_CloseRings), -1);
    rb_define_method(cGeometry.klass, "FlattenTo2D", VALUEFUNC(_wrap_Geometry_FlattenTo2D), -1);
    rb_define_method(cGeometry.klass, "GetEnvelope", VALUEFUNC(_wrap_Geometry_GetEnvelope), -1);
    rb_define_method(cGeometry.klass, "Centroid", VALUEFUNC(_wrap_Geometry_Centroid), -1);
    rb_define_method(cGeometry.klass, "WkbSize", VALUEFUNC(_wrap_Geometry_WkbSize), -1);
    rb_define_method(cGeometry.klass, "GetCoordinateDimension", VALUEFUNC(_wrap_Geometry_GetCoordinateDimension), -1);
    rb_define_method(cGeometry.klass, "GetDimension", VALUEFUNC(_wrap_Geometry_GetDimension), -1);
    cGeometry.mark = 0;
    rb_define_module_function(mOgr, "GetDriverCount", VALUEFUNC(_wrap_GetDriverCount), -1);
    rb_define_module_function(mOgr, "GetOpenDSCount", VALUEFUNC(_wrap_GetOpenDSCount), -1);
    rb_define_module_function(mOgr, "SetGenerate_DB2_V72_BYTE_ORDER", VALUEFUNC(_wrap_SetGenerate_DB2_V72_BYTE_ORDER), -1);
    rb_define_module_function(mOgr, "RegisterAll", VALUEFUNC(_wrap_RegisterAll), -1);
    rb_define_module_function(mOgr, "GetOpenDS", VALUEFUNC(_wrap_GetOpenDS), -1);
}

