/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 1.3.29
 * 
 * This file is not intended to be easily readable and contains a number of 
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG 
 * interface file instead. 
 * ----------------------------------------------------------------------------- */

#define SWIGPERL
#define SWIG_CASTRANK_MODE

#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)
#   if (__SUNPRO_CC <= 0x560)
#     define SWIGTEMPLATEDISAMBIGUATOR template
#   else
#     define SWIGTEMPLATEDISAMBIGUATOR 
#   endif
# else
#   define SWIGTEMPLATEDISAMBIGUATOR 
# endif
#endif

/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
#   define SWIGINLINE inline
# else
#   define SWIGINLINE
# endif
#endif

/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define SWIGUNUSED __attribute__ ((__unused__)) 
#   else
#     define SWIGUNUSED
#   endif
# elif defined(__ICC)
#   define SWIGUNUSED __attribute__ ((__unused__)) 
# else
#   define SWIGUNUSED 
# endif
#endif

#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
#   define SWIGUNUSEDPARM(p)
# else
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
# endif
#endif

/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif

/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif

/* exporting methods */
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#  ifndef GCC_HASCLASSVISIBILITY
#    define GCC_HASCLASSVISIBILITY
#  endif
#endif

#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#     define SWIGEXPORT __attribute__ ((visibility("default")))
#   else
#     define SWIGEXPORT
#   endif
# endif
#endif

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

/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
# define _CRT_SECURE_NO_DEPRECATE
#endif

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

/*  Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1

/* Flags for new pointer objects */
#define SWIG_POINTER_OWN           0x1


/* 
   Flags/methods for returning states.
   
   The swig conversion methods, as ConvertPtr, return and integer 
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).
   
   Use the following macros/flags to set or process the returning
   states.
   
   In old swig versions, you usually write code as:

     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
       // success code
     } else {
       //fail code
     }

   Now you can be more explicit as:

    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
    } else {
      // fail code
    }

   that seems to be the same, but now you can also do

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }
    
   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   requires also to SWIG_ConvertPtr to return new result values, as

      int SWIG_ConvertPtr(obj, ptr,...) {         
        if (<obj is ok>) {			       
          if (<need new object>) {		       
            *ptr = <ptr to new allocated object>; 
            return SWIG_NEWOBJ;		       
          } else {				       
            *ptr = <ptr to old object>;	       
            return SWIG_OLDOBJ;		       
          } 				       
        } else {				       
          return SWIG_BADOBJ;		       
        }					       
      }

   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
   swig errors code.

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows to return the 'cast rank', for example, if you have this

       int food(double)
       int fooi(int);

   and you call
 
      food(1)   // cast rank '1'  (1 -> 1.0)
      fooi(1)   // cast rank '0'

   just use the SWIG_AddCast()/SWIG_CheckState()


 */
#define SWIG_OK                    (0) 
#define SWIG_ERROR                 (-1)
#define SWIG_IsOK(r)               (r >= 0)
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  

/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT         (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ                (SWIG_ERROR)
#define SWIG_OLDOBJ                (SWIG_OK)
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))


/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
#  ifndef SWIG_TypeRank
#    define SWIG_TypeRank             unsigned long
#  endif
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
#    define SWIG_MAXCASTRANK          (2)
#  endif
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
}
#else /* no cast-rank mode */
#  define SWIG_AddCast
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#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 */
  int                    owndata;		/* flag if the structure owns the clientdata */
} swig_type_info;

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
  struct swig_cast_info  *prev;			/* pointer to the previous cast */
} swig_cast_info;

/* Structure used to store module information
 * Each module generates one structure like this, and the runtime collects
 * all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
  size_t                 size;		        /* Number of types in this module */
  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
  swig_type_info         **type_initial;	/* Array of initially generated type structures */
  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
  void                    *clientdata;		/* Language specific module data */
} swig_module_info;

/* 
  Compare two type names skipping the space characters, therefore
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.

  Return 0 when the two name types are equivalent, as in
  strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
		  const char *f2, const char *l2) {
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  }
  return (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) return NULL;
  if (type->str != NULL) {
    const char *last_name = type->str;
    const char *s;
    for (s = type->str; *s; s++)
      if (*s == '|') last_name = s+1;
    return last_name;
  }
  else
    return type->name;
}

/* 
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;
  
  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }    
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}
  
/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)
  
  We start searching at module start, and finish searching when start == end.  
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start, 
                            swig_module_info *end, 
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      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;
    if ((d >= '0') && (d <= '9'))
      uu = ((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = ((d - ('a'-10)) << 4);
    else 
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (d - ('a'-10));
    else 
      return (char *) 0;
    *u = uu;
  }
  return c;
}

/* 
   Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  char *r = buff;
  if ((2*sizeof(void *) + 2) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,&ptr,sizeof(void *));
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  strcpy(r,name);
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      *ptr = (void *) 0;
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
}

SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2*sz + 2 + lname) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  if (lname) {
    strncpy(r,name,lname+1);
  } else {
    *r = 0;
  }
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      memset(ptr,0,sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sz);
}

#ifdef __cplusplus
}
#endif

/*  Errors in SWIG */
#define  SWIG_UnknownError    	   -1 
#define  SWIG_IOError        	   -2 
#define  SWIG_RuntimeError   	   -3 
#define  SWIG_IndexError     	   -4 
#define  SWIG_TypeError      	   -5 
#define  SWIG_DivisionByZero 	   -6 
#define  SWIG_OverflowError  	   -7 
#define  SWIG_SyntaxError    	   -8 
#define  SWIG_ValueError     	   -9 
#define  SWIG_SystemError    	   -10
#define  SWIG_AttributeError 	   -11
#define  SWIG_MemoryError    	   -12 
#define  SWIG_NullReferenceError   -13



#ifdef __cplusplus
/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
#include <math.h>
#include <stdlib.h>
extern "C" {
#endif
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */

/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
#ifndef PERL_REVISION
#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
#    define PERL_PATCHLEVEL_H_IMPLICIT
#    include <patchlevel.h>
#  endif
#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
#    include <could_not_find_Perl_patchlevel.h>
#  endif
#  ifndef PERL_REVISION
#    define PERL_REVISION       (5)
#    define PERL_VERSION        PATCHLEVEL
#    define PERL_SUBVERSION     SUBVERSION
#  endif
#endif

#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
#endif

#ifndef SvIOK_UV
# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
#endif

#ifndef SvUOK
# define SvUOK(sv)           SvIOK_UV(sv)
#endif

#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
#  define PL_sv_undef               sv_undef
#  define PL_na	                    na
#  define PL_errgv                  errgv
#  define PL_sv_no                  sv_no
#  define PL_sv_yes                 sv_yes
#  define PL_markstack_ptr          markstack_ptr
#endif

#ifndef IVSIZE
#  ifdef LONGSIZE
#    define IVSIZE LONGSIZE
#  else
#    define IVSIZE 4 /* A bold guess, but the best we can make. */
#  endif
#endif

#ifndef INT2PTR
#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
#    define PTRV                  UV
#    define INT2PTR(any,d)        (any)(d)
#  else
#    if PTRSIZE == LONGSIZE
#      define PTRV                unsigned long
#    else
#      define PTRV                unsigned
#    endif
#    define INT2PTR(any,d)        (any)(PTRV)(d)
#  endif

#  define NUM2PTR(any,d)  (any)(PTRV)(d)
#  define PTR2IV(p)       INT2PTR(IV,p)
#  define PTR2UV(p)       INT2PTR(UV,p)
#  define PTR2NV(p)       NUM2PTR(NV,p)

#  if PTRSIZE == LONGSIZE
#    define PTR2ul(p)     (unsigned long)(p)
#  else
#    define PTR2ul(p)     INT2PTR(unsigned long,p)
#  endif
#endif /* !INT2PTR */

#ifndef get_sv
#  define get_sv perl_get_sv
#endif

#ifndef ERRSV
#  define ERRSV get_sv("@",FALSE)
#endif

#ifndef pTHX_
#define pTHX_
#endif   

#include <string.h>
#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------
 * error manipulation
 * ----------------------------------------------------------------------------- */

SWIGINTERN const char*
SWIG_Perl_ErrorType(int code) {
  const char* type = 0;
  switch(code) {
  case SWIG_MemoryError:
    type = "MemoryError";
    break;
  case SWIG_IOError:
    type = "IOError";
    break;
  case SWIG_RuntimeError:
    type = "RuntimeError";
    break;
  case SWIG_IndexError:
    type = "IndexError";
    break;
  case SWIG_TypeError:
    type = "TypeError";
    break;
  case SWIG_DivisionByZero:
    type = "ZeroDivisionError";
    break;
  case SWIG_OverflowError:
    type = "OverflowError";
    break;
  case SWIG_SyntaxError:
    type = "SyntaxError";
    break;
  case SWIG_ValueError:
    type = "ValueError";
    break;
  case SWIG_SystemError:
    type = "SystemError";
    break;
  case SWIG_AttributeError:
    type = "AttributeError";
    break;
  default:
    type = "RuntimeError";
  }
  return type;
}




/* -----------------------------------------------------------------------------
 * perlrun.swg
 *
 * This file contains the runtime support for Perl modules
 * and includes code for managing global variables and pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

#ifdef PERL_OBJECT
#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
#define SWIG_PERL_OBJECT_CALL pPerl,
#else
#define SWIG_PERL_OBJECT_DECL
#define SWIG_PERL_OBJECT_CALL
#endif

/* Common SWIG API */

/* for raw pointers */
#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)

/* for raw packed data */
#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
#define SWIG_NewPackedObj(p, s, type)	                SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)

/* for class or struct pointers */
#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)

/* for C or C++ function pointers */
#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)

/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)


/* Runtime API */

#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)


/* Error manipulation */

#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
#define SWIG_Error(code, msg)            		sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
#define SWIG_fail                        		goto fail						    

/* Perl-specific SWIG API */

#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
#define SWIG_MakePackedObj(sv, p, s, type)	        SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)


#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)

/* -----------------------------------------------------------------------------
 * pointers/data manipulation
 * ----------------------------------------------------------------------------- */

/* For backward compatibility only */
#define SWIG_POINTER_EXCEPTION  0

#ifdef __cplusplus
extern "C" {
#endif

#define SWIG_OWNER   SWIG_POINTER_OWN
#define SWIG_SHADOW  SWIG_OWNER << 1

#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL

/* SWIG Perl macros */

/* Macro to call an XS function */
#ifdef PERL_OBJECT 
#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
#else 
#  ifndef MULTIPLICITY 
#    define SWIG_CALLXS(_name) _name(cv) 
#  else 
#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
#  endif 
#endif 

/* Note: SwigMagicFuncHack is a typedef used to get the C++ compiler to just shut up already */

#ifdef PERL_OBJECT
#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);

#ifdef __cplusplus
extern "C" {
#endif
typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *);
#ifdef __cplusplus
}
#endif

#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
#define SWIGCLASS_STATIC
#else
#define MAGIC_PPERL
#define SWIGCLASS_STATIC static SWIGUNUSED
#ifndef MULTIPLICITY
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
typedef int (*SwigMagicFunc)(SV *, MAGIC *);

#ifdef __cplusplus
extern "C" {
#endif
typedef int (*SwigMagicFuncHack)(SV *, MAGIC *);
#ifdef __cplusplus
}
#endif


#else
#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *);
#ifdef __cplusplus
}
#endif

#endif
#endif

/* Workaround for bug in perl 5.6.x croak and earlier */
#if (PERL_VERSION < 8)
#  ifdef PERL_OBJECT
#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
static void SWIG_Perl_croak_null(CPerlObj *pPerl)
#  else
static void SWIG_croak_null()
#  endif
{
  SV *err=ERRSV;
#  if (PERL_VERSION < 6)
  croak("%_", err);
#  else
  if (SvOK(err) && !SvROK(err)) croak("%_", err);
  croak(Nullch);
#  endif
}
#else
#  define SWIG_croak_null() croak(Nullch)
#endif



#include <stdlib.h>

SWIGRUNTIME const char *
SWIG_Perl_TypeProxyName(const swig_type_info *type) {
  if (!type) return NULL;
  if (type->clientdata != NULL) {
    return (const char*) type->clientdata;
  } 
  else {
    return type->name;
  }
}

SWIGRUNTIME swig_cast_info *
SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
  SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0)) 
			    || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
}


/* Function for getting a pointer value */

SWIGRUNTIME int
SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
  swig_cast_info *tc;
  void *voidptr = (void *)0;
  SV *tsv = 0;
  /* If magical, apply more magic */
  if (SvGMAGICAL(sv))
    mg_get(sv);

  /* Check to see if this is an object */
  if (sv_isobject(sv)) {
    IV tmp = 0;
    tsv = (SV*) SvRV(sv);
    if ((SvTYPE(tsv) == SVt_PVHV)) {
      MAGIC *mg;
      if (SvMAGICAL(tsv)) {
        mg = mg_find(tsv,'P');
        if (mg) {
          sv = mg->mg_obj;
          if (sv_isobject(sv)) {
	    tsv = (SV*)SvRV(sv);
            tmp = SvIV(tsv);
          }
        }
      } else {
        return SWIG_ERROR;
      }
    } else {
      tmp = SvIV(tsv);
    }
    voidptr = INT2PTR(void *,tmp);
  } else if (! SvOK(sv)) {            /* Check for undef */
    *(ptr) = (void *) 0;
    return SWIG_OK;
  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
    if (!SvROK(sv)) {
      *(ptr) = (void *) 0;
      return SWIG_OK;
    } else {
      return SWIG_ERROR;
    }
  } else {                            /* Don't know what it is */
    return SWIG_ERROR;
  }
  if (_t) {
    /* Now see if the types match */
    char *_c = HvNAME(SvSTASH(SvRV(sv)));
    tc = SWIG_TypeProxyCheck(_c,_t);
    if (!tc) {
      return SWIG_ERROR;
    }
    *ptr = SWIG_TypeCast(tc,voidptr);
  } else {
    *ptr = voidptr;
  }

  /* 
   *  DISOWN implementation: we need a perl guru to check this one.
   */
  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
    /* 
     *  almost copy paste code from below SWIG_POINTER_OWN setting
     */
    SV *obj = sv;
    HV *stash = SvSTASH(SvRV(obj));
    GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
    if (isGV(gv)) {
      HV *hv = GvHVn(gv);
      /*
       * To set ownership (see below), a newSViv(1) entry is added. 
       * Hence, to remove ownership, we delete the entry.
       */
      if (hv_exists_ent(hv, obj, 0)) {
	hv_delete_ent(hv, obj, 0, 0);
      }
    }
  }
  return SWIG_OK;
}

SWIGRUNTIME void
SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
  if (ptr && (flags & SWIG_SHADOW)) {
    SV *self;
    SV *obj=newSV(0);
    HV *hash=newHV();
    HV *stash;
    sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
    stash=SvSTASH(SvRV(obj));
    if (flags & SWIG_POINTER_OWN) {
      HV *hv;
      GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
      if (!isGV(gv))
        gv_init(gv, stash, "OWNER", 5, FALSE);
      hv=GvHVn(gv);
      hv_store_ent(hv, obj, newSViv(1), 0);
    }
    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
    SvREFCNT_dec(obj);
    self=newRV_noinc((SV *)hash);
    sv_setsv(sv, self);
    SvREFCNT_dec((SV *)self);
    sv_bless(sv, stash);
  }
  else {
    sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
  }
}

SWIGRUNTIMEINLINE SV *
SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
  SV *result = sv_newmortal();
  SWIG_MakePtr(result, ptr, t, flags);
  return result;
}

SWIGRUNTIME void
SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
  char result[1024];
  char *r = result;
  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  strcpy(r,SWIG_Perl_TypeProxyName(type));
  sv_setpv(sv, result);
}

SWIGRUNTIME SV *
SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
  SV *result = sv_newmortal();
  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
  return result;
}

/* Convert a packed value value */
SWIGRUNTIME int
SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
  swig_cast_info *tc;
  const char  *c = 0;

  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
  c = SvPV(obj, PL_na);
  /* Pointer values must start with leading underscore */
  if (*c != '_') return SWIG_ERROR;
  c++;
  c = SWIG_UnpackData(c,ptr,sz);
  if (ty) {
    tc = SWIG_TypeCheck(c,ty);
    if (!tc) return SWIG_ERROR;
  }
  return SWIG_OK;
}


/* Macros for low-level exception handling */
#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }


typedef XS(SwigPerlWrapper);
typedef SwigPerlWrapper *SwigPerlWrapperPtr;

/* Structure for command table */
typedef struct {
  const char         *name;
  SwigPerlWrapperPtr  wrapper;
} swig_command_info;

/* Information for constant table */

#define SWIG_INT     1
#define SWIG_FLOAT   2
#define SWIG_STRING  3
#define SWIG_POINTER 4
#define SWIG_BINARY  5

/* Constant information structure */
typedef struct swig_constant_info {
    int              type;
    const char      *name;
    long             lvalue;
    double           dvalue;
    void            *pvalue;
    swig_type_info **ptype;
} swig_constant_info;


/* Structure for variable table */
typedef struct {
  const char   *name;
  SwigMagicFunc   set;
  SwigMagicFunc   get;
  swig_type_info  **type;
} swig_variable_info;

/* Magic variable code */
#ifndef PERL_OBJECT
#define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
  #ifndef MULTIPLICITY
     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
  #else
     SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
  #endif
#else
#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
#endif
{
  MAGIC *mg;
  sv_magic(sv,sv,'U',(char *) name,strlen(name));
  mg = mg_find(sv,'U');
  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
  mg->mg_virtual->svt_get = (SwigMagicFuncHack) get;
  mg->mg_virtual->svt_set = (SwigMagicFuncHack) set;
  mg->mg_virtual->svt_len = 0;
  mg->mg_virtual->svt_clear = 0;
  mg->mg_virtual->svt_free = 0;
}


SWIGRUNTIME swig_module_info *
SWIG_Perl_GetModule(void) {
  static void *type_pointer = (void *)0;
  SV *pointer;

  /* first check if pointer already created */
  if (!type_pointer) {
    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
    if (pointer && SvOK(pointer)) {
      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
    }
  }

  return (swig_module_info *) type_pointer;
}

SWIGRUNTIME void
SWIG_Perl_SetModule(swig_module_info *module) {
  SV *pointer;

  /* create a new pointer */
  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
  sv_setiv(pointer, PTR2IV(module));
}

#ifdef __cplusplus
}
#endif

/* Workaround perl5 global namespace pollution. Note that undefining library
 * functions like fopen will not solve the problem on all platforms as fopen
 * might be a macro on Windows but not necessarily on other operating systems. */
#ifdef do_open
  #undef do_open
#endif
#ifdef do_close
  #undef do_close
#endif
#ifdef scalar
  #undef scalar
#endif
#ifdef list
  #undef list
#endif
#ifdef apply
  #undef apply
#endif
#ifdef convert
  #undef convert
#endif
#ifdef Error
  #undef Error
#endif
#ifdef form
  #undef form
#endif
#ifdef vform
  #undef vform
#endif
#ifdef LABEL
  #undef LABEL
#endif
#ifdef METHOD
  #undef METHOD
#endif
#ifdef Move
  #undef Move
#endif
#ifdef yylex
  #undef yylex
#endif
#ifdef yyparse
  #undef yyparse
#endif
#ifdef yyerror
  #undef yyerror
#endif
#ifdef invert
  #undef invert
#endif
#ifdef ref
  #undef ref
#endif
#ifdef read
  #undef read
#endif
#ifdef write
  #undef write
#endif
#ifdef eof
  #undef eof
#endif
#ifdef bool
  #undef bool
#endif
#ifdef close
  #undef close
#endif
#ifdef rewind
  #undef rewind
#endif
#ifdef free
  #undef free
#endif
#ifdef malloc
  #undef malloc
#endif
#ifdef calloc
  #undef calloc
#endif
#ifdef Stat
  #undef Stat
#endif
#ifdef check
  #undef check
#endif
#ifdef seekdir
  #undef seekdir
#endif
#ifdef open
  #undef open
#endif



#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 

#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 



  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0) 


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

#define SWIGTYPE_p_OGRDataSourceShadow swig_types[0]
#define SWIGTYPE_p_OGRDriverShadow swig_types[1]
#define SWIGTYPE_p_OGRFeatureDefnShadow swig_types[2]
#define SWIGTYPE_p_OGRFeatureShadow swig_types[3]
#define SWIGTYPE_p_OGRFieldDefnShadow swig_types[4]
#define SWIGTYPE_p_OGRGeometryShadow swig_types[5]
#define SWIGTYPE_p_OGRLayerShadow swig_types[6]
#define SWIGTYPE_p_OSRCoordinateTransformationShadow swig_types[7]
#define SWIGTYPE_p_OSRSpatialReferenceShadow swig_types[8]
#define SWIGTYPE_p_char 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]
static swig_type_info *swig_types[14];
static swig_module_info swig_module = {swig_types, 13, 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    boot_Geo__OGR

#define SWIG_name   "Geo::OGRc::boot_Geo__OGR"
#define SWIG_prefix "Geo::OGRc::"

#define SWIGVERSION 0x010329 


#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 


#include <stdexcept>


#ifdef __cplusplus
extern "C"
#endif
#ifndef PERL_OBJECT
#ifndef MULTIPLICITY
SWIGEXPORT void SWIG_init (CV* cv);
#else
SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
#endif
#else
SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
#endif


#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;


SWIGINTERNINLINE SV *
SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
{    
  SV *obj = sv_newmortal();
  sv_setiv(obj, (IV) value);
  return obj;
}


SWIGINTERNINLINE SV *
SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
{    
  return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
}


SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
{
  SV *obj = sv_newmortal();
  if (size && carray) {
    if (carray[size - 1] == 0) {
      sv_setpv(obj, carray);
    } else {
      char *tmp = (new char[size + 1]);
      memcpy(tmp, carray, size);
      tmp[size] = 0;
      sv_setpv(obj, tmp);
      delete[] tmp;
    }
  } else {
    sv_setsv(obj, &PL_sv_undef);
  }
  return obj;
}


SWIGINTERNINLINE SV * 
SWIG_FromCharPtr(const char *cptr)
{ 
  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
}


void VeryQuiteErrorHandler(CPLErr eclass, int code, const char *msg ) {
  /* If the error class is CE_Fatal, we want to have a message issued
     because the CPL support code does an abort() before any exception
     can be generated */
  if (eclass == CE_Fatal ) {
    CPLDefaultErrorHandler(eclass, code, msg );
  }
}


void UseExceptions() {
  CPLSetErrorHandler( (CPLErrorHandler) VeryQuiteErrorHandler );
}

void DontUseExceptions() {
  CPLSetErrorHandler( CPLDefaultErrorHandler );
}


SWIGINTERN swig_type_info*
SWIG_pchar_descriptor()
{
  static int init = 0;
  static swig_type_info* info = 0;
  if (!init) {
    info = SWIG_TypeQuery("_p_char");
    init = 1;
  }
  return info;
}


SWIGINTERN int
SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
{
  if (SvPOK(obj)) {
    STRLEN len = 0;
    char *cstr = SvPV(obj, len); 
    size_t size = len + 1;
    if (cptr)  {
      if (alloc) {
	if (*alloc == SWIG_NEWOBJ) {
	  *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
	} else {
	  *cptr = cstr;
	  *alloc = SWIG_OLDOBJ;
	}
      }
    }
    if (psize) *psize = size;
    return SWIG_OK;
  } else {
    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
    if (pchar_descriptor) {
      char* vptr = 0; 
      if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
	if (cptr) *cptr = vptr;
	if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
	if (alloc) *alloc = SWIG_OLDOBJ;
	return SWIG_OK;
      }
    }
  }
  return SWIG_TypeError;
}




SWIGINTERN OGRDataSourceShadow *OGRDriverShadow_CreateDataSource(OGRDriverShadow *self,char const *name,char **options=0){
    OGRDataSourceShadow *ds = (OGRDataSourceShadow*) OGR_Dr_CreateDataSource( self, name, options);
    return ds;
  }
SWIGINTERN 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;
  }

#include <limits.h>
#ifndef LLONG_MIN
# define LLONG_MIN	LONG_LONG_MIN
#endif
#ifndef LLONG_MAX
# define LLONG_MAX	LONG_LONG_MAX
#endif
#ifndef ULLONG_MAX
# define ULLONG_MAX	ULONG_LONG_MAX
#endif


SWIGINTERN int
SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
{
  if (SvNIOK(obj)) {
    if (val) *val = SvNV(obj);
    return SWIG_OK;
  } else if (SvIOK(obj)) {
    if (val) *val = (double) SvIV(obj);
    return SWIG_AddCast(SWIG_OK);
  } else {
    const char *nptr = SvPV(obj, PL_na);
    if (nptr) {
      char *endptr;
      double v = strtod(nptr, &endptr);
      if (errno == ERANGE) {
	errno = 0;
	return SWIG_OverflowError;
      } else {
	if (*endptr == '\0') {
	  if (val) *val = v;
	  return SWIG_AddCast(SWIG_OK);
	}
      }
    }
  }
  return SWIG_TypeError;
}


#include <float.h>


#include <math.h>


SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double *d, double min, double max) {
  double x = *d;
  if ((min <= x && x <= max)) {
   double fx = floor(x);
   double cx = ceil(x);
   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
   if ((errno == EDOM) || (errno == ERANGE)) {
     errno = 0;
   } else {
     double summ, reps, diff;
     if (rd < x) {
       diff = x - rd;
     } else if (rd > x) {
       diff = rd - x;
     } else {
       return 1;
     }
     summ = rd + x;
     reps = diff/summ;
     if (reps < 8*DBL_EPSILON) {
       *d = rd;
       return 1;
     }
   }
  }
  return 0;
}


SWIGINTERN int
SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
{
  if (SvIOK(obj)) {
    if (val) *val = SvIV(obj);
    return SWIG_OK;
  } else {
    int dispatch = 0;
    const char *nptr = SvPV(obj, PL_na);
    if (nptr) {
      char *endptr;
      long v = strtol(nptr, &endptr,0);
      if (errno == ERANGE) {
	errno = 0;
	return SWIG_OverflowError;
      } else {
	if (*endptr == '\0') {
	  if (val) *val = v;
	  return SWIG_AddCast(SWIG_OK);
	}
      }
    }
    if (!dispatch) {
      double d;
      int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
	if (val) *val = (long)(d);
	return res;
      }
    }
  }
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
{
  long v;
  int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
  if (SWIG_IsOK(res)) {
    if ((v < INT_MIN || v > INT_MAX)) {
      return SWIG_OverflowError;
    } else {
      if (val) *val = static_cast< int >(v);
    }
  }  
  return res;
}

SWIGINTERN OGRDataSourceShadow *OGRDriverShadow_Open(OGRDriverShadow *self,char const *name,int update=0){
    OGRDataSourceShadow* ds = (OGRDataSourceShadow*) OGR_Dr_Open(self, name, update);
    return ds;
  }
SWIGINTERN int OGRDriverShadow_DeleteDataSource(OGRDriverShadow *self,char const *name){
    return OGR_Dr_DeleteDataSource( self, name );
  }
SWIGINTERN bool OGRDriverShadow_TestCapability(OGRDriverShadow *self,char const *cap){
    return OGR_Dr_TestCapability(self, cap);
  }

SWIGINTERNINLINE SV *
SWIG_From_bool  SWIG_PERL_DECL_ARGS_1(bool value)
{    
  SV *obj = sv_newmortal();
  if (value) {
    sv_setsv(obj, &PL_sv_yes);
  } else {
    sv_setsv(obj, &PL_sv_no); 
  }
  return obj;
}

SWIGINTERN char const *OGRDriverShadow_GetName(OGRDriverShadow *self){
    return OGR_Dr_GetName( self );
  }
SWIGINTERN void delete_OGRDataSourceShadow(OGRDataSourceShadow *self){
    OGRReleaseDataSource(self);
  }
SWIGINTERN int OGRDataSourceShadow_GetRefCount(OGRDataSourceShadow *self){
    return OGR_DS_GetRefCount(self);
  }
SWIGINTERN int OGRDataSourceShadow_GetSummaryRefCount(OGRDataSourceShadow *self){
    return OGR_DS_GetSummaryRefCount(self);
  }
SWIGINTERN int OGRDataSourceShadow_GetLayerCount(OGRDataSourceShadow *self){
    return OGR_DS_GetLayerCount(self);
  }
SWIGINTERN OGRDriverShadow *OGRDataSourceShadow_GetDriver(OGRDataSourceShadow *self){
    OGRDriverShadow* driver;
    OGRDataSourceShadow* ds;
    ds = (OGRDataSourceShadow*)OGROpen((const char *) OGR_DS_GetName(self),0,&driver);
    OGRReleaseDataSource(ds);
    return driver;
  }
SWIGINTERN char const *OGRDataSourceShadow_GetName(OGRDataSourceShadow *self){
    return OGR_DS_GetName(self);
  }
SWIGINTERN OGRErr OGRDataSourceShadow_DeleteLayer(OGRDataSourceShadow *self,int index){
    return OGR_DS_DeleteLayer(self, index);
  }


static char const *
OGRErrMessages( int rc ) {
  switch( rc ) {
  case 0:
    return "OGR Error: None";
  case 1:
    return "OGR Error: Not enough data";
  case 2:
    return "OGR Error: Not enough memory";
  case 3:
    return "OGR Error: Unsupported geometry type";
  case 4:
    return "OGR Error: Unsupported operation";
  case 5:
    return "OGR Error: Corrupt data";
  case 6:
    return "OGR Error: General Error";
  case 7:
    return "OGR Error: Unsupported SRS";
  default:
    return "OGR Error: Unknown";
  }
}

SWIGINTERN 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;
  }
SWIGINTERN OGRLayerShadow *OGRDataSourceShadow_CopyLayer(OGRDataSourceShadow *self,OGRLayerShadow *src_layer,char const *new_name,char **options=0){
    OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_CopyLayer( self,
                                                      src_layer,
                                                      new_name,
                                                      options);
    return layer;
  }
SWIGINTERN OGRLayerShadow *OGRDataSourceShadow_GetLayerByIndex(OGRDataSourceShadow *self,int index=0){
    OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_GetLayer(self, index);
    return layer;
  }
SWIGINTERN OGRLayerShadow *OGRDataSourceShadow_GetLayerByName(OGRDataSourceShadow *self,char const *layer_name){
    OGRLayerShadow* layer = (OGRLayerShadow*) OGR_DS_GetLayerByName(self, layer_name);
    return layer;
  }
SWIGINTERN bool OGRDataSourceShadow_TestCapability(OGRDataSourceShadow *self,char const *cap){
    return OGR_DS_TestCapability(self, cap);
  }
SWIGINTERN 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;
  }
SWIGINTERN void OGRDataSourceShadow_ReleaseResultSet(OGRDataSourceShadow *self,OGRLayerShadow *layer){
    OGR_DS_ReleaseResultSet(self, layer);
  }
SWIGINTERN int OGRLayerShadow_GetRefCount(OGRLayerShadow *self){
    return OGR_L_GetRefCount(self);
  }
SWIGINTERN void OGRLayerShadow_SetSpatialFilter(OGRLayerShadow *self,OGRGeometryShadow *filter){
    OGR_L_SetSpatialFilter (self, filter);
  }
SWIGINTERN void OGRLayerShadow_SetSpatialFilterRect(OGRLayerShadow *self,double minx,double miny,double maxx,double maxy){
    OGR_L_SetSpatialFilterRect(self, minx, miny, maxx, maxy);                          
  }
SWIGINTERN OGRGeometryShadow *OGRLayerShadow_GetSpatialFilter(OGRLayerShadow *self){
    return (OGRGeometryShadow *) OGR_L_GetSpatialFilter(self);
  }
SWIGINTERN OGRErr OGRLayerShadow_SetAttributeFilter(OGRLayerShadow *self,char *filter_string){
    return OGR_L_SetAttributeFilter((OGRLayerShadow*)self, filter_string);
  }
SWIGINTERN void OGRLayerShadow_ResetReading(OGRLayerShadow *self){
    OGR_L_ResetReading(self);
  }
SWIGINTERN char const *OGRLayerShadow_GetName(OGRLayerShadow *self){
    return OGR_FD_GetName(OGR_L_GetLayerDefn(self));
  }
SWIGINTERN OGRFeatureShadow *OGRLayerShadow_GetFeature(OGRLayerShadow *self,long fid){
    return (OGRFeatureShadow*) OGR_L_GetFeature(self, fid);
  }
SWIGINTERN OGRFeatureShadow *OGRLayerShadow_GetNextFeature(OGRLayerShadow *self){
    return (OGRFeatureShadow*) OGR_L_GetNextFeature(self);
  }
SWIGINTERN OGRErr OGRLayerShadow_SetNextByIndex(OGRLayerShadow *self,long new_index){
    return OGR_L_SetNextByIndex(self, new_index);
  }
SWIGINTERN OGRErr OGRLayerShadow_SetFeature(OGRLayerShadow *self,OGRFeatureShadow *feature){
    return OGR_L_SetFeature(self, feature);
  }
SWIGINTERN OGRErr OGRLayerShadow_CreateFeature(OGRLayerShadow *self,OGRFeatureShadow *feature){
    return OGR_L_CreateFeature(self, feature);
  }
SWIGINTERN OGRErr OGRLayerShadow_DeleteFeature(OGRLayerShadow *self,long fid){
    return OGR_L_DeleteFeature(self, fid);
  }
SWIGINTERN OGRErr OGRLayerShadow_SyncToDisk(OGRLayerShadow *self){
    return OGR_L_SyncToDisk(self);
  }
SWIGINTERN OGRFeatureDefnShadow *OGRLayerShadow_GetLayerDefn(OGRLayerShadow *self){
    return (OGRFeatureDefnShadow*) OGR_L_GetLayerDefn(self);
  }
SWIGINTERN int OGRLayerShadow_GetFeatureCount(OGRLayerShadow *self,int force=1){
    return OGR_L_GetFeatureCount(self, force);
  }

static SV *
CreateArrayFromDoubleArray( double *first, unsigned int size ) {
  AV *av = (AV*)sv_2mortal((SV*)newAV());
  for( unsigned int i=0; i<size; i++ ) {
    av_store(av,i,newSVnv(*first));
    ++first;
  }
  return newRV_noinc((SV*)av);
}

SWIGINTERN OGRErr OGRLayerShadow_GetExtent(OGRLayerShadow *self,double argout[4],int force=1){
    return OGR_L_GetExtent(self, (OGREnvelope*)argout, force);
  }
SWIGINTERN bool OGRLayerShadow_TestCapability(OGRLayerShadow *self,char const *cap){
    return OGR_L_TestCapability(self, cap);
  }
SWIGINTERN OGRErr OGRLayerShadow_CreateField(OGRLayerShadow *self,OGRFieldDefnShadow *field_def,int approx_ok=1){
    return OGR_L_CreateField(self, field_def, approx_ok);
  }
SWIGINTERN OGRErr OGRLayerShadow_StartTransaction(OGRLayerShadow *self){
    return OGR_L_StartTransaction(self);
  }
SWIGINTERN OGRErr OGRLayerShadow_CommitTransaction(OGRLayerShadow *self){
    return OGR_L_CommitTransaction(self);
  }
SWIGINTERN OGRErr OGRLayerShadow_RollbackTransaction(OGRLayerShadow *self){
    return OGR_L_RollbackTransaction(self);
  }
SWIGINTERN OSRSpatialReferenceShadow *OGRLayerShadow_GetSpatialRef(OGRLayerShadow *self){
    return (OSRSpatialReferenceShadow*) OGR_L_GetSpatialRef(self);
  }
SWIGINTERN GIntBig OGRLayerShadow_GetFeatureRead(OGRLayerShadow *self){
    return OGR_L_GetFeaturesRead(self);
  }
SWIGINTERN void delete_OGRFeatureShadow(OGRFeatureShadow *self){
    OGR_F_Destroy(self);
  }
SWIGINTERN OGRFeatureShadow *new_OGRFeatureShadow(OGRFeatureDefnShadow *feature_def=0){
    return (OGRFeatureShadow*) OGR_F_Create( feature_def );
  }
SWIGINTERN OGRFeatureDefnShadow *OGRFeatureShadow_GetDefnRef(OGRFeatureShadow *self){
    return (OGRFeatureDefnShadow*) OGR_F_GetDefnRef(self);
  }
SWIGINTERN OGRErr OGRFeatureShadow_SetGeometry(OGRFeatureShadow *self,OGRGeometryShadow *geom){
    return OGR_F_SetGeometry(self, geom);
  }
SWIGINTERN OGRErr OGRFeatureShadow_SetGeometryDirectly(OGRFeatureShadow *self,OGRGeometryShadow *geom){
    return OGR_F_SetGeometryDirectly(self, geom);
  }
SWIGINTERN OGRGeometryShadow *OGRFeatureShadow_GetGeometryRef(OGRFeatureShadow *self){
    return (OGRGeometryShadow*) OGR_F_GetGeometryRef(self);
  }
SWIGINTERN OGRFeatureShadow *OGRFeatureShadow_Clone(OGRFeatureShadow *self){
    return (OGRFeatureShadow*) OGR_F_Clone(self);
  }
SWIGINTERN bool OGRFeatureShadow_Equal(OGRFeatureShadow *self,OGRFeatureShadow *feature){
    return OGR_F_Equal(self, feature);
  }
SWIGINTERN int OGRFeatureShadow_GetFieldCount(OGRFeatureShadow *self){
    return OGR_F_GetFieldCount(self);
  }
SWIGINTERN OGRFieldDefnShadow *OGRFeatureShadow_GetFieldDefnRef__SWIG_0(OGRFeatureShadow *self,int id){
    return (OGRFieldDefnShadow *) OGR_F_GetFieldDefnRef(self, id);
  }
SWIGINTERN OGRFieldDefnShadow *OGRFeatureShadow_GetFieldDefnRef__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in GetFieldDefnRef");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            return (OGRFieldDefnShadow *) OGR_F_GetFieldDefnRef(self, i);
    }
    return NULL;
  }
SWIGINTERN char const *OGRFeatureShadow_GetFieldAsString__SWIG_0(OGRFeatureShadow *self,int id){
    return (const char *) OGR_F_GetFieldAsString(self, id);
  }
SWIGINTERN char const *OGRFeatureShadow_GetFieldAsString__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in GetFieldAsString");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            return (const char *) OGR_F_GetFieldAsString(self, i);
    }
    return NULL;
  }
SWIGINTERN int OGRFeatureShadow_GetFieldAsInteger__SWIG_0(OGRFeatureShadow *self,int id){
    return OGR_F_GetFieldAsInteger(self, id);
  }
SWIGINTERN int OGRFeatureShadow_GetFieldAsInteger__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in GetFieldAsInteger");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            return OGR_F_GetFieldAsInteger(self, i);
    }
    return 0;
  }
SWIGINTERN double OGRFeatureShadow_GetFieldAsDouble__SWIG_0(OGRFeatureShadow *self,int id){
    return OGR_F_GetFieldAsDouble(self, id);
  }

SWIGINTERNINLINE SV *
SWIG_From_double  SWIG_PERL_DECL_ARGS_1(double value)
{    
  SV *obj = sv_newmortal();
  sv_setnv(obj, value);
  return obj;
}

SWIGINTERN double OGRFeatureShadow_GetFieldAsDouble__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in GetFieldAsDouble");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            return OGR_F_GetFieldAsDouble(self, i);
    }
    return 0;
  }
SWIGINTERN bool OGRFeatureShadow_IsFieldSet__SWIG_0(OGRFeatureShadow *self,int id){
    return OGR_F_IsFieldSet(self, id);
  }
SWIGINTERN bool OGRFeatureShadow_IsFieldSet__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in IsFieldSet");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            return OGR_F_IsFieldSet(self, i);
    }
    return (bool)0;
  }
SWIGINTERN int OGRFeatureShadow_GetFieldIndex(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in GetFieldIndex");
    else
        return OGR_F_GetFieldIndex(self, name);
    return 0;
  }
SWIGINTERN int OGRFeatureShadow_GetFID(OGRFeatureShadow *self){
    return OGR_F_GetFID(self);
  }
SWIGINTERN OGRErr OGRFeatureShadow_SetFID(OGRFeatureShadow *self,int fid){
    return OGR_F_SetFID(self, fid);
  }
SWIGINTERN void OGRFeatureShadow_DumpReadable(OGRFeatureShadow *self){
    OGR_F_DumpReadable(self, NULL);
  }
SWIGINTERN void OGRFeatureShadow_UnsetField__SWIG_0(OGRFeatureShadow *self,int id){
    OGR_F_UnsetField(self, id);
  }
SWIGINTERN void OGRFeatureShadow_UnsetField__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in UnsetField");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            OGR_F_UnsetField(self, i);
    }
  }
SWIGINTERN void OGRFeatureShadow_SetField__SWIG_0(OGRFeatureShadow *self,int id,char const *value){
    OGR_F_SetFieldString(self, id, value);
  }
SWIGINTERN void OGRFeatureShadow_SetField__SWIG_1(OGRFeatureShadow *self,char const *name,char const *value){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in SetField");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            OGR_F_SetFieldString(self, i, value);
    }
  }
SWIGINTERN OGRErr OGRFeatureShadow_SetFrom(OGRFeatureShadow *self,OGRFeatureShadow *other,int forgiving=1){
    return OGR_F_SetFrom(self, other, forgiving);
  }
SWIGINTERN char const *OGRFeatureShadow_GetStyleString(OGRFeatureShadow *self){
    return (const char*) OGR_F_GetStyleString(self);
  }
SWIGINTERN void OGRFeatureShadow_SetStyleString(OGRFeatureShadow *self,char const *the_string){
    OGR_F_SetStyleString(self, the_string);
  }
SWIGINTERN OGRFieldType OGRFeatureShadow_GetFieldType__SWIG_0(OGRFeatureShadow *self,int id){
    return (OGRFieldType) OGR_Fld_GetType( OGR_F_GetFieldDefnRef( self, id));
  }
SWIGINTERN OGRFieldType OGRFeatureShadow_GetFieldType__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL) {
        CPLError(CE_Failure, 1, "Undefined field name in GetFieldType");
	return (OGRFieldType)0;
    } else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1) {
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
            return (OGRFieldType)0;
        } else
            return (OGRFieldType) OGR_Fld_GetType( 
                            OGR_F_GetFieldDefnRef( self,  i )
                                          );
    }
  }
SWIGINTERN char const *OGRFeatureShadow_GetField__SWIG_0(OGRFeatureShadow *self,int id){
    return (const char *) OGR_F_GetFieldAsString(self, id);
  }
SWIGINTERN char const *OGRFeatureShadow_GetField__SWIG_1(OGRFeatureShadow *self,char const *name){
    if (name == NULL)
        CPLError(CE_Failure, 1, "Undefined field name in GetField");
    else {
        int i = OGR_F_GetFieldIndex(self, name);
        if (i == -1)
            CPLError(CE_Failure, 1, "No such field: '%s'", name);
        else
            return (const char *) OGR_F_GetFieldAsString(self, i);
    }
    return NULL;
  }
SWIGINTERN void delete_OGRFeatureDefnShadow(OGRFeatureDefnShadow *self){
    OGR_FD_Destroy(self);
  }
SWIGINTERN OGRFeatureDefnShadow *new_OGRFeatureDefnShadow(char const *name=NULL){
    return (OGRFeatureDefnShadow* )OGR_FD_Create(name);
  }
SWIGINTERN char const *OGRFeatureDefnShadow_GetName(OGRFeatureDefnShadow *self){
    return OGR_FD_GetName(self);
  }
SWIGINTERN int OGRFeatureDefnShadow_GetFieldCount(OGRFeatureDefnShadow *self){
    return OGR_FD_GetFieldCount(self);
  }
SWIGINTERN OGRFieldDefnShadow *OGRFeatureDefnShadow_GetFieldDefn(OGRFeatureDefnShadow *self,int i){
    return (OGRFieldDefnShadow*) OGR_FD_GetFieldDefn(self, i);
  }
SWIGINTERN int OGRFeatureDefnShadow_GetFieldIndex(OGRFeatureDefnShadow *self,char const *name){
    if (name == NULL) {
        CPLError(CE_Failure, 1, "Undefined field name in GetFieldIndex");
	return 0;
    } else
	return OGR_FD_GetFieldIndex(self, name);
  }
SWIGINTERN void OGRFeatureDefnShadow_AddFieldDefn(OGRFeatureDefnShadow *self,OGRFieldDefnShadow *defn){
    OGR_FD_AddFieldDefn(self, defn);
  }
SWIGINTERN OGRwkbGeometryType OGRFeatureDefnShadow_GetGeomType(OGRFeatureDefnShadow *self){
    return (OGRwkbGeometryType) OGR_FD_GetGeomType(self);
  }
SWIGINTERN void OGRFeatureDefnShadow_SetGeomType(OGRFeatureDefnShadow *self,OGRwkbGeometryType geom_type){
    OGR_FD_SetGeomType(self, geom_type);
  }
SWIGINTERN int OGRFeatureDefnShadow_GetReferenceCount(OGRFeatureDefnShadow *self){
    return OGR_FD_GetReferenceCount(self);
  }
SWIGINTERN void delete_OGRFieldDefnShadow(OGRFieldDefnShadow *self){
    OGR_Fld_Destroy(self);
  }
SWIGINTERN OGRFieldDefnShadow *new_OGRFieldDefnShadow(char const *name="unnamed",OGRFieldType field_type=OFTString){
    return (OGRFieldDefnShadow*) OGR_Fld_Create(name, field_type);
  }
SWIGINTERN char const *OGRFieldDefnShadow_GetName(OGRFieldDefnShadow *self){
    return (const char *) OGR_Fld_GetNameRef(self);
  }
SWIGINTERN char const *OGRFieldDefnShadow_GetNameRef(OGRFieldDefnShadow *self){
    return (const char *) OGR_Fld_GetNameRef(self);
  }
SWIGINTERN void OGRFieldDefnShadow_SetName(OGRFieldDefnShadow *self,char const *name){
    OGR_Fld_SetName(self, name);
  }
SWIGINTERN OGRFieldType OGRFieldDefnShadow_GetType(OGRFieldDefnShadow *self){
    return OGR_Fld_GetType(self);
  }
SWIGINTERN void OGRFieldDefnShadow_SetType(OGRFieldDefnShadow *self,OGRFieldType type){
    OGR_Fld_SetType(self, type);
  }
SWIGINTERN OGRJustification OGRFieldDefnShadow_GetJustify(OGRFieldDefnShadow *self){
    return OGR_Fld_GetJustify(self);
  }
SWIGINTERN void OGRFieldDefnShadow_SetJustify(OGRFieldDefnShadow *self,OGRJustification justify){
    OGR_Fld_SetJustify(self, justify);
  }
SWIGINTERN int OGRFieldDefnShadow_GetWidth(OGRFieldDefnShadow *self){
    return OGR_Fld_GetWidth(self);
  }
SWIGINTERN void OGRFieldDefnShadow_SetWidth(OGRFieldDefnShadow *self,int width){
    OGR_Fld_SetWidth(self, width);
  }
SWIGINTERN int OGRFieldDefnShadow_GetPrecision(OGRFieldDefnShadow *self){
    return OGR_Fld_GetPrecision(self);
  }
SWIGINTERN void OGRFieldDefnShadow_SetPrecision(OGRFieldDefnShadow *self,int precision){
    OGR_Fld_SetPrecision(self, precision);
  }
SWIGINTERN char const *OGRFieldDefnShadow_GetFieldTypeName(OGRFieldDefnShadow *self,OGRFieldType type){
    return OGR_GetFieldTypeName(type);
  }

  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 ) {
       CPLError(CE_Failure, err, "%s", OGRErrMessages(err));
       return NULL;
    }
    return (OGRGeometryShadow*) geom;
  }
 


  OGRGeometryShadow* CreateGeometryFromWkt( char **val, 
                                      OSRSpatialReferenceShadow *reference=NULL ) {
    void *geom;
    OGRErr err = OGR_G_CreateFromWkt(val,
                                      reference,
                                      &geom);
    if (err != 0 ) {
       CPLError(CE_Failure, err, "%s", OGRErrMessages(err));
       return NULL;
    }
    return (OGRGeometryShadow*) geom;
  }
 


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

SWIGINTERN void delete_OGRGeometryShadow(OGRGeometryShadow *self){
    OGR_G_DestroyGeometry( self );
  }
SWIGINTERN OGRGeometryShadow *new_OGRGeometryShadow(OGRwkbGeometryType type=wkbUnknown,char *wkt=0,int wkb=0,char *wkb_buf=0,char *gml=0){
    if (type != wkbUnknown ) {
      return (OGRGeometryShadow*) OGR_G_CreateGeometry( type );
    }
    else if ( wkt != 0 ) {
      return CreateGeometryFromWkt( &wkt );
    }
    else if ( wkb != 0 ) {
      return CreateGeometryFromWkb( wkb, wkb_buf );
    }
    else if ( gml != 0 ) {
      return CreateGeometryFromGML( gml );
    }
    // throw?
    else return 0;
  }
SWIGINTERN OGRErr OGRGeometryShadow_ExportToWkt(OGRGeometryShadow *self,char **argout){
    return OGR_G_ExportToWkt(self, argout);
  }
SWIGINTERN OGRErr OGRGeometryShadow_ExportToWkb(OGRGeometryShadow *self,int *nLen,char **pBuf,OGRwkbByteOrder byte_order=wkbXDR){
    *nLen = OGR_G_WkbSize( self );
    *pBuf = (char *) malloc( *nLen * sizeof(unsigned char) );
    return OGR_G_ExportToWkb(self, byte_order, (unsigned char*) *pBuf );
  }
SWIGINTERN char const *OGRGeometryShadow_ExportToGML(OGRGeometryShadow *self){
    return (const char *) OGR_G_ExportToGML(self);
  }
SWIGINTERN void OGRGeometryShadow_AddPoint(OGRGeometryShadow *self,double x,double y,double z=0){
    OGR_G_AddPoint( self, x, y, z );
  }
SWIGINTERN OGRErr OGRGeometryShadow_AddGeometryDirectly(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_AddGeometryDirectly( self, other );
  }
SWIGINTERN OGRErr OGRGeometryShadow_AddGeometry(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_AddGeometry( self, other );
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Clone(OGRGeometryShadow *self){
    return (OGRGeometryShadow*) OGR_G_Clone(self);
  }
SWIGINTERN OGRwkbGeometryType OGRGeometryShadow_GetGeometryType(OGRGeometryShadow *self){
    return (OGRwkbGeometryType) OGR_G_GetGeometryType(self);
  }
SWIGINTERN char const *OGRGeometryShadow_GetGeometryName(OGRGeometryShadow *self){
    return (const char *) OGR_G_GetGeometryName(self);
  }
SWIGINTERN double OGRGeometryShadow_GetArea(OGRGeometryShadow *self){
    return OGR_G_GetArea(self);
  }
SWIGINTERN int OGRGeometryShadow_GetPointCount(OGRGeometryShadow *self){
    return OGR_G_GetPointCount(self);
  }
SWIGINTERN double OGRGeometryShadow_GetX(OGRGeometryShadow *self,int point=0){
    return OGR_G_GetX(self, point);
  }
SWIGINTERN double OGRGeometryShadow_GetY(OGRGeometryShadow *self,int point=0){
    return OGR_G_GetY(self, point);
  }
SWIGINTERN double OGRGeometryShadow_GetZ(OGRGeometryShadow *self,int point=0){
    return OGR_G_GetZ(self, point);
  }
SWIGINTERN int OGRGeometryShadow_GetGeometryCount(OGRGeometryShadow *self){
    return OGR_G_GetGeometryCount(self);
  }
SWIGINTERN void OGRGeometryShadow_SetPoint(OGRGeometryShadow *self,int point,double x,double y,double z=0){
    OGR_G_SetPoint(self, point, x, y, z);
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_GetGeometryRef(OGRGeometryShadow *self,int geom){
    return (OGRGeometryShadow*) OGR_G_GetGeometryRef(self, geom);
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_GetBoundary(OGRGeometryShadow *self){
    return (OGRGeometryShadow*) OGR_G_GetBoundary(self);
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_ConvexHull(OGRGeometryShadow *self){
    return (OGRGeometryShadow*) OGR_G_ConvexHull(self);
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Buffer(OGRGeometryShadow *self,double distance,int quadsecs=30){
    return (OGRGeometryShadow*) OGR_G_Buffer( self, distance, quadsecs );
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Intersection(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_Intersection( self, other );
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Union(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_Union( self, other );
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Difference(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_Difference( self, other );
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_SymmetricDifference(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return (OGRGeometryShadow*) OGR_G_SymmetricDifference( self, other );
  }
SWIGINTERN double OGRGeometryShadow_Distance(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Distance(self, other);
  }
SWIGINTERN void OGRGeometryShadow_Empty(OGRGeometryShadow *self){
    OGR_G_Empty(self);
  }
SWIGINTERN bool OGRGeometryShadow_Intersect(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Intersect(self, other);
  }
SWIGINTERN bool OGRGeometryShadow_Equal(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Equal(self, other);
  }
SWIGINTERN bool OGRGeometryShadow_Disjoint(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Disjoint(self, other);
  }
SWIGINTERN bool OGRGeometryShadow_Touches(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Touches(self, other);
  }
SWIGINTERN bool OGRGeometryShadow_Crosses(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Crosses(self, other);
  }
SWIGINTERN bool OGRGeometryShadow_Within(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Within(self, other);
  }
SWIGINTERN bool OGRGeometryShadow_Contains(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Contains(self, other);
  }
SWIGINTERN bool OGRGeometryShadow_Overlaps(OGRGeometryShadow *self,OGRGeometryShadow *other){
    return OGR_G_Overlaps(self, other);
  }
SWIGINTERN OGRErr OGRGeometryShadow_TransformTo(OGRGeometryShadow *self,OSRSpatialReferenceShadow *reference){
    return OGR_G_TransformTo(self, reference);
  }
SWIGINTERN OGRErr OGRGeometryShadow_Transform(OGRGeometryShadow *self,OSRCoordinateTransformationShadow *trans){
    return OGR_G_Transform(self, trans);
  }
SWIGINTERN OSRSpatialReferenceShadow *OGRGeometryShadow_GetSpatialReference(OGRGeometryShadow *self){
    return (OSRSpatialReferenceShadow*)OGR_G_GetSpatialReference(self);
  }
SWIGINTERN void OGRGeometryShadow_AssignSpatialReference(OGRGeometryShadow *self,OSRSpatialReferenceShadow *reference){
    OGR_G_AssignSpatialReference(self, reference);
  }
SWIGINTERN void OGRGeometryShadow_CloseRings(OGRGeometryShadow *self){
    OGR_G_CloseRings(self);
  }
SWIGINTERN void OGRGeometryShadow_FlattenTo2D(OGRGeometryShadow *self){
    OGR_G_FlattenTo2D(self);
  }
SWIGINTERN void OGRGeometryShadow_GetEnvelope(OGRGeometryShadow *self,double argout[4]){
    OGR_G_GetEnvelope(self, (OGREnvelope*)argout);
  }
SWIGINTERN OGRGeometryShadow *OGRGeometryShadow_Centroid(OGRGeometryShadow *self){
    OGRGeometryShadow *pt = new_OGRGeometryShadow( wkbPoint );
    OGR_G_Centroid( self, pt );
    return pt;
  }
SWIGINTERN int OGRGeometryShadow_WkbSize(OGRGeometryShadow *self){
    return OGR_G_WkbSize(self);
  }
SWIGINTERN int OGRGeometryShadow_GetCoordinateDimension(OGRGeometryShadow *self){
    return OGR_G_GetCoordinateDimension(self);
  }
SWIGINTERN void OGRGeometryShadow_SetCoordinateDimension(OGRGeometryShadow *self,int dimension){
    OGR_G_SetCoordinateDimension(self, dimension);
  }
SWIGINTERN int OGRGeometryShadow_GetDimension(OGRGeometryShadow *self){
    return OGR_G_GetDimension(self);
  }

char const *OGRDriverShadow_get_name( OGRDriverShadow *h ) {
  return OGR_Dr_GetName( h );
}

char const *OGRDataSourceShadow_get_name( OGRDataSourceShadow *h ) {
  return OGR_DS_GetName( h );
}

char const *OGRDriverShadow_name_get( OGRDriverShadow *h ) {
  return OGR_Dr_GetName( h );
}

char const *OGRDataSourceShadow_name_get( OGRDataSourceShadow *h ) {
  return OGR_DS_GetName( h );
}


  OGRDataSourceShadow* GetOpenDS(int ds_number) {
    OGRDataSourceShadow* layer = (OGRDataSourceShadow*) OGRGetOpenDS(ds_number);
    return layer;
  }


  OGRDataSourceShadow* Open( const char *filename, int update =0 ) {
    OGRDataSourceShadow* ds = (OGRDataSourceShadow*)OGROpen(filename,update,NULL);
    return ds;
  }


  OGRDataSourceShadow* OpenShared( const char *filename, int update =0 ) {
    OGRDataSourceShadow* ds = (OGRDataSourceShadow*)OGROpenShared(filename,update,NULL);
    return ds;
  }


OGRDriverShadow* GetDriverByName( char const *name ) {
  return (OGRDriverShadow*) OGRGetDriverByName( name );
}

OGRDriverShadow* GetDriver(int driver_number) {
  return (OGRDriverShadow*) OGRGetDriver(driver_number);
}

#ifdef PERL_OBJECT
#define MAGIC_CLASS _wrap_Geo::OGR_var::
class _wrap_Geo::OGR_var : public CPerlObj {
public:
#else
#define MAGIC_CLASS
#endif
SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
    MAGIC_PPERL
    croak("Value is read-only.");
    return 0;
}


#ifdef PERL_OBJECT
};
#endif

#ifdef __cplusplus
extern "C" {
#endif
XS(_wrap_UseExceptions) {
  {
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 0)) {
      SWIG_croak("Usage: UseExceptions();");
    }
    UseExceptions();
    
    XSRETURN(argvi);
  fail:
    SWIG_croak_null();
  }
}


XS(_wrap_DontUseExceptions) {
  {
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 0)) {
      SWIG_croak("Usage: DontUseExceptions();");
    }
    DontUseExceptions();
    
    XSRETURN(argvi);
  fail:
    SWIG_croak_null();
  }
}


XS(_wrap_Driver_name_get) {
  {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Driver_name_get(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_name_get" "', argument " "1"" of type '" "OGRDriverShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDriverShadow_name_get(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Driver_CreateDataSource) {
  {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char **arg3 = (char **) 0 ;
    OGRDataSourceShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 3)) {
      SWIG_croak("Usage: Driver_CreateDataSource(self,name,options);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_CreateDataSource" "', argument " "1"" of type '" "OGRDriverShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_CreateDataSource" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    if (items > 2) {
      {
        /* %typemap(in) char **options */
        if ( ! (SvROK(ST(2)) && (SvTYPE(SvRV(ST(2)))==SVt_PVAV)) ) {
          croak("argument is not an array ref");
          SWIG_fail;
        }
        AV *av = (AV*)(SvRV(ST(2)));
        for (int i = 0; i < av_len(av)-1; i++) {
          char *pszItem = SvPV_nolen(*(av_fetch(av, i, 0)));
          arg3 = CSLAddString( arg3, pszItem );
        }
      }
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OGRDriverShadow_CreateDataSource(arg1,(char const *)arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg3 );
    }
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg3 );
    }
    SWIG_croak_null();
  }
}


XS(_wrap_Driver_CopyDataSource) {
  {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    OGRDataSourceShadow *arg2 = (OGRDataSourceShadow *) 0 ;
    char *arg3 = (char *) 0 ;
    char **arg4 = (char **) 0 ;
    OGRDataSourceShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int res3 ;
    char *buf3 = 0 ;
    int alloc3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 3) || (items > 4)) {
      SWIG_croak("Usage: Driver_CopyDataSource(self,copy_ds,name,options);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_CopyDataSource" "', argument " "1"" of type '" "OGRDriverShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_CopyDataSource" "', argument " "2"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRDataSourceShadow * >(argp2);
    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Driver_CopyDataSource" "', argument " "3"" of type '" "char const *""'");
    }
    arg3 = buf3;
    if (items > 3) {
      {
        /* %typemap(in) char **options */
        if ( ! (SvROK(ST(3)) && (SvTYPE(SvRV(ST(3)))==SVt_PVAV)) ) {
          croak("argument is not an array ref");
          SWIG_fail;
        }
        AV *av = (AV*)(SvRV(ST(3)));
        for (int i = 0; i < av_len(av)-1; i++) {
          char *pszItem = SvPV_nolen(*(av_fetch(av, i, 0)));
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OGRDriverShadow_CopyDataSource(arg1,arg2,(char const *)arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg4 );
    }
    XSRETURN(argvi);
  fail:
    
    
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg4 );
    }
    SWIG_croak_null();
  }
}


XS(_wrap_Driver_Open) {
  {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int arg3 = (int) 0 ;
    OGRDataSourceShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 3)) {
      SWIG_croak("Usage: Driver_Open(self,name,update);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Open" "', argument " "1"" of type '" "OGRDriverShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_Open" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    if (items > 2) {
      ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Driver_Open" "', argument " "3"" of type '" "int""'");
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OGRDriverShadow_Open(arg1,(char const *)arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    SWIG_croak_null();
  }
}


XS(_wrap_Driver_DeleteDataSource) {
  {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Driver_DeleteDataSource(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_DeleteDataSource" "', argument " "1"" of type '" "OGRDriverShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_DeleteDataSource" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (int)OGRDriverShadow_DeleteDataSource(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Driver_TestCapability) {
  {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Driver_TestCapability(self,cap);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_TestCapability" "', argument " "1"" of type '" "OGRDriverShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_TestCapability" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (bool)OGRDriverShadow_TestCapability(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Driver_GetName) {
  {
    OGRDriverShadow *arg1 = (OGRDriverShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Driver_GetName(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDriverShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_GetName" "', argument " "1"" of type '" "OGRDriverShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDriverShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDriverShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_name_get) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: DataSource_name_get(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_name_get" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDataSourceShadow_name_get(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_delete_DataSource) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: delete_DataSource(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DataSource" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      delete_OGRDataSourceShadow(arg1);
      
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_GetRefCount) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: DataSource_GetRefCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_GetRefCount" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRDataSourceShadow_GetRefCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_GetSummaryRefCount) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: DataSource_GetSummaryRefCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_GetSummaryRefCount" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRDataSourceShadow_GetSummaryRefCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_GetLayerCount) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: DataSource_GetLayerCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_GetLayerCount" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRDataSourceShadow_GetLayerCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_GetDriver) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    OGRDriverShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: DataSource_GetDriver(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_GetDriver" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRDriverShadow *)OGRDataSourceShadow_GetDriver(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_GetName) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: DataSource_GetName(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_GetName" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRDataSourceShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_DeleteLayer) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int arg2 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: DataSource_DeleteLayer(self,index);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_DeleteLayer" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DataSource_DeleteLayer" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRDataSourceShadow_DeleteLayer(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_CreateLayer) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
    OGRwkbGeometryType arg4 = (OGRwkbGeometryType) wkbUnknown ;
    char **arg5 = (char **) 0 ;
    OGRLayerShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    int val4 ;
    int ecode4 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 5)) {
      SWIG_croak("Usage: DataSource_CreateLayer(self,name,reference,geom_type,options);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_CreateLayer" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_CreateLayer" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    if (items > 2) {
      res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DataSource_CreateLayer" "', argument " "3"" of type '" "OSRSpatialReferenceShadow *""'"); 
      }
      arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
    }
    if (items > 3) {
      ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
      if (!SWIG_IsOK(ecode4)) {
        SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "DataSource_CreateLayer" "', argument " "4"" of type '" "OGRwkbGeometryType""'");
      } 
      arg4 = static_cast< OGRwkbGeometryType >(val4);
    }
    if (items > 4) {
      {
        /* %typemap(in) char **options */
        if ( ! (SvROK(ST(4)) && (SvTYPE(SvRV(ST(4)))==SVt_PVAV)) ) {
          croak("argument is not an array ref");
          SWIG_fail;
        }
        AV *av = (AV*)(SvRV(ST(4)));
        for (int i = 0; i < av_len(av)-1; i++) {
          char *pszItem = SvPV_nolen(*(av_fetch(av, i, 0)));
          arg5 = CSLAddString( arg5, pszItem );
        }
      }
    }
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg5 );
    }
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg5 );
    }
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_CopyLayer) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    char *arg3 = (char *) 0 ;
    char **arg4 = (char **) 0 ;
    OGRLayerShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int res3 ;
    char *buf3 = 0 ;
    int alloc3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 3) || (items > 4)) {
      SWIG_croak("Usage: DataSource_CopyLayer(self,src_layer,new_name,options);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_CopyLayer" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_CopyLayer" "', argument " "2"" of type '" "OGRLayerShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
    res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
    if (!SWIG_IsOK(res3)) {
      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DataSource_CopyLayer" "', argument " "3"" of type '" "char const *""'");
    }
    arg3 = buf3;
    if (items > 3) {
      {
        /* %typemap(in) char **options */
        if ( ! (SvROK(ST(3)) && (SvTYPE(SvRV(ST(3)))==SVt_PVAV)) ) {
          croak("argument is not an array ref");
          SWIG_fail;
        }
        AV *av = (AV*)(SvRV(ST(3)));
        for (int i = 0; i < av_len(av)-1; i++) {
          char *pszItem = SvPV_nolen(*(av_fetch(av, i, 0)));
          arg4 = CSLAddString( arg4, pszItem );
        }
      }
    }
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg4 );
    }
    XSRETURN(argvi);
  fail:
    
    
    if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
    {
      /* %typemap(freearg) char **options */
      CSLDestroy( arg4 );
    }
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_GetLayerByIndex) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    int arg2 = (int) 0 ;
    OGRLayerShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: DataSource_GetLayerByIndex(self,index);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_GetLayerByIndex" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DataSource_GetLayerByIndex" "', argument " "2"" of type '" "int""'");
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_GetLayerByIndex(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_GetLayerByName) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRLayerShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: DataSource_GetLayerByName(self,layer_name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_GetLayerByName" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_GetLayerByName" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_GetLayerByName(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_TestCapability) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: DataSource_TestCapability(self,cap);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_TestCapability" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_TestCapability" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (bool)OGRDataSourceShadow_TestCapability(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_ExecuteSQL) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRGeometryShadow *arg3 = (OGRGeometryShadow *) NULL ;
    char *arg4 = (char *) "" ;
    OGRLayerShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    int res4 ;
    char *buf4 = 0 ;
    int alloc4 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 4)) {
      SWIG_croak("Usage: DataSource_ExecuteSQL(self,statement,geom,dialect);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_ExecuteSQL" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_ExecuteSQL" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    if (items > 2) {
      res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DataSource_ExecuteSQL" "', argument " "3"" of type '" "OGRGeometryShadow *""'"); 
      }
      arg3 = reinterpret_cast< OGRGeometryShadow * >(argp3);
    }
    if (items > 3) {
      res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
      if (!SWIG_IsOK(res4)) {
        SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DataSource_ExecuteSQL" "', argument " "4"" of type '" "char const *""'");
      }
      arg4 = buf4;
    }
    {
      CPLErrorReset();
      result = (OGRLayerShadow *)OGRDataSourceShadow_ExecuteSQL(arg1,(char const *)arg2,arg3,(char const *)arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
    SWIG_croak_null();
  }
}


XS(_wrap_DataSource_ReleaseResultSet) {
  {
    OGRDataSourceShadow *arg1 = (OGRDataSourceShadow *) 0 ;
    OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: DataSource_ReleaseResultSet(self,layer);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRDataSourceShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DataSource_ReleaseResultSet" "', argument " "1"" of type '" "OGRDataSourceShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRDataSourceShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DataSource_ReleaseResultSet" "', argument " "2"" of type '" "OGRLayerShadow *""'");
    }
    {
      CPLErrorReset();
      OGRDataSourceShadow_ReleaseResultSet(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetRefCount) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_GetRefCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetRefCount" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRLayerShadow_GetRefCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_SetSpatialFilter) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_SetSpatialFilter(self,filter);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_SetSpatialFilter" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_SetSpatialFilter" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      OGRLayerShadow_SetSpatialFilter(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_SetSpatialFilterRect) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    double arg2 ;
    double arg3 ;
    double arg4 ;
    double arg5 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    double val5 ;
    int ecode5 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 5) || (items > 5)) {
      SWIG_croak("Usage: Layer_SetSpatialFilterRect(self,minx,miny,maxx,maxy);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_SetSpatialFilterRect" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Layer_SetSpatialFilterRect" "', argument " "2"" of type '" "double""'");
    } 
    arg2 = static_cast< double >(val2);
    ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Layer_SetSpatialFilterRect" "', argument " "3"" of type '" "double""'");
    } 
    arg3 = static_cast< double >(val3);
    ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Layer_SetSpatialFilterRect" "', argument " "4"" of type '" "double""'");
    } 
    arg4 = static_cast< double >(val4);
    ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
    if (!SWIG_IsOK(ecode5)) {
      SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Layer_SetSpatialFilterRect" "', argument " "5"" of type '" "double""'");
    } 
    arg5 = static_cast< double >(val5);
    {
      CPLErrorReset();
      OGRLayerShadow_SetSpatialFilterRect(arg1,arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetSpatialFilter) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_GetSpatialFilter(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetSpatialFilter" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRLayerShadow_GetSpatialFilter(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_SetAttributeFilter) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_SetAttributeFilter(self,filter_string);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_SetAttributeFilter" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_SetAttributeFilter" "', argument " "2"" of type '" "char *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SetAttributeFilter(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_ResetReading) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_ResetReading(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_ResetReading" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      OGRLayerShadow_ResetReading(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetName) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_GetName(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetName" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRLayerShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetFeature) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    OGRFeatureShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    long val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_GetFeature(self,fid);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetFeature" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Layer_GetFeature" "', argument " "2"" of type '" "long""'");
    } 
    arg2 = static_cast< long >(val2);
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)OGRLayerShadow_GetFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetNextFeature) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_GetNextFeature(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetNextFeature" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)OGRLayerShadow_GetNextFeature(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_SetNextByIndex) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    long val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_SetNextByIndex(self,new_index);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_SetNextByIndex" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Layer_SetNextByIndex" "', argument " "2"" of type '" "long""'");
    } 
    arg2 = static_cast< long >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SetNextByIndex(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_SetFeature) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_SetFeature(self,feature);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_SetFeature" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_SetFeature" "', argument " "2"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SetFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_CreateFeature) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_CreateFeature(self,feature);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_CreateFeature" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_CreateFeature" "', argument " "2"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_CreateFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_DeleteFeature) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    long arg2 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    long val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_DeleteFeature(self,fid);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_DeleteFeature" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    ecode2 = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Layer_DeleteFeature" "', argument " "2"" of type '" "long""'");
    } 
    arg2 = static_cast< long >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_DeleteFeature(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_SyncToDisk) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_SyncToDisk(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_SyncToDisk" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_SyncToDisk(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetLayerDefn) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFeatureDefnShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_GetLayerDefn(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetLayerDefn" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureDefnShadow *)OGRLayerShadow_GetLayerDefn(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureDefnShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetFeatureCount) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    int arg2 = (int) 1 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: Layer_GetFeatureCount(self,force);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetFeatureCount" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Layer_GetFeatureCount" "', argument " "2"" of type '" "int""'");
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (int)OGRLayerShadow_GetFeatureCount(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetExtent) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    double *arg2 ;
    int arg3 = (int) 1 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double argout2[4] ;
    int val3 ;
    int ecode3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    {
      /* %typemap(in,numinputs=0) (double argout2[ANY]) */
      arg2 = argout2;
    }
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: Layer_GetExtent(self,force);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetExtent" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    if (items > 1) {
      ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Layer_GetExtent" "', argument " "3"" of type '" "int""'");
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_GetExtent(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    {
      /* %typemap(argout) (double argout[ANY]) */
      ST(argvi) = CreateArrayFromDoubleArray( arg2, 4 );
      argvi++;
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_TestCapability) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Layer_TestCapability(self,cap);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_TestCapability" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_TestCapability" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (bool)OGRLayerShadow_TestCapability(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_CreateField) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRFieldDefnShadow *arg2 = (OGRFieldDefnShadow *) 0 ;
    int arg3 = (int) 1 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 3)) {
      SWIG_croak("Usage: Layer_CreateField(self,field_def,approx_ok);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_CreateField" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Layer_CreateField" "', argument " "2"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRFieldDefnShadow * >(argp2);
    if (items > 2) {
      ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Layer_CreateField" "', argument " "3"" of type '" "int""'");
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_CreateField(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_StartTransaction) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_StartTransaction(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_StartTransaction" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_StartTransaction(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_CommitTransaction) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_CommitTransaction(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_CommitTransaction" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_CommitTransaction(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_RollbackTransaction) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_RollbackTransaction(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_RollbackTransaction" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRLayerShadow_RollbackTransaction(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetSpatialRef) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    OSRSpatialReferenceShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_GetSpatialRef(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetSpatialRef" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OSRSpatialReferenceShadow *)OGRLayerShadow_GetSpatialRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Layer_GetFeatureRead) {
  {
    OGRLayerShadow *arg1 = (OGRLayerShadow *) 0 ;
    GIntBig result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Layer_GetFeatureRead(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Layer_GetFeatureRead" "', argument " "1"" of type '" "OGRLayerShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRLayerShadow * >(argp1);
    {
      CPLErrorReset();
      result = OGRLayerShadow_GetFeatureRead(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) GIntBig */
      ST(argvi) = sv_newmortal();
      sv_setiv(ST(argvi), (IV) result);
      argvi++;
    }
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_delete_Feature) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: delete_Feature(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Feature" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      delete_OGRFeatureShadow(arg1);
      
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_new_Feature) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRFeatureShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 1)) {
      SWIG_croak("Usage: new_Feature(feature_def);");
    }
    if (items > 0) {
      res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
      if (!SWIG_IsOK(res1)) {
        SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Feature" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
      }
      arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    }
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)new_OGRFeatureShadow(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetDefnRef) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureDefnShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Feature_GetDefnRef(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetDefnRef" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureDefnShadow *)OGRFeatureShadow_GetDefnRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureDefnShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_SetGeometry) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_SetGeometry(self,geom);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_SetGeometry" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_SetGeometry" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetGeometry(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_SetGeometryDirectly) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_SetGeometryDirectly(self,geom);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_SetGeometryDirectly" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_SetGeometryDirectly" "', argument " "2"" of type '" "OGRGeometryShadow *""'");
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetGeometryDirectly(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetGeometryRef) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Feature_GetGeometryRef(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetGeometryRef" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRFeatureShadow_GetGeometryRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_Clone) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Feature_Clone(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_Clone" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFeatureShadow *)OGRFeatureShadow_Clone(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_Equal) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_Equal(self,feature);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_Equal" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_Equal" "', argument " "2"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRFeatureShadow_Equal(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldCount) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Feature_GetFieldCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldCount" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldDefnRef__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    OGRFieldDefnShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldDefnRef(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldDefnRef" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_GetFieldDefnRef" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)OGRFeatureShadow_GetFieldDefnRef__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldDefnRef__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRFieldDefnShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldDefnRef(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldDefnRef" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldDefnRef" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)OGRFeatureShadow_GetFieldDefnRef__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldDefnRef) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldDefnRef__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldDefnRef__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_GetFieldDefnRef'");
  XSRETURN(0);
}


XS(_wrap_Feature_GetFieldAsString__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldAsString(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldAsString" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_GetFieldAsString" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldAsString__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldAsString(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldAsString" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldAsString" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetFieldAsString__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldAsString) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldAsString__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldAsString__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_GetFieldAsString'");
  XSRETURN(0);
}


XS(_wrap_Feature_GetFieldAsInteger__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldAsInteger(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldAsInteger" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_GetFieldAsInteger" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldAsInteger__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldAsInteger__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldAsInteger(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldAsInteger" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldAsInteger" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldAsInteger__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldAsInteger) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldAsInteger__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldAsInteger__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_GetFieldAsInteger'");
  XSRETURN(0);
}


XS(_wrap_Feature_GetFieldAsDouble__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    double result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldAsDouble(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldAsDouble" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_GetFieldAsDouble" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (double)OGRFeatureShadow_GetFieldAsDouble__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldAsDouble__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    double result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldAsDouble(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldAsDouble" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldAsDouble" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (double)OGRFeatureShadow_GetFieldAsDouble__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldAsDouble) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldAsDouble__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldAsDouble__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_GetFieldAsDouble'");
  XSRETURN(0);
}


XS(_wrap_Feature_IsFieldSet__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_IsFieldSet(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_IsFieldSet" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_IsFieldSet" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (bool)OGRFeatureShadow_IsFieldSet__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_IsFieldSet__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_IsFieldSet(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_IsFieldSet" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_IsFieldSet" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (bool)OGRFeatureShadow_IsFieldSet__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_IsFieldSet) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_IsFieldSet__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_IsFieldSet__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_IsFieldSet'");
  XSRETURN(0);
}


XS(_wrap_Feature_GetFieldIndex) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldIndex(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldIndex" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldIndex" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFieldIndex(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFID) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Feature_GetFID(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFID" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureShadow_GetFID(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_SetFID) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_SetFID(self,fid);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_SetFID" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_SetFID" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetFID(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_DumpReadable) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Feature_DumpReadable(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_DumpReadable" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      OGRFeatureShadow_DumpReadable(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_UnsetField__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_UnsetField(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_UnsetField" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_UnsetField" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFeatureShadow_UnsetField__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_UnsetField__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_UnsetField(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_UnsetField" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_UnsetField" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      OGRFeatureShadow_UnsetField__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_UnsetField) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_UnsetField__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_UnsetField__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_UnsetField'");
  XSRETURN(0);
}


XS(_wrap_Feature_SetField__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char *arg3 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 3) || (items > 3)) {
      SWIG_croak("Usage: Feature_SetField(self,id,value);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_SetField" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_SetField" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      /* %typemap(in) (tostring argin) */
      arg3 = SvPV_nolen( ST(2) ); 
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_0(arg1,arg2,(char const *)arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_SetField__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char *arg3 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 3) || (items > 3)) {
      SWIG_croak("Usage: Feature_SetField(self,name,value);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_SetField" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_SetField" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      /* %typemap(in) (tostring argin) */
      arg3 = SvPV_nolen( ST(2) ); 
    }
    {
      CPLErrorReset();
      OGRFeatureShadow_SetField__SWIG_1(arg1,(char const *)arg2,(char const *)arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_SetField) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 3) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          /* %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) (tostring argin) */
          _v = 1;
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 3) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          /* %typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) (tostring argin) */
          _v = 1;
        }
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_SetField__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_SetField__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_SetField'");
  XSRETURN(0);
}


XS(_wrap_Feature_SetFrom) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    OGRFeatureShadow *arg2 = (OGRFeatureShadow *) 0 ;
    int arg3 = (int) 1 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 3)) {
      SWIG_croak("Usage: Feature_SetFrom(self,other,forgiving);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_SetFrom" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_SetFrom" "', argument " "2"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRFeatureShadow * >(argp2);
    if (items > 2) {
      ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Feature_SetFrom" "', argument " "3"" of type '" "int""'");
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRFeatureShadow_SetFrom(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetStyleString) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Feature_GetStyleString(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetStyleString" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetStyleString(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_SetStyleString) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_SetStyleString(self,the_string);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_SetStyleString" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_SetStyleString" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      OGRFeatureShadow_SetStyleString(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldType__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    OGRFieldType result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldType(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldType" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_GetFieldType" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRFieldType)OGRFeatureShadow_GetFieldType__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldType__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    OGRFieldType result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetFieldType(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetFieldType" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetFieldType" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (OGRFieldType)OGRFeatureShadow_GetFieldType__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetFieldType) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldType__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetFieldType__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_GetFieldType'");
  XSRETURN(0);
}


XS(_wrap_Feature_GetField__SWIG_0) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    int arg2 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetField(self,id);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetField" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Feature_GetField" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetField__SWIG_0(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetField__SWIG_1) {
  {
    OGRFeatureShadow *arg1 = (OGRFeatureShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Feature_GetField(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Feature_GetField" "', argument " "1"" of type '" "OGRFeatureShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Feature_GetField" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (char *)OGRFeatureShadow_GetField__SWIG_1(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_Feature_GetField) {
  dXSARGS;
  
  {
    unsigned long _index = 0;
    SWIG_TypeRank _rank = 0; 
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        {
          int res = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), NULL);
          _v = SWIG_CheckState(res);
        }
      }
      if (!_v) goto check_1;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 1;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_1:
    
    if (items == 2) {
      SWIG_TypeRank _ranki = 0;
      SWIG_TypeRank _rankm = 0;
      SWIG_TypeRank _pi = 1;
      int _v = 0;
      {
        void *vptr = 0;
        int res = SWIG_ConvertPtr(ST(0), &vptr, SWIGTYPE_p_OGRFeatureShadow, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      {
        int res = SWIG_AsCharPtrAndSize(ST(1), 0, NULL, 0);
        _v = SWIG_CheckState(res);
      }
      if (!_v) goto check_2;
      _ranki += _v*_pi;
      _rankm += _pi;
      _pi *= SWIG_MAXCASTRANK;
      if (!_index || (_ranki < _rank)) {
        _rank = _ranki; _index = 2;
        if (_rank == _rankm) goto dispatch;
      }
    }
  check_2:
    
  dispatch:
    switch(_index) {
    case 1:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetField__SWIG_0); return;
    case 2:
      ++PL_markstack_ptr; SWIG_CALLXS(_wrap_Feature_GetField__SWIG_1); return;
    }
  }
  
  croak("No matching function for overloaded 'Feature_GetField'");
  XSRETURN(0);
}


XS(_wrap_delete_FeatureDefn) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: delete_FeatureDefn(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FeatureDefn" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      delete_OGRFeatureDefnShadow(arg1);
      
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_new_FeatureDefn) {
  {
    char *arg1 = (char *) NULL ;
    OGRFeatureDefnShadow *result = 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 1)) {
      SWIG_croak("Usage: new_FeatureDefn(name);");
    }
    if (items > 0) {
      res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
      if (!SWIG_IsOK(res1)) {
        SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_FeatureDefn" "', argument " "1"" of type '" "char const *""'");
      }
      arg1 = buf1;
    }
    {
      CPLErrorReset();
      result = (OGRFeatureDefnShadow *)new_OGRFeatureDefnShadow((char const *)arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureDefnShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    XSRETURN(argvi);
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_GetName) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FeatureDefn_GetName(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_GetName" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFeatureDefnShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_GetFieldCount) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FeatureDefn_GetFieldCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_GetFieldCount" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_GetFieldCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_GetFieldDefn) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int arg2 ;
    OGRFieldDefnShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FeatureDefn_GetFieldDefn(self,i);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_GetFieldDefn" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FeatureDefn_GetFieldDefn" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)OGRFeatureDefnShadow_GetFieldDefn(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_GetFieldIndex) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FeatureDefn_GetFieldIndex(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_GetFieldIndex" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FeatureDefn_GetFieldIndex" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_GetFieldIndex(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_AddFieldDefn) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRFieldDefnShadow *arg2 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FeatureDefn_AddFieldDefn(self,defn);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_AddFieldDefn" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FeatureDefn_AddFieldDefn" "', argument " "2"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRFieldDefnShadow * >(argp2);
    {
      CPLErrorReset();
      OGRFeatureDefnShadow_AddFieldDefn(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_GetGeomType) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRwkbGeometryType result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FeatureDefn_GetGeomType(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_GetGeomType" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRwkbGeometryType)OGRFeatureDefnShadow_GetGeomType(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_SetGeomType) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    OGRwkbGeometryType arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FeatureDefn_SetGeomType(self,geom_type);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_SetGeomType" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FeatureDefn_SetGeomType" "', argument " "2"" of type '" "OGRwkbGeometryType""'");
    } 
    arg2 = static_cast< OGRwkbGeometryType >(val2);
    {
      CPLErrorReset();
      OGRFeatureDefnShadow_SetGeomType(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_FeatureDefn_GetReferenceCount) {
  {
    OGRFeatureDefnShadow *arg1 = (OGRFeatureDefnShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FeatureDefn_GetReferenceCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFeatureDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FeatureDefn_GetReferenceCount" "', argument " "1"" of type '" "OGRFeatureDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFeatureDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFeatureDefnShadow_GetReferenceCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_delete_FieldDefn) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: delete_FieldDefn(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_FieldDefn" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      delete_OGRFieldDefnShadow(arg1);
      
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_new_FieldDefn) {
  {
    char *arg1 = (char *) "unnamed" ;
    OGRFieldType arg2 = (OGRFieldType) OFTString ;
    OGRFieldDefnShadow *result = 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 2)) {
      SWIG_croak("Usage: new_FieldDefn(name,field_type);");
    }
    if (items > 0) {
      res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
      if (!SWIG_IsOK(res1)) {
        SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_FieldDefn" "', argument " "1"" of type '" "char const *""'");
      }
      arg1 = buf1;
    }
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_FieldDefn" "', argument " "2"" of type '" "OGRFieldType""'");
      } 
      arg2 = static_cast< OGRFieldType >(val2);
    }
    {
      CPLErrorReset();
      result = (OGRFieldDefnShadow *)new_OGRFieldDefnShadow((char const *)arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDefnShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    
    XSRETURN(argvi);
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_GetName) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FieldDefn_GetName(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_GetName" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFieldDefnShadow_GetName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_GetNameRef) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FieldDefn_GetNameRef(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_GetNameRef" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRFieldDefnShadow_GetNameRef(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_SetName) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    char *arg2 = (char *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FieldDefn_SetName(self,name);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_SetName" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FieldDefn_SetName" "', argument " "2"" of type '" "char const *""'");
    }
    arg2 = buf2;
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetName(arg1,(char const *)arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_GetType) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRFieldType result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FieldDefn_GetType(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_GetType" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRFieldType)OGRFieldDefnShadow_GetType(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_SetType) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRFieldType arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FieldDefn_SetType(self,type);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_SetType" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FieldDefn_SetType" "', argument " "2"" of type '" "OGRFieldType""'");
    } 
    arg2 = static_cast< OGRFieldType >(val2);
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetType(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_GetJustify) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRJustification result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FieldDefn_GetJustify(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_GetJustify" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRJustification)OGRFieldDefnShadow_GetJustify(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_SetJustify) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRJustification arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FieldDefn_SetJustify(self,justify);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_SetJustify" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FieldDefn_SetJustify" "', argument " "2"" of type '" "OGRJustification""'");
    } 
    arg2 = static_cast< OGRJustification >(val2);
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetJustify(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_GetWidth) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FieldDefn_GetWidth(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_GetWidth" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFieldDefnShadow_GetWidth(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_SetWidth) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FieldDefn_SetWidth(self,width);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_SetWidth" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FieldDefn_SetWidth" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetWidth(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_GetPrecision) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: FieldDefn_GetPrecision(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_GetPrecision" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRFieldDefnShadow_GetPrecision(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_SetPrecision) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FieldDefn_SetPrecision(self,precision);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_SetPrecision" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FieldDefn_SetPrecision" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRFieldDefnShadow_SetPrecision(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_FieldDefn_GetFieldTypeName) {
  {
    OGRFieldDefnShadow *arg1 = (OGRFieldDefnShadow *) 0 ;
    OGRFieldType arg2 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: FieldDefn_GetFieldTypeName(self,type);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRFieldDefnShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FieldDefn_GetFieldTypeName" "', argument " "1"" of type '" "OGRFieldDefnShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRFieldDefnShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "FieldDefn_GetFieldTypeName" "', argument " "2"" of type '" "OGRFieldType""'");
    } 
    arg2 = static_cast< OGRFieldType >(val2);
    {
      CPLErrorReset();
      result = (char *)OGRFieldDefnShadow_GetFieldTypeName(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_CreateGeometryFromWkb) {
  {
    int arg1 ;
    char *arg2 = (char *) 0 ;
    OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
    OGRGeometryShadow *result = 0 ;
    void *argp3 = 0 ;
    int res3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: CreateGeometryFromWkb(len,bin_string,reference);");
    }
    {
      /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
      if (!SvPOK(ST(0))) {
        croak("buf argument has to be binary data");
        SWIG_fail;
      }
      STRLEN len = SvCUR(ST(0));
      arg2 = SvPV_nolen(ST(0));
      arg1 = len;
    }
    if (items > 1) {
      res3 = SWIG_ConvertPtr(ST(1), &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
      if (!SWIG_IsOK(res3)) {
        SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CreateGeometryFromWkb" "', argument " "3"" of type '" "OSRSpatialReferenceShadow *""'"); 
      }
      arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)CreateGeometryFromWkb(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_CreateGeometryFromWkt) {
  {
    char **arg1 = (char **) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) NULL ;
    OGRGeometryShadow *result = 0 ;
    char *val1 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: CreateGeometryFromWkt(val,reference);");
    }
    {
      /* %typemap(in) (char **ignorechange) */
      val1 = SvPV_nolen(ST(0));
      arg1 = &val1;
    }
    if (items > 1) {
      res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
      if (!SWIG_IsOK(res2)) {
        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CreateGeometryFromWkt" "', argument " "2"" of type '" "OSRSpatialReferenceShadow *""'"); 
      }
      arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)CreateGeometryFromWkt(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_CreateGeometryFromGML) {
  {
    char *arg1 = (char *) 0 ;
    OGRGeometryShadow *result = 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: CreateGeometryFromGML(input_string);");
    }
    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CreateGeometryFromGML" "', argument " "1"" of type '" "char const *""'");
    }
    arg1 = buf1;
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)CreateGeometryFromGML((char const *)arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    XSRETURN(argvi);
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    SWIG_croak_null();
  }
}


XS(_wrap_delete_Geometry) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: delete_Geometry(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Geometry" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      delete_OGRGeometryShadow(arg1);
      
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_new_Geometry) {
  {
    OGRwkbGeometryType arg1 = (OGRwkbGeometryType) wkbUnknown ;
    char *arg2 = (char *) 0 ;
    int arg3 = (int) 0 ;
    char *arg4 = (char *) 0 ;
    char *arg5 = (char *) 0 ;
    OGRGeometryShadow *result = 0 ;
    int val1 ;
    int ecode1 = 0 ;
    int res2 ;
    char *buf2 = 0 ;
    int alloc2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    int res4 ;
    char *buf4 = 0 ;
    int alloc4 = 0 ;
    int res5 ;
    char *buf5 = 0 ;
    int alloc5 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 5)) {
      SWIG_croak("Usage: new_Geometry(type,wkt,wkb,wkb_buf,gml);");
    }
    if (items > 0) {
      ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
      if (!SWIG_IsOK(ecode1)) {
        SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_Geometry" "', argument " "1"" of type '" "OGRwkbGeometryType""'");
      } 
      arg1 = static_cast< OGRwkbGeometryType >(val1);
    }
    if (items > 1) {
      res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
      if (!SWIG_IsOK(res2)) {
        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Geometry" "', argument " "2"" of type '" "char *""'");
      }
      arg2 = buf2;
    }
    if (items > 2) {
      ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Geometry" "', argument " "3"" of type '" "int""'");
      } 
      arg3 = static_cast< int >(val3);
    }
    if (items > 3) {
      res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
      if (!SWIG_IsOK(res4)) {
        SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_Geometry" "', argument " "4"" of type '" "char *""'");
      }
      arg4 = buf4;
    }
    if (items > 4) {
      res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
      if (!SWIG_IsOK(res5)) {
        SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_Geometry" "', argument " "5"" of type '" "char *""'");
      }
      arg5 = buf5;
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)new_OGRGeometryShadow(arg1,arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
    if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
    XSRETURN(argvi);
  fail:
    
    if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
    
    if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
    if (alloc5 == SWIG_NEWOBJ) delete[] buf5;
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_ExportToWkt) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char **arg2 = (char **) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    char *argout2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    {
      /* %typemap(in,numinputs=0) (char **argout2) */
      arg2 = &argout2;
    }
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_ExportToWkt(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_ExportToWkt" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_ExportToWkt(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    {
      /* %typemap(argout) (char **argout) */
      ST(argvi) = sv_newmortal();
      if ( arg2 )
      sv_setpv(ST(argvi), *arg2);
      argvi++;
    }
    
    {
      /* %typemap(freearg) (char **argout) */
      if ( *arg2 )
      CPLFree( *arg2 );
    }
    XSRETURN(argvi);
  fail:
    
    {
      /* %typemap(freearg) (char **argout) */
      if ( *arg2 )
      CPLFree( *arg2 );
    }
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_ExportToWkb) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int *arg2 = (int *) 0 ;
    char **arg3 = (char **) 0 ;
    OGRwkbByteOrder arg4 = (OGRwkbByteOrder) wkbXDR ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int nLen2 = 0 ;
    char *pBuf2 = 0 ;
    int val4 ;
    int ecode4 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    {
      /* %typemap(in,numinputs=0) (int *nLen2, char **pBuf2 ) */
      arg2 = &nLen2;
      arg3 = &pBuf2;
    }
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: Geometry_ExportToWkb(self,byte_order);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_ExportToWkb" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (items > 1) {
      ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val4);
      if (!SWIG_IsOK(ecode4)) {
        SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Geometry_ExportToWkb" "', argument " "4"" of type '" "OGRwkbByteOrder""'");
      } 
      arg4 = static_cast< OGRwkbByteOrder >(val4);
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_ExportToWkb(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    {
      /* %typemap(argout) (int *nLen, char **pBuf ) */
      ST(argvi) = sv_2mortal(newSVpv( *arg3, *arg2 ));
      argvi++;
    }
    
    {
      /* %typemap(freearg) (int *nLen, char **pBuf ) */
      if( *arg2 ) {
        free( *arg3 );
      }
    }
    
    XSRETURN(argvi);
  fail:
    
    {
      /* %typemap(freearg) (int *nLen, char **pBuf ) */
      if( *arg2 ) {
        free( *arg3 );
      }
    }
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_ExportToGML) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_ExportToGML(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_ExportToGML" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRGeometryShadow_ExportToGML(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_AddPoint) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    double arg3 ;
    double arg4 = (double) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 3) || (items > 4)) {
      SWIG_croak("Usage: Geometry_AddPoint(self,x,y,z);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_AddPoint" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_AddPoint" "', argument " "2"" of type '" "double""'");
    } 
    arg2 = static_cast< double >(val2);
    ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_AddPoint" "', argument " "3"" of type '" "double""'");
    } 
    arg3 = static_cast< double >(val3);
    if (items > 3) {
      ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
      if (!SWIG_IsOK(ecode4)) {
        SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Geometry_AddPoint" "', argument " "4"" of type '" "double""'");
      } 
      arg4 = static_cast< double >(val4);
    }
    {
      CPLErrorReset();
      OGRGeometryShadow_AddPoint(arg1,arg2,arg3,arg4);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_AddGeometryDirectly) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_AddGeometryDirectly(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_AddGeometryDirectly" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRGeometryShadow, SWIG_POINTER_DISOWN |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_AddGeometryDirectly" "', argument " "2"" of type '" "OGRGeometryShadow *""'");
    }
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_AddGeometryDirectly(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_AddGeometry) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_AddGeometry(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_AddGeometry" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_AddGeometry" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_AddGeometry(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Clone) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_Clone(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Clone" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Clone(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetGeometryType) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRwkbGeometryType result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetGeometryType(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetGeometryType" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRwkbGeometryType)OGRGeometryShadow_GetGeometryType(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetGeometryName) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    char *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetGeometryName(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetGeometryName" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (char *)OGRGeometryShadow_GetGeometryName(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_FromCharPtr(result); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetArea) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetArea(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetArea" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetArea(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetPointCount) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetPointCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetPointCount" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetPointCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetX) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: Geometry_GetX(self,point);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetX" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_GetX" "', argument " "2"" of type '" "int""'");
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetX(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetY) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: Geometry_GetY(self,point);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetY" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_GetY" "', argument " "2"" of type '" "int""'");
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetY(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetZ) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 = (int) 0 ;
    double result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: Geometry_GetZ(self,point);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetZ" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_GetZ" "', argument " "2"" of type '" "int""'");
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_GetZ(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetGeometryCount) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetGeometryCount(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetGeometryCount" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetGeometryCount(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_SetPoint) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    double arg3 ;
    double arg4 ;
    double arg5 = (double) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    double val3 ;
    int ecode3 = 0 ;
    double val4 ;
    int ecode4 = 0 ;
    double val5 ;
    int ecode5 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 4) || (items > 5)) {
      SWIG_croak("Usage: Geometry_SetPoint(self,point,x,y,z);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_SetPoint" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_SetPoint" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    ecode3 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
    if (!SWIG_IsOK(ecode3)) {
      SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_SetPoint" "', argument " "3"" of type '" "double""'");
    } 
    arg3 = static_cast< double >(val3);
    ecode4 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
    if (!SWIG_IsOK(ecode4)) {
      SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Geometry_SetPoint" "', argument " "4"" of type '" "double""'");
    } 
    arg4 = static_cast< double >(val4);
    if (items > 4) {
      ecode5 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
      if (!SWIG_IsOK(ecode5)) {
        SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Geometry_SetPoint" "', argument " "5"" of type '" "double""'");
      } 
      arg5 = static_cast< double >(val5);
    }
    {
      CPLErrorReset();
      OGRGeometryShadow_SetPoint(arg1,arg2,arg3,arg4,arg5);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetGeometryRef) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_GetGeometryRef(self,geom);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetGeometryRef" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_GetGeometryRef" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_GetGeometryRef(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetBoundary) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetBoundary(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetBoundary" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_GetBoundary(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_ConvexHull) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_ConvexHull(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_ConvexHull" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_ConvexHull(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Buffer) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double arg2 ;
    int arg3 = (int) 30 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double val2 ;
    int ecode2 = 0 ;
    int val3 ;
    int ecode3 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 3)) {
      SWIG_croak("Usage: Geometry_Buffer(self,distance,quadsecs);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Buffer" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_Buffer" "', argument " "2"" of type '" "double""'");
    } 
    arg2 = static_cast< double >(val2);
    if (items > 2) {
      ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
      if (!SWIG_IsOK(ecode3)) {
        SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_Buffer" "', argument " "3"" of type '" "int""'");
      } 
      arg3 = static_cast< int >(val3);
    }
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Buffer(arg1,arg2,arg3);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Intersection) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Intersection(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Intersection" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Intersection" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Intersection(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Union) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Union(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Union" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Union" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Union(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Difference) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Difference(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Difference" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Difference" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Difference(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_SymmetricDifference) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_SymmetricDifference(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_SymmetricDifference" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_SymmetricDifference" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_SymmetricDifference(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Distance) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    double result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Distance(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Distance" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Distance" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (double)OGRGeometryShadow_Distance(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_double  SWIG_PERL_CALL_ARGS_1(static_cast< double >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Empty) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_Empty(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Empty" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_Empty(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Intersect) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Intersect(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Intersect" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Intersect" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Intersect(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Equal) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Equal(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Equal" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Equal" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Equal(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Disjoint) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Disjoint(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Disjoint" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Disjoint" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Disjoint(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Touches) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Touches(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Touches" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Touches" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Touches(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Crosses) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Crosses(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Crosses" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Crosses" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Crosses(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Within) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Within(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Within" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Within" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Within(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Contains) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Contains(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Contains" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Contains" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Contains(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Overlaps) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *arg2 = (OGRGeometryShadow *) 0 ;
    bool result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Overlaps(self,other);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Overlaps" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Overlaps" "', argument " "2"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg2 = reinterpret_cast< OGRGeometryShadow * >(argp2);
    {
      CPLErrorReset();
      result = (bool)OGRGeometryShadow_Overlaps(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_bool  SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_TransformTo) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_TransformTo(self,reference);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_TransformTo" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_TransformTo" "', argument " "2"" of type '" "OSRSpatialReferenceShadow *""'"); 
    }
    arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_TransformTo(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Transform) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRCoordinateTransformationShadow *arg2 = (OSRCoordinateTransformationShadow *) 0 ;
    OGRErr result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_Transform(self,trans);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Transform" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OSRCoordinateTransformationShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_Transform" "', argument " "2"" of type '" "OSRCoordinateTransformationShadow *""'"); 
    }
    arg2 = reinterpret_cast< OSRCoordinateTransformationShadow * >(argp2);
    {
      CPLErrorReset();
      result = (OGRErr)OGRGeometryShadow_Transform(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetSpatialReference) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetSpatialReference(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetSpatialReference" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OSRSpatialReferenceShadow *)OGRGeometryShadow_GetSpatialReference(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_AssignSpatialReference) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    void *argp2 = 0 ;
    int res2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_AssignSpatialReference(self,reference);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_AssignSpatialReference" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
    if (!SWIG_IsOK(res2)) {
      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_AssignSpatialReference" "', argument " "2"" of type '" "OSRSpatialReferenceShadow *""'"); 
    }
    arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
    {
      CPLErrorReset();
      OGRGeometryShadow_AssignSpatialReference(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_CloseRings) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_CloseRings(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_CloseRings" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_CloseRings(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_FlattenTo2D) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_FlattenTo2D(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_FlattenTo2D" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_FlattenTo2D(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetEnvelope) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    double *arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    double argout2[4] ;
    int argvi = 0;
    dXSARGS;
    
    {
      /* %typemap(in,numinputs=0) (double argout2[ANY]) */
      arg2 = argout2;
    }
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetEnvelope(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetEnvelope" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      OGRGeometryShadow_GetEnvelope(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    {
      /* %typemap(argout) (double argout[ANY]) */
      ST(argvi) = CreateArrayFromDoubleArray( arg2, 4 );
      argvi++;
    }
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_Centroid) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    OGRGeometryShadow *result = 0 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_Centroid(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_Centroid" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (OGRGeometryShadow *)OGRGeometryShadow_Centroid(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRGeometryShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_WkbSize) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_WkbSize(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_WkbSize" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_WkbSize(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetCoordinateDimension) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetCoordinateDimension(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetCoordinateDimension" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetCoordinateDimension(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_SetCoordinateDimension) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int arg2 ;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 2) || (items > 2)) {
      SWIG_croak("Usage: Geometry_SetCoordinateDimension(self,dimension);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_SetCoordinateDimension" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
    if (!SWIG_IsOK(ecode2)) {
      SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_SetCoordinateDimension" "', argument " "2"" of type '" "int""'");
    } 
    arg2 = static_cast< int >(val2);
    {
      CPLErrorReset();
      OGRGeometryShadow_SetCoordinateDimension(arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    
    
    XSRETURN(argvi);
  fail:
    
    
    SWIG_croak_null();
  }
}


XS(_wrap_Geometry_GetDimension) {
  {
    OGRGeometryShadow *arg1 = (OGRGeometryShadow *) 0 ;
    int result;
    void *argp1 = 0 ;
    int res1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: Geometry_GetDimension(self);");
    }
    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_GetDimension" "', argument " "1"" of type '" "OGRGeometryShadow *""'"); 
    }
    arg1 = reinterpret_cast< OGRGeometryShadow * >(argp1);
    {
      CPLErrorReset();
      result = (int)OGRGeometryShadow_GetDimension(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_GetDriverCount) {
  {
    int result;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 0)) {
      SWIG_croak("Usage: GetDriverCount();");
    }
    {
      CPLErrorReset();
      result = (int)OGRGetDriverCount();
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    XSRETURN(argvi);
  fail:
    SWIG_croak_null();
  }
}


XS(_wrap_GetOpenDSCount) {
  {
    int result;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 0)) {
      SWIG_croak("Usage: GetOpenDSCount();");
    }
    {
      CPLErrorReset();
      result = (int)OGRGetOpenDSCount();
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(result)); argvi++ ;
    XSRETURN(argvi);
  fail:
    SWIG_croak_null();
  }
}


XS(_wrap_SetGenerate_DB2_V72_BYTE_ORDER) {
  {
    int arg1 ;
    OGRErr result;
    int val1 ;
    int ecode1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: SetGenerate_DB2_V72_BYTE_ORDER(bGenerate_DB2_V72_BYTE_ORDER);");
    }
    ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "SetGenerate_DB2_V72_BYTE_ORDER" "', argument " "1"" of type '" "int""'");
    } 
    arg1 = static_cast< int >(val1);
    {
      CPLErrorReset();
      result = (OGRErr)OGRSetGenerate_DB2_V72_BYTE_ORDER(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    {
      /* %typemap(out) OGRErr */
      if ( result != 0 ) {
        if (CPLGetLastErrorMsg()) croak( CPLGetLastErrorMsg() ); /* this is usually better */
        croak( OGRErrMessages(result) );
      }
    }
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_RegisterAll) {
  {
    int argvi = 0;
    dXSARGS;
    
    if ((items < 0) || (items > 0)) {
      SWIG_croak("Usage: RegisterAll();");
    }
    {
      CPLErrorReset();
      OGRRegisterAll();
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    
    XSRETURN(argvi);
  fail:
    SWIG_croak_null();
  }
}


XS(_wrap_GetOpenDS) {
  {
    int arg1 ;
    OGRDataSourceShadow *result = 0 ;
    int val1 ;
    int ecode1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: GetOpenDS(ds_number);");
    }
    ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetOpenDS" "', argument " "1"" of type '" "int""'");
    } 
    arg1 = static_cast< int >(val1);
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)GetOpenDS(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}


XS(_wrap_Open) {
  {
    char *arg1 = (char *) 0 ;
    int arg2 = (int) 0 ;
    OGRDataSourceShadow *result = 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: Open(filename,update);");
    }
    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Open" "', argument " "1"" of type '" "char const *""'");
    }
    arg1 = buf1;
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Open" "', argument " "2"" of type '" "int""'");
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)Open((char const *)arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    
    XSRETURN(argvi);
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    
    SWIG_croak_null();
  }
}


XS(_wrap_OpenShared) {
  {
    char *arg1 = (char *) 0 ;
    int arg2 = (int) 0 ;
    OGRDataSourceShadow *result = 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int val2 ;
    int ecode2 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 2)) {
      SWIG_croak("Usage: OpenShared(filename,update);");
    }
    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OpenShared" "', argument " "1"" of type '" "char const *""'");
    }
    arg1 = buf1;
    if (items > 1) {
      ecode2 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
      if (!SWIG_IsOK(ecode2)) {
        SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OpenShared" "', argument " "2"" of type '" "int""'");
      } 
      arg2 = static_cast< int >(val2);
    }
    {
      CPLErrorReset();
      result = (OGRDataSourceShadow *)OpenShared((char const *)arg1,arg2);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDataSourceShadow, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    
    XSRETURN(argvi);
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    
    SWIG_croak_null();
  }
}


XS(_wrap_GetDriverByName) {
  {
    char *arg1 = (char *) 0 ;
    OGRDriverShadow *result = 0 ;
    int res1 ;
    char *buf1 = 0 ;
    int alloc1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: GetDriverByName(name);");
    }
    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
    if (!SWIG_IsOK(res1)) {
      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetDriverByName" "', argument " "1"" of type '" "char const *""'");
    }
    arg1 = buf1;
    {
      CPLErrorReset();
      result = (OGRDriverShadow *)GetDriverByName((char const *)arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    XSRETURN(argvi);
  fail:
    if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
    SWIG_croak_null();
  }
}


XS(_wrap_GetDriver) {
  {
    int arg1 ;
    OGRDriverShadow *result = 0 ;
    int val1 ;
    int ecode1 = 0 ;
    int argvi = 0;
    dXSARGS;
    
    if ((items < 1) || (items > 1)) {
      SWIG_croak("Usage: GetDriver(driver_number);");
    }
    ecode1 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
    if (!SWIG_IsOK(ecode1)) {
      SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetDriver" "', argument " "1"" of type '" "int""'");
    } 
    arg1 = static_cast< int >(val1);
    {
      CPLErrorReset();
      result = (OGRDriverShadow *)GetDriver(arg1);
      CPLErr eclass = CPLGetLastErrorType();
      if ( eclass == CE_Failure || eclass == CE_Fatal ) {
        SWIG_exception_fail( SWIG_RuntimeError, CPLGetLastErrorMsg() );
        
        
        
      }
    }
    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRDriverShadow, 0 | SWIG_SHADOW); argvi++ ;
    
    XSRETURN(argvi);
  fail:
    
    SWIG_croak_null();
  }
}



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

static swig_type_info _swigt__p_OGRDataSourceShadow = {"_p_OGRDataSourceShadow", "OGRDataSourceShadow *", 0, 0, (void*)"Geo::OGR::DataSource", 0};
static swig_type_info _swigt__p_OGRDriverShadow = {"_p_OGRDriverShadow", "OGRDriverShadow *", 0, 0, (void*)"Geo::OGR::Driver", 0};
static swig_type_info _swigt__p_OGRFeatureDefnShadow = {"_p_OGRFeatureDefnShadow", "OGRFeatureDefnShadow *", 0, 0, (void*)"Geo::OGR::FeatureDefn", 0};
static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, (void*)"Geo::OGR::Feature", 0};
static swig_type_info _swigt__p_OGRFieldDefnShadow = {"_p_OGRFieldDefnShadow", "OGRFieldDefnShadow *", 0, 0, (void*)"Geo::OGR::FieldDefn", 0};
static swig_type_info _swigt__p_OGRGeometryShadow = {"_p_OGRGeometryShadow", "OGRGeometryShadow *", 0, 0, (void*)"Geo::OGR::Geometry", 0};
static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)"Geo::OGR::Layer", 0};
static swig_type_info _swigt__p_OSRCoordinateTransformationShadow = {"_p_OSRCoordinateTransformationShadow", "OSRCoordinateTransformationShadow *", 0, 0, (void*)"Geo::OSR::CoordinateTransformation", 0};
static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, (void*)"Geo::OSR::SpatialReference", 0};
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_OGRDataSourceShadow,
  &_swigt__p_OGRDriverShadow,
  &_swigt__p_OGRFeatureDefnShadow,
  &_swigt__p_OGRFeatureShadow,
  &_swigt__p_OGRFieldDefnShadow,
  &_swigt__p_OGRGeometryShadow,
  &_swigt__p_OGRLayerShadow,
  &_swigt__p_OSRCoordinateTransformationShadow,
  &_swigt__p_OSRSpatialReferenceShadow,
  &_swigt__p_char,
  &_swigt__p_double,
  &_swigt__p_int,
  &_swigt__p_p_char,
};

static swig_cast_info _swigc__p_OGRDataSourceShadow[] = {  {&_swigt__p_OGRDataSourceShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OGRDriverShadow[] = {  {&_swigt__p_OGRDriverShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OGRFeatureDefnShadow[] = {  {&_swigt__p_OGRFeatureDefnShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OGRFeatureShadow[] = {  {&_swigt__p_OGRFeatureShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OGRFieldDefnShadow[] = {  {&_swigt__p_OGRFieldDefnShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OGRGeometryShadow[] = {  {&_swigt__p_OGRGeometryShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OSRCoordinateTransformationShadow[] = {  {&_swigt__p_OSRCoordinateTransformationShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_OSRSpatialReferenceShadow[] = {  {&_swigt__p_OSRSpatialReferenceShadow, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_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 *swig_cast_initial[] = {
  _swigc__p_OGRDataSourceShadow,
  _swigc__p_OGRDriverShadow,
  _swigc__p_OGRFeatureDefnShadow,
  _swigc__p_OGRFeatureShadow,
  _swigc__p_OGRFieldDefnShadow,
  _swigc__p_OGRGeometryShadow,
  _swigc__p_OGRLayerShadow,
  _swigc__p_OSRCoordinateTransformationShadow,
  _swigc__p_OSRSpatialReferenceShadow,
  _swigc__p_char,
  _swigc__p_double,
  _swigc__p_int,
  _swigc__p_p_char,
};


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

static swig_constant_info swig_constants[] = {
{0,0,0,0,0,0}
};
#ifdef __cplusplus
}
#endif
static swig_variable_info swig_variables[] = {
{0,0,0,0}
};
static swig_command_info swig_commands[] = {
{"Geo::OGRc::UseExceptions", _wrap_UseExceptions},
{"Geo::OGRc::DontUseExceptions", _wrap_DontUseExceptions},
{"Geo::OGRc::Driver_name_get", _wrap_Driver_name_get},
{"Geo::OGRc::Driver_CreateDataSource", _wrap_Driver_CreateDataSource},
{"Geo::OGRc::Driver_CopyDataSource", _wrap_Driver_CopyDataSource},
{"Geo::OGRc::Driver_Open", _wrap_Driver_Open},
{"Geo::OGRc::Driver_DeleteDataSource", _wrap_Driver_DeleteDataSource},
{"Geo::OGRc::Driver_TestCapability", _wrap_Driver_TestCapability},
{"Geo::OGRc::Driver_GetName", _wrap_Driver_GetName},
{"Geo::OGRc::DataSource_name_get", _wrap_DataSource_name_get},
{"Geo::OGRc::delete_DataSource", _wrap_delete_DataSource},
{"Geo::OGRc::DataSource_GetRefCount", _wrap_DataSource_GetRefCount},
{"Geo::OGRc::DataSource_GetSummaryRefCount", _wrap_DataSource_GetSummaryRefCount},
{"Geo::OGRc::DataSource_GetLayerCount", _wrap_DataSource_GetLayerCount},
{"Geo::OGRc::DataSource_GetDriver", _wrap_DataSource_GetDriver},
{"Geo::OGRc::DataSource_GetName", _wrap_DataSource_GetName},
{"Geo::OGRc::DataSource_DeleteLayer", _wrap_DataSource_DeleteLayer},
{"Geo::OGRc::DataSource_CreateLayer", _wrap_DataSource_CreateLayer},
{"Geo::OGRc::DataSource_CopyLayer", _wrap_DataSource_CopyLayer},
{"Geo::OGRc::DataSource_GetLayerByIndex", _wrap_DataSource_GetLayerByIndex},
{"Geo::OGRc::DataSource_GetLayerByName", _wrap_DataSource_GetLayerByName},
{"Geo::OGRc::DataSource_TestCapability", _wrap_DataSource_TestCapability},
{"Geo::OGRc::DataSource_ExecuteSQL", _wrap_DataSource_ExecuteSQL},
{"Geo::OGRc::DataSource_ReleaseResultSet", _wrap_DataSource_ReleaseResultSet},
{"Geo::OGRc::Layer_GetRefCount", _wrap_Layer_GetRefCount},
{"Geo::OGRc::Layer_SetSpatialFilter", _wrap_Layer_SetSpatialFilter},
{"Geo::OGRc::Layer_SetSpatialFilterRect", _wrap_Layer_SetSpatialFilterRect},
{"Geo::OGRc::Layer_GetSpatialFilter", _wrap_Layer_GetSpatialFilter},
{"Geo::OGRc::Layer_SetAttributeFilter", _wrap_Layer_SetAttributeFilter},
{"Geo::OGRc::Layer_ResetReading", _wrap_Layer_ResetReading},
{"Geo::OGRc::Layer_GetName", _wrap_Layer_GetName},
{"Geo::OGRc::Layer_GetFeature", _wrap_Layer_GetFeature},
{"Geo::OGRc::Layer_GetNextFeature", _wrap_Layer_GetNextFeature},
{"Geo::OGRc::Layer_SetNextByIndex", _wrap_Layer_SetNextByIndex},
{"Geo::OGRc::Layer_SetFeature", _wrap_Layer_SetFeature},
{"Geo::OGRc::Layer_CreateFeature", _wrap_Layer_CreateFeature},
{"Geo::OGRc::Layer_DeleteFeature", _wrap_Layer_DeleteFeature},
{"Geo::OGRc::Layer_SyncToDisk", _wrap_Layer_SyncToDisk},
{"Geo::OGRc::Layer_GetLayerDefn", _wrap_Layer_GetLayerDefn},
{"Geo::OGRc::Layer_GetFeatureCount", _wrap_Layer_GetFeatureCount},
{"Geo::OGRc::Layer_GetExtent", _wrap_Layer_GetExtent},
{"Geo::OGRc::Layer_TestCapability", _wrap_Layer_TestCapability},
{"Geo::OGRc::Layer_CreateField", _wrap_Layer_CreateField},
{"Geo::OGRc::Layer_StartTransaction", _wrap_Layer_StartTransaction},
{"Geo::OGRc::Layer_CommitTransaction", _wrap_Layer_CommitTransaction},
{"Geo::OGRc::Layer_RollbackTransaction", _wrap_Layer_RollbackTransaction},
{"Geo::OGRc::Layer_GetSpatialRef", _wrap_Layer_GetSpatialRef},
{"Geo::OGRc::Layer_GetFeatureRead", _wrap_Layer_GetFeatureRead},
{"Geo::OGRc::delete_Feature", _wrap_delete_Feature},
{"Geo::OGRc::new_Feature", _wrap_new_Feature},
{"Geo::OGRc::Feature_GetDefnRef", _wrap_Feature_GetDefnRef},
{"Geo::OGRc::Feature_SetGeometry", _wrap_Feature_SetGeometry},
{"Geo::OGRc::Feature_SetGeometryDirectly", _wrap_Feature_SetGeometryDirectly},
{"Geo::OGRc::Feature_GetGeometryRef", _wrap_Feature_GetGeometryRef},
{"Geo::OGRc::Feature_Clone", _wrap_Feature_Clone},
{"Geo::OGRc::Feature_Equal", _wrap_Feature_Equal},
{"Geo::OGRc::Feature_GetFieldCount", _wrap_Feature_GetFieldCount},
{"Geo::OGRc::Feature_GetFieldDefnRef", _wrap_Feature_GetFieldDefnRef},
{"Geo::OGRc::Feature_GetFieldAsString", _wrap_Feature_GetFieldAsString},
{"Geo::OGRc::Feature_GetFieldAsInteger", _wrap_Feature_GetFieldAsInteger},
{"Geo::OGRc::Feature_GetFieldAsDouble", _wrap_Feature_GetFieldAsDouble},
{"Geo::OGRc::Feature_IsFieldSet", _wrap_Feature_IsFieldSet},
{"Geo::OGRc::Feature_GetFieldIndex", _wrap_Feature_GetFieldIndex},
{"Geo::OGRc::Feature_GetFID", _wrap_Feature_GetFID},
{"Geo::OGRc::Feature_SetFID", _wrap_Feature_SetFID},
{"Geo::OGRc::Feature_DumpReadable", _wrap_Feature_DumpReadable},
{"Geo::OGRc::Feature_UnsetField", _wrap_Feature_UnsetField},
{"Geo::OGRc::Feature_SetField", _wrap_Feature_SetField},
{"Geo::OGRc::Feature_SetFrom", _wrap_Feature_SetFrom},
{"Geo::OGRc::Feature_GetStyleString", _wrap_Feature_GetStyleString},
{"Geo::OGRc::Feature_SetStyleString", _wrap_Feature_SetStyleString},
{"Geo::OGRc::Feature_GetFieldType", _wrap_Feature_GetFieldType},
{"Geo::OGRc::Feature_GetField", _wrap_Feature_GetField},
{"Geo::OGRc::delete_FeatureDefn", _wrap_delete_FeatureDefn},
{"Geo::OGRc::new_FeatureDefn", _wrap_new_FeatureDefn},
{"Geo::OGRc::FeatureDefn_GetName", _wrap_FeatureDefn_GetName},
{"Geo::OGRc::FeatureDefn_GetFieldCount", _wrap_FeatureDefn_GetFieldCount},
{"Geo::OGRc::FeatureDefn_GetFieldDefn", _wrap_FeatureDefn_GetFieldDefn},
{"Geo::OGRc::FeatureDefn_GetFieldIndex", _wrap_FeatureDefn_GetFieldIndex},
{"Geo::OGRc::FeatureDefn_AddFieldDefn", _wrap_FeatureDefn_AddFieldDefn},
{"Geo::OGRc::FeatureDefn_GetGeomType", _wrap_FeatureDefn_GetGeomType},
{"Geo::OGRc::FeatureDefn_SetGeomType", _wrap_FeatureDefn_SetGeomType},
{"Geo::OGRc::FeatureDefn_GetReferenceCount", _wrap_FeatureDefn_GetReferenceCount},
{"Geo::OGRc::delete_FieldDefn", _wrap_delete_FieldDefn},
{"Geo::OGRc::new_FieldDefn", _wrap_new_FieldDefn},
{"Geo::OGRc::FieldDefn_GetName", _wrap_FieldDefn_GetName},
{"Geo::OGRc::FieldDefn_GetNameRef", _wrap_FieldDefn_GetNameRef},
{"Geo::OGRc::FieldDefn_SetName", _wrap_FieldDefn_SetName},
{"Geo::OGRc::FieldDefn_GetType", _wrap_FieldDefn_GetType},
{"Geo::OGRc::FieldDefn_SetType", _wrap_FieldDefn_SetType},
{"Geo::OGRc::FieldDefn_GetJustify", _wrap_FieldDefn_GetJustify},
{"Geo::OGRc::FieldDefn_SetJustify", _wrap_FieldDefn_SetJustify},
{"Geo::OGRc::FieldDefn_GetWidth", _wrap_FieldDefn_GetWidth},
{"Geo::OGRc::FieldDefn_SetWidth", _wrap_FieldDefn_SetWidth},
{"Geo::OGRc::FieldDefn_GetPrecision", _wrap_FieldDefn_GetPrecision},
{"Geo::OGRc::FieldDefn_SetPrecision", _wrap_FieldDefn_SetPrecision},
{"Geo::OGRc::FieldDefn_GetFieldTypeName", _wrap_FieldDefn_GetFieldTypeName},
{"Geo::OGRc::CreateGeometryFromWkb", _wrap_CreateGeometryFromWkb},
{"Geo::OGRc::CreateGeometryFromWkt", _wrap_CreateGeometryFromWkt},
{"Geo::OGRc::CreateGeometryFromGML", _wrap_CreateGeometryFromGML},
{"Geo::OGRc::delete_Geometry", _wrap_delete_Geometry},
{"Geo::OGRc::new_Geometry", _wrap_new_Geometry},
{"Geo::OGRc::Geometry_ExportToWkt", _wrap_Geometry_ExportToWkt},
{"Geo::OGRc::Geometry_ExportToWkb", _wrap_Geometry_ExportToWkb},
{"Geo::OGRc::Geometry_ExportToGML", _wrap_Geometry_ExportToGML},
{"Geo::OGRc::Geometry_AddPoint", _wrap_Geometry_AddPoint},
{"Geo::OGRc::Geometry_AddGeometryDirectly", _wrap_Geometry_AddGeometryDirectly},
{"Geo::OGRc::Geometry_AddGeometry", _wrap_Geometry_AddGeometry},
{"Geo::OGRc::Geometry_Clone", _wrap_Geometry_Clone},
{"Geo::OGRc::Geometry_GetGeometryType", _wrap_Geometry_GetGeometryType},
{"Geo::OGRc::Geometry_GetGeometryName", _wrap_Geometry_GetGeometryName},
{"Geo::OGRc::Geometry_GetArea", _wrap_Geometry_GetArea},
{"Geo::OGRc::Geometry_GetPointCount", _wrap_Geometry_GetPointCount},
{"Geo::OGRc::Geometry_GetX", _wrap_Geometry_GetX},
{"Geo::OGRc::Geometry_GetY", _wrap_Geometry_GetY},
{"Geo::OGRc::Geometry_GetZ", _wrap_Geometry_GetZ},
{"Geo::OGRc::Geometry_GetGeometryCount", _wrap_Geometry_GetGeometryCount},
{"Geo::OGRc::Geometry_SetPoint", _wrap_Geometry_SetPoint},
{"Geo::OGRc::Geometry_GetGeometryRef", _wrap_Geometry_GetGeometryRef},
{"Geo::OGRc::Geometry_GetBoundary", _wrap_Geometry_GetBoundary},
{"Geo::OGRc::Geometry_ConvexHull", _wrap_Geometry_ConvexHull},
{"Geo::OGRc::Geometry_Buffer", _wrap_Geometry_Buffer},
{"Geo::OGRc::Geometry_Intersection", _wrap_Geometry_Intersection},
{"Geo::OGRc::Geometry_Union", _wrap_Geometry_Union},
{"Geo::OGRc::Geometry_Difference", _wrap_Geometry_Difference},
{"Geo::OGRc::Geometry_SymmetricDifference", _wrap_Geometry_SymmetricDifference},
{"Geo::OGRc::Geometry_Distance", _wrap_Geometry_Distance},
{"Geo::OGRc::Geometry_Empty", _wrap_Geometry_Empty},
{"Geo::OGRc::Geometry_Intersect", _wrap_Geometry_Intersect},
{"Geo::OGRc::Geometry_Equal", _wrap_Geometry_Equal},
{"Geo::OGRc::Geometry_Disjoint", _wrap_Geometry_Disjoint},
{"Geo::OGRc::Geometry_Touches", _wrap_Geometry_Touches},
{"Geo::OGRc::Geometry_Crosses", _wrap_Geometry_Crosses},
{"Geo::OGRc::Geometry_Within", _wrap_Geometry_Within},
{"Geo::OGRc::Geometry_Contains", _wrap_Geometry_Contains},
{"Geo::OGRc::Geometry_Overlaps", _wrap_Geometry_Overlaps},
{"Geo::OGRc::Geometry_TransformTo", _wrap_Geometry_TransformTo},
{"Geo::OGRc::Geometry_Transform", _wrap_Geometry_Transform},
{"Geo::OGRc::Geometry_GetSpatialReference", _wrap_Geometry_GetSpatialReference},
{"Geo::OGRc::Geometry_AssignSpatialReference", _wrap_Geometry_AssignSpatialReference},
{"Geo::OGRc::Geometry_CloseRings", _wrap_Geometry_CloseRings},
{"Geo::OGRc::Geometry_FlattenTo2D", _wrap_Geometry_FlattenTo2D},
{"Geo::OGRc::Geometry_GetEnvelope", _wrap_Geometry_GetEnvelope},
{"Geo::OGRc::Geometry_Centroid", _wrap_Geometry_Centroid},
{"Geo::OGRc::Geometry_WkbSize", _wrap_Geometry_WkbSize},
{"Geo::OGRc::Geometry_GetCoordinateDimension", _wrap_Geometry_GetCoordinateDimension},
{"Geo::OGRc::Geometry_SetCoordinateDimension", _wrap_Geometry_SetCoordinateDimension},
{"Geo::OGRc::Geometry_GetDimension", _wrap_Geometry_GetDimension},
{"Geo::OGRc::GetDriverCount", _wrap_GetDriverCount},
{"Geo::OGRc::GetOpenDSCount", _wrap_GetOpenDSCount},
{"Geo::OGRc::SetGenerate_DB2_V72_BYTE_ORDER", _wrap_SetGenerate_DB2_V72_BYTE_ORDER},
{"Geo::OGRc::RegisterAll", _wrap_RegisterAll},
{"Geo::OGRc::GetOpenDS", _wrap_GetOpenDS},
{"Geo::OGRc::Open", _wrap_Open},
{"Geo::OGRc::OpenShared", _wrap_OpenShared},
{"Geo::OGRc::GetDriverByName", _wrap_GetDriverByName},
{"Geo::OGRc::GetDriver", _wrap_GetDriver},
{0,0}
};
/* -----------------------------------------------------------------------------
 * 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" {
#if 0
} /* c-mode */
#endif
#endif

#if 0
#define SWIGRUNTIME_DEBUG
#endif

SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  size_t i;
  swig_module_info *module_head;
  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 */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *ret;
    swig_cast_info *cast;
    
#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
#endif
    
    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
        type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }
    
    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {
      /* Don't need to add information already in the list */
      ret = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
      }
      if (ret) {
        if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
          cast->type = ret;
          ret = 0;
        } else {
          /* Check for casting already in the list */
          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
          if (!ocast) ret = 0;
        }
      }
      
      if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        if (type->cast) {
          type->cast->prev = cast;
          cast->next = type->cast;
        }
        type->cast = cast;
      }
      cast++;
    }
    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;
  
#ifdef SWIGRUNTIME_DEBUG
  printf("**** SWIG_InitializeModule: Cast List ******\n");
  for (i = 0; i < swig_module.size; ++i) {
    int j = 0;
    swig_cast_info *cast = swig_module.cast_initial[i];
    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
    printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  swig_cast_info *equiv;
  static int init_run = 0;
  
  if (init_run) return;
  init_run = 1;
  
  for (i = 0; i < swig_module.size; i++) {
    if (swig_module.types[i]->clientdata) {
      equiv = swig_module.types[i]->cast;
      while (equiv) {
        if (!equiv->converter) {
          if (equiv->type && !equiv->type->clientdata)
          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
        }
        equiv = equiv->next;
      }
    }
  }
}

#ifdef __cplusplus
#if 0
{
  /* c-mode */
#endif
}
#endif



#ifdef __cplusplus
extern "C"
#endif

XS(SWIG_init) {
  dXSARGS;
  int i;
  
  SWIG_InitializeModule(0);
  
  /* Install commands */
  for (i = 0; swig_commands[i].name; i++) {
    newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
  }
  
  /* Install variables */
  for (i = 0; swig_variables[i].name; i++) {
    SV *sv;
    sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
    if (swig_variables[i].type) {
      SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
    } else {
      sv_setiv(sv,(IV) 0);
    }
    swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
  }
  
  /* Install constant */
  for (i = 0; swig_constants[i].type; i++) {
    SV *sv;
    sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
    switch(swig_constants[i].type) {
    case SWIG_INT:
      sv_setiv(sv, (IV) swig_constants[i].lvalue);
      break;
    case SWIG_FLOAT:
      sv_setnv(sv, (double) swig_constants[i].dvalue);
      break;
    case SWIG_STRING:
      sv_setpv(sv, (char *) swig_constants[i].pvalue);
      break;
    case SWIG_POINTER:
      SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
      break;
    case SWIG_BINARY:
      SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
      break;
    default:
      break;
    }
    SvREADONLY_on(sv);
  }
  
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkb25Bit", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbUnknown", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(0)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbPoint", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(1)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbLineString", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(2)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbPolygon", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(3)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbMultiPoint", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(4)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbMultiLineString", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(5)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbMultiPolygon", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(6)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbGeometryCollection", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(7)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbNone", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(100)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbLinearRing", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(101)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbPoint25D", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkbPoint+wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbLineString25D", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkbLineString+wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbPolygon25D", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkbPolygon+wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbMultiPoint25D", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkbMultiPoint+wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbMultiLineString25D", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkbMultiLineString+wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbMultiPolygon25D", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkbMultiPolygon+wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbGeometryCollection25D", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(wkbGeometryCollection+wkb25DBit)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTInteger", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(0)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTIntegerList", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(1)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTReal", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(2)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTRealList", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(3)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTString", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(4)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTStringList", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(5)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTWideString", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(6)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTWideStringList", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(7)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTBinary", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(8)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTDate", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(9)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTTime", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(10)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OFTDateTime", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(11)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OJUndefined", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(0)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OJLeft", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(1)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OJRight", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(2)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbXDR", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(0)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "wkbNDR", TRUE | 0x2);
    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1(static_cast< int >(1)));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCRandomRead", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("RandomRead"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCSequentialWrite", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("SequentialWrite"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCRandomWrite", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("RandomWrite"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCFastSpatialFilter", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("FastSpatialFilter"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCFastFeatureCount", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("FastFeatureCount"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCFastGetExtent", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("FastGetExtent"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCCreateField", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("CreateField"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCTransactions", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("Transactions"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCDeleteFeature", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("DeleteFeature"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "OLCFastSetNextByIndex", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("FastSetNextByIndex"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "ODsCCreateLayer", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("CreateLayer"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "ODsCDeleteLayer", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("DeleteLayer"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "ODrCCreateDataSource", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("CreateDataSource"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  /*@SWIG:%set_constant@*/ do {
    SV *sv = get_sv((char*) SWIG_prefix "ODrCDeleteDataSource", TRUE | 0x2);
    sv_setsv(sv, SWIG_FromCharPtr("DeleteDataSource"));
    SvREADONLY_on(sv);
  } while(0) /*@SWIG@*/;
  
  
  UseExceptions();
  if ( OGRGetDriverCount() == 0 ) {
    OGRRegisterAll();
  }
  
  
  SWIG_TypeClientData(SWIGTYPE_p_OGRDriverShadow, (void*) "Geo::OGR::Driver");
  SWIG_TypeClientData(SWIGTYPE_p_OGRDataSourceShadow, (void*) "Geo::OGR::DataSource");
  SWIG_TypeClientData(SWIGTYPE_p_OGRLayerShadow, (void*) "Geo::OGR::Layer");
  SWIG_TypeClientData(SWIGTYPE_p_OGRFeatureShadow, (void*) "Geo::OGR::Feature");
  SWIG_TypeClientData(SWIGTYPE_p_OGRFeatureDefnShadow, (void*) "Geo::OGR::FeatureDefn");
  SWIG_TypeClientData(SWIGTYPE_p_OGRFieldDefnShadow, (void*) "Geo::OGR::FieldDefn");
  SWIG_TypeClientData(SWIGTYPE_p_OGRGeometryShadow, (void*) "Geo::OGR::Geometry");
  ST(0) = &PL_sv_yes;
  XSRETURN(1);
}

