1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 
12 #ifndef SWIGPYTHON
13 #define SWIGPYTHON
14 #define SED_HACKS
15 #endif
16 
17 #define SWIG_PYTHON_THREADS
18 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
19 
20 
21 #ifdef __cplusplus
22 /* SwigValueWrapper is described in swig.swg */
23 template<typename T> class SwigValueWrapper {
24   struct SwigMovePointer {
25     T *ptr;
SwigMovePointerSwigValueWrapper::SwigMovePointer26     SwigMovePointer(T *p) : ptr(p) { }
~SwigMovePointerSwigValueWrapper::SwigMovePointer27     ~SwigMovePointer() { delete ptr; }
operator =SwigValueWrapper::SwigMovePointer28     SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
29   } pointer;
30   SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
31   SwigValueWrapper(const SwigValueWrapper<T>& rhs);
32 public:
SwigValueWrapper()33   SwigValueWrapper() : pointer(0) { }
operator =(const T & t)34   SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
operator T&() const35   operator T&() const { return *pointer.ptr; }
operator &()36   T *operator&() { return pointer.ptr; }
37 };
38 
SwigValueInit()39 template <typename T> T SwigValueInit() {
40   return T();
41 }
42 #endif
43 
44 /* -----------------------------------------------------------------------------
45  *  This section contains generic SWIG labels for method/variable
46  *  declarations/attributes, and other compiler dependent labels.
47  * ----------------------------------------------------------------------------- */
48 
49 /* template workaround for compilers that cannot correctly implement the C++ standard */
50 #ifndef SWIGTEMPLATEDISAMBIGUATOR
51 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
52 #  define SWIGTEMPLATEDISAMBIGUATOR template
53 # elif defined(__HP_aCC)
54 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
55 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
56 #  define SWIGTEMPLATEDISAMBIGUATOR template
57 # else
58 #  define SWIGTEMPLATEDISAMBIGUATOR
59 # endif
60 #endif
61 
62 /* inline attribute */
63 #ifndef SWIGINLINE
64 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
65 #   define SWIGINLINE inline
66 # else
67 #   define SWIGINLINE
68 # endif
69 #endif
70 
71 /* attribute recognised by some compilers to avoid 'unused' warnings */
72 #ifndef SWIGUNUSED
73 # if defined(__GNUC__)
74 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
75 #     define SWIGUNUSED __attribute__ ((__unused__))
76 #   else
77 #     define SWIGUNUSED
78 #   endif
79 # elif defined(__ICC)
80 #   define SWIGUNUSED __attribute__ ((__unused__))
81 # else
82 #   define SWIGUNUSED
83 # endif
84 #endif
85 
86 #ifndef SWIG_MSC_UNSUPPRESS_4505
87 # if defined(_MSC_VER)
88 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
89 # endif
90 #endif
91 
92 #ifndef SWIGUNUSEDPARM
93 # ifdef __cplusplus
94 #   define SWIGUNUSEDPARM(p)
95 # else
96 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
97 # endif
98 #endif
99 
100 /* internal SWIG method */
101 #ifndef SWIGINTERN
102 # define SWIGINTERN static SWIGUNUSED
103 #endif
104 
105 /* internal inline SWIG method */
106 #ifndef SWIGINTERNINLINE
107 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
108 #endif
109 
110 /* exporting methods */
111 #if defined(__GNUC__)
112 #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
113 #    ifndef GCC_HASCLASSVISIBILITY
114 #      define GCC_HASCLASSVISIBILITY
115 #    endif
116 #  endif
117 #endif
118 
119 #ifndef SWIGEXPORT
120 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
121 #   if defined(STATIC_LINKED)
122 #     define SWIGEXPORT
123 #   else
124 #     define SWIGEXPORT __declspec(dllexport)
125 #   endif
126 # else
127 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
128 #     define SWIGEXPORT __attribute__ ((visibility("default")))
129 #   else
130 #     define SWIGEXPORT
131 #   endif
132 # endif
133 #endif
134 
135 /* calling conventions for Windows */
136 #ifndef SWIGSTDCALL
137 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
138 #   define SWIGSTDCALL __stdcall
139 # else
140 #   define SWIGSTDCALL
141 # endif
142 #endif
143 
144 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
145 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
146 # define _CRT_SECURE_NO_DEPRECATE
147 #endif
148 
149 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
150 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
151 # define _SCL_SECURE_NO_DEPRECATE
152 #endif
153 
154 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
155 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
156 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
157 #endif
158 
159 /* Intel's compiler complains if a variable which was never initialised is
160  * cast to void, which is a common idiom which we use to indicate that we
161  * are aware a variable isn't used.  So we just silence that warning.
162  * See: https://github.com/swig/swig/issues/192 for more discussion.
163  */
164 #ifdef __INTEL_COMPILER
165 # pragma warning disable 592
166 #endif
167 
168 
169 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
170 /* Use debug wrappers with the Python release dll */
171 # undef _DEBUG
172 # include <Python.h>
173 # define _DEBUG
174 #else
175 # include <Python.h>
176 #endif
177 
178 /* -----------------------------------------------------------------------------
179  * swigrun.swg
180  *
181  * This file contains generic C API SWIG runtime support for pointer
182  * type checking.
183  * ----------------------------------------------------------------------------- */
184 
185 /* This should only be incremented when either the layout of swig_type_info changes,
186    or for whatever reason, the runtime changes incompatibly */
187 #define SWIG_RUNTIME_VERSION "4"
188 
189 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
190 #ifdef SWIG_TYPE_TABLE
191 # define SWIG_QUOTE_STRING(x) #x
192 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
193 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
194 #else
195 # define SWIG_TYPE_TABLE_NAME
196 #endif
197 
198 /*
199   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
200   creating a static or dynamic library from the SWIG runtime code.
201   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
202 
203   But only do this if strictly necessary, ie, if you have problems
204   with your compiler or suchlike.
205 */
206 
207 #ifndef SWIGRUNTIME
208 # define SWIGRUNTIME SWIGINTERN
209 #endif
210 
211 #ifndef SWIGRUNTIMEINLINE
212 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
213 #endif
214 
215 /*  Generic buffer size */
216 #ifndef SWIG_BUFFER_SIZE
217 # define SWIG_BUFFER_SIZE 1024
218 #endif
219 
220 /* Flags for pointer conversions */
221 #define SWIG_POINTER_DISOWN        0x1
222 #define SWIG_CAST_NEW_MEMORY       0x2
223 
224 /* Flags for new pointer objects */
225 #define SWIG_POINTER_OWN           0x1
226 
227 
228 /*
229    Flags/methods for returning states.
230 
231    The SWIG conversion methods, as ConvertPtr, return an integer
232    that tells if the conversion was successful or not. And if not,
233    an error code can be returned (see swigerrors.swg for the codes).
234 
235    Use the following macros/flags to set or process the returning
236    states.
237 
238    In old versions of SWIG, code such as the following was usually written:
239 
240      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
241        // success code
242      } else {
243        //fail code
244      }
245 
246    Now you can be more explicit:
247 
248     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
249     if (SWIG_IsOK(res)) {
250       // success code
251     } else {
252       // fail code
253     }
254 
255    which is the same really, but now you can also do
256 
257     Type *ptr;
258     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
259     if (SWIG_IsOK(res)) {
260       // success code
261       if (SWIG_IsNewObj(res) {
262         ...
263 	delete *ptr;
264       } else {
265         ...
266       }
267     } else {
268       // fail code
269     }
270 
271    I.e., now SWIG_ConvertPtr can return new objects and you can
272    identify the case and take care of the deallocation. Of course that
273    also requires SWIG_ConvertPtr to return new result values, such as
274 
275       int SWIG_ConvertPtr(obj, ptr,...) {
276         if (<obj is ok>) {
277           if (<need new object>) {
278             *ptr = <ptr to new allocated object>;
279             return SWIG_NEWOBJ;
280           } else {
281             *ptr = <ptr to old object>;
282             return SWIG_OLDOBJ;
283           }
284         } else {
285           return SWIG_BADOBJ;
286         }
287       }
288 
289    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
290    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
291    SWIG errors code.
292 
293    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
294    allows to return the 'cast rank', for example, if you have this
295 
296        int food(double)
297        int fooi(int);
298 
299    and you call
300 
301       food(1)   // cast rank '1'  (1 -> 1.0)
302       fooi(1)   // cast rank '0'
303 
304    just use the SWIG_AddCast()/SWIG_CheckState()
305 */
306 
307 #define SWIG_OK                    (0)
308 #define SWIG_ERROR                 (-1)
309 #define SWIG_IsOK(r)               (r >= 0)
310 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
311 
312 /* The CastRankLimit says how many bits are used for the cast rank */
313 #define SWIG_CASTRANKLIMIT         (1 << 8)
314 /* The NewMask denotes the object was created (using new/malloc) */
315 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
316 /* The TmpMask is for in/out typemaps that use temporal objects */
317 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
318 /* Simple returning values */
319 #define SWIG_BADOBJ                (SWIG_ERROR)
320 #define SWIG_OLDOBJ                (SWIG_OK)
321 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
322 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
323 /* Check, add and del mask methods */
324 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
325 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
326 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
327 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
328 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
329 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
330 
331 /* Cast-Rank Mode */
332 #if defined(SWIG_CASTRANK_MODE)
333 #  ifndef SWIG_TypeRank
334 #    define SWIG_TypeRank             unsigned long
335 #  endif
336 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
337 #    define SWIG_MAXCASTRANK          (2)
338 #  endif
339 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
340 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)341 SWIGINTERNINLINE int SWIG_AddCast(int r) {
342   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
343 }
SWIG_CheckState(int r)344 SWIGINTERNINLINE int SWIG_CheckState(int r) {
345   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
346 }
347 #else /* no cast-rank mode */
348 #  define SWIG_AddCast(r) (r)
349 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
350 #endif
351 
352 
353 #include <string.h>
354 
355 #ifdef __cplusplus
356 extern "C" {
357 #endif
358 
359 typedef void *(*swig_converter_func)(void *, int *);
360 typedef struct swig_type_info *(*swig_dycast_func)(void **);
361 
362 /* Structure to store information on one type */
363 typedef struct swig_type_info {
364   const char             *name;			/* mangled name of this type */
365   const char             *str;			/* human readable name of this type */
366   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
367   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
368   void                   *clientdata;		/* language specific type data */
369   int                    owndata;		/* flag if the structure owns the clientdata */
370 } swig_type_info;
371 
372 /* Structure to store a type and conversion function used for casting */
373 typedef struct swig_cast_info {
374   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
375   swig_converter_func     converter;		/* function to cast the void pointers */
376   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
377   struct swig_cast_info  *prev;			/* pointer to the previous cast */
378 } swig_cast_info;
379 
380 /* Structure used to store module information
381  * Each module generates one structure like this, and the runtime collects
382  * all of these structures and stores them in a circularly linked list.*/
383 typedef struct swig_module_info {
384   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
385   size_t                 size;		        /* Number of types in this module */
386   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
387   swig_type_info         **type_initial;	/* Array of initially generated type structures */
388   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
389   void                    *clientdata;		/* Language specific module data */
390 } swig_module_info;
391 
392 /*
393   Compare two type names skipping the space characters, therefore
394   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
395 
396   Return 0 when the two name types are equivalent, as in
397   strncmp, but skipping ' '.
398 */
399 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)400 SWIG_TypeNameComp(const char *f1, const char *l1,
401 		  const char *f2, const char *l2) {
402   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
403     while ((*f1 == ' ') && (f1 != l1)) ++f1;
404     while ((*f2 == ' ') && (f2 != l2)) ++f2;
405     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
406   }
407   return (int)((l1 - f1) - (l2 - f2));
408 }
409 
410 /*
411   Check type equivalence in a name list like <name1>|<name2>|...
412   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
413 */
414 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)415 SWIG_TypeCmp(const char *nb, const char *tb) {
416   int equiv = 1;
417   const char* te = tb + strlen(tb);
418   const char* ne = nb;
419   while (equiv != 0 && *ne) {
420     for (nb = ne; *ne; ++ne) {
421       if (*ne == '|') break;
422     }
423     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
424     if (*ne) ++ne;
425   }
426   return equiv;
427 }
428 
429 /*
430   Check type equivalence in a name list like <name1>|<name2>|...
431   Return 0 if not equal, 1 if equal
432 */
433 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)434 SWIG_TypeEquiv(const char *nb, const char *tb) {
435   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
436 }
437 
438 /*
439   Check the typename
440 */
441 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)442 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
443   if (ty) {
444     swig_cast_info *iter = ty->cast;
445     while (iter) {
446       if (strcmp(iter->type->name, c) == 0) {
447         if (iter == ty->cast)
448           return iter;
449         /* Move iter to the top of the linked list */
450         iter->prev->next = iter->next;
451         if (iter->next)
452           iter->next->prev = iter->prev;
453         iter->next = ty->cast;
454         iter->prev = 0;
455         if (ty->cast) ty->cast->prev = iter;
456         ty->cast = iter;
457         return iter;
458       }
459       iter = iter->next;
460     }
461   }
462   return 0;
463 }
464 
465 /*
466   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
467 */
468 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)469 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
470   if (ty) {
471     swig_cast_info *iter = ty->cast;
472     while (iter) {
473       if (iter->type == from) {
474         if (iter == ty->cast)
475           return iter;
476         /* Move iter to the top of the linked list */
477         iter->prev->next = iter->next;
478         if (iter->next)
479           iter->next->prev = iter->prev;
480         iter->next = ty->cast;
481         iter->prev = 0;
482         if (ty->cast) ty->cast->prev = iter;
483         ty->cast = iter;
484         return iter;
485       }
486       iter = iter->next;
487     }
488   }
489   return 0;
490 }
491 
492 /*
493   Cast a pointer up an inheritance hierarchy
494 */
495 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)496 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
497   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
498 }
499 
500 /*
501    Dynamic pointer casting. Down an inheritance hierarchy
502 */
503 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)504 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
505   swig_type_info *lastty = ty;
506   if (!ty || !ty->dcast) return ty;
507   while (ty && (ty->dcast)) {
508     ty = (*ty->dcast)(ptr);
509     if (ty) lastty = ty;
510   }
511   return lastty;
512 }
513 
514 /*
515   Return the name associated with this type
516 */
517 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)518 SWIG_TypeName(const swig_type_info *ty) {
519   return ty->name;
520 }
521 
522 /*
523   Return the pretty name associated with this type,
524   that is an unmangled type name in a form presentable to the user.
525 */
526 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)527 SWIG_TypePrettyName(const swig_type_info *type) {
528   /* The "str" field contains the equivalent pretty names of the
529      type, separated by vertical-bar characters.  We choose
530      to print the last name, as it is often (?) the most
531      specific. */
532   if (!type) return NULL;
533   if (type->str != NULL) {
534     const char *last_name = type->str;
535     const char *s;
536     for (s = type->str; *s; s++)
537       if (*s == '|') last_name = s+1;
538     return last_name;
539   }
540   else
541     return type->name;
542 }
543 
544 /*
545    Set the clientdata field for a type
546 */
547 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)548 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
549   swig_cast_info *cast = ti->cast;
550   /* if (ti->clientdata == clientdata) return; */
551   ti->clientdata = clientdata;
552 
553   while (cast) {
554     if (!cast->converter) {
555       swig_type_info *tc = cast->type;
556       if (!tc->clientdata) {
557 	SWIG_TypeClientData(tc, clientdata);
558       }
559     }
560     cast = cast->next;
561   }
562 }
563 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)564 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
565   SWIG_TypeClientData(ti, clientdata);
566   ti->owndata = 1;
567 }
568 
569 /*
570   Search for a swig_type_info structure only by mangled name
571   Search is a O(log #types)
572 
573   We start searching at module start, and finish searching when start == end.
574   Note: if start == end at the beginning of the function, we go all the way around
575   the circular list.
576 */
577 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)578 SWIG_MangledTypeQueryModule(swig_module_info *start,
579                             swig_module_info *end,
580 		            const char *name) {
581   swig_module_info *iter = start;
582   do {
583     if (iter->size) {
584       size_t l = 0;
585       size_t r = iter->size - 1;
586       do {
587 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
588 	size_t i = (l + r) >> 1;
589 	const char *iname = iter->types[i]->name;
590 	if (iname) {
591 	  int compare = strcmp(name, iname);
592 	  if (compare == 0) {
593 	    return iter->types[i];
594 	  } else if (compare < 0) {
595 	    if (i) {
596 	      r = i - 1;
597 	    } else {
598 	      break;
599 	    }
600 	  } else if (compare > 0) {
601 	    l = i + 1;
602 	  }
603 	} else {
604 	  break; /* should never happen */
605 	}
606       } while (l <= r);
607     }
608     iter = iter->next;
609   } while (iter != end);
610   return 0;
611 }
612 
613 /*
614   Search for a swig_type_info structure for either a mangled name or a human readable name.
615   It first searches the mangled names of the types, which is a O(log #types)
616   If a type is not found it then searches the human readable names, which is O(#types).
617 
618   We start searching at module start, and finish searching when start == end.
619   Note: if start == end at the beginning of the function, we go all the way around
620   the circular list.
621 */
622 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)623 SWIG_TypeQueryModule(swig_module_info *start,
624                      swig_module_info *end,
625 		     const char *name) {
626   /* STEP 1: Search the name field using binary search */
627   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
628   if (ret) {
629     return ret;
630   } else {
631     /* STEP 2: If the type hasn't been found, do a complete search
632        of the str field (the human readable name) */
633     swig_module_info *iter = start;
634     do {
635       size_t i = 0;
636       for (; i < iter->size; ++i) {
637 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
638 	  return iter->types[i];
639       }
640       iter = iter->next;
641     } while (iter != end);
642   }
643 
644   /* neither found a match */
645   return 0;
646 }
647 
648 /*
649    Pack binary data into a string
650 */
651 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)652 SWIG_PackData(char *c, void *ptr, size_t sz) {
653   static const char hex[17] = "0123456789abcdef";
654   const unsigned char *u = (unsigned char *) ptr;
655   const unsigned char *eu =  u + sz;
656   for (; u != eu; ++u) {
657     unsigned char uu = *u;
658     *(c++) = hex[(uu & 0xf0) >> 4];
659     *(c++) = hex[uu & 0xf];
660   }
661   return c;
662 }
663 
664 /*
665    Unpack binary data from a string
666 */
667 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)668 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
669   unsigned char *u = (unsigned char *) ptr;
670   const unsigned char *eu = u + sz;
671   for (; u != eu; ++u) {
672     char d = *(c++);
673     unsigned char uu;
674     if ((d >= '0') && (d <= '9'))
675       uu = (unsigned char)((d - '0') << 4);
676     else if ((d >= 'a') && (d <= 'f'))
677       uu = (unsigned char)((d - ('a'-10)) << 4);
678     else
679       return (char *) 0;
680     d = *(c++);
681     if ((d >= '0') && (d <= '9'))
682       uu |= (unsigned char)(d - '0');
683     else if ((d >= 'a') && (d <= 'f'))
684       uu |= (unsigned char)(d - ('a'-10));
685     else
686       return (char *) 0;
687     *u = uu;
688   }
689   return c;
690 }
691 
692 /*
693    Pack 'void *' into a string buffer.
694 */
695 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)696 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
697   char *r = buff;
698   if ((2*sizeof(void *) + 2) > bsz) return 0;
699   *(r++) = '_';
700   r = SWIG_PackData(r,&ptr,sizeof(void *));
701   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
702   strcpy(r,name);
703   return buff;
704 }
705 
706 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)707 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
708   if (*c != '_') {
709     if (strcmp(c,"NULL") == 0) {
710       *ptr = (void *) 0;
711       return name;
712     } else {
713       return 0;
714     }
715   }
716   return SWIG_UnpackData(++c,ptr,sizeof(void *));
717 }
718 
719 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)720 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
721   char *r = buff;
722   size_t lname = (name ? strlen(name) : 0);
723   if ((2*sz + 2 + lname) > bsz) return 0;
724   *(r++) = '_';
725   r = SWIG_PackData(r,ptr,sz);
726   if (lname) {
727     strncpy(r,name,lname+1);
728   } else {
729     *r = 0;
730   }
731   return buff;
732 }
733 
734 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)735 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
736   if (*c != '_') {
737     if (strcmp(c,"NULL") == 0) {
738       memset(ptr,0,sz);
739       return name;
740     } else {
741       return 0;
742     }
743   }
744   return SWIG_UnpackData(++c,ptr,sz);
745 }
746 
747 #ifdef __cplusplus
748 }
749 #endif
750 
751 /*  Errors in SWIG */
752 #define  SWIG_UnknownError    	   -1
753 #define  SWIG_IOError        	   -2
754 #define  SWIG_RuntimeError   	   -3
755 #define  SWIG_IndexError     	   -4
756 #define  SWIG_TypeError      	   -5
757 #define  SWIG_DivisionByZero 	   -6
758 #define  SWIG_OverflowError  	   -7
759 #define  SWIG_SyntaxError    	   -8
760 #define  SWIG_ValueError     	   -9
761 #define  SWIG_SystemError    	   -10
762 #define  SWIG_AttributeError 	   -11
763 #define  SWIG_MemoryError    	   -12
764 #define  SWIG_NullReferenceError   -13
765 
766 
767 
768 /* Compatibility macros for Python 3 */
769 #if PY_VERSION_HEX >= 0x03000000
770 
771 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
772 #define PyInt_Check(x) PyLong_Check(x)
773 #define PyInt_AsLong(x) PyLong_AsLong(x)
774 #define PyInt_FromLong(x) PyLong_FromLong(x)
775 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
776 #define PyString_Check(name) PyBytes_Check(name)
777 #define PyString_FromString(x) PyUnicode_FromString(x)
778 #define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
779 #define PyString_AsString(str) PyBytes_AsString(str)
780 #define PyString_Size(str) PyBytes_Size(str)
781 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
782 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
783 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
784 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
785 
786 #endif
787 
788 #ifndef Py_TYPE
789 #  define Py_TYPE(op) ((op)->ob_type)
790 #endif
791 
792 /* SWIG APIs for compatibility of both Python 2 & 3 */
793 
794 #if PY_VERSION_HEX >= 0x03000000
795 #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
796 #else
797 #  define SWIG_Python_str_FromFormat PyString_FromFormat
798 #endif
799 
800 
801 /* Warning: This function will allocate a new string in Python 3,
802  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
803  */
804 SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject * str)805 SWIG_Python_str_AsChar(PyObject *str)
806 {
807 #if PY_VERSION_HEX >= 0x03000000
808   char *cstr;
809   char *newstr;
810   Py_ssize_t len;
811   str = PyUnicode_AsUTF8String(str);
812   PyBytes_AsStringAndSize(str, &cstr, &len);
813   newstr = (char *) malloc(len+1);
814   memcpy(newstr, cstr, len+1);
815   Py_XDECREF(str);
816   return newstr;
817 #else
818   return PyString_AsString(str);
819 #endif
820 }
821 
822 #if PY_VERSION_HEX >= 0x03000000
823 #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
824 #else
825 #  define SWIG_Python_str_DelForPy3(x)
826 #endif
827 
828 
829 SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char * c)830 SWIG_Python_str_FromChar(const char *c)
831 {
832 #if PY_VERSION_HEX >= 0x03000000
833   return PyUnicode_FromString(c);
834 #else
835   return PyString_FromString(c);
836 #endif
837 }
838 
839 /* Add PyOS_snprintf for old Pythons */
840 #if PY_VERSION_HEX < 0x02020000
841 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
842 #  define PyOS_snprintf _snprintf
843 # else
844 #  define PyOS_snprintf snprintf
845 # endif
846 #endif
847 
848 /* A crude PyString_FromFormat implementation for old Pythons */
849 #if PY_VERSION_HEX < 0x02020000
850 
851 #ifndef SWIG_PYBUFFER_SIZE
852 # define SWIG_PYBUFFER_SIZE 1024
853 #endif
854 
855 static PyObject *
PyString_FromFormat(const char * fmt,...)856 PyString_FromFormat(const char *fmt, ...) {
857   va_list ap;
858   char buf[SWIG_PYBUFFER_SIZE * 2];
859   int res;
860   va_start(ap, fmt);
861   res = vsnprintf(buf, sizeof(buf), fmt, ap);
862   va_end(ap);
863   return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
864 }
865 #endif
866 
867 #ifndef PyObject_DEL
868 # define PyObject_DEL PyObject_Del
869 #endif
870 
871 /* A crude PyExc_StopIteration exception for old Pythons */
872 #if PY_VERSION_HEX < 0x02020000
873 # ifndef PyExc_StopIteration
874 #  define PyExc_StopIteration PyExc_RuntimeError
875 # endif
876 # ifndef PyObject_GenericGetAttr
877 #  define PyObject_GenericGetAttr 0
878 # endif
879 #endif
880 
881 /* Py_NotImplemented is defined in 2.1 and up. */
882 #if PY_VERSION_HEX < 0x02010000
883 # ifndef Py_NotImplemented
884 #  define Py_NotImplemented PyExc_RuntimeError
885 # endif
886 #endif
887 
888 /* A crude PyString_AsStringAndSize implementation for old Pythons */
889 #if PY_VERSION_HEX < 0x02010000
890 # ifndef PyString_AsStringAndSize
891 #  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
892 # endif
893 #endif
894 
895 /* PySequence_Size for old Pythons */
896 #if PY_VERSION_HEX < 0x02000000
897 # ifndef PySequence_Size
898 #  define PySequence_Size PySequence_Length
899 # endif
900 #endif
901 
902 /* PyBool_FromLong for old Pythons */
903 #if PY_VERSION_HEX < 0x02030000
904 static
PyBool_FromLong(long ok)905 PyObject *PyBool_FromLong(long ok)
906 {
907   PyObject *result = ok ? Py_True : Py_False;
908   Py_INCREF(result);
909   return result;
910 }
911 #endif
912 
913 /* Py_ssize_t for old Pythons */
914 /* This code is as recommended by: */
915 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
916 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
917 typedef int Py_ssize_t;
918 # define PY_SSIZE_T_MAX INT_MAX
919 # define PY_SSIZE_T_MIN INT_MIN
920 typedef inquiry lenfunc;
921 typedef intargfunc ssizeargfunc;
922 typedef intintargfunc ssizessizeargfunc;
923 typedef intobjargproc ssizeobjargproc;
924 typedef intintobjargproc ssizessizeobjargproc;
925 typedef getreadbufferproc readbufferproc;
926 typedef getwritebufferproc writebufferproc;
927 typedef getsegcountproc segcountproc;
928 typedef getcharbufferproc charbufferproc;
PyNumber_AsSsize_t(PyObject * x,void * SWIGUNUSEDPARM (exc))929 static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
930 {
931   long result = 0;
932   PyObject *i = PyNumber_Int(x);
933   if (i) {
934     result = PyInt_AsLong(i);
935     Py_DECREF(i);
936   }
937   return result;
938 }
939 #endif
940 
941 #if PY_VERSION_HEX < 0x02050000
942 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
943 #endif
944 
945 #if PY_VERSION_HEX < 0x02040000
946 #define Py_VISIT(op)				\
947   do { 						\
948     if (op) {					\
949       int vret = visit((op), arg);		\
950       if (vret)					\
951         return vret;				\
952     }						\
953   } while (0)
954 #endif
955 
956 #if PY_VERSION_HEX < 0x02030000
957 typedef struct {
958   PyTypeObject type;
959   PyNumberMethods as_number;
960   PyMappingMethods as_mapping;
961   PySequenceMethods as_sequence;
962   PyBufferProcs as_buffer;
963   PyObject *name, *slots;
964 } PyHeapTypeObject;
965 #endif
966 
967 #if PY_VERSION_HEX < 0x02030000
968 typedef destructor freefunc;
969 #endif
970 
971 #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
972      (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
973      (PY_MAJOR_VERSION > 3))
974 # define SWIGPY_USE_CAPSULE
975 # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
976 #endif
977 
978 #if PY_VERSION_HEX < 0x03020000
979 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
980 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
981 #define Py_hash_t long
982 #endif
983 
984 /* -----------------------------------------------------------------------------
985  * error manipulation
986  * ----------------------------------------------------------------------------- */
987 
988 SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code)989 SWIG_Python_ErrorType(int code) {
990   PyObject* type = 0;
991   switch(code) {
992   case SWIG_MemoryError:
993     type = PyExc_MemoryError;
994     break;
995   case SWIG_IOError:
996     type = PyExc_IOError;
997     break;
998   case SWIG_RuntimeError:
999     type = PyExc_RuntimeError;
1000     break;
1001   case SWIG_IndexError:
1002     type = PyExc_IndexError;
1003     break;
1004   case SWIG_TypeError:
1005     type = PyExc_TypeError;
1006     break;
1007   case SWIG_DivisionByZero:
1008     type = PyExc_ZeroDivisionError;
1009     break;
1010   case SWIG_OverflowError:
1011     type = PyExc_OverflowError;
1012     break;
1013   case SWIG_SyntaxError:
1014     type = PyExc_SyntaxError;
1015     break;
1016   case SWIG_ValueError:
1017     type = PyExc_ValueError;
1018     break;
1019   case SWIG_SystemError:
1020     type = PyExc_SystemError;
1021     break;
1022   case SWIG_AttributeError:
1023     type = PyExc_AttributeError;
1024     break;
1025   default:
1026     type = PyExc_RuntimeError;
1027   }
1028   return type;
1029 }
1030 
1031 
1032 SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char * mesg)1033 SWIG_Python_AddErrorMsg(const char* mesg)
1034 {
1035   PyObject *type = 0;
1036   PyObject *value = 0;
1037   PyObject *traceback = 0;
1038 
1039   if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
1040   if (value) {
1041     char *tmp;
1042     PyObject *old_str = PyObject_Str(value);
1043     PyErr_Clear();
1044     Py_XINCREF(type);
1045 
1046     PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
1047     SWIG_Python_str_DelForPy3(tmp);
1048     Py_DECREF(old_str);
1049     Py_DECREF(value);
1050   } else {
1051     PyErr_SetString(PyExc_RuntimeError, mesg);
1052   }
1053 }
1054 
1055 #if defined(SWIG_PYTHON_NO_THREADS)
1056 #  if defined(SWIG_PYTHON_THREADS)
1057 #    undef SWIG_PYTHON_THREADS
1058 #  endif
1059 #endif
1060 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
1061 #  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
1062 #    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
1063 #      define SWIG_PYTHON_USE_GIL
1064 #    endif
1065 #  endif
1066 #  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
1067 #    ifndef SWIG_PYTHON_INITIALIZE_THREADS
1068 #     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads()
1069 #    endif
1070 #    ifdef __cplusplus /* C++ code */
1071        class SWIG_Python_Thread_Block {
1072          bool status;
1073          PyGILState_STATE state;
1074        public:
end()1075          void end() { if (status) { PyGILState_Release(state); status = false;} }
SWIG_Python_Thread_Block()1076          SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
~SWIG_Python_Thread_Block()1077          ~SWIG_Python_Thread_Block() { end(); }
1078        };
1079        class SWIG_Python_Thread_Allow {
1080          bool status;
1081          PyThreadState *save;
1082        public:
end()1083          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
SWIG_Python_Thread_Allow()1084          SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
~SWIG_Python_Thread_Allow()1085          ~SWIG_Python_Thread_Allow() { end(); }
1086        };
1087 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
1088 #      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
1089 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
1090 #      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
1091 #    else /* C code */
1092 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1093 #      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
1094 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1095 #      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
1096 #    endif
1097 #  else /* Old thread way, not implemented, user must provide it */
1098 #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1099 #      define SWIG_PYTHON_INITIALIZE_THREADS
1100 #    endif
1101 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1102 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1103 #    endif
1104 #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1105 #      define SWIG_PYTHON_THREAD_END_BLOCK
1106 #    endif
1107 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1108 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1109 #    endif
1110 #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1111 #      define SWIG_PYTHON_THREAD_END_ALLOW
1112 #    endif
1113 #  endif
1114 #else /* No thread support */
1115 #  define SWIG_PYTHON_INITIALIZE_THREADS
1116 #  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1117 #  define SWIG_PYTHON_THREAD_END_BLOCK
1118 #  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1119 #  define SWIG_PYTHON_THREAD_END_ALLOW
1120 #endif
1121 
1122 /* -----------------------------------------------------------------------------
1123  * Python API portion that goes into the runtime
1124  * ----------------------------------------------------------------------------- */
1125 
1126 #ifdef __cplusplus
1127 extern "C" {
1128 #endif
1129 
1130 /* -----------------------------------------------------------------------------
1131  * Constant declarations
1132  * ----------------------------------------------------------------------------- */
1133 
1134 /* Constant Types */
1135 #define SWIG_PY_POINTER 4
1136 #define SWIG_PY_BINARY  5
1137 
1138 /* Constant information structure */
1139 typedef struct swig_const_info {
1140   int type;
1141   char *name;
1142   long lvalue;
1143   double dvalue;
1144   void   *pvalue;
1145   swig_type_info **ptype;
1146 } swig_const_info;
1147 
1148 
1149 /* -----------------------------------------------------------------------------
1150  * Wrapper of PyInstanceMethod_New() used in Python 3
1151  * It is exported to the generated module, used for -fastproxy
1152  * ----------------------------------------------------------------------------- */
1153 #if PY_VERSION_HEX >= 0x03000000
SWIG_PyInstanceMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)1154 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
1155 {
1156   return PyInstanceMethod_New(func);
1157 }
1158 #else
SWIG_PyInstanceMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * SWIGUNUSEDPARM (func))1159 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1160 {
1161   return NULL;
1162 }
1163 #endif
1164 
1165 #ifdef __cplusplus
1166 }
1167 #endif
1168 
1169 
1170 /* -----------------------------------------------------------------------------
1171  * pyrun.swg
1172  *
1173  * This file contains the runtime support for Python modules
1174  * and includes code for managing global variables and pointer
1175  * type checking.
1176  *
1177  * ----------------------------------------------------------------------------- */
1178 
1179 /* Common SWIG API */
1180 
1181 /* for raw pointers */
1182 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1183 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1184 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1185 
1186 #ifdef SWIGPYTHON_BUILTIN
1187 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
1188 #else
1189 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1190 #endif
1191 
1192 #define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1193 
1194 #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty)
1195 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
1196 #define swig_owntype                                    int
1197 
1198 /* for raw packed data */
1199 #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1200 #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1201 
1202 /* for class or struct pointers */
1203 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
1204 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
1205 
1206 /* for C or C++ function pointers */
1207 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1208 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1209 
1210 /* for C++ member pointers, ie, member methods */
1211 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1212 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1213 
1214 
1215 /* Runtime API */
1216 
1217 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
1218 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
1219 #define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
1220 
1221 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj
1222 #define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg
1223 #define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)
1224 #define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1225 #define SWIG_fail                        		goto fail
1226 
1227 
1228 /* Runtime API implementation */
1229 
1230 /* Error manipulation */
1231 
1232 SWIGINTERN void
SWIG_Python_SetErrorObj(PyObject * errtype,PyObject * obj)1233 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1234   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1235   PyErr_SetObject(errtype, obj);
1236   Py_DECREF(obj);
1237   SWIG_PYTHON_THREAD_END_BLOCK;
1238 }
1239 
1240 SWIGINTERN void
SWIG_Python_SetErrorMsg(PyObject * errtype,const char * msg)1241 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1242   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1243   PyErr_SetString(errtype, msg);
1244   SWIG_PYTHON_THREAD_END_BLOCK;
1245 }
1246 
1247 #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1248 
1249 /* Set a constant value */
1250 
1251 #if defined(SWIGPYTHON_BUILTIN)
1252 
1253 SWIGINTERN void
SwigPyBuiltin_AddPublicSymbol(PyObject * seq,const char * key)1254 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1255   PyObject *s = PyString_InternFromString(key);
1256   PyList_Append(seq, s);
1257   Py_DECREF(s);
1258 }
1259 
1260 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,PyObject * public_interface,const char * name,PyObject * obj)1261 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1262 #if PY_VERSION_HEX < 0x02030000
1263   PyDict_SetItemString(d, (char *)name, obj);
1264 #else
1265   PyDict_SetItemString(d, name, obj);
1266 #endif
1267   Py_DECREF(obj);
1268   if (public_interface)
1269     SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1270 }
1271 
1272 #else
1273 
1274 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,const char * name,PyObject * obj)1275 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1276 #if PY_VERSION_HEX < 0x02030000
1277   PyDict_SetItemString(d, (char *)name, obj);
1278 #else
1279   PyDict_SetItemString(d, name, obj);
1280 #endif
1281   Py_DECREF(obj);
1282 }
1283 
1284 #endif
1285 
1286 /* Append a value to the result obj */
1287 
1288 SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject * result,PyObject * obj)1289 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1290 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1291   if (!result) {
1292     result = obj;
1293   } else if (result == Py_None) {
1294     Py_DECREF(result);
1295     result = obj;
1296   } else {
1297     if (!PyList_Check(result)) {
1298       PyObject *o2 = result;
1299       result = PyList_New(1);
1300       PyList_SetItem(result, 0, o2);
1301     }
1302     PyList_Append(result,obj);
1303     Py_DECREF(obj);
1304   }
1305   return result;
1306 #else
1307   PyObject*   o2;
1308   PyObject*   o3;
1309   if (!result) {
1310     result = obj;
1311   } else if (result == Py_None) {
1312     Py_DECREF(result);
1313     result = obj;
1314   } else {
1315     if (!PyTuple_Check(result)) {
1316       o2 = result;
1317       result = PyTuple_New(1);
1318       PyTuple_SET_ITEM(result, 0, o2);
1319     }
1320     o3 = PyTuple_New(1);
1321     PyTuple_SET_ITEM(o3, 0, obj);
1322     o2 = result;
1323     result = PySequence_Concat(o2, o3);
1324     Py_DECREF(o2);
1325     Py_DECREF(o3);
1326   }
1327   return result;
1328 #endif
1329 }
1330 
1331 /* Unpack the argument tuple */
1332 
1333 SWIGINTERN Py_ssize_t
SWIG_Python_UnpackTuple(PyObject * args,const char * name,Py_ssize_t min,Py_ssize_t max,PyObject ** objs)1334 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1335 {
1336   if (!args) {
1337     if (!min && !max) {
1338       return 1;
1339     } else {
1340       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1341 		   name, (min == max ? "" : "at least "), (int)min);
1342       return 0;
1343     }
1344   }
1345   if (!PyTuple_Check(args)) {
1346     if (min <= 1 && max >= 1) {
1347       Py_ssize_t i;
1348       objs[0] = args;
1349       for (i = 1; i < max; ++i) {
1350 	objs[i] = 0;
1351       }
1352       return 2;
1353     }
1354     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1355     return 0;
1356   } else {
1357     Py_ssize_t l = PyTuple_GET_SIZE(args);
1358     if (l < min) {
1359       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1360 		   name, (min == max ? "" : "at least "), (int)min, (int)l);
1361       return 0;
1362     } else if (l > max) {
1363       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1364 		   name, (min == max ? "" : "at most "), (int)max, (int)l);
1365       return 0;
1366     } else {
1367       Py_ssize_t i;
1368       for (i = 0; i < l; ++i) {
1369 	objs[i] = PyTuple_GET_ITEM(args, i);
1370       }
1371       for (; l < max; ++l) {
1372 	objs[l] = 0;
1373       }
1374       return i + 1;
1375     }
1376   }
1377 }
1378 
1379 /* A functor is a function object with one single object argument */
1380 #if PY_VERSION_HEX >= 0x02020000
1381 #define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
1382 #else
1383 #define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
1384 #endif
1385 
1386 /*
1387   Helper for static pointer initialization for both C and C++ code, for example
1388   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1389 */
1390 #ifdef __cplusplus
1391 #define SWIG_STATIC_POINTER(var)  var
1392 #else
1393 #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
1394 #endif
1395 
1396 /* -----------------------------------------------------------------------------
1397  * Pointer declarations
1398  * ----------------------------------------------------------------------------- */
1399 
1400 /* Flags for new pointer objects */
1401 #define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
1402 #define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1403 
1404 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
1405 
1406 #define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
1407 #define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1408 
1409 #ifdef __cplusplus
1410 extern "C" {
1411 #endif
1412 
1413 /*  How to access Py_None */
1414 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1415 #  ifndef SWIG_PYTHON_NO_BUILD_NONE
1416 #    ifndef SWIG_PYTHON_BUILD_NONE
1417 #      define SWIG_PYTHON_BUILD_NONE
1418 #    endif
1419 #  endif
1420 #endif
1421 
1422 #ifdef SWIG_PYTHON_BUILD_NONE
1423 #  ifdef Py_None
1424 #   undef Py_None
1425 #   define Py_None SWIG_Py_None()
1426 #  endif
1427 SWIGRUNTIMEINLINE PyObject *
_SWIG_Py_None(void)1428 _SWIG_Py_None(void)
1429 {
1430   PyObject *none = Py_BuildValue((char*)"");
1431   Py_DECREF(none);
1432   return none;
1433 }
1434 SWIGRUNTIME PyObject *
SWIG_Py_None(void)1435 SWIG_Py_None(void)
1436 {
1437   static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1438   return none;
1439 }
1440 #endif
1441 
1442 /* The python void return value */
1443 
1444 SWIGRUNTIMEINLINE PyObject *
SWIG_Py_Void(void)1445 SWIG_Py_Void(void)
1446 {
1447   PyObject *none = Py_None;
1448   Py_INCREF(none);
1449   return none;
1450 }
1451 
1452 /* SwigPyClientData */
1453 
1454 typedef struct {
1455   PyObject *klass;
1456   PyObject *newraw;
1457   PyObject *newargs;
1458   PyObject *destroy;
1459   int delargs;
1460   int implicitconv;
1461   PyTypeObject *pytype;
1462 } SwigPyClientData;
1463 
1464 SWIGRUNTIMEINLINE int
SWIG_Python_CheckImplicit(swig_type_info * ty)1465 SWIG_Python_CheckImplicit(swig_type_info *ty)
1466 {
1467   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1468   return data ? data->implicitconv : 0;
1469 }
1470 
1471 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info * desc)1472 SWIG_Python_ExceptionType(swig_type_info *desc) {
1473   SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1474   PyObject *klass = data ? data->klass : 0;
1475   return (klass ? klass : PyExc_RuntimeError);
1476 }
1477 
1478 
1479 SWIGRUNTIME SwigPyClientData *
SwigPyClientData_New(PyObject * obj)1480 SwigPyClientData_New(PyObject* obj)
1481 {
1482   if (!obj) {
1483     return 0;
1484   } else {
1485     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1486     /* the klass element */
1487     data->klass = obj;
1488     Py_INCREF(data->klass);
1489     /* the newraw method and newargs arguments used to create a new raw instance */
1490     if (PyClass_Check(obj)) {
1491       data->newraw = 0;
1492       data->newargs = obj;
1493       Py_INCREF(obj);
1494     } else {
1495 #if (PY_VERSION_HEX < 0x02020000)
1496       data->newraw = 0;
1497 #else
1498       data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1499 #endif
1500       if (data->newraw) {
1501 	Py_INCREF(data->newraw);
1502 	data->newargs = PyTuple_New(1);
1503 	PyTuple_SetItem(data->newargs, 0, obj);
1504       } else {
1505 	data->newargs = obj;
1506       }
1507       Py_INCREF(data->newargs);
1508     }
1509     /* the destroy method, aka as the C++ delete method */
1510     data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1511     if (PyErr_Occurred()) {
1512       PyErr_Clear();
1513       data->destroy = 0;
1514     }
1515     if (data->destroy) {
1516       int flags;
1517       Py_INCREF(data->destroy);
1518       flags = PyCFunction_GET_FLAGS(data->destroy);
1519 #ifdef METH_O
1520       data->delargs = !(flags & (METH_O));
1521 #else
1522       data->delargs = 0;
1523 #endif
1524     } else {
1525       data->delargs = 0;
1526     }
1527     data->implicitconv = 0;
1528     data->pytype = 0;
1529     return data;
1530   }
1531 }
1532 
1533 SWIGRUNTIME void
SwigPyClientData_Del(SwigPyClientData * data)1534 SwigPyClientData_Del(SwigPyClientData *data) {
1535   Py_XDECREF(data->newraw);
1536   Py_XDECREF(data->newargs);
1537   Py_XDECREF(data->destroy);
1538 }
1539 
1540 /* =============== SwigPyObject =====================*/
1541 
1542 typedef struct {
1543   PyObject_HEAD
1544   void *ptr;
1545   swig_type_info *ty;
1546   int own;
1547   PyObject *next;
1548 #ifdef SWIGPYTHON_BUILTIN
1549   PyObject *dict;
1550 #endif
1551 } SwigPyObject;
1552 
1553 
1554 #ifdef SWIGPYTHON_BUILTIN
1555 
1556 SWIGRUNTIME PyObject *
SwigPyObject_get___dict__(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1557 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1558 {
1559   SwigPyObject *sobj = (SwigPyObject *)v;
1560 
1561   if (!sobj->dict)
1562     sobj->dict = PyDict_New();
1563 
1564   Py_INCREF(sobj->dict);
1565   return sobj->dict;
1566 }
1567 
1568 #endif
1569 
1570 SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject * v)1571 SwigPyObject_long(SwigPyObject *v)
1572 {
1573   return PyLong_FromVoidPtr(v->ptr);
1574 }
1575 
1576 SWIGRUNTIME PyObject *
SwigPyObject_format(const char * fmt,SwigPyObject * v)1577 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1578 {
1579   PyObject *res = NULL;
1580   PyObject *args = PyTuple_New(1);
1581   if (args) {
1582     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1583       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1584       if (ofmt) {
1585 #if PY_VERSION_HEX >= 0x03000000
1586 	res = PyUnicode_Format(ofmt,args);
1587 #else
1588 	res = PyString_Format(ofmt,args);
1589 #endif
1590 	Py_DECREF(ofmt);
1591       }
1592       Py_DECREF(args);
1593     }
1594   }
1595   return res;
1596 }
1597 
1598 SWIGRUNTIME PyObject *
SwigPyObject_oct(SwigPyObject * v)1599 SwigPyObject_oct(SwigPyObject *v)
1600 {
1601   return SwigPyObject_format("%o",v);
1602 }
1603 
1604 SWIGRUNTIME PyObject *
SwigPyObject_hex(SwigPyObject * v)1605 SwigPyObject_hex(SwigPyObject *v)
1606 {
1607   return SwigPyObject_format("%x",v);
1608 }
1609 
1610 SWIGRUNTIME PyObject *
1611 #ifdef METH_NOARGS
SwigPyObject_repr(SwigPyObject * v)1612 SwigPyObject_repr(SwigPyObject *v)
1613 #else
1614 SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1615 #endif
1616 {
1617   const char *name = SWIG_TypePrettyName(v->ty);
1618   PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1619   if (v->next) {
1620 # ifdef METH_NOARGS
1621     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1622 # else
1623     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1624 # endif
1625 # if PY_VERSION_HEX >= 0x03000000
1626     PyObject *joined = PyUnicode_Concat(repr, nrep);
1627     Py_DecRef(repr);
1628     Py_DecRef(nrep);
1629     repr = joined;
1630 # else
1631     PyString_ConcatAndDel(&repr,nrep);
1632 # endif
1633   }
1634   return repr;
1635 }
1636 
1637 SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject * v,SwigPyObject * w)1638 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1639 {
1640   void *i = v->ptr;
1641   void *j = w->ptr;
1642   return (i < j) ? -1 : ((i > j) ? 1 : 0);
1643 }
1644 
1645 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1646 SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject * v,SwigPyObject * w,int op)1647 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1648 {
1649   PyObject* res;
1650   if( op != Py_EQ && op != Py_NE ) {
1651     Py_INCREF(Py_NotImplemented);
1652     return Py_NotImplemented;
1653   }
1654   res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1655   return res;
1656 }
1657 
1658 
1659 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1660 
1661 #ifdef SWIGPYTHON_BUILTIN
1662 static swig_type_info *SwigPyObject_stype = 0;
1663 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1664 SwigPyObject_type(void) {
1665     SwigPyClientData *cd;
1666     assert(SwigPyObject_stype);
1667     cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1668     assert(cd);
1669     assert(cd->pytype);
1670     return cd->pytype;
1671 }
1672 #else
1673 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1674 SwigPyObject_type(void) {
1675   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1676   return type;
1677 }
1678 #endif
1679 
1680 SWIGRUNTIMEINLINE int
SwigPyObject_Check(PyObject * op)1681 SwigPyObject_Check(PyObject *op) {
1682 #ifdef SWIGPYTHON_BUILTIN
1683   PyTypeObject *target_tp = SwigPyObject_type();
1684   if (PyType_IsSubtype(op->ob_type, target_tp))
1685     return 1;
1686   return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1687 #else
1688   return (Py_TYPE(op) == SwigPyObject_type())
1689     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1690 #endif
1691 }
1692 
1693 SWIGRUNTIME PyObject *
1694 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1695 
1696 SWIGRUNTIME void
SwigPyObject_dealloc(PyObject * v)1697 SwigPyObject_dealloc(PyObject *v)
1698 {
1699   SwigPyObject *sobj = (SwigPyObject *) v;
1700   PyObject *next = sobj->next;
1701   if (sobj->own == SWIG_POINTER_OWN) {
1702     swig_type_info *ty = sobj->ty;
1703     SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1704     PyObject *destroy = data ? data->destroy : 0;
1705     if (destroy) {
1706       /* destroy is always a VARARGS method */
1707       PyObject *res;
1708 
1709       /* PyObject_CallFunction() has the potential to silently drop
1710          the active active exception.  In cases of unnamed temporary
1711          variable or where we just finished iterating over a generator
1712          StopIteration will be active right now, and this needs to
1713          remain true upon return from SwigPyObject_dealloc.  So save
1714          and restore. */
1715 
1716       PyObject *val = NULL, *type = NULL, *tb = NULL;
1717       PyErr_Fetch(&val, &type, &tb);
1718 
1719       if (data->delargs) {
1720         /* we need to create a temporary object to carry the destroy operation */
1721         PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1722         res = SWIG_Python_CallFunctor(destroy, tmp);
1723         Py_DECREF(tmp);
1724       } else {
1725         PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1726         PyObject *mself = PyCFunction_GET_SELF(destroy);
1727         res = ((*meth)(mself, v));
1728       }
1729       if (!res)
1730         PyErr_WriteUnraisable(destroy);
1731 
1732       PyErr_Restore(val, type, tb);
1733 
1734       Py_XDECREF(res);
1735     }
1736 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1737     else {
1738       const char *name = SWIG_TypePrettyName(ty);
1739       printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1740     }
1741 #endif
1742   }
1743   Py_XDECREF(next);
1744   PyObject_DEL(v);
1745 }
1746 
1747 SWIGRUNTIME PyObject*
SwigPyObject_append(PyObject * v,PyObject * next)1748 SwigPyObject_append(PyObject* v, PyObject* next)
1749 {
1750   SwigPyObject *sobj = (SwigPyObject *) v;
1751 #ifndef METH_O
1752   PyObject *tmp = 0;
1753   if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1754   next = tmp;
1755 #endif
1756   if (!SwigPyObject_Check(next)) {
1757     PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1758     return NULL;
1759   }
1760   sobj->next = next;
1761   Py_INCREF(next);
1762   return SWIG_Py_Void();
1763 }
1764 
1765 SWIGRUNTIME PyObject*
1766 #ifdef METH_NOARGS
SwigPyObject_next(PyObject * v)1767 SwigPyObject_next(PyObject* v)
1768 #else
1769 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1770 #endif
1771 {
1772   SwigPyObject *sobj = (SwigPyObject *) v;
1773   if (sobj->next) {
1774     Py_INCREF(sobj->next);
1775     return sobj->next;
1776   } else {
1777     return SWIG_Py_Void();
1778   }
1779 }
1780 
1781 SWIGINTERN PyObject*
1782 #ifdef METH_NOARGS
SwigPyObject_disown(PyObject * v)1783 SwigPyObject_disown(PyObject *v)
1784 #else
1785 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1786 #endif
1787 {
1788   SwigPyObject *sobj = (SwigPyObject *)v;
1789   sobj->own = 0;
1790   return SWIG_Py_Void();
1791 }
1792 
1793 SWIGINTERN PyObject*
1794 #ifdef METH_NOARGS
SwigPyObject_acquire(PyObject * v)1795 SwigPyObject_acquire(PyObject *v)
1796 #else
1797 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1798 #endif
1799 {
1800   SwigPyObject *sobj = (SwigPyObject *)v;
1801   sobj->own = SWIG_POINTER_OWN;
1802   return SWIG_Py_Void();
1803 }
1804 
1805 SWIGINTERN PyObject*
SwigPyObject_own(PyObject * v,PyObject * args)1806 SwigPyObject_own(PyObject *v, PyObject *args)
1807 {
1808   PyObject *val = 0;
1809 #if (PY_VERSION_HEX < 0x02020000)
1810   if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1811 #elif (PY_VERSION_HEX < 0x02050000)
1812   if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1813 #else
1814   if (!PyArg_UnpackTuple(args, "own", 0, 1, &val))
1815 #endif
1816     {
1817       return NULL;
1818     }
1819   else
1820     {
1821       SwigPyObject *sobj = (SwigPyObject *)v;
1822       PyObject *obj = PyBool_FromLong(sobj->own);
1823       if (val) {
1824 #ifdef METH_NOARGS
1825 	if (PyObject_IsTrue(val)) {
1826 	  SwigPyObject_acquire(v);
1827 	} else {
1828 	  SwigPyObject_disown(v);
1829 	}
1830 #else
1831 	if (PyObject_IsTrue(val)) {
1832 	  SwigPyObject_acquire(v,args);
1833 	} else {
1834 	  SwigPyObject_disown(v,args);
1835 	}
1836 #endif
1837       }
1838       return obj;
1839     }
1840 }
1841 
1842 #ifdef METH_O
1843 static PyMethodDef
1844 swigobject_methods[] = {
1845   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
1846   {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"acquires ownership of the pointer"},
1847   {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1848   {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
1849   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
1850   {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
1851   {0, 0, 0, 0}
1852 };
1853 #else
1854 static PyMethodDef
1855 swigobject_methods[] = {
1856   {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
1857   {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"acquires ownership of the pointer"},
1858   {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
1859   {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
1860   {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
1861   {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
1862   {0, 0, 0, 0}
1863 };
1864 #endif
1865 
1866 #if PY_VERSION_HEX < 0x02020000
1867 SWIGINTERN PyObject *
SwigPyObject_getattr(SwigPyObject * sobj,char * name)1868 SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1869 {
1870   return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1871 }
1872 #endif
1873 
1874 SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void)1875 SwigPyObject_TypeOnce(void) {
1876   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1877 
1878   static PyNumberMethods SwigPyObject_as_number = {
1879     (binaryfunc)0, /*nb_add*/
1880     (binaryfunc)0, /*nb_subtract*/
1881     (binaryfunc)0, /*nb_multiply*/
1882     /* nb_divide removed in Python 3 */
1883 #if PY_VERSION_HEX < 0x03000000
1884     (binaryfunc)0, /*nb_divide*/
1885 #endif
1886     (binaryfunc)0, /*nb_remainder*/
1887     (binaryfunc)0, /*nb_divmod*/
1888     (ternaryfunc)0,/*nb_power*/
1889     (unaryfunc)0,  /*nb_negative*/
1890     (unaryfunc)0,  /*nb_positive*/
1891     (unaryfunc)0,  /*nb_absolute*/
1892     (inquiry)0,    /*nb_nonzero*/
1893     0,		   /*nb_invert*/
1894     0,		   /*nb_lshift*/
1895     0,		   /*nb_rshift*/
1896     0,		   /*nb_and*/
1897     0,		   /*nb_xor*/
1898     0,		   /*nb_or*/
1899 #if PY_VERSION_HEX < 0x03000000
1900     0,   /*nb_coerce*/
1901 #endif
1902     (unaryfunc)SwigPyObject_long, /*nb_int*/
1903 #if PY_VERSION_HEX < 0x03000000
1904     (unaryfunc)SwigPyObject_long, /*nb_long*/
1905 #else
1906     0, /*nb_reserved*/
1907 #endif
1908     (unaryfunc)0,                 /*nb_float*/
1909 #if PY_VERSION_HEX < 0x03000000
1910     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
1911     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
1912 #endif
1913 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1914     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1915 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1916     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1917 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1918     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1919 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1920     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1921 #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1922     0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1923 #endif
1924   };
1925 
1926   static PyTypeObject swigpyobject_type;
1927   static int type_init = 0;
1928   if (!type_init) {
1929     const PyTypeObject tmp = {
1930 #if PY_VERSION_HEX >= 0x03000000
1931       PyVarObject_HEAD_INIT(NULL, 0)
1932 #else
1933       PyObject_HEAD_INIT(NULL)
1934       0,                                    /* ob_size */
1935 #endif
1936       (char *)"SwigPyObject",               /* tp_name */
1937       sizeof(SwigPyObject),                 /* tp_basicsize */
1938       0,                                    /* tp_itemsize */
1939       (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
1940       0,                                    /* tp_print */
1941 #if PY_VERSION_HEX < 0x02020000
1942       (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
1943 #else
1944       (getattrfunc)0,                       /* tp_getattr */
1945 #endif
1946       (setattrfunc)0,                       /* tp_setattr */
1947 #if PY_VERSION_HEX >= 0x03000000
1948       0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1949 #else
1950       (cmpfunc)SwigPyObject_compare,        /* tp_compare */
1951 #endif
1952       (reprfunc)SwigPyObject_repr,          /* tp_repr */
1953       &SwigPyObject_as_number,              /* tp_as_number */
1954       0,                                    /* tp_as_sequence */
1955       0,                                    /* tp_as_mapping */
1956       (hashfunc)0,                          /* tp_hash */
1957       (ternaryfunc)0,                       /* tp_call */
1958       0,                                    /* tp_str */
1959       PyObject_GenericGetAttr,              /* tp_getattro */
1960       0,                                    /* tp_setattro */
1961       0,                                    /* tp_as_buffer */
1962       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1963       swigobject_doc,                       /* tp_doc */
1964       0,                                    /* tp_traverse */
1965       0,                                    /* tp_clear */
1966       (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1967       0,                                    /* tp_weaklistoffset */
1968 #if PY_VERSION_HEX >= 0x02020000
1969       0,                                    /* tp_iter */
1970       0,                                    /* tp_iternext */
1971       swigobject_methods,                   /* tp_methods */
1972       0,                                    /* tp_members */
1973       0,                                    /* tp_getset */
1974       0,                                    /* tp_base */
1975       0,                                    /* tp_dict */
1976       0,                                    /* tp_descr_get */
1977       0,                                    /* tp_descr_set */
1978       0,                                    /* tp_dictoffset */
1979       0,                                    /* tp_init */
1980       0,                                    /* tp_alloc */
1981       0,                                    /* tp_new */
1982       0,                                    /* tp_free */
1983       0,                                    /* tp_is_gc */
1984       0,                                    /* tp_bases */
1985       0,                                    /* tp_mro */
1986       0,                                    /* tp_cache */
1987       0,                                    /* tp_subclasses */
1988       0,                                    /* tp_weaklist */
1989 #endif
1990 #if PY_VERSION_HEX >= 0x02030000
1991       0,                                    /* tp_del */
1992 #endif
1993 #if PY_VERSION_HEX >= 0x02060000
1994       0,                                    /* tp_version_tag */
1995 #endif
1996 #if PY_VERSION_HEX >= 0x03040000
1997       0,                                    /* tp_finalize */
1998 #endif
1999 #ifdef COUNT_ALLOCS
2000       0,                                    /* tp_allocs */
2001       0,                                    /* tp_frees */
2002       0,                                    /* tp_maxalloc */
2003 #if PY_VERSION_HEX >= 0x02050000
2004       0,                                    /* tp_prev */
2005 #endif
2006       0                                     /* tp_next */
2007 #endif
2008     };
2009     swigpyobject_type = tmp;
2010     type_init = 1;
2011 #if PY_VERSION_HEX < 0x02020000
2012     swigpyobject_type.ob_type = &PyType_Type;
2013 #else
2014     if (PyType_Ready(&swigpyobject_type) < 0)
2015       return NULL;
2016 #endif
2017   }
2018   return &swigpyobject_type;
2019 }
2020 
2021 SWIGRUNTIME PyObject *
SwigPyObject_New(void * ptr,swig_type_info * ty,int own)2022 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
2023 {
2024   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
2025   if (sobj) {
2026     sobj->ptr  = ptr;
2027     sobj->ty   = ty;
2028     sobj->own  = own;
2029     sobj->next = 0;
2030   }
2031   return (PyObject *)sobj;
2032 }
2033 
2034 /* -----------------------------------------------------------------------------
2035  * Implements a simple Swig Packed type, and use it instead of string
2036  * ----------------------------------------------------------------------------- */
2037 
2038 typedef struct {
2039   PyObject_HEAD
2040   void *pack;
2041   swig_type_info *ty;
2042   size_t size;
2043 } SwigPyPacked;
2044 
2045 SWIGRUNTIME int
SwigPyPacked_print(SwigPyPacked * v,FILE * fp,int SWIGUNUSEDPARM (flags))2046 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
2047 {
2048   char result[SWIG_BUFFER_SIZE];
2049   fputs("<Swig Packed ", fp);
2050   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2051     fputs("at ", fp);
2052     fputs(result, fp);
2053   }
2054   fputs(v->ty->name,fp);
2055   fputs(">", fp);
2056   return 0;
2057 }
2058 
2059 SWIGRUNTIME PyObject *
SwigPyPacked_repr(SwigPyPacked * v)2060 SwigPyPacked_repr(SwigPyPacked *v)
2061 {
2062   char result[SWIG_BUFFER_SIZE];
2063   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2064     return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
2065   } else {
2066     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2067   }
2068 }
2069 
2070 SWIGRUNTIME PyObject *
SwigPyPacked_str(SwigPyPacked * v)2071 SwigPyPacked_str(SwigPyPacked *v)
2072 {
2073   char result[SWIG_BUFFER_SIZE];
2074   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
2075     return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
2076   } else {
2077     return SWIG_Python_str_FromChar(v->ty->name);
2078   }
2079 }
2080 
2081 SWIGRUNTIME int
SwigPyPacked_compare(SwigPyPacked * v,SwigPyPacked * w)2082 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2083 {
2084   size_t i = v->size;
2085   size_t j = w->size;
2086   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2087   return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
2088 }
2089 
2090 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2091 
2092 SWIGRUNTIME PyTypeObject*
SwigPyPacked_type(void)2093 SwigPyPacked_type(void) {
2094   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2095   return type;
2096 }
2097 
2098 SWIGRUNTIMEINLINE int
SwigPyPacked_Check(PyObject * op)2099 SwigPyPacked_Check(PyObject *op) {
2100   return ((op)->ob_type == SwigPyPacked_TypeOnce())
2101     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
2102 }
2103 
2104 SWIGRUNTIME void
SwigPyPacked_dealloc(PyObject * v)2105 SwigPyPacked_dealloc(PyObject *v)
2106 {
2107   if (SwigPyPacked_Check(v)) {
2108     SwigPyPacked *sobj = (SwigPyPacked *) v;
2109     free(sobj->pack);
2110   }
2111   PyObject_DEL(v);
2112 }
2113 
2114 SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void)2115 SwigPyPacked_TypeOnce(void) {
2116   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
2117   static PyTypeObject swigpypacked_type;
2118   static int type_init = 0;
2119   if (!type_init) {
2120     const PyTypeObject tmp = {
2121 #if PY_VERSION_HEX>=0x03000000
2122       PyVarObject_HEAD_INIT(NULL, 0)
2123 #else
2124       PyObject_HEAD_INIT(NULL)
2125       0,                                    /* ob_size */
2126 #endif
2127       (char *)"SwigPyPacked",               /* tp_name */
2128       sizeof(SwigPyPacked),                 /* tp_basicsize */
2129       0,                                    /* tp_itemsize */
2130       (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
2131       (printfunc)SwigPyPacked_print,        /* tp_print */
2132       (getattrfunc)0,                       /* tp_getattr */
2133       (setattrfunc)0,                       /* tp_setattr */
2134 #if PY_VERSION_HEX>=0x03000000
2135       0, /* tp_reserved in 3.0.1 */
2136 #else
2137       (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
2138 #endif
2139       (reprfunc)SwigPyPacked_repr,          /* tp_repr */
2140       0,                                    /* tp_as_number */
2141       0,                                    /* tp_as_sequence */
2142       0,                                    /* tp_as_mapping */
2143       (hashfunc)0,                          /* tp_hash */
2144       (ternaryfunc)0,                       /* tp_call */
2145       (reprfunc)SwigPyPacked_str,           /* tp_str */
2146       PyObject_GenericGetAttr,              /* tp_getattro */
2147       0,                                    /* tp_setattro */
2148       0,                                    /* tp_as_buffer */
2149       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
2150       swigpacked_doc,                       /* tp_doc */
2151       0,                                    /* tp_traverse */
2152       0,                                    /* tp_clear */
2153       0,                                    /* tp_richcompare */
2154       0,                                    /* tp_weaklistoffset */
2155 #if PY_VERSION_HEX >= 0x02020000
2156       0,                                    /* tp_iter */
2157       0,                                    /* tp_iternext */
2158       0,                                    /* tp_methods */
2159       0,                                    /* tp_members */
2160       0,                                    /* tp_getset */
2161       0,                                    /* tp_base */
2162       0,                                    /* tp_dict */
2163       0,                                    /* tp_descr_get */
2164       0,                                    /* tp_descr_set */
2165       0,                                    /* tp_dictoffset */
2166       0,                                    /* tp_init */
2167       0,                                    /* tp_alloc */
2168       0,                                    /* tp_new */
2169       0,                                    /* tp_free */
2170       0,                                    /* tp_is_gc */
2171       0,                                    /* tp_bases */
2172       0,                                    /* tp_mro */
2173       0,                                    /* tp_cache */
2174       0,                                    /* tp_subclasses */
2175       0,                                    /* tp_weaklist */
2176 #endif
2177 #if PY_VERSION_HEX >= 0x02030000
2178       0,                                    /* tp_del */
2179 #endif
2180 #if PY_VERSION_HEX >= 0x02060000
2181       0,                                    /* tp_version_tag */
2182 #endif
2183 #if PY_VERSION_HEX >= 0x03040000
2184       0,                                    /* tp_finalize */
2185 #endif
2186 #ifdef COUNT_ALLOCS
2187       0,                                    /* tp_allocs */
2188       0,                                    /* tp_frees */
2189       0,                                    /* tp_maxalloc */
2190 #if PY_VERSION_HEX >= 0x02050000
2191       0,                                    /* tp_prev */
2192 #endif
2193       0                                     /* tp_next */
2194 #endif
2195     };
2196     swigpypacked_type = tmp;
2197     type_init = 1;
2198 #if PY_VERSION_HEX < 0x02020000
2199     swigpypacked_type.ob_type = &PyType_Type;
2200 #else
2201     if (PyType_Ready(&swigpypacked_type) < 0)
2202       return NULL;
2203 #endif
2204   }
2205   return &swigpypacked_type;
2206 }
2207 
2208 SWIGRUNTIME PyObject *
SwigPyPacked_New(void * ptr,size_t size,swig_type_info * ty)2209 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2210 {
2211   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2212   if (sobj) {
2213     void *pack = malloc(size);
2214     if (pack) {
2215       memcpy(pack, ptr, size);
2216       sobj->pack = pack;
2217       sobj->ty   = ty;
2218       sobj->size = size;
2219     } else {
2220       PyObject_DEL((PyObject *) sobj);
2221       sobj = 0;
2222     }
2223   }
2224   return (PyObject *) sobj;
2225 }
2226 
2227 SWIGRUNTIME swig_type_info *
SwigPyPacked_UnpackData(PyObject * obj,void * ptr,size_t size)2228 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2229 {
2230   if (SwigPyPacked_Check(obj)) {
2231     SwigPyPacked *sobj = (SwigPyPacked *)obj;
2232     if (sobj->size != size) return 0;
2233     memcpy(ptr, sobj->pack, size);
2234     return sobj->ty;
2235   } else {
2236     return 0;
2237   }
2238 }
2239 
2240 /* -----------------------------------------------------------------------------
2241  * pointers/data manipulation
2242  * ----------------------------------------------------------------------------- */
2243 
2244 SWIGRUNTIMEINLINE PyObject *
_SWIG_This(void)2245 _SWIG_This(void)
2246 {
2247     return SWIG_Python_str_FromChar("this");
2248 }
2249 
2250 static PyObject *swig_this = NULL;
2251 
2252 SWIGRUNTIME PyObject *
SWIG_This(void)2253 SWIG_This(void)
2254 {
2255   if (swig_this == NULL)
2256     swig_this = _SWIG_This();
2257   return swig_this;
2258 }
2259 
2260 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2261 
2262 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2263 #if PY_VERSION_HEX>=0x03000000
2264 #define SWIG_PYTHON_SLOW_GETSET_THIS
2265 #endif
2266 
2267 SWIGRUNTIME SwigPyObject *
SWIG_Python_GetSwigThis(PyObject * pyobj)2268 SWIG_Python_GetSwigThis(PyObject *pyobj)
2269 {
2270   PyObject *obj;
2271 
2272   if (SwigPyObject_Check(pyobj))
2273     return (SwigPyObject *) pyobj;
2274 
2275 #ifdef SWIGPYTHON_BUILTIN
2276   (void)obj;
2277 # ifdef PyWeakref_CheckProxy
2278   if (PyWeakref_CheckProxy(pyobj)) {
2279     pyobj = PyWeakref_GET_OBJECT(pyobj);
2280     if (pyobj && SwigPyObject_Check(pyobj))
2281       return (SwigPyObject*) pyobj;
2282   }
2283 # endif
2284   return NULL;
2285 #else
2286 
2287   obj = 0;
2288 
2289 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2290   if (PyInstance_Check(pyobj)) {
2291     obj = _PyInstance_Lookup(pyobj, SWIG_This());
2292   } else {
2293     PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2294     if (dictptr != NULL) {
2295       PyObject *dict = *dictptr;
2296       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2297     } else {
2298 #ifdef PyWeakref_CheckProxy
2299       if (PyWeakref_CheckProxy(pyobj)) {
2300 	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2301 	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2302       }
2303 #endif
2304       obj = PyObject_GetAttr(pyobj,SWIG_This());
2305       if (obj) {
2306 	Py_DECREF(obj);
2307       } else {
2308 	if (PyErr_Occurred()) PyErr_Clear();
2309 	return 0;
2310       }
2311     }
2312   }
2313 #else
2314   obj = PyObject_GetAttr(pyobj,SWIG_This());
2315   if (obj) {
2316     Py_DECREF(obj);
2317   } else {
2318     if (PyErr_Occurred()) PyErr_Clear();
2319     return 0;
2320   }
2321 #endif
2322   if (obj && !SwigPyObject_Check(obj)) {
2323     /* a PyObject is called 'this', try to get the 'real this'
2324        SwigPyObject from it */
2325     return SWIG_Python_GetSwigThis(obj);
2326   }
2327   return (SwigPyObject *)obj;
2328 #endif
2329 }
2330 
2331 /* Acquire a pointer value */
2332 
2333 SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject * obj,int own)2334 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2335   if (own == SWIG_POINTER_OWN) {
2336     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2337     if (sobj) {
2338       int oldown = sobj->own;
2339       sobj->own = own;
2340       return oldown;
2341     }
2342   }
2343   return 0;
2344 }
2345 
2346 /* Convert a pointer value */
2347 
2348 SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject * obj,void ** ptr,swig_type_info * ty,int flags,int * own)2349 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2350   int res;
2351   SwigPyObject *sobj;
2352   int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2353 
2354   if (!obj)
2355     return SWIG_ERROR;
2356   if (obj == Py_None && !implicit_conv) {
2357     if (ptr)
2358       *ptr = 0;
2359     return SWIG_OK;
2360   }
2361 
2362   res = SWIG_ERROR;
2363 
2364   sobj = SWIG_Python_GetSwigThis(obj);
2365   if (own)
2366     *own = 0;
2367   while (sobj) {
2368     void *vptr = sobj->ptr;
2369     if (ty) {
2370       swig_type_info *to = sobj->ty;
2371       if (to == ty) {
2372         /* no type cast needed */
2373         if (ptr) *ptr = vptr;
2374         break;
2375       } else {
2376         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2377         if (!tc) {
2378           sobj = (SwigPyObject *)sobj->next;
2379         } else {
2380           if (ptr) {
2381             int newmemory = 0;
2382             *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2383             if (newmemory == SWIG_CAST_NEW_MEMORY) {
2384               assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2385               if (own)
2386                 *own = *own | SWIG_CAST_NEW_MEMORY;
2387             }
2388           }
2389           break;
2390         }
2391       }
2392     } else {
2393       if (ptr) *ptr = vptr;
2394       break;
2395     }
2396   }
2397   if (sobj) {
2398     if (own)
2399       *own = *own | sobj->own;
2400     if (flags & SWIG_POINTER_DISOWN) {
2401       sobj->own = 0;
2402     }
2403     res = SWIG_OK;
2404   } else {
2405     if (implicit_conv) {
2406       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2407       if (data && !data->implicitconv) {
2408         PyObject *klass = data->klass;
2409         if (klass) {
2410           PyObject *impconv;
2411           data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2412           impconv = SWIG_Python_CallFunctor(klass, obj);
2413           data->implicitconv = 0;
2414           if (PyErr_Occurred()) {
2415             PyErr_Clear();
2416             impconv = 0;
2417           }
2418           if (impconv) {
2419             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2420             if (iobj) {
2421               void *vptr;
2422               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2423               if (SWIG_IsOK(res)) {
2424                 if (ptr) {
2425                   *ptr = vptr;
2426                   /* transfer the ownership to 'ptr' */
2427                   iobj->own = 0;
2428                   res = SWIG_AddCast(res);
2429                   res = SWIG_AddNewMask(res);
2430                 } else {
2431                   res = SWIG_AddCast(res);
2432                 }
2433               }
2434             }
2435             Py_DECREF(impconv);
2436           }
2437         }
2438       }
2439     }
2440     if (!SWIG_IsOK(res) && obj == Py_None) {
2441       if (ptr)
2442         *ptr = 0;
2443       if (PyErr_Occurred())
2444         PyErr_Clear();
2445       res = SWIG_OK;
2446     }
2447   }
2448   return res;
2449 }
2450 
2451 /* Convert a function ptr value */
2452 
2453 SWIGRUNTIME int
SWIG_Python_ConvertFunctionPtr(PyObject * obj,void ** ptr,swig_type_info * ty)2454 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2455   if (!PyCFunction_Check(obj)) {
2456     return SWIG_ConvertPtr(obj, ptr, ty, 0);
2457   } else {
2458     void *vptr = 0;
2459 
2460     /* here we get the method pointer for callbacks */
2461     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2462     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2463     if (desc)
2464       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2465     if (!desc)
2466       return SWIG_ERROR;
2467     if (ty) {
2468       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2469       if (tc) {
2470         int newmemory = 0;
2471         *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2472         assert(!newmemory); /* newmemory handling not yet implemented */
2473       } else {
2474         return SWIG_ERROR;
2475       }
2476     } else {
2477       *ptr = vptr;
2478     }
2479     return SWIG_OK;
2480   }
2481 }
2482 
2483 /* Convert a packed value value */
2484 
2485 SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject * obj,void * ptr,size_t sz,swig_type_info * ty)2486 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2487   swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2488   if (!to) return SWIG_ERROR;
2489   if (ty) {
2490     if (to != ty) {
2491       /* check type cast? */
2492       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2493       if (!tc) return SWIG_ERROR;
2494     }
2495   }
2496   return SWIG_OK;
2497 }
2498 
2499 /* -----------------------------------------------------------------------------
2500  * Create a new pointer object
2501  * ----------------------------------------------------------------------------- */
2502 
2503 /*
2504   Create a new instance object, without calling __init__, and set the
2505   'this' attribute.
2506 */
2507 
2508 SWIGRUNTIME PyObject*
SWIG_Python_NewShadowInstance(SwigPyClientData * data,PyObject * swig_this)2509 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2510 {
2511 #if (PY_VERSION_HEX >= 0x02020000)
2512   PyObject *inst = 0;
2513   PyObject *newraw = data->newraw;
2514   if (newraw) {
2515     inst = PyObject_Call(newraw, data->newargs, NULL);
2516     if (inst) {
2517 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2518       PyObject **dictptr = _PyObject_GetDictPtr(inst);
2519       if (dictptr != NULL) {
2520 	PyObject *dict = *dictptr;
2521 	if (dict == NULL) {
2522 	  dict = PyDict_New();
2523 	  *dictptr = dict;
2524 	  PyDict_SetItem(dict, SWIG_This(), swig_this);
2525 	}
2526       }
2527 #else
2528       PyObject *key = SWIG_This();
2529       PyObject_SetAttr(inst, key, swig_this);
2530 #endif
2531     }
2532   } else {
2533 #if PY_VERSION_HEX >= 0x03000000
2534     inst = ((PyTypeObject*) data->newargs)->tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2535     if (inst) {
2536       PyObject_SetAttr(inst, SWIG_This(), swig_this);
2537       Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2538     }
2539 #else
2540     PyObject *dict = PyDict_New();
2541     if (dict) {
2542       PyDict_SetItem(dict, SWIG_This(), swig_this);
2543       inst = PyInstance_NewRaw(data->newargs, dict);
2544       Py_DECREF(dict);
2545     }
2546 #endif
2547   }
2548   return inst;
2549 #else
2550 #if (PY_VERSION_HEX >= 0x02010000)
2551   PyObject *inst = 0;
2552   PyObject *dict = PyDict_New();
2553   if (dict) {
2554     PyDict_SetItem(dict, SWIG_This(), swig_this);
2555     inst = PyInstance_NewRaw(data->newargs, dict);
2556     Py_DECREF(dict);
2557   }
2558   return (PyObject *) inst;
2559 #else
2560   PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2561   if (inst == NULL) {
2562     return NULL;
2563   }
2564   inst->in_class = (PyClassObject *)data->newargs;
2565   Py_INCREF(inst->in_class);
2566   inst->in_dict = PyDict_New();
2567   if (inst->in_dict == NULL) {
2568     Py_DECREF(inst);
2569     return NULL;
2570   }
2571 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2572   inst->in_weakreflist = NULL;
2573 #endif
2574 #ifdef Py_TPFLAGS_GC
2575   PyObject_GC_Init(inst);
2576 #endif
2577   PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2578   return (PyObject *) inst;
2579 #endif
2580 #endif
2581 }
2582 
2583 SWIGRUNTIME void
SWIG_Python_SetSwigThis(PyObject * inst,PyObject * swig_this)2584 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2585 {
2586  PyObject *dict;
2587 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2588  PyObject **dictptr = _PyObject_GetDictPtr(inst);
2589  if (dictptr != NULL) {
2590    dict = *dictptr;
2591    if (dict == NULL) {
2592      dict = PyDict_New();
2593      *dictptr = dict;
2594    }
2595    PyDict_SetItem(dict, SWIG_This(), swig_this);
2596    return;
2597  }
2598 #endif
2599  dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2600  PyDict_SetItem(dict, SWIG_This(), swig_this);
2601  Py_DECREF(dict);
2602 }
2603 
2604 
2605 SWIGINTERN PyObject *
SWIG_Python_InitShadowInstance(PyObject * args)2606 SWIG_Python_InitShadowInstance(PyObject *args) {
2607   PyObject *obj[2];
2608   if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2609     return NULL;
2610   } else {
2611     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2612     if (sthis) {
2613       SwigPyObject_append((PyObject*) sthis, obj[1]);
2614     } else {
2615       SWIG_Python_SetSwigThis(obj[0], obj[1]);
2616     }
2617     return SWIG_Py_Void();
2618   }
2619 }
2620 
2621 /* Create a new pointer object */
2622 
2623 SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(PyObject * self,void * ptr,swig_type_info * type,int flags)2624 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2625   SwigPyClientData *clientdata;
2626   PyObject * robj;
2627   int own;
2628 
2629   if (!ptr)
2630     return SWIG_Py_Void();
2631 
2632   clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2633   own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2634   if (clientdata && clientdata->pytype) {
2635     SwigPyObject *newobj;
2636     if (flags & SWIG_BUILTIN_TP_INIT) {
2637       newobj = (SwigPyObject*) self;
2638       if (newobj->ptr) {
2639         PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2640         while (newobj->next)
2641 	  newobj = (SwigPyObject *) newobj->next;
2642         newobj->next = next_self;
2643         newobj = (SwigPyObject *)next_self;
2644 #ifdef SWIGPYTHON_BUILTIN
2645         newobj->dict = 0;
2646 #endif
2647       }
2648     } else {
2649       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2650 #ifdef SWIGPYTHON_BUILTIN
2651       newobj->dict = 0;
2652 #endif
2653     }
2654     if (newobj) {
2655       newobj->ptr = ptr;
2656       newobj->ty = type;
2657       newobj->own = own;
2658       newobj->next = 0;
2659       return (PyObject*) newobj;
2660     }
2661     return SWIG_Py_Void();
2662   }
2663 
2664   assert(!(flags & SWIG_BUILTIN_TP_INIT));
2665 
2666   robj = SwigPyObject_New(ptr, type, own);
2667   if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2668     PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2669     Py_DECREF(robj);
2670     robj = inst;
2671   }
2672   return robj;
2673 }
2674 
2675 /* Create a new packed object */
2676 
2677 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void * ptr,size_t sz,swig_type_info * type)2678 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2679   return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2680 }
2681 
2682 /* -----------------------------------------------------------------------------*
2683  *  Get type list
2684  * -----------------------------------------------------------------------------*/
2685 
2686 #ifdef SWIG_LINK_RUNTIME
2687 void *SWIG_ReturnGlobalTypeList(void *);
2688 #endif
2689 
2690 SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void * SWIGUNUSEDPARM (clientdata))2691 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2692   static void *type_pointer = (void *)0;
2693   /* first check if module already created */
2694   if (!type_pointer) {
2695 #ifdef SWIG_LINK_RUNTIME
2696     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2697 #else
2698 # ifdef SWIGPY_USE_CAPSULE
2699     type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2700 # else
2701     type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2702 				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2703 # endif
2704     if (PyErr_Occurred()) {
2705       PyErr_Clear();
2706       type_pointer = (void *)0;
2707     }
2708 #endif
2709   }
2710   return (swig_module_info *) type_pointer;
2711 }
2712 
2713 #if PY_MAJOR_VERSION < 2
2714 /* PyModule_AddObject function was introduced in Python 2.0.  The following function
2715    is copied out of Python/modsupport.c in python version 2.3.4 */
2716 SWIGINTERN int
PyModule_AddObject(PyObject * m,char * name,PyObject * o)2717 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2718 {
2719   PyObject *dict;
2720   if (!PyModule_Check(m)) {
2721     PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg");
2722     return SWIG_ERROR;
2723   }
2724   if (!o) {
2725     PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value");
2726     return SWIG_ERROR;
2727   }
2728 
2729   dict = PyModule_GetDict(m);
2730   if (dict == NULL) {
2731     /* Internal error -- modules must have a dict! */
2732     PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2733 		 PyModule_GetName(m));
2734     return SWIG_ERROR;
2735   }
2736   if (PyDict_SetItemString(dict, name, o))
2737     return SWIG_ERROR;
2738   Py_DECREF(o);
2739   return SWIG_OK;
2740 }
2741 #endif
2742 
2743 SWIGRUNTIME void
2744 #ifdef SWIGPY_USE_CAPSULE
SWIG_Python_DestroyModule(PyObject * obj)2745 SWIG_Python_DestroyModule(PyObject *obj)
2746 #else
2747 SWIG_Python_DestroyModule(void *vptr)
2748 #endif
2749 {
2750 #ifdef SWIGPY_USE_CAPSULE
2751   swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2752 #else
2753   swig_module_info *swig_module = (swig_module_info *) vptr;
2754 #endif
2755   swig_type_info **types = swig_module->types;
2756   size_t i;
2757   for (i =0; i < swig_module->size; ++i) {
2758     swig_type_info *ty = types[i];
2759     if (ty->owndata) {
2760       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2761       if (data) SwigPyClientData_Del(data);
2762     }
2763   }
2764   Py_DECREF(SWIG_This());
2765   swig_this = NULL;
2766 }
2767 
2768 SWIGRUNTIME void
SWIG_Python_SetModule(swig_module_info * swig_module)2769 SWIG_Python_SetModule(swig_module_info *swig_module) {
2770 #if PY_VERSION_HEX >= 0x03000000
2771  /* Add a dummy module object into sys.modules */
2772   PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2773 #else
2774   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2775   PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2776 #endif
2777 #ifdef SWIGPY_USE_CAPSULE
2778   PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2779   if (pointer && module) {
2780     PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2781   } else {
2782     Py_XDECREF(pointer);
2783   }
2784 #else
2785   PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2786   if (pointer && module) {
2787     PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2788   } else {
2789     Py_XDECREF(pointer);
2790   }
2791 #endif
2792 }
2793 
2794 /* The python cached type query */
2795 SWIGRUNTIME PyObject *
SWIG_Python_TypeCache(void)2796 SWIG_Python_TypeCache(void) {
2797   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2798   return cache;
2799 }
2800 
2801 SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char * type)2802 SWIG_Python_TypeQuery(const char *type)
2803 {
2804   PyObject *cache = SWIG_Python_TypeCache();
2805   PyObject *key = SWIG_Python_str_FromChar(type);
2806   PyObject *obj = PyDict_GetItem(cache, key);
2807   swig_type_info *descriptor;
2808   if (obj) {
2809 #ifdef SWIGPY_USE_CAPSULE
2810     descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2811 #else
2812     descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2813 #endif
2814   } else {
2815     swig_module_info *swig_module = SWIG_GetModule(0);
2816     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2817     if (descriptor) {
2818 #ifdef SWIGPY_USE_CAPSULE
2819       obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2820 #else
2821       obj = PyCObject_FromVoidPtr(descriptor, NULL);
2822 #endif
2823       PyDict_SetItem(cache, key, obj);
2824       Py_DECREF(obj);
2825     }
2826   }
2827   Py_DECREF(key);
2828   return descriptor;
2829 }
2830 
2831 /*
2832    For backward compatibility only
2833 */
2834 #define SWIG_POINTER_EXCEPTION  0
2835 #define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
2836 #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
2837 
2838 SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char * mesg,int infront)2839 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2840 {
2841   if (PyErr_Occurred()) {
2842     PyObject *type = 0;
2843     PyObject *value = 0;
2844     PyObject *traceback = 0;
2845     PyErr_Fetch(&type, &value, &traceback);
2846     if (value) {
2847       char *tmp;
2848       PyObject *old_str = PyObject_Str(value);
2849       Py_XINCREF(type);
2850       PyErr_Clear();
2851       if (infront) {
2852 	PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2853       } else {
2854 	PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2855       }
2856       SWIG_Python_str_DelForPy3(tmp);
2857       Py_DECREF(old_str);
2858     }
2859     return 1;
2860   } else {
2861     return 0;
2862   }
2863 }
2864 
2865 SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)2866 SWIG_Python_ArgFail(int argnum)
2867 {
2868   if (PyErr_Occurred()) {
2869     /* add information about failing argument */
2870     char mesg[256];
2871     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2872     return SWIG_Python_AddErrMesg(mesg, 1);
2873   } else {
2874     return 0;
2875   }
2876 }
2877 
2878 SWIGRUNTIMEINLINE const char *
SwigPyObject_GetDesc(PyObject * self)2879 SwigPyObject_GetDesc(PyObject *self)
2880 {
2881   SwigPyObject *v = (SwigPyObject *)self;
2882   swig_type_info *ty = v ? v->ty : 0;
2883   return ty ? ty->str : "";
2884 }
2885 
2886 SWIGRUNTIME void
SWIG_Python_TypeError(const char * type,PyObject * obj)2887 SWIG_Python_TypeError(const char *type, PyObject *obj)
2888 {
2889   if (type) {
2890 #if defined(SWIG_COBJECT_TYPES)
2891     if (obj && SwigPyObject_Check(obj)) {
2892       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2893       if (otype) {
2894 	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2895 		     type, otype);
2896 	return;
2897       }
2898     } else
2899 #endif
2900     {
2901       const char *otype = (obj ? obj->ob_type->tp_name : 0);
2902       if (otype) {
2903 	PyObject *str = PyObject_Str(obj);
2904 	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2905 	if (cstr) {
2906 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2907 		       type, otype, cstr);
2908           SWIG_Python_str_DelForPy3(cstr);
2909 	} else {
2910 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2911 		       type, otype);
2912 	}
2913 	Py_XDECREF(str);
2914 	return;
2915       }
2916     }
2917     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2918   } else {
2919     PyErr_Format(PyExc_TypeError, "unexpected type is received");
2920   }
2921 }
2922 
2923 
2924 /* Convert a pointer value, signal an exception on a type mismatch */
2925 SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject * obj,swig_type_info * ty,int SWIGUNUSEDPARM (argnum),int flags)2926 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2927   void *result;
2928   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2929     PyErr_Clear();
2930 #if SWIG_POINTER_EXCEPTION
2931     if (flags) {
2932       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2933       SWIG_Python_ArgFail(argnum);
2934     }
2935 #endif
2936   }
2937   return result;
2938 }
2939 
2940 #ifdef SWIGPYTHON_BUILTIN
2941 SWIGRUNTIME int
SWIG_Python_NonDynamicSetAttr(PyObject * obj,PyObject * name,PyObject * value)2942 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2943   PyTypeObject *tp = obj->ob_type;
2944   PyObject *descr;
2945   PyObject *encoded_name;
2946   descrsetfunc f;
2947   int res = -1;
2948 
2949 # ifdef Py_USING_UNICODE
2950   if (PyString_Check(name)) {
2951     name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2952     if (!name)
2953       return -1;
2954   } else if (!PyUnicode_Check(name))
2955 # else
2956   if (!PyString_Check(name))
2957 # endif
2958   {
2959     PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2960     return -1;
2961   } else {
2962     Py_INCREF(name);
2963   }
2964 
2965   if (!tp->tp_dict) {
2966     if (PyType_Ready(tp) < 0)
2967       goto done;
2968   }
2969 
2970   descr = _PyType_Lookup(tp, name);
2971   f = NULL;
2972   if (descr != NULL)
2973     f = descr->ob_type->tp_descr_set;
2974   if (!f) {
2975     if (PyString_Check(name)) {
2976       encoded_name = name;
2977       Py_INCREF(name);
2978     } else {
2979       encoded_name = PyUnicode_AsUTF8String(name);
2980     }
2981     PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2982     Py_DECREF(encoded_name);
2983   } else {
2984     res = f(descr, obj, value);
2985   }
2986 
2987   done:
2988   Py_DECREF(name);
2989   return res;
2990 }
2991 #endif
2992 
2993 
2994 #ifdef __cplusplus
2995 }
2996 #endif
2997 
2998 
2999 
3000 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
3001 
3002 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
3003 
3004 
3005 
3006   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
3007 
3008 
3009 /* -------- TYPES TABLE (BEGIN) -------- */
3010 
3011 #define SWIGTYPE_p_CPLErrorHandler swig_types[0]
3012 #define SWIGTYPE_p_CPLVirtualMemShadow swig_types[1]
3013 #define SWIGTYPE_p_CPLXMLNode swig_types[2]
3014 #define SWIGTYPE_p_DirEntry swig_types[3]
3015 #define SWIGTYPE_p_GByte swig_types[4]
3016 #define SWIGTYPE_p_GDALAsyncReaderShadow swig_types[5]
3017 #define SWIGTYPE_p_GDALAttributeHS swig_types[6]
3018 #define SWIGTYPE_p_GDALBuildVRTOptions swig_types[7]
3019 #define SWIGTYPE_p_GDALColorEntry swig_types[8]
3020 #define SWIGTYPE_p_GDALColorTableShadow swig_types[9]
3021 #define SWIGTYPE_p_GDALDEMProcessingOptions swig_types[10]
3022 #define SWIGTYPE_p_GDALDatasetShadow swig_types[11]
3023 #define SWIGTYPE_p_GDALDimensionHS swig_types[12]
3024 #define SWIGTYPE_p_GDALDriverShadow swig_types[13]
3025 #define SWIGTYPE_p_GDALEDTComponentHS swig_types[14]
3026 #define SWIGTYPE_p_GDALExtendedDataTypeClass swig_types[15]
3027 #define SWIGTYPE_p_GDALExtendedDataTypeHS swig_types[16]
3028 #define SWIGTYPE_p_GDALGridOptions swig_types[17]
3029 #define SWIGTYPE_p_GDALGroupHS swig_types[18]
3030 #define SWIGTYPE_p_GDALInfoOptions swig_types[19]
3031 #define SWIGTYPE_p_GDALMDArrayHS swig_types[20]
3032 #define SWIGTYPE_p_GDALMajorObjectShadow swig_types[21]
3033 #define SWIGTYPE_p_GDALMultiDimInfoOptions swig_types[22]
3034 #define SWIGTYPE_p_GDALMultiDimTranslateOptions swig_types[23]
3035 #define SWIGTYPE_p_GDALNearblackOptions swig_types[24]
3036 #define SWIGTYPE_p_GDALProgressFunc swig_types[25]
3037 #define SWIGTYPE_p_GDALRasterAttributeTableShadow swig_types[26]
3038 #define SWIGTYPE_p_GDALRasterBandShadow swig_types[27]
3039 #define SWIGTYPE_p_GDALRasterizeOptions swig_types[28]
3040 #define SWIGTYPE_p_GDALTransformerInfoShadow swig_types[29]
3041 #define SWIGTYPE_p_GDALTranslateOptions swig_types[30]
3042 #define SWIGTYPE_p_GDALVectorTranslateOptions swig_types[31]
3043 #define SWIGTYPE_p_GDALViewshedMode swig_types[32]
3044 #define SWIGTYPE_p_GDALViewshedOutputType swig_types[33]
3045 #define SWIGTYPE_p_GDALWarpAppOptions swig_types[34]
3046 #define SWIGTYPE_p_GDAL_GCP swig_types[35]
3047 #define SWIGTYPE_p_GIntBig swig_types[36]
3048 #define SWIGTYPE_p_GUIntBig swig_types[37]
3049 #define SWIGTYPE_p_OGRFeatureShadow swig_types[38]
3050 #define SWIGTYPE_p_OGRFieldDomainShadow swig_types[39]
3051 #define SWIGTYPE_p_OGRGeometryShadow swig_types[40]
3052 #define SWIGTYPE_p_OGRLayerShadow swig_types[41]
3053 #define SWIGTYPE_p_OGRStyleTableShadow swig_types[42]
3054 #define SWIGTYPE_p_OSRSpatialReferenceShadow swig_types[43]
3055 #define SWIGTYPE_p_StatBuf swig_types[44]
3056 #define SWIGTYPE_p_Statistics swig_types[45]
3057 #define SWIGTYPE_p_VSIDIR swig_types[46]
3058 #define SWIGTYPE_p_VSILFILE swig_types[47]
3059 #define SWIGTYPE_p_char swig_types[48]
3060 #define SWIGTYPE_p_double swig_types[49]
3061 #define SWIGTYPE_p_f_double_p_q_const__char_p_void__int swig_types[50]
3062 #define SWIGTYPE_p_int swig_types[51]
3063 #define SWIGTYPE_p_p_GByte swig_types[52]
3064 #define SWIGTYPE_p_p_GDALDatasetShadow swig_types[53]
3065 #define SWIGTYPE_p_p_GDALDimensionHS swig_types[54]
3066 #define SWIGTYPE_p_p_GDALEDTComponentHS swig_types[55]
3067 #define SWIGTYPE_p_p_GDALRasterBandShadow swig_types[56]
3068 #define SWIGTYPE_p_p_GDAL_GCP swig_types[57]
3069 #define SWIGTYPE_p_p_GUIntBig swig_types[58]
3070 #define SWIGTYPE_p_p_OGRLayerShadow swig_types[59]
3071 #define SWIGTYPE_p_p_char swig_types[60]
3072 #define SWIGTYPE_p_p_double swig_types[61]
3073 #define SWIGTYPE_p_p_int swig_types[62]
3074 #define SWIGTYPE_p_p_p_GDALAttributeHS swig_types[63]
3075 #define SWIGTYPE_p_p_p_GDALDimensionHS swig_types[64]
3076 #define SWIGTYPE_p_p_p_GDALEDTComponentHS swig_types[65]
3077 #define SWIGTYPE_p_p_void swig_types[66]
3078 #define SWIGTYPE_p_size_t swig_types[67]
3079 #define SWIGTYPE_p_vsi_l_offset swig_types[68]
3080 static swig_type_info *swig_types[70];
3081 static swig_module_info swig_module = {swig_types, 69, 0, 0, 0, 0};
3082 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3083 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3084 
3085 /* -------- TYPES TABLE (END) -------- */
3086 
3087 #if (PY_VERSION_HEX <= 0x02000000)
3088 # if !defined(SWIG_PYTHON_CLASSIC)
3089 #  error "This python version requires swig to be run with the '-classic' option"
3090 # endif
3091 #endif
3092 
3093 /*-----------------------------------------------
3094               @(target):= _gdal.so
3095   ------------------------------------------------*/
3096 #if PY_VERSION_HEX >= 0x03000000
3097 #  define SWIG_init    PyInit__gdal
3098 
3099 #else
3100 #  define SWIG_init    init_gdal
3101 
3102 #endif
3103 #define SWIG_name    "_gdal"
3104 
3105 #define SWIGVERSION 0x030012
3106 #define SWIG_VERSION SWIGVERSION
3107 
3108 
3109 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
3110 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
3111 
3112 
3113 #include <stdexcept>
3114 
3115 
3116 namespace swig {
3117   class SwigPtr_PyObject {
3118   protected:
3119     PyObject *_obj;
3120 
3121   public:
SwigPtr_PyObject()3122     SwigPtr_PyObject() :_obj(0)
3123     {
3124     }
3125 
SwigPtr_PyObject(const SwigPtr_PyObject & item)3126     SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
3127     {
3128       SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3129       Py_XINCREF(_obj);
3130       SWIG_PYTHON_THREAD_END_BLOCK;
3131     }
3132 
SwigPtr_PyObject(PyObject * obj,bool initial_ref=true)3133     SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3134     {
3135       if (initial_ref) {
3136         SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3137         Py_XINCREF(_obj);
3138         SWIG_PYTHON_THREAD_END_BLOCK;
3139       }
3140     }
3141 
operator =(const SwigPtr_PyObject & item)3142     SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
3143     {
3144       SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3145       Py_XINCREF(item._obj);
3146       Py_XDECREF(_obj);
3147       _obj = item._obj;
3148       SWIG_PYTHON_THREAD_END_BLOCK;
3149       return *this;
3150     }
3151 
~SwigPtr_PyObject()3152     ~SwigPtr_PyObject()
3153     {
3154       SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3155       Py_XDECREF(_obj);
3156       SWIG_PYTHON_THREAD_END_BLOCK;
3157     }
3158 
operator PyObject*() const3159     operator PyObject *() const
3160     {
3161       return _obj;
3162     }
3163 
operator ->() const3164     PyObject *operator->() const
3165     {
3166       return _obj;
3167     }
3168   };
3169 }
3170 
3171 
3172 namespace swig {
3173   struct SwigVar_PyObject : SwigPtr_PyObject {
SwigVar_PyObjectswig::SwigVar_PyObject3174     SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3175 
operator =swig::SwigVar_PyObject3176     SwigVar_PyObject & operator = (PyObject* obj)
3177     {
3178       Py_XDECREF(_obj);
3179       _obj = obj;
3180       return *this;
3181     }
3182   };
3183 }
3184 
3185 
3186 #include <iostream>
3187 #include <vector>
3188 using namespace std;
3189 
3190 #define CPL_SUPRESS_CPLUSPLUS
3191 #include "cpl_port.h"
3192 #include "cpl_string.h"
3193 #include "cpl_multiproc.h"
3194 #include "cpl_http.h"
3195 #include "cpl_vsi_error.h"
3196 
3197 #include "gdal.h"
3198 #include "gdal_alg.h"
3199 #include "gdalwarper.h"
3200 #include "ogr_srs_api.h"
3201 
3202 typedef void GDALMajorObjectShadow;
3203 typedef void GDALDriverShadow;
3204 typedef void GDALDatasetShadow;
3205 typedef void GDALRasterBandShadow;
3206 typedef void GDALColorTableShadow;
3207 typedef void GDALRasterAttributeTableShadow;
3208 typedef void GDALTransformerInfoShadow;
3209 typedef void GDALAsyncReaderShadow;
3210 
3211 typedef GDALExtendedDataTypeHS GDALExtendedDataTypeHS;
3212 typedef GDALEDTComponentHS GDALEDTComponentHS;
3213 typedef GDALGroupHS GDALGroupHS;
3214 typedef GDALMDArrayHS GDALMDArrayHS;
3215 typedef GDALAttributeHS GDALAttributeHS;
3216 typedef GDALDimensionHS GDALDimensionHS;
3217 
3218 
3219 
3220 #ifdef DEBUG
3221 typedef struct OGRSpatialReferenceHS OSRSpatialReferenceShadow;
3222 typedef struct OGRLayerHS OGRLayerShadow;
3223 typedef struct OGRFeatureHS OGRFeatureShadow;
3224 typedef struct OGRGeometryHS OGRGeometryShadow;
3225 #else
3226 typedef void OSRSpatialReferenceShadow;
3227 typedef void OGRLayerShadow;
3228 typedef void OGRFeatureShadow;
3229 typedef void OGRGeometryShadow;
3230 #endif
3231 
3232 typedef struct OGRStyleTableHS OGRStyleTableShadow;
3233 typedef struct OGRFieldDomainHS OGRFieldDomainShadow;
3234 
3235 
3236 /* use this to not return the int returned by GDAL */
3237 typedef int RETURN_NONE;
3238 /* return value that is used for VSI methods that return -1 on error (and set errno) */
3239 typedef int VSI_RETVAL;
3240 
3241 
getAlignment(GDALDataType ntype)3242 static int getAlignment(GDALDataType ntype)
3243 {
3244     switch(ntype)
3245     {
3246         case GDT_Unknown:
3247             break; // shouldn't happen
3248         case GDT_Byte:
3249             return 1;
3250         case GDT_Int16:
3251         case GDT_UInt16:
3252             return 2;
3253         case GDT_Int32:
3254         case GDT_UInt32:
3255         case GDT_Float32:
3256             return 4;
3257         case GDT_Float64:
3258             return 8;
3259         case GDT_CInt16:
3260             return 2;
3261         case GDT_CInt32:
3262         case GDT_CFloat32:
3263             return 4;
3264         case GDT_CFloat64:
3265             return 8;
3266         case GDT_TypeCount:
3267             break; // shouldn't happen
3268     }
3269     // shouldn't happen
3270     CPLAssert(false);
3271     return 1;
3272 }
3273 
readraster_acquirebuffer(void ** buf,void * & inputOutputBuf,size_t buf_size,GDALDataType ntype,int bUseExceptions,char * & data,Py_buffer & view)3274 static bool readraster_acquirebuffer(void** buf,
3275                                      void*& inputOutputBuf,
3276                                      size_t buf_size,
3277                                      GDALDataType ntype,
3278                                      int bUseExceptions,
3279                                      char*& data,
3280                                      Py_buffer& view)
3281 {
3282     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3283 
3284     if( inputOutputBuf == Py_None )
3285         inputOutputBuf = NULL;
3286 
3287     if( inputOutputBuf )
3288     {
3289         if (PyObject_GetBuffer( (PyObject*)inputOutputBuf, &view,
3290                                 PyBUF_SIMPLE | PyBUF_WRITABLE) == 0)
3291         {
3292             if( static_cast<GUIntBig>(view.len) < buf_size )
3293             {
3294                 PyBuffer_Release(&view);
3295                 SWIG_PYTHON_THREAD_END_BLOCK;
3296                 CPLError(CE_Failure, CPLE_AppDefined,
3297                     "buf_obj length is " CPL_FRMT_GUIB " bytes. "
3298                     "It should be at least " CPL_FRMT_GUIB,
3299                     static_cast<GUIntBig>(view.len),
3300                     static_cast<GUIntBig>(buf_size));
3301                 return false;
3302             }
3303             data = (char*)view.buf;
3304             if( (reinterpret_cast<uintptr_t>(data) % getAlignment(ntype)) != 0 )
3305             {
3306                 PyBuffer_Release(&view);
3307                 SWIG_PYTHON_THREAD_END_BLOCK;
3308                 CPLError(CE_Failure, CPLE_AppDefined,
3309                          "buffer has not the appropriate alignment");
3310                 return false;
3311             }
3312         }
3313         else
3314         {
3315             PyErr_Clear();
3316             SWIG_PYTHON_THREAD_END_BLOCK;
3317             CPLError(CE_Failure, CPLE_AppDefined,
3318                      "buf_obj is not a simple writable buffer");
3319             return false;
3320         }
3321     }
3322     else
3323     {
3324         *buf = (void *)PyByteArray_FromStringAndSize( NULL, buf_size );
3325         if (*buf == NULL)
3326         {
3327             *buf = Py_None;
3328             if( !bUseExceptions )
3329             {
3330                 PyErr_Clear();
3331             }
3332             SWIG_PYTHON_THREAD_END_BLOCK;
3333             CPLError(CE_Failure, CPLE_OutOfMemory, "Cannot allocate result buffer");
3334             return false;
3335         }
3336         data = PyByteArray_AsString( (PyObject *)*buf );
3337     }
3338     SWIG_PYTHON_THREAD_END_BLOCK;
3339     return true;
3340 }
3341 
readraster_releasebuffer(CPLErr eErr,void ** buf,void * inputOutputBuf,Py_buffer & view)3342 static void readraster_releasebuffer(CPLErr eErr,
3343                                      void** buf,
3344                                      void* inputOutputBuf,
3345                                      Py_buffer& view)
3346 {
3347     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3348 
3349     if( inputOutputBuf )
3350         PyBuffer_Release(&view);
3351 
3352     if (eErr == CE_Failure)
3353     {
3354         if( inputOutputBuf == NULL )
3355             Py_DECREF((PyObject*)*buf);
3356         *buf = NULL;
3357     }
3358     else if( inputOutputBuf )
3359     {
3360         *buf = inputOutputBuf;
3361         Py_INCREF((PyObject*)*buf);
3362     }
3363 
3364     SWIG_PYTHON_THREAD_END_BLOCK;
3365 }
3366 
3367 
3368 
3369 #define MODULE_NAME           "gdal"
3370 
3371 
3372 static int bUseExceptions=0;
3373 static CPLErrorHandler pfnPreviousHandler = CPLDefaultErrorHandler;
3374 
3375 static void CPL_STDCALL
PythonBindingErrorHandler(CPLErr eclass,int code,const char * msg)3376 PythonBindingErrorHandler(CPLErr eclass, int code, const char *msg )
3377 {
3378   /*
3379   ** Generally we want to suppress error reporting if we have exceptions
3380   ** enabled as the error message will be in the exception thrown in
3381   ** Python.
3382   */
3383 
3384   /* If the error class is CE_Fatal, we want to have a message issued
3385      because the CPL support code does an abort() before any exception
3386      can be generated */
3387   if (eclass == CE_Fatal ) {
3388     pfnPreviousHandler(eclass, code, msg );
3389   }
3390 
3391   /*
3392   ** We do not want to interfere with non-failure messages since
3393   ** they won't be translated into exceptions.
3394   */
3395   else if (eclass != CE_Failure ) {
3396     pfnPreviousHandler(eclass, code, msg );
3397   }
3398   else {
3399     CPLSetThreadLocalConfigOption("__last_error_message", msg);
3400     CPLSetThreadLocalConfigOption("__last_error_code", CPLSPrintf("%d", code));
3401   }
3402 }
3403 
3404 
3405 
3406 static
GetUseExceptions()3407 int GetUseExceptions() {
3408   CPLErrorReset();
3409   return bUseExceptions;
3410 }
3411 
3412 static
UseExceptions()3413 void UseExceptions() {
3414   CPLErrorReset();
3415   if( !bUseExceptions )
3416   {
3417     bUseExceptions = 1;
3418     char* pszNewValue = CPLStrdup(CPLSPrintf("%s %s",
3419                    MODULE_NAME,
3420                    CPLGetConfigOption("__chain_python_error_handlers", "")));
3421     CPLSetConfigOption("__chain_python_error_handlers", pszNewValue);
3422     CPLFree(pszNewValue);
3423     // if the previous logger was custom, we need the user data available
3424     pfnPreviousHandler =
3425         CPLSetErrorHandlerEx( (CPLErrorHandler) PythonBindingErrorHandler, CPLGetErrorHandlerUserData() );
3426   }
3427 }
3428 
3429 static
DontUseExceptions()3430 void DontUseExceptions() {
3431   CPLErrorReset();
3432   if( bUseExceptions )
3433   {
3434     const char* pszValue = CPLGetConfigOption("__chain_python_error_handlers", "");
3435     if( strncmp(pszValue, MODULE_NAME, strlen(MODULE_NAME)) != 0 ||
3436         pszValue[strlen(MODULE_NAME)] != ' ')
3437     {
3438         CPLError(CE_Failure, CPLE_NotSupported,
3439                  "Cannot call %s.DontUseExceptions() at that point since the "
3440                  "stack of error handlers is: %s", MODULE_NAME, pszValue);
3441         return;
3442     }
3443     char* pszNewValue = CPLStrdup(pszValue + strlen(MODULE_NAME) + 1);
3444     if( pszNewValue[0] == ' ' && pszNewValue[1] == '\0' )
3445     {
3446         CPLFree(pszNewValue);
3447         pszNewValue = NULL;
3448     }
3449     CPLSetConfigOption("__chain_python_error_handlers", pszNewValue);
3450     CPLFree(pszNewValue);
3451     bUseExceptions = 0;
3452     // if the previous logger was custom, we need the user data available. Preserve it.
3453     CPLSetErrorHandlerEx( pfnPreviousHandler, CPLGetErrorHandlerUserData());
3454   }
3455 }
3456 
3457 
3458 SWIGINTERNINLINE PyObject*
SWIG_From_int(int value)3459   SWIG_From_int  (int value)
3460 {
3461   return PyInt_FromLong((long) value);
3462 }
3463 
3464 
3465 /* Completely unrelated: just to avoid Coverity warnings */
3466 
3467 static int bReturnSame = 1;
3468 
NeverCallMePlease()3469 void NeverCallMePlease() {
3470     bReturnSame = 0;
3471 }
3472 
3473 /* Some SWIG code generates dead code, which Coverity warns about */
ReturnSame(T x)3474 template<class T> static T ReturnSame(T x)
3475 {
3476     if( bReturnSame )
3477         return x;
3478     return 0;
3479 }
3480 
ClearErrorState()3481 static void ClearErrorState()
3482 {
3483     CPLSetThreadLocalConfigOption("__last_error_message", NULL);
3484     CPLSetThreadLocalConfigOption("__last_error_code", NULL);
3485     CPLErrorReset();
3486 }
3487 
3488 static void StoreLastException() CPL_UNUSED;
3489 
3490 // Note: this is also copy&pasted in gdal_array.i
StoreLastException()3491 static void StoreLastException()
3492 {
3493     const char* pszLastErrorMessage =
3494         CPLGetThreadLocalConfigOption("__last_error_message", NULL);
3495     const char* pszLastErrorCode =
3496         CPLGetThreadLocalConfigOption("__last_error_code", NULL);
3497     if( pszLastErrorMessage != NULL && pszLastErrorCode != NULL )
3498     {
3499         CPLErrorSetState( CE_Failure,
3500             static_cast<CPLErrorNum>(atoi(pszLastErrorCode)),
3501             pszLastErrorMessage);
3502     }
3503 }
3504 
3505 
3506 
3507 
3508 /* Return a PyObject* from a NULL terminated C String */
3509 static PyObject* GDALPythonObjectFromCStr(const char *pszStr) CPL_UNUSED;
GDALPythonObjectFromCStr(const char * pszStr)3510 static PyObject* GDALPythonObjectFromCStr(const char *pszStr)
3511 {
3512   const unsigned char* pszIter = (const unsigned char*) pszStr;
3513   while(*pszIter != 0)
3514   {
3515     if (*pszIter > 127)
3516     {
3517         PyObject* pyObj = PyUnicode_DecodeUTF8(pszStr, strlen(pszStr), "strict");
3518         if (pyObj != NULL && !PyErr_Occurred())
3519             return pyObj;
3520         PyErr_Clear();
3521         return PyBytes_FromString(pszStr);
3522     }
3523     pszIter ++;
3524   }
3525   return PyUnicode_FromString(pszStr);
3526 }
3527 
3528 /* Return a NULL terminated c String from a PyObject */
3529 /* Result must be freed with GDALPythonFreeCStr */
3530 static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree) CPL_UNUSED;
GDALPythonObjectToCStr(PyObject * pyObject,int * pbToFree)3531 static char* GDALPythonObjectToCStr(PyObject* pyObject, int* pbToFree)
3532 {
3533   *pbToFree = 0;
3534   if (PyUnicode_Check(pyObject))
3535   {
3536       char *pszStr;
3537       char *pszNewStr;
3538       Py_ssize_t nLen;
3539       PyObject* pyUTF8Str = PyUnicode_AsUTF8String(pyObject);
3540       if( pyUTF8Str == NULL )
3541         return NULL;
3542       PyBytes_AsStringAndSize(pyUTF8Str, &pszStr, &nLen);
3543       pszNewStr = (char *) malloc(nLen+1);
3544       if( pszNewStr == NULL )
3545       {
3546           CPLError(CE_Failure, CPLE_OutOfMemory, "Failed to allocate %llu bytes",
3547                    (unsigned long long)(nLen + 1));
3548           Py_XDECREF(pyUTF8Str);
3549           return NULL;
3550       }
3551       memcpy(pszNewStr, pszStr, nLen+1);
3552       Py_XDECREF(pyUTF8Str);
3553       *pbToFree = 1;
3554       return pszNewStr;
3555   }
3556   else if( PyBytes_Check(pyObject) )
3557   {
3558       char* ret = PyBytes_AsString(pyObject);
3559 
3560       // Check if there are \0 bytes inside the string
3561       const Py_ssize_t size = PyBytes_Size(pyObject);
3562       for( Py_ssize_t i = 0; i < size; i++ )
3563       {
3564           if( ret[i] == 0 )
3565           {
3566               CPLError(CE_Failure, CPLE_AppDefined,
3567                        "bytes object cast as string contains a zero-byte.");
3568               return NULL;
3569           }
3570       }
3571 
3572       return ret;
3573   }
3574   else
3575   {
3576       CPLError(CE_Failure, CPLE_AppDefined,
3577                "Passed object is neither of type string nor bytes");
3578       return NULL;
3579   }
3580 }
3581 
3582 static void GDALPythonFreeCStr(void* ptr, int bToFree) CPL_UNUSED;
GDALPythonFreeCStr(void * ptr,int bToFree)3583 static void GDALPythonFreeCStr(void* ptr, int bToFree)
3584 {
3585    if (bToFree)
3586        free(ptr);
3587 }
3588 
3589 
3590 
wrapper_VSIFReadL(void ** buf,unsigned int nMembSize,unsigned int nMembCount,VSILFILE * fp)3591 unsigned int wrapper_VSIFReadL( void **buf, unsigned int nMembSize, unsigned int nMembCount, VSILFILE *fp)
3592 {
3593     size_t buf_size = static_cast<size_t>(nMembSize) * nMembCount;
3594     if( buf_size > 0xFFFFFFFFU )
3595    {
3596         CPLError(CE_Failure, CPLE_AppDefined, "Too big request");
3597         *buf = NULL;
3598         return 0;
3599     }
3600 
3601     if (buf_size == 0)
3602     {
3603         *buf = NULL;
3604         return 0;
3605     }
3606 
3607     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3608     *buf = (void *)PyByteArray_FromStringAndSize( NULL, buf_size );
3609     if (*buf == NULL)
3610     {
3611         *buf = Py_None;
3612         if( !bUseExceptions )
3613         {
3614             PyErr_Clear();
3615         }
3616         SWIG_PYTHON_THREAD_END_BLOCK;
3617         CPLError(CE_Failure, CPLE_OutOfMemory, "Cannot allocate result buffer");
3618         return 0;
3619     }
3620     PyObject* o = (PyObject*) *buf;
3621     char *data = PyByteArray_AsString(o);
3622     SWIG_PYTHON_THREAD_END_BLOCK;
3623     size_t nRet = (size_t)VSIFReadL( data, nMembSize, nMembCount, fp );
3624     if (nRet * (size_t)nMembSize < buf_size)
3625     {
3626         SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3627         PyByteArray_Resize(o, nRet * nMembSize);
3628         SWIG_PYTHON_THREAD_END_BLOCK;
3629         *buf = o;
3630     }
3631     return static_cast<unsigned int>(nRet);
3632 }
3633 
3634 
3635 #include <limits.h>
3636 #if !defined(SWIG_NO_LLONG_MAX)
3637 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3638 #   define LLONG_MAX __LONG_LONG_MAX__
3639 #   define LLONG_MIN (-LLONG_MAX - 1LL)
3640 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3641 # endif
3642 #endif
3643 
3644 
3645 SWIGINTERN int
SWIG_AsVal_double(PyObject * obj,double * val)3646 SWIG_AsVal_double (PyObject *obj, double *val)
3647 {
3648   int res = SWIG_TypeError;
3649   if (PyFloat_Check(obj)) {
3650     if (val) *val = PyFloat_AsDouble(obj);
3651     return SWIG_OK;
3652 #if PY_VERSION_HEX < 0x03000000
3653   } else if (PyInt_Check(obj)) {
3654     if (val) *val = (double) PyInt_AsLong(obj);
3655     return SWIG_OK;
3656 #endif
3657   } else if (PyLong_Check(obj)) {
3658     double v = PyLong_AsDouble(obj);
3659     if (!PyErr_Occurred()) {
3660       if (val) *val = v;
3661       return SWIG_OK;
3662     } else {
3663       PyErr_Clear();
3664     }
3665   }
3666 #ifdef SWIG_PYTHON_CAST_MODE
3667   {
3668     int dispatch = 0;
3669     double d = PyFloat_AsDouble(obj);
3670     if (!PyErr_Occurred()) {
3671       if (val) *val = d;
3672       return SWIG_AddCast(SWIG_OK);
3673     } else {
3674       PyErr_Clear();
3675     }
3676     if (!dispatch) {
3677       long v = PyLong_AsLong(obj);
3678       if (!PyErr_Occurred()) {
3679 	if (val) *val = v;
3680 	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3681       } else {
3682 	PyErr_Clear();
3683       }
3684     }
3685   }
3686 #endif
3687   return res;
3688 }
3689 
3690 
3691 #include <float.h>
3692 
3693 
3694 #include <math.h>
3695 
3696 
3697 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)3698 SWIG_CanCastAsInteger(double *d, double min, double max) {
3699   double x = *d;
3700   if ((min <= x && x <= max)) {
3701    double fx = floor(x);
3702    double cx = ceil(x);
3703    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3704    if ((errno == EDOM) || (errno == ERANGE)) {
3705      errno = 0;
3706    } else {
3707      double summ, reps, diff;
3708      if (rd < x) {
3709        diff = x - rd;
3710      } else if (rd > x) {
3711        diff = rd - x;
3712      } else {
3713        return 1;
3714      }
3715      summ = rd + x;
3716      reps = diff/summ;
3717      if (reps < 8*DBL_EPSILON) {
3718        *d = rd;
3719        return 1;
3720      }
3721    }
3722   }
3723   return 0;
3724 }
3725 
3726 
3727 SWIGINTERN int
SWIG_AsVal_unsigned_SS_long(PyObject * obj,unsigned long * val)3728 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
3729 {
3730 #if PY_VERSION_HEX < 0x03000000
3731   if (PyInt_Check(obj)) {
3732     long v = PyInt_AsLong(obj);
3733     if (v >= 0) {
3734       if (val) *val = v;
3735       return SWIG_OK;
3736     } else {
3737       return SWIG_OverflowError;
3738     }
3739   } else
3740 #endif
3741   if (PyLong_Check(obj)) {
3742     unsigned long v = PyLong_AsUnsignedLong(obj);
3743     if (!PyErr_Occurred()) {
3744       if (val) *val = v;
3745       return SWIG_OK;
3746     } else {
3747       PyErr_Clear();
3748       return SWIG_OverflowError;
3749     }
3750   }
3751 #ifdef SWIG_PYTHON_CAST_MODE
3752   {
3753     int dispatch = 0;
3754     unsigned long v = PyLong_AsUnsignedLong(obj);
3755     if (!PyErr_Occurred()) {
3756       if (val) *val = v;
3757       return SWIG_AddCast(SWIG_OK);
3758     } else {
3759       PyErr_Clear();
3760     }
3761     if (!dispatch) {
3762       double d;
3763       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3764       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
3765 	if (val) *val = (unsigned long)(d);
3766 	return res;
3767       }
3768     }
3769   }
3770 #endif
3771   return SWIG_TypeError;
3772 }
3773 
3774 
3775 SWIGINTERN int
SWIG_AsVal_unsigned_SS_int(PyObject * obj,unsigned int * val)3776 SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
3777 {
3778   unsigned long v;
3779   int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
3780   if (SWIG_IsOK(res)) {
3781     if ((v > UINT_MAX)) {
3782       return SWIG_OverflowError;
3783     } else {
3784       if (val) *val = static_cast< unsigned int >(v);
3785     }
3786   }
3787   return res;
3788 }
3789 
3790 
3791 SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_int(unsigned int value)3792   SWIG_From_unsigned_SS_int  (unsigned int value)
3793 {
3794   return PyInt_FromSize_t((size_t) value);
3795 }
3796 
3797 
wrapper_VSIGetMemFileBuffer(const char * utf8_path,GByte ** out,vsi_l_offset * length)3798 void wrapper_VSIGetMemFileBuffer(const char *utf8_path, GByte **out, vsi_l_offset *length)
3799 {
3800     *out = VSIGetMemFileBuffer(utf8_path, length, 0);
3801 }
3802 
3803 
3804 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)3805 SWIG_pchar_descriptor(void)
3806 {
3807   static int init = 0;
3808   static swig_type_info* info = 0;
3809   if (!init) {
3810     info = SWIG_TypeQuery("_p_char");
3811     init = 1;
3812   }
3813   return info;
3814 }
3815 
3816 
3817 SWIGINTERN int
SWIG_AsCharPtrAndSize(PyObject * obj,char ** cptr,size_t * psize,int * alloc)3818 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3819 {
3820 #if PY_VERSION_HEX>=0x03000000
3821 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3822   if (PyBytes_Check(obj))
3823 #else
3824   if (PyUnicode_Check(obj))
3825 #endif
3826 #else
3827   if (PyString_Check(obj))
3828 #endif
3829   {
3830     char *cstr; Py_ssize_t len;
3831 #if PY_VERSION_HEX>=0x03000000
3832 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3833     if (!alloc && cptr) {
3834         /* We can't allow converting without allocation, since the internal
3835            representation of string in Python 3 is UCS-2/UCS-4 but we require
3836            a UTF-8 representation.
3837            TODO(bhy) More detailed explanation */
3838         return SWIG_RuntimeError;
3839     }
3840     obj = PyUnicode_AsUTF8String(obj); if (!obj) return SWIG_TypeError;
3841     if(alloc) *alloc = SWIG_NEWOBJ;
3842 #endif
3843     PyBytes_AsStringAndSize(obj, &cstr, &len);
3844 #else
3845     PyString_AsStringAndSize(obj, &cstr, &len);
3846 #endif
3847     if (cptr) {
3848       if (alloc) {
3849 	/*
3850 	   In python the user should not be able to modify the inner
3851 	   string representation. To warranty that, if you define
3852 	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
3853 	   buffer is always returned.
3854 
3855 	   The default behavior is just to return the pointer value,
3856 	   so, be careful.
3857 	*/
3858 #if defined(SWIG_PYTHON_SAFE_CSTRINGS)
3859 	if (*alloc != SWIG_OLDOBJ)
3860 #else
3861 	if (*alloc == SWIG_NEWOBJ)
3862 #endif
3863 	{
3864 	  *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3865 	  *alloc = SWIG_NEWOBJ;
3866 	} else {
3867 	  *cptr = cstr;
3868 	  *alloc = SWIG_OLDOBJ;
3869 	}
3870       } else {
3871 #if PY_VERSION_HEX>=0x03000000
3872 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3873 	*cptr = PyBytes_AsString(obj);
3874 #else
3875 	assert(0); /* Should never reach here with Unicode strings in Python 3 */
3876 #endif
3877 #else
3878 	*cptr = SWIG_Python_str_AsChar(obj);
3879 #endif
3880       }
3881     }
3882     if (psize) *psize = len + 1;
3883 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3884     Py_XDECREF(obj);
3885 #endif
3886     return SWIG_OK;
3887   } else {
3888 #if defined(SWIG_PYTHON_2_UNICODE)
3889 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3890 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3891 #endif
3892 #if PY_VERSION_HEX<0x03000000
3893     if (PyUnicode_Check(obj)) {
3894       char *cstr; Py_ssize_t len;
3895       if (!alloc && cptr) {
3896         return SWIG_RuntimeError;
3897       }
3898       obj = PyUnicode_AsUTF8String(obj); if (!obj) return SWIG_TypeError;
3899       if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3900         if (cptr) {
3901           if (alloc) *alloc = SWIG_NEWOBJ;
3902           *cptr = reinterpret_cast< char* >(memcpy(new char[len + 1], cstr, sizeof(char)*(len + 1)));
3903         }
3904         if (psize) *psize = len + 1;
3905 
3906         Py_XDECREF(obj);
3907         return SWIG_OK;
3908       } else {
3909         Py_XDECREF(obj);
3910       }
3911     }
3912 #endif
3913 #endif
3914 
3915     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3916     if (pchar_descriptor) {
3917       void* vptr = 0;
3918       if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3919 	if (cptr) *cptr = (char *) vptr;
3920 	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3921 	if (alloc) *alloc = SWIG_OLDOBJ;
3922 	return SWIG_OK;
3923       }
3924     }
3925   }
3926   return SWIG_TypeError;
3927 }
3928 
3929 
3930 
3931 
3932 
3933 
3934 typedef struct {
3935     PyObject *psPyCallback;
3936     PyObject *psPyCallbackData;
3937     int nLastReported;
3938 } PyProgressData;
3939 
3940 /************************************************************************/
3941 /*                          PyProgressProxy()                           */
3942 /************************************************************************/
3943 
3944 
3945 static int CPL_STDCALL
3946 PyProgressProxy( double dfComplete, const char *pszMessage, void *pData ) CPL_UNUSED;
3947 
3948 static int CPL_STDCALL
PyProgressProxy(double dfComplete,const char * pszMessage,void * pData)3949 PyProgressProxy( double dfComplete, const char *pszMessage, void *pData )
3950 
3951 {
3952     PyProgressData *psInfo = (PyProgressData *) pData;
3953     PyObject *psArgs, *psResult;
3954     int      bContinue = TRUE;
3955 
3956     if( psInfo->nLastReported == (int) (100.0 * dfComplete) )
3957         return TRUE;
3958 
3959     if( psInfo->psPyCallback == NULL || psInfo->psPyCallback == Py_None )
3960         return TRUE;
3961 
3962     psInfo->nLastReported = (int) (100.0 * dfComplete);
3963 
3964     if( pszMessage == NULL )
3965         pszMessage = "";
3966 
3967     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
3968 
3969     if( psInfo->psPyCallbackData == NULL )
3970         psArgs = Py_BuildValue("(dsO)", dfComplete, pszMessage, Py_None );
3971     else
3972         psArgs = Py_BuildValue("(dsO)", dfComplete, pszMessage,
3973 	                       psInfo->psPyCallbackData );
3974 
3975     psResult = PyObject_CallObject( psInfo->psPyCallback, psArgs);
3976     Py_XDECREF(psArgs);
3977 
3978     if( PyErr_Occurred() != NULL )
3979     {
3980         PyErr_Print();
3981         PyErr_Clear();
3982         SWIG_PYTHON_THREAD_END_BLOCK;
3983         return FALSE;
3984     }
3985 
3986     if( psResult == NULL )
3987     {
3988         SWIG_PYTHON_THREAD_END_BLOCK;
3989         return TRUE;
3990     }
3991 
3992     if( psResult == Py_None )
3993     {
3994         SWIG_PYTHON_THREAD_END_BLOCK;
3995         return TRUE;
3996     }
3997 
3998     if( !PyArg_Parse( psResult, "i", &bContinue ) )
3999     {
4000         PyErr_Clear();
4001         CPLError(CE_Failure, CPLE_AppDefined, "bad progress return value");
4002         Py_XDECREF(psResult);
4003         SWIG_PYTHON_THREAD_END_BLOCK;
4004         return FALSE;
4005     }
4006 
4007     Py_XDECREF(psResult);
4008     SWIG_PYTHON_THREAD_END_BLOCK;
4009 
4010     return bContinue;
4011 }
4012 
4013 
4014 typedef char retStringAndCPLFree;
4015 
4016 
Debug(const char * msg_class,const char * message)4017   void Debug( const char *msg_class, const char *message ) {
4018     CPLDebug( msg_class, "%s", message );
4019   }
4020 
4021 
SetErrorHandler(CPLErrorHandler pfnErrorHandler=NULL,void * user_data=NULL)4022   CPLErr SetErrorHandler( CPLErrorHandler pfnErrorHandler = NULL, void* user_data = NULL )
4023   {
4024     if( pfnErrorHandler == NULL )
4025     {
4026         pfnErrorHandler = CPLDefaultErrorHandler;
4027     }
4028 
4029     CPLSetErrorHandlerEx( pfnErrorHandler, user_data );
4030 
4031     return CE_None;
4032   }
4033 
4034 
4035 SWIGINTERN int
SWIG_AsVal_long(PyObject * obj,long * val)4036 SWIG_AsVal_long (PyObject *obj, long* val)
4037 {
4038 #if PY_VERSION_HEX < 0x03000000
4039   if (PyInt_Check(obj)) {
4040     if (val) *val = PyInt_AsLong(obj);
4041     return SWIG_OK;
4042   } else
4043 #endif
4044   if (PyLong_Check(obj)) {
4045     long v = PyLong_AsLong(obj);
4046     if (!PyErr_Occurred()) {
4047       if (val) *val = v;
4048       return SWIG_OK;
4049     } else {
4050       PyErr_Clear();
4051       return SWIG_OverflowError;
4052     }
4053   }
4054 #ifdef SWIG_PYTHON_CAST_MODE
4055   {
4056     int dispatch = 0;
4057     long v = PyInt_AsLong(obj);
4058     if (!PyErr_Occurred()) {
4059       if (val) *val = v;
4060       return SWIG_AddCast(SWIG_OK);
4061     } else {
4062       PyErr_Clear();
4063     }
4064     if (!dispatch) {
4065       double d;
4066       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
4067       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
4068 	if (val) *val = (long)(d);
4069 	return res;
4070       }
4071     }
4072   }
4073 #endif
4074   return SWIG_TypeError;
4075 }
4076 
4077 
4078 SWIGINTERN int
SWIG_AsVal_int(PyObject * obj,int * val)4079 SWIG_AsVal_int (PyObject * obj, int *val)
4080 {
4081   long v;
4082   int res = SWIG_AsVal_long (obj, &v);
4083   if (SWIG_IsOK(res)) {
4084     if ((v < INT_MIN || v > INT_MAX)) {
4085       return SWIG_OverflowError;
4086     } else {
4087       if (val) *val = static_cast< int >(v);
4088     }
4089   }
4090   return res;
4091 }
4092 
4093 
4094 extern "C" int CPL_DLL GDALIsInGlobalDestructor();
4095 
PyCPLErrorHandler(CPLErr eErrClass,int err_no,const char * pszErrorMsg)4096 void CPL_STDCALL PyCPLErrorHandler(CPLErr eErrClass, int err_no, const char* pszErrorMsg)
4097 {
4098     if( GDALIsInGlobalDestructor() )
4099     {
4100         // this is typically during Python interpreter shutdown, and ends up in a crash
4101         // because error handling tries to do thread initialization.
4102         return;
4103     }
4104 
4105     void* user_data = CPLGetErrorHandlerUserData();
4106     PyObject *psArgs;
4107 
4108     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
4109 
4110     psArgs = Py_BuildValue("(iis)", eErrClass, err_no, pszErrorMsg );
4111     PyObject_CallObject( (PyObject*)user_data, psArgs);
4112     Py_XDECREF(psArgs);
4113 
4114     SWIG_PYTHON_THREAD_END_BLOCK;
4115 }
4116 
4117 
PushErrorHandler(CPLErrorHandler pfnErrorHandler=NULL,void * user_data=NULL)4118   CPLErr PushErrorHandler( CPLErrorHandler pfnErrorHandler = NULL, void* user_data = NULL )
4119   {
4120     if( pfnErrorHandler == NULL )
4121         CPLPushErrorHandler(CPLQuietErrorHandler);
4122     else
4123         CPLPushErrorHandlerEx(pfnErrorHandler, user_data);
4124     return CE_None;
4125   }
4126 
4127 
PopErrorHandler()4128   void PopErrorHandler()
4129   {
4130      void* user_data = CPLGetErrorHandlerUserData();
4131      if( user_data != NULL )
4132      {
4133          Py_XDECREF((PyObject*)user_data);
4134      }
4135      CPLPopErrorHandler();
4136   }
4137 
4138 
Error(CPLErr msg_class=CE_Failure,int err_code=0,const char * msg="error")4139   void Error( CPLErr msg_class = CE_Failure, int err_code = 0, const char* msg = "error" ) {
4140     CPLError( msg_class, err_code, "%s", msg );
4141   }
4142 
4143 
EscapeString(int len,char * bin_string,int scheme=CPLES_SQL)4144 retStringAndCPLFree* EscapeString(int len, char *bin_string , int scheme=CPLES_SQL) {
4145     return CPLEscapeString(bin_string, len, scheme);
4146 }
4147 
4148 
4149 SWIGINTERNINLINE PyObject *
SWIG_FromCharPtrAndSize(const char * carray,size_t size)4150 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
4151 {
4152   if (carray) {
4153     if (size > INT_MAX) {
4154       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
4155       return pchar_descriptor ?
4156 	SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
4157     } else {
4158 #if PY_VERSION_HEX >= 0x03000000
4159 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
4160       return PyBytes_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
4161 #else
4162 #if PY_VERSION_HEX >= 0x03010000
4163       return PyUnicode_DecodeUTF8(carray, static_cast< Py_ssize_t >(size), "surrogateescape");
4164 #else
4165       return PyUnicode_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
4166 #endif
4167 #endif
4168 #else
4169       return PyString_FromStringAndSize(carray, static_cast< Py_ssize_t >(size));
4170 #endif
4171     }
4172   } else {
4173     return SWIG_Py_Void();
4174   }
4175 }
4176 
4177 
4178 SWIGINTERNINLINE PyObject *
SWIG_FromCharPtr(const char * cptr)4179 SWIG_FromCharPtr(const char *cptr)
4180 {
4181   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
4182 }
4183 
4184 
wrapper_VSIReadDirEx(const char * utf8_path,int nMaxFiles=0)4185 char **wrapper_VSIReadDirEx( const char * utf8_path, int nMaxFiles = 0 )
4186 {
4187     return VSIReadDirEx(utf8_path, nMaxFiles);
4188 }
4189 
4190 
wrapper_VSIOpenDir(const char * utf8_path,int nRecurseDepth=-1,char ** options=NULL)4191 VSIDIR* wrapper_VSIOpenDir( const char * utf8_path,
4192                             int nRecurseDepth = -1,
4193                             char** options = NULL )
4194 {
4195     return VSIOpenDir(utf8_path, nRecurseDepth, options);
4196 }
4197 
4198 
4199 /************************************************************************/
4200 /*                         CSLFromPySequence()                          */
4201 /************************************************************************/
CSLFromPySequence(PyObject * pySeq,int * pbErr)4202 static char **CSLFromPySequence( PyObject *pySeq, int *pbErr )
4203 
4204 {
4205   *pbErr = FALSE;
4206   /* Check if is a list (and reject strings, that are seen as sequence of characters)  */
4207   if ( ! PySequence_Check(pySeq) || PyUnicode_Check(pySeq) ) {
4208     PyErr_SetString(PyExc_TypeError,"not a sequence");
4209     *pbErr = TRUE;
4210     return NULL;
4211   }
4212 
4213   Py_ssize_t size = PySequence_Size(pySeq);
4214   if( size != (int)size ) {
4215     PyErr_SetString(PyExc_TypeError, "too big sequence");
4216     *pbErr = TRUE;
4217     return NULL;
4218   }
4219   char** papszRet = NULL;
4220   for (int i = 0; i < (int)size; i++) {
4221     PyObject* pyObj = PySequence_GetItem(pySeq,i);
4222     if (PyUnicode_Check(pyObj))
4223     {
4224       char *pszStr;
4225       Py_ssize_t nLen;
4226       PyObject* pyUTF8Str = PyUnicode_AsUTF8String(pyObj);
4227       if( !pyUTF8Str )
4228       {
4229         Py_DECREF(pyObj);
4230         PyErr_SetString(PyExc_TypeError,"invalid Unicode sequence");
4231         CSLDestroy(papszRet);
4232         *pbErr = TRUE;
4233         return NULL;
4234       }
4235       PyBytes_AsStringAndSize(pyUTF8Str, &pszStr, &nLen);
4236       papszRet = CSLAddString( papszRet, pszStr );
4237       Py_XDECREF(pyUTF8Str);
4238     }
4239     else if (PyBytes_Check(pyObj))
4240       papszRet = CSLAddString( papszRet, PyBytes_AsString(pyObj) );
4241     else
4242     {
4243         Py_DECREF(pyObj);
4244         PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
4245         CSLDestroy(papszRet);
4246         *pbErr = TRUE;
4247         return NULL;
4248     }
4249     Py_DECREF(pyObj);
4250   }
4251   return papszRet;
4252 }
4253 
4254 
4255 typedef struct
4256 {
4257     char*        name;
4258     int          mode;
4259     GIntBig      size;
4260     GIntBig      mtime;
4261     bool         modeKnown;
4262     bool         sizeKnown;
4263     bool         mtimeKnown;
4264     char**       extra;
4265 } DirEntry;
4266 
4267 
4268 SWIGINTERNINLINE PyObject*
SWIG_From_bool(bool value)4269   SWIG_From_bool  (bool value)
4270 {
4271   return PyBool_FromLong(value ? 1 : 0);
4272 }
4273 
new_DirEntry(DirEntry const * entryIn)4274 SWIGINTERN DirEntry *new_DirEntry(DirEntry const *entryIn){
4275     DirEntry *self = (DirEntry*) CPLMalloc( sizeof( DirEntry ) );
4276     self->name = CPLStrdup(entryIn->name);
4277     self->mode = entryIn->mode;
4278     self->size = entryIn->size;
4279     self->mtime = entryIn->mtime;
4280     self->modeKnown = entryIn->modeKnown;
4281     self->sizeKnown = entryIn->sizeKnown;
4282     self->mtimeKnown = entryIn->mtimeKnown;
4283     self->extra = CSLDuplicate(entryIn->extra);
4284     return self;
4285   }
delete_DirEntry(DirEntry * self)4286 SWIGINTERN void delete_DirEntry(DirEntry *self){
4287     CPLFree(self->name);
4288     CSLDestroy(self->extra);
4289     CPLFree(self);
4290   }
DirEntry_IsDirectory(DirEntry * self)4291 SWIGINTERN bool DirEntry_IsDirectory(DirEntry *self){
4292      return (self->mode & S_IFDIR) != 0;
4293   }
4294 
wrapper_VSIGetNextDirEntry(VSIDIR * dir)4295 DirEntry* wrapper_VSIGetNextDirEntry(VSIDIR* dir)
4296 {
4297     const VSIDIREntry* vsiEntry = VSIGetNextDirEntry(dir);
4298     if( vsiEntry == nullptr )
4299     {
4300         return nullptr;
4301     }
4302     DirEntry* entry = (DirEntry*) CPLMalloc( sizeof( DirEntry ) );
4303     entry->name = CPLStrdup(vsiEntry->pszName);
4304     entry->mode = vsiEntry->nMode;
4305     entry->size = vsiEntry->nSize;
4306     entry->mtime = vsiEntry->nMTime;
4307     entry->modeKnown = vsiEntry->bModeKnown == TRUE;
4308     entry->sizeKnown = vsiEntry->bSizeKnown == TRUE;
4309     entry->mtimeKnown = vsiEntry->bMTimeKnown == TRUE;
4310     entry->extra = CSLDuplicate(vsiEntry->papszExtra);
4311     return entry;
4312 }
4313 
4314 
wrapper_CPLGetConfigOption(const char * pszKey,const char * pszDefault=NULL)4315 const char *wrapper_CPLGetConfigOption( const char * pszKey, const char * pszDefault = NULL )
4316 {
4317     return CPLGetConfigOption( pszKey, pszDefault );
4318 }
4319 
4320 
wrapper_VSIFileFromMemBuffer(const char * utf8_path,GIntBig nBytes,const char * pabyData)4321 void wrapper_VSIFileFromMemBuffer( const char* utf8_path, GIntBig nBytes, const char *pabyData)
4322 {
4323     const size_t nSize = static_cast<size_t>(nBytes);
4324     void* pabyDataDup = VSIMalloc(nSize);
4325     if (pabyDataDup == NULL)
4326             return;
4327     memcpy(pabyDataDup, pabyData, nSize);
4328     VSIFCloseL(VSIFileFromMemBuffer(utf8_path, (GByte*) pabyDataDup, nSize, TRUE));
4329 }
4330 
4331 
wrapper_VSIUnlinkBatch(char ** files)4332 bool wrapper_VSIUnlinkBatch(char** files)
4333 {
4334     int* success = VSIUnlinkBatch(files);
4335     if( !success )
4336         return false;
4337     int bRet = true;
4338     for( int i = 0; files && files[i]; i++ )
4339     {
4340         if( !success[i] ) {
4341             bRet = false;
4342             break;
4343         }
4344     }
4345     VSIFree(success);
4346     return bRet;
4347 }
4348 
4349 
wrapper_HasThreadSupport()4350 int wrapper_HasThreadSupport()
4351 {
4352     return strcmp(CPLGetThreadingModel(), "stub") != 0;
4353 }
4354 
4355 
wrapper_VSISync(const char * pszSource,const char * pszTarget,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)4356 bool wrapper_VSISync(const char* pszSource,
4357                      const char* pszTarget,
4358                      char** options = NULL,
4359                      GDALProgressFunc callback=NULL,
4360                      void* callback_data=NULL)
4361 {
4362     return VSISync( pszSource, pszTarget, options, callback, callback_data, nullptr );
4363 }
4364 
4365 
wrapper_VSIGetSignedURL(const char * utf8_path,char ** options=NULL)4366 retStringAndCPLFree* wrapper_VSIGetSignedURL(const char * utf8_path, char** options = NULL )
4367 {
4368     return VSIGetSignedURL( utf8_path, options );
4369 }
4370 
4371 
4372 typedef struct
4373 {
4374   int     mode;
4375   GIntBig size;
4376   GIntBig mtime;
4377 } StatBuf;
4378 
new_StatBuf(StatBuf * psStatBuf)4379 SWIGINTERN StatBuf *new_StatBuf(StatBuf *psStatBuf){
4380     StatBuf *self = (StatBuf*) CPLMalloc( sizeof( StatBuf ) );
4381     self->mode = psStatBuf->mode;
4382     self->size = psStatBuf->size;
4383     self->mtime = psStatBuf->mtime;
4384     return self;
4385   }
delete_StatBuf(StatBuf * self)4386 SWIGINTERN void delete_StatBuf(StatBuf *self){
4387     CPLFree(self);
4388   }
StatBuf_IsDirectory(StatBuf * self)4389 SWIGINTERN int StatBuf_IsDirectory(StatBuf *self){
4390      return (self->mode & S_IFDIR) != 0;
4391   }
4392 
wrapper_VSIStatL(const char * utf8_path,StatBuf * psStatBufOut,int nFlags=0)4393 int wrapper_VSIStatL( const char * utf8_path, StatBuf *psStatBufOut, int nFlags = 0 )
4394 {
4395     VSIStatBufL sStat;
4396     memset(&sStat, 0, sizeof(sStat));
4397     memset(psStatBufOut, 0, sizeof(StatBuf));
4398     int nRet = VSIStatExL(utf8_path, &sStat, nFlags);
4399     psStatBufOut->mode = sStat.st_mode;
4400     psStatBufOut->size = (GIntBig)sStat.st_size;
4401     psStatBufOut->mtime = (GIntBig)sStat.st_mtime;
4402     return nRet;
4403 }
4404 
4405 
wrapper_VSIFOpenL(const char * utf8_path,const char * pszMode)4406 VSILFILE   *wrapper_VSIFOpenL( const char *utf8_path, const char *pszMode )
4407 {
4408     if (!pszMode) /* would lead to segfault */
4409         pszMode = "r";
4410     return VSIFOpenL( utf8_path, pszMode );
4411 }
4412 
4413 
wrapper_VSIFOpenExL(const char * utf8_path,const char * pszMode,int bSetError=FALSE,char ** options=NULL)4414 VSILFILE   *wrapper_VSIFOpenExL( const char *utf8_path, const char *pszMode, int bSetError = FALSE, char** options = NULL )
4415 {
4416     if (!pszMode) /* would lead to segfault */
4417         pszMode = "r";
4418     return VSIFOpenEx2L( utf8_path, pszMode, bSetError, options );
4419 }
4420 
4421 
wrapper_VSIFWriteL(int nLen,char * pBuf,int size,int memb,VSILFILE * fp)4422 int wrapper_VSIFWriteL( int nLen, char *pBuf, int size, int memb, VSILFILE* fp)
4423 {
4424     if (nLen < static_cast<GIntBig>(size) * memb)
4425     {
4426         CPLError(CE_Failure, CPLE_AppDefined, "Inconsistent buffer size with 'size' and 'memb' values");
4427         return 0;
4428     }
4429     return static_cast<int>(VSIFWriteL(pBuf, size, memb, fp));
4430 }
4431 
GDALMajorObjectShadow_GetDescription(GDALMajorObjectShadow * self)4432 SWIGINTERN char const *GDALMajorObjectShadow_GetDescription(GDALMajorObjectShadow *self){
4433     return GDALGetDescription( self );
4434   }
GDALMajorObjectShadow_SetDescription(GDALMajorObjectShadow * self,char const * pszNewDesc)4435 SWIGINTERN void GDALMajorObjectShadow_SetDescription(GDALMajorObjectShadow *self,char const *pszNewDesc){
4436     GDALSetDescription( self, pszNewDesc );
4437   }
GDALMajorObjectShadow_GetMetadataDomainList(GDALMajorObjectShadow * self)4438 SWIGINTERN char **GDALMajorObjectShadow_GetMetadataDomainList(GDALMajorObjectShadow *self){
4439     return GDALGetMetadataDomainList( self );
4440   }
GDALMajorObjectShadow_GetMetadata_Dict(GDALMajorObjectShadow * self,char const * pszDomain="")4441 SWIGINTERN char **GDALMajorObjectShadow_GetMetadata_Dict(GDALMajorObjectShadow *self,char const *pszDomain=""){
4442     return GDALGetMetadata( self, pszDomain );
4443   }
GDALMajorObjectShadow_GetMetadata_List(GDALMajorObjectShadow * self,char const * pszDomain="")4444 SWIGINTERN char **GDALMajorObjectShadow_GetMetadata_List(GDALMajorObjectShadow *self,char const *pszDomain=""){
4445     return GDALGetMetadata( self, pszDomain );
4446   }
GDALMajorObjectShadow_SetMetadata__SWIG_0(GDALMajorObjectShadow * self,char ** papszMetadata,char const * pszDomain="")4447 SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadata__SWIG_0(GDALMajorObjectShadow *self,char **papszMetadata,char const *pszDomain=""){
4448     return GDALSetMetadata( self, papszMetadata, pszDomain );
4449   }
GDALMajorObjectShadow_SetMetadata__SWIG_1(GDALMajorObjectShadow * self,char * pszMetadataString,char const * pszDomain="")4450 SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadata__SWIG_1(GDALMajorObjectShadow *self,char *pszMetadataString,char const *pszDomain=""){
4451     char *tmpList[2];
4452     tmpList[0] = pszMetadataString;
4453     tmpList[1] = 0;
4454     return GDALSetMetadata( self, tmpList, pszDomain );
4455   }
GDALMajorObjectShadow_GetMetadataItem(GDALMajorObjectShadow * self,char const * pszName,char const * pszDomain="")4456 SWIGINTERN char const *GDALMajorObjectShadow_GetMetadataItem(GDALMajorObjectShadow *self,char const *pszName,char const *pszDomain=""){
4457     return GDALGetMetadataItem( self, pszName, pszDomain);
4458   }
GDALMajorObjectShadow_SetMetadataItem(GDALMajorObjectShadow * self,char const * pszName,char const * pszValue,char const * pszDomain="")4459 SWIGINTERN CPLErr GDALMajorObjectShadow_SetMetadataItem(GDALMajorObjectShadow *self,char const *pszName,char const *pszValue,char const *pszDomain=""){
4460     return GDALSetMetadataItem( self, pszName, pszValue, pszDomain);
4461   }
GDALDriverShadow_Create(GDALDriverShadow * self,char const * utf8_path,int xsize,int ysize,int bands=1,GDALDataType eType=GDT_Byte,char ** options=0)4462 SWIGINTERN GDALDatasetShadow *GDALDriverShadow_Create(GDALDriverShadow *self,char const *utf8_path,int xsize,int ysize,int bands=1,GDALDataType eType=GDT_Byte,char **options=0){
4463 
4464     GDALDatasetShadow* ds = (GDALDatasetShadow*) GDALCreate(    self,
4465                                                                 utf8_path,
4466                                                                 xsize,
4467                                                                 ysize,
4468                                                                 bands,
4469                                                                 eType,
4470                                                                 options );
4471     return ds;
4472   }
GDALDriverShadow_CreateMultiDimensional(GDALDriverShadow * self,char const * utf8_path,char ** root_group_options=0,char ** options=0)4473 SWIGINTERN GDALDatasetShadow *GDALDriverShadow_CreateMultiDimensional(GDALDriverShadow *self,char const *utf8_path,char **root_group_options=0,char **options=0){
4474 
4475     GDALDatasetShadow* ds = (GDALDatasetShadow*) GDALCreateMultiDimensional(    self,
4476                                                                 utf8_path,
4477                                                                 root_group_options,
4478                                                                 options );
4479     return ds;
4480   }
GDALDriverShadow_CreateCopy(GDALDriverShadow * self,char const * utf8_path,GDALDatasetShadow * src,int strict=1,char ** options=0,GDALProgressFunc callback=NULL,void * callback_data=NULL)4481 SWIGINTERN GDALDatasetShadow *GDALDriverShadow_CreateCopy(GDALDriverShadow *self,char const *utf8_path,GDALDatasetShadow *src,int strict=1,char **options=0,GDALProgressFunc callback=NULL,void *callback_data=NULL){
4482 
4483     GDALDatasetShadow *ds = (GDALDatasetShadow*) GDALCreateCopy(    self,
4484                                                                     utf8_path,
4485                                                                     src,
4486                                                                     strict,
4487                                                                     options,
4488                                                                     callback,
4489                                                                     callback_data );
4490     return ds;
4491   }
GDALDriverShadow_Delete(GDALDriverShadow * self,char const * utf8_path)4492 SWIGINTERN CPLErr GDALDriverShadow_Delete(GDALDriverShadow *self,char const *utf8_path){
4493     return GDALDeleteDataset( self, utf8_path );
4494   }
GDALDriverShadow_Rename(GDALDriverShadow * self,char const * newName,char const * oldName)4495 SWIGINTERN CPLErr GDALDriverShadow_Rename(GDALDriverShadow *self,char const *newName,char const *oldName){
4496     return GDALRenameDataset( self, newName, oldName );
4497   }
GDALDriverShadow_CopyFiles(GDALDriverShadow * self,char const * newName,char const * oldName)4498 SWIGINTERN CPLErr GDALDriverShadow_CopyFiles(GDALDriverShadow *self,char const *newName,char const *oldName){
4499     return GDALCopyDatasetFiles( self, newName, oldName );
4500   }
GDALDriverShadow_Register(GDALDriverShadow * self)4501 SWIGINTERN int GDALDriverShadow_Register(GDALDriverShadow *self){
4502     return GDALRegisterDriver( self );
4503   }
GDALDriverShadow_Deregister(GDALDriverShadow * self)4504 SWIGINTERN void GDALDriverShadow_Deregister(GDALDriverShadow *self){
4505     GDALDeregisterDriver( self );
4506   }
4507 
GDALDriverShadow_ShortName_get(GDALDriverShadow * h)4508 char const *GDALDriverShadow_ShortName_get( GDALDriverShadow *h ) {
4509   return GDALGetDriverShortName( h );
4510 }
GDALDriverShadow_LongName_get(GDALDriverShadow * h)4511 char const *GDALDriverShadow_LongName_get( GDALDriverShadow *h ) {
4512   return GDALGetDriverLongName( h );
4513 }
GDALDriverShadow_HelpTopic_get(GDALDriverShadow * h)4514 char const *GDALDriverShadow_HelpTopic_get( GDALDriverShadow *h ) {
4515   return GDALGetDriverHelpTopic( h );
4516 }
4517 
4518 
4519 SWIGINTERN int
SWIG_AsVal_short(PyObject * obj,short * val)4520 SWIG_AsVal_short (PyObject * obj, short *val)
4521 {
4522   long v;
4523   int res = SWIG_AsVal_long (obj, &v);
4524   if (SWIG_IsOK(res)) {
4525     if ((v < SHRT_MIN || v > SHRT_MAX)) {
4526       return SWIG_OverflowError;
4527     } else {
4528       if (val) *val = static_cast< short >(v);
4529     }
4530   }
4531   return res;
4532 }
4533 
4534 
4535   #define SWIG_From_long   PyInt_FromLong
4536 
4537 
4538 SWIGINTERNINLINE PyObject *
SWIG_From_short(short value)4539 SWIG_From_short  (short value)
4540 {
4541   return SWIG_From_long  (value);
4542 }
4543 
4544 
4545   #define SWIG_From_double   PyFloat_FromDouble
4546 
new_GDAL_GCP(double x=0.0,double y=0.0,double z=0.0,double pixel=0.0,double line=0.0,char const * info="",char const * id="")4547 SWIGINTERN GDAL_GCP *new_GDAL_GCP(double x=0.0,double y=0.0,double z=0.0,double pixel=0.0,double line=0.0,char const *info="",char const *id=""){
4548 
4549     GDAL_GCP *self = (GDAL_GCP*) CPLMalloc( sizeof( GDAL_GCP ) );
4550     self->dfGCPX = x;
4551     self->dfGCPY = y;
4552     self->dfGCPZ = z;
4553     self->dfGCPPixel = pixel;
4554     self->dfGCPLine = line;
4555     self->pszInfo =  CPLStrdup( (info == 0) ? "" : info );
4556     self->pszId = CPLStrdup( (id==0)? "" : id );
4557     return self;
4558   }
delete_GDAL_GCP(GDAL_GCP * self)4559 SWIGINTERN void delete_GDAL_GCP(GDAL_GCP *self){
4560     if ( self->pszInfo )
4561       CPLFree( self->pszInfo );
4562     if ( self->pszId )
4563       CPLFree( self->pszId );
4564     CPLFree( self );
4565   }
4566 
4567 
GDAL_GCP_GCPX_get(GDAL_GCP * gcp)4568 double GDAL_GCP_GCPX_get( GDAL_GCP *gcp ) {
4569   return gcp->dfGCPX;
4570 }
GDAL_GCP_GCPX_set(GDAL_GCP * gcp,double dfGCPX)4571 void GDAL_GCP_GCPX_set( GDAL_GCP *gcp, double dfGCPX ) {
4572   gcp->dfGCPX = dfGCPX;
4573 }
GDAL_GCP_GCPY_get(GDAL_GCP * gcp)4574 double GDAL_GCP_GCPY_get( GDAL_GCP *gcp ) {
4575   return gcp->dfGCPY;
4576 }
GDAL_GCP_GCPY_set(GDAL_GCP * gcp,double dfGCPY)4577 void GDAL_GCP_GCPY_set( GDAL_GCP *gcp, double dfGCPY ) {
4578   gcp->dfGCPY = dfGCPY;
4579 }
GDAL_GCP_GCPZ_get(GDAL_GCP * gcp)4580 double GDAL_GCP_GCPZ_get( GDAL_GCP *gcp ) {
4581   return gcp->dfGCPZ;
4582 }
GDAL_GCP_GCPZ_set(GDAL_GCP * gcp,double dfGCPZ)4583 void GDAL_GCP_GCPZ_set( GDAL_GCP *gcp, double dfGCPZ ) {
4584   gcp->dfGCPZ = dfGCPZ;
4585 }
GDAL_GCP_GCPPixel_get(GDAL_GCP * gcp)4586 double GDAL_GCP_GCPPixel_get( GDAL_GCP *gcp ) {
4587   return gcp->dfGCPPixel;
4588 }
GDAL_GCP_GCPPixel_set(GDAL_GCP * gcp,double dfGCPPixel)4589 void GDAL_GCP_GCPPixel_set( GDAL_GCP *gcp, double dfGCPPixel ) {
4590   gcp->dfGCPPixel = dfGCPPixel;
4591 }
GDAL_GCP_GCPLine_get(GDAL_GCP * gcp)4592 double GDAL_GCP_GCPLine_get( GDAL_GCP *gcp ) {
4593   return gcp->dfGCPLine;
4594 }
GDAL_GCP_GCPLine_set(GDAL_GCP * gcp,double dfGCPLine)4595 void GDAL_GCP_GCPLine_set( GDAL_GCP *gcp, double dfGCPLine ) {
4596   gcp->dfGCPLine = dfGCPLine;
4597 }
GDAL_GCP_Info_get(GDAL_GCP * gcp)4598 const char * GDAL_GCP_Info_get( GDAL_GCP *gcp ) {
4599   return gcp->pszInfo;
4600 }
GDAL_GCP_Info_set(GDAL_GCP * gcp,const char * pszInfo)4601 void GDAL_GCP_Info_set( GDAL_GCP *gcp, const char * pszInfo ) {
4602   if ( gcp->pszInfo )
4603     CPLFree( gcp->pszInfo );
4604   gcp->pszInfo = CPLStrdup(pszInfo);
4605 }
GDAL_GCP_Id_get(GDAL_GCP * gcp)4606 const char * GDAL_GCP_Id_get( GDAL_GCP *gcp ) {
4607   return gcp->pszId;
4608 }
GDAL_GCP_Id_set(GDAL_GCP * gcp,const char * pszId)4609 void GDAL_GCP_Id_set( GDAL_GCP *gcp, const char * pszId ) {
4610   if ( gcp->pszId )
4611     CPLFree( gcp->pszId );
4612   gcp->pszId = CPLStrdup(pszId);
4613 }
4614 
4615 
4616 #define t_output_helper SWIG_Python_AppendOutput
4617 
4618 
4619 static PyObject *
CreateTupleFromDoubleArray(const double * first,size_t size)4620 CreateTupleFromDoubleArray( const double *first, size_t size ) {
4621   PyObject *out = PyTuple_New( size );
4622   for( unsigned int i=0; i<size; i++ ) {
4623     PyObject *val = PyFloat_FromDouble( *first );
4624     ++first;
4625     PyTuple_SetItem( out, i, val );
4626   }
4627   return out;
4628 }
4629 
4630 
4631 #include "gdal.h"
4632 
4633 typedef struct
4634 {
4635     CPLVirtualMem *vmem;
4636     int            bAuto;
4637     GDALDataType   eBufType;
4638     int            bIsBandSequential;
4639     int            bReadOnly;
4640     int            nBufXSize;
4641     int            nBufYSize;
4642     int            nBandCount;
4643     GDALTileOrganization eTileOrganization;
4644     int                  nTileXSize;
4645     int                  nTileYSize;
4646     int            nPixelSpace; /* if bAuto == TRUE */
4647     GIntBig        nLineSpace; /* if bAuto == TRUE */
4648 } CPLVirtualMemShadow;
4649 
4650 
delete_CPLVirtualMemShadow(CPLVirtualMemShadow * self)4651 SWIGINTERN void delete_CPLVirtualMemShadow(CPLVirtualMemShadow *self){
4652         CPLVirtualMemFree( self->vmem );
4653         free(self);
4654     }
CPLVirtualMemShadow_GetAddr(CPLVirtualMemShadow * self,void ** pptr,size_t * pnsize,GDALDataType * pdatatype,int * preadonly)4655 SWIGINTERN void CPLVirtualMemShadow_GetAddr(CPLVirtualMemShadow *self,void **pptr,size_t *pnsize,GDALDataType *pdatatype,int *preadonly){
4656         *pptr = CPLVirtualMemGetAddr( self->vmem );
4657         *pnsize = CPLVirtualMemGetSize( self->vmem );
4658         *pdatatype = self->eBufType;
4659         *preadonly = self->bReadOnly;
4660     }
4661 
4662 #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
4663 #  define SWIG_LONG_LONG_AVAILABLE
4664 #endif
4665 
4666 
4667 #ifdef SWIG_LONG_LONG_AVAILABLE
4668 SWIGINTERN int
SWIG_AsVal_unsigned_SS_long_SS_long(PyObject * obj,unsigned long long * val)4669 SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val)
4670 {
4671   int res = SWIG_TypeError;
4672   if (PyLong_Check(obj)) {
4673     unsigned long long v = PyLong_AsUnsignedLongLong(obj);
4674     if (!PyErr_Occurred()) {
4675       if (val) *val = v;
4676       return SWIG_OK;
4677     } else {
4678       PyErr_Clear();
4679       res = SWIG_OverflowError;
4680     }
4681   } else {
4682     unsigned long v;
4683     res = SWIG_AsVal_unsigned_SS_long (obj,&v);
4684     if (SWIG_IsOK(res)) {
4685       if (val) *val = v;
4686       return res;
4687     }
4688   }
4689 #ifdef SWIG_PYTHON_CAST_MODE
4690   {
4691     const double mant_max = 1LL << DBL_MANT_DIG;
4692     double d;
4693     res = SWIG_AsVal_double (obj,&d);
4694     if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max))
4695       return SWIG_OverflowError;
4696     if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
4697       if (val) *val = (unsigned long long)(d);
4698       return SWIG_AddCast(res);
4699     }
4700     res = SWIG_TypeError;
4701   }
4702 #endif
4703   return res;
4704 }
4705 #endif
4706 
4707 
4708 SWIGINTERNINLINE int
SWIG_AsVal_size_t(PyObject * obj,size_t * val)4709 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
4710 {
4711   int res = SWIG_TypeError;
4712 #ifdef SWIG_LONG_LONG_AVAILABLE
4713   if (sizeof(size_t) <= sizeof(unsigned long)) {
4714 #endif
4715     unsigned long v;
4716     res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
4717     if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
4718 #ifdef SWIG_LONG_LONG_AVAILABLE
4719   } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
4720     unsigned long long v;
4721     res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
4722     if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
4723   }
4724 #endif
4725   return res;
4726 }
4727 
CPLVirtualMemShadow_Pin(CPLVirtualMemShadow * self,size_t start_offset=0,size_t nsize=0,int bWriteOp=0)4728 SWIGINTERN void CPLVirtualMemShadow_Pin(CPLVirtualMemShadow *self,size_t start_offset=0,size_t nsize=0,int bWriteOp=0){
4729         if( nsize == 0 || start_offset + nsize >= CPLVirtualMemGetSize( self->vmem ) )
4730             nsize = CPLVirtualMemGetSize( self->vmem ) - start_offset;
4731         char* start_addr = (char*)CPLVirtualMemGetAddr( self->vmem ) + start_offset;
4732         CPLVirtualMemPin(self->vmem, start_addr, nsize, bWriteOp);
4733     }
4734 
4735 /* Returned size is in bytes or 0 if an error occurred. */
4736 static
ComputeDatasetRasterIOSize(int buf_xsize,int buf_ysize,int nPixelSize,int nBands,int * bandMap,int nBandMapArrayLength,GIntBig nPixelSpace,GIntBig nLineSpace,GIntBig nBandSpace,int bSpacingShouldBeMultipleOfPixelSize)4737 GIntBig ComputeDatasetRasterIOSize (int buf_xsize, int buf_ysize, int nPixelSize,
4738                                 int nBands, int* bandMap, int nBandMapArrayLength,
4739                                 GIntBig nPixelSpace, GIntBig nLineSpace, GIntBig nBandSpace,
4740                                 int bSpacingShouldBeMultipleOfPixelSize )
4741 {
4742     if (buf_xsize <= 0 || buf_ysize <= 0)
4743     {
4744         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for buffer size");
4745         return 0;
4746     }
4747 
4748     if (nPixelSpace < 0 || nLineSpace < 0 || nBandSpace < 0)
4749     {
4750         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for space arguments");
4751         return 0;
4752     }
4753 
4754     if (nPixelSize == 0)
4755     {
4756         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal value for data type");
4757         return 0;
4758     }
4759 
4760     if( nPixelSpace == 0 )
4761         nPixelSpace = nPixelSize;
4762     else if ( bSpacingShouldBeMultipleOfPixelSize && (nPixelSpace % nPixelSize) != 0 )
4763     {
4764         CPLError(CE_Failure, CPLE_IllegalArg, "nPixelSpace should be a multiple of nPixelSize");
4765         return 0;
4766     }
4767 
4768     if( nLineSpace == 0 )
4769     {
4770         nLineSpace = nPixelSpace * buf_xsize;
4771     }
4772     else if ( bSpacingShouldBeMultipleOfPixelSize && (nLineSpace % nPixelSize) != 0 )
4773     {
4774         CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
4775         return 0;
4776     }
4777 
4778     if( nBandSpace == 0 )
4779     {
4780         nBandSpace = nLineSpace * buf_ysize;
4781     }
4782     else if ( bSpacingShouldBeMultipleOfPixelSize && (nBandSpace % nPixelSize) != 0 )
4783     {
4784         CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
4785         return 0;
4786     }
4787 
4788     if (nBands <= 0 || (bandMap != NULL && nBands > nBandMapArrayLength))
4789     {
4790         CPLError(CE_Failure, CPLE_IllegalArg, "Invalid band count");
4791         return 0;
4792     }
4793 
4794     GIntBig nRet = (GIntBig)(buf_ysize - 1) * nLineSpace + (GIntBig)(buf_xsize - 1) * nPixelSpace + (GIntBig)(nBands - 1) * nBandSpace + nPixelSize;
4795 #if SIZEOF_VOIDP == 4
4796     if (nRet > INT_MAX)
4797     {
4798         CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
4799         return 0;
4800     }
4801 #endif
4802 
4803     return nRet;
4804 }
4805 
4806 
4807 typedef struct
4808 {
4809     GDALAsyncReaderH  hAsyncReader;
4810     void             *pyObject;
4811 } GDALAsyncReaderWrapper;
4812 
4813 typedef void* GDALAsyncReaderWrapperH;
4814 
AsyncReaderWrapperGetReader(GDALAsyncReaderWrapperH hWrapper)4815 static GDALAsyncReaderH AsyncReaderWrapperGetReader(GDALAsyncReaderWrapperH hWrapper)
4816 {
4817     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
4818     if (psWrapper->hAsyncReader == NULL)
4819     {
4820         CPLError(CE_Failure, CPLE_AppDefined, "AsyncReader object is defunct");
4821     }
4822     return psWrapper->hAsyncReader;
4823 }
4824 
4825 #if defined(SWIGPYTHON)
AsyncReaderWrapperGetPyObject(GDALAsyncReaderWrapperH hWrapper)4826 static void* AsyncReaderWrapperGetPyObject(GDALAsyncReaderWrapperH hWrapper)
4827 {
4828     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
4829     return psWrapper->pyObject;
4830 }
4831 #endif
4832 
DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH hWrapper)4833 static void DeleteAsyncReaderWrapper(GDALAsyncReaderWrapperH hWrapper)
4834 {
4835     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
4836     if (psWrapper->hAsyncReader != NULL)
4837     {
4838         CPLError(CE_Failure, CPLE_AppDefined,
4839                  "Native AsyncReader object will leak. EndAsyncReader() should have been called before");
4840     }
4841     CPLFree(psWrapper);
4842 }
4843 
4844 
4845 
4846 
CreateAsyncReaderWrapper(GDALAsyncReaderH hAsyncReader,void * pyObject)4847 static GDALAsyncReaderWrapper* CreateAsyncReaderWrapper(GDALAsyncReaderH  hAsyncReader,
4848                                                         void             *pyObject)
4849 {
4850     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper* )CPLMalloc(sizeof(GDALAsyncReaderWrapper));
4851     psWrapper->hAsyncReader = hAsyncReader;
4852     psWrapper->pyObject = pyObject;
4853     Py_INCREF((PyObject*) psWrapper->pyObject);
4854     return psWrapper;
4855 }
4856 
DisableAsyncReaderWrapper(GDALAsyncReaderWrapperH hWrapper)4857 static void DisableAsyncReaderWrapper(GDALAsyncReaderWrapperH hWrapper)
4858 {
4859     GDALAsyncReaderWrapper* psWrapper = (GDALAsyncReaderWrapper*)hWrapper;
4860     if (psWrapper->pyObject)
4861     {
4862         Py_XDECREF((PyObject*) psWrapper->pyObject);
4863     }
4864     psWrapper->pyObject = NULL;
4865     psWrapper->hAsyncReader = NULL;
4866 }
4867 
delete_GDALAsyncReaderShadow(GDALAsyncReaderShadow * self)4868 SWIGINTERN void delete_GDALAsyncReaderShadow(GDALAsyncReaderShadow *self){
4869         DeleteAsyncReaderWrapper(self);
4870     }
GDALAsyncReaderShadow_GetNextUpdatedRegion(GDALAsyncReaderShadow * self,double timeout,int * xoff,int * yoff,int * buf_xsize,int * buf_ysize)4871 SWIGINTERN GDALAsyncStatusType GDALAsyncReaderShadow_GetNextUpdatedRegion(GDALAsyncReaderShadow *self,double timeout,int *xoff,int *yoff,int *buf_xsize,int *buf_ysize){
4872         GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
4873         if (hReader == NULL)
4874         {
4875             *xoff = 0;
4876             *yoff = 0;
4877             *buf_xsize = 0;
4878             *buf_ysize = 0;
4879             return GARIO_ERROR;
4880         }
4881         return GDALARGetNextUpdatedRegion(hReader, timeout, xoff, yoff, buf_xsize, buf_ysize );
4882     }
GDALAsyncReaderShadow_GetBuffer(GDALAsyncReaderShadow * self,void ** ppRetPyObject)4883 SWIGINTERN void GDALAsyncReaderShadow_GetBuffer(GDALAsyncReaderShadow *self,void **ppRetPyObject){
4884         GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
4885         if (hReader == NULL)
4886         {
4887             *ppRetPyObject = NULL;
4888             return;
4889         }
4890         *ppRetPyObject = AsyncReaderWrapperGetPyObject(self);
4891         Py_INCREF((PyObject*)*ppRetPyObject);
4892     }
GDALAsyncReaderShadow_LockBuffer(GDALAsyncReaderShadow * self,double timeout)4893 SWIGINTERN int GDALAsyncReaderShadow_LockBuffer(GDALAsyncReaderShadow *self,double timeout){
4894         GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
4895         if (hReader == NULL)
4896         {
4897             return 0;
4898         }
4899         return GDALARLockBuffer(hReader,timeout);
4900     }
GDALAsyncReaderShadow_UnlockBuffer(GDALAsyncReaderShadow * self)4901 SWIGINTERN void GDALAsyncReaderShadow_UnlockBuffer(GDALAsyncReaderShadow *self){
4902         GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(self);
4903         if (hReader == NULL)
4904         {
4905             return;
4906         }
4907         GDALARUnlockBuffer(hReader);
4908     }
delete_GDALDatasetShadow(GDALDatasetShadow * self)4909 SWIGINTERN void delete_GDALDatasetShadow(GDALDatasetShadow *self){
4910     if ( GDALDereferenceDataset( self ) <= 0 ) {
4911       GDALClose(self);
4912     }
4913   }
GDALDatasetShadow_GetDriver(GDALDatasetShadow * self)4914 SWIGINTERN GDALDriverShadow *GDALDatasetShadow_GetDriver(GDALDatasetShadow *self){
4915     return (GDALDriverShadow*) GDALGetDatasetDriver( self );
4916   }
GDALDatasetShadow_GetRasterBand(GDALDatasetShadow * self,int nBand)4917 SWIGINTERN GDALRasterBandShadow *GDALDatasetShadow_GetRasterBand(GDALDatasetShadow *self,int nBand){
4918     return (GDALRasterBandShadow*) GDALGetRasterBand( self, nBand );
4919   }
GDALDatasetShadow_GetRootGroup(GDALDatasetShadow * self)4920 SWIGINTERN GDALGroupHS *GDALDatasetShadow_GetRootGroup(GDALDatasetShadow *self){
4921     return GDALDatasetGetRootGroup(self);
4922   }
GDALDatasetShadow_GetProjection(GDALDatasetShadow * self)4923 SWIGINTERN char const *GDALDatasetShadow_GetProjection(GDALDatasetShadow *self){
4924     return GDALGetProjectionRef( self );
4925   }
GDALDatasetShadow_GetProjectionRef(GDALDatasetShadow * self)4926 SWIGINTERN char const *GDALDatasetShadow_GetProjectionRef(GDALDatasetShadow *self){
4927     return GDALGetProjectionRef( self );
4928   }
GDALDatasetShadow_GetSpatialRef(GDALDatasetShadow * self)4929 SWIGINTERN OSRSpatialReferenceShadow *GDALDatasetShadow_GetSpatialRef(GDALDatasetShadow *self){
4930     OGRSpatialReferenceH ref = GDALGetSpatialRef(self);
4931     if( ref )
4932        ref = OSRClone( ref );
4933     return (OSRSpatialReferenceShadow*) ref;
4934   }
GDALDatasetShadow_SetProjection(GDALDatasetShadow * self,char const * prj)4935 SWIGINTERN CPLErr GDALDatasetShadow_SetProjection(GDALDatasetShadow *self,char const *prj){
4936     return GDALSetProjection( self, prj );
4937   }
GDALDatasetShadow_SetSpatialRef(GDALDatasetShadow * self,OSRSpatialReferenceShadow * srs)4938 SWIGINTERN CPLErr GDALDatasetShadow_SetSpatialRef(GDALDatasetShadow *self,OSRSpatialReferenceShadow *srs){
4939      return GDALSetSpatialRef( self, (OGRSpatialReferenceH)srs );
4940   }
GDALDatasetShadow_GetGeoTransform(GDALDatasetShadow * self,double argout[6],int * isvalid,int * can_return_null=0)4941 SWIGINTERN void GDALDatasetShadow_GetGeoTransform(GDALDatasetShadow *self,double argout[6],int *isvalid,int *can_return_null=0){
4942     if (can_return_null && *can_return_null)
4943     {
4944         *isvalid = (GDALGetGeoTransform( self, argout ) == CE_None );
4945     }
4946     else
4947     {
4948         *isvalid = TRUE;
4949         if ( GDALGetGeoTransform( self, argout ) != CE_None ) {
4950             argout[0] = 0.0;
4951             argout[1] = 1.0;
4952             argout[2] = 0.0;
4953             argout[3] = 0.0;
4954             argout[4] = 0.0;
4955             argout[5] = 1.0;
4956         }
4957     }
4958   }
GDALDatasetShadow_SetGeoTransform(GDALDatasetShadow * self,double argin[6])4959 SWIGINTERN CPLErr GDALDatasetShadow_SetGeoTransform(GDALDatasetShadow *self,double argin[6]){
4960     return GDALSetGeoTransform( self, argin );
4961   }
4962 
4963 static int*
CreateCIntListFromSequence(PyObject * pySeq,int * pnSize)4964 CreateCIntListFromSequence( PyObject* pySeq, int* pnSize ) {
4965   /* check if is List */
4966   if ( !PySequence_Check(pySeq) ) {
4967     PyErr_SetString(PyExc_TypeError, "not a sequence");
4968     *pnSize = -1;
4969     return NULL;
4970   }
4971   Py_ssize_t size = PySequence_Size(pySeq);
4972   if( size != (int)size ) {
4973     PyErr_SetString(PyExc_TypeError, "too big sequence");
4974     *pnSize = -1;
4975     return NULL;
4976   }
4977   *pnSize = (int)size;
4978   int* ret = (int*) malloc(*pnSize*sizeof(int));
4979   for( int i = 0; i<*pnSize; i++ ) {
4980     PyObject *o = PySequence_GetItem(pySeq,i);
4981     if ( !PyArg_Parse(o,"i",&ret[i]) ) {
4982         PyErr_SetString(PyExc_TypeError, "not an integer");
4983         Py_DECREF(o);
4984         free(ret);
4985         *pnSize = -1;
4986         return NULL;
4987     }
4988     Py_DECREF(o);
4989   }
4990   return ret;
4991 }
4992 
GDALDatasetShadow_BuildOverviews(GDALDatasetShadow * self,char const * resampling="NEAREST",int overviewlist=0,int * pOverviews=0,GDALProgressFunc callback=NULL,void * callback_data=NULL)4993 SWIGINTERN int GDALDatasetShadow_BuildOverviews(GDALDatasetShadow *self,char const *resampling="NEAREST",int overviewlist=0,int *pOverviews=0,GDALProgressFunc callback=NULL,void *callback_data=NULL){
4994 
4995     return GDALBuildOverviews(  self,
4996                                 resampling ? resampling : "NEAREST",
4997                                 overviewlist,
4998                                 pOverviews,
4999                                 0,
5000                                 0,
5001                                 callback,
5002                                 callback_data);
5003   }
GDALDatasetShadow_GetGCPCount(GDALDatasetShadow * self)5004 SWIGINTERN int GDALDatasetShadow_GetGCPCount(GDALDatasetShadow *self){
5005     return GDALGetGCPCount( self );
5006   }
GDALDatasetShadow_GetGCPProjection(GDALDatasetShadow * self)5007 SWIGINTERN char const *GDALDatasetShadow_GetGCPProjection(GDALDatasetShadow *self){
5008     return GDALGetGCPProjection( self );
5009   }
GDALDatasetShadow_GetGCPSpatialRef(GDALDatasetShadow * self)5010 SWIGINTERN OSRSpatialReferenceShadow *GDALDatasetShadow_GetGCPSpatialRef(GDALDatasetShadow *self){
5011     OGRSpatialReferenceH ref = GDALGetGCPSpatialRef(self);
5012     if( ref )
5013        ref = OSRClone( ref );
5014     return (OSRSpatialReferenceShadow*) ref;
5015   }
GDALDatasetShadow_GetGCPs(GDALDatasetShadow * self,int * nGCPs,GDAL_GCP const ** pGCPs)5016 SWIGINTERN void GDALDatasetShadow_GetGCPs(GDALDatasetShadow *self,int *nGCPs,GDAL_GCP const **pGCPs){
5017     *nGCPs = GDALGetGCPCount( self );
5018     *pGCPs = GDALGetGCPs( self );
5019   }
GDALDatasetShadow_SetGCPs(GDALDatasetShadow * self,int nGCPs,GDAL_GCP const * pGCPs,char const * pszGCPProjection)5020 SWIGINTERN CPLErr GDALDatasetShadow_SetGCPs(GDALDatasetShadow *self,int nGCPs,GDAL_GCP const *pGCPs,char const *pszGCPProjection){
5021     return GDALSetGCPs( self, nGCPs, pGCPs, pszGCPProjection );
5022   }
GDALDatasetShadow_SetGCPs2(GDALDatasetShadow * self,int nGCPs,GDAL_GCP const * pGCPs,OSRSpatialReferenceShadow * hSRS)5023 SWIGINTERN CPLErr GDALDatasetShadow_SetGCPs2(GDALDatasetShadow *self,int nGCPs,GDAL_GCP const *pGCPs,OSRSpatialReferenceShadow *hSRS){
5024     return GDALSetGCPs2( self, nGCPs, pGCPs, (OGRSpatialReferenceH)hSRS );
5025   }
GDALDatasetShadow_FlushCache(GDALDatasetShadow * self)5026 SWIGINTERN void GDALDatasetShadow_FlushCache(GDALDatasetShadow *self){
5027     GDALFlushCache( self );
5028   }
GDALDatasetShadow_AddBand(GDALDatasetShadow * self,GDALDataType datatype=GDT_Byte,char ** options=0)5029 SWIGINTERN CPLErr GDALDatasetShadow_AddBand(GDALDatasetShadow *self,GDALDataType datatype=GDT_Byte,char **options=0){
5030     return GDALAddBand( self, datatype, options );
5031   }
GDALDatasetShadow_CreateMaskBand(GDALDatasetShadow * self,int nFlags)5032 SWIGINTERN CPLErr GDALDatasetShadow_CreateMaskBand(GDALDatasetShadow *self,int nFlags){
5033       return GDALCreateDatasetMaskBand( self, nFlags );
5034   }
GDALDatasetShadow_GetFileList(GDALDatasetShadow * self)5035 SWIGINTERN char **GDALDatasetShadow_GetFileList(GDALDatasetShadow *self){
5036     return GDALGetFileList( self );
5037   }
GDALDatasetShadow_WriteRaster(GDALDatasetShadow * self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char * buf_string,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,int band_list=0,int * pband_list=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0,GIntBig * buf_band_space=0)5038 SWIGINTERN CPLErr GDALDatasetShadow_WriteRaster(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char *buf_string,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0,GIntBig *buf_band_space=0){
5039     CPLErr eErr;
5040     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
5041     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
5042     GDALDataType ntype;
5043     if ( buf_type != 0 ) {
5044       ntype = (GDALDataType) *buf_type;
5045     } else {
5046       int lastband = GDALGetRasterCount( self );
5047       if (lastband <= 0)
5048         return CE_Failure;
5049       ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
5050     }
5051 
5052     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
5053     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
5054     GIntBig band_space = (buf_band_space == 0) ? 0 : *buf_band_space;
5055 
5056     GIntBig min_buffer_size =
5057       ComputeDatasetRasterIOSize (nxsize, nysize, GDALGetDataTypeSize( ntype ) / 8,
5058                                   band_list ? band_list : GDALGetRasterCount(self), pband_list, band_list,
5059                                   pixel_space, line_space, band_space, FALSE);
5060     if (min_buffer_size == 0)
5061         return CE_Failure;
5062 
5063     if ( buf_len < min_buffer_size )
5064     {
5065         CPLError(CE_Failure, CPLE_AppDefined, "Buffer too small");
5066         return CE_Failure;
5067     }
5068 
5069     GDALRasterIOExtraArg* psExtraArg = NULL;
5070 
5071     eErr = GDALDatasetRasterIOEx( self, GF_Write, xoff, yoff, xsize, ysize,
5072                                   (void*) buf_string, nxsize, nysize, ntype,
5073                                   band_list, pband_list, pixel_space, line_space, band_space, psExtraArg );
5074 
5075     return eErr;
5076   }
GDALDatasetShadow_AdviseRead(GDALDatasetShadow * self,int xoff,int yoff,int xsize,int ysize,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,int band_list=0,int * pband_list=0,char ** options=NULL)5077 SWIGINTERN CPLErr GDALDatasetShadow_AdviseRead(GDALDatasetShadow *self,int xoff,int yoff,int xsize,int ysize,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,char **options=NULL){
5078     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
5079     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
5080     GDALDataType ntype;
5081     if ( buf_type != 0 ) {
5082       ntype = (GDALDataType) *buf_type;
5083     } else {
5084       int lastband = GDALGetRasterCount( self );
5085       if (lastband <= 0)
5086         return CE_Failure;
5087       ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
5088     }
5089     return GDALDatasetAdviseRead(self, xoff, yoff, xsize, ysize,
5090                                  nxsize, nysize, ntype,
5091                                  band_list, pband_list, options);
5092 }
GDALDatasetShadow_BeginAsyncReader(GDALDatasetShadow * self,int xOff,int yOff,int xSize,int ySize,int buf_len,char * buf_string,void * pyObject,int buf_xsize,int buf_ysize,GDALDataType bufType=(GDALDataType)0,int band_list=0,int * pband_list=0,int nPixelSpace=0,int nLineSpace=0,int nBandSpace=0,char ** options=0)5093 SWIGINTERN GDALAsyncReaderShadow *GDALDatasetShadow_BeginAsyncReader(GDALDatasetShadow *self,int xOff,int yOff,int xSize,int ySize,int buf_len,char *buf_string,void *pyObject,int buf_xsize,int buf_ysize,GDALDataType bufType=(GDALDataType) 0,int band_list=0,int *pband_list=0,int nPixelSpace=0,int nLineSpace=0,int nBandSpace=0,char **options=0){
5094 
5095     if ((options != NULL) && (buf_xsize ==0) && (buf_ysize == 0))
5096     {
5097         // calculate an appropriate buffer size
5098         const char* pszLevel = CSLFetchNameValue(options, "LEVEL");
5099         if (pszLevel)
5100         {
5101             // round up
5102             int nLevel = atoi(pszLevel);
5103             if( nLevel < 0 || nLevel > 30 )
5104             {
5105                 CPLError(CE_Failure, CPLE_AppDefined, "Invalid LEVEL: %d", nLevel);
5106             }
5107             else
5108             {
5109                 int nRes = 1 << nLevel;
5110                 buf_xsize = static_cast<int>(ceil(xSize / (1.0 * nRes)));
5111                 buf_ysize = static_cast<int>(ceil(ySize / (1.0 * nRes)));
5112             }
5113         }
5114     }
5115 
5116     int nxsize = (buf_xsize == 0) ? xSize : buf_xsize;
5117     int nysize = (buf_ysize == 0) ? ySize : buf_ysize;
5118 
5119     GDALDataType ntype;
5120     if (bufType != 0) {
5121         ntype = (GDALDataType) bufType;
5122     }
5123     else {
5124         ntype = GDT_Byte;
5125     }
5126 
5127     int nBCount = (band_list) != 0 ? band_list : GDALGetRasterCount(self);
5128     int nMinSize = nxsize * nysize * nBCount * (GDALGetDataTypeSize(ntype) / 8);
5129     if (buf_string == NULL || buf_len < nMinSize)
5130     {
5131         CPLError(CE_Failure, CPLE_AppDefined, "Buffer is too small");
5132         return NULL;
5133     }
5134 
5135     bool myBandList = false;
5136     int* pBandList;
5137 
5138     if (band_list != 0){
5139         myBandList = false;
5140         pBandList = pband_list;
5141     }
5142     else
5143     {
5144         myBandList = true;
5145         pBandList = (int*)CPLMalloc(sizeof(int) * nBCount);
5146         for (int i = 0; i < nBCount; ++i) {
5147             pBandList[i] = i + 1;
5148         }
5149     }
5150 
5151     GDALAsyncReaderH hAsyncReader =
5152             GDALBeginAsyncReader(self, xOff, yOff, xSize, ySize, (void*) buf_string, nxsize, nysize, ntype, nBCount, pBandList, nPixelSpace, nLineSpace,
5153     nBandSpace, options);
5154 
5155     if ( myBandList ) {
5156        CPLFree( pBandList );
5157     }
5158 
5159     if (hAsyncReader)
5160     {
5161         return (GDALAsyncReaderShadow*) CreateAsyncReaderWrapper(hAsyncReader, pyObject);
5162     }
5163     else
5164     {
5165         return NULL;
5166     }
5167 
5168   }
GDALDatasetShadow_EndAsyncReader(GDALDatasetShadow * self,GDALAsyncReaderShadow * ario)5169 SWIGINTERN void GDALDatasetShadow_EndAsyncReader(GDALDatasetShadow *self,GDALAsyncReaderShadow *ario){
5170     if( ario == NULL ) return;
5171     GDALAsyncReaderH hReader = AsyncReaderWrapperGetReader(ario);
5172     if (hReader == NULL)
5173     {
5174         return;
5175     }
5176     GDALEndAsyncReader(self, hReader);
5177     DisableAsyncReaderWrapper(ario);
5178   }
GDALDatasetShadow_GetVirtualMem(GDALDatasetShadow * self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nBufXSize,int nBufYSize,GDALDataType eBufType,int band_list,int * pband_list,int bIsBandSequential,size_t nCacheSize,size_t nPageSizeHint,char ** options=NULL)5179 SWIGINTERN CPLVirtualMemShadow *GDALDatasetShadow_GetVirtualMem(GDALDatasetShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nBufXSize,int nBufYSize,GDALDataType eBufType,int band_list,int *pband_list,int bIsBandSequential,size_t nCacheSize,size_t nPageSizeHint,char **options=NULL){
5180         int nPixelSpace;
5181         int nBandSpace;
5182         if( bIsBandSequential != 0 && bIsBandSequential != 1 )
5183             return NULL;
5184         if( band_list == 0 )
5185             return NULL;
5186         if( bIsBandSequential || band_list == 1 )
5187         {
5188             nPixelSpace = 0;
5189             nBandSpace = 0;
5190         }
5191         else
5192         {
5193             nBandSpace = GDALGetDataTypeSize(eBufType) / 8;
5194             nPixelSpace = nBandSpace * band_list;
5195         }
5196         CPLVirtualMem* vmem = GDALDatasetGetVirtualMem( self,
5197                                          eRWFlag,
5198                                          nXOff, nYOff,
5199                                          nXSize, nYSize,
5200                                          nBufXSize, nBufYSize,
5201                                          eBufType,
5202                                          band_list, pband_list,
5203                                          nPixelSpace,
5204                                          0,
5205                                          nBandSpace,
5206                                          nCacheSize,
5207                                          nPageSizeHint,
5208                                          FALSE,
5209                                          options );
5210         if( vmem == NULL )
5211             return NULL;
5212         CPLVirtualMemShadow* vmemshadow = (CPLVirtualMemShadow*)calloc(1, sizeof(CPLVirtualMemShadow));
5213         vmemshadow->vmem = vmem;
5214         vmemshadow->eBufType = eBufType;
5215         vmemshadow->bIsBandSequential = bIsBandSequential;
5216         vmemshadow->bReadOnly = (eRWFlag == GF_Read);
5217         vmemshadow->nBufXSize = nBufXSize;
5218         vmemshadow->nBufYSize = nBufYSize;
5219         vmemshadow->nBandCount = band_list;
5220         return vmemshadow;
5221     }
GDALDatasetShadow_GetTiledVirtualMem(GDALDatasetShadow * self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nTileXSize,int nTileYSize,GDALDataType eBufType,int band_list,int * pband_list,GDALTileOrganization eTileOrganization,size_t nCacheSize,char ** options=NULL)5222 SWIGINTERN CPLVirtualMemShadow *GDALDatasetShadow_GetTiledVirtualMem(GDALDatasetShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nTileXSize,int nTileYSize,GDALDataType eBufType,int band_list,int *pband_list,GDALTileOrganization eTileOrganization,size_t nCacheSize,char **options=NULL){
5223         if( band_list == 0 )
5224             return NULL;
5225         CPLVirtualMem* vmem = GDALDatasetGetTiledVirtualMem( self,
5226                                          eRWFlag,
5227                                          nXOff, nYOff,
5228                                          nXSize, nYSize,
5229                                          nTileXSize, nTileYSize,
5230                                          eBufType,
5231                                          band_list, pband_list,
5232                                          eTileOrganization,
5233                                          nCacheSize,
5234                                          FALSE,
5235                                          options );
5236         if( vmem == NULL )
5237             return NULL;
5238         CPLVirtualMemShadow* vmemshadow = (CPLVirtualMemShadow*)calloc(1, sizeof(CPLVirtualMemShadow));
5239         vmemshadow->vmem = vmem;
5240         vmemshadow->eBufType = eBufType;
5241         vmemshadow->bIsBandSequential = -1;
5242         vmemshadow->bReadOnly = (eRWFlag == GF_Read);
5243         vmemshadow->nBufXSize = nXSize;
5244         vmemshadow->nBufYSize = nYSize;
5245         vmemshadow->eTileOrganization = eTileOrganization;
5246         vmemshadow->nTileXSize = nTileXSize;
5247         vmemshadow->nTileYSize = nTileYSize;
5248         vmemshadow->nBandCount = band_list;
5249         return vmemshadow;
5250     }
GDALDatasetShadow_CreateLayer(GDALDatasetShadow * self,char const * name,OSRSpatialReferenceShadow * srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char ** options=0)5251 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_CreateLayer(GDALDatasetShadow *self,char const *name,OSRSpatialReferenceShadow *srs=NULL,OGRwkbGeometryType geom_type=wkbUnknown,char **options=0){
5252     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCreateLayer( self,
5253                                   name,
5254                                   srs,
5255                                   geom_type,
5256                                   options);
5257     return layer;
5258   }
GDALDatasetShadow_CopyLayer(GDALDatasetShadow * self,OGRLayerShadow * src_layer,char const * new_name,char ** options=0)5259 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_CopyLayer(GDALDatasetShadow *self,OGRLayerShadow *src_layer,char const *new_name,char **options=0){
5260     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetCopyLayer( self,
5261                                                       src_layer,
5262                                                       new_name,
5263                                                       options);
5264     return layer;
5265   }
GDALDatasetShadow_DeleteLayer(GDALDatasetShadow * self,int index)5266 SWIGINTERN OGRErr GDALDatasetShadow_DeleteLayer(GDALDatasetShadow *self,int index){
5267     return GDALDatasetDeleteLayer(self, index);
5268   }
5269 
5270 
5271 #include "ogr_core.h"
5272 static char const *
OGRErrMessages(int rc)5273 OGRErrMessages( int rc ) {
5274   switch( rc ) {
5275   case OGRERR_NONE:
5276     return "OGR Error: None";
5277   case OGRERR_NOT_ENOUGH_DATA:
5278     return "OGR Error: Not enough data to deserialize";
5279   case OGRERR_NOT_ENOUGH_MEMORY:
5280     return "OGR Error: Not enough memory";
5281   case OGRERR_UNSUPPORTED_GEOMETRY_TYPE:
5282     return "OGR Error: Unsupported geometry type";
5283   case OGRERR_UNSUPPORTED_OPERATION:
5284     return "OGR Error: Unsupported operation";
5285   case OGRERR_CORRUPT_DATA:
5286     return "OGR Error: Corrupt data";
5287   case OGRERR_FAILURE:
5288     return "OGR Error: General Error";
5289   case OGRERR_UNSUPPORTED_SRS:
5290     return "OGR Error: Unsupported SRS";
5291   case OGRERR_INVALID_HANDLE:
5292     return "OGR Error: Invalid handle";
5293   case OGRERR_NON_EXISTING_FEATURE:
5294     return "OGR Error: Non existing feature";
5295   default:
5296     return "OGR Error: Unknown";
5297   }
5298 }
5299 
GDALDatasetShadow_GetLayerCount(GDALDatasetShadow * self)5300 SWIGINTERN int GDALDatasetShadow_GetLayerCount(GDALDatasetShadow *self){
5301     return GDALDatasetGetLayerCount(self);
5302   }
GDALDatasetShadow_GetLayerByIndex(GDALDatasetShadow * self,int index=0)5303 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_GetLayerByIndex(GDALDatasetShadow *self,int index=0){
5304 
5305     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetGetLayer(self, index);
5306     return layer;
5307   }
GDALDatasetShadow_GetLayerByName(GDALDatasetShadow * self,char const * layer_name)5308 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_GetLayerByName(GDALDatasetShadow *self,char const *layer_name){
5309     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetGetLayerByName(self, layer_name);
5310     return layer;
5311   }
GDALDatasetShadow_ResetReading(GDALDatasetShadow * self)5312 SWIGINTERN void GDALDatasetShadow_ResetReading(GDALDatasetShadow *self){
5313     GDALDatasetResetReading( self );
5314   }
5315 
5316 SWIGINTERN int
SWIG_AsVal_bool(PyObject * obj,bool * val)5317 SWIG_AsVal_bool (PyObject *obj, bool *val)
5318 {
5319   int r;
5320   if (!PyBool_Check(obj))
5321     return SWIG_ERROR;
5322   r = PyObject_IsTrue(obj);
5323   if (r == -1)
5324     return SWIG_ERROR;
5325   if (val) *val = r ? true : false;
5326   return SWIG_OK;
5327 }
5328 
GDALDatasetShadow_GetNextFeature(GDALDatasetShadow * self,bool include_layer=true,bool include_pct=false,OGRLayerShadow ** ppoBelongingLayer=NULL,double * pdfProgressPct=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)5329 SWIGINTERN OGRFeatureShadow *GDALDatasetShadow_GetNextFeature(GDALDatasetShadow *self,bool include_layer=true,bool include_pct=false,OGRLayerShadow **ppoBelongingLayer=NULL,double *pdfProgressPct=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
5330     return GDALDatasetGetNextFeature( self, ppoBelongingLayer, pdfProgressPct,
5331                                       callback, callback_data );
5332   }
GDALDatasetShadow_TestCapability(GDALDatasetShadow * self,char const * cap)5333 SWIGINTERN bool GDALDatasetShadow_TestCapability(GDALDatasetShadow *self,char const *cap){
5334     return (GDALDatasetTestCapability(self, cap) > 0);
5335   }
GDALDatasetShadow_ExecuteSQL(GDALDatasetShadow * self,char const * statement,OGRGeometryShadow * spatialFilter=NULL,char const * dialect="")5336 SWIGINTERN OGRLayerShadow *GDALDatasetShadow_ExecuteSQL(GDALDatasetShadow *self,char const *statement,OGRGeometryShadow *spatialFilter=NULL,char const *dialect=""){
5337     OGRLayerShadow* layer = (OGRLayerShadow*) GDALDatasetExecuteSQL(self,
5338                                                       statement,
5339                                                       spatialFilter,
5340                                                       dialect);
5341     return layer;
5342   }
GDALDatasetShadow_ReleaseResultSet(GDALDatasetShadow * self,OGRLayerShadow * layer)5343 SWIGINTERN void GDALDatasetShadow_ReleaseResultSet(GDALDatasetShadow *self,OGRLayerShadow *layer){
5344     GDALDatasetReleaseResultSet(self, layer);
5345   }
GDALDatasetShadow_GetStyleTable(GDALDatasetShadow * self)5346 SWIGINTERN OGRStyleTableShadow *GDALDatasetShadow_GetStyleTable(GDALDatasetShadow *self){
5347     return (OGRStyleTableShadow*) GDALDatasetGetStyleTable(self);
5348   }
GDALDatasetShadow_SetStyleTable(GDALDatasetShadow * self,OGRStyleTableShadow * table)5349 SWIGINTERN void GDALDatasetShadow_SetStyleTable(GDALDatasetShadow *self,OGRStyleTableShadow *table){
5350     if( table != NULL )
5351         GDALDatasetSetStyleTable(self, (OGRStyleTableH) table);
5352   }
GDALDatasetShadow_AbortSQL(GDALDatasetShadow * self)5353 SWIGINTERN OGRErr GDALDatasetShadow_AbortSQL(GDALDatasetShadow *self){
5354     return GDALDatasetAbortSQL(self);
5355 }
GDALDatasetShadow_StartTransaction(GDALDatasetShadow * self,int force=FALSE)5356 SWIGINTERN OGRErr GDALDatasetShadow_StartTransaction(GDALDatasetShadow *self,int force=FALSE){
5357     return GDALDatasetStartTransaction(self, force);
5358   }
GDALDatasetShadow_CommitTransaction(GDALDatasetShadow * self)5359 SWIGINTERN OGRErr GDALDatasetShadow_CommitTransaction(GDALDatasetShadow *self){
5360     return GDALDatasetCommitTransaction(self);
5361   }
GDALDatasetShadow_RollbackTransaction(GDALDatasetShadow * self)5362 SWIGINTERN OGRErr GDALDatasetShadow_RollbackTransaction(GDALDatasetShadow *self){
5363     return GDALDatasetRollbackTransaction(self);
5364   }
GDALDatasetShadow_ClearStatistics(GDALDatasetShadow * self)5365 SWIGINTERN void GDALDatasetShadow_ClearStatistics(GDALDatasetShadow *self){
5366       GDALDatasetClearStatistics(self);
5367   }
GDALDatasetShadow_GetFieldDomain(GDALDatasetShadow * self,char const * name)5368 SWIGINTERN OGRFieldDomainShadow *GDALDatasetShadow_GetFieldDomain(GDALDatasetShadow *self,char const *name){
5369     return (OGRFieldDomainShadow*) GDALDatasetGetFieldDomain(self, name);
5370   }
GDALDatasetShadow_AddFieldDomain(GDALDatasetShadow * self,OGRFieldDomainShadow * fieldDomain)5371 SWIGINTERN bool GDALDatasetShadow_AddFieldDomain(GDALDatasetShadow *self,OGRFieldDomainShadow *fieldDomain){
5372       return GDALDatasetAddFieldDomain(self, (OGRFieldDomainH)fieldDomain, NULL);
5373   }
GDALDatasetShadow_ReadRaster1(GDALDatasetShadow * self,double xoff,double yoff,double xsize,double ysize,void ** buf,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,int band_list=0,int * pband_list=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0,GIntBig * buf_band_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void * callback_data=NULL,void * inputOutputBuf=NULL)5374 SWIGINTERN CPLErr GDALDatasetShadow_ReadRaster1(GDALDatasetShadow *self,double xoff,double yoff,double xsize,double ysize,void **buf,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,int band_list=0,int *pband_list=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0,GIntBig *buf_band_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void *callback_data=NULL,void *inputOutputBuf=NULL){
5375     *buf = NULL;
5376 
5377     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
5378     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
5379     GDALDataType ntype;
5380     if ( buf_type != 0 ) {
5381       ntype = *buf_type;
5382     } else {
5383       int lastband = GDALGetRasterCount( self ) - 1;
5384       if (lastband < 0)
5385       {
5386           return CE_Failure;
5387       }
5388       ntype = GDALGetRasterDataType( GDALGetRasterBand( self, lastband ) );
5389     }
5390 
5391     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
5392     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
5393     GIntBig band_space = (buf_band_space == 0) ? 0 : *buf_band_space;
5394 
5395     int ntypesize = GDALGetDataTypeSize( ntype ) / 8;
5396     size_t buf_size = static_cast<size_t>(
5397         ComputeDatasetRasterIOSize (nxsize, nysize, ntypesize,
5398                                     band_list ? band_list :
5399                                         GDALGetRasterCount(self),
5400                                     pband_list, band_list,
5401                                     pixel_space, line_space, band_space,
5402                                     FALSE));
5403     if (buf_size == 0)
5404     {
5405         return CE_Failure;
5406     }
5407 
5408     char *data;
5409     Py_buffer view;
5410 
5411     if( !readraster_acquirebuffer(buf, inputOutputBuf, buf_size, ntype,
5412                                   bUseExceptions, data, view) )
5413     {
5414         return CE_Failure;
5415     }
5416 
5417     if( inputOutputBuf == NULL )
5418     {
5419         /* Should we clear the buffer in case there are hole in it ? */
5420         if( line_space != 0 && pixel_space != 0 && line_space > pixel_space * nxsize )
5421         {
5422             memset(data, 0, buf_size);
5423         }
5424         else if( band_list > 1 && band_space != 0 )
5425         {
5426             if( line_space != 0 && band_space > line_space * nysize )
5427                 memset(data, 0, buf_size);
5428             else if( pixel_space != 0 && band_space < pixel_space &&
5429                      pixel_space != GDALGetRasterCount(self) * ntypesize )
5430                 memset(data, 0, buf_size);
5431         }
5432     }
5433 
5434     GDALRasterIOExtraArg sExtraArg;
5435     INIT_RASTERIO_EXTRA_ARG(sExtraArg);
5436     sExtraArg.eResampleAlg = resample_alg;
5437     sExtraArg.pfnProgress = callback;
5438     sExtraArg.pProgressData = callback_data;
5439 
5440     int nXOff = (int)(xoff + 0.5);
5441     int nYOff = (int)(yoff + 0.5);
5442     int nXSize = (int)(xsize + 0.5);
5443     int nYSize = (int)(ysize + 0.5);
5444     if( fabs(xoff-nXOff) > 1e-8 || fabs(yoff-nYOff) > 1e-8 ||
5445         fabs(xsize-nXSize) > 1e-8 || fabs(ysize-nYSize) > 1e-8 )
5446     {
5447         sExtraArg.bFloatingPointWindowValidity = TRUE;
5448         sExtraArg.dfXOff = xoff;
5449         sExtraArg.dfYOff = yoff;
5450         sExtraArg.dfXSize = xsize;
5451         sExtraArg.dfYSize = ysize;
5452     }
5453 
5454     CPLErr eErr = GDALDatasetRasterIOEx(self, GF_Read, nXOff, nYOff, nXSize, nYSize,
5455                                data, nxsize, nysize, ntype,
5456                                band_list, pband_list, pixel_space, line_space, band_space,
5457                                &sExtraArg );
5458 
5459     readraster_releasebuffer(eErr, buf, inputOutputBuf, view);
5460 
5461     return eErr;
5462 }
5463 
GDALDatasetShadow_RasterXSize_get(GDALDatasetShadow * h)5464 int GDALDatasetShadow_RasterXSize_get( GDALDatasetShadow *h ) {
5465   return GDALGetRasterXSize( h );
5466 }
GDALDatasetShadow_RasterYSize_get(GDALDatasetShadow * h)5467 int GDALDatasetShadow_RasterYSize_get( GDALDatasetShadow *h ) {
5468   return GDALGetRasterYSize( h );
5469 }
GDALDatasetShadow_RasterCount_get(GDALDatasetShadow * h)5470 int GDALDatasetShadow_RasterCount_get( GDALDatasetShadow *h ) {
5471   return GDALGetRasterCount( h );
5472 }
5473 
delete_GDALGroupHS(GDALGroupHS * self)5474 SWIGINTERN void delete_GDALGroupHS(GDALGroupHS *self){
5475     GDALGroupRelease(self);
5476   }
GDALGroupHS_GetName(GDALGroupHS * self)5477 SWIGINTERN char const *GDALGroupHS_GetName(GDALGroupHS *self){
5478     return GDALGroupGetName(self);
5479   }
GDALGroupHS_GetFullName(GDALGroupHS * self)5480 SWIGINTERN char const *GDALGroupHS_GetFullName(GDALGroupHS *self){
5481     return GDALGroupGetFullName(self);
5482   }
GDALGroupHS_GetMDArrayNames(GDALGroupHS * self,char ** options=0)5483 SWIGINTERN char **GDALGroupHS_GetMDArrayNames(GDALGroupHS *self,char **options=0){
5484     return GDALGroupGetMDArrayNames( self, options );
5485   }
GDALGroupHS_OpenMDArray(GDALGroupHS * self,char const * name,char ** options=0)5486 SWIGINTERN GDALMDArrayHS *GDALGroupHS_OpenMDArray(GDALGroupHS *self,char const *name,char **options=0){
5487     return GDALGroupOpenMDArray(self, name, options);
5488   }
GDALGroupHS_OpenMDArrayFromFullname(GDALGroupHS * self,char const * name,char ** options=0)5489 SWIGINTERN GDALMDArrayHS *GDALGroupHS_OpenMDArrayFromFullname(GDALGroupHS *self,char const *name,char **options=0){
5490     return GDALGroupOpenMDArrayFromFullname(self, name, options);
5491   }
GDALGroupHS_ResolveMDArray(GDALGroupHS * self,char const * name,char const * starting_point,char ** options=0)5492 SWIGINTERN GDALMDArrayHS *GDALGroupHS_ResolveMDArray(GDALGroupHS *self,char const *name,char const *starting_point,char **options=0){
5493     return GDALGroupResolveMDArray(self, name, starting_point, options);
5494   }
GDALGroupHS_GetGroupNames(GDALGroupHS * self,char ** options=0)5495 SWIGINTERN char **GDALGroupHS_GetGroupNames(GDALGroupHS *self,char **options=0){
5496     return GDALGroupGetGroupNames( self, options );
5497   }
GDALGroupHS_OpenGroup(GDALGroupHS * self,char const * name,char ** options=0)5498 SWIGINTERN GDALGroupHS *GDALGroupHS_OpenGroup(GDALGroupHS *self,char const *name,char **options=0){
5499     return GDALGroupOpenGroup(self, name, options);
5500   }
GDALGroupHS_OpenGroupFromFullname(GDALGroupHS * self,char const * name,char ** options=0)5501 SWIGINTERN GDALGroupHS *GDALGroupHS_OpenGroupFromFullname(GDALGroupHS *self,char const *name,char **options=0){
5502     return GDALGroupOpenGroupFromFullname(self, name, options);
5503   }
GDALGroupHS_GetDimensions(GDALGroupHS * self,GDALDimensionHS *** pdims,size_t * pnCount,char ** options=0)5504 SWIGINTERN void GDALGroupHS_GetDimensions(GDALGroupHS *self,GDALDimensionHS ***pdims,size_t *pnCount,char **options=0){
5505     *pdims = GDALGroupGetDimensions(self, pnCount, options);
5506   }
GDALGroupHS_GetAttribute(GDALGroupHS * self,char const * name)5507 SWIGINTERN GDALAttributeHS *GDALGroupHS_GetAttribute(GDALGroupHS *self,char const *name){
5508     return GDALGroupGetAttribute(self, name);
5509   }
GDALGroupHS_GetAttributes(GDALGroupHS * self,GDALAttributeHS *** pattrs,size_t * pnCount,char ** options=0)5510 SWIGINTERN void GDALGroupHS_GetAttributes(GDALGroupHS *self,GDALAttributeHS ***pattrs,size_t *pnCount,char **options=0){
5511     *pattrs = GDALGroupGetAttributes(self, pnCount, options);
5512   }
GDALGroupHS_GetStructuralInfo(GDALGroupHS * self)5513 SWIGINTERN char **GDALGroupHS_GetStructuralInfo(GDALGroupHS *self){
5514     return GDALGroupGetStructuralInfo( self );
5515   }
GDALGroupHS_CreateGroup(GDALGroupHS * self,char const * name,char ** options=0)5516 SWIGINTERN GDALGroupHS *GDALGroupHS_CreateGroup(GDALGroupHS *self,char const *name,char **options=0){
5517     return GDALGroupCreateGroup(self, name, options);
5518   }
GDALGroupHS_CreateDimension(GDALGroupHS * self,char const * name,char const * type,char const * direction,unsigned long long size,char ** options=0)5519 SWIGINTERN GDALDimensionHS *GDALGroupHS_CreateDimension(GDALGroupHS *self,char const *name,char const *type,char const *direction,unsigned long long size,char **options=0){
5520     return GDALGroupCreateDimension(self, name, type, direction, size, options);
5521   }
GDALGroupHS_CreateMDArray(GDALGroupHS * self,char const * name,int nDimensions,GDALDimensionHS ** dimensions,GDALExtendedDataTypeHS * data_type,char ** options=0)5522 SWIGINTERN GDALMDArrayHS *GDALGroupHS_CreateMDArray(GDALGroupHS *self,char const *name,int nDimensions,GDALDimensionHS **dimensions,GDALExtendedDataTypeHS *data_type,char **options=0){
5523     return GDALGroupCreateMDArray(self, name, nDimensions, dimensions,
5524                                   data_type, options);
5525   }
GDALGroupHS_CreateAttribute(GDALGroupHS * self,char const * name,int nDimensions,GUIntBig * dimensions,GDALExtendedDataTypeHS * data_type,char ** options=0)5526 SWIGINTERN GDALAttributeHS *GDALGroupHS_CreateAttribute(GDALGroupHS *self,char const *name,int nDimensions,GUIntBig *dimensions,GDALExtendedDataTypeHS *data_type,char **options=0){
5527     return GDALGroupCreateAttribute(self, name, nDimensions,
5528                                     (const GUInt64*)dimensions,
5529                                     data_type, options);
5530   }
5531 
5532 typedef struct
5533 {
5534   double min;
5535   double max;
5536   double mean;
5537   double std_dev;
5538   GIntBig valid_count;
5539 } Statistics;
5540 
delete_Statistics(Statistics * self)5541 SWIGINTERN void delete_Statistics(Statistics *self){
5542     CPLFree(self);
5543   }
5544 
5545 #include <limits>
5546 
CheckNumericDataType(GDALExtendedDataTypeHS * dt)5547 static bool CheckNumericDataType(GDALExtendedDataTypeHS* dt)
5548 {
5549     GDALExtendedDataTypeClass klass = GDALExtendedDataTypeGetClass(dt);
5550     if( klass == GEDTC_NUMERIC )
5551         return true;
5552     if( klass == GEDTC_STRING )
5553         return false;
5554     CPLAssert( klass == GEDTC_COMPOUND );
5555     size_t nCount = 0;
5556     GDALEDTComponentH* comps = GDALExtendedDataTypeGetComponents(dt, &nCount);
5557     bool ret = true;
5558     for( size_t i = 0; i < nCount; i++ )
5559     {
5560         GDALExtendedDataTypeH tmpType = GDALEDTComponentGetType(comps[i]);
5561         ret = CheckNumericDataType(tmpType);
5562         GDALExtendedDataTypeRelease(tmpType);
5563         if( !ret )
5564             break;
5565     }
5566     GDALExtendedDataTypeFreeComponents(comps, nCount);
5567     return ret;
5568 }
5569 
MDArrayReadWriteCheckArguments(GDALMDArrayHS * array,bool bCheckOnlyDims,int nDims1,GUIntBig * array_start_idx,int nDims2,GUIntBig * count,int nDims3,GIntBig * array_step,int nDims4,GIntBig * buffer_stride,GDALExtendedDataTypeHS * buffer_datatype,size_t * pnBufferSize)5570 static CPLErr MDArrayReadWriteCheckArguments(GDALMDArrayHS* array,
5571                                              bool bCheckOnlyDims,
5572                                              int nDims1, GUIntBig* array_start_idx,
5573                                              int nDims2, GUIntBig* count,
5574                                              int nDims3, GIntBig* array_step,
5575                                              int nDims4, GIntBig* buffer_stride,
5576                                              GDALExtendedDataTypeHS* buffer_datatype,
5577                                              size_t* pnBufferSize)
5578 {
5579     const int nExpectedDims = (int)GDALMDArrayGetDimensionCount(array);
5580     if( nDims1 != nExpectedDims )
5581     {
5582         CPLError(CE_Failure, CPLE_AppDefined,
5583             "Wrong number of values in array_start_idx");
5584         return CE_Failure;
5585     }
5586     if( nDims2 != nExpectedDims )
5587     {
5588         CPLError(CE_Failure, CPLE_AppDefined,
5589             "Wrong number of values in count");
5590         return CE_Failure;
5591     }
5592     if( nDims3 != nExpectedDims )
5593     {
5594         CPLError(CE_Failure, CPLE_AppDefined,
5595             "Wrong number of values in array_step");
5596         return CE_Failure;
5597     }
5598     if( nDims4!= nExpectedDims )
5599     {
5600         CPLError(CE_Failure, CPLE_AppDefined,
5601             "Wrong number of values in buffer_stride");
5602         return CE_Failure;
5603     }
5604     if( bCheckOnlyDims )
5605         return CE_None;
5606     if( !CheckNumericDataType(buffer_datatype) )
5607     {
5608         CPLError(CE_Failure, CPLE_NotSupported,
5609             "non-numeric buffer data type not supported in SWIG bindings");
5610         return CE_Failure;
5611     }
5612     GIntBig nBufferSize = 0;
5613     for( int i = 0; i < nExpectedDims; i++ )
5614     {
5615         if( count[i] == 0 )
5616         {
5617             CPLError(CE_Failure, CPLE_AppDefined,
5618                      "count[%d] = 0 is invalid", i);
5619             return CE_Failure;
5620         }
5621         if( buffer_stride[i] < 0 )
5622         {
5623             CPLError(CE_Failure, CPLE_NotSupported,
5624                 "Negative value in buffer_stride not supported in SWIG bindings");
5625             return CE_Failure;
5626         }
5627         if( count[i] > 1 && buffer_stride[i] != 0 )
5628         {
5629             if( (GUIntBig)buffer_stride[i] > std::numeric_limits<GIntBig>::max() / (count[i] - 1) )
5630             {
5631                 CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5632                 return CE_Failure;
5633             }
5634             GIntBig nDelta = buffer_stride[i] * (count[i] - 1);
5635             if( nBufferSize > std::numeric_limits<GIntBig>::max() - nDelta )
5636             {
5637                 CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5638                 return CE_Failure;
5639             }
5640             nBufferSize += nDelta;
5641         }
5642     }
5643     const size_t nDTSize = GDALExtendedDataTypeGetSize(buffer_datatype);
5644     if( nDTSize == 0 )
5645     {
5646         CPLError(CE_Failure, CPLE_AppDefined, "nDTSize == 0");
5647         return CE_Failure;
5648     }
5649     if( (GUIntBig)nBufferSize > (GUIntBig)std::numeric_limits<GIntBig>::max() / nDTSize )
5650     {
5651         CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5652         return CE_Failure;
5653     }
5654     nBufferSize *= nDTSize;
5655     if( (GUIntBig)nBufferSize > (GUIntBig)std::numeric_limits<GIntBig>::max() - nDTSize )
5656     {
5657         CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5658         return CE_Failure;
5659     }
5660     nBufferSize += nDTSize;
5661 
5662 #if SIZEOF_VOIDP == 4
5663     if( nBufferSize > INT_MAX )
5664     {
5665         CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
5666         return CE_Failure;
5667     }
5668 #endif
5669     *pnBufferSize = (size_t)nBufferSize;
5670     return CE_None;
5671 }
5672 
delete_GDALMDArrayHS(GDALMDArrayHS * self)5673 SWIGINTERN void delete_GDALMDArrayHS(GDALMDArrayHS *self){
5674     GDALMDArrayRelease(self);
5675   }
GDALMDArrayHS_GetName(GDALMDArrayHS * self)5676 SWIGINTERN char const *GDALMDArrayHS_GetName(GDALMDArrayHS *self){
5677     return GDALMDArrayGetName(self);
5678   }
GDALMDArrayHS_GetFullName(GDALMDArrayHS * self)5679 SWIGINTERN char const *GDALMDArrayHS_GetFullName(GDALMDArrayHS *self){
5680     return GDALMDArrayGetFullName(self);
5681   }
GDALMDArrayHS_GetTotalElementsCount(GDALMDArrayHS * self)5682 SWIGINTERN unsigned long long GDALMDArrayHS_GetTotalElementsCount(GDALMDArrayHS *self){
5683     return GDALMDArrayGetTotalElementsCount(self);
5684   }
5685 
5686 #ifdef SWIG_LONG_LONG_AVAILABLE
5687 SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long_SS_long(unsigned long long value)5688 SWIG_From_unsigned_SS_long_SS_long  (unsigned long long value)
5689 {
5690   return (value > LONG_MAX) ?
5691     PyLong_FromUnsignedLongLong(value) : PyInt_FromLong(static_cast< long >(value));
5692 }
5693 #endif
5694 
GDALMDArrayHS_GetDimensionCount(GDALMDArrayHS * self)5695 SWIGINTERN size_t GDALMDArrayHS_GetDimensionCount(GDALMDArrayHS *self){
5696     return GDALMDArrayGetDimensionCount(self);
5697   }
5698 
5699 SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long(unsigned long value)5700 SWIG_From_unsigned_SS_long  (unsigned long value)
5701 {
5702   return (value > LONG_MAX) ?
5703     PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value));
5704 }
5705 
5706 
5707 SWIGINTERNINLINE PyObject *
SWIG_From_size_t(size_t value)5708 SWIG_From_size_t  (size_t value)
5709 {
5710 #ifdef SWIG_LONG_LONG_AVAILABLE
5711   if (sizeof(size_t) <= sizeof(unsigned long)) {
5712 #endif
5713     return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
5714 #ifdef SWIG_LONG_LONG_AVAILABLE
5715   } else {
5716     /* assume sizeof(size_t) <= sizeof(unsigned long long) */
5717     return SWIG_From_unsigned_SS_long_SS_long  (static_cast< unsigned long long >(value));
5718   }
5719 #endif
5720 }
5721 
GDALMDArrayHS_GetDimensions(GDALMDArrayHS * self,GDALDimensionHS *** pdims,size_t * pnCount)5722 SWIGINTERN void GDALMDArrayHS_GetDimensions(GDALMDArrayHS *self,GDALDimensionHS ***pdims,size_t *pnCount){
5723     *pdims = GDALMDArrayGetDimensions(self, pnCount);
5724   }
GDALMDArrayHS_GetBlockSize(GDALMDArrayHS * self,GUIntBig ** psizes,size_t * pnCount)5725 SWIGINTERN void GDALMDArrayHS_GetBlockSize(GDALMDArrayHS *self,GUIntBig **psizes,size_t *pnCount){
5726     *psizes = GDALMDArrayGetBlockSize(self, pnCount);
5727   }
GDALMDArrayHS_GetProcessingChunkSize(GDALMDArrayHS * self,size_t nMaxChunkMemory,GUIntBig ** psizes,size_t * pnCount)5728 SWIGINTERN void GDALMDArrayHS_GetProcessingChunkSize(GDALMDArrayHS *self,size_t nMaxChunkMemory,GUIntBig **psizes,size_t *pnCount){
5729      size_t* panTmp = GDALMDArrayGetProcessingChunkSize(self, pnCount, nMaxChunkMemory);
5730      *psizes = NULL;
5731      if( panTmp )
5732      {
5733         *psizes = (GUIntBig*) CPLMalloc(sizeof(GUIntBig) * (*pnCount));
5734         for( size_t i = 0; i < *pnCount; ++i )
5735         {
5736             (*psizes)[i] = panTmp[i];
5737         }
5738         CPLFree(panTmp);
5739      }
5740   }
GDALMDArrayHS_GetDataType(GDALMDArrayHS * self)5741 SWIGINTERN GDALExtendedDataTypeHS *GDALMDArrayHS_GetDataType(GDALMDArrayHS *self){
5742     return GDALMDArrayGetDataType(self);
5743   }
GDALMDArrayHS_GetStructuralInfo(GDALMDArrayHS * self)5744 SWIGINTERN char **GDALMDArrayHS_GetStructuralInfo(GDALMDArrayHS *self){
5745     return GDALMDArrayGetStructuralInfo( self );
5746   }
GDALMDArrayHS_Read(GDALMDArrayHS * self,int nDims1,GUIntBig * array_start_idx,int nDims2,GUIntBig * count,int nDims3,GIntBig * array_step,int nDims4,GIntBig * buffer_stride,GDALExtendedDataTypeHS * buffer_datatype,void ** buf)5747 SWIGINTERN CPLErr GDALMDArrayHS_Read(GDALMDArrayHS *self,int nDims1,GUIntBig *array_start_idx,int nDims2,GUIntBig *count,int nDims3,GIntBig *array_step,int nDims4,GIntBig *buffer_stride,GDALExtendedDataTypeHS *buffer_datatype,void **buf){
5748     *buf = NULL;
5749 
5750     size_t buf_size = 0;
5751     if( MDArrayReadWriteCheckArguments(self, true,
5752                                         nDims1, array_start_idx,
5753                                         nDims2, count,
5754                                         nDims3, array_step,
5755                                         nDims4, buffer_stride,
5756                                         buffer_datatype,
5757                                         &buf_size) != CE_None )
5758     {
5759       return CE_Failure;
5760     }
5761 
5762     const int nExpectedDims = (int)GDALMDArrayGetDimensionCount(self);
5763     std::vector<size_t> count_internal(nExpectedDims + 1);
5764     std::vector<GPtrDiff_t> buffer_stride_internal(nExpectedDims + 1);
5765     size_t nProductCount = 1;
5766     for( int i = 0; i < nExpectedDims; i++ )
5767     {
5768         count_internal[i] = (size_t)count[i];
5769         if( count_internal[i] != count[i] )
5770         {
5771             CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5772             return CE_Failure;
5773         }
5774         nProductCount *= count_internal[i];
5775         buffer_stride_internal[i] = (GPtrDiff_t)buffer_stride[i];
5776         if( buffer_stride_internal[i] != buffer_stride[i] )
5777         {
5778             CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5779             return CE_Failure;
5780         }
5781     }
5782 
5783     GDALExtendedDataTypeHS* selfType = GDALMDArrayGetDataType(self);
5784     bool isSelfString = GDALExtendedDataTypeGetClass(selfType) == GEDTC_STRING;
5785     GDALExtendedDataTypeRelease(selfType);
5786 
5787     if( GDALExtendedDataTypeGetClass(buffer_datatype) == GEDTC_STRING &&
5788         isSelfString )
5789     {
5790         size_t nExpectedStride = 1;
5791         for( int i = nExpectedDims; i > 0; )
5792         {
5793             --i;
5794             if( (size_t)buffer_stride_internal[i] != nExpectedStride )
5795             {
5796                 CPLError(CE_Failure, CPLE_AppDefined, "Unhandled stride");
5797                 return CE_Failure;
5798             }
5799             nExpectedStride *= count_internal[i];
5800         }
5801         char** ppszBuffer = (char**)VSI_CALLOC_VERBOSE(nProductCount, sizeof(char*));
5802         if( !ppszBuffer )
5803             return CE_Failure;
5804         GByte* pabyBuffer = (GByte*)ppszBuffer;
5805         if( !(GDALMDArrayRead( self,
5806                             array_start_idx,
5807                             &count_internal[0],
5808                             array_step,
5809                             NULL,
5810                             buffer_datatype,
5811                             pabyBuffer,
5812                             pabyBuffer,
5813                             nProductCount * sizeof(char*) )) )
5814         {
5815             for( size_t i = 0; i < nProductCount; i++ )
5816                 VSIFree(ppszBuffer[i]);
5817             VSIFree(pabyBuffer);
5818             return CE_Failure;
5819         }
5820 
5821         SWIG_PYTHON_THREAD_BEGIN_BLOCK;
5822         PyObject* obj = PyList_New( nProductCount );
5823         for( size_t i = 0; i < nProductCount; i++ )
5824         {
5825             if( !ppszBuffer[i] )
5826             {
5827                 Py_INCREF(Py_None);
5828                 PyList_SetItem(obj, i, Py_None);
5829             }
5830             else
5831             {
5832                 PyList_SetItem(obj, i, GDALPythonObjectFromCStr( ppszBuffer[i] ) );
5833             }
5834             VSIFree(ppszBuffer[i]);
5835         }
5836         SWIG_PYTHON_THREAD_END_BLOCK;
5837         *buf = obj;
5838         VSIFree(pabyBuffer);
5839         return CE_None;
5840     }
5841 
5842     if( MDArrayReadWriteCheckArguments(self, false,
5843                                         nDims1, array_start_idx,
5844                                         nDims2, count,
5845                                         nDims3, array_step,
5846                                         nDims4, buffer_stride,
5847                                         buffer_datatype,
5848                                         &buf_size) != CE_None )
5849     {
5850       return CE_Failure;
5851     }
5852     if( buf_size == 0 )
5853     {
5854         return CE_None;
5855     }
5856 
5857 
5858     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
5859     *buf = (void *)PyByteArray_FromStringAndSize( NULL, buf_size );
5860     if (*buf == NULL)
5861     {
5862         *buf = Py_None;
5863         if( !bUseExceptions )
5864         {
5865             PyErr_Clear();
5866         }
5867         SWIG_PYTHON_THREAD_END_BLOCK;
5868         CPLError(CE_Failure, CPLE_OutOfMemory, "Cannot allocate result buffer");
5869         return CE_Failure;
5870     }
5871     char *data = PyByteArray_AsString( (PyObject *)*buf );
5872     SWIG_PYTHON_THREAD_END_BLOCK;
5873 
5874     memset(data, 0, buf_size);
5875 
5876     CPLErr eErr = GDALMDArrayRead( self,
5877                                    array_start_idx,
5878                                    &count_internal[0],
5879                                    array_step,
5880                                    &buffer_stride_internal[0],
5881                                    buffer_datatype,
5882                                    data,
5883                                    data,
5884                                    buf_size ) ? CE_None : CE_Failure;
5885     if (eErr == CE_Failure)
5886     {
5887         SWIG_PYTHON_THREAD_BEGIN_BLOCK;
5888         Py_DECREF((PyObject*)*buf);
5889         SWIG_PYTHON_THREAD_END_BLOCK;
5890         *buf = NULL;
5891     }
5892 
5893     return eErr;
5894   }
GDALMDArrayHS_WriteStringArray(GDALMDArrayHS * self,int nDims1,GUIntBig * array_start_idx,int nDims2,GUIntBig * count,int nDims3,GIntBig * array_step,GDALExtendedDataTypeHS * buffer_datatype,char ** options)5895 SWIGINTERN CPLErr GDALMDArrayHS_WriteStringArray(GDALMDArrayHS *self,int nDims1,GUIntBig *array_start_idx,int nDims2,GUIntBig *count,int nDims3,GIntBig *array_step,GDALExtendedDataTypeHS *buffer_datatype,char **options){
5896 
5897     const int nExpectedDims = (int)GDALMDArrayGetDimensionCount(self);
5898     std::vector<size_t> count_internal(nExpectedDims);
5899     if( nExpectedDims != 1 )
5900     {
5901         CPLError(CE_Failure, CPLE_AppDefined,
5902             "Unsupported number of dimensions");
5903         return CE_Failure;
5904     }
5905     for( int i = 0; i < nExpectedDims; i++ )
5906     {
5907         count_internal[i] = (size_t)count[i];
5908         if( count_internal[i] != count[i] )
5909         {
5910             CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5911             return CE_Failure;
5912         }
5913     }
5914     if( nDims1 != 1 )
5915     {
5916         CPLError(CE_Failure, CPLE_AppDefined,
5917             "Wrong number of values in array_start_idx");
5918         return CE_Failure;
5919     }
5920     if( nDims2 != 1 )
5921     {
5922         CPLError(CE_Failure, CPLE_AppDefined,
5923             "Wrong number of values in count");
5924         return CE_Failure;
5925     }
5926     if( nDims3 != 1 )
5927     {
5928         CPLError(CE_Failure, CPLE_AppDefined,
5929             "Wrong number of values in array_step");
5930         return CE_Failure;
5931     }
5932 
5933     CPLErr eErr = GDALMDArrayWrite(self,
5934                                    array_start_idx,
5935                                    &count_internal[0],
5936                                    array_step,
5937                                    NULL,
5938                                    buffer_datatype,
5939                                    options,
5940                                    options,
5941                                    CSLCount(options) * sizeof(char*) ) ? CE_None : CE_Failure;
5942     return eErr;
5943   }
GDALMDArrayHS_Write(GDALMDArrayHS * self,int nDims1,GUIntBig * array_start_idx,int nDims2,GUIntBig * count,int nDims3,GIntBig * array_step,int nDims4,GIntBig * buffer_stride,GDALExtendedDataTypeHS * buffer_datatype,GIntBig buf_len,char * buf_string)5944 SWIGINTERN CPLErr GDALMDArrayHS_Write(GDALMDArrayHS *self,int nDims1,GUIntBig *array_start_idx,int nDims2,GUIntBig *count,int nDims3,GIntBig *array_step,int nDims4,GIntBig *buffer_stride,GDALExtendedDataTypeHS *buffer_datatype,GIntBig buf_len,char *buf_string){
5945 
5946     size_t buf_size = 0;
5947     if( MDArrayReadWriteCheckArguments(self, false,
5948                                         nDims1, array_start_idx,
5949                                         nDims2, count,
5950                                         nDims3, array_step,
5951                                         nDims4, buffer_stride,
5952                                         buffer_datatype,
5953                                         &buf_size) != CE_None )
5954     {
5955       return CE_Failure;
5956     }
5957 
5958     if ( (GUIntBig)buf_len < buf_size )
5959     {
5960         CPLError(CE_Failure, CPLE_AppDefined, "Buffer too small");
5961         return CE_Failure;
5962     }
5963 
5964     const int nExpectedDims = (int)GDALMDArrayGetDimensionCount(self);
5965     std::vector<size_t> count_internal(nExpectedDims+1);
5966     std::vector<GPtrDiff_t> buffer_stride_internal(nExpectedDims+1);
5967     for( int i = 0; i < nExpectedDims; i++ )
5968     {
5969         count_internal[i] = (size_t)count[i];
5970         if( count_internal[i] != count[i] )
5971         {
5972             CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5973             return CE_Failure;
5974         }
5975         buffer_stride_internal[i] = (GPtrDiff_t)buffer_stride[i];
5976         if( buffer_stride_internal[i] != buffer_stride[i] )
5977         {
5978             CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
5979             return CE_Failure;
5980         }
5981     }
5982 
5983     CPLErr eErr = GDALMDArrayWrite( self,
5984                                    array_start_idx,
5985                                    &count_internal[0],
5986                                    array_step,
5987                                    &buffer_stride_internal[0],
5988                                    buffer_datatype,
5989                                    buf_string,
5990                                    buf_string,
5991                                    (size_t)buf_len ) ? CE_None : CE_Failure;
5992     return eErr;
5993   }
GDALMDArrayHS_AdviseRead(GDALMDArrayHS * self,int nDims1,GUIntBig * array_start_idx,int nDims2,GUIntBig * count)5994 SWIGINTERN CPLErr GDALMDArrayHS_AdviseRead(GDALMDArrayHS *self,int nDims1,GUIntBig *array_start_idx,int nDims2,GUIntBig *count){
5995 
5996     const int nExpectedDims = (int)GDALMDArrayGetDimensionCount(self);
5997     if( nDims1 != nExpectedDims )
5998     {
5999         CPLError(CE_Failure, CPLE_AppDefined,
6000             "Wrong number of values in array_start_idx");
6001         return CE_Failure;
6002     }
6003     if( nDims2 != nExpectedDims )
6004     {
6005         CPLError(CE_Failure, CPLE_AppDefined,
6006             "Wrong number of values in count");
6007         return CE_Failure;
6008     }
6009 
6010     std::vector<size_t> count_internal(nExpectedDims+1);
6011     for( int i = 0; i < nExpectedDims; i++ )
6012     {
6013         count_internal[i] = (size_t)count[i];
6014         if( count_internal[i] != count[i] )
6015         {
6016             CPLError(CE_Failure, CPLE_AppDefined, "Integer overflow");
6017             return CE_Failure;
6018         }
6019     }
6020 
6021     if( !(GDALMDArrayAdviseRead( self, array_start_idx, count_internal.data() )) )
6022     {
6023         return CE_Failure;
6024     }
6025     return CE_None;
6026   }
GDALMDArrayHS_GetAttribute(GDALMDArrayHS * self,char const * name)6027 SWIGINTERN GDALAttributeHS *GDALMDArrayHS_GetAttribute(GDALMDArrayHS *self,char const *name){
6028     return GDALMDArrayGetAttribute(self, name);
6029   }
GDALMDArrayHS_GetAttributes(GDALMDArrayHS * self,GDALAttributeHS *** pattrs,size_t * pnCount,char ** options=0)6030 SWIGINTERN void GDALMDArrayHS_GetAttributes(GDALMDArrayHS *self,GDALAttributeHS ***pattrs,size_t *pnCount,char **options=0){
6031     *pattrs = GDALMDArrayGetAttributes(self, pnCount, options);
6032   }
GDALMDArrayHS_CreateAttribute(GDALMDArrayHS * self,char const * name,int nDimensions,GUIntBig * dimensions,GDALExtendedDataTypeHS * data_type,char ** options=0)6033 SWIGINTERN GDALAttributeHS *GDALMDArrayHS_CreateAttribute(GDALMDArrayHS *self,char const *name,int nDimensions,GUIntBig *dimensions,GDALExtendedDataTypeHS *data_type,char **options=0){
6034     return GDALMDArrayCreateAttribute(self, name, nDimensions,
6035                                     (const GUInt64*)dimensions,
6036                                     data_type, options);
6037   }
GDALMDArrayHS_GetNoDataValueAsRaw(GDALMDArrayHS * self,void ** buf)6038 SWIGINTERN CPLErr GDALMDArrayHS_GetNoDataValueAsRaw(GDALMDArrayHS *self,void **buf){
6039     *buf = NULL;
6040     const void* pabyBuf = GDALMDArrayGetRawNoDataValue(self);
6041     if( pabyBuf == NULL )
6042     {
6043       return CE_Failure;
6044     }
6045     GDALExtendedDataTypeHS* selfType = GDALMDArrayGetDataType(self);
6046     const size_t buf_size = GDALExtendedDataTypeGetSize(selfType);
6047     GDALExtendedDataTypeRelease(selfType);
6048 
6049     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
6050     *buf = (void *)PyByteArray_FromStringAndSize( NULL, buf_size );
6051     if (*buf == NULL)
6052     {
6053         *buf = Py_None;
6054         if( !bUseExceptions )
6055         {
6056             PyErr_Clear();
6057         }
6058         SWIG_PYTHON_THREAD_END_BLOCK;
6059         CPLError(CE_Failure, CPLE_OutOfMemory, "Cannot allocate result buffer");
6060         return CE_Failure;
6061     }
6062     char *data = PyByteArray_AsString( (PyObject *)*buf );
6063     SWIG_PYTHON_THREAD_END_BLOCK;
6064 
6065     memcpy(data, pabyBuf, buf_size);
6066 
6067     return CE_None;
6068   }
GDALMDArrayHS_GetNoDataValueAsDouble(GDALMDArrayHS * self,double * val,int * hasval)6069 SWIGINTERN void GDALMDArrayHS_GetNoDataValueAsDouble(GDALMDArrayHS *self,double *val,int *hasval){
6070     *val = GDALMDArrayGetNoDataValueAsDouble( self, hasval );
6071   }
GDALMDArrayHS_SetNoDataValueDouble(GDALMDArrayHS * self,double d)6072 SWIGINTERN CPLErr GDALMDArrayHS_SetNoDataValueDouble(GDALMDArrayHS *self,double d){
6073     return GDALMDArraySetNoDataValueAsDouble( self, d ) ? CE_None : CE_Failure;
6074   }
GDALMDArrayHS_SetNoDataValueRaw(GDALMDArrayHS * self,GIntBig nLen,char * pBuf)6075 SWIGINTERN CPLErr GDALMDArrayHS_SetNoDataValueRaw(GDALMDArrayHS *self,GIntBig nLen,char *pBuf){
6076     GDALExtendedDataTypeHS* selfType = GDALMDArrayGetDataType(self);
6077     const size_t selfTypeSize = GDALExtendedDataTypeGetSize(selfType);
6078     GDALExtendedDataTypeRelease(selfType);
6079 
6080     if( static_cast<size_t>(nLen) != selfTypeSize )
6081     {
6082         CPLError(CE_Failure, CPLE_IllegalArg, "Argument of wrong size");
6083         return CE_Failure;
6084     }
6085     return GDALMDArraySetRawNoDataValue(self, pBuf) ? CE_None : CE_Failure;
6086   }
GDALMDArrayHS_DeleteNoDataValue(GDALMDArrayHS * self)6087 SWIGINTERN CPLErr GDALMDArrayHS_DeleteNoDataValue(GDALMDArrayHS *self){
6088     return GDALMDArraySetRawNoDataValue( self, NULL ) ? CE_None : CE_Failure;
6089   }
GDALMDArrayHS_GetOffset(GDALMDArrayHS * self,double * val,int * hasval)6090 SWIGINTERN void GDALMDArrayHS_GetOffset(GDALMDArrayHS *self,double *val,int *hasval){
6091     *val = GDALMDArrayGetOffset( self, hasval );
6092   }
GDALMDArrayHS_GetOffsetStorageType(GDALMDArrayHS * self)6093 SWIGINTERN GDALDataType GDALMDArrayHS_GetOffsetStorageType(GDALMDArrayHS *self){
6094     GDALDataType eDT = GDT_Unknown;
6095     int hasval = FALSE;
6096     GDALMDArrayGetOffsetEx( self, &hasval, &eDT );
6097     return hasval ? eDT : GDT_Unknown;
6098   }
GDALMDArrayHS_GetScale(GDALMDArrayHS * self,double * val,int * hasval)6099 SWIGINTERN void GDALMDArrayHS_GetScale(GDALMDArrayHS *self,double *val,int *hasval){
6100     *val = GDALMDArrayGetScale( self, hasval );
6101   }
GDALMDArrayHS_GetScaleStorageType(GDALMDArrayHS * self)6102 SWIGINTERN GDALDataType GDALMDArrayHS_GetScaleStorageType(GDALMDArrayHS *self){
6103     GDALDataType eDT = GDT_Unknown;
6104     int hasval = FALSE;
6105     GDALMDArrayGetScaleEx( self, &hasval, &eDT );
6106     return hasval ? eDT : GDT_Unknown;
6107   }
GDALMDArrayHS_SetOffset(GDALMDArrayHS * self,double val,GDALDataType storageType=GDT_Unknown)6108 SWIGINTERN CPLErr GDALMDArrayHS_SetOffset(GDALMDArrayHS *self,double val,GDALDataType storageType=GDT_Unknown){
6109     return GDALMDArraySetOffsetEx( self, val, storageType ) ? CE_None : CE_Failure;
6110   }
GDALMDArrayHS_SetScale(GDALMDArrayHS * self,double val,GDALDataType storageType=GDT_Unknown)6111 SWIGINTERN CPLErr GDALMDArrayHS_SetScale(GDALMDArrayHS *self,double val,GDALDataType storageType=GDT_Unknown){
6112     return GDALMDArraySetScaleEx( self, val, storageType ) ? CE_None : CE_Failure;
6113   }
GDALMDArrayHS_SetUnit(GDALMDArrayHS * self,char const * unit)6114 SWIGINTERN CPLErr GDALMDArrayHS_SetUnit(GDALMDArrayHS *self,char const *unit){
6115     return GDALMDArraySetUnit(self, unit) ? CE_None : CE_Failure;
6116   }
GDALMDArrayHS_GetUnit(GDALMDArrayHS * self)6117 SWIGINTERN char const *GDALMDArrayHS_GetUnit(GDALMDArrayHS *self){
6118     return GDALMDArrayGetUnit(self);
6119   }
GDALMDArrayHS_SetSpatialRef(GDALMDArrayHS * self,OSRSpatialReferenceShadow * srs)6120 SWIGINTERN OGRErr GDALMDArrayHS_SetSpatialRef(GDALMDArrayHS *self,OSRSpatialReferenceShadow *srs){
6121      return GDALMDArraySetSpatialRef( self, (OGRSpatialReferenceH)srs ) ? CE_None : CE_Failure;
6122   }
GDALMDArrayHS_GetSpatialRef(GDALMDArrayHS * self)6123 SWIGINTERN OSRSpatialReferenceShadow *GDALMDArrayHS_GetSpatialRef(GDALMDArrayHS *self){
6124     return GDALMDArrayGetSpatialRef(self);
6125   }
GDALMDArrayHS_GetView(GDALMDArrayHS * self,char const * viewExpr)6126 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_GetView(GDALMDArrayHS *self,char const *viewExpr){
6127     return GDALMDArrayGetView(self, viewExpr);
6128   }
GDALMDArrayHS_Transpose(GDALMDArrayHS * self,int nList,int * pList)6129 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_Transpose(GDALMDArrayHS *self,int nList,int *pList){
6130     return GDALMDArrayTranspose(self, nList, pList);
6131   }
GDALMDArrayHS_GetUnscaled(GDALMDArrayHS * self)6132 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_GetUnscaled(GDALMDArrayHS *self){
6133     return GDALMDArrayGetUnscaled(self);
6134   }
GDALMDArrayHS_GetMask(GDALMDArrayHS * self,char ** options=0)6135 SWIGINTERN GDALMDArrayHS *GDALMDArrayHS_GetMask(GDALMDArrayHS *self,char **options=0){
6136     return GDALMDArrayGetMask(self, options);
6137   }
GDALMDArrayHS_AsClassicDataset(GDALMDArrayHS * self,size_t iXDim,size_t iYDim)6138 SWIGINTERN GDALDatasetShadow *GDALMDArrayHS_AsClassicDataset(GDALMDArrayHS *self,size_t iXDim,size_t iYDim){
6139     return (GDALDatasetShadow*)GDALMDArrayAsClassicDataset(self, iXDim, iYDim);
6140   }
GDALMDArrayHS_GetStatistics(GDALMDArrayHS * self,GDALDatasetShadow * ds=NULL,bool approx_ok=FALSE,bool force=TRUE,GDALProgressFunc callback=NULL,void * callback_data=NULL)6141 SWIGINTERN Statistics *GDALMDArrayHS_GetStatistics(GDALMDArrayHS *self,GDALDatasetShadow *ds=NULL,bool approx_ok=FALSE,bool force=TRUE,GDALProgressFunc callback=NULL,void *callback_data=NULL){
6142         GUInt64 nValidCount = 0;
6143         Statistics* psStatisticsOut = (Statistics*)CPLMalloc(sizeof(Statistics));
6144         CPLErr eErr = GDALMDArrayGetStatistics(self, ds, approx_ok, force,
6145                                  &(psStatisticsOut->min),
6146                                  &(psStatisticsOut->max),
6147                                  &(psStatisticsOut->mean),
6148                                  &(psStatisticsOut->std_dev),
6149                                  &nValidCount,
6150                                  callback, callback_data);
6151         psStatisticsOut->valid_count = static_cast<GIntBig>(nValidCount);
6152         if( eErr == CE_None )
6153             return psStatisticsOut;
6154         CPLFree(psStatisticsOut);
6155         return NULL;
6156   }
GDALMDArrayHS_ComputeStatistics(GDALMDArrayHS * self,GDALDatasetShadow * ds=NULL,bool approx_ok=FALSE,GDALProgressFunc callback=NULL,void * callback_data=NULL)6157 SWIGINTERN Statistics *GDALMDArrayHS_ComputeStatistics(GDALMDArrayHS *self,GDALDatasetShadow *ds=NULL,bool approx_ok=FALSE,GDALProgressFunc callback=NULL,void *callback_data=NULL){
6158         GUInt64 nValidCount = 0;
6159         Statistics* psStatisticsOut = (Statistics*)CPLMalloc(sizeof(Statistics));
6160         int nSuccess = GDALMDArrayComputeStatistics(self, ds, approx_ok,
6161                                  &(psStatisticsOut->min),
6162                                  &(psStatisticsOut->max),
6163                                  &(psStatisticsOut->mean),
6164                                  &(psStatisticsOut->std_dev),
6165                                  &nValidCount,
6166                                  callback, callback_data);
6167         psStatisticsOut->valid_count = static_cast<GIntBig>(nValidCount);
6168         if( nSuccess )
6169             return psStatisticsOut;
6170         CPLFree(psStatisticsOut);
6171         return NULL;
6172   }
delete_GDALAttributeHS(GDALAttributeHS * self)6173 SWIGINTERN void delete_GDALAttributeHS(GDALAttributeHS *self){
6174     GDALAttributeRelease(self);
6175   }
GDALAttributeHS_GetName(GDALAttributeHS * self)6176 SWIGINTERN char const *GDALAttributeHS_GetName(GDALAttributeHS *self){
6177     return GDALAttributeGetName(self);
6178   }
GDALAttributeHS_GetFullName(GDALAttributeHS * self)6179 SWIGINTERN char const *GDALAttributeHS_GetFullName(GDALAttributeHS *self){
6180     return GDALAttributeGetFullName(self);
6181   }
GDALAttributeHS_GetTotalElementsCount(GDALAttributeHS * self)6182 SWIGINTERN unsigned long long GDALAttributeHS_GetTotalElementsCount(GDALAttributeHS *self){
6183     return GDALAttributeGetTotalElementsCount(self);
6184   }
GDALAttributeHS_GetDimensionCount(GDALAttributeHS * self)6185 SWIGINTERN size_t GDALAttributeHS_GetDimensionCount(GDALAttributeHS *self){
6186     return GDALAttributeGetDimensionCount(self);
6187   }
GDALAttributeHS_GetDimensionsSize(GDALAttributeHS * self,GUIntBig ** pdims,size_t * pnCount)6188 SWIGINTERN void GDALAttributeHS_GetDimensionsSize(GDALAttributeHS *self,GUIntBig **pdims,size_t *pnCount){
6189     *pdims = GDALAttributeGetDimensionsSize(self, pnCount);
6190   }
GDALAttributeHS_GetDataType(GDALAttributeHS * self)6191 SWIGINTERN GDALExtendedDataTypeHS *GDALAttributeHS_GetDataType(GDALAttributeHS *self){
6192     return GDALAttributeGetDataType(self);
6193   }
GDALAttributeHS_ReadAsRaw(GDALAttributeHS * self,void ** buf)6194 SWIGINTERN CPLErr GDALAttributeHS_ReadAsRaw(GDALAttributeHS *self,void **buf){
6195     *buf = NULL;
6196     GDALExtendedDataTypeHS* dt = GDALAttributeGetDataType(self);
6197     bool bIsNumeric = CheckNumericDataType(dt);
6198     GDALExtendedDataTypeRelease(dt);
6199     if( !bIsNumeric )
6200     {
6201         CPLError(CE_Failure, CPLE_NotSupported,
6202             "non-numeric buffer data type not supported in SWIG bindings");
6203         return CE_Failure;
6204     }
6205     size_t buf_size = 0;
6206     GByte* pabyBuf = GDALAttributeReadAsRaw(self, &buf_size);
6207     if( pabyBuf == NULL )
6208     {
6209       return CE_Failure;
6210     }
6211 
6212     SWIG_PYTHON_THREAD_BEGIN_BLOCK;
6213     *buf = (void *)PyBytes_FromStringAndSize( NULL, buf_size );
6214     if (*buf == NULL)
6215     {
6216         *buf = Py_None;
6217         if( !bUseExceptions )
6218         {
6219             PyErr_Clear();
6220         }
6221         SWIG_PYTHON_THREAD_END_BLOCK;
6222         CPLError(CE_Failure, CPLE_OutOfMemory, "Cannot allocate result buffer");
6223         GDALAttributeFreeRawResult(self, pabyBuf, buf_size);
6224         return CE_Failure;
6225     }
6226     char *data = PyBytes_AsString( (PyObject *)*buf );
6227     SWIG_PYTHON_THREAD_END_BLOCK;
6228 
6229     memcpy(data, pabyBuf, buf_size);
6230     GDALAttributeFreeRawResult(self, pabyBuf, buf_size);
6231 
6232     return CE_None;
6233   }
GDALAttributeHS_ReadAsString(GDALAttributeHS * self)6234 SWIGINTERN char const *GDALAttributeHS_ReadAsString(GDALAttributeHS *self){
6235     return GDALAttributeReadAsString(self);
6236   }
GDALAttributeHS_ReadAsInt(GDALAttributeHS * self)6237 SWIGINTERN int GDALAttributeHS_ReadAsInt(GDALAttributeHS *self){
6238     return GDALAttributeReadAsInt(self);
6239   }
GDALAttributeHS_ReadAsDouble(GDALAttributeHS * self)6240 SWIGINTERN double GDALAttributeHS_ReadAsDouble(GDALAttributeHS *self){
6241     return GDALAttributeReadAsDouble(self);
6242   }
GDALAttributeHS_ReadAsStringArray(GDALAttributeHS * self)6243 SWIGINTERN char **GDALAttributeHS_ReadAsStringArray(GDALAttributeHS *self){
6244     return GDALAttributeReadAsStringArray(self);
6245   }
GDALAttributeHS_ReadAsIntArray(GDALAttributeHS * self,int ** pvals,size_t * pnCount)6246 SWIGINTERN void GDALAttributeHS_ReadAsIntArray(GDALAttributeHS *self,int **pvals,size_t *pnCount){
6247     *pvals = GDALAttributeReadAsIntArray(self, pnCount);
6248   }
GDALAttributeHS_ReadAsDoubleArray(GDALAttributeHS * self,double ** pvals,size_t * pnCount)6249 SWIGINTERN void GDALAttributeHS_ReadAsDoubleArray(GDALAttributeHS *self,double **pvals,size_t *pnCount){
6250     *pvals = GDALAttributeReadAsDoubleArray(self, pnCount);
6251   }
GDALAttributeHS_WriteRaw(GDALAttributeHS * self,GIntBig nLen,char * pBuf)6252 SWIGINTERN CPLErr GDALAttributeHS_WriteRaw(GDALAttributeHS *self,GIntBig nLen,char *pBuf){
6253     GDALExtendedDataTypeHS* dt = GDALAttributeGetDataType(self);
6254     bool bIsNumeric = CheckNumericDataType(dt);
6255     GDALExtendedDataTypeRelease(dt);
6256     if( !bIsNumeric )
6257     {
6258         CPLError(CE_Failure, CPLE_NotSupported,
6259             "non-numeric buffer data type not supported in SWIG bindings");
6260         return CE_Failure;
6261     }
6262     return GDALAttributeWriteRaw(self, pBuf, nLen) ? CE_None : CE_Failure;
6263   }
GDALAttributeHS_WriteString(GDALAttributeHS * self,char const * val)6264 SWIGINTERN CPLErr GDALAttributeHS_WriteString(GDALAttributeHS *self,char const *val){
6265     return GDALAttributeWriteString(self, val) ? CE_None : CE_Failure;
6266   }
GDALAttributeHS_WriteStringArray(GDALAttributeHS * self,char ** vals)6267 SWIGINTERN CPLErr GDALAttributeHS_WriteStringArray(GDALAttributeHS *self,char **vals){
6268     return GDALAttributeWriteStringArray(self, vals) ? CE_None : CE_Failure;
6269   }
GDALAttributeHS_WriteInt(GDALAttributeHS * self,int val)6270 SWIGINTERN CPLErr GDALAttributeHS_WriteInt(GDALAttributeHS *self,int val){
6271     return GDALAttributeWriteInt(self, val) ? CE_None : CE_Failure;
6272   }
GDALAttributeHS_WriteDouble(GDALAttributeHS * self,double val)6273 SWIGINTERN CPLErr GDALAttributeHS_WriteDouble(GDALAttributeHS *self,double val){
6274     return GDALAttributeWriteDouble(self, val) ? CE_None : CE_Failure;
6275   }
GDALAttributeHS_WriteDoubleArray(GDALAttributeHS * self,int nList,double * pList)6276 SWIGINTERN CPLErr GDALAttributeHS_WriteDoubleArray(GDALAttributeHS *self,int nList,double *pList){
6277     return GDALAttributeWriteDoubleArray(self, pList, nList) ? CE_None : CE_Failure;
6278   }
delete_GDALDimensionHS(GDALDimensionHS * self)6279 SWIGINTERN void delete_GDALDimensionHS(GDALDimensionHS *self){
6280     GDALDimensionRelease(self);
6281   }
GDALDimensionHS_GetName(GDALDimensionHS * self)6282 SWIGINTERN char const *GDALDimensionHS_GetName(GDALDimensionHS *self){
6283     return GDALDimensionGetName(self);
6284   }
GDALDimensionHS_GetFullName(GDALDimensionHS * self)6285 SWIGINTERN char const *GDALDimensionHS_GetFullName(GDALDimensionHS *self){
6286     return GDALDimensionGetFullName(self);
6287   }
GDALDimensionHS_GetType(GDALDimensionHS * self)6288 SWIGINTERN char const *GDALDimensionHS_GetType(GDALDimensionHS *self){
6289     return GDALDimensionGetType(self);
6290   }
GDALDimensionHS_GetDirection(GDALDimensionHS * self)6291 SWIGINTERN char const *GDALDimensionHS_GetDirection(GDALDimensionHS *self){
6292     return GDALDimensionGetDirection(self);
6293   }
GDALDimensionHS_GetSize(GDALDimensionHS * self)6294 SWIGINTERN unsigned long long GDALDimensionHS_GetSize(GDALDimensionHS *self){
6295     return GDALDimensionGetSize(self);
6296   }
GDALDimensionHS_GetIndexingVariable(GDALDimensionHS * self)6297 SWIGINTERN GDALMDArrayHS *GDALDimensionHS_GetIndexingVariable(GDALDimensionHS *self){
6298     return GDALDimensionGetIndexingVariable(self);
6299   }
GDALDimensionHS_SetIndexingVariable(GDALDimensionHS * self,GDALMDArrayHS * array)6300 SWIGINTERN bool GDALDimensionHS_SetIndexingVariable(GDALDimensionHS *self,GDALMDArrayHS *array){
6301     return GDALDimensionSetIndexingVariable(self, array);
6302   }
delete_GDALExtendedDataTypeHS(GDALExtendedDataTypeHS * self)6303 SWIGINTERN void delete_GDALExtendedDataTypeHS(GDALExtendedDataTypeHS *self){
6304     GDALExtendedDataTypeRelease(self);
6305   }
GDALExtendedDataTypeHS_Create(GDALDataType dt)6306 SWIGINTERN GDALExtendedDataTypeHS *GDALExtendedDataTypeHS_Create(GDALDataType dt){
6307     return GDALExtendedDataTypeCreate(dt);
6308   }
GDALExtendedDataTypeHS_CreateString(size_t nMaxStringLength=0)6309 SWIGINTERN GDALExtendedDataTypeHS *GDALExtendedDataTypeHS_CreateString(size_t nMaxStringLength=0){
6310     return GDALExtendedDataTypeCreateString(nMaxStringLength);
6311   }
GDALExtendedDataTypeHS_CreateCompound(char const * name,size_t nTotalSize,int nComps,GDALEDTComponentHS ** comps)6312 SWIGINTERN GDALExtendedDataTypeHS *GDALExtendedDataTypeHS_CreateCompound(char const *name,size_t nTotalSize,int nComps,GDALEDTComponentHS **comps){
6313     return GDALExtendedDataTypeCreateCompound(name, nTotalSize, nComps, comps);
6314   }
GDALExtendedDataTypeHS_GetName(GDALExtendedDataTypeHS * self)6315 SWIGINTERN char const *GDALExtendedDataTypeHS_GetName(GDALExtendedDataTypeHS *self){
6316     return GDALExtendedDataTypeGetName(self);
6317   }
GDALExtendedDataTypeHS_GetClass(GDALExtendedDataTypeHS * self)6318 SWIGINTERN GDALExtendedDataTypeClass GDALExtendedDataTypeHS_GetClass(GDALExtendedDataTypeHS *self){
6319     return GDALExtendedDataTypeGetClass(self);
6320   }
GDALExtendedDataTypeHS_GetNumericDataType(GDALExtendedDataTypeHS * self)6321 SWIGINTERN GDALDataType GDALExtendedDataTypeHS_GetNumericDataType(GDALExtendedDataTypeHS *self){
6322     return GDALExtendedDataTypeGetNumericDataType(self);
6323   }
GDALExtendedDataTypeHS_GetSize(GDALExtendedDataTypeHS * self)6324 SWIGINTERN size_t GDALExtendedDataTypeHS_GetSize(GDALExtendedDataTypeHS *self){
6325     return GDALExtendedDataTypeGetSize(self);
6326   }
GDALExtendedDataTypeHS_GetMaxStringLength(GDALExtendedDataTypeHS * self)6327 SWIGINTERN size_t GDALExtendedDataTypeHS_GetMaxStringLength(GDALExtendedDataTypeHS *self){
6328     return GDALExtendedDataTypeGetMaxStringLength(self);
6329   }
GDALExtendedDataTypeHS_GetComponents(GDALExtendedDataTypeHS * self,GDALEDTComponentHS *** pcomps,size_t * pnCount)6330 SWIGINTERN void GDALExtendedDataTypeHS_GetComponents(GDALExtendedDataTypeHS *self,GDALEDTComponentHS ***pcomps,size_t *pnCount){
6331     *pcomps = GDALExtendedDataTypeGetComponents(self, pnCount);
6332   }
GDALExtendedDataTypeHS_CanConvertTo(GDALExtendedDataTypeHS * self,GDALExtendedDataTypeHS * other)6333 SWIGINTERN bool GDALExtendedDataTypeHS_CanConvertTo(GDALExtendedDataTypeHS *self,GDALExtendedDataTypeHS *other){
6334     return GDALExtendedDataTypeCanConvertTo(self, other);
6335   }
GDALExtendedDataTypeHS_Equals(GDALExtendedDataTypeHS * self,GDALExtendedDataTypeHS * other)6336 SWIGINTERN bool GDALExtendedDataTypeHS_Equals(GDALExtendedDataTypeHS *self,GDALExtendedDataTypeHS *other){
6337     return GDALExtendedDataTypeEquals(self, other);
6338   }
delete_GDALEDTComponentHS(GDALEDTComponentHS * self)6339 SWIGINTERN void delete_GDALEDTComponentHS(GDALEDTComponentHS *self){
6340     GDALEDTComponentRelease(self);
6341   }
GDALEDTComponentHS_Create(char const * name,size_t offset,GDALExtendedDataTypeHS * type)6342 SWIGINTERN GDALEDTComponentHS *GDALEDTComponentHS_Create(char const *name,size_t offset,GDALExtendedDataTypeHS *type){
6343     return GDALEDTComponentCreate(name, offset, type);
6344   }
GDALEDTComponentHS_GetName(GDALEDTComponentHS * self)6345 SWIGINTERN char const *GDALEDTComponentHS_GetName(GDALEDTComponentHS *self){
6346     return GDALEDTComponentGetName(self);
6347   }
GDALEDTComponentHS_GetOffset(GDALEDTComponentHS * self)6348 SWIGINTERN size_t GDALEDTComponentHS_GetOffset(GDALEDTComponentHS *self){
6349     return GDALEDTComponentGetOffset(self);
6350   }
GDALEDTComponentHS_GetType(GDALEDTComponentHS * self)6351 SWIGINTERN GDALExtendedDataTypeHS *GDALEDTComponentHS_GetType(GDALEDTComponentHS *self){
6352     return GDALEDTComponentGetType(self);
6353   }
6354 
6355 /* Returned size is in bytes or 0 if an error occurred. */
6356 static
ComputeBandRasterIOSize(int buf_xsize,int buf_ysize,int nPixelSize,GIntBig nPixelSpace,GIntBig nLineSpace,int bSpacingShouldBeMultipleOfPixelSize)6357 GIntBig ComputeBandRasterIOSize (int buf_xsize, int buf_ysize, int nPixelSize,
6358                                  GIntBig nPixelSpace, GIntBig nLineSpace,
6359                                  int bSpacingShouldBeMultipleOfPixelSize )
6360 {
6361     if (buf_xsize <= 0 || buf_ysize <= 0)
6362     {
6363         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for buffer size");
6364         return 0;
6365     }
6366 
6367     if (nPixelSpace < 0 || nLineSpace < 0)
6368     {
6369         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal values for space arguments");
6370         return 0;
6371     }
6372 
6373     if (nPixelSize == 0)
6374     {
6375         CPLError(CE_Failure, CPLE_IllegalArg, "Illegal value for data type");
6376         return 0;
6377     }
6378 
6379     if( nPixelSpace == 0 )
6380         nPixelSpace = nPixelSize;
6381     else if ( bSpacingShouldBeMultipleOfPixelSize && (nPixelSpace % nPixelSize) != 0 )
6382     {
6383         CPLError(CE_Failure, CPLE_IllegalArg, "nPixelSpace should be a multiple of nPixelSize");
6384         return 0;
6385     }
6386 
6387     if( nLineSpace == 0 )
6388     {
6389         nLineSpace = nPixelSpace * buf_xsize;
6390     }
6391     else if ( bSpacingShouldBeMultipleOfPixelSize && (nLineSpace % nPixelSize) != 0 )
6392     {
6393         CPLError(CE_Failure, CPLE_IllegalArg, "nLineSpace should be a multiple of nPixelSize");
6394         return 0;
6395     }
6396 
6397     GIntBig nRet = (GIntBig)(buf_ysize - 1) * nLineSpace + (GIntBig)(buf_xsize - 1) * nPixelSpace + nPixelSize;
6398 #if SIZEOF_VOIDP == 4
6399     if (nRet > INT_MAX)
6400     {
6401         CPLError(CE_Failure, CPLE_IllegalArg, "Integer overflow");
6402         return 0;
6403     }
6404 #endif
6405 
6406     return nRet;
6407 }
6408 
6409 
6410 static
WriteRaster_internal(GDALRasterBandShadow * obj,int xoff,int yoff,int xsize,int ysize,int buf_xsize,int buf_ysize,GDALDataType buf_type,GIntBig buf_size,char * buffer,GIntBig pixel_space,GIntBig line_space,GDALRasterIOExtraArg * psExtraArg)6411 CPLErr WriteRaster_internal( GDALRasterBandShadow *obj,
6412                              int xoff, int yoff, int xsize, int ysize,
6413                              int buf_xsize, int buf_ysize,
6414                              GDALDataType buf_type,
6415                              GIntBig buf_size, char *buffer,
6416                              GIntBig pixel_space, GIntBig line_space,
6417                              GDALRasterIOExtraArg* psExtraArg )
6418 {
6419     GIntBig min_buffer_size = ComputeBandRasterIOSize (buf_xsize, buf_ysize, GDALGetDataTypeSize( buf_type ) / 8,
6420                                                    pixel_space, line_space, FALSE );
6421     if ( min_buffer_size == 0 )
6422       return CE_Failure;
6423 
6424     if ( buf_size < min_buffer_size ) {
6425       CPLError(CE_Failure, CPLE_AppDefined, "Buffer too small");
6426       return CE_Failure;
6427     }
6428 
6429     return GDALRasterIOEx( obj, GF_Write, xoff, yoff, xsize, ysize,
6430                            (void *) buffer, buf_xsize, buf_ysize, buf_type, pixel_space, line_space, psExtraArg );
6431 }
6432 
GDALRasterBandShadow_GetDataset(GDALRasterBandShadow * self)6433 SWIGINTERN GDALDatasetShadow *GDALRasterBandShadow_GetDataset(GDALRasterBandShadow *self){
6434     return (GDALDatasetShadow*) GDALGetBandDataset(self);
6435   }
GDALRasterBandShadow_GetBand(GDALRasterBandShadow * self)6436 SWIGINTERN int GDALRasterBandShadow_GetBand(GDALRasterBandShadow *self){
6437     return GDALGetBandNumber(self);
6438   }
GDALRasterBandShadow_GetBlockSize(GDALRasterBandShadow * self,int * pnBlockXSize,int * pnBlockYSize)6439 SWIGINTERN void GDALRasterBandShadow_GetBlockSize(GDALRasterBandShadow *self,int *pnBlockXSize,int *pnBlockYSize){
6440       GDALGetBlockSize(self, pnBlockXSize, pnBlockYSize);
6441   }
GDALRasterBandShadow_GetActualBlockSize(GDALRasterBandShadow * self,int nXBlockOff,int nYBlockOff,int * pnxvalid,int * pnyvalid,int * pisvalid)6442 SWIGINTERN void GDALRasterBandShadow_GetActualBlockSize(GDALRasterBandShadow *self,int nXBlockOff,int nYBlockOff,int *pnxvalid,int *pnyvalid,int *pisvalid){
6443     *pisvalid = (GDALGetActualBlockSize(self, nXBlockOff, nYBlockOff, pnxvalid, pnyvalid) == CE_None);
6444   }
GDALRasterBandShadow_GetColorInterpretation(GDALRasterBandShadow * self)6445 SWIGINTERN GDALColorInterp GDALRasterBandShadow_GetColorInterpretation(GDALRasterBandShadow *self){
6446     return GDALGetRasterColorInterpretation(self);
6447   }
GDALRasterBandShadow_GetRasterColorInterpretation(GDALRasterBandShadow * self)6448 SWIGINTERN GDALColorInterp GDALRasterBandShadow_GetRasterColorInterpretation(GDALRasterBandShadow *self){
6449     return GDALGetRasterColorInterpretation(self);
6450   }
GDALRasterBandShadow_SetColorInterpretation(GDALRasterBandShadow * self,GDALColorInterp val)6451 SWIGINTERN CPLErr GDALRasterBandShadow_SetColorInterpretation(GDALRasterBandShadow *self,GDALColorInterp val){
6452     return GDALSetRasterColorInterpretation( self, val );
6453   }
GDALRasterBandShadow_SetRasterColorInterpretation(GDALRasterBandShadow * self,GDALColorInterp val)6454 SWIGINTERN CPLErr GDALRasterBandShadow_SetRasterColorInterpretation(GDALRasterBandShadow *self,GDALColorInterp val){
6455     return GDALSetRasterColorInterpretation( self, val );
6456   }
GDALRasterBandShadow_GetNoDataValue(GDALRasterBandShadow * self,double * val,int * hasval)6457 SWIGINTERN void GDALRasterBandShadow_GetNoDataValue(GDALRasterBandShadow *self,double *val,int *hasval){
6458     *val = GDALGetRasterNoDataValue( self, hasval );
6459   }
GDALRasterBandShadow_SetNoDataValue(GDALRasterBandShadow * self,double d)6460 SWIGINTERN CPLErr GDALRasterBandShadow_SetNoDataValue(GDALRasterBandShadow *self,double d){
6461     return GDALSetRasterNoDataValue( self, d );
6462   }
GDALRasterBandShadow_DeleteNoDataValue(GDALRasterBandShadow * self)6463 SWIGINTERN CPLErr GDALRasterBandShadow_DeleteNoDataValue(GDALRasterBandShadow *self){
6464     return GDALDeleteRasterNoDataValue(self);
6465   }
GDALRasterBandShadow_GetUnitType(GDALRasterBandShadow * self)6466 SWIGINTERN char const *GDALRasterBandShadow_GetUnitType(GDALRasterBandShadow *self){
6467       return GDALGetRasterUnitType(self);
6468   }
GDALRasterBandShadow_SetUnitType(GDALRasterBandShadow * self,char const * val)6469 SWIGINTERN CPLErr GDALRasterBandShadow_SetUnitType(GDALRasterBandShadow *self,char const *val){
6470     return GDALSetRasterUnitType( self, val );
6471   }
GDALRasterBandShadow_GetRasterCategoryNames(GDALRasterBandShadow * self)6472 SWIGINTERN char **GDALRasterBandShadow_GetRasterCategoryNames(GDALRasterBandShadow *self){
6473     return GDALGetRasterCategoryNames(self);
6474   }
GDALRasterBandShadow_SetRasterCategoryNames(GDALRasterBandShadow * self,char ** names)6475 SWIGINTERN CPLErr GDALRasterBandShadow_SetRasterCategoryNames(GDALRasterBandShadow *self,char **names){
6476     return GDALSetRasterCategoryNames( self, names );
6477   }
GDALRasterBandShadow_GetMinimum(GDALRasterBandShadow * self,double * val,int * hasval)6478 SWIGINTERN void GDALRasterBandShadow_GetMinimum(GDALRasterBandShadow *self,double *val,int *hasval){
6479     *val = GDALGetRasterMinimum( self, hasval );
6480   }
GDALRasterBandShadow_GetMaximum(GDALRasterBandShadow * self,double * val,int * hasval)6481 SWIGINTERN void GDALRasterBandShadow_GetMaximum(GDALRasterBandShadow *self,double *val,int *hasval){
6482     *val = GDALGetRasterMaximum( self, hasval );
6483   }
GDALRasterBandShadow_GetOffset(GDALRasterBandShadow * self,double * val,int * hasval)6484 SWIGINTERN void GDALRasterBandShadow_GetOffset(GDALRasterBandShadow *self,double *val,int *hasval){
6485     *val = GDALGetRasterOffset( self, hasval );
6486   }
GDALRasterBandShadow_GetScale(GDALRasterBandShadow * self,double * val,int * hasval)6487 SWIGINTERN void GDALRasterBandShadow_GetScale(GDALRasterBandShadow *self,double *val,int *hasval){
6488     *val = GDALGetRasterScale( self, hasval );
6489   }
GDALRasterBandShadow_SetOffset(GDALRasterBandShadow * self,double val)6490 SWIGINTERN CPLErr GDALRasterBandShadow_SetOffset(GDALRasterBandShadow *self,double val){
6491     return GDALSetRasterOffset( self, val );
6492   }
GDALRasterBandShadow_SetScale(GDALRasterBandShadow * self,double val)6493 SWIGINTERN CPLErr GDALRasterBandShadow_SetScale(GDALRasterBandShadow *self,double val){
6494     return GDALSetRasterScale( self, val );
6495   }
GDALRasterBandShadow_GetStatistics(GDALRasterBandShadow * self,int approx_ok,int force,double * min,double * max,double * mean,double * stddev)6496 SWIGINTERN CPLErr GDALRasterBandShadow_GetStatistics(GDALRasterBandShadow *self,int approx_ok,int force,double *min,double *max,double *mean,double *stddev){
6497     if (min) *min = 0;
6498     if (max) *max = 0;
6499     if (mean) *mean = 0;
6500     if (stddev) *stddev = -1; /* This is the only way to recognize from Python if GetRasterStatistics() has updated the values */
6501     return GDALGetRasterStatistics( self, approx_ok, force,
6502 				    min, max, mean, stddev );
6503   }
GDALRasterBandShadow_ComputeStatistics(GDALRasterBandShadow * self,bool approx_ok,double * min=NULL,double * max=NULL,double * mean=NULL,double * stddev=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)6504 SWIGINTERN CPLErr GDALRasterBandShadow_ComputeStatistics(GDALRasterBandShadow *self,bool approx_ok,double *min=NULL,double *max=NULL,double *mean=NULL,double *stddev=NULL,GDALProgressFunc callback=NULL,void *callback_data=NULL){
6505     return GDALComputeRasterStatistics( self, approx_ok, min, max, mean, stddev, callback, callback_data );
6506   }
GDALRasterBandShadow_SetStatistics(GDALRasterBandShadow * self,double min,double max,double mean,double stddev)6507 SWIGINTERN CPLErr GDALRasterBandShadow_SetStatistics(GDALRasterBandShadow *self,double min,double max,double mean,double stddev){
6508     return GDALSetRasterStatistics( self, min, max, mean, stddev );
6509   }
GDALRasterBandShadow_GetOverviewCount(GDALRasterBandShadow * self)6510 SWIGINTERN int GDALRasterBandShadow_GetOverviewCount(GDALRasterBandShadow *self){
6511     return GDALGetOverviewCount(self);
6512   }
GDALRasterBandShadow_GetOverview(GDALRasterBandShadow * self,int i)6513 SWIGINTERN GDALRasterBandShadow *GDALRasterBandShadow_GetOverview(GDALRasterBandShadow *self,int i){
6514     return (GDALRasterBandShadow*) GDALGetOverview( self, i );
6515   }
GDALRasterBandShadow_Checksum(GDALRasterBandShadow * self,int xoff=0,int yoff=0,int * xsize=0,int * ysize=0)6516 SWIGINTERN int GDALRasterBandShadow_Checksum(GDALRasterBandShadow *self,int xoff=0,int yoff=0,int *xsize=0,int *ysize=0){
6517     int nxsize = (xsize!=0) ? *xsize : GDALGetRasterBandXSize( self );
6518     int nysize = (ysize!=0) ? *ysize : GDALGetRasterBandYSize( self );
6519     return GDALChecksumImage( self, xoff, yoff, nxsize, nysize );
6520   }
GDALRasterBandShadow_ComputeRasterMinMax(GDALRasterBandShadow * self,double argout[2],int approx_ok=0)6521 SWIGINTERN void GDALRasterBandShadow_ComputeRasterMinMax(GDALRasterBandShadow *self,double argout[2],int approx_ok=0){
6522     GDALComputeRasterMinMax( self, approx_ok, argout );
6523   }
GDALRasterBandShadow_ComputeBandStats(GDALRasterBandShadow * self,double argout[2],int samplestep=1)6524 SWIGINTERN void GDALRasterBandShadow_ComputeBandStats(GDALRasterBandShadow *self,double argout[2],int samplestep=1){
6525     GDALComputeBandStats( self, samplestep, argout+0, argout+1,
6526                           NULL, NULL );
6527   }
GDALRasterBandShadow_Fill(GDALRasterBandShadow * self,double real_fill,double imag_fill=0.0)6528 SWIGINTERN CPLErr GDALRasterBandShadow_Fill(GDALRasterBandShadow *self,double real_fill,double imag_fill=0.0){
6529     return GDALFillRaster( self, real_fill, imag_fill );
6530   }
GDALRasterBandShadow_WriteRaster(GDALRasterBandShadow * self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char * buf_string,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0)6531 SWIGINTERN CPLErr GDALRasterBandShadow_WriteRaster(GDALRasterBandShadow *self,int xoff,int yoff,int xsize,int ysize,GIntBig buf_len,char *buf_string,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0){
6532     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
6533     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
6534     GDALDataType ntype  = (buf_type==0) ? GDALGetRasterDataType(self)
6535                                         : *buf_type;
6536     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
6537     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
6538     GDALRasterIOExtraArg* psExtraArg = NULL;
6539     return WriteRaster_internal( self, xoff, yoff, xsize, ysize,
6540                                  nxsize, nysize, ntype, buf_len, buf_string, pixel_space, line_space, psExtraArg );
6541   }
GDALRasterBandShadow_FlushCache(GDALRasterBandShadow * self)6542 SWIGINTERN void GDALRasterBandShadow_FlushCache(GDALRasterBandShadow *self){
6543     GDALFlushRasterCache( self );
6544   }
GDALRasterBandShadow_GetRasterColorTable(GDALRasterBandShadow * self)6545 SWIGINTERN GDALColorTableShadow *GDALRasterBandShadow_GetRasterColorTable(GDALRasterBandShadow *self){
6546     return (GDALColorTableShadow*) GDALGetRasterColorTable( self );
6547   }
GDALRasterBandShadow_GetColorTable(GDALRasterBandShadow * self)6548 SWIGINTERN GDALColorTableShadow *GDALRasterBandShadow_GetColorTable(GDALRasterBandShadow *self){
6549     return (GDALColorTableShadow*) GDALGetRasterColorTable( self );
6550   }
GDALRasterBandShadow_SetRasterColorTable(GDALRasterBandShadow * self,GDALColorTableShadow * arg)6551 SWIGINTERN int GDALRasterBandShadow_SetRasterColorTable(GDALRasterBandShadow *self,GDALColorTableShadow *arg){
6552     return GDALSetRasterColorTable( self, arg );
6553   }
GDALRasterBandShadow_SetColorTable(GDALRasterBandShadow * self,GDALColorTableShadow * arg)6554 SWIGINTERN int GDALRasterBandShadow_SetColorTable(GDALRasterBandShadow *self,GDALColorTableShadow *arg){
6555     return GDALSetRasterColorTable( self, arg );
6556   }
GDALRasterBandShadow_GetDefaultRAT(GDALRasterBandShadow * self)6557 SWIGINTERN GDALRasterAttributeTableShadow *GDALRasterBandShadow_GetDefaultRAT(GDALRasterBandShadow *self){
6558       return (GDALRasterAttributeTableShadow*) GDALGetDefaultRAT(self);
6559   }
GDALRasterBandShadow_SetDefaultRAT(GDALRasterBandShadow * self,GDALRasterAttributeTableShadow * table)6560 SWIGINTERN int GDALRasterBandShadow_SetDefaultRAT(GDALRasterBandShadow *self,GDALRasterAttributeTableShadow *table){
6561       return GDALSetDefaultRAT(self, table);
6562   }
GDALRasterBandShadow_GetMaskBand(GDALRasterBandShadow * self)6563 SWIGINTERN GDALRasterBandShadow *GDALRasterBandShadow_GetMaskBand(GDALRasterBandShadow *self){
6564       return (GDALRasterBandShadow *) GDALGetMaskBand( self );
6565   }
GDALRasterBandShadow_GetMaskFlags(GDALRasterBandShadow * self)6566 SWIGINTERN int GDALRasterBandShadow_GetMaskFlags(GDALRasterBandShadow *self){
6567       return GDALGetMaskFlags( self );
6568   }
GDALRasterBandShadow_CreateMaskBand(GDALRasterBandShadow * self,int nFlags)6569 SWIGINTERN CPLErr GDALRasterBandShadow_CreateMaskBand(GDALRasterBandShadow *self,int nFlags){
6570       return GDALCreateMaskBand( self, nFlags );
6571   }
GDALRasterBandShadow_GetHistogram(GDALRasterBandShadow * self,double min=-0.5,double max=255.5,int buckets=256,GUIntBig * panHistogram=NULL,int include_out_of_range=0,int approx_ok=1,GDALProgressFunc callback=NULL,void * callback_data=NULL)6572 SWIGINTERN CPLErr GDALRasterBandShadow_GetHistogram(GDALRasterBandShadow *self,double min=-0.5,double max=255.5,int buckets=256,GUIntBig *panHistogram=NULL,int include_out_of_range=0,int approx_ok=1,GDALProgressFunc callback=NULL,void *callback_data=NULL){
6573     CPLErrorReset();
6574     CPLErr err = GDALGetRasterHistogramEx( self, min, max, buckets, panHistogram,
6575                                          include_out_of_range, approx_ok,
6576                                          callback, callback_data );
6577     return err;
6578   }
GDALRasterBandShadow_GetDefaultHistogram(GDALRasterBandShadow * self,double * min_ret=NULL,double * max_ret=NULL,int * buckets_ret=NULL,GUIntBig ** ppanHistogram=NULL,int force=1,GDALProgressFunc callback=NULL,void * callback_data=NULL)6579 SWIGINTERN CPLErr GDALRasterBandShadow_GetDefaultHistogram(GDALRasterBandShadow *self,double *min_ret=NULL,double *max_ret=NULL,int *buckets_ret=NULL,GUIntBig **ppanHistogram=NULL,int force=1,GDALProgressFunc callback=NULL,void *callback_data=NULL){
6580     return GDALGetDefaultHistogramEx( self, min_ret, max_ret, buckets_ret,
6581                                     ppanHistogram, force,
6582                                     callback, callback_data );
6583 }
GDALRasterBandShadow_SetDefaultHistogram(GDALRasterBandShadow * self,double min,double max,int buckets_in,GUIntBig * panHistogram_in)6584 SWIGINTERN CPLErr GDALRasterBandShadow_SetDefaultHistogram(GDALRasterBandShadow *self,double min,double max,int buckets_in,GUIntBig *panHistogram_in){
6585     return GDALSetDefaultHistogramEx( self, min, max,
6586                                     buckets_in, panHistogram_in );
6587 }
GDALRasterBandShadow_HasArbitraryOverviews(GDALRasterBandShadow * self)6588 SWIGINTERN bool GDALRasterBandShadow_HasArbitraryOverviews(GDALRasterBandShadow *self){
6589       return (GDALHasArbitraryOverviews( self ) != 0) ? true : false;
6590   }
GDALRasterBandShadow_GetCategoryNames(GDALRasterBandShadow * self)6591 SWIGINTERN char **GDALRasterBandShadow_GetCategoryNames(GDALRasterBandShadow *self){
6592     return GDALGetRasterCategoryNames( self );
6593   }
GDALRasterBandShadow_SetCategoryNames(GDALRasterBandShadow * self,char ** papszCategoryNames)6594 SWIGINTERN CPLErr GDALRasterBandShadow_SetCategoryNames(GDALRasterBandShadow *self,char **papszCategoryNames){
6595     return GDALSetRasterCategoryNames( self, papszCategoryNames );
6596   }
GDALRasterBandShadow_GetVirtualMem(GDALRasterBandShadow * self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nBufXSize,int nBufYSize,GDALDataType eBufType,size_t nCacheSize,size_t nPageSizeHint,char ** options=NULL)6597 SWIGINTERN CPLVirtualMemShadow *GDALRasterBandShadow_GetVirtualMem(GDALRasterBandShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nBufXSize,int nBufYSize,GDALDataType eBufType,size_t nCacheSize,size_t nPageSizeHint,char **options=NULL){
6598         CPLVirtualMem* vmem = GDALRasterBandGetVirtualMem( self,
6599                                          eRWFlag,
6600                                          nXOff, nYOff,
6601                                          nXSize, nYSize,
6602                                          nBufXSize, nBufYSize,
6603                                          eBufType,
6604                                          0,
6605                                          0,
6606                                          nCacheSize,
6607                                          nPageSizeHint,
6608                                          FALSE,
6609                                          options );
6610         if( vmem == NULL )
6611             return NULL;
6612         CPLVirtualMemShadow* vmemshadow = (CPLVirtualMemShadow*)calloc(1, sizeof(CPLVirtualMemShadow));
6613         vmemshadow->vmem = vmem;
6614         vmemshadow->eBufType = eBufType;
6615         vmemshadow->bIsBandSequential = TRUE;
6616         vmemshadow->bReadOnly = (eRWFlag == GF_Read);
6617         vmemshadow->nBufXSize = nBufXSize;
6618         vmemshadow->nBufYSize = nBufYSize;
6619         vmemshadow->nBandCount = 1;
6620         return vmemshadow;
6621     }
GDALRasterBandShadow_GetVirtualMemAuto(GDALRasterBandShadow * self,GDALRWFlag eRWFlag,char ** options=NULL)6622 SWIGINTERN CPLVirtualMemShadow *GDALRasterBandShadow_GetVirtualMemAuto(GDALRasterBandShadow *self,GDALRWFlag eRWFlag,char **options=NULL){
6623         int            nPixelSpace;
6624         GIntBig        nLineSpace;
6625         CPLVirtualMem* vmem = GDALGetVirtualMemAuto( self,
6626                                          eRWFlag,
6627                                          &nPixelSpace,
6628                                          &nLineSpace,
6629                                          options );
6630         if( vmem == NULL )
6631             return NULL;
6632         CPLVirtualMemShadow* vmemshadow = (CPLVirtualMemShadow*)calloc(1, sizeof(CPLVirtualMemShadow));
6633         vmemshadow->vmem = vmem;
6634         vmemshadow->eBufType = GDALGetRasterDataType( self );
6635         vmemshadow->bAuto = TRUE;
6636         vmemshadow->bReadOnly = (eRWFlag == GF_Read);
6637         vmemshadow->nBandCount = 1;
6638         vmemshadow->nPixelSpace = nPixelSpace;
6639         vmemshadow->nLineSpace = nLineSpace;
6640         vmemshadow->nBufXSize = GDALGetRasterBandXSize(self);
6641         vmemshadow->nBufYSize = GDALGetRasterBandYSize(self);
6642         return vmemshadow;
6643     }
GDALRasterBandShadow_GetTiledVirtualMem(GDALRasterBandShadow * self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nTileXSize,int nTileYSize,GDALDataType eBufType,size_t nCacheSize,char ** options=NULL)6644 SWIGINTERN CPLVirtualMemShadow *GDALRasterBandShadow_GetTiledVirtualMem(GDALRasterBandShadow *self,GDALRWFlag eRWFlag,int nXOff,int nYOff,int nXSize,int nYSize,int nTileXSize,int nTileYSize,GDALDataType eBufType,size_t nCacheSize,char **options=NULL){
6645         CPLVirtualMem* vmem = GDALRasterBandGetTiledVirtualMem( self,
6646                                          eRWFlag,
6647                                          nXOff, nYOff,
6648                                          nXSize, nYSize,
6649                                          nTileXSize, nTileYSize,
6650                                          eBufType,
6651                                          nCacheSize,
6652                                          FALSE,
6653                                          options );
6654         if( vmem == NULL )
6655             return NULL;
6656         CPLVirtualMemShadow* vmemshadow = (CPLVirtualMemShadow*)calloc(1, sizeof(CPLVirtualMemShadow));
6657         vmemshadow->vmem = vmem;
6658         vmemshadow->eBufType = eBufType;
6659         vmemshadow->bIsBandSequential = -1;
6660         vmemshadow->bReadOnly = (eRWFlag == GF_Read);
6661         vmemshadow->nBufXSize = nXSize;
6662         vmemshadow->nBufYSize = nYSize;
6663         vmemshadow->eTileOrganization = GTO_BSQ;
6664         vmemshadow->nTileXSize = nTileXSize;
6665         vmemshadow->nTileYSize = nTileYSize;
6666         vmemshadow->nBandCount = 1;
6667         return vmemshadow;
6668     }
GDALRasterBandShadow_GetDataCoverageStatus(GDALRasterBandShadow * self,int nXOff,int nYOff,int nXSize,int nYSize,int nMaskFlagStop=0,double * pdfDataPct=NULL)6669 SWIGINTERN int GDALRasterBandShadow_GetDataCoverageStatus(GDALRasterBandShadow *self,int nXOff,int nYOff,int nXSize,int nYSize,int nMaskFlagStop=0,double *pdfDataPct=NULL){
6670         return GDALGetDataCoverageStatus(self, nXOff, nYOff,
6671                                          nXSize, nYSize,
6672                                          nMaskFlagStop,
6673                                          pdfDataPct);
6674     }
GDALRasterBandShadow_AdviseRead(GDALRasterBandShadow * self,int xoff,int yoff,int xsize,int ysize,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,char ** options=NULL)6675 SWIGINTERN CPLErr GDALRasterBandShadow_AdviseRead(GDALRasterBandShadow *self,int xoff,int yoff,int xsize,int ysize,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,char **options=NULL){
6676     int nxsize = (buf_xsize==0) ? xsize : *buf_xsize;
6677     int nysize = (buf_ysize==0) ? ysize : *buf_ysize;
6678     GDALDataType ntype;
6679     if ( buf_type != 0 ) {
6680       ntype = (GDALDataType) *buf_type;
6681     } else {
6682       ntype = GDALGetRasterDataType( self );
6683     }
6684     return GDALRasterAdviseRead(self, xoff, yoff, xsize, ysize,
6685                                 nxsize, nysize, ntype, options);
6686 }
GDALRasterBandShadow_AsMDArray(GDALRasterBandShadow * self)6687 SWIGINTERN GDALMDArrayHS *GDALRasterBandShadow_AsMDArray(GDALRasterBandShadow *self){
6688     return GDALRasterBandAsMDArray(self);
6689   }
GDALRasterBandShadow_ReadRaster1(GDALRasterBandShadow * self,double xoff,double yoff,double xsize,double ysize,void ** buf,int * buf_xsize=0,int * buf_ysize=0,GDALDataType * buf_type=0,GIntBig * buf_pixel_space=0,GIntBig * buf_line_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void * callback_data=NULL,void * inputOutputBuf=NULL)6690 SWIGINTERN CPLErr GDALRasterBandShadow_ReadRaster1(GDALRasterBandShadow *self,double xoff,double yoff,double xsize,double ysize,void **buf,int *buf_xsize=0,int *buf_ysize=0,GDALDataType *buf_type=0,GIntBig *buf_pixel_space=0,GIntBig *buf_line_space=0,GDALRIOResampleAlg resample_alg=GRIORA_NearestNeighbour,GDALProgressFunc callback=NULL,void *callback_data=NULL,void *inputOutputBuf=NULL){
6691 
6692     *buf = NULL;
6693 
6694     int nxsize = (buf_xsize==0) ? static_cast<int>(xsize) : *buf_xsize;
6695     int nysize = (buf_ysize==0) ? static_cast<int>(ysize) : *buf_ysize;
6696     GDALDataType ntype  = (buf_type==0) ? GDALGetRasterDataType(self)
6697                                         : *buf_type;
6698     GIntBig pixel_space = (buf_pixel_space == 0) ? 0 : *buf_pixel_space;
6699     GIntBig line_space = (buf_line_space == 0) ? 0 : *buf_line_space;
6700 
6701     size_t buf_size = static_cast<size_t>(
6702         ComputeBandRasterIOSize( nxsize, nysize,
6703                                  GDALGetDataTypeSize( ntype ) / 8,
6704                                  pixel_space, line_space, FALSE ) );
6705     if (buf_size == 0)
6706     {
6707         return CE_Failure;
6708     }
6709 
6710     char *data;
6711     Py_buffer view;
6712     if( !readraster_acquirebuffer(buf, inputOutputBuf, buf_size, ntype,
6713                                   bUseExceptions, data, view) )
6714     {
6715         return CE_Failure;
6716     }
6717 
6718     /* Should we clear the buffer in case there are hole in it ? */
6719     if( inputOutputBuf == NULL &&
6720         line_space != 0 && pixel_space != 0 && line_space > pixel_space * nxsize )
6721     {
6722         memset(data, 0, buf_size);
6723     }
6724 
6725     GDALRasterIOExtraArg sExtraArg;
6726     INIT_RASTERIO_EXTRA_ARG(sExtraArg);
6727     sExtraArg.eResampleAlg = resample_alg;
6728     sExtraArg.pfnProgress = callback;
6729     sExtraArg.pProgressData = callback_data;
6730     int nXOff = (int)(xoff + 0.5);
6731     int nYOff = (int)(yoff + 0.5);
6732     int nXSize = (int)(xsize + 0.5);
6733     int nYSize = (int)(ysize + 0.5);
6734     if( fabs(xoff-nXOff) > 1e-8 || fabs(yoff-nYOff) > 1e-8 ||
6735         fabs(xsize-nXSize) > 1e-8 || fabs(ysize-nYSize) > 1e-8 )
6736     {
6737         sExtraArg.bFloatingPointWindowValidity = TRUE;
6738         sExtraArg.dfXOff = xoff;
6739         sExtraArg.dfYOff = yoff;
6740         sExtraArg.dfXSize = xsize;
6741         sExtraArg.dfYSize = ysize;
6742     }
6743 
6744     CPLErr eErr = GDALRasterIOEx( self, GF_Read, nXOff, nYOff, nXSize, nYSize,
6745                          data, nxsize, nysize, ntype,
6746                          pixel_space, line_space, &sExtraArg );
6747 
6748     readraster_releasebuffer(eErr, buf, inputOutputBuf, view);
6749 
6750     return eErr;
6751   }
GDALRasterBandShadow_ReadBlock(GDALRasterBandShadow * self,int xoff,int yoff,void ** buf,void * buf_obj=NULL)6752 SWIGINTERN CPLErr GDALRasterBandShadow_ReadBlock(GDALRasterBandShadow *self,int xoff,int yoff,void **buf,void *buf_obj=NULL){
6753 
6754     int nBlockXSize, nBlockYSize;
6755     GDALGetBlockSize(self, &nBlockXSize, &nBlockYSize);
6756     GDALDataType ntype = GDALGetRasterDataType(self);
6757     int nDataTypeSize = (GDALGetDataTypeSize(ntype) / 8);
6758     size_t buf_size = static_cast<size_t>(nBlockXSize) *
6759                                                 nBlockYSize * nDataTypeSize;
6760 
6761     *buf = NULL;
6762 
6763     char *data;
6764     Py_buffer view;
6765 
6766     if( !readraster_acquirebuffer(buf, buf_obj, buf_size, ntype,
6767                                   bUseExceptions, data, view) )
6768     {
6769         return CE_Failure;
6770     }
6771 
6772     CPLErr eErr = GDALReadBlock( self, xoff, yoff, data);
6773 
6774     readraster_releasebuffer(eErr, buf, buf_obj, view);
6775 
6776     return eErr;
6777   }
6778 
GDALRasterBandShadow_DataType_get(GDALRasterBandShadow * h)6779 GDALDataType GDALRasterBandShadow_DataType_get( GDALRasterBandShadow *h ) {
6780   return GDALGetRasterDataType( h );
6781 }
GDALRasterBandShadow_XSize_get(GDALRasterBandShadow * h)6782 int GDALRasterBandShadow_XSize_get( GDALRasterBandShadow *h ) {
6783   return GDALGetRasterBandXSize( h );
6784 }
GDALRasterBandShadow_YSize_get(GDALRasterBandShadow * h)6785 int GDALRasterBandShadow_YSize_get( GDALRasterBandShadow *h ) {
6786   return GDALGetRasterBandYSize( h );
6787 }
6788 
new_GDALColorTableShadow(GDALPaletteInterp palette=GPI_RGB)6789 SWIGINTERN GDALColorTableShadow *new_GDALColorTableShadow(GDALPaletteInterp palette=GPI_RGB){
6790         return (GDALColorTableShadow*) GDALCreateColorTable(palette);
6791     }
delete_GDALColorTableShadow(GDALColorTableShadow * self)6792 SWIGINTERN void delete_GDALColorTableShadow(GDALColorTableShadow *self){
6793         GDALDestroyColorTable(self);
6794     }
GDALColorTableShadow_Clone(GDALColorTableShadow * self)6795 SWIGINTERN GDALColorTableShadow *GDALColorTableShadow_Clone(GDALColorTableShadow *self){
6796         return (GDALColorTableShadow*) GDALCloneColorTable (self);
6797     }
GDALColorTableShadow_GetPaletteInterpretation(GDALColorTableShadow * self)6798 SWIGINTERN GDALPaletteInterp GDALColorTableShadow_GetPaletteInterpretation(GDALColorTableShadow *self){
6799         return GDALGetPaletteInterpretation(self);
6800     }
GDALColorTableShadow_GetColorEntryCount(GDALColorTableShadow * self)6801 SWIGINTERN int GDALColorTableShadow_GetColorEntryCount(GDALColorTableShadow *self){
6802         return GDALGetColorEntryCount(self);
6803     }
GDALColorTableShadow_GetColorEntry(GDALColorTableShadow * self,int entry)6804 SWIGINTERN GDALColorEntry *GDALColorTableShadow_GetColorEntry(GDALColorTableShadow *self,int entry){
6805         return (GDALColorEntry*) GDALGetColorEntry(self, entry);
6806     }
GDALColorTableShadow_GetColorEntryAsRGB(GDALColorTableShadow * self,int entry,GDALColorEntry * centry)6807 SWIGINTERN int GDALColorTableShadow_GetColorEntryAsRGB(GDALColorTableShadow *self,int entry,GDALColorEntry *centry){
6808         return GDALGetColorEntryAsRGB(self, entry, centry);
6809     }
GDALColorTableShadow_SetColorEntry(GDALColorTableShadow * self,int entry,GDALColorEntry const * centry)6810 SWIGINTERN void GDALColorTableShadow_SetColorEntry(GDALColorTableShadow *self,int entry,GDALColorEntry const *centry){
6811         GDALSetColorEntry(self, entry, centry);
6812     }
GDALColorTableShadow_CreateColorRamp(GDALColorTableShadow * self,int nStartIndex,GDALColorEntry const * startcolor,int nEndIndex,GDALColorEntry const * endcolor)6813 SWIGINTERN void GDALColorTableShadow_CreateColorRamp(GDALColorTableShadow *self,int nStartIndex,GDALColorEntry const *startcolor,int nEndIndex,GDALColorEntry const *endcolor){
6814         GDALCreateColorRamp(self, nStartIndex, startcolor, nEndIndex, endcolor);
6815     }
new_GDALRasterAttributeTableShadow()6816 SWIGINTERN GDALRasterAttributeTableShadow *new_GDALRasterAttributeTableShadow(){
6817         return (GDALRasterAttributeTableShadow*)
6818 		GDALCreateRasterAttributeTable();
6819     }
delete_GDALRasterAttributeTableShadow(GDALRasterAttributeTableShadow * self)6820 SWIGINTERN void delete_GDALRasterAttributeTableShadow(GDALRasterAttributeTableShadow *self){
6821         GDALDestroyRasterAttributeTable(self);
6822     }
GDALRasterAttributeTableShadow_Clone(GDALRasterAttributeTableShadow * self)6823 SWIGINTERN GDALRasterAttributeTableShadow *GDALRasterAttributeTableShadow_Clone(GDALRasterAttributeTableShadow *self){
6824         return (GDALRasterAttributeTableShadow*) GDALRATClone(self);
6825     }
GDALRasterAttributeTableShadow_GetColumnCount(GDALRasterAttributeTableShadow * self)6826 SWIGINTERN int GDALRasterAttributeTableShadow_GetColumnCount(GDALRasterAttributeTableShadow *self){
6827         return GDALRATGetColumnCount( self );
6828     }
GDALRasterAttributeTableShadow_GetNameOfCol(GDALRasterAttributeTableShadow * self,int iCol)6829 SWIGINTERN char const *GDALRasterAttributeTableShadow_GetNameOfCol(GDALRasterAttributeTableShadow *self,int iCol){
6830         return GDALRATGetNameOfCol( self, iCol );
6831     }
GDALRasterAttributeTableShadow_GetUsageOfCol(GDALRasterAttributeTableShadow * self,int iCol)6832 SWIGINTERN GDALRATFieldUsage GDALRasterAttributeTableShadow_GetUsageOfCol(GDALRasterAttributeTableShadow *self,int iCol){
6833         return GDALRATGetUsageOfCol( self, iCol );
6834     }
GDALRasterAttributeTableShadow_GetTypeOfCol(GDALRasterAttributeTableShadow * self,int iCol)6835 SWIGINTERN GDALRATFieldType GDALRasterAttributeTableShadow_GetTypeOfCol(GDALRasterAttributeTableShadow *self,int iCol){
6836         return GDALRATGetTypeOfCol( self, iCol );
6837     }
GDALRasterAttributeTableShadow_GetColOfUsage(GDALRasterAttributeTableShadow * self,GDALRATFieldUsage eUsage)6838 SWIGINTERN int GDALRasterAttributeTableShadow_GetColOfUsage(GDALRasterAttributeTableShadow *self,GDALRATFieldUsage eUsage){
6839         return GDALRATGetColOfUsage( self, eUsage );
6840     }
GDALRasterAttributeTableShadow_GetRowCount(GDALRasterAttributeTableShadow * self)6841 SWIGINTERN int GDALRasterAttributeTableShadow_GetRowCount(GDALRasterAttributeTableShadow *self){
6842         return GDALRATGetRowCount( self );
6843     }
GDALRasterAttributeTableShadow_GetValueAsString(GDALRasterAttributeTableShadow * self,int iRow,int iCol)6844 SWIGINTERN char const *GDALRasterAttributeTableShadow_GetValueAsString(GDALRasterAttributeTableShadow *self,int iRow,int iCol){
6845         return GDALRATGetValueAsString( self, iRow, iCol );
6846     }
GDALRasterAttributeTableShadow_GetValueAsInt(GDALRasterAttributeTableShadow * self,int iRow,int iCol)6847 SWIGINTERN int GDALRasterAttributeTableShadow_GetValueAsInt(GDALRasterAttributeTableShadow *self,int iRow,int iCol){
6848         return GDALRATGetValueAsInt( self, iRow, iCol );
6849     }
GDALRasterAttributeTableShadow_GetValueAsDouble(GDALRasterAttributeTableShadow * self,int iRow,int iCol)6850 SWIGINTERN double GDALRasterAttributeTableShadow_GetValueAsDouble(GDALRasterAttributeTableShadow *self,int iRow,int iCol){
6851         return GDALRATGetValueAsDouble( self, iRow, iCol );
6852     }
GDALRasterAttributeTableShadow_SetValueAsString(GDALRasterAttributeTableShadow * self,int iRow,int iCol,char const * pszValue)6853 SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsString(GDALRasterAttributeTableShadow *self,int iRow,int iCol,char const *pszValue){
6854         GDALRATSetValueAsString( self, iRow, iCol, pszValue );
6855     }
GDALRasterAttributeTableShadow_SetValueAsInt(GDALRasterAttributeTableShadow * self,int iRow,int iCol,int nValue)6856 SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsInt(GDALRasterAttributeTableShadow *self,int iRow,int iCol,int nValue){
6857         GDALRATSetValueAsInt( self, iRow, iCol, nValue );
6858     }
GDALRasterAttributeTableShadow_SetValueAsDouble(GDALRasterAttributeTableShadow * self,int iRow,int iCol,double dfValue)6859 SWIGINTERN void GDALRasterAttributeTableShadow_SetValueAsDouble(GDALRasterAttributeTableShadow *self,int iRow,int iCol,double dfValue){
6860         GDALRATSetValueAsDouble( self, iRow, iCol, dfValue );
6861     }
GDALRasterAttributeTableShadow_SetRowCount(GDALRasterAttributeTableShadow * self,int nCount)6862 SWIGINTERN void GDALRasterAttributeTableShadow_SetRowCount(GDALRasterAttributeTableShadow *self,int nCount){
6863         GDALRATSetRowCount( self, nCount );
6864     }
GDALRasterAttributeTableShadow_CreateColumn(GDALRasterAttributeTableShadow * self,char const * pszName,GDALRATFieldType eType,GDALRATFieldUsage eUsage)6865 SWIGINTERN int GDALRasterAttributeTableShadow_CreateColumn(GDALRasterAttributeTableShadow *self,char const *pszName,GDALRATFieldType eType,GDALRATFieldUsage eUsage){
6866         return GDALRATCreateColumn( self, pszName, eType, eUsage );
6867     }
GDALRasterAttributeTableShadow_GetLinearBinning(GDALRasterAttributeTableShadow * self,double * pdfRow0Min,double * pdfBinSize)6868 SWIGINTERN bool GDALRasterAttributeTableShadow_GetLinearBinning(GDALRasterAttributeTableShadow *self,double *pdfRow0Min,double *pdfBinSize){
6869         return (GDALRATGetLinearBinning(self, pdfRow0Min, pdfBinSize) != 0) ? true : false;
6870     }
GDALRasterAttributeTableShadow_SetLinearBinning(GDALRasterAttributeTableShadow * self,double dfRow0Min,double dfBinSize)6871 SWIGINTERN int GDALRasterAttributeTableShadow_SetLinearBinning(GDALRasterAttributeTableShadow *self,double dfRow0Min,double dfBinSize){
6872         return GDALRATSetLinearBinning(self, dfRow0Min, dfBinSize);
6873     }
GDALRasterAttributeTableShadow_GetRowOfValue(GDALRasterAttributeTableShadow * self,double dfValue)6874 SWIGINTERN int GDALRasterAttributeTableShadow_GetRowOfValue(GDALRasterAttributeTableShadow *self,double dfValue){
6875         return GDALRATGetRowOfValue( self, dfValue );
6876     }
GDALRasterAttributeTableShadow_ChangesAreWrittenToFile(GDALRasterAttributeTableShadow * self)6877 SWIGINTERN int GDALRasterAttributeTableShadow_ChangesAreWrittenToFile(GDALRasterAttributeTableShadow *self){
6878         return GDALRATChangesAreWrittenToFile( self );
6879     }
GDALRasterAttributeTableShadow_DumpReadable(GDALRasterAttributeTableShadow * self)6880 SWIGINTERN void GDALRasterAttributeTableShadow_DumpReadable(GDALRasterAttributeTableShadow *self){
6881         GDALRATDumpReadable( self, NULL );
6882     }
GDALRasterAttributeTableShadow_SetTableType(GDALRasterAttributeTableShadow * self,GDALRATTableType eTableType)6883 SWIGINTERN void GDALRasterAttributeTableShadow_SetTableType(GDALRasterAttributeTableShadow *self,GDALRATTableType eTableType){
6884         GDALRATSetTableType( self, eTableType );
6885     }
GDALRasterAttributeTableShadow_GetTableType(GDALRasterAttributeTableShadow * self)6886 SWIGINTERN GDALRATTableType GDALRasterAttributeTableShadow_GetTableType(GDALRasterAttributeTableShadow *self){
6887         return GDALRATGetTableType( self );
6888     }
6889 
6890 #include "gdalgrid.h"
6891 
6892 #ifdef DEBUG
6893 typedef struct OGRLayerHS OGRLayerShadow;
6894 typedef struct OGRGeometryHS OGRGeometryShadow;
6895 #else
6896 typedef void OGRLayerShadow;
6897 typedef void OGRGeometryShadow;
6898 #endif
6899 
6900 
6901 static int
GDALTermProgress_nocb(double dfProgress,const char * pszMessage=NULL,void * pData=NULL)6902 GDALTermProgress_nocb( double dfProgress, const char * pszMessage=NULL, void *pData=NULL ) {
6903   return GDALTermProgress( dfProgress, pszMessage, pData);
6904 }
6905 
6906 
ComputeMedianCutPCT(GDALRasterBandShadow * red,GDALRasterBandShadow * green,GDALRasterBandShadow * blue,int num_colors,GDALColorTableShadow * colors,GDALProgressFunc callback=NULL,void * callback_data=NULL)6907 int  ComputeMedianCutPCT ( GDALRasterBandShadow *red,
6908                               GDALRasterBandShadow *green,
6909                               GDALRasterBandShadow *blue,
6910                               int num_colors,
6911                               GDALColorTableShadow* colors,
6912                               GDALProgressFunc callback = NULL,
6913                               void* callback_data=NULL) {
6914 
6915     CPLErrorReset();
6916 
6917     int err = GDALComputeMedianCutPCT( red,
6918                                           green,
6919                                           blue,
6920                                           NULL,
6921                                           num_colors,
6922                                           colors,
6923                                           callback,
6924                                           callback_data);
6925 
6926     return err;
6927 }
6928 
6929 
DitherRGB2PCT(GDALRasterBandShadow * red,GDALRasterBandShadow * green,GDALRasterBandShadow * blue,GDALRasterBandShadow * target,GDALColorTableShadow * colors,GDALProgressFunc callback=NULL,void * callback_data=NULL)6930 int  DitherRGB2PCT ( GDALRasterBandShadow *red,
6931                      GDALRasterBandShadow *green,
6932                      GDALRasterBandShadow *blue,
6933                      GDALRasterBandShadow *target,
6934                      GDALColorTableShadow *colors,
6935                      GDALProgressFunc callback = NULL,
6936                      void* callback_data=NULL) {
6937 
6938     CPLErrorReset();
6939     int err;
6940     err = GDALDitherRGB2PCT(  red,
6941                                   green,
6942                                   blue,
6943                                   target,
6944                                   colors,
6945                                   callback,
6946                                   callback_data);
6947 
6948     return err;
6949 }
6950 
6951 
ReprojectImage(GDALDatasetShadow * src_ds,GDALDatasetShadow * dst_ds,const char * src_wkt=NULL,const char * dst_wkt=NULL,GDALResampleAlg eResampleAlg=GRA_NearestNeighbour,double WarpMemoryLimit=0.0,double maxerror=0.0,GDALProgressFunc callback=NULL,void * callback_data=NULL,char ** options=NULL)6952 CPLErr  ReprojectImage ( GDALDatasetShadow *src_ds,
6953                          GDALDatasetShadow *dst_ds,
6954                          const char *src_wkt=NULL,
6955                          const char *dst_wkt=NULL,
6956                          GDALResampleAlg eResampleAlg=GRA_NearestNeighbour,
6957                          double WarpMemoryLimit=0.0,
6958                          double maxerror = 0.0,
6959 			 GDALProgressFunc callback = NULL,
6960                      	 void* callback_data=NULL,
6961                          char** options = NULL ) {
6962 
6963     CPLErrorReset();
6964 
6965     GDALWarpOptions* psOptions = NULL;
6966     if( options != NULL )
6967     {
6968         psOptions = GDALCreateWarpOptions();
6969         psOptions->papszWarpOptions = CSLDuplicate(options);
6970     }
6971 
6972     CPLErr err = GDALReprojectImage( src_ds,
6973                                      src_wkt,
6974                                      dst_ds,
6975                                      dst_wkt,
6976                                      eResampleAlg,
6977                                      WarpMemoryLimit,
6978                                      maxerror,
6979                                      callback,
6980                                      callback_data,
6981                                      psOptions);
6982 
6983     if( psOptions != NULL )
6984         GDALDestroyWarpOptions(psOptions);
6985 
6986     return err;
6987 }
6988 
6989 
ComputeProximity(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * proximityBand,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)6990 int  ComputeProximity( GDALRasterBandShadow *srcBand,
6991                        GDALRasterBandShadow *proximityBand,
6992                        char **options = NULL,
6993                        GDALProgressFunc callback=NULL,
6994                        void* callback_data=NULL) {
6995 
6996     CPLErrorReset();
6997 
6998     return GDALComputeProximity( srcBand, proximityBand, options,
6999                                  callback, callback_data );
7000 }
7001 
7002 
RasterizeLayer(GDALDatasetShadow * dataset,int bands,int * band_list,OGRLayerShadow * layer,void * pfnTransformer=NULL,void * pTransformArg=NULL,int burn_values=0,double * burn_values_list=NULL,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)7003 int  RasterizeLayer( GDALDatasetShadow *dataset,
7004                  int bands, int *band_list,
7005                  OGRLayerShadow *layer,
7006                  void *pfnTransformer = NULL,
7007                  void *pTransformArg = NULL,
7008 		 int burn_values = 0, double *burn_values_list = NULL,
7009                  char **options = NULL,
7010                  GDALProgressFunc callback=NULL,
7011                  void* callback_data=NULL) {
7012 
7013     CPLErr eErr;
7014 
7015     CPLErrorReset();
7016 
7017     if( burn_values == 0 )
7018     {
7019         burn_values_list = (double *) CPLMalloc(sizeof(double)*bands);
7020         for( int i = 0; i < bands; i++ )
7021             burn_values_list[i] = 255.0;
7022     }
7023     else if( burn_values != bands )
7024     {
7025         CPLError( CE_Failure, CPLE_AppDefined,
7026                   "Did not get the expected number of burn values in RasterizeLayer()" );
7027         return CE_Failure;
7028     }
7029 
7030     eErr = GDALRasterizeLayers( dataset, bands, band_list,
7031                                 1, &layer,
7032                                 (GDALTransformerFunc) pfnTransformer,
7033                                 pTransformArg,
7034                                 burn_values_list, options,
7035                                 callback, callback_data );
7036 
7037     if( burn_values == 0 )
7038         CPLFree( burn_values_list );
7039 
7040     return eErr;
7041 }
7042 
7043 
Polygonize(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * maskBand,OGRLayerShadow * outLayer,int iPixValField,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)7044 int  Polygonize( GDALRasterBandShadow *srcBand,
7045      		 GDALRasterBandShadow *maskBand,
7046   	         OGRLayerShadow *outLayer,
7047                  int iPixValField,
7048                  char **options = NULL,
7049                  GDALProgressFunc callback=NULL,
7050                  void* callback_data=NULL) {
7051 
7052     CPLErrorReset();
7053 
7054     return GDALPolygonize( srcBand, maskBand, outLayer, iPixValField,
7055                            options, callback, callback_data );
7056 }
7057 
7058 
FPolygonize(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * maskBand,OGRLayerShadow * outLayer,int iPixValField,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)7059 int  FPolygonize( GDALRasterBandShadow *srcBand,
7060                  GDALRasterBandShadow *maskBand,
7061                  OGRLayerShadow *outLayer,
7062                  int iPixValField,
7063                  char **options = NULL,
7064                  GDALProgressFunc callback=NULL,
7065                  void* callback_data=NULL) {
7066 
7067     CPLErrorReset();
7068 
7069     return GDALFPolygonize( srcBand, maskBand, outLayer, iPixValField,
7070                            options, callback, callback_data );
7071 }
7072 
7073 
FillNodata(GDALRasterBandShadow * targetBand,GDALRasterBandShadow * maskBand,double maxSearchDist,int smoothingIterations,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)7074 int  FillNodata( GDALRasterBandShadow *targetBand,
7075      		 GDALRasterBandShadow *maskBand,
7076                  double maxSearchDist,
7077                  int smoothingIterations,
7078                  char **options = NULL,
7079                  GDALProgressFunc callback=NULL,
7080                  void* callback_data=NULL) {
7081 
7082     CPLErrorReset();
7083 
7084     return GDALFillNodata( targetBand, maskBand, maxSearchDist,
7085     	   		   0, smoothingIterations, options,
7086 			   callback, callback_data );
7087 }
7088 
7089 
SieveFilter(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * maskBand,GDALRasterBandShadow * dstBand,int threshold,int connectedness=4,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)7090 int  SieveFilter( GDALRasterBandShadow *srcBand,
7091      		  GDALRasterBandShadow *maskBand,
7092   	          GDALRasterBandShadow *dstBand,
7093                   int threshold, int connectedness=4,
7094                   char **options = NULL,
7095                   GDALProgressFunc callback=NULL,
7096                   void* callback_data=NULL) {
7097 
7098     CPLErrorReset();
7099 
7100     return GDALSieveFilter( srcBand, maskBand, dstBand,
7101                             threshold, connectedness,
7102                             options, callback, callback_data );
7103 }
7104 
7105 
RegenerateOverviews(GDALRasterBandShadow * srcBand,int overviewBandCount,GDALRasterBandShadow ** overviewBands,const char * resampling="average",GDALProgressFunc callback=NULL,void * callback_data=NULL)7106 int  RegenerateOverviews( GDALRasterBandShadow *srcBand,
7107      			  int overviewBandCount,
7108                           GDALRasterBandShadow **overviewBands,
7109                           const char *resampling = "average",
7110                           GDALProgressFunc callback=NULL,
7111                           void* callback_data=NULL) {
7112 
7113     CPLErrorReset();
7114 
7115     return GDALRegenerateOverviews( srcBand, overviewBandCount, overviewBands,
7116     	   			    resampling ? resampling : "average", callback, callback_data );
7117 }
7118 
7119 
RegenerateOverview(GDALRasterBandShadow * srcBand,GDALRasterBandShadow * overviewBand,const char * resampling="average",GDALProgressFunc callback=NULL,void * callback_data=NULL)7120 int  RegenerateOverview( GDALRasterBandShadow *srcBand,
7121                           GDALRasterBandShadow *overviewBand,
7122                           const char *resampling = "average",
7123                           GDALProgressFunc callback=NULL,
7124                           void* callback_data=NULL) {
7125 
7126     CPLErrorReset();
7127 
7128     return GDALRegenerateOverviews( srcBand, 1, &overviewBand,
7129     	   			    resampling ? resampling : "average", callback, callback_data );
7130 }
7131 
7132 
ContourGenerate(GDALRasterBandShadow * srcBand,double contourInterval,double contourBase,int fixedLevelCount,double * fixedLevels,int useNoData,double noDataValue,OGRLayerShadow * dstLayer,int idField,int elevField,GDALProgressFunc callback=NULL,void * callback_data=NULL)7133 int ContourGenerate( GDALRasterBandShadow *srcBand,
7134                      double contourInterval,
7135                      double contourBase,
7136                      int fixedLevelCount,
7137                      double *fixedLevels,
7138                      int useNoData,
7139                      double noDataValue,
7140                      OGRLayerShadow* dstLayer,
7141                      int idField,
7142                      int elevField,
7143                      GDALProgressFunc callback = NULL,
7144                      void* callback_data = NULL)
7145 {
7146     CPLErr eErr;
7147 
7148     CPLErrorReset();
7149 
7150     eErr =  GDALContourGenerate( srcBand,
7151                                  contourInterval,
7152                                  contourBase,
7153                                  fixedLevelCount,
7154                                  fixedLevels,
7155                                  useNoData,
7156                                  noDataValue,
7157                                  dstLayer,
7158                                  idField,
7159                                  elevField,
7160                                  callback,
7161                                  callback_data);
7162 
7163     return eErr;
7164 }
7165 
7166 
ContourGenerateEx(GDALRasterBandShadow * srcBand,OGRLayerShadow * dstLayer,char ** options=NULL,GDALProgressFunc callback=NULL,void * callback_data=NULL)7167 int ContourGenerateEx( GDALRasterBandShadow *srcBand,
7168                        OGRLayerShadow* dstLayer,
7169                        char** options = NULL,
7170                        GDALProgressFunc callback = NULL,
7171                        void* callback_data = NULL )
7172 {
7173     CPLErr eErr;
7174 
7175     CPLErrorReset();
7176 
7177     eErr =  GDALContourGenerateEx( srcBand,
7178                                    dstLayer,
7179                                    options,
7180                                    callback,
7181                                    callback_data);
7182 
7183     return eErr;
7184 }
7185 
7186 
ViewshedGenerate(GDALRasterBandShadow * srcBand,const char * driverName,const char * targetRasterName,char ** creationOptions,double observerX,double observerY,double observerHeight,double targetHeight,double visibleVal,double invisibleVal,double outOfRangeVal,double noDataVal,double dfCurvCoeff,GDALViewshedMode mode,double maxDistance,GDALProgressFunc callback=NULL,void * callback_data=NULL,GDALViewshedOutputType heightMode=GVOT_NORMAL,char ** papszOptions=NULL)7187 GDALDatasetShadow *ViewshedGenerate( GDALRasterBandShadow *srcBand,
7188                         const char* driverName,
7189                         const char* targetRasterName,
7190                         char** creationOptions,
7191                         double observerX, double observerY, double observerHeight,
7192                         double targetHeight, double visibleVal, double invisibleVal,
7193                         double outOfRangeVal,  double noDataVal, double dfCurvCoeff,
7194                         GDALViewshedMode mode, double maxDistance,
7195                         GDALProgressFunc callback = NULL, void* callback_data = NULL,
7196                         GDALViewshedOutputType heightMode = GVOT_NORMAL,
7197                         char** papszOptions = NULL)
7198 {
7199     GDALDatasetShadow* ds = GDALViewshedGenerate( srcBand,
7200                                  driverName,
7201                                  targetRasterName,
7202                                  creationOptions,
7203                                  observerX,
7204                                  observerY,
7205                                  observerHeight,
7206                                  targetHeight,
7207                                  visibleVal,
7208                                  invisibleVal,
7209                                  outOfRangeVal,
7210                                  noDataVal,
7211                                  dfCurvCoeff,
7212                                  mode,
7213                                  maxDistance,
7214                                  callback,
7215                                  callback_data,
7216                                  heightMode,
7217                                  papszOptions);
7218   if (ds == 0) {
7219     /*throw CPLGetLastErrorMsg(); causes a SWIG_exception later*/
7220   }
7221   return ds;
7222 }
7223 
7224 
AutoCreateWarpedVRT(GDALDatasetShadow * src_ds,const char * src_wkt=0,const char * dst_wkt=0,GDALResampleAlg eResampleAlg=GRA_NearestNeighbour,double maxerror=0.0)7225 GDALDatasetShadow *AutoCreateWarpedVRT( GDALDatasetShadow *src_ds,
7226                                         const char *src_wkt = 0,
7227                                         const char *dst_wkt = 0,
7228                                         GDALResampleAlg eResampleAlg = GRA_NearestNeighbour,
7229                                         double maxerror = 0.0 ) {
7230   GDALDatasetShadow *ds = GDALAutoCreateWarpedVRT( src_ds, src_wkt,
7231                                                    dst_wkt,
7232                                                    eResampleAlg,
7233                                                    maxerror,
7234                                                    0 );
7235   if (ds == 0) {
7236     /*throw CPLGetLastErrorMsg(); causes a SWIG_exception later*/
7237   }
7238   return ds;
7239 
7240 }
7241 
7242 
CreatePansharpenedVRT(const char * pszXML,GDALRasterBandShadow * panchroBand,int nInputSpectralBands,GDALRasterBandShadow ** ahInputSpectralBands)7243 GDALDatasetShadow*  CreatePansharpenedVRT( const char* pszXML,
7244                             GDALRasterBandShadow* panchroBand,
7245                             int nInputSpectralBands,
7246                             GDALRasterBandShadow** ahInputSpectralBands )
7247 {
7248     CPLErrorReset();
7249 
7250     return (GDALDatasetShadow*)GDALCreatePansharpenedVRT( pszXML, panchroBand,
7251                                       nInputSpectralBands, ahInputSpectralBands );
7252 }
7253 
delete_GDALTransformerInfoShadow(GDALTransformerInfoShadow * self)7254 SWIGINTERN void delete_GDALTransformerInfoShadow(GDALTransformerInfoShadow *self){
7255     GDALDestroyTransformer( self );
7256   }
GDALTransformerInfoShadow_TransformPoint__SWIG_0(GDALTransformerInfoShadow * self,int bDstToSrc,double inout[3])7257 SWIGINTERN int GDALTransformerInfoShadow_TransformPoint__SWIG_0(GDALTransformerInfoShadow *self,int bDstToSrc,double inout[3]){
7258     int nRet, nSuccess = TRUE;
7259 
7260     nRet = GDALUseTransformer( self, bDstToSrc,
7261                                1, &inout[0], &inout[1], &inout[2],
7262                                &nSuccess );
7263 
7264     return nRet && nSuccess;
7265   }
GDALTransformerInfoShadow_TransformPoint__SWIG_1(GDALTransformerInfoShadow * self,double argout[3],int bDstToSrc,double x,double y,double z=0.0)7266 SWIGINTERN int GDALTransformerInfoShadow_TransformPoint__SWIG_1(GDALTransformerInfoShadow *self,double argout[3],int bDstToSrc,double x,double y,double z=0.0){
7267     int nRet, nSuccess = TRUE;
7268 
7269     argout[0] = x;
7270     argout[1] = y;
7271     argout[2] = z;
7272     nRet = GDALUseTransformer( self, bDstToSrc,
7273                                1, &argout[0], &argout[1], &argout[2],
7274                                &nSuccess );
7275 
7276     return nRet && nSuccess;
7277   }
7278 
7279 static int
DecomposeSequenceOfCoordinates(PyObject * seq,int nCount,double * x,double * y,double * z)7280 DecomposeSequenceOfCoordinates( PyObject *seq, int nCount, double *x, double *y, double *z )
7281 {
7282   for( int i = 0; i<nCount; ++i )
7283   {
7284 
7285     PyObject *o = PySequence_GetItem(seq, i);
7286     if ( !PySequence_Check(o) )
7287     {
7288         Py_DECREF(o);
7289         PyErr_SetString(PyExc_TypeError, "not a sequence");
7290 
7291         return FALSE;
7292     }
7293 
7294     Py_ssize_t len = PySequence_Size(o);
7295 
7296     if (len == 2 || len == 3)
7297     {
7298         PyObject *o1 = PySequence_GetItem(o, 0);
7299         if (!PyNumber_Check(o1))
7300         {
7301             Py_DECREF(o); Py_DECREF(o1);
7302             PyErr_SetString(PyExc_TypeError, "not a number");
7303 
7304             return FALSE;
7305         }
7306         x[i] = PyFloat_AsDouble(o1);
7307         Py_DECREF(o1);
7308 
7309         o1 = PySequence_GetItem(o, 1);
7310         if (!PyNumber_Check(o1))
7311         {
7312             Py_DECREF(o); Py_DECREF(o1);
7313             PyErr_SetString(PyExc_TypeError, "not a number");
7314 
7315             return FALSE;
7316         }
7317         y[i] = PyFloat_AsDouble(o1);
7318         Py_DECREF(o1);
7319 
7320         /* The 3rd coordinate is optional, default 0.0 */
7321         if (len == 3)
7322         {
7323             o1 = PySequence_GetItem(o, 2);
7324             if (!PyNumber_Check(o1))
7325             {
7326                 Py_DECREF(o); Py_DECREF(o1);
7327                 PyErr_SetString(PyExc_TypeError, "not a number");
7328 
7329                 return FALSE;
7330             }
7331             z[i] = PyFloat_AsDouble(o1);
7332             Py_DECREF(o1);
7333         }
7334         else
7335         {
7336             z[i] = 0.0;
7337         }
7338     }
7339     else
7340     {
7341         Py_DECREF(o);
7342         PyErr_SetString(PyExc_TypeError, "invalid coordinate");
7343 
7344         return FALSE;
7345     }
7346 
7347     Py_DECREF(o);
7348   }
7349 
7350   return TRUE;
7351 }
7352 
GDALTransformerInfoShadow_TransformPoints(GDALTransformerInfoShadow * self,int bDstToSrc,int nCount,double * x,double * y,double * z,int * panSuccess)7353 SWIGINTERN int GDALTransformerInfoShadow_TransformPoints(GDALTransformerInfoShadow *self,int bDstToSrc,int nCount,double *x,double *y,double *z,int *panSuccess){
7354     int nRet;
7355 
7356     nRet = GDALUseTransformer( self, bDstToSrc, nCount, x, y, z, panSuccess );
7357 
7358     return nRet;
7359   }
GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow * self,GDALRasterBandShadow * xBand,GDALRasterBandShadow * yBand,GDALRasterBandShadow * zBand,GDALProgressFunc callback=NULL,void * callback_data=NULL,char ** options=NULL)7360 SWIGINTERN int GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow *self,GDALRasterBandShadow *xBand,GDALRasterBandShadow *yBand,GDALRasterBandShadow *zBand,GDALProgressFunc callback=NULL,void *callback_data=NULL,char **options=NULL){
7361 
7362     CPLErrorReset();
7363 
7364     return GDALTransformGeolocations( xBand, yBand, zBand,
7365                                       GDALUseTransformer, self,
7366                             	      callback, callback_data, options );
7367   }
7368 
Transformer(GDALDatasetShadow * src,GDALDatasetShadow * dst,char ** options)7369   GDALTransformerInfoShadow* Transformer( GDALDatasetShadow *src, GDALDatasetShadow *dst,
7370                              char **options ) {
7371     GDALTransformerInfoShadow *obj = (GDALTransformerInfoShadow*)
7372        GDALCreateGenImgProjTransformer2( (GDALDatasetH)src, (GDALDatasetH)dst,
7373                                          options );
7374     return obj;
7375   }
7376 
7377 
ApplyVerticalShiftGrid(GDALDatasetShadow * src_ds,GDALDatasetShadow * grid_ds,bool inverse=false,double srcUnitToMeter=1.0,double dstUnitToMeter=1.0,char ** options=NULL)7378 GDALDatasetShadow* ApplyVerticalShiftGrid( GDALDatasetShadow *src_ds,
7379                                            GDALDatasetShadow *grid_ds,
7380                                            bool inverse = false,
7381                                            double srcUnitToMeter = 1.0,
7382                                            double dstUnitToMeter = 1.0,
7383                                            char** options = NULL ) {
7384   GDALDatasetShadow *ds = GDALApplyVerticalShiftGrid( src_ds, grid_ds,
7385                                                       inverse,
7386                                                       srcUnitToMeter,
7387                                                       dstUnitToMeter,
7388                                                       options );
7389   return ds;
7390 
7391 }
7392 
7393 
wrapper_GDALGetCacheMax()7394 GIntBig wrapper_GDALGetCacheMax()
7395 {
7396     return GDALGetCacheMax64();
7397 }
7398 
7399 
wrapper_GDALGetCacheUsed()7400 GIntBig wrapper_GDALGetCacheUsed()
7401 {
7402     return GDALGetCacheUsed64();
7403 }
7404 
7405 
wrapper_GDALSetCacheMax(GIntBig nBytes)7406 void wrapper_GDALSetCacheMax(GIntBig nBytes)
7407 {
7408     return GDALSetCacheMax64(nBytes);
7409 }
7410 
7411 
7412 /************************************************************************/
7413 /*                          XMLTreeToPyList()                           */
7414 /************************************************************************/
XMLTreeToPyList(CPLXMLNode * psTree)7415 static PyObject *XMLTreeToPyList( CPLXMLNode *psTree )
7416 {
7417     PyObject *pyList;
7418     int      nChildCount = 0, iChild;
7419     CPLXMLNode *psChild;
7420 
7421     if( psTree == NULL )
7422         return Py_None;
7423 
7424     for( psChild = psTree->psChild;
7425          psChild != NULL;
7426          psChild = psChild->psNext )
7427         nChildCount++;
7428 
7429     pyList = PyList_New(nChildCount+2);
7430 
7431     PyList_SetItem( pyList, 0, Py_BuildValue( "i", (int) psTree->eType ) );
7432     PyList_SetItem( pyList, 1, Py_BuildValue( "s", psTree->pszValue ) );
7433 
7434     for( psChild = psTree->psChild, iChild = 2;
7435          psChild != NULL;
7436          psChild = psChild->psNext, iChild++ )
7437     {
7438         PyList_SetItem( pyList, iChild, XMLTreeToPyList( psChild ) );
7439     }
7440 
7441     return pyList;
7442 }
7443 
7444 
7445 /************************************************************************/
7446 /*                          PyListToXMLTree()                           */
7447 /************************************************************************/
PyListToXMLTree(PyObject * pyList)7448 static CPLXMLNode *PyListToXMLTree( PyObject *pyList )
7449 
7450 {
7451     int      nChildCount = 0, iChild, nType = 0;
7452     CPLXMLNode *psThisNode;
7453     CPLXMLNode *psChild;
7454     char       *pszText = NULL;
7455 
7456     if( PyList_Size(pyList) > INT_MAX )
7457     {
7458         PyErr_SetString(PyExc_TypeError,"Error in input XMLTree." );
7459         return NULL;
7460     }
7461     nChildCount = static_cast<int>(PyList_Size(pyList)) - 2;
7462     if( nChildCount < 0 )
7463     {
7464         PyErr_SetString(PyExc_TypeError,"Error in input XMLTree." );
7465         return NULL;
7466     }
7467 
7468     CPL_IGNORE_RET_VAL(PyArg_Parse( PyList_GET_ITEM(pyList,0), "i", &nType ));
7469     CPL_IGNORE_RET_VAL(PyArg_Parse( PyList_GET_ITEM(pyList,1), "s", &pszText ));
7470 
7471     /* Detect "pseudo" root */
7472     if (nType == CXT_Element && pszText != NULL && strlen(pszText) == 0 && nChildCount == 2)
7473     {
7474         PyObject *pyFirst = PyList_GET_ITEM(pyList, 2);
7475         if (PyList_Size(pyFirst) < 2)
7476         {
7477             PyErr_SetString(PyExc_TypeError,"Error in input XMLTree." );
7478             return NULL;
7479         }
7480         int nTypeFirst = 0;
7481         char* pszTextFirst = NULL;
7482         CPL_IGNORE_RET_VAL(PyArg_Parse( PyList_GET_ITEM(pyFirst,0), "i", &nTypeFirst ));
7483         CPL_IGNORE_RET_VAL(PyArg_Parse( PyList_GET_ITEM(pyFirst,1), "s", &pszTextFirst ));
7484         if (nTypeFirst == CXT_Element && pszTextFirst != NULL && pszTextFirst[0] == '?')
7485         {
7486             psThisNode = PyListToXMLTree( PyList_GET_ITEM(pyList,2) );
7487             psThisNode->psNext = PyListToXMLTree( PyList_GET_ITEM(pyList,3) );
7488             return psThisNode;
7489         }
7490     }
7491 
7492     psThisNode = CPLCreateXMLNode( NULL, (CPLXMLNodeType) nType, pszText );
7493 
7494     for( iChild = 0; iChild < nChildCount; iChild++ )
7495     {
7496         psChild = PyListToXMLTree( PyList_GET_ITEM(pyList,iChild+2) );
7497         CPLAddXMLChild( psThisNode, psChild );
7498     }
7499 
7500     return psThisNode;
7501 }
7502 
7503 
GetJPEG2000StructureAsString(const char * pszFilename,char ** options=NULL)7504 retStringAndCPLFree *GetJPEG2000StructureAsString( const char* pszFilename, char** options = NULL )
7505 {
7506     CPLXMLNode* psNode = GDALGetJPEG2000Structure(pszFilename, options);
7507     if( psNode == NULL )
7508         return NULL;
7509     char* pszXML = CPLSerializeXMLTree(psNode);
7510     CPLDestroyXMLNode(psNode);
7511     return pszXML;
7512 }
7513 
7514 
GetDriverCount()7515 int GetDriverCount() {
7516   return GDALGetDriverCount();
7517 }
7518 
7519 
7520 static
GetDriverByName(char const * name)7521 GDALDriverShadow* GetDriverByName( char const *name ) {
7522   return (GDALDriverShadow*) GDALGetDriverByName( name );
7523 }
7524 
7525 
GetDriver(int i)7526 GDALDriverShadow* GetDriver( int i ) {
7527   return (GDALDriverShadow*) GDALGetDriver( i );
7528 }
7529 
7530 
Open(char const * utf8_path,GDALAccess eAccess=GA_ReadOnly)7531 GDALDatasetShadow* Open( char const* utf8_path, GDALAccess eAccess = GA_ReadOnly ) {
7532   CPLErrorReset();
7533   GDALDatasetShadow *ds = GDALOpen( utf8_path, eAccess );
7534 #ifndef SWIGPYTHON
7535   if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
7536   {
7537       if ( GDALDereferenceDataset( ds ) <= 0 )
7538           GDALClose(ds);
7539       ds = NULL;
7540   }
7541 #endif
7542   return (GDALDatasetShadow*) ds;
7543 }
7544 
7545 
OpenEx(char const * utf8_path,unsigned int nOpenFlags=0,char ** allowed_drivers=NULL,char ** open_options=NULL,char ** sibling_files=NULL)7546 GDALDatasetShadow* OpenEx( char const* utf8_path, unsigned int nOpenFlags = 0,
7547                            char** allowed_drivers = NULL, char** open_options = NULL,
7548                            char** sibling_files = NULL ) {
7549   CPLErrorReset();
7550 #ifdef SWIGPYTHON
7551   if( GetUseExceptions() )
7552       nOpenFlags |= GDAL_OF_VERBOSE_ERROR;
7553 #endif
7554   GDALDatasetShadow *ds = GDALOpenEx( utf8_path, nOpenFlags, allowed_drivers,
7555                                       open_options, sibling_files );
7556 #ifndef SWIGPYTHON
7557   if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
7558   {
7559       if ( GDALDereferenceDataset( ds ) <= 0 )
7560           GDALClose(ds);
7561       ds = NULL;
7562   }
7563 #endif
7564   return (GDALDatasetShadow*) ds;
7565 }
7566 
7567 
OpenShared(char const * utf8_path,GDALAccess eAccess=GA_ReadOnly)7568 GDALDatasetShadow* OpenShared( char const* utf8_path, GDALAccess eAccess = GA_ReadOnly ) {
7569   CPLErrorReset();
7570   GDALDatasetShadow *ds = GDALOpenShared( utf8_path, eAccess );
7571 #ifndef SWIGPYTHON
7572   if( ds != NULL && CPLGetLastErrorType() == CE_Failure )
7573   {
7574       if ( GDALDereferenceDataset( ds ) <= 0 )
7575           GDALClose(ds);
7576       ds = NULL;
7577   }
7578 #endif
7579   return (GDALDatasetShadow*) ds;
7580 }
7581 
7582 
IdentifyDriver(const char * utf8_path,char ** papszSiblings=NULL)7583 GDALDriverShadow *IdentifyDriver( const char *utf8_path,
7584                                   char **papszSiblings = NULL ) {
7585     return (GDALDriverShadow *) GDALIdentifyDriver( utf8_path,
7586 	                                            papszSiblings );
7587 }
7588 
7589 
IdentifyDriverEx(const char * utf8_path,unsigned int nIdentifyFlags=0,char ** allowed_drivers=NULL,char ** sibling_files=NULL)7590 GDALDriverShadow *IdentifyDriverEx( const char* utf8_path,
7591                                     unsigned int nIdentifyFlags = 0,
7592                                     char** allowed_drivers = NULL,
7593                                     char** sibling_files = NULL )
7594 {
7595     return  (GDALDriverShadow *) GDALIdentifyDriverEx( utf8_path,
7596                                                 nIdentifyFlags,
7597                                                 allowed_drivers,
7598                                                 sibling_files );
7599 }
7600 
7601 
GeneralCmdLineProcessor(char ** papszArgv,int nOptions=0)7602   char **GeneralCmdLineProcessor( char **papszArgv, int nOptions = 0 ) {
7603     int nResArgCount;
7604 
7605     if( papszArgv == NULL )
7606         return NULL;
7607 
7608     bool bReloadDrivers = ( CSLFindString(papszArgv, "GDAL_SKIP") >= 0 ||
7609                             CSLFindString(papszArgv, "OGR_SKIP") >= 0 );
7610 
7611     nResArgCount =
7612       GDALGeneralCmdLineProcessor( CSLCount(papszArgv), &papszArgv, nOptions );
7613 
7614     if( bReloadDrivers )
7615     {
7616         GDALAllRegister();
7617     }
7618 
7619     if( nResArgCount <= 0 )
7620         return NULL;
7621     else
7622         return papszArgv;
7623   }
7624 
7625 
7626 #include "gdal_utils.h"
7627 
7628 
7629 
7630 #include <vector>
7631 
7632 class ErrorStruct
7633 {
7634   public:
7635     CPLErr type;
7636     CPLErrorNum no;
7637     char* msg;
7638 
7639     ErrorStruct() = delete;
ErrorStruct(CPLErr eErrIn,CPLErrorNum noIn,const char * msgIn)7640     ErrorStruct(CPLErr eErrIn, CPLErrorNum noIn, const char* msgIn) :
7641         type(eErrIn), no(noIn), msg(msgIn ? CPLStrdup(msgIn) : nullptr) {}
ErrorStruct(const ErrorStruct & other)7642     ErrorStruct(const ErrorStruct& other):
7643         type(other.type), no(other.no),
7644         msg(other.msg ? CPLStrdup(other.msg) : nullptr) {}
~ErrorStruct()7645     ~ErrorStruct() { CPLFree(msg); }
7646 };
7647 
StackingErrorHandler(CPLErr eErr,CPLErrorNum no,const char * msg)7648 static void CPL_STDCALL StackingErrorHandler( CPLErr eErr, CPLErrorNum no,
7649                                            const char* msg )
7650 {
7651     std::vector<ErrorStruct>* paoErrors =
7652         static_cast<std::vector<ErrorStruct> *>(
7653             CPLGetErrorHandlerUserData());
7654     paoErrors->emplace_back(eErr, no, msg);
7655 }
7656 
PushStackingErrorHandler(std::vector<ErrorStruct> * paoErrors)7657 static void PushStackingErrorHandler(std::vector<ErrorStruct>* paoErrors)
7658 {
7659     CPLPushErrorHandlerEx(StackingErrorHandler, paoErrors);
7660 }
7661 
PopStackingErrorHandler(std::vector<ErrorStruct> * paoErrors,bool bSuccess)7662 static void PopStackingErrorHandler(std::vector<ErrorStruct>* paoErrors, bool bSuccess)
7663 {
7664     CPLPopErrorHandler();
7665 
7666     // If the operation was successful, do not emit regular CPLError()
7667     // that would be caught by the PythonBindingErrorHandler and turned into
7668     // Python exceptions. Just emit them with the previous error handler
7669     if( bSuccess )
7670     {
7671         for( size_t iError = 0; iError < paoErrors->size(); ++iError )
7672         {
7673             pfnPreviousHandler( (*paoErrors)[iError].type,
7674                     (*paoErrors)[iError].no,
7675                     (*paoErrors)[iError].msg );
7676         }
7677 
7678         CPLErrorReset();
7679     }
7680     else
7681     {
7682         for( size_t iError = 0; iError < paoErrors->size(); ++iError )
7683         {
7684             CPLError( (*paoErrors)[iError].type,
7685                     (*paoErrors)[iError].no,
7686                     "%s",
7687                     (*paoErrors)[iError].msg );
7688         }
7689     }
7690 }
7691 
new_GDALInfoOptions(char ** options)7692 SWIGINTERN GDALInfoOptions *new_GDALInfoOptions(char **options){
7693         return GDALInfoOptionsNew(options, NULL);
7694     }
delete_GDALInfoOptions(GDALInfoOptions * self)7695 SWIGINTERN void delete_GDALInfoOptions(GDALInfoOptions *self){
7696         GDALInfoOptionsFree( self );
7697     }
new_GDALMultiDimInfoOptions(char ** options)7698 SWIGINTERN GDALMultiDimInfoOptions *new_GDALMultiDimInfoOptions(char **options){
7699         return GDALMultiDimInfoOptionsNew(options, NULL);
7700     }
delete_GDALMultiDimInfoOptions(GDALMultiDimInfoOptions * self)7701 SWIGINTERN void delete_GDALMultiDimInfoOptions(GDALMultiDimInfoOptions *self){
7702         GDALMultiDimInfoOptionsFree( self );
7703     }
new_GDALTranslateOptions(char ** options)7704 SWIGINTERN GDALTranslateOptions *new_GDALTranslateOptions(char **options){
7705         return GDALTranslateOptionsNew(options, NULL);
7706     }
delete_GDALTranslateOptions(GDALTranslateOptions * self)7707 SWIGINTERN void delete_GDALTranslateOptions(GDALTranslateOptions *self){
7708         GDALTranslateOptionsFree( self );
7709     }
7710 
wrapper_GDALTranslate(const char * dest,GDALDatasetShadow * dataset,GDALTranslateOptions * translateOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)7711 GDALDatasetShadow* wrapper_GDALTranslate( const char* dest,
7712                                       GDALDatasetShadow* dataset,
7713                                       GDALTranslateOptions* translateOptions,
7714                                       GDALProgressFunc callback=NULL,
7715                                       void* callback_data=NULL)
7716 {
7717     int usageError; /* ignored */
7718     bool bFreeOptions = false;
7719     if( callback )
7720     {
7721         if( translateOptions == NULL )
7722         {
7723             bFreeOptions = true;
7724             translateOptions = GDALTranslateOptionsNew(NULL, NULL);
7725         }
7726         GDALTranslateOptionsSetProgress(translateOptions, callback, callback_data);
7727     }
7728 #ifdef SWIGPYTHON
7729     std::vector<ErrorStruct> aoErrors;
7730     if( bUseExceptions )
7731     {
7732         PushStackingErrorHandler(&aoErrors);
7733     }
7734 #endif
7735     GDALDatasetH hDSRet = GDALTranslate(dest, dataset, translateOptions, &usageError);
7736     if( bFreeOptions )
7737         GDALTranslateOptionsFree(translateOptions);
7738 #ifdef SWIGPYTHON
7739     if( bUseExceptions )
7740     {
7741         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
7742     }
7743 #endif
7744     return hDSRet;
7745 }
7746 
new_GDALWarpAppOptions(char ** options)7747 SWIGINTERN GDALWarpAppOptions *new_GDALWarpAppOptions(char **options){
7748         return GDALWarpAppOptionsNew(options, NULL);
7749     }
delete_GDALWarpAppOptions(GDALWarpAppOptions * self)7750 SWIGINTERN void delete_GDALWarpAppOptions(GDALWarpAppOptions *self){
7751         GDALWarpAppOptionsFree( self );
7752     }
7753 
7754 
wrapper_GDALWarpDestDS(GDALDatasetShadow * dstDS,int object_list_count,GDALDatasetShadow ** poObjects,GDALWarpAppOptions * warpAppOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)7755 int wrapper_GDALWarpDestDS( GDALDatasetShadow* dstDS,
7756                             int object_list_count, GDALDatasetShadow** poObjects,
7757                             GDALWarpAppOptions* warpAppOptions,
7758                             GDALProgressFunc callback=NULL,
7759                             void* callback_data=NULL)
7760 {
7761     int usageError; /* ignored */
7762     bool bFreeOptions = false;
7763     if( callback )
7764     {
7765         if( warpAppOptions == NULL )
7766         {
7767             bFreeOptions = true;
7768             warpAppOptions = GDALWarpAppOptionsNew(NULL, NULL);
7769         }
7770         GDALWarpAppOptionsSetProgress(warpAppOptions, callback, callback_data);
7771     }
7772 #ifdef SWIGPYTHON
7773     std::vector<ErrorStruct> aoErrors;
7774     if( bUseExceptions )
7775     {
7776         PushStackingErrorHandler(&aoErrors);
7777     }
7778 #endif
7779     bool bRet = (GDALWarp(NULL, dstDS, object_list_count, poObjects, warpAppOptions, &usageError) != NULL);
7780     if( bFreeOptions )
7781         GDALWarpAppOptionsFree(warpAppOptions);
7782 #ifdef SWIGPYTHON
7783     if( bUseExceptions )
7784     {
7785         PopStackingErrorHandler(&aoErrors, bRet);
7786     }
7787 #endif
7788     return bRet;
7789 }
7790 
7791 
wrapper_GDALWarpDestName(const char * dest,int object_list_count,GDALDatasetShadow ** poObjects,GDALWarpAppOptions * warpAppOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)7792 GDALDatasetShadow* wrapper_GDALWarpDestName( const char* dest,
7793                                              int object_list_count, GDALDatasetShadow** poObjects,
7794                                              GDALWarpAppOptions* warpAppOptions,
7795                                              GDALProgressFunc callback=NULL,
7796                                              void* callback_data=NULL)
7797 {
7798     int usageError; /* ignored */
7799     bool bFreeOptions = false;
7800     if( callback )
7801     {
7802         if( warpAppOptions == NULL )
7803         {
7804             bFreeOptions = true;
7805             warpAppOptions = GDALWarpAppOptionsNew(NULL, NULL);
7806         }
7807         GDALWarpAppOptionsSetProgress(warpAppOptions, callback, callback_data);
7808     }
7809 #ifdef SWIGPYTHON
7810     std::vector<ErrorStruct> aoErrors;
7811     if( bUseExceptions )
7812     {
7813         PushStackingErrorHandler(&aoErrors);
7814     }
7815 #endif
7816     GDALDatasetH hDSRet = GDALWarp(dest, NULL, object_list_count, poObjects, warpAppOptions, &usageError);
7817     if( bFreeOptions )
7818         GDALWarpAppOptionsFree(warpAppOptions);
7819 #ifdef SWIGPYTHON
7820     if( bUseExceptions )
7821     {
7822         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
7823     }
7824 #endif
7825     return hDSRet;
7826 }
7827 
new_GDALVectorTranslateOptions(char ** options)7828 SWIGINTERN GDALVectorTranslateOptions *new_GDALVectorTranslateOptions(char **options){
7829         return GDALVectorTranslateOptionsNew(options, NULL);
7830     }
delete_GDALVectorTranslateOptions(GDALVectorTranslateOptions * self)7831 SWIGINTERN void delete_GDALVectorTranslateOptions(GDALVectorTranslateOptions *self){
7832         GDALVectorTranslateOptionsFree( self );
7833     }
7834 
wrapper_GDALVectorTranslateDestDS(GDALDatasetShadow * dstDS,GDALDatasetShadow * srcDS,GDALVectorTranslateOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)7835 int wrapper_GDALVectorTranslateDestDS( GDALDatasetShadow* dstDS,
7836                                        GDALDatasetShadow* srcDS,
7837                             GDALVectorTranslateOptions* options,
7838                             GDALProgressFunc callback=NULL,
7839                             void* callback_data=NULL)
7840 {
7841     int usageError; /* ignored */
7842     bool bFreeOptions = false;
7843     if( callback )
7844     {
7845         if( options == NULL )
7846         {
7847             bFreeOptions = true;
7848             options = GDALVectorTranslateOptionsNew(NULL, NULL);
7849         }
7850         GDALVectorTranslateOptionsSetProgress(options, callback, callback_data);
7851     }
7852 #ifdef SWIGPYTHON
7853     std::vector<ErrorStruct> aoErrors;
7854     if( bUseExceptions )
7855     {
7856         PushStackingErrorHandler(&aoErrors);
7857     }
7858 #endif
7859     bool bRet = (GDALVectorTranslate(NULL, dstDS, 1, &srcDS, options, &usageError) != NULL);
7860     if( bFreeOptions )
7861         GDALVectorTranslateOptionsFree(options);
7862 #ifdef SWIGPYTHON
7863     if( bUseExceptions )
7864     {
7865         PopStackingErrorHandler(&aoErrors, bRet);
7866     }
7867 #endif
7868     return bRet;
7869 }
7870 
7871 
wrapper_GDALVectorTranslateDestName(const char * dest,GDALDatasetShadow * srcDS,GDALVectorTranslateOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)7872 GDALDatasetShadow* wrapper_GDALVectorTranslateDestName( const char* dest,
7873                                              GDALDatasetShadow* srcDS,
7874                                              GDALVectorTranslateOptions* options,
7875                                              GDALProgressFunc callback=NULL,
7876                                              void* callback_data=NULL)
7877 {
7878     int usageError; /* ignored */
7879     bool bFreeOptions = false;
7880     if( callback )
7881     {
7882         if( options == NULL )
7883         {
7884             bFreeOptions = true;
7885             options = GDALVectorTranslateOptionsNew(NULL, NULL);
7886         }
7887         GDALVectorTranslateOptionsSetProgress(options, callback, callback_data);
7888     }
7889 #ifdef SWIGPYTHON
7890     std::vector<ErrorStruct> aoErrors;
7891     if( bUseExceptions )
7892     {
7893         PushStackingErrorHandler(&aoErrors);
7894     }
7895 #endif
7896     GDALDatasetH hDSRet = GDALVectorTranslate(dest, NULL, 1, &srcDS, options, &usageError);
7897     if( bFreeOptions )
7898         GDALVectorTranslateOptionsFree(options);
7899 #ifdef SWIGPYTHON
7900     if( bUseExceptions )
7901     {
7902         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
7903     }
7904 #endif
7905     return hDSRet;
7906 }
7907 
new_GDALDEMProcessingOptions(char ** options)7908 SWIGINTERN GDALDEMProcessingOptions *new_GDALDEMProcessingOptions(char **options){
7909         return GDALDEMProcessingOptionsNew(options, NULL);
7910     }
delete_GDALDEMProcessingOptions(GDALDEMProcessingOptions * self)7911 SWIGINTERN void delete_GDALDEMProcessingOptions(GDALDEMProcessingOptions *self){
7912         GDALDEMProcessingOptionsFree( self );
7913     }
7914 
wrapper_GDALDEMProcessing(const char * dest,GDALDatasetShadow * dataset,const char * pszProcessing,const char * pszColorFilename,GDALDEMProcessingOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)7915 GDALDatasetShadow* wrapper_GDALDEMProcessing( const char* dest,
7916                                       GDALDatasetShadow* dataset,
7917                                       const char* pszProcessing,
7918                                       const char* pszColorFilename,
7919                                       GDALDEMProcessingOptions* options,
7920                                       GDALProgressFunc callback=NULL,
7921                                       void* callback_data=NULL)
7922 {
7923     int usageError; /* ignored */
7924     bool bFreeOptions = false;
7925     if( callback )
7926     {
7927         if( options == NULL )
7928         {
7929             bFreeOptions = true;
7930             options = GDALDEMProcessingOptionsNew(NULL, NULL);
7931         }
7932         GDALDEMProcessingOptionsSetProgress(options, callback, callback_data);
7933     }
7934 #ifdef SWIGPYTHON
7935     std::vector<ErrorStruct> aoErrors;
7936     if( bUseExceptions )
7937     {
7938         PushStackingErrorHandler(&aoErrors);
7939     }
7940 #endif
7941     GDALDatasetH hDSRet = GDALDEMProcessing(dest, dataset, pszProcessing, pszColorFilename, options, &usageError);
7942     if( bFreeOptions )
7943         GDALDEMProcessingOptionsFree(options);
7944 #ifdef SWIGPYTHON
7945     if( bUseExceptions )
7946     {
7947         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
7948     }
7949 #endif
7950     return hDSRet;
7951 }
7952 
new_GDALNearblackOptions(char ** options)7953 SWIGINTERN GDALNearblackOptions *new_GDALNearblackOptions(char **options){
7954         return GDALNearblackOptionsNew(options, NULL);
7955     }
delete_GDALNearblackOptions(GDALNearblackOptions * self)7956 SWIGINTERN void delete_GDALNearblackOptions(GDALNearblackOptions *self){
7957         GDALNearblackOptionsFree( self );
7958     }
7959 
wrapper_GDALNearblackDestDS(GDALDatasetShadow * dstDS,GDALDatasetShadow * srcDS,GDALNearblackOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)7960 int wrapper_GDALNearblackDestDS( GDALDatasetShadow* dstDS,
7961                             GDALDatasetShadow* srcDS,
7962                             GDALNearblackOptions* options,
7963                             GDALProgressFunc callback=NULL,
7964                             void* callback_data=NULL)
7965 {
7966     int usageError; /* ignored */
7967     bool bFreeOptions = false;
7968     if( callback )
7969     {
7970         if( options == NULL )
7971         {
7972             bFreeOptions = true;
7973             options = GDALNearblackOptionsNew(NULL, NULL);
7974         }
7975         GDALNearblackOptionsSetProgress(options, callback, callback_data);
7976     }
7977 #ifdef SWIGPYTHON
7978     std::vector<ErrorStruct> aoErrors;
7979     if( bUseExceptions )
7980     {
7981         PushStackingErrorHandler(&aoErrors);
7982     }
7983 #endif
7984     bool bRet = (GDALNearblack(NULL, dstDS, srcDS, options, &usageError) != NULL);
7985     if( bFreeOptions )
7986         GDALNearblackOptionsFree(options);
7987 #ifdef SWIGPYTHON
7988     if( bUseExceptions )
7989     {
7990         PopStackingErrorHandler(&aoErrors, bRet);
7991     }
7992 #endif
7993     return bRet;
7994 }
7995 
7996 
wrapper_GDALNearblackDestName(const char * dest,GDALDatasetShadow * srcDS,GDALNearblackOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)7997 GDALDatasetShadow* wrapper_GDALNearblackDestName( const char* dest,
7998                                              GDALDatasetShadow* srcDS,
7999                                              GDALNearblackOptions* options,
8000                                              GDALProgressFunc callback=NULL,
8001                                              void* callback_data=NULL)
8002 {
8003     int usageError; /* ignored */
8004     bool bFreeOptions = false;
8005     if( callback )
8006     {
8007         if( options == NULL )
8008         {
8009             bFreeOptions = true;
8010             options = GDALNearblackOptionsNew(NULL, NULL);
8011         }
8012         GDALNearblackOptionsSetProgress(options, callback, callback_data);
8013     }
8014 #ifdef SWIGPYTHON
8015     std::vector<ErrorStruct> aoErrors;
8016     if( bUseExceptions )
8017     {
8018         PushStackingErrorHandler(&aoErrors);
8019     }
8020 #endif
8021     GDALDatasetH hDSRet = GDALNearblack(dest, NULL, srcDS, options, &usageError);
8022     if( bFreeOptions )
8023         GDALNearblackOptionsFree(options);
8024 #ifdef SWIGPYTHON
8025     if( bUseExceptions )
8026     {
8027         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
8028     }
8029 #endif
8030     return hDSRet;
8031 }
8032 
new_GDALGridOptions(char ** options)8033 SWIGINTERN GDALGridOptions *new_GDALGridOptions(char **options){
8034         return GDALGridOptionsNew(options, NULL);
8035     }
delete_GDALGridOptions(GDALGridOptions * self)8036 SWIGINTERN void delete_GDALGridOptions(GDALGridOptions *self){
8037         GDALGridOptionsFree( self );
8038     }
8039 
wrapper_GDALGrid(const char * dest,GDALDatasetShadow * dataset,GDALGridOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)8040 GDALDatasetShadow* wrapper_GDALGrid( const char* dest,
8041                                       GDALDatasetShadow* dataset,
8042                                       GDALGridOptions* options,
8043                                       GDALProgressFunc callback=NULL,
8044                                       void* callback_data=NULL)
8045 {
8046     int usageError; /* ignored */
8047     bool bFreeOptions = false;
8048     if( callback )
8049     {
8050         if( options == NULL )
8051         {
8052             bFreeOptions = true;
8053             options = GDALGridOptionsNew(NULL, NULL);
8054         }
8055         GDALGridOptionsSetProgress(options, callback, callback_data);
8056     }
8057 #ifdef SWIGPYTHON
8058     std::vector<ErrorStruct> aoErrors;
8059     if( bUseExceptions )
8060     {
8061         PushStackingErrorHandler(&aoErrors);
8062     }
8063 #endif
8064     GDALDatasetH hDSRet = GDALGrid(dest, dataset, options, &usageError);
8065     if( bFreeOptions )
8066         GDALGridOptionsFree(options);
8067 #ifdef SWIGPYTHON
8068     if( bUseExceptions )
8069     {
8070         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
8071     }
8072 #endif
8073     return hDSRet;
8074 }
8075 
new_GDALRasterizeOptions(char ** options)8076 SWIGINTERN GDALRasterizeOptions *new_GDALRasterizeOptions(char **options){
8077         return GDALRasterizeOptionsNew(options, NULL);
8078     }
delete_GDALRasterizeOptions(GDALRasterizeOptions * self)8079 SWIGINTERN void delete_GDALRasterizeOptions(GDALRasterizeOptions *self){
8080         GDALRasterizeOptionsFree( self );
8081     }
8082 
wrapper_GDALRasterizeDestDS(GDALDatasetShadow * dstDS,GDALDatasetShadow * srcDS,GDALRasterizeOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)8083 int wrapper_GDALRasterizeDestDS( GDALDatasetShadow* dstDS,
8084                             GDALDatasetShadow* srcDS,
8085                             GDALRasterizeOptions* options,
8086                             GDALProgressFunc callback=NULL,
8087                             void* callback_data=NULL)
8088 {
8089     int usageError; /* ignored */
8090     bool bFreeOptions = false;
8091     if( callback )
8092     {
8093         if( options == NULL )
8094         {
8095             bFreeOptions = true;
8096             options = GDALRasterizeOptionsNew(NULL, NULL);
8097         }
8098         GDALRasterizeOptionsSetProgress(options, callback, callback_data);
8099     }
8100 #ifdef SWIGPYTHON
8101     std::vector<ErrorStruct> aoErrors;
8102     if( bUseExceptions )
8103     {
8104         PushStackingErrorHandler(&aoErrors);
8105     }
8106 #endif
8107     bool bRet = (GDALRasterize(NULL, dstDS, srcDS, options, &usageError) != NULL);
8108     if( bFreeOptions )
8109         GDALRasterizeOptionsFree(options);
8110 #ifdef SWIGPYTHON
8111     if( bUseExceptions )
8112     {
8113         PopStackingErrorHandler(&aoErrors, bRet);
8114     }
8115 #endif
8116     return bRet;
8117 }
8118 
8119 
wrapper_GDALRasterizeDestName(const char * dest,GDALDatasetShadow * srcDS,GDALRasterizeOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)8120 GDALDatasetShadow* wrapper_GDALRasterizeDestName( const char* dest,
8121                                              GDALDatasetShadow* srcDS,
8122                                              GDALRasterizeOptions* options,
8123                                              GDALProgressFunc callback=NULL,
8124                                              void* callback_data=NULL)
8125 {
8126     int usageError; /* ignored */
8127     bool bFreeOptions = false;
8128     if( callback )
8129     {
8130         if( options == NULL )
8131         {
8132             bFreeOptions = true;
8133             options = GDALRasterizeOptionsNew(NULL, NULL);
8134         }
8135         GDALRasterizeOptionsSetProgress(options, callback, callback_data);
8136     }
8137 #ifdef SWIGPYTHON
8138     std::vector<ErrorStruct> aoErrors;
8139     if( bUseExceptions )
8140     {
8141         PushStackingErrorHandler(&aoErrors);
8142     }
8143 #endif
8144     GDALDatasetH hDSRet = GDALRasterize(dest, NULL, srcDS, options, &usageError);
8145     if( bFreeOptions )
8146         GDALRasterizeOptionsFree(options);
8147 #ifdef SWIGPYTHON
8148     if( bUseExceptions )
8149     {
8150         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
8151     }
8152 #endif
8153     return hDSRet;
8154 }
8155 
new_GDALBuildVRTOptions(char ** options)8156 SWIGINTERN GDALBuildVRTOptions *new_GDALBuildVRTOptions(char **options){
8157         return GDALBuildVRTOptionsNew(options, NULL);
8158     }
delete_GDALBuildVRTOptions(GDALBuildVRTOptions * self)8159 SWIGINTERN void delete_GDALBuildVRTOptions(GDALBuildVRTOptions *self){
8160         GDALBuildVRTOptionsFree( self );
8161     }
8162 
wrapper_GDALBuildVRT_objects(const char * dest,int object_list_count,GDALDatasetShadow ** poObjects,GDALBuildVRTOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)8163 GDALDatasetShadow* wrapper_GDALBuildVRT_objects( const char* dest,
8164                                              int object_list_count, GDALDatasetShadow** poObjects,
8165                                              GDALBuildVRTOptions* options,
8166                                              GDALProgressFunc callback=NULL,
8167                                              void* callback_data=NULL)
8168 {
8169     int usageError; /* ignored */
8170     bool bFreeOptions = false;
8171     if( callback )
8172     {
8173         if( options == NULL )
8174         {
8175             bFreeOptions = true;
8176             options = GDALBuildVRTOptionsNew(NULL, NULL);
8177         }
8178         GDALBuildVRTOptionsSetProgress(options, callback, callback_data);
8179     }
8180 #ifdef SWIGPYTHON
8181     std::vector<ErrorStruct> aoErrors;
8182     if( bUseExceptions )
8183     {
8184         PushStackingErrorHandler(&aoErrors);
8185     }
8186 #endif
8187     GDALDatasetH hDSRet = GDALBuildVRT(dest, object_list_count, poObjects, NULL, options, &usageError);
8188     if( bFreeOptions )
8189         GDALBuildVRTOptionsFree(options);
8190 #ifdef SWIGPYTHON
8191     if( bUseExceptions )
8192     {
8193         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
8194     }
8195 #endif
8196     return hDSRet;
8197 }
8198 
8199 
wrapper_GDALBuildVRT_names(const char * dest,char ** source_filenames,GDALBuildVRTOptions * options,GDALProgressFunc callback=NULL,void * callback_data=NULL)8200 GDALDatasetShadow* wrapper_GDALBuildVRT_names( const char* dest,
8201                                          char ** source_filenames,
8202                                          GDALBuildVRTOptions* options,
8203                                          GDALProgressFunc callback=NULL,
8204                                          void* callback_data=NULL)
8205 {
8206     int usageError; /* ignored */
8207     bool bFreeOptions = false;
8208     if( callback )
8209     {
8210         if( options == NULL )
8211         {
8212             bFreeOptions = true;
8213             options = GDALBuildVRTOptionsNew(NULL, NULL);
8214         }
8215         GDALBuildVRTOptionsSetProgress(options, callback, callback_data);
8216     }
8217 #ifdef SWIGPYTHON
8218     std::vector<ErrorStruct> aoErrors;
8219     if( bUseExceptions )
8220     {
8221         PushStackingErrorHandler(&aoErrors);
8222     }
8223 #endif
8224     GDALDatasetH hDSRet = GDALBuildVRT(dest, CSLCount(source_filenames), NULL, source_filenames, options, &usageError);
8225     if( bFreeOptions )
8226         GDALBuildVRTOptionsFree(options);
8227 #ifdef SWIGPYTHON
8228     if( bUseExceptions )
8229     {
8230         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
8231     }
8232 #endif
8233     return hDSRet;
8234 }
8235 
new_GDALMultiDimTranslateOptions(char ** options)8236 SWIGINTERN GDALMultiDimTranslateOptions *new_GDALMultiDimTranslateOptions(char **options){
8237         return GDALMultiDimTranslateOptionsNew(options, NULL);
8238     }
delete_GDALMultiDimTranslateOptions(GDALMultiDimTranslateOptions * self)8239 SWIGINTERN void delete_GDALMultiDimTranslateOptions(GDALMultiDimTranslateOptions *self){
8240         GDALMultiDimTranslateOptionsFree( self );
8241     }
8242 
wrapper_GDALMultiDimTranslateDestName(const char * dest,int object_list_count,GDALDatasetShadow ** poObjects,GDALMultiDimTranslateOptions * multiDimTranslateOptions,GDALProgressFunc callback=NULL,void * callback_data=NULL)8243 GDALDatasetShadow* wrapper_GDALMultiDimTranslateDestName( const char* dest,
8244                                              int object_list_count, GDALDatasetShadow** poObjects,
8245                                              GDALMultiDimTranslateOptions* multiDimTranslateOptions,
8246                                              GDALProgressFunc callback=NULL,
8247                                              void* callback_data=NULL)
8248 {
8249     int usageError; /* ignored */
8250     bool bFreeOptions = false;
8251     if( callback )
8252     {
8253         if( multiDimTranslateOptions == NULL )
8254         {
8255             bFreeOptions = true;
8256             multiDimTranslateOptions = GDALMultiDimTranslateOptionsNew(NULL, NULL);
8257         }
8258         GDALMultiDimTranslateOptionsSetProgress(multiDimTranslateOptions, callback, callback_data);
8259     }
8260 #ifdef SWIGPYTHON
8261     std::vector<ErrorStruct> aoErrors;
8262     if( bUseExceptions )
8263     {
8264         PushStackingErrorHandler(&aoErrors);
8265     }
8266 #endif
8267     GDALDatasetH hDSRet = GDALMultiDimTranslate(dest, NULL, object_list_count, poObjects, multiDimTranslateOptions, &usageError);
8268     if( bFreeOptions )
8269         GDALMultiDimTranslateOptionsFree(multiDimTranslateOptions);
8270 #ifdef SWIGPYTHON
8271     if( bUseExceptions )
8272     {
8273         PopStackingErrorHandler(&aoErrors, hDSRet != NULL);
8274     }
8275 #endif
8276     return hDSRet;
8277 }
8278 
8279 #ifdef __cplusplus
8280 extern "C" {
8281 #endif
_wrap_GetUseExceptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8282 SWIGINTERN PyObject *_wrap_GetUseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8283   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8284   int result;
8285 
8286   if (!PyArg_ParseTuple(args,(char *)":GetUseExceptions")) SWIG_fail;
8287   {
8288     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8289     result = (int)GetUseExceptions();
8290     SWIG_PYTHON_THREAD_END_ALLOW;
8291   }
8292   resultobj = SWIG_From_int(static_cast< int >(result));
8293   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8294   return resultobj;
8295 fail:
8296   return NULL;
8297 }
8298 
8299 
_wrap_UseExceptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8300 SWIGINTERN PyObject *_wrap_UseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8301   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8302 
8303   if (!PyArg_ParseTuple(args,(char *)":UseExceptions")) SWIG_fail;
8304   {
8305     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8306     UseExceptions();
8307     SWIG_PYTHON_THREAD_END_ALLOW;
8308   }
8309   resultobj = SWIG_Py_Void();
8310   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8311   return resultobj;
8312 fail:
8313   return NULL;
8314 }
8315 
8316 
_wrap_DontUseExceptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8317 SWIGINTERN PyObject *_wrap_DontUseExceptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8318   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8319 
8320   if (!PyArg_ParseTuple(args,(char *)":DontUseExceptions")) SWIG_fail;
8321   {
8322     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8323     DontUseExceptions();
8324     SWIG_PYTHON_THREAD_END_ALLOW;
8325   }
8326   resultobj = SWIG_Py_Void();
8327   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8328   return resultobj;
8329 fail:
8330   return NULL;
8331 }
8332 
8333 
_wrap_VSIFReadL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8334 SWIGINTERN PyObject *_wrap_VSIFReadL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8335   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8336   void **arg1 = (void **) 0 ;
8337   unsigned int arg2 ;
8338   unsigned int arg3 ;
8339   VSILFILE *arg4 = (VSILFILE *) 0 ;
8340   void *pyObject1 = NULL ;
8341   unsigned int val2 ;
8342   int ecode2 = 0 ;
8343   unsigned int val3 ;
8344   int ecode3 = 0 ;
8345   void *argp4 = 0 ;
8346   int res4 = 0 ;
8347   PyObject * obj0 = 0 ;
8348   PyObject * obj1 = 0 ;
8349   PyObject * obj2 = 0 ;
8350   unsigned int result;
8351 
8352   {
8353     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject1 = NULL ) */
8354     arg1 = &pyObject1;
8355   }
8356   if (!PyArg_ParseTuple(args,(char *)"OOO:VSIFReadL",&obj0,&obj1,&obj2)) SWIG_fail;
8357   ecode2 = SWIG_AsVal_unsigned_SS_int(obj0, &val2);
8358   if (!SWIG_IsOK(ecode2)) {
8359     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VSIFReadL" "', argument " "2"" of type '" "unsigned int""'");
8360   }
8361   arg2 = static_cast< unsigned int >(val2);
8362   ecode3 = SWIG_AsVal_unsigned_SS_int(obj1, &val3);
8363   if (!SWIG_IsOK(ecode3)) {
8364     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VSIFReadL" "', argument " "3"" of type '" "unsigned int""'");
8365   }
8366   arg3 = static_cast< unsigned int >(val3);
8367   res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_VSILFILE, 0 |  0 );
8368   if (!SWIG_IsOK(res4)) {
8369     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VSIFReadL" "', argument " "4"" of type '" "VSILFILE *""'");
8370   }
8371   arg4 = reinterpret_cast< VSILFILE * >(argp4);
8372   {
8373     if (!arg4) {
8374       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8375     }
8376   }
8377   {
8378     if ( bUseExceptions ) {
8379       ClearErrorState();
8380     }
8381     {
8382       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8383       result = (unsigned int)wrapper_VSIFReadL(arg1,arg2,arg3,arg4);
8384       SWIG_PYTHON_THREAD_END_ALLOW;
8385     }
8386 #ifndef SED_HACKS
8387     if ( bUseExceptions ) {
8388       CPLErr eclass = CPLGetLastErrorType();
8389       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8390         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8391       }
8392     }
8393 #endif
8394   }
8395   resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
8396   {
8397     /* %typemap(argout) ( void **outPythonObject ) */
8398     Py_XDECREF(resultobj);
8399     if (*arg1)
8400     {
8401       resultobj = (PyObject*)*arg1;
8402     }
8403     else
8404     {
8405       resultobj = Py_None;
8406       Py_INCREF(resultobj);
8407     }
8408   }
8409   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8410   return resultobj;
8411 fail:
8412   return NULL;
8413 }
8414 
8415 
_wrap_VSIGetMemFileBuffer_unsafe(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8416 SWIGINTERN PyObject *_wrap_VSIGetMemFileBuffer_unsafe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8417   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8418   char *arg1 = (char *) 0 ;
8419   GByte **arg2 = (GByte **) 0 ;
8420   vsi_l_offset *arg3 = (vsi_l_offset *) 0 ;
8421   int bToFree1 = 0 ;
8422   GByte *out2 = NULL ;
8423   vsi_l_offset length2 ;
8424   PyObject * obj0 = 0 ;
8425 
8426   {
8427     arg2 = &out2;
8428     arg3 = &length2;
8429   }
8430   if (!PyArg_ParseTuple(args,(char *)"O:VSIGetMemFileBuffer_unsafe",&obj0)) SWIG_fail;
8431   {
8432     /* %typemap(in) (const char *utf8_path) */
8433     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
8434     if (arg1 == NULL)
8435     {
8436       PyErr_SetString( PyExc_RuntimeError, "not a string" );
8437       SWIG_fail;
8438     }
8439   }
8440   {
8441     if ( bUseExceptions ) {
8442       ClearErrorState();
8443     }
8444     {
8445       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8446       wrapper_VSIGetMemFileBuffer((char const *)arg1,arg2,arg3);
8447       SWIG_PYTHON_THREAD_END_ALLOW;
8448     }
8449 #ifndef SED_HACKS
8450     if ( bUseExceptions ) {
8451       CPLErr eclass = CPLGetLastErrorType();
8452       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8453         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8454       }
8455     }
8456 #endif
8457   }
8458   resultobj = SWIG_Py_Void();
8459   {
8460     if (*arg2 == NULL) {
8461       if( bUseExceptions ) {
8462         PyErr_SetString(PyExc_RuntimeError, "Could not find path");
8463         resultobj = NULL;
8464       } else {
8465         CPLError(CE_Failure, CPLE_AppDefined, "Could not find path");
8466         resultobj = Py_None;
8467         Py_INCREF(resultobj);
8468       }
8469     } else {
8470       do {
8471         resultobj = PyMemoryView_FromMemory(reinterpret_cast<char *>(*arg2), *arg3, PyBUF_READ);
8472         if (resultobj == NULL) {
8473           if( bUseExceptions ) {
8474             PyErr_SetString(PyExc_RuntimeError, "Could not allocate result buffer");
8475             resultobj = NULL;
8476           } else {
8477             CPLError(CE_Failure, CPLE_AppDefined, "Could not allocate result buffer");
8478             resultobj = Py_None;
8479             Py_INCREF(resultobj);
8480           }
8481         }
8482       } while(0);
8483     }
8484   }
8485   {
8486     /* %typemap(freearg) (const char *utf8_path) */
8487     GDALPythonFreeCStr(arg1, bToFree1);
8488   }
8489   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8490   return resultobj;
8491 fail:
8492   {
8493     /* %typemap(freearg) (const char *utf8_path) */
8494     GDALPythonFreeCStr(arg1, bToFree1);
8495   }
8496   return NULL;
8497 }
8498 
8499 
_wrap_Debug(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8500 SWIGINTERN PyObject *_wrap_Debug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8501   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8502   char *arg1 = (char *) 0 ;
8503   char *arg2 = (char *) 0 ;
8504   int res1 ;
8505   char *buf1 = 0 ;
8506   int alloc1 = 0 ;
8507   int res2 ;
8508   char *buf2 = 0 ;
8509   int alloc2 = 0 ;
8510   PyObject * obj0 = 0 ;
8511   PyObject * obj1 = 0 ;
8512 
8513   if (!PyArg_ParseTuple(args,(char *)"OO:Debug",&obj0,&obj1)) SWIG_fail;
8514   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
8515   if (!SWIG_IsOK(res1)) {
8516     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Debug" "', argument " "1"" of type '" "char const *""'");
8517   }
8518   arg1 = reinterpret_cast< char * >(buf1);
8519   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
8520   if (!SWIG_IsOK(res2)) {
8521     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Debug" "', argument " "2"" of type '" "char const *""'");
8522   }
8523   arg2 = reinterpret_cast< char * >(buf2);
8524   {
8525     if (!arg2) {
8526       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8527     }
8528   }
8529   {
8530     if ( bUseExceptions ) {
8531       ClearErrorState();
8532     }
8533     {
8534       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8535       Debug((char const *)arg1,(char const *)arg2);
8536       SWIG_PYTHON_THREAD_END_ALLOW;
8537     }
8538 #ifndef SED_HACKS
8539     if ( bUseExceptions ) {
8540       CPLErr eclass = CPLGetLastErrorType();
8541       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8542         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8543       }
8544     }
8545 #endif
8546   }
8547   resultobj = SWIG_Py_Void();
8548   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
8549   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8550   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8551   return resultobj;
8552 fail:
8553   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
8554   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8555   return NULL;
8556 }
8557 
8558 
_wrap_SetErrorHandler(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8559 SWIGINTERN PyObject *_wrap_SetErrorHandler(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8560   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8561   CPLErrorHandler arg1 = (CPLErrorHandler) NULL ;
8562   void *arg2 = (void *) NULL ;
8563   PyObject * obj0 = 0 ;
8564   CPLErr result;
8565 
8566   if (!PyArg_ParseTuple(args,(char *)"|O:SetErrorHandler",&obj0)) SWIG_fail;
8567   if (obj0) {
8568     {
8569       /* %typemap(in) (CPLErrorHandler pfnErrorHandler = NULL, void* user_data = NULL) */
8570       int alloc = 0;
8571       char* pszCallbackName = NULL;
8572       arg2 = NULL;
8573       if( SWIG_IsOK(SWIG_AsCharPtrAndSize(obj0, &pszCallbackName, NULL, &alloc)) )
8574       {
8575         if( pszCallbackName == NULL || EQUAL(pszCallbackName,"CPLQuietErrorHandler") )
8576         arg1 = CPLQuietErrorHandler;
8577         else if( EQUAL(pszCallbackName,"CPLDefaultErrorHandler") )
8578         arg1 = CPLDefaultErrorHandler;
8579         else if( EQUAL(pszCallbackName,"CPLLoggingErrorHandler") )
8580         arg1 = CPLLoggingErrorHandler;
8581         else
8582         {
8583           if (alloc == SWIG_NEWOBJ) delete[] pszCallbackName;
8584           PyErr_SetString( PyExc_RuntimeError, "Unhandled value for passed string" );
8585           SWIG_fail;
8586         }
8587 
8588         if (alloc == SWIG_NEWOBJ) delete[] pszCallbackName;
8589       }
8590       else if (!PyCallable_Check(obj0))
8591       {
8592         PyErr_SetString( PyExc_RuntimeError,
8593           "Object given is not a String or a Python function" );
8594         SWIG_fail;
8595       }
8596       else
8597       {
8598         Py_INCREF(obj0);
8599         arg1 = PyCPLErrorHandler;
8600         arg2 = obj0;
8601       }
8602     }
8603   }
8604   {
8605     if ( bUseExceptions ) {
8606       ClearErrorState();
8607     }
8608     {
8609       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8610       CPL_IGNORE_RET_VAL(result = (CPLErr)SetErrorHandler(arg1,arg2));
8611       SWIG_PYTHON_THREAD_END_ALLOW;
8612     }
8613 #ifndef SED_HACKS
8614     if ( bUseExceptions ) {
8615       CPLErr eclass = CPLGetLastErrorType();
8616       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8617         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8618       }
8619     }
8620 #endif
8621   }
8622   resultobj = SWIG_From_int(static_cast< int >(result));
8623   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8624   return resultobj;
8625 fail:
8626   return NULL;
8627 }
8628 
8629 
_wrap_SetCurrentErrorHandlerCatchDebug(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8630 SWIGINTERN PyObject *_wrap_SetCurrentErrorHandlerCatchDebug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8631   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8632   int arg1 ;
8633   int val1 ;
8634   int ecode1 = 0 ;
8635   PyObject * obj0 = 0 ;
8636 
8637   if (!PyArg_ParseTuple(args,(char *)"O:SetCurrentErrorHandlerCatchDebug",&obj0)) SWIG_fail;
8638   ecode1 = SWIG_AsVal_int(obj0, &val1);
8639   if (!SWIG_IsOK(ecode1)) {
8640     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "SetCurrentErrorHandlerCatchDebug" "', argument " "1"" of type '" "int""'");
8641   }
8642   arg1 = static_cast< int >(val1);
8643   {
8644     if ( bUseExceptions ) {
8645       ClearErrorState();
8646     }
8647     {
8648       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8649       CPLSetCurrentErrorHandlerCatchDebug(arg1);
8650       SWIG_PYTHON_THREAD_END_ALLOW;
8651     }
8652 #ifndef SED_HACKS
8653     if ( bUseExceptions ) {
8654       CPLErr eclass = CPLGetLastErrorType();
8655       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8656         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8657       }
8658     }
8659 #endif
8660   }
8661   resultobj = SWIG_Py_Void();
8662   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8663   return resultobj;
8664 fail:
8665   return NULL;
8666 }
8667 
8668 
_wrap_PushErrorHandler(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8669 SWIGINTERN PyObject *_wrap_PushErrorHandler(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8670   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8671   CPLErrorHandler arg1 = (CPLErrorHandler) NULL ;
8672   void *arg2 = (void *) NULL ;
8673   PyObject * obj0 = 0 ;
8674   CPLErr result;
8675 
8676   if (!PyArg_ParseTuple(args,(char *)"|O:PushErrorHandler",&obj0)) SWIG_fail;
8677   if (obj0) {
8678     {
8679       /* %typemap(in) (CPLErrorHandler pfnErrorHandler = NULL, void* user_data = NULL) */
8680       int alloc = 0;
8681       char* pszCallbackName = NULL;
8682       arg2 = NULL;
8683       if( SWIG_IsOK(SWIG_AsCharPtrAndSize(obj0, &pszCallbackName, NULL, &alloc)) )
8684       {
8685         if( pszCallbackName == NULL || EQUAL(pszCallbackName,"CPLQuietErrorHandler") )
8686         arg1 = CPLQuietErrorHandler;
8687         else if( EQUAL(pszCallbackName,"CPLDefaultErrorHandler") )
8688         arg1 = CPLDefaultErrorHandler;
8689         else if( EQUAL(pszCallbackName,"CPLLoggingErrorHandler") )
8690         arg1 = CPLLoggingErrorHandler;
8691         else
8692         {
8693           if (alloc == SWIG_NEWOBJ) delete[] pszCallbackName;
8694           PyErr_SetString( PyExc_RuntimeError, "Unhandled value for passed string" );
8695           SWIG_fail;
8696         }
8697 
8698         if (alloc == SWIG_NEWOBJ) delete[] pszCallbackName;
8699       }
8700       else if (!PyCallable_Check(obj0))
8701       {
8702         PyErr_SetString( PyExc_RuntimeError,
8703           "Object given is not a String or a Python function" );
8704         SWIG_fail;
8705       }
8706       else
8707       {
8708         Py_INCREF(obj0);
8709         arg1 = PyCPLErrorHandler;
8710         arg2 = obj0;
8711       }
8712     }
8713   }
8714   {
8715     if ( bUseExceptions ) {
8716       ClearErrorState();
8717     }
8718     CPL_IGNORE_RET_VAL(result = (CPLErr)PushErrorHandler(arg1,arg2));
8719 #ifndef SED_HACKS
8720     if ( bUseExceptions ) {
8721       CPLErr eclass = CPLGetLastErrorType();
8722       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8723         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8724       }
8725     }
8726 #endif
8727   }
8728   resultobj = SWIG_From_int(static_cast< int >(result));
8729   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8730   return resultobj;
8731 fail:
8732   return NULL;
8733 }
8734 
8735 
_wrap_PopErrorHandler(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8736 SWIGINTERN PyObject *_wrap_PopErrorHandler(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8737   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8738 
8739   if (!PyArg_ParseTuple(args,(char *)":PopErrorHandler")) SWIG_fail;
8740   {
8741     if ( bUseExceptions ) {
8742       ClearErrorState();
8743     }
8744     PopErrorHandler();
8745 #ifndef SED_HACKS
8746     if ( bUseExceptions ) {
8747       CPLErr eclass = CPLGetLastErrorType();
8748       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8749         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8750       }
8751     }
8752 #endif
8753   }
8754   resultobj = SWIG_Py_Void();
8755   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8756   return resultobj;
8757 fail:
8758   return NULL;
8759 }
8760 
8761 
_wrap_Error(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8762 SWIGINTERN PyObject *_wrap_Error(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8763   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8764   CPLErr arg1 = (CPLErr) CE_Failure ;
8765   int arg2 = (int) 0 ;
8766   char *arg3 = (char *) "error" ;
8767   int val1 ;
8768   int ecode1 = 0 ;
8769   int val2 ;
8770   int ecode2 = 0 ;
8771   int res3 ;
8772   char *buf3 = 0 ;
8773   int alloc3 = 0 ;
8774   PyObject * obj0 = 0 ;
8775   PyObject * obj1 = 0 ;
8776   PyObject * obj2 = 0 ;
8777 
8778   if (!PyArg_ParseTuple(args,(char *)"|OOO:Error",&obj0,&obj1,&obj2)) SWIG_fail;
8779   if (obj0) {
8780     ecode1 = SWIG_AsVal_int(obj0, &val1);
8781     if (!SWIG_IsOK(ecode1)) {
8782       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "Error" "', argument " "1"" of type '" "CPLErr""'");
8783     }
8784     arg1 = static_cast< CPLErr >(val1);
8785   }
8786   if (obj1) {
8787     ecode2 = SWIG_AsVal_int(obj1, &val2);
8788     if (!SWIG_IsOK(ecode2)) {
8789       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Error" "', argument " "2"" of type '" "int""'");
8790     }
8791     arg2 = static_cast< int >(val2);
8792   }
8793   if (obj2) {
8794     res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
8795     if (!SWIG_IsOK(res3)) {
8796       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Error" "', argument " "3"" of type '" "char const *""'");
8797     }
8798     arg3 = reinterpret_cast< char * >(buf3);
8799   }
8800   {
8801     if ( bUseExceptions ) {
8802       ClearErrorState();
8803     }
8804     {
8805       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8806       Error(arg1,arg2,(char const *)arg3);
8807       SWIG_PYTHON_THREAD_END_ALLOW;
8808     }
8809 #ifndef SED_HACKS
8810     if ( bUseExceptions ) {
8811       CPLErr eclass = CPLGetLastErrorType();
8812       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8813         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8814       }
8815     }
8816 #endif
8817   }
8818   resultobj = SWIG_Py_Void();
8819   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
8820   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8821   return resultobj;
8822 fail:
8823   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
8824   return NULL;
8825 }
8826 
8827 
_wrap_GOA2GetAuthorizationURL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8828 SWIGINTERN PyObject *_wrap_GOA2GetAuthorizationURL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8829   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8830   char *arg1 = (char *) 0 ;
8831   int res1 ;
8832   char *buf1 = 0 ;
8833   int alloc1 = 0 ;
8834   PyObject * obj0 = 0 ;
8835   retStringAndCPLFree *result = 0 ;
8836 
8837   if (!PyArg_ParseTuple(args,(char *)"O:GOA2GetAuthorizationURL",&obj0)) SWIG_fail;
8838   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
8839   if (!SWIG_IsOK(res1)) {
8840     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GOA2GetAuthorizationURL" "', argument " "1"" of type '" "char const *""'");
8841   }
8842   arg1 = reinterpret_cast< char * >(buf1);
8843   {
8844     if (!arg1) {
8845       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8846     }
8847   }
8848   {
8849     if ( bUseExceptions ) {
8850       ClearErrorState();
8851     }
8852     {
8853       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8854       result = (retStringAndCPLFree *)GOA2GetAuthorizationURL((char const *)arg1);
8855       SWIG_PYTHON_THREAD_END_ALLOW;
8856     }
8857 #ifndef SED_HACKS
8858     if ( bUseExceptions ) {
8859       CPLErr eclass = CPLGetLastErrorType();
8860       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8861         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8862       }
8863     }
8864 #endif
8865   }
8866   {
8867     /* %typemap(out) (retStringAndCPLFree*) */
8868     Py_XDECREF(resultobj);
8869     if(result)
8870     {
8871       resultobj = GDALPythonObjectFromCStr( (const char *)result);
8872       CPLFree(result);
8873     }
8874     else
8875     {
8876       resultobj = Py_None;
8877       Py_INCREF(resultobj);
8878     }
8879   }
8880   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
8881   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8882   return resultobj;
8883 fail:
8884   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
8885   return NULL;
8886 }
8887 
8888 
_wrap_GOA2GetRefreshToken(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8889 SWIGINTERN PyObject *_wrap_GOA2GetRefreshToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8890   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8891   char *arg1 = (char *) 0 ;
8892   char *arg2 = (char *) 0 ;
8893   int res1 ;
8894   char *buf1 = 0 ;
8895   int alloc1 = 0 ;
8896   int res2 ;
8897   char *buf2 = 0 ;
8898   int alloc2 = 0 ;
8899   PyObject * obj0 = 0 ;
8900   PyObject * obj1 = 0 ;
8901   retStringAndCPLFree *result = 0 ;
8902 
8903   if (!PyArg_ParseTuple(args,(char *)"OO:GOA2GetRefreshToken",&obj0,&obj1)) SWIG_fail;
8904   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
8905   if (!SWIG_IsOK(res1)) {
8906     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GOA2GetRefreshToken" "', argument " "1"" of type '" "char const *""'");
8907   }
8908   arg1 = reinterpret_cast< char * >(buf1);
8909   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
8910   if (!SWIG_IsOK(res2)) {
8911     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GOA2GetRefreshToken" "', argument " "2"" of type '" "char const *""'");
8912   }
8913   arg2 = reinterpret_cast< char * >(buf2);
8914   {
8915     if (!arg1) {
8916       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8917     }
8918   }
8919   {
8920     if ( bUseExceptions ) {
8921       ClearErrorState();
8922     }
8923     {
8924       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8925       result = (retStringAndCPLFree *)GOA2GetRefreshToken((char const *)arg1,(char const *)arg2);
8926       SWIG_PYTHON_THREAD_END_ALLOW;
8927     }
8928 #ifndef SED_HACKS
8929     if ( bUseExceptions ) {
8930       CPLErr eclass = CPLGetLastErrorType();
8931       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
8932         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
8933       }
8934     }
8935 #endif
8936   }
8937   {
8938     /* %typemap(out) (retStringAndCPLFree*) */
8939     Py_XDECREF(resultobj);
8940     if(result)
8941     {
8942       resultobj = GDALPythonObjectFromCStr( (const char *)result);
8943       CPLFree(result);
8944     }
8945     else
8946     {
8947       resultobj = Py_None;
8948       Py_INCREF(resultobj);
8949     }
8950   }
8951   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
8952   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8953   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
8954   return resultobj;
8955 fail:
8956   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
8957   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
8958   return NULL;
8959 }
8960 
8961 
_wrap_GOA2GetAccessToken(PyObject * SWIGUNUSEDPARM (self),PyObject * args)8962 SWIGINTERN PyObject *_wrap_GOA2GetAccessToken(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8963   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
8964   char *arg1 = (char *) 0 ;
8965   char *arg2 = (char *) 0 ;
8966   int res1 ;
8967   char *buf1 = 0 ;
8968   int alloc1 = 0 ;
8969   int res2 ;
8970   char *buf2 = 0 ;
8971   int alloc2 = 0 ;
8972   PyObject * obj0 = 0 ;
8973   PyObject * obj1 = 0 ;
8974   retStringAndCPLFree *result = 0 ;
8975 
8976   if (!PyArg_ParseTuple(args,(char *)"OO:GOA2GetAccessToken",&obj0,&obj1)) SWIG_fail;
8977   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
8978   if (!SWIG_IsOK(res1)) {
8979     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GOA2GetAccessToken" "', argument " "1"" of type '" "char const *""'");
8980   }
8981   arg1 = reinterpret_cast< char * >(buf1);
8982   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
8983   if (!SWIG_IsOK(res2)) {
8984     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GOA2GetAccessToken" "', argument " "2"" of type '" "char const *""'");
8985   }
8986   arg2 = reinterpret_cast< char * >(buf2);
8987   {
8988     if (!arg1) {
8989       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
8990     }
8991   }
8992   {
8993     if ( bUseExceptions ) {
8994       ClearErrorState();
8995     }
8996     {
8997       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
8998       result = (retStringAndCPLFree *)GOA2GetAccessToken((char const *)arg1,(char const *)arg2);
8999       SWIG_PYTHON_THREAD_END_ALLOW;
9000     }
9001 #ifndef SED_HACKS
9002     if ( bUseExceptions ) {
9003       CPLErr eclass = CPLGetLastErrorType();
9004       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9005         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9006       }
9007     }
9008 #endif
9009   }
9010   {
9011     /* %typemap(out) (retStringAndCPLFree*) */
9012     Py_XDECREF(resultobj);
9013     if(result)
9014     {
9015       resultobj = GDALPythonObjectFromCStr( (const char *)result);
9016       CPLFree(result);
9017     }
9018     else
9019     {
9020       resultobj = Py_None;
9021       Py_INCREF(resultobj);
9022     }
9023   }
9024   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
9025   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9026   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9027   return resultobj;
9028 fail:
9029   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
9030   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9031   return NULL;
9032 }
9033 
9034 
_wrap_ErrorReset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9035 SWIGINTERN PyObject *_wrap_ErrorReset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9036   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9037 
9038   if (!PyArg_ParseTuple(args,(char *)":ErrorReset")) SWIG_fail;
9039   {
9040     if ( bUseExceptions ) {
9041       ClearErrorState();
9042     }
9043     {
9044       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9045       CPLErrorReset();
9046       SWIG_PYTHON_THREAD_END_ALLOW;
9047     }
9048 #ifndef SED_HACKS
9049     if ( bUseExceptions ) {
9050       CPLErr eclass = CPLGetLastErrorType();
9051       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9052         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9053       }
9054     }
9055 #endif
9056   }
9057   resultobj = SWIG_Py_Void();
9058   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9059   return resultobj;
9060 fail:
9061   return NULL;
9062 }
9063 
9064 
_wrap_EscapeString(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)9065 SWIGINTERN PyObject *_wrap_EscapeString(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
9066   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9067   int arg1 ;
9068   char *arg2 = (char *) 0 ;
9069   int arg3 = (int) CPLES_SQL ;
9070   int alloc1 = 0 ;
9071   bool viewIsValid1 = false ;
9072   Py_buffer view1 ;
9073   int val3 ;
9074   int ecode3 = 0 ;
9075   PyObject * obj0 = 0 ;
9076   PyObject * obj1 = 0 ;
9077   char *  kwnames[] = {
9078     (char *) "len",(char *) "scheme", NULL
9079   };
9080   retStringAndCPLFree *result = 0 ;
9081 
9082   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:EscapeString",kwnames,&obj0,&obj1)) SWIG_fail;
9083   {
9084     /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
9085     {
9086       if (PyObject_GetBuffer(obj0, &view1, PyBUF_SIMPLE) == 0)
9087       {
9088         if( view1.len > INT_MAX ) {
9089           PyBuffer_Release(&view1);
9090           SWIG_exception( SWIG_RuntimeError, "too large buffer (>2GB)" );
9091         }
9092         viewIsValid1 = true;
9093         arg1 = (int) view1.len;
9094         arg2 = (char *) view1.buf;
9095         goto ok;
9096       }
9097       else
9098       {
9099         PyErr_Clear();
9100       }
9101     }
9102     if (PyUnicode_Check(obj0))
9103     {
9104       size_t safeLen = 0;
9105       int ret = SWIG_AsCharPtrAndSize(obj0, (char**) &arg2, &safeLen, &alloc1);
9106       if (!SWIG_IsOK(ret)) {
9107         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
9108       }
9109 
9110       if (safeLen) safeLen--;
9111       if( safeLen > INT_MAX ) {
9112         SWIG_exception( SWIG_RuntimeError, "too large buffer (>2GB)" );
9113       }
9114       arg1 = (int) safeLen;
9115     }
9116     else
9117     {
9118       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
9119       SWIG_fail;
9120     }
9121     ok: ;
9122   }
9123   if (obj1) {
9124     ecode3 = SWIG_AsVal_int(obj1, &val3);
9125     if (!SWIG_IsOK(ecode3)) {
9126       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "EscapeString" "', argument " "3"" of type '" "int""'");
9127     }
9128     arg3 = static_cast< int >(val3);
9129   }
9130   {
9131     if ( bUseExceptions ) {
9132       ClearErrorState();
9133     }
9134     {
9135       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9136       result = (retStringAndCPLFree *)EscapeString(arg1,arg2,arg3);
9137       SWIG_PYTHON_THREAD_END_ALLOW;
9138     }
9139 #ifndef SED_HACKS
9140     if ( bUseExceptions ) {
9141       CPLErr eclass = CPLGetLastErrorType();
9142       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9143         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9144       }
9145     }
9146 #endif
9147   }
9148   {
9149     /* %typemap(out) (retStringAndCPLFree*) */
9150     Py_XDECREF(resultobj);
9151     if(result)
9152     {
9153       resultobj = GDALPythonObjectFromCStr( (const char *)result);
9154       CPLFree(result);
9155     }
9156     else
9157     {
9158       resultobj = Py_None;
9159       Py_INCREF(resultobj);
9160     }
9161   }
9162   {
9163     /* %typemap(freearg) (int *nLen, char *pBuf ) */
9164     if( viewIsValid1 ) {
9165       PyBuffer_Release(&view1);
9166     }
9167     else if (ReturnSame(alloc1) == SWIG_NEWOBJ ) {
9168       delete[] arg2;
9169     }
9170   }
9171   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9172   return resultobj;
9173 fail:
9174   {
9175     /* %typemap(freearg) (int *nLen, char *pBuf ) */
9176     if( viewIsValid1 ) {
9177       PyBuffer_Release(&view1);
9178     }
9179     else if (ReturnSame(alloc1) == SWIG_NEWOBJ ) {
9180       delete[] arg2;
9181     }
9182   }
9183   return NULL;
9184 }
9185 
9186 
_wrap_GetLastErrorNo(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9187 SWIGINTERN PyObject *_wrap_GetLastErrorNo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9188   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9189   int result;
9190 
9191   if (!PyArg_ParseTuple(args,(char *)":GetLastErrorNo")) SWIG_fail;
9192   {
9193 #ifdef SED_HACKS
9194     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
9195 #endif
9196 
9197     result = CPLGetLastErrorNo();
9198   }
9199   resultobj = SWIG_From_int(static_cast< int >(result));
9200   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9201   return resultobj;
9202 fail:
9203   return NULL;
9204 }
9205 
9206 
_wrap_GetLastErrorType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9207 SWIGINTERN PyObject *_wrap_GetLastErrorType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9208   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9209   int result;
9210 
9211   if (!PyArg_ParseTuple(args,(char *)":GetLastErrorType")) SWIG_fail;
9212   {
9213 #ifdef SED_HACKS
9214     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
9215 #endif
9216 
9217     result = CPLGetLastErrorType();
9218   }
9219   resultobj = SWIG_From_int(static_cast< int >(result));
9220   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9221   return resultobj;
9222 fail:
9223   return NULL;
9224 }
9225 
9226 
_wrap_GetLastErrorMsg(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9227 SWIGINTERN PyObject *_wrap_GetLastErrorMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9228   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9229   char *result = 0 ;
9230 
9231   if (!PyArg_ParseTuple(args,(char *)":GetLastErrorMsg")) SWIG_fail;
9232   {
9233 #ifdef SED_HACKS
9234     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
9235 #endif
9236 
9237     result = (char*)CPLGetLastErrorMsg();
9238   }
9239   resultobj = SWIG_FromCharPtr((const char *)result);
9240   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9241   return resultobj;
9242 fail:
9243   return NULL;
9244 }
9245 
9246 
_wrap_GetErrorCounter(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9247 SWIGINTERN PyObject *_wrap_GetErrorCounter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9248   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9249   unsigned int result;
9250 
9251   if (!PyArg_ParseTuple(args,(char *)":GetErrorCounter")) SWIG_fail;
9252   {
9253 #ifdef SED_HACKS
9254     if( bUseExceptions ) bLocalUseExceptionsCode = FALSE;
9255 #endif
9256 
9257     result = CPLGetErrorCounter();
9258   }
9259   resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
9260   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9261   return resultobj;
9262 fail:
9263   return NULL;
9264 }
9265 
9266 
_wrap_VSIGetLastErrorNo(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9267 SWIGINTERN PyObject *_wrap_VSIGetLastErrorNo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9268   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9269   int result;
9270 
9271   if (!PyArg_ParseTuple(args,(char *)":VSIGetLastErrorNo")) SWIG_fail;
9272   {
9273     if ( bUseExceptions ) {
9274       ClearErrorState();
9275     }
9276     {
9277       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9278       result = (int)VSIGetLastErrorNo();
9279       SWIG_PYTHON_THREAD_END_ALLOW;
9280     }
9281 #ifndef SED_HACKS
9282     if ( bUseExceptions ) {
9283       CPLErr eclass = CPLGetLastErrorType();
9284       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9285         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9286       }
9287     }
9288 #endif
9289   }
9290   resultobj = SWIG_From_int(static_cast< int >(result));
9291   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9292   return resultobj;
9293 fail:
9294   return NULL;
9295 }
9296 
9297 
_wrap_VSIGetLastErrorMsg(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9298 SWIGINTERN PyObject *_wrap_VSIGetLastErrorMsg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9299   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9300   char *result = 0 ;
9301 
9302   if (!PyArg_ParseTuple(args,(char *)":VSIGetLastErrorMsg")) SWIG_fail;
9303   {
9304     if ( bUseExceptions ) {
9305       ClearErrorState();
9306     }
9307     {
9308       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9309       result = (char *)VSIGetLastErrorMsg();
9310       SWIG_PYTHON_THREAD_END_ALLOW;
9311     }
9312 #ifndef SED_HACKS
9313     if ( bUseExceptions ) {
9314       CPLErr eclass = CPLGetLastErrorType();
9315       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9316         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9317       }
9318     }
9319 #endif
9320   }
9321   resultobj = SWIG_FromCharPtr((const char *)result);
9322   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9323   return resultobj;
9324 fail:
9325   return NULL;
9326 }
9327 
9328 
_wrap_VSIErrorReset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9329 SWIGINTERN PyObject *_wrap_VSIErrorReset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9330   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9331 
9332   if (!PyArg_ParseTuple(args,(char *)":VSIErrorReset")) SWIG_fail;
9333   {
9334     if ( bUseExceptions ) {
9335       ClearErrorState();
9336     }
9337     {
9338       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9339       VSIErrorReset();
9340       SWIG_PYTHON_THREAD_END_ALLOW;
9341     }
9342 #ifndef SED_HACKS
9343     if ( bUseExceptions ) {
9344       CPLErr eclass = CPLGetLastErrorType();
9345       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9346         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9347       }
9348     }
9349 #endif
9350   }
9351   resultobj = SWIG_Py_Void();
9352   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9353   return resultobj;
9354 fail:
9355   return NULL;
9356 }
9357 
9358 
_wrap_PushFinderLocation(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9359 SWIGINTERN PyObject *_wrap_PushFinderLocation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9360   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9361   char *arg1 = (char *) 0 ;
9362   int bToFree1 = 0 ;
9363   PyObject * obj0 = 0 ;
9364 
9365   if (!PyArg_ParseTuple(args,(char *)"O:PushFinderLocation",&obj0)) SWIG_fail;
9366   {
9367     /* %typemap(in) (const char *utf8_path) */
9368     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
9369     if (arg1 == NULL)
9370     {
9371       PyErr_SetString( PyExc_RuntimeError, "not a string" );
9372       SWIG_fail;
9373     }
9374   }
9375   {
9376     if (!arg1) {
9377       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9378     }
9379   }
9380   {
9381     if ( bUseExceptions ) {
9382       ClearErrorState();
9383     }
9384     {
9385       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9386       CPLPushFinderLocation((char const *)arg1);
9387       SWIG_PYTHON_THREAD_END_ALLOW;
9388     }
9389 #ifndef SED_HACKS
9390     if ( bUseExceptions ) {
9391       CPLErr eclass = CPLGetLastErrorType();
9392       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9393         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9394       }
9395     }
9396 #endif
9397   }
9398   resultobj = SWIG_Py_Void();
9399   {
9400     /* %typemap(freearg) (const char *utf8_path) */
9401     GDALPythonFreeCStr(arg1, bToFree1);
9402   }
9403   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9404   return resultobj;
9405 fail:
9406   {
9407     /* %typemap(freearg) (const char *utf8_path) */
9408     GDALPythonFreeCStr(arg1, bToFree1);
9409   }
9410   return NULL;
9411 }
9412 
9413 
_wrap_PopFinderLocation(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9414 SWIGINTERN PyObject *_wrap_PopFinderLocation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9415   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9416 
9417   if (!PyArg_ParseTuple(args,(char *)":PopFinderLocation")) SWIG_fail;
9418   {
9419     if ( bUseExceptions ) {
9420       ClearErrorState();
9421     }
9422     {
9423       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9424       CPLPopFinderLocation();
9425       SWIG_PYTHON_THREAD_END_ALLOW;
9426     }
9427 #ifndef SED_HACKS
9428     if ( bUseExceptions ) {
9429       CPLErr eclass = CPLGetLastErrorType();
9430       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9431         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9432       }
9433     }
9434 #endif
9435   }
9436   resultobj = SWIG_Py_Void();
9437   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9438   return resultobj;
9439 fail:
9440   return NULL;
9441 }
9442 
9443 
_wrap_FinderClean(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9444 SWIGINTERN PyObject *_wrap_FinderClean(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9445   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9446 
9447   if (!PyArg_ParseTuple(args,(char *)":FinderClean")) SWIG_fail;
9448   {
9449     if ( bUseExceptions ) {
9450       ClearErrorState();
9451     }
9452     {
9453       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9454       CPLFinderClean();
9455       SWIG_PYTHON_THREAD_END_ALLOW;
9456     }
9457 #ifndef SED_HACKS
9458     if ( bUseExceptions ) {
9459       CPLErr eclass = CPLGetLastErrorType();
9460       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9461         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9462       }
9463     }
9464 #endif
9465   }
9466   resultobj = SWIG_Py_Void();
9467   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9468   return resultobj;
9469 fail:
9470   return NULL;
9471 }
9472 
9473 
_wrap_FindFile(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9474 SWIGINTERN PyObject *_wrap_FindFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9475   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9476   char *arg1 = (char *) 0 ;
9477   char *arg2 = (char *) 0 ;
9478   int res1 ;
9479   char *buf1 = 0 ;
9480   int alloc1 = 0 ;
9481   int bToFree2 = 0 ;
9482   PyObject * obj0 = 0 ;
9483   PyObject * obj1 = 0 ;
9484   char *result = 0 ;
9485 
9486   if (!PyArg_ParseTuple(args,(char *)"OO:FindFile",&obj0,&obj1)) SWIG_fail;
9487   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
9488   if (!SWIG_IsOK(res1)) {
9489     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FindFile" "', argument " "1"" of type '" "char const *""'");
9490   }
9491   arg1 = reinterpret_cast< char * >(buf1);
9492   {
9493     /* %typemap(in) (const char *utf8_path) */
9494     arg2 = GDALPythonObjectToCStr( obj1, &bToFree2 );
9495     if (arg2 == NULL)
9496     {
9497       PyErr_SetString( PyExc_RuntimeError, "not a string" );
9498       SWIG_fail;
9499     }
9500   }
9501   {
9502     if (!arg2) {
9503       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9504     }
9505   }
9506   {
9507     if ( bUseExceptions ) {
9508       ClearErrorState();
9509     }
9510     {
9511       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9512       result = (char *)CPLFindFile((char const *)arg1,(char const *)arg2);
9513       SWIG_PYTHON_THREAD_END_ALLOW;
9514     }
9515 #ifndef SED_HACKS
9516     if ( bUseExceptions ) {
9517       CPLErr eclass = CPLGetLastErrorType();
9518       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9519         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9520       }
9521     }
9522 #endif
9523   }
9524   resultobj = SWIG_FromCharPtr((const char *)result);
9525   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
9526   {
9527     /* %typemap(freearg) (const char *utf8_path) */
9528     GDALPythonFreeCStr(arg2, bToFree2);
9529   }
9530   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9531   return resultobj;
9532 fail:
9533   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
9534   {
9535     /* %typemap(freearg) (const char *utf8_path) */
9536     GDALPythonFreeCStr(arg2, bToFree2);
9537   }
9538   return NULL;
9539 }
9540 
9541 
_wrap_ReadDir(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9542 SWIGINTERN PyObject *_wrap_ReadDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9543   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9544   char *arg1 = (char *) 0 ;
9545   int arg2 = (int) 0 ;
9546   int bToFree1 = 0 ;
9547   int val2 ;
9548   int ecode2 = 0 ;
9549   PyObject * obj0 = 0 ;
9550   PyObject * obj1 = 0 ;
9551   char **result = 0 ;
9552 
9553   if (!PyArg_ParseTuple(args,(char *)"O|O:ReadDir",&obj0,&obj1)) SWIG_fail;
9554   {
9555     /* %typemap(in) (const char *utf8_path) */
9556     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
9557     if (arg1 == NULL)
9558     {
9559       PyErr_SetString( PyExc_RuntimeError, "not a string" );
9560       SWIG_fail;
9561     }
9562   }
9563   if (obj1) {
9564     ecode2 = SWIG_AsVal_int(obj1, &val2);
9565     if (!SWIG_IsOK(ecode2)) {
9566       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ReadDir" "', argument " "2"" of type '" "int""'");
9567     }
9568     arg2 = static_cast< int >(val2);
9569   }
9570   {
9571     if (!arg1) {
9572       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9573     }
9574   }
9575   {
9576     if ( bUseExceptions ) {
9577       ClearErrorState();
9578     }
9579     {
9580       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9581       result = (char **)wrapper_VSIReadDirEx((char const *)arg1,arg2);
9582       SWIG_PYTHON_THREAD_END_ALLOW;
9583     }
9584 #ifndef SED_HACKS
9585     if ( bUseExceptions ) {
9586       CPLErr eclass = CPLGetLastErrorType();
9587       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9588         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9589       }
9590     }
9591 #endif
9592   }
9593   {
9594     /* %typemap(out) char **CSL -> ( string ) */
9595     char **stringarray = result;
9596     if ( stringarray == NULL ) {
9597       resultobj = Py_None;
9598       Py_INCREF( resultobj );
9599     }
9600     else {
9601       int len = CSLCount( stringarray );
9602       resultobj = PyList_New( len );
9603       for ( int i = 0; i < len; ++i ) {
9604         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
9605         PyList_SetItem(resultobj, i, o );
9606       }
9607     }
9608     CSLDestroy(result);
9609   }
9610   {
9611     /* %typemap(freearg) (const char *utf8_path) */
9612     GDALPythonFreeCStr(arg1, bToFree1);
9613   }
9614   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9615   return resultobj;
9616 fail:
9617   {
9618     /* %typemap(freearg) (const char *utf8_path) */
9619     GDALPythonFreeCStr(arg1, bToFree1);
9620   }
9621   return NULL;
9622 }
9623 
9624 
_wrap_ReadDirRecursive(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9625 SWIGINTERN PyObject *_wrap_ReadDirRecursive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9626   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9627   char *arg1 = (char *) 0 ;
9628   int bToFree1 = 0 ;
9629   PyObject * obj0 = 0 ;
9630   char **result = 0 ;
9631 
9632   if (!PyArg_ParseTuple(args,(char *)"O:ReadDirRecursive",&obj0)) SWIG_fail;
9633   {
9634     /* %typemap(in) (const char *utf8_path) */
9635     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
9636     if (arg1 == NULL)
9637     {
9638       PyErr_SetString( PyExc_RuntimeError, "not a string" );
9639       SWIG_fail;
9640     }
9641   }
9642   {
9643     if (!arg1) {
9644       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9645     }
9646   }
9647   {
9648     if ( bUseExceptions ) {
9649       ClearErrorState();
9650     }
9651     {
9652       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9653       result = (char **)VSIReadDirRecursive((char const *)arg1);
9654       SWIG_PYTHON_THREAD_END_ALLOW;
9655     }
9656 #ifndef SED_HACKS
9657     if ( bUseExceptions ) {
9658       CPLErr eclass = CPLGetLastErrorType();
9659       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9660         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9661       }
9662     }
9663 #endif
9664   }
9665   {
9666     /* %typemap(out) char **CSL -> ( string ) */
9667     char **stringarray = result;
9668     if ( stringarray == NULL ) {
9669       resultobj = Py_None;
9670       Py_INCREF( resultobj );
9671     }
9672     else {
9673       int len = CSLCount( stringarray );
9674       resultobj = PyList_New( len );
9675       for ( int i = 0; i < len; ++i ) {
9676         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
9677         PyList_SetItem(resultobj, i, o );
9678       }
9679     }
9680     CSLDestroy(result);
9681   }
9682   {
9683     /* %typemap(freearg) (const char *utf8_path) */
9684     GDALPythonFreeCStr(arg1, bToFree1);
9685   }
9686   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9687   return resultobj;
9688 fail:
9689   {
9690     /* %typemap(freearg) (const char *utf8_path) */
9691     GDALPythonFreeCStr(arg1, bToFree1);
9692   }
9693   return NULL;
9694 }
9695 
9696 
_wrap_OpenDir(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9697 SWIGINTERN PyObject *_wrap_OpenDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9698   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9699   char *arg1 = (char *) 0 ;
9700   int arg2 = (int) -1 ;
9701   char **arg3 = (char **) NULL ;
9702   int bToFree1 = 0 ;
9703   int val2 ;
9704   int ecode2 = 0 ;
9705   PyObject * obj0 = 0 ;
9706   PyObject * obj1 = 0 ;
9707   PyObject * obj2 = 0 ;
9708   VSIDIR *result = 0 ;
9709 
9710   if (!PyArg_ParseTuple(args,(char *)"O|OO:OpenDir",&obj0,&obj1,&obj2)) SWIG_fail;
9711   {
9712     /* %typemap(in) (const char *utf8_path) */
9713     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
9714     if (arg1 == NULL)
9715     {
9716       PyErr_SetString( PyExc_RuntimeError, "not a string" );
9717       SWIG_fail;
9718     }
9719   }
9720   if (obj1) {
9721     ecode2 = SWIG_AsVal_int(obj1, &val2);
9722     if (!SWIG_IsOK(ecode2)) {
9723       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OpenDir" "', argument " "2"" of type '" "int""'");
9724     }
9725     arg2 = static_cast< int >(val2);
9726   }
9727   if (obj2) {
9728     {
9729       /* %typemap(in) char **options */
9730       int bErr = FALSE;
9731       arg3 = CSLFromPySequence(obj2, &bErr);
9732       if( bErr )
9733       {
9734         SWIG_fail;
9735       }
9736     }
9737   }
9738   {
9739     if (!arg1) {
9740       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
9741     }
9742   }
9743   {
9744     if ( bUseExceptions ) {
9745       ClearErrorState();
9746     }
9747     {
9748       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9749       result = (VSIDIR *)wrapper_VSIOpenDir((char const *)arg1,arg2,arg3);
9750       SWIG_PYTHON_THREAD_END_ALLOW;
9751     }
9752 #ifndef SED_HACKS
9753     if ( bUseExceptions ) {
9754       CPLErr eclass = CPLGetLastErrorType();
9755       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
9756         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
9757       }
9758     }
9759 #endif
9760   }
9761   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_VSIDIR, 0 |  0 );
9762   {
9763     /* %typemap(freearg) (const char *utf8_path) */
9764     GDALPythonFreeCStr(arg1, bToFree1);
9765   }
9766   {
9767     /* %typemap(freearg) char **options */
9768     CSLDestroy( arg3 );
9769   }
9770   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9771   return resultobj;
9772 fail:
9773   {
9774     /* %typemap(freearg) (const char *utf8_path) */
9775     GDALPythonFreeCStr(arg1, bToFree1);
9776   }
9777   {
9778     /* %typemap(freearg) char **options */
9779     CSLDestroy( arg3 );
9780   }
9781   return NULL;
9782 }
9783 
9784 
_wrap_DirEntry_name_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9785 SWIGINTERN PyObject *_wrap_DirEntry_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9786   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9787   DirEntry *arg1 = (DirEntry *) 0 ;
9788   void *argp1 = 0 ;
9789   int res1 = 0 ;
9790   PyObject * obj0 = 0 ;
9791   char *result = 0 ;
9792 
9793   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_name_get",&obj0)) SWIG_fail;
9794   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9795   if (!SWIG_IsOK(res1)) {
9796     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_name_get" "', argument " "1"" of type '" "DirEntry *""'");
9797   }
9798   arg1 = reinterpret_cast< DirEntry * >(argp1);
9799   {
9800     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9801     result = (char *) ((arg1)->name);
9802     SWIG_PYTHON_THREAD_END_ALLOW;
9803   }
9804   resultobj = SWIG_FromCharPtr((const char *)result);
9805   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9806   return resultobj;
9807 fail:
9808   return NULL;
9809 }
9810 
9811 
_wrap_DirEntry_mode_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9812 SWIGINTERN PyObject *_wrap_DirEntry_mode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9813   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9814   DirEntry *arg1 = (DirEntry *) 0 ;
9815   void *argp1 = 0 ;
9816   int res1 = 0 ;
9817   PyObject * obj0 = 0 ;
9818   int result;
9819 
9820   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_mode_get",&obj0)) SWIG_fail;
9821   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9822   if (!SWIG_IsOK(res1)) {
9823     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_mode_get" "', argument " "1"" of type '" "DirEntry *""'");
9824   }
9825   arg1 = reinterpret_cast< DirEntry * >(argp1);
9826   {
9827     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9828     result = (int) ((arg1)->mode);
9829     SWIG_PYTHON_THREAD_END_ALLOW;
9830   }
9831   resultobj = SWIG_From_int(static_cast< int >(result));
9832   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9833   return resultobj;
9834 fail:
9835   return NULL;
9836 }
9837 
9838 
_wrap_DirEntry_size_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9839 SWIGINTERN PyObject *_wrap_DirEntry_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9840   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9841   DirEntry *arg1 = (DirEntry *) 0 ;
9842   void *argp1 = 0 ;
9843   int res1 = 0 ;
9844   PyObject * obj0 = 0 ;
9845   GIntBig result;
9846 
9847   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_size_get",&obj0)) SWIG_fail;
9848   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9849   if (!SWIG_IsOK(res1)) {
9850     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_size_get" "', argument " "1"" of type '" "DirEntry *""'");
9851   }
9852   arg1 = reinterpret_cast< DirEntry * >(argp1);
9853   {
9854     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9855     result =  ((arg1)->size);
9856     SWIG_PYTHON_THREAD_END_ALLOW;
9857   }
9858   {
9859     char szTmp[32];
9860     sprintf(szTmp, CPL_FRMT_GIB, result);
9861     resultobj = PyLong_FromString(szTmp, NULL, 10);
9862   }
9863   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9864   return resultobj;
9865 fail:
9866   return NULL;
9867 }
9868 
9869 
_wrap_DirEntry_mtime_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9870 SWIGINTERN PyObject *_wrap_DirEntry_mtime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9871   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9872   DirEntry *arg1 = (DirEntry *) 0 ;
9873   void *argp1 = 0 ;
9874   int res1 = 0 ;
9875   PyObject * obj0 = 0 ;
9876   GIntBig result;
9877 
9878   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_mtime_get",&obj0)) SWIG_fail;
9879   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9880   if (!SWIG_IsOK(res1)) {
9881     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_mtime_get" "', argument " "1"" of type '" "DirEntry *""'");
9882   }
9883   arg1 = reinterpret_cast< DirEntry * >(argp1);
9884   {
9885     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9886     result =  ((arg1)->mtime);
9887     SWIG_PYTHON_THREAD_END_ALLOW;
9888   }
9889   {
9890     char szTmp[32];
9891     sprintf(szTmp, CPL_FRMT_GIB, result);
9892     resultobj = PyLong_FromString(szTmp, NULL, 10);
9893   }
9894   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9895   return resultobj;
9896 fail:
9897   return NULL;
9898 }
9899 
9900 
_wrap_DirEntry_modeKnown_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9901 SWIGINTERN PyObject *_wrap_DirEntry_modeKnown_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9902   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9903   DirEntry *arg1 = (DirEntry *) 0 ;
9904   void *argp1 = 0 ;
9905   int res1 = 0 ;
9906   PyObject * obj0 = 0 ;
9907   bool result;
9908 
9909   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_modeKnown_get",&obj0)) SWIG_fail;
9910   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9911   if (!SWIG_IsOK(res1)) {
9912     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_modeKnown_get" "', argument " "1"" of type '" "DirEntry *""'");
9913   }
9914   arg1 = reinterpret_cast< DirEntry * >(argp1);
9915   {
9916     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9917     result = (bool) ((arg1)->modeKnown);
9918     SWIG_PYTHON_THREAD_END_ALLOW;
9919   }
9920   resultobj = SWIG_From_bool(static_cast< bool >(result));
9921   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9922   return resultobj;
9923 fail:
9924   return NULL;
9925 }
9926 
9927 
_wrap_DirEntry_sizeKnown_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9928 SWIGINTERN PyObject *_wrap_DirEntry_sizeKnown_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9929   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9930   DirEntry *arg1 = (DirEntry *) 0 ;
9931   void *argp1 = 0 ;
9932   int res1 = 0 ;
9933   PyObject * obj0 = 0 ;
9934   bool result;
9935 
9936   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_sizeKnown_get",&obj0)) SWIG_fail;
9937   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9938   if (!SWIG_IsOK(res1)) {
9939     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_sizeKnown_get" "', argument " "1"" of type '" "DirEntry *""'");
9940   }
9941   arg1 = reinterpret_cast< DirEntry * >(argp1);
9942   {
9943     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9944     result = (bool) ((arg1)->sizeKnown);
9945     SWIG_PYTHON_THREAD_END_ALLOW;
9946   }
9947   resultobj = SWIG_From_bool(static_cast< bool >(result));
9948   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9949   return resultobj;
9950 fail:
9951   return NULL;
9952 }
9953 
9954 
_wrap_DirEntry_mtimeKnown_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9955 SWIGINTERN PyObject *_wrap_DirEntry_mtimeKnown_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9956   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9957   DirEntry *arg1 = (DirEntry *) 0 ;
9958   void *argp1 = 0 ;
9959   int res1 = 0 ;
9960   PyObject * obj0 = 0 ;
9961   bool result;
9962 
9963   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_mtimeKnown_get",&obj0)) SWIG_fail;
9964   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9965   if (!SWIG_IsOK(res1)) {
9966     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_mtimeKnown_get" "', argument " "1"" of type '" "DirEntry *""'");
9967   }
9968   arg1 = reinterpret_cast< DirEntry * >(argp1);
9969   {
9970     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9971     result = (bool) ((arg1)->mtimeKnown);
9972     SWIG_PYTHON_THREAD_END_ALLOW;
9973   }
9974   resultobj = SWIG_From_bool(static_cast< bool >(result));
9975   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
9976   return resultobj;
9977 fail:
9978   return NULL;
9979 }
9980 
9981 
_wrap_DirEntry_extra_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)9982 SWIGINTERN PyObject *_wrap_DirEntry_extra_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9983   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
9984   DirEntry *arg1 = (DirEntry *) 0 ;
9985   void *argp1 = 0 ;
9986   int res1 = 0 ;
9987   PyObject * obj0 = 0 ;
9988   char **result = 0 ;
9989 
9990   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_extra_get",&obj0)) SWIG_fail;
9991   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
9992   if (!SWIG_IsOK(res1)) {
9993     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_extra_get" "', argument " "1"" of type '" "DirEntry *""'");
9994   }
9995   arg1 = reinterpret_cast< DirEntry * >(argp1);
9996   {
9997     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
9998     result = (char **) ((arg1)->extra);
9999     SWIG_PYTHON_THREAD_END_ALLOW;
10000   }
10001   {
10002     /* %typemap(out) char **dict */
10003     char **stringarray = result;
10004     resultobj = PyDict_New();
10005     if ( stringarray != NULL ) {
10006       while (*stringarray != NULL ) {
10007         char const *valptr;
10008         char *keyptr;
10009         const char* pszSep = strchr( *stringarray, '=' );
10010         if ( pszSep != NULL) {
10011           keyptr = CPLStrdup(*stringarray);
10012           keyptr[pszSep - *stringarray] = '\0';
10013           valptr = pszSep + 1;
10014           PyObject *nm = GDALPythonObjectFromCStr( keyptr );
10015           PyObject *val = GDALPythonObjectFromCStr( valptr );
10016           PyDict_SetItem(resultobj, nm, val );
10017           Py_DECREF(nm);
10018           Py_DECREF(val);
10019           CPLFree( keyptr );
10020         }
10021         stringarray++;
10022       }
10023     }
10024   }
10025   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10026   return resultobj;
10027 fail:
10028   return NULL;
10029 }
10030 
10031 
_wrap_new_DirEntry(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10032 SWIGINTERN PyObject *_wrap_new_DirEntry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10033   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10034   DirEntry *arg1 = (DirEntry *) 0 ;
10035   void *argp1 = 0 ;
10036   int res1 = 0 ;
10037   PyObject * obj0 = 0 ;
10038   DirEntry *result = 0 ;
10039 
10040   if (!PyArg_ParseTuple(args,(char *)"O:new_DirEntry",&obj0)) SWIG_fail;
10041   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
10042   if (!SWIG_IsOK(res1)) {
10043     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DirEntry" "', argument " "1"" of type '" "DirEntry const *""'");
10044   }
10045   arg1 = reinterpret_cast< DirEntry * >(argp1);
10046   {
10047     if ( bUseExceptions ) {
10048       ClearErrorState();
10049     }
10050     {
10051       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10052       result = (DirEntry *)new_DirEntry((DirEntry const *)arg1);
10053       SWIG_PYTHON_THREAD_END_ALLOW;
10054     }
10055 #ifndef SED_HACKS
10056     if ( bUseExceptions ) {
10057       CPLErr eclass = CPLGetLastErrorType();
10058       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10059         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10060       }
10061     }
10062 #endif
10063   }
10064   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirEntry, SWIG_POINTER_NEW |  0 );
10065   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10066   return resultobj;
10067 fail:
10068   return NULL;
10069 }
10070 
10071 
_wrap_delete_DirEntry(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10072 SWIGINTERN PyObject *_wrap_delete_DirEntry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10073   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10074   DirEntry *arg1 = (DirEntry *) 0 ;
10075   void *argp1 = 0 ;
10076   int res1 = 0 ;
10077   PyObject * obj0 = 0 ;
10078 
10079   if (!PyArg_ParseTuple(args,(char *)"O:delete_DirEntry",&obj0)) SWIG_fail;
10080   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, SWIG_POINTER_DISOWN |  0 );
10081   if (!SWIG_IsOK(res1)) {
10082     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DirEntry" "', argument " "1"" of type '" "DirEntry *""'");
10083   }
10084   arg1 = reinterpret_cast< DirEntry * >(argp1);
10085   {
10086     if ( bUseExceptions ) {
10087       ClearErrorState();
10088     }
10089     {
10090       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10091       delete_DirEntry(arg1);
10092       SWIG_PYTHON_THREAD_END_ALLOW;
10093     }
10094 #ifndef SED_HACKS
10095     if ( bUseExceptions ) {
10096       CPLErr eclass = CPLGetLastErrorType();
10097       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10098         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10099       }
10100     }
10101 #endif
10102   }
10103   resultobj = SWIG_Py_Void();
10104   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10105   return resultobj;
10106 fail:
10107   return NULL;
10108 }
10109 
10110 
_wrap_DirEntry_IsDirectory(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10111 SWIGINTERN PyObject *_wrap_DirEntry_IsDirectory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10112   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10113   DirEntry *arg1 = (DirEntry *) 0 ;
10114   void *argp1 = 0 ;
10115   int res1 = 0 ;
10116   PyObject * obj0 = 0 ;
10117   bool result;
10118 
10119   if (!PyArg_ParseTuple(args,(char *)"O:DirEntry_IsDirectory",&obj0)) SWIG_fail;
10120   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DirEntry, 0 |  0 );
10121   if (!SWIG_IsOK(res1)) {
10122     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirEntry_IsDirectory" "', argument " "1"" of type '" "DirEntry *""'");
10123   }
10124   arg1 = reinterpret_cast< DirEntry * >(argp1);
10125   {
10126     if ( bUseExceptions ) {
10127       ClearErrorState();
10128     }
10129     {
10130       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10131       result = (bool)DirEntry_IsDirectory(arg1);
10132       SWIG_PYTHON_THREAD_END_ALLOW;
10133     }
10134 #ifndef SED_HACKS
10135     if ( bUseExceptions ) {
10136       CPLErr eclass = CPLGetLastErrorType();
10137       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10138         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10139       }
10140     }
10141 #endif
10142   }
10143   resultobj = SWIG_From_bool(static_cast< bool >(result));
10144   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10145   return resultobj;
10146 fail:
10147   return NULL;
10148 }
10149 
10150 
DirEntry_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10151 SWIGINTERN PyObject *DirEntry_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10152   PyObject *obj;
10153   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
10154   SWIG_TypeNewClientData(SWIGTYPE_p_DirEntry, SWIG_NewClientData(obj));
10155   return SWIG_Py_Void();
10156 }
10157 
_wrap_GetNextDirEntry(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10158 SWIGINTERN PyObject *_wrap_GetNextDirEntry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10159   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10160   VSIDIR *arg1 = (VSIDIR *) 0 ;
10161   void *argp1 = 0 ;
10162   int res1 = 0 ;
10163   PyObject * obj0 = 0 ;
10164   DirEntry *result = 0 ;
10165 
10166   if (!PyArg_ParseTuple(args,(char *)"O:GetNextDirEntry",&obj0)) SWIG_fail;
10167   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSIDIR, 0 |  0 );
10168   if (!SWIG_IsOK(res1)) {
10169     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetNextDirEntry" "', argument " "1"" of type '" "VSIDIR *""'");
10170   }
10171   arg1 = reinterpret_cast< VSIDIR * >(argp1);
10172   {
10173     if (!arg1) {
10174       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10175     }
10176   }
10177   {
10178     if ( bUseExceptions ) {
10179       ClearErrorState();
10180     }
10181     {
10182       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10183       result = (DirEntry *)wrapper_VSIGetNextDirEntry(arg1);
10184       SWIG_PYTHON_THREAD_END_ALLOW;
10185     }
10186 #ifndef SED_HACKS
10187     if ( bUseExceptions ) {
10188       CPLErr eclass = CPLGetLastErrorType();
10189       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10190         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10191       }
10192     }
10193 #endif
10194   }
10195   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirEntry, SWIG_POINTER_OWN |  0 );
10196   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10197   return resultobj;
10198 fail:
10199   return NULL;
10200 }
10201 
10202 
_wrap_CloseDir(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10203 SWIGINTERN PyObject *_wrap_CloseDir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10204   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10205   VSIDIR *arg1 = (VSIDIR *) 0 ;
10206   void *argp1 = 0 ;
10207   int res1 = 0 ;
10208   PyObject * obj0 = 0 ;
10209 
10210   if (!PyArg_ParseTuple(args,(char *)"O:CloseDir",&obj0)) SWIG_fail;
10211   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSIDIR, 0 |  0 );
10212   if (!SWIG_IsOK(res1)) {
10213     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CloseDir" "', argument " "1"" of type '" "VSIDIR *""'");
10214   }
10215   arg1 = reinterpret_cast< VSIDIR * >(argp1);
10216   {
10217     if (!arg1) {
10218       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10219     }
10220   }
10221   {
10222     if ( bUseExceptions ) {
10223       ClearErrorState();
10224     }
10225     {
10226       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10227       VSICloseDir(arg1);
10228       SWIG_PYTHON_THREAD_END_ALLOW;
10229     }
10230 #ifndef SED_HACKS
10231     if ( bUseExceptions ) {
10232       CPLErr eclass = CPLGetLastErrorType();
10233       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10234         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10235       }
10236     }
10237 #endif
10238   }
10239   resultobj = SWIG_Py_Void();
10240   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10241   return resultobj;
10242 fail:
10243   return NULL;
10244 }
10245 
10246 
_wrap_SetConfigOption(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10247 SWIGINTERN PyObject *_wrap_SetConfigOption(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10248   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10249   char *arg1 = (char *) 0 ;
10250   char *arg2 = (char *) 0 ;
10251   int res1 ;
10252   char *buf1 = 0 ;
10253   int alloc1 = 0 ;
10254   int res2 ;
10255   char *buf2 = 0 ;
10256   int alloc2 = 0 ;
10257   PyObject * obj0 = 0 ;
10258   PyObject * obj1 = 0 ;
10259 
10260   if (!PyArg_ParseTuple(args,(char *)"OO:SetConfigOption",&obj0,&obj1)) SWIG_fail;
10261   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
10262   if (!SWIG_IsOK(res1)) {
10263     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SetConfigOption" "', argument " "1"" of type '" "char const *""'");
10264   }
10265   arg1 = reinterpret_cast< char * >(buf1);
10266   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
10267   if (!SWIG_IsOK(res2)) {
10268     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SetConfigOption" "', argument " "2"" of type '" "char const *""'");
10269   }
10270   arg2 = reinterpret_cast< char * >(buf2);
10271   {
10272     if (!arg1) {
10273       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10274     }
10275   }
10276   {
10277     if ( bUseExceptions ) {
10278       ClearErrorState();
10279     }
10280     {
10281       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10282       CPLSetConfigOption((char const *)arg1,(char const *)arg2);
10283       SWIG_PYTHON_THREAD_END_ALLOW;
10284     }
10285 #ifndef SED_HACKS
10286     if ( bUseExceptions ) {
10287       CPLErr eclass = CPLGetLastErrorType();
10288       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10289         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10290       }
10291     }
10292 #endif
10293   }
10294   resultobj = SWIG_Py_Void();
10295   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
10296   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10297   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10298   return resultobj;
10299 fail:
10300   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
10301   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10302   return NULL;
10303 }
10304 
10305 
_wrap_GetConfigOption(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10306 SWIGINTERN PyObject *_wrap_GetConfigOption(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10307   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10308   char *arg1 = (char *) 0 ;
10309   char *arg2 = (char *) NULL ;
10310   int res1 ;
10311   char *buf1 = 0 ;
10312   int alloc1 = 0 ;
10313   int res2 ;
10314   char *buf2 = 0 ;
10315   int alloc2 = 0 ;
10316   PyObject * obj0 = 0 ;
10317   PyObject * obj1 = 0 ;
10318   char *result = 0 ;
10319 
10320   if (!PyArg_ParseTuple(args,(char *)"O|O:GetConfigOption",&obj0,&obj1)) SWIG_fail;
10321   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
10322   if (!SWIG_IsOK(res1)) {
10323     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetConfigOption" "', argument " "1"" of type '" "char const *""'");
10324   }
10325   arg1 = reinterpret_cast< char * >(buf1);
10326   if (obj1) {
10327     res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
10328     if (!SWIG_IsOK(res2)) {
10329       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GetConfigOption" "', argument " "2"" of type '" "char const *""'");
10330     }
10331     arg2 = reinterpret_cast< char * >(buf2);
10332   }
10333   {
10334     if (!arg1) {
10335       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10336     }
10337   }
10338   {
10339     if ( bUseExceptions ) {
10340       ClearErrorState();
10341     }
10342     {
10343       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10344       result = (char *)wrapper_CPLGetConfigOption((char const *)arg1,(char const *)arg2);
10345       SWIG_PYTHON_THREAD_END_ALLOW;
10346     }
10347 #ifndef SED_HACKS
10348     if ( bUseExceptions ) {
10349       CPLErr eclass = CPLGetLastErrorType();
10350       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10351         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10352       }
10353     }
10354 #endif
10355   }
10356   resultobj = SWIG_FromCharPtr((const char *)result);
10357   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
10358   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10359   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10360   return resultobj;
10361 fail:
10362   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
10363   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
10364   return NULL;
10365 }
10366 
10367 
_wrap_CPLBinaryToHex(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10368 SWIGINTERN PyObject *_wrap_CPLBinaryToHex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10369   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10370   int arg1 ;
10371   GByte *arg2 = (GByte *) 0 ;
10372   int alloc1 = 0 ;
10373   bool viewIsValid1 = false ;
10374   Py_buffer view1 ;
10375   PyObject * obj0 = 0 ;
10376   retStringAndCPLFree *result = 0 ;
10377 
10378   if (!PyArg_ParseTuple(args,(char *)"O:CPLBinaryToHex",&obj0)) SWIG_fail;
10379   {
10380     /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
10381     {
10382       if (PyObject_GetBuffer(obj0, &view1, PyBUF_SIMPLE) == 0)
10383       {
10384         if( view1.len > INT_MAX ) {
10385           PyBuffer_Release(&view1);
10386           SWIG_exception( SWIG_RuntimeError, "too large buffer (>2GB)" );
10387         }
10388         viewIsValid1 = true;
10389         arg1 = (int) view1.len;
10390         arg2 = (GByte *) view1.buf;
10391         goto ok;
10392       }
10393       else
10394       {
10395         PyErr_Clear();
10396       }
10397     }
10398     if (PyUnicode_Check(obj0))
10399     {
10400       size_t safeLen = 0;
10401       int ret = SWIG_AsCharPtrAndSize(obj0, (char**) &arg2, &safeLen, &alloc1);
10402       if (!SWIG_IsOK(ret)) {
10403         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
10404       }
10405 
10406       if (safeLen) safeLen--;
10407       if( safeLen > INT_MAX ) {
10408         SWIG_exception( SWIG_RuntimeError, "too large buffer (>2GB)" );
10409       }
10410       arg1 = (int) safeLen;
10411     }
10412     else
10413     {
10414       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
10415       SWIG_fail;
10416     }
10417     ok: ;
10418   }
10419   {
10420     if ( bUseExceptions ) {
10421       ClearErrorState();
10422     }
10423     {
10424       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10425       result = (retStringAndCPLFree *)CPLBinaryToHex(arg1,(GByte const *)arg2);
10426       SWIG_PYTHON_THREAD_END_ALLOW;
10427     }
10428 #ifndef SED_HACKS
10429     if ( bUseExceptions ) {
10430       CPLErr eclass = CPLGetLastErrorType();
10431       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10432         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10433       }
10434     }
10435 #endif
10436   }
10437   {
10438     /* %typemap(out) (retStringAndCPLFree*) */
10439     Py_XDECREF(resultobj);
10440     if(result)
10441     {
10442       resultobj = GDALPythonObjectFromCStr( (const char *)result);
10443       CPLFree(result);
10444     }
10445     else
10446     {
10447       resultobj = Py_None;
10448       Py_INCREF(resultobj);
10449     }
10450   }
10451   {
10452     /* %typemap(freearg) (int *nLen, char *pBuf ) */
10453     if( viewIsValid1 ) {
10454       PyBuffer_Release(&view1);
10455     }
10456     else if (ReturnSame(alloc1) == SWIG_NEWOBJ ) {
10457       delete[] arg2;
10458     }
10459   }
10460   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10461   return resultobj;
10462 fail:
10463   {
10464     /* %typemap(freearg) (int *nLen, char *pBuf ) */
10465     if( viewIsValid1 ) {
10466       PyBuffer_Release(&view1);
10467     }
10468     else if (ReturnSame(alloc1) == SWIG_NEWOBJ ) {
10469       delete[] arg2;
10470     }
10471   }
10472   return NULL;
10473 }
10474 
10475 
_wrap_CPLHexToBinary(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10476 SWIGINTERN PyObject *_wrap_CPLHexToBinary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10477   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10478   char *arg1 = (char *) 0 ;
10479   int *arg2 = (int *) 0 ;
10480   int res1 ;
10481   char *buf1 = 0 ;
10482   int alloc1 = 0 ;
10483   void *argp2 = 0 ;
10484   int res2 = 0 ;
10485   PyObject * obj0 = 0 ;
10486   PyObject * obj1 = 0 ;
10487   GByte *result = 0 ;
10488 
10489   if (!PyArg_ParseTuple(args,(char *)"OO:CPLHexToBinary",&obj0,&obj1)) SWIG_fail;
10490   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
10491   if (!SWIG_IsOK(res1)) {
10492     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CPLHexToBinary" "', argument " "1"" of type '" "char const *""'");
10493   }
10494   arg1 = reinterpret_cast< char * >(buf1);
10495   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
10496   if (!SWIG_IsOK(res2)) {
10497     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CPLHexToBinary" "', argument " "2"" of type '" "int *""'");
10498   }
10499   arg2 = reinterpret_cast< int * >(argp2);
10500   {
10501     if ( bUseExceptions ) {
10502       ClearErrorState();
10503     }
10504     {
10505       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10506       result = (GByte *)CPLHexToBinary((char const *)arg1,arg2);
10507       SWIG_PYTHON_THREAD_END_ALLOW;
10508     }
10509 #ifndef SED_HACKS
10510     if ( bUseExceptions ) {
10511       CPLErr eclass = CPLGetLastErrorType();
10512       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10513         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10514       }
10515     }
10516 #endif
10517   }
10518   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GByte, 0 |  0 );
10519   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
10520   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10521   return resultobj;
10522 fail:
10523   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
10524   return NULL;
10525 }
10526 
10527 
_wrap_FileFromMemBuffer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10528 SWIGINTERN PyObject *_wrap_FileFromMemBuffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10529   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10530   char *arg1 = (char *) 0 ;
10531   GIntBig arg2 ;
10532   char *arg3 = (char *) 0 ;
10533   int bToFree1 = 0 ;
10534   int alloc2 = 0 ;
10535   bool viewIsValid2 = false ;
10536   Py_buffer view2 ;
10537   PyObject * obj0 = 0 ;
10538   PyObject * obj1 = 0 ;
10539 
10540   if (!PyArg_ParseTuple(args,(char *)"OO:FileFromMemBuffer",&obj0,&obj1)) SWIG_fail;
10541   {
10542     /* %typemap(in) (const char *utf8_path) */
10543     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
10544     if (arg1 == NULL)
10545     {
10546       PyErr_SetString( PyExc_RuntimeError, "not a string" );
10547       SWIG_fail;
10548     }
10549   }
10550   {
10551     /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
10552     {
10553       if (PyObject_GetBuffer(obj1, &view2, PyBUF_SIMPLE) == 0)
10554       {
10555         viewIsValid2 = true;
10556         arg2 = view2.len;
10557         arg3 = (char *) view2.buf;
10558         goto ok;
10559       }
10560       else
10561       {
10562         PyErr_Clear();
10563       }
10564     }
10565     if (PyUnicode_Check(obj1))
10566     {
10567       size_t safeLen = 0;
10568       int ret = SWIG_AsCharPtrAndSize(obj1, (char**) &arg3, &safeLen, &alloc2);
10569       if (!SWIG_IsOK(ret)) {
10570         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
10571       }
10572 
10573       if (safeLen) safeLen--;
10574       arg2 = (GIntBig) safeLen;
10575     }
10576     else
10577     {
10578       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
10579       SWIG_fail;
10580     }
10581     ok: ;
10582   }
10583   {
10584     if (!arg1) {
10585       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10586     }
10587   }
10588   {
10589     if ( bUseExceptions ) {
10590       ClearErrorState();
10591     }
10592     {
10593       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10594       wrapper_VSIFileFromMemBuffer((char const *)arg1,arg2,(char const *)arg3);
10595       SWIG_PYTHON_THREAD_END_ALLOW;
10596     }
10597 #ifndef SED_HACKS
10598     if ( bUseExceptions ) {
10599       CPLErr eclass = CPLGetLastErrorType();
10600       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10601         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10602       }
10603     }
10604 #endif
10605   }
10606   resultobj = SWIG_Py_Void();
10607   {
10608     /* %typemap(freearg) (const char *utf8_path) */
10609     GDALPythonFreeCStr(arg1, bToFree1);
10610   }
10611   {
10612     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
10613     if( viewIsValid2 ) {
10614       PyBuffer_Release(&view2);
10615     }
10616     else if (ReturnSame(alloc2) == SWIG_NEWOBJ ) {
10617       delete[] arg3;
10618     }
10619   }
10620   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10621   return resultobj;
10622 fail:
10623   {
10624     /* %typemap(freearg) (const char *utf8_path) */
10625     GDALPythonFreeCStr(arg1, bToFree1);
10626   }
10627   {
10628     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
10629     if( viewIsValid2 ) {
10630       PyBuffer_Release(&view2);
10631     }
10632     else if (ReturnSame(alloc2) == SWIG_NEWOBJ ) {
10633       delete[] arg3;
10634     }
10635   }
10636   return NULL;
10637 }
10638 
10639 
_wrap_Unlink(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10640 SWIGINTERN PyObject *_wrap_Unlink(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10641   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10642   char *arg1 = (char *) 0 ;
10643   int bToFree1 = 0 ;
10644   PyObject * obj0 = 0 ;
10645   VSI_RETVAL result;
10646 
10647   if (!PyArg_ParseTuple(args,(char *)"O:Unlink",&obj0)) SWIG_fail;
10648   {
10649     /* %typemap(in) (const char *utf8_path) */
10650     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
10651     if (arg1 == NULL)
10652     {
10653       PyErr_SetString( PyExc_RuntimeError, "not a string" );
10654       SWIG_fail;
10655     }
10656   }
10657   {
10658     if (!arg1) {
10659       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10660     }
10661   }
10662   {
10663     if ( bUseExceptions ) {
10664       ClearErrorState();
10665     }
10666     {
10667       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10668       result = VSIUnlink((char const *)arg1);
10669       SWIG_PYTHON_THREAD_END_ALLOW;
10670     }
10671 #ifndef SED_HACKS
10672     if ( bUseExceptions ) {
10673       CPLErr eclass = CPLGetLastErrorType();
10674       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10675         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10676       }
10677     }
10678 #endif
10679   }
10680   {
10681     /* %typemap(out) VSI_RETVAL */
10682     if ( result != 0 && bUseExceptions) {
10683       const char* pszMessage = CPLGetLastErrorMsg();
10684       if( pszMessage[0] != '\0' )
10685       PyErr_SetString( PyExc_RuntimeError, pszMessage );
10686       else
10687       PyErr_SetString( PyExc_RuntimeError, "unknown error occurred" );
10688       SWIG_fail;
10689     }
10690   }
10691   {
10692     /* %typemap(freearg) (const char *utf8_path) */
10693     GDALPythonFreeCStr(arg1, bToFree1);
10694   }
10695   {
10696     /* %typemap(ret) VSI_RETVAL */
10697     resultobj = PyInt_FromLong( result );
10698   }
10699   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10700   return resultobj;
10701 fail:
10702   {
10703     /* %typemap(freearg) (const char *utf8_path) */
10704     GDALPythonFreeCStr(arg1, bToFree1);
10705   }
10706   return NULL;
10707 }
10708 
10709 
_wrap_UnlinkBatch(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10710 SWIGINTERN PyObject *_wrap_UnlinkBatch(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10711   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10712   char **arg1 = (char **) 0 ;
10713   PyObject * obj0 = 0 ;
10714   bool result;
10715 
10716   if (!PyArg_ParseTuple(args,(char *)"O:UnlinkBatch",&obj0)) SWIG_fail;
10717   {
10718     /* %typemap(in) char **options */
10719     int bErr = FALSE;
10720     arg1 = CSLFromPySequence(obj0, &bErr);
10721     if( bErr )
10722     {
10723       SWIG_fail;
10724     }
10725   }
10726   {
10727     if ( bUseExceptions ) {
10728       ClearErrorState();
10729     }
10730     {
10731       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10732       result = (bool)wrapper_VSIUnlinkBatch(arg1);
10733       SWIG_PYTHON_THREAD_END_ALLOW;
10734     }
10735 #ifndef SED_HACKS
10736     if ( bUseExceptions ) {
10737       CPLErr eclass = CPLGetLastErrorType();
10738       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10739         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10740       }
10741     }
10742 #endif
10743   }
10744   resultobj = SWIG_From_bool(static_cast< bool >(result));
10745   {
10746     /* %typemap(freearg) char **options */
10747     CSLDestroy( arg1 );
10748   }
10749   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10750   return resultobj;
10751 fail:
10752   {
10753     /* %typemap(freearg) char **options */
10754     CSLDestroy( arg1 );
10755   }
10756   return NULL;
10757 }
10758 
10759 
_wrap_HasThreadSupport(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10760 SWIGINTERN PyObject *_wrap_HasThreadSupport(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10761   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10762   int result;
10763 
10764   if (!PyArg_ParseTuple(args,(char *)":HasThreadSupport")) SWIG_fail;
10765   {
10766     if ( bUseExceptions ) {
10767       ClearErrorState();
10768     }
10769     {
10770       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10771       result = (int)wrapper_HasThreadSupport();
10772       SWIG_PYTHON_THREAD_END_ALLOW;
10773     }
10774 #ifndef SED_HACKS
10775     if ( bUseExceptions ) {
10776       CPLErr eclass = CPLGetLastErrorType();
10777       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10778         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10779       }
10780     }
10781 #endif
10782   }
10783   resultobj = SWIG_From_int(static_cast< int >(result));
10784   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10785   return resultobj;
10786 fail:
10787   return NULL;
10788 }
10789 
10790 
_wrap_Mkdir(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10791 SWIGINTERN PyObject *_wrap_Mkdir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10792   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10793   char *arg1 = (char *) 0 ;
10794   int arg2 ;
10795   int bToFree1 = 0 ;
10796   int val2 ;
10797   int ecode2 = 0 ;
10798   PyObject * obj0 = 0 ;
10799   PyObject * obj1 = 0 ;
10800   VSI_RETVAL result;
10801 
10802   if (!PyArg_ParseTuple(args,(char *)"OO:Mkdir",&obj0,&obj1)) SWIG_fail;
10803   {
10804     /* %typemap(in) (const char *utf8_path) */
10805     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
10806     if (arg1 == NULL)
10807     {
10808       PyErr_SetString( PyExc_RuntimeError, "not a string" );
10809       SWIG_fail;
10810     }
10811   }
10812   ecode2 = SWIG_AsVal_int(obj1, &val2);
10813   if (!SWIG_IsOK(ecode2)) {
10814     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Mkdir" "', argument " "2"" of type '" "int""'");
10815   }
10816   arg2 = static_cast< int >(val2);
10817   {
10818     if (!arg1) {
10819       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10820     }
10821   }
10822   {
10823     if ( bUseExceptions ) {
10824       ClearErrorState();
10825     }
10826     {
10827       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10828       result = VSIMkdir((char const *)arg1,arg2);
10829       SWIG_PYTHON_THREAD_END_ALLOW;
10830     }
10831 #ifndef SED_HACKS
10832     if ( bUseExceptions ) {
10833       CPLErr eclass = CPLGetLastErrorType();
10834       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10835         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10836       }
10837     }
10838 #endif
10839   }
10840   {
10841     /* %typemap(out) VSI_RETVAL */
10842     if ( result != 0 && bUseExceptions) {
10843       const char* pszMessage = CPLGetLastErrorMsg();
10844       if( pszMessage[0] != '\0' )
10845       PyErr_SetString( PyExc_RuntimeError, pszMessage );
10846       else
10847       PyErr_SetString( PyExc_RuntimeError, "unknown error occurred" );
10848       SWIG_fail;
10849     }
10850   }
10851   {
10852     /* %typemap(freearg) (const char *utf8_path) */
10853     GDALPythonFreeCStr(arg1, bToFree1);
10854   }
10855   {
10856     /* %typemap(ret) VSI_RETVAL */
10857     resultobj = PyInt_FromLong( result );
10858   }
10859   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10860   return resultobj;
10861 fail:
10862   {
10863     /* %typemap(freearg) (const char *utf8_path) */
10864     GDALPythonFreeCStr(arg1, bToFree1);
10865   }
10866   return NULL;
10867 }
10868 
10869 
_wrap_Rmdir(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10870 SWIGINTERN PyObject *_wrap_Rmdir(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10871   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10872   char *arg1 = (char *) 0 ;
10873   int bToFree1 = 0 ;
10874   PyObject * obj0 = 0 ;
10875   VSI_RETVAL result;
10876 
10877   if (!PyArg_ParseTuple(args,(char *)"O:Rmdir",&obj0)) SWIG_fail;
10878   {
10879     /* %typemap(in) (const char *utf8_path) */
10880     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
10881     if (arg1 == NULL)
10882     {
10883       PyErr_SetString( PyExc_RuntimeError, "not a string" );
10884       SWIG_fail;
10885     }
10886   }
10887   {
10888     if (!arg1) {
10889       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10890     }
10891   }
10892   {
10893     if ( bUseExceptions ) {
10894       ClearErrorState();
10895     }
10896     {
10897       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10898       result = VSIRmdir((char const *)arg1);
10899       SWIG_PYTHON_THREAD_END_ALLOW;
10900     }
10901 #ifndef SED_HACKS
10902     if ( bUseExceptions ) {
10903       CPLErr eclass = CPLGetLastErrorType();
10904       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10905         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10906       }
10907     }
10908 #endif
10909   }
10910   {
10911     /* %typemap(out) VSI_RETVAL */
10912     if ( result != 0 && bUseExceptions) {
10913       const char* pszMessage = CPLGetLastErrorMsg();
10914       if( pszMessage[0] != '\0' )
10915       PyErr_SetString( PyExc_RuntimeError, pszMessage );
10916       else
10917       PyErr_SetString( PyExc_RuntimeError, "unknown error occurred" );
10918       SWIG_fail;
10919     }
10920   }
10921   {
10922     /* %typemap(freearg) (const char *utf8_path) */
10923     GDALPythonFreeCStr(arg1, bToFree1);
10924   }
10925   {
10926     /* %typemap(ret) VSI_RETVAL */
10927     resultobj = PyInt_FromLong( result );
10928   }
10929   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
10930   return resultobj;
10931 fail:
10932   {
10933     /* %typemap(freearg) (const char *utf8_path) */
10934     GDALPythonFreeCStr(arg1, bToFree1);
10935   }
10936   return NULL;
10937 }
10938 
10939 
_wrap_MkdirRecursive(PyObject * SWIGUNUSEDPARM (self),PyObject * args)10940 SWIGINTERN PyObject *_wrap_MkdirRecursive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10941   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
10942   char *arg1 = (char *) 0 ;
10943   int arg2 ;
10944   int bToFree1 = 0 ;
10945   int val2 ;
10946   int ecode2 = 0 ;
10947   PyObject * obj0 = 0 ;
10948   PyObject * obj1 = 0 ;
10949   VSI_RETVAL result;
10950 
10951   if (!PyArg_ParseTuple(args,(char *)"OO:MkdirRecursive",&obj0,&obj1)) SWIG_fail;
10952   {
10953     /* %typemap(in) (const char *utf8_path) */
10954     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
10955     if (arg1 == NULL)
10956     {
10957       PyErr_SetString( PyExc_RuntimeError, "not a string" );
10958       SWIG_fail;
10959     }
10960   }
10961   ecode2 = SWIG_AsVal_int(obj1, &val2);
10962   if (!SWIG_IsOK(ecode2)) {
10963     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MkdirRecursive" "', argument " "2"" of type '" "int""'");
10964   }
10965   arg2 = static_cast< int >(val2);
10966   {
10967     if (!arg1) {
10968       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
10969     }
10970   }
10971   {
10972     if ( bUseExceptions ) {
10973       ClearErrorState();
10974     }
10975     {
10976       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
10977       result = VSIMkdirRecursive((char const *)arg1,arg2);
10978       SWIG_PYTHON_THREAD_END_ALLOW;
10979     }
10980 #ifndef SED_HACKS
10981     if ( bUseExceptions ) {
10982       CPLErr eclass = CPLGetLastErrorType();
10983       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
10984         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
10985       }
10986     }
10987 #endif
10988   }
10989   {
10990     /* %typemap(out) VSI_RETVAL */
10991     if ( result != 0 && bUseExceptions) {
10992       const char* pszMessage = CPLGetLastErrorMsg();
10993       if( pszMessage[0] != '\0' )
10994       PyErr_SetString( PyExc_RuntimeError, pszMessage );
10995       else
10996       PyErr_SetString( PyExc_RuntimeError, "unknown error occurred" );
10997       SWIG_fail;
10998     }
10999   }
11000   {
11001     /* %typemap(freearg) (const char *utf8_path) */
11002     GDALPythonFreeCStr(arg1, bToFree1);
11003   }
11004   {
11005     /* %typemap(ret) VSI_RETVAL */
11006     resultobj = PyInt_FromLong( result );
11007   }
11008   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11009   return resultobj;
11010 fail:
11011   {
11012     /* %typemap(freearg) (const char *utf8_path) */
11013     GDALPythonFreeCStr(arg1, bToFree1);
11014   }
11015   return NULL;
11016 }
11017 
11018 
_wrap_RmdirRecursive(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11019 SWIGINTERN PyObject *_wrap_RmdirRecursive(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11020   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11021   char *arg1 = (char *) 0 ;
11022   int bToFree1 = 0 ;
11023   PyObject * obj0 = 0 ;
11024   VSI_RETVAL result;
11025 
11026   if (!PyArg_ParseTuple(args,(char *)"O:RmdirRecursive",&obj0)) SWIG_fail;
11027   {
11028     /* %typemap(in) (const char *utf8_path) */
11029     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11030     if (arg1 == NULL)
11031     {
11032       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11033       SWIG_fail;
11034     }
11035   }
11036   {
11037     if (!arg1) {
11038       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11039     }
11040   }
11041   {
11042     if ( bUseExceptions ) {
11043       ClearErrorState();
11044     }
11045     {
11046       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11047       result = VSIRmdirRecursive((char const *)arg1);
11048       SWIG_PYTHON_THREAD_END_ALLOW;
11049     }
11050 #ifndef SED_HACKS
11051     if ( bUseExceptions ) {
11052       CPLErr eclass = CPLGetLastErrorType();
11053       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11054         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11055       }
11056     }
11057 #endif
11058   }
11059   {
11060     /* %typemap(out) VSI_RETVAL */
11061     if ( result != 0 && bUseExceptions) {
11062       const char* pszMessage = CPLGetLastErrorMsg();
11063       if( pszMessage[0] != '\0' )
11064       PyErr_SetString( PyExc_RuntimeError, pszMessage );
11065       else
11066       PyErr_SetString( PyExc_RuntimeError, "unknown error occurred" );
11067       SWIG_fail;
11068     }
11069   }
11070   {
11071     /* %typemap(freearg) (const char *utf8_path) */
11072     GDALPythonFreeCStr(arg1, bToFree1);
11073   }
11074   {
11075     /* %typemap(ret) VSI_RETVAL */
11076     resultobj = PyInt_FromLong( result );
11077   }
11078   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11079   return resultobj;
11080 fail:
11081   {
11082     /* %typemap(freearg) (const char *utf8_path) */
11083     GDALPythonFreeCStr(arg1, bToFree1);
11084   }
11085   return NULL;
11086 }
11087 
11088 
_wrap_Rename(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11089 SWIGINTERN PyObject *_wrap_Rename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11090   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11091   char *arg1 = (char *) 0 ;
11092   char *arg2 = (char *) 0 ;
11093   int bToFree1 = 0 ;
11094   int bToFree2 = 0 ;
11095   PyObject * obj0 = 0 ;
11096   PyObject * obj1 = 0 ;
11097   VSI_RETVAL result;
11098 
11099   if (!PyArg_ParseTuple(args,(char *)"OO:Rename",&obj0,&obj1)) SWIG_fail;
11100   {
11101     /* %typemap(in) (const char *utf8_path) */
11102     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11103     if (arg1 == NULL)
11104     {
11105       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11106       SWIG_fail;
11107     }
11108   }
11109   {
11110     /* %typemap(in) (const char *utf8_path) */
11111     arg2 = GDALPythonObjectToCStr( obj1, &bToFree2 );
11112     if (arg2 == NULL)
11113     {
11114       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11115       SWIG_fail;
11116     }
11117   }
11118   {
11119     if (!arg1) {
11120       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11121     }
11122   }
11123   {
11124     if (!arg2) {
11125       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11126     }
11127   }
11128   {
11129     if ( bUseExceptions ) {
11130       ClearErrorState();
11131     }
11132     {
11133       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11134       result = VSIRename((char const *)arg1,(char const *)arg2);
11135       SWIG_PYTHON_THREAD_END_ALLOW;
11136     }
11137 #ifndef SED_HACKS
11138     if ( bUseExceptions ) {
11139       CPLErr eclass = CPLGetLastErrorType();
11140       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11141         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11142       }
11143     }
11144 #endif
11145   }
11146   {
11147     /* %typemap(out) VSI_RETVAL */
11148     if ( result != 0 && bUseExceptions) {
11149       const char* pszMessage = CPLGetLastErrorMsg();
11150       if( pszMessage[0] != '\0' )
11151       PyErr_SetString( PyExc_RuntimeError, pszMessage );
11152       else
11153       PyErr_SetString( PyExc_RuntimeError, "unknown error occurred" );
11154       SWIG_fail;
11155     }
11156   }
11157   {
11158     /* %typemap(freearg) (const char *utf8_path) */
11159     GDALPythonFreeCStr(arg1, bToFree1);
11160   }
11161   {
11162     /* %typemap(freearg) (const char *utf8_path) */
11163     GDALPythonFreeCStr(arg2, bToFree2);
11164   }
11165   {
11166     /* %typemap(ret) VSI_RETVAL */
11167     resultobj = PyInt_FromLong( result );
11168   }
11169   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11170   return resultobj;
11171 fail:
11172   {
11173     /* %typemap(freearg) (const char *utf8_path) */
11174     GDALPythonFreeCStr(arg1, bToFree1);
11175   }
11176   {
11177     /* %typemap(freearg) (const char *utf8_path) */
11178     GDALPythonFreeCStr(arg2, bToFree2);
11179   }
11180   return NULL;
11181 }
11182 
11183 
_wrap_Sync(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)11184 SWIGINTERN PyObject *_wrap_Sync(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
11185   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11186   char *arg1 = (char *) 0 ;
11187   char *arg2 = (char *) 0 ;
11188   char **arg3 = (char **) NULL ;
11189   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
11190   void *arg5 = (void *) NULL ;
11191   int bToFree1 = 0 ;
11192   int bToFree2 = 0 ;
11193   PyObject * obj0 = 0 ;
11194   PyObject * obj1 = 0 ;
11195   PyObject * obj2 = 0 ;
11196   PyObject * obj3 = 0 ;
11197   PyObject * obj4 = 0 ;
11198   char *  kwnames[] = {
11199     (char *) "pszSource",(char *) "pszTarget",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
11200   };
11201   bool result;
11202 
11203   /* %typemap(arginit) ( const char* callback_data=NULL)  */
11204   PyProgressData *psProgressInfo;
11205   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
11206   psProgressInfo->nLastReported = -1;
11207   psProgressInfo->psPyCallback = NULL;
11208   psProgressInfo->psPyCallbackData = NULL;
11209   arg5 = psProgressInfo;
11210   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOO:Sync",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
11211   {
11212     /* %typemap(in) (const char *utf8_path) */
11213     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11214     if (arg1 == NULL)
11215     {
11216       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11217       SWIG_fail;
11218     }
11219   }
11220   {
11221     /* %typemap(in) (const char *utf8_path) */
11222     arg2 = GDALPythonObjectToCStr( obj1, &bToFree2 );
11223     if (arg2 == NULL)
11224     {
11225       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11226       SWIG_fail;
11227     }
11228   }
11229   if (obj2) {
11230     {
11231       /* %typemap(in) char **options */
11232       int bErr = FALSE;
11233       arg3 = CSLFromPySequence(obj2, &bErr);
11234       if( bErr )
11235       {
11236         SWIG_fail;
11237       }
11238     }
11239   }
11240   if (obj3) {
11241     {
11242       /* %typemap(in) (GDALProgressFunc callback = NULL) */
11243       /* callback_func typemap */
11244 
11245       /* In some cases 0 is passed instead of None. */
11246       /* See https://github.com/OSGeo/gdal/pull/219 */
11247       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
11248       {
11249         if( PyLong_AsLong(obj3) == 0 )
11250         {
11251           obj3 = Py_None;
11252         }
11253       }
11254 
11255       if (obj3 && obj3 != Py_None ) {
11256         void* cbfunction = NULL;
11257         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
11258             (void**)&cbfunction,
11259             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
11260             SWIG_POINTER_EXCEPTION | 0 ));
11261 
11262         if ( cbfunction == GDALTermProgress ) {
11263           arg4 = GDALTermProgress;
11264         } else {
11265           if (!PyCallable_Check(obj3)) {
11266             PyErr_SetString( PyExc_RuntimeError,
11267               "Object given is not a Python function" );
11268             SWIG_fail;
11269           }
11270           psProgressInfo->psPyCallback = obj3;
11271           arg4 = PyProgressProxy;
11272         }
11273 
11274       }
11275 
11276     }
11277   }
11278   if (obj4) {
11279     {
11280       /* %typemap(in) ( void* callback_data=NULL)  */
11281       psProgressInfo->psPyCallbackData = obj4 ;
11282     }
11283   }
11284   {
11285     if (!arg1) {
11286       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11287     }
11288   }
11289   {
11290     if (!arg2) {
11291       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11292     }
11293   }
11294   {
11295     if ( bUseExceptions ) {
11296       ClearErrorState();
11297     }
11298     {
11299       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11300       result = (bool)wrapper_VSISync((char const *)arg1,(char const *)arg2,arg3,arg4,arg5);
11301       SWIG_PYTHON_THREAD_END_ALLOW;
11302     }
11303 #ifndef SED_HACKS
11304     if ( bUseExceptions ) {
11305       CPLErr eclass = CPLGetLastErrorType();
11306       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11307         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11308       }
11309     }
11310 #endif
11311   }
11312   resultobj = SWIG_From_bool(static_cast< bool >(result));
11313   {
11314     /* %typemap(freearg) (const char *utf8_path) */
11315     GDALPythonFreeCStr(arg1, bToFree1);
11316   }
11317   {
11318     /* %typemap(freearg) (const char *utf8_path) */
11319     GDALPythonFreeCStr(arg2, bToFree2);
11320   }
11321   {
11322     /* %typemap(freearg) char **options */
11323     CSLDestroy( arg3 );
11324   }
11325   {
11326     /* %typemap(freearg) ( void* callback_data=NULL)  */
11327 
11328     CPLFree(psProgressInfo);
11329 
11330   }
11331   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11332   return resultobj;
11333 fail:
11334   {
11335     /* %typemap(freearg) (const char *utf8_path) */
11336     GDALPythonFreeCStr(arg1, bToFree1);
11337   }
11338   {
11339     /* %typemap(freearg) (const char *utf8_path) */
11340     GDALPythonFreeCStr(arg2, bToFree2);
11341   }
11342   {
11343     /* %typemap(freearg) char **options */
11344     CSLDestroy( arg3 );
11345   }
11346   {
11347     /* %typemap(freearg) ( void* callback_data=NULL)  */
11348 
11349     CPLFree(psProgressInfo);
11350 
11351   }
11352   return NULL;
11353 }
11354 
11355 
_wrap_GetActualURL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11356 SWIGINTERN PyObject *_wrap_GetActualURL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11357   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11358   char *arg1 = (char *) 0 ;
11359   int bToFree1 = 0 ;
11360   PyObject * obj0 = 0 ;
11361   char *result = 0 ;
11362 
11363   if (!PyArg_ParseTuple(args,(char *)"O:GetActualURL",&obj0)) SWIG_fail;
11364   {
11365     /* %typemap(in) (const char *utf8_path) */
11366     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11367     if (arg1 == NULL)
11368     {
11369       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11370       SWIG_fail;
11371     }
11372   }
11373   {
11374     if (!arg1) {
11375       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11376     }
11377   }
11378   {
11379     if ( bUseExceptions ) {
11380       ClearErrorState();
11381     }
11382     {
11383       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11384       result = (char *)VSIGetActualURL((char const *)arg1);
11385       SWIG_PYTHON_THREAD_END_ALLOW;
11386     }
11387 #ifndef SED_HACKS
11388     if ( bUseExceptions ) {
11389       CPLErr eclass = CPLGetLastErrorType();
11390       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11391         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11392       }
11393     }
11394 #endif
11395   }
11396   resultobj = SWIG_FromCharPtr((const char *)result);
11397   {
11398     /* %typemap(freearg) (const char *utf8_path) */
11399     GDALPythonFreeCStr(arg1, bToFree1);
11400   }
11401   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11402   return resultobj;
11403 fail:
11404   {
11405     /* %typemap(freearg) (const char *utf8_path) */
11406     GDALPythonFreeCStr(arg1, bToFree1);
11407   }
11408   return NULL;
11409 }
11410 
11411 
_wrap_GetSignedURL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11412 SWIGINTERN PyObject *_wrap_GetSignedURL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11413   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11414   char *arg1 = (char *) 0 ;
11415   char **arg2 = (char **) NULL ;
11416   int bToFree1 = 0 ;
11417   PyObject * obj0 = 0 ;
11418   PyObject * obj1 = 0 ;
11419   retStringAndCPLFree *result = 0 ;
11420 
11421   if (!PyArg_ParseTuple(args,(char *)"O|O:GetSignedURL",&obj0,&obj1)) SWIG_fail;
11422   {
11423     /* %typemap(in) (const char *utf8_path) */
11424     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11425     if (arg1 == NULL)
11426     {
11427       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11428       SWIG_fail;
11429     }
11430   }
11431   if (obj1) {
11432     {
11433       /* %typemap(in) char **options */
11434       int bErr = FALSE;
11435       arg2 = CSLFromPySequence(obj1, &bErr);
11436       if( bErr )
11437       {
11438         SWIG_fail;
11439       }
11440     }
11441   }
11442   {
11443     if (!arg1) {
11444       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11445     }
11446   }
11447   {
11448     if ( bUseExceptions ) {
11449       ClearErrorState();
11450     }
11451     {
11452       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11453       result = (retStringAndCPLFree *)wrapper_VSIGetSignedURL((char const *)arg1,arg2);
11454       SWIG_PYTHON_THREAD_END_ALLOW;
11455     }
11456 #ifndef SED_HACKS
11457     if ( bUseExceptions ) {
11458       CPLErr eclass = CPLGetLastErrorType();
11459       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11460         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11461       }
11462     }
11463 #endif
11464   }
11465   {
11466     /* %typemap(out) (retStringAndCPLFree*) */
11467     Py_XDECREF(resultobj);
11468     if(result)
11469     {
11470       resultobj = GDALPythonObjectFromCStr( (const char *)result);
11471       CPLFree(result);
11472     }
11473     else
11474     {
11475       resultobj = Py_None;
11476       Py_INCREF(resultobj);
11477     }
11478   }
11479   {
11480     /* %typemap(freearg) (const char *utf8_path) */
11481     GDALPythonFreeCStr(arg1, bToFree1);
11482   }
11483   {
11484     /* %typemap(freearg) char **options */
11485     CSLDestroy( arg2 );
11486   }
11487   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11488   return resultobj;
11489 fail:
11490   {
11491     /* %typemap(freearg) (const char *utf8_path) */
11492     GDALPythonFreeCStr(arg1, bToFree1);
11493   }
11494   {
11495     /* %typemap(freearg) char **options */
11496     CSLDestroy( arg2 );
11497   }
11498   return NULL;
11499 }
11500 
11501 
_wrap_GetFileSystemsPrefixes(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11502 SWIGINTERN PyObject *_wrap_GetFileSystemsPrefixes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11503   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11504   char **result = 0 ;
11505 
11506   if (!PyArg_ParseTuple(args,(char *)":GetFileSystemsPrefixes")) SWIG_fail;
11507   {
11508     if ( bUseExceptions ) {
11509       ClearErrorState();
11510     }
11511     {
11512       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11513       result = (char **)VSIGetFileSystemsPrefixes();
11514       SWIG_PYTHON_THREAD_END_ALLOW;
11515     }
11516 #ifndef SED_HACKS
11517     if ( bUseExceptions ) {
11518       CPLErr eclass = CPLGetLastErrorType();
11519       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11520         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11521       }
11522     }
11523 #endif
11524   }
11525   {
11526     /* %typemap(out) char **CSL -> ( string ) */
11527     char **stringarray = result;
11528     if ( stringarray == NULL ) {
11529       resultobj = Py_None;
11530       Py_INCREF( resultobj );
11531     }
11532     else {
11533       int len = CSLCount( stringarray );
11534       resultobj = PyList_New( len );
11535       for ( int i = 0; i < len; ++i ) {
11536         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
11537         PyList_SetItem(resultobj, i, o );
11538       }
11539     }
11540     CSLDestroy(result);
11541   }
11542   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11543   return resultobj;
11544 fail:
11545   return NULL;
11546 }
11547 
11548 
_wrap_GetFileSystemOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11549 SWIGINTERN PyObject *_wrap_GetFileSystemOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11550   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11551   char *arg1 = (char *) 0 ;
11552   int bToFree1 = 0 ;
11553   PyObject * obj0 = 0 ;
11554   char *result = 0 ;
11555 
11556   if (!PyArg_ParseTuple(args,(char *)"O:GetFileSystemOptions",&obj0)) SWIG_fail;
11557   {
11558     /* %typemap(in) (const char *utf8_path) */
11559     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11560     if (arg1 == NULL)
11561     {
11562       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11563       SWIG_fail;
11564     }
11565   }
11566   {
11567     if (!arg1) {
11568       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11569     }
11570   }
11571   {
11572     if ( bUseExceptions ) {
11573       ClearErrorState();
11574     }
11575     {
11576       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11577       result = (char *)VSIGetFileSystemOptions((char const *)arg1);
11578       SWIG_PYTHON_THREAD_END_ALLOW;
11579     }
11580 #ifndef SED_HACKS
11581     if ( bUseExceptions ) {
11582       CPLErr eclass = CPLGetLastErrorType();
11583       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11584         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11585       }
11586     }
11587 #endif
11588   }
11589   resultobj = SWIG_FromCharPtr((const char *)result);
11590   {
11591     /* %typemap(freearg) (const char *utf8_path) */
11592     GDALPythonFreeCStr(arg1, bToFree1);
11593   }
11594   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11595   return resultobj;
11596 fail:
11597   {
11598     /* %typemap(freearg) (const char *utf8_path) */
11599     GDALPythonFreeCStr(arg1, bToFree1);
11600   }
11601   return NULL;
11602 }
11603 
11604 
VSILFILE_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11605 SWIGINTERN PyObject *VSILFILE_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11606   PyObject *obj;
11607   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
11608   SWIG_TypeNewClientData(SWIGTYPE_p_VSILFILE, SWIG_NewClientData(obj));
11609   return SWIG_Py_Void();
11610 }
11611 
_wrap_StatBuf_mode_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11612 SWIGINTERN PyObject *_wrap_StatBuf_mode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11613   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11614   StatBuf *arg1 = (StatBuf *) 0 ;
11615   void *argp1 = 0 ;
11616   int res1 = 0 ;
11617   PyObject * obj0 = 0 ;
11618   int result;
11619 
11620   if (!PyArg_ParseTuple(args,(char *)"O:StatBuf_mode_get",&obj0)) SWIG_fail;
11621   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StatBuf, 0 |  0 );
11622   if (!SWIG_IsOK(res1)) {
11623     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StatBuf_mode_get" "', argument " "1"" of type '" "StatBuf *""'");
11624   }
11625   arg1 = reinterpret_cast< StatBuf * >(argp1);
11626   {
11627     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11628     result = (int) ((arg1)->mode);
11629     SWIG_PYTHON_THREAD_END_ALLOW;
11630   }
11631   resultobj = SWIG_From_int(static_cast< int >(result));
11632   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11633   return resultobj;
11634 fail:
11635   return NULL;
11636 }
11637 
11638 
_wrap_StatBuf_size_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11639 SWIGINTERN PyObject *_wrap_StatBuf_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11640   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11641   StatBuf *arg1 = (StatBuf *) 0 ;
11642   void *argp1 = 0 ;
11643   int res1 = 0 ;
11644   PyObject * obj0 = 0 ;
11645   GIntBig result;
11646 
11647   if (!PyArg_ParseTuple(args,(char *)"O:StatBuf_size_get",&obj0)) SWIG_fail;
11648   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StatBuf, 0 |  0 );
11649   if (!SWIG_IsOK(res1)) {
11650     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StatBuf_size_get" "', argument " "1"" of type '" "StatBuf *""'");
11651   }
11652   arg1 = reinterpret_cast< StatBuf * >(argp1);
11653   {
11654     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11655     result =  ((arg1)->size);
11656     SWIG_PYTHON_THREAD_END_ALLOW;
11657   }
11658   {
11659     char szTmp[32];
11660     sprintf(szTmp, CPL_FRMT_GIB, result);
11661     resultobj = PyLong_FromString(szTmp, NULL, 10);
11662   }
11663   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11664   return resultobj;
11665 fail:
11666   return NULL;
11667 }
11668 
11669 
_wrap_StatBuf_mtime_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11670 SWIGINTERN PyObject *_wrap_StatBuf_mtime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11671   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11672   StatBuf *arg1 = (StatBuf *) 0 ;
11673   void *argp1 = 0 ;
11674   int res1 = 0 ;
11675   PyObject * obj0 = 0 ;
11676   GIntBig result;
11677 
11678   if (!PyArg_ParseTuple(args,(char *)"O:StatBuf_mtime_get",&obj0)) SWIG_fail;
11679   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StatBuf, 0 |  0 );
11680   if (!SWIG_IsOK(res1)) {
11681     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StatBuf_mtime_get" "', argument " "1"" of type '" "StatBuf *""'");
11682   }
11683   arg1 = reinterpret_cast< StatBuf * >(argp1);
11684   {
11685     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11686     result =  ((arg1)->mtime);
11687     SWIG_PYTHON_THREAD_END_ALLOW;
11688   }
11689   {
11690     char szTmp[32];
11691     sprintf(szTmp, CPL_FRMT_GIB, result);
11692     resultobj = PyLong_FromString(szTmp, NULL, 10);
11693   }
11694   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11695   return resultobj;
11696 fail:
11697   return NULL;
11698 }
11699 
11700 
_wrap_new_StatBuf(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11701 SWIGINTERN PyObject *_wrap_new_StatBuf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11702   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11703   StatBuf *arg1 = (StatBuf *) 0 ;
11704   void *argp1 = 0 ;
11705   int res1 = 0 ;
11706   PyObject * obj0 = 0 ;
11707   StatBuf *result = 0 ;
11708 
11709   if (!PyArg_ParseTuple(args,(char *)"O:new_StatBuf",&obj0)) SWIG_fail;
11710   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StatBuf, 0 |  0 );
11711   if (!SWIG_IsOK(res1)) {
11712     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_StatBuf" "', argument " "1"" of type '" "StatBuf *""'");
11713   }
11714   arg1 = reinterpret_cast< StatBuf * >(argp1);
11715   {
11716     if ( bUseExceptions ) {
11717       ClearErrorState();
11718     }
11719     {
11720       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11721       result = (StatBuf *)new_StatBuf(arg1);
11722       SWIG_PYTHON_THREAD_END_ALLOW;
11723     }
11724 #ifndef SED_HACKS
11725     if ( bUseExceptions ) {
11726       CPLErr eclass = CPLGetLastErrorType();
11727       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11728         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11729       }
11730     }
11731 #endif
11732   }
11733   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_StatBuf, SWIG_POINTER_NEW |  0 );
11734   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11735   return resultobj;
11736 fail:
11737   return NULL;
11738 }
11739 
11740 
_wrap_delete_StatBuf(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11741 SWIGINTERN PyObject *_wrap_delete_StatBuf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11742   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11743   StatBuf *arg1 = (StatBuf *) 0 ;
11744   void *argp1 = 0 ;
11745   int res1 = 0 ;
11746   PyObject * obj0 = 0 ;
11747 
11748   if (!PyArg_ParseTuple(args,(char *)"O:delete_StatBuf",&obj0)) SWIG_fail;
11749   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StatBuf, SWIG_POINTER_DISOWN |  0 );
11750   if (!SWIG_IsOK(res1)) {
11751     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StatBuf" "', argument " "1"" of type '" "StatBuf *""'");
11752   }
11753   arg1 = reinterpret_cast< StatBuf * >(argp1);
11754   {
11755     if ( bUseExceptions ) {
11756       ClearErrorState();
11757     }
11758     {
11759       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11760       delete_StatBuf(arg1);
11761       SWIG_PYTHON_THREAD_END_ALLOW;
11762     }
11763 #ifndef SED_HACKS
11764     if ( bUseExceptions ) {
11765       CPLErr eclass = CPLGetLastErrorType();
11766       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11767         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11768       }
11769     }
11770 #endif
11771   }
11772   resultobj = SWIG_Py_Void();
11773   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11774   return resultobj;
11775 fail:
11776   return NULL;
11777 }
11778 
11779 
_wrap_StatBuf_IsDirectory(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11780 SWIGINTERN PyObject *_wrap_StatBuf_IsDirectory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11781   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11782   StatBuf *arg1 = (StatBuf *) 0 ;
11783   void *argp1 = 0 ;
11784   int res1 = 0 ;
11785   PyObject * obj0 = 0 ;
11786   int result;
11787 
11788   if (!PyArg_ParseTuple(args,(char *)"O:StatBuf_IsDirectory",&obj0)) SWIG_fail;
11789   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_StatBuf, 0 |  0 );
11790   if (!SWIG_IsOK(res1)) {
11791     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StatBuf_IsDirectory" "', argument " "1"" of type '" "StatBuf *""'");
11792   }
11793   arg1 = reinterpret_cast< StatBuf * >(argp1);
11794   {
11795     if ( bUseExceptions ) {
11796       ClearErrorState();
11797     }
11798     {
11799       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11800       result = (int)StatBuf_IsDirectory(arg1);
11801       SWIG_PYTHON_THREAD_END_ALLOW;
11802     }
11803 #ifndef SED_HACKS
11804     if ( bUseExceptions ) {
11805       CPLErr eclass = CPLGetLastErrorType();
11806       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11807         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11808       }
11809     }
11810 #endif
11811   }
11812   resultobj = SWIG_From_int(static_cast< int >(result));
11813   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11814   return resultobj;
11815 fail:
11816   return NULL;
11817 }
11818 
11819 
StatBuf_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11820 SWIGINTERN PyObject *StatBuf_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11821   PyObject *obj;
11822   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
11823   SWIG_TypeNewClientData(SWIGTYPE_p_StatBuf, SWIG_NewClientData(obj));
11824   return SWIG_Py_Void();
11825 }
11826 
_wrap_VSIStatL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11827 SWIGINTERN PyObject *_wrap_VSIStatL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11828   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11829   char *arg1 = (char *) 0 ;
11830   StatBuf *arg2 = (StatBuf *) 0 ;
11831   int arg3 = (int) 0 ;
11832   int bToFree1 = 0 ;
11833   StatBuf sStatBuf2 ;
11834   int val3 ;
11835   int ecode3 = 0 ;
11836   PyObject * obj0 = 0 ;
11837   PyObject * obj1 = 0 ;
11838   int result;
11839 
11840   {
11841     /* %typemap(in,numinputs=0) (StatBuf *psStatBufOut) (StatBuf sStatBuf2 ) */
11842     arg2 = &sStatBuf2;
11843   }
11844   if (!PyArg_ParseTuple(args,(char *)"O|O:VSIStatL",&obj0,&obj1)) SWIG_fail;
11845   {
11846     /* %typemap(in) (const char *utf8_path) */
11847     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11848     if (arg1 == NULL)
11849     {
11850       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11851       SWIG_fail;
11852     }
11853   }
11854   if (obj1) {
11855     ecode3 = SWIG_AsVal_int(obj1, &val3);
11856     if (!SWIG_IsOK(ecode3)) {
11857       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VSIStatL" "', argument " "3"" of type '" "int""'");
11858     }
11859     arg3 = static_cast< int >(val3);
11860   }
11861   {
11862     if (!arg1) {
11863       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11864     }
11865   }
11866   {
11867     if ( bUseExceptions ) {
11868       ClearErrorState();
11869     }
11870     {
11871       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11872       result = (int)wrapper_VSIStatL((char const *)arg1,arg2,arg3);
11873       SWIG_PYTHON_THREAD_END_ALLOW;
11874     }
11875 #ifndef SED_HACKS
11876     if ( bUseExceptions ) {
11877       CPLErr eclass = CPLGetLastErrorType();
11878       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11879         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11880       }
11881     }
11882 #endif
11883   }
11884   resultobj = SWIG_From_int(static_cast< int >(result));
11885   {
11886     /* %typemap(argout) (StatBuf *psStatBufOut)*/
11887     Py_DECREF(resultobj);
11888     if (result == 0)
11889     resultobj = SWIG_NewPointerObj((void*)new_StatBuf( arg2 ),SWIGTYPE_p_StatBuf,1);
11890     else
11891     {
11892       resultobj = Py_None;
11893       Py_INCREF(resultobj);
11894     }
11895   }
11896   {
11897     /* %typemap(freearg) (const char *utf8_path) */
11898     GDALPythonFreeCStr(arg1, bToFree1);
11899   }
11900   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
11901   return resultobj;
11902 fail:
11903   {
11904     /* %typemap(freearg) (const char *utf8_path) */
11905     GDALPythonFreeCStr(arg1, bToFree1);
11906   }
11907   return NULL;
11908 }
11909 
11910 
_wrap_GetFileMetadata(PyObject * SWIGUNUSEDPARM (self),PyObject * args)11911 SWIGINTERN PyObject *_wrap_GetFileMetadata(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11912   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
11913   char *arg1 = (char *) 0 ;
11914   char *arg2 = (char *) 0 ;
11915   char **arg3 = (char **) NULL ;
11916   int bToFree1 = 0 ;
11917   int res2 ;
11918   char *buf2 = 0 ;
11919   int alloc2 = 0 ;
11920   PyObject * obj0 = 0 ;
11921   PyObject * obj1 = 0 ;
11922   PyObject * obj2 = 0 ;
11923   char **result = 0 ;
11924 
11925   if (!PyArg_ParseTuple(args,(char *)"OO|O:GetFileMetadata",&obj0,&obj1,&obj2)) SWIG_fail;
11926   {
11927     /* %typemap(in) (const char *utf8_path) */
11928     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
11929     if (arg1 == NULL)
11930     {
11931       PyErr_SetString( PyExc_RuntimeError, "not a string" );
11932       SWIG_fail;
11933     }
11934   }
11935   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
11936   if (!SWIG_IsOK(res2)) {
11937     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GetFileMetadata" "', argument " "2"" of type '" "char const *""'");
11938   }
11939   arg2 = reinterpret_cast< char * >(buf2);
11940   if (obj2) {
11941     {
11942       /* %typemap(in) char **options */
11943       int bErr = FALSE;
11944       arg3 = CSLFromPySequence(obj2, &bErr);
11945       if( bErr )
11946       {
11947         SWIG_fail;
11948       }
11949     }
11950   }
11951   {
11952     if (!arg1) {
11953       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
11954     }
11955   }
11956   {
11957     if ( bUseExceptions ) {
11958       ClearErrorState();
11959     }
11960     {
11961       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
11962       result = (char **)VSIGetFileMetadata((char const *)arg1,(char const *)arg2,arg3);
11963       SWIG_PYTHON_THREAD_END_ALLOW;
11964     }
11965 #ifndef SED_HACKS
11966     if ( bUseExceptions ) {
11967       CPLErr eclass = CPLGetLastErrorType();
11968       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
11969         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
11970       }
11971     }
11972 #endif
11973   }
11974   {
11975     /* %typemap(out) char **dict */
11976     char **stringarray = result;
11977     resultobj = PyDict_New();
11978     if ( stringarray != NULL ) {
11979       while (*stringarray != NULL ) {
11980         char const *valptr;
11981         char *keyptr;
11982         const char* pszSep = strchr( *stringarray, '=' );
11983         if ( pszSep != NULL) {
11984           keyptr = CPLStrdup(*stringarray);
11985           keyptr[pszSep - *stringarray] = '\0';
11986           valptr = pszSep + 1;
11987           PyObject *nm = GDALPythonObjectFromCStr( keyptr );
11988           PyObject *val = GDALPythonObjectFromCStr( valptr );
11989           PyDict_SetItem(resultobj, nm, val );
11990           Py_DECREF(nm);
11991           Py_DECREF(val);
11992           CPLFree( keyptr );
11993         }
11994         stringarray++;
11995       }
11996     }
11997   }
11998   {
11999     /* %typemap(freearg) (const char *utf8_path) */
12000     GDALPythonFreeCStr(arg1, bToFree1);
12001   }
12002   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12003   {
12004     /* %typemap(freearg) char **options */
12005     CSLDestroy( arg3 );
12006   }
12007   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12008   return resultobj;
12009 fail:
12010   {
12011     /* %typemap(freearg) (const char *utf8_path) */
12012     GDALPythonFreeCStr(arg1, bToFree1);
12013   }
12014   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12015   {
12016     /* %typemap(freearg) char **options */
12017     CSLDestroy( arg3 );
12018   }
12019   return NULL;
12020 }
12021 
12022 
_wrap_SetFileMetadata(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12023 SWIGINTERN PyObject *_wrap_SetFileMetadata(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12024   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12025   char *arg1 = (char *) 0 ;
12026   char **arg2 = (char **) 0 ;
12027   char *arg3 = (char *) 0 ;
12028   char **arg4 = (char **) NULL ;
12029   int bToFree1 = 0 ;
12030   int res3 ;
12031   char *buf3 = 0 ;
12032   int alloc3 = 0 ;
12033   PyObject * obj0 = 0 ;
12034   PyObject * obj1 = 0 ;
12035   PyObject * obj2 = 0 ;
12036   PyObject * obj3 = 0 ;
12037   bool result;
12038 
12039   if (!PyArg_ParseTuple(args,(char *)"OOO|O:SetFileMetadata",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
12040   {
12041     /* %typemap(in) (const char *utf8_path) */
12042     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
12043     if (arg1 == NULL)
12044     {
12045       PyErr_SetString( PyExc_RuntimeError, "not a string" );
12046       SWIG_fail;
12047     }
12048   }
12049   {
12050     /* %typemap(in) char **dict */
12051     arg2 = NULL;
12052     if ( PySequence_Check( obj1 ) ) {
12053       Py_ssize_t size = PySequence_Size(obj1);
12054       if( size != (int)size ) {
12055         PyErr_SetString(PyExc_TypeError, "too big sequence");
12056         SWIG_fail;
12057       }
12058       for (int i = 0; i < (int)size; i++) {
12059         PyObject* pyObj = PySequence_GetItem(obj1,i);
12060         int bFreeStr;
12061         char* pszStr = GDALPythonObjectToCStr(pyObj, &bFreeStr);
12062         if ( pszStr == NULL ) {
12063           Py_DECREF(pyObj);
12064           PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
12065           SWIG_fail;
12066         }
12067         arg2 = CSLAddString( arg2, pszStr );
12068         GDALPythonFreeCStr(pszStr, bFreeStr);
12069         Py_DECREF(pyObj);
12070       }
12071     }
12072     else if ( PyMapping_Check( obj1 ) ) {
12073       /* We need to use the dictionary form. */
12074       Py_ssize_t size = PyMapping_Length( obj1 );
12075       if ( size > 0 && size == (int)size) {
12076         PyObject *item_list = PyMapping_Items( obj1 );
12077         for( int i=0; i<(int)size; i++ ) {
12078           PyObject *it = PySequence_GetItem( item_list, i );
12079 
12080           PyObject *k, *v;
12081           if ( ! PyArg_ParseTuple( it, "OO", &k, &v ) ) {
12082             Py_DECREF(it);
12083             Py_DECREF(item_list);
12084             PyErr_SetString(PyExc_TypeError,"Cannot retrieve key/value");
12085             SWIG_fail;
12086           }
12087 
12088           PyObject* kStr = PyObject_Str(k);
12089           if( PyErr_Occurred() )
12090           {
12091             Py_DECREF(it);
12092             Py_DECREF(item_list);
12093             SWIG_fail;
12094           }
12095 
12096           PyObject* vStr;
12097           if( PyBytes_Check(v) )
12098           {
12099             vStr = v;
12100             Py_INCREF(vStr);
12101           }
12102           else
12103           {
12104             vStr = PyObject_Str(v);
12105             if( PyErr_Occurred() )
12106             {
12107               Py_DECREF(it);
12108               Py_DECREF(kStr);
12109               Py_DECREF(item_list);
12110               SWIG_fail;
12111             }
12112           }
12113 
12114           int bFreeK, bFreeV;
12115           char* pszK = GDALPythonObjectToCStr(kStr, &bFreeK);
12116           char* pszV = GDALPythonObjectToCStr(vStr, &bFreeV);
12117           if( pszK == NULL || pszV == NULL )
12118           {
12119             GDALPythonFreeCStr(pszK, bFreeK);
12120             GDALPythonFreeCStr(pszV, bFreeV);
12121             Py_DECREF(kStr);
12122             Py_DECREF(vStr);
12123             Py_DECREF(it);
12124             Py_DECREF(item_list);
12125             PyErr_SetString(PyExc_TypeError,"Cannot get key/value as string");
12126             SWIG_fail;
12127           }
12128           arg2 = CSLAddNameValue( arg2, pszK, pszV );
12129 
12130           GDALPythonFreeCStr(pszK, bFreeK);
12131           GDALPythonFreeCStr(pszV, bFreeV);
12132           Py_DECREF(kStr);
12133           Py_DECREF(vStr);
12134           Py_DECREF(it);
12135         }
12136         Py_DECREF(item_list);
12137       }
12138     }
12139     else {
12140       PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
12141       SWIG_fail;
12142     }
12143   }
12144   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
12145   if (!SWIG_IsOK(res3)) {
12146     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SetFileMetadata" "', argument " "3"" of type '" "char const *""'");
12147   }
12148   arg3 = reinterpret_cast< char * >(buf3);
12149   if (obj3) {
12150     {
12151       /* %typemap(in) char **options */
12152       int bErr = FALSE;
12153       arg4 = CSLFromPySequence(obj3, &bErr);
12154       if( bErr )
12155       {
12156         SWIG_fail;
12157       }
12158     }
12159   }
12160   {
12161     if (!arg1) {
12162       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12163     }
12164   }
12165   {
12166     if ( bUseExceptions ) {
12167       ClearErrorState();
12168     }
12169     {
12170       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12171       result = (bool)VSISetFileMetadata((char const *)arg1,arg2,(char const *)arg3,arg4);
12172       SWIG_PYTHON_THREAD_END_ALLOW;
12173     }
12174 #ifndef SED_HACKS
12175     if ( bUseExceptions ) {
12176       CPLErr eclass = CPLGetLastErrorType();
12177       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12178         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12179       }
12180     }
12181 #endif
12182   }
12183   resultobj = SWIG_From_bool(static_cast< bool >(result));
12184   {
12185     /* %typemap(freearg) (const char *utf8_path) */
12186     GDALPythonFreeCStr(arg1, bToFree1);
12187   }
12188   {
12189     /* %typemap(freearg) char **dict */
12190     CSLDestroy( arg2 );
12191   }
12192   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
12193   {
12194     /* %typemap(freearg) char **options */
12195     CSLDestroy( arg4 );
12196   }
12197   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12198   return resultobj;
12199 fail:
12200   {
12201     /* %typemap(freearg) (const char *utf8_path) */
12202     GDALPythonFreeCStr(arg1, bToFree1);
12203   }
12204   {
12205     /* %typemap(freearg) char **dict */
12206     CSLDestroy( arg2 );
12207   }
12208   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
12209   {
12210     /* %typemap(freearg) char **options */
12211     CSLDestroy( arg4 );
12212   }
12213   return NULL;
12214 }
12215 
12216 
_wrap_VSIFOpenL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12217 SWIGINTERN PyObject *_wrap_VSIFOpenL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12218   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12219   char *arg1 = (char *) 0 ;
12220   char *arg2 = (char *) 0 ;
12221   int bToFree1 = 0 ;
12222   int res2 ;
12223   char *buf2 = 0 ;
12224   int alloc2 = 0 ;
12225   PyObject * obj0 = 0 ;
12226   PyObject * obj1 = 0 ;
12227   VSILFILE *result = 0 ;
12228 
12229   if (!PyArg_ParseTuple(args,(char *)"OO:VSIFOpenL",&obj0,&obj1)) SWIG_fail;
12230   {
12231     /* %typemap(in) (const char *utf8_path) */
12232     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
12233     if (arg1 == NULL)
12234     {
12235       PyErr_SetString( PyExc_RuntimeError, "not a string" );
12236       SWIG_fail;
12237     }
12238   }
12239   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
12240   if (!SWIG_IsOK(res2)) {
12241     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VSIFOpenL" "', argument " "2"" of type '" "char const *""'");
12242   }
12243   arg2 = reinterpret_cast< char * >(buf2);
12244   {
12245     if (!arg1) {
12246       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12247     }
12248   }
12249   {
12250     if ( bUseExceptions ) {
12251       ClearErrorState();
12252     }
12253     {
12254       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12255       result = (VSILFILE *)wrapper_VSIFOpenL((char const *)arg1,(char const *)arg2);
12256       SWIG_PYTHON_THREAD_END_ALLOW;
12257     }
12258 #ifndef SED_HACKS
12259     if ( bUseExceptions ) {
12260       CPLErr eclass = CPLGetLastErrorType();
12261       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12262         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12263       }
12264     }
12265 #endif
12266   }
12267   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_VSILFILE, 0 |  0 );
12268   {
12269     /* %typemap(freearg) (const char *utf8_path) */
12270     GDALPythonFreeCStr(arg1, bToFree1);
12271   }
12272   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12273   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12274   return resultobj;
12275 fail:
12276   {
12277     /* %typemap(freearg) (const char *utf8_path) */
12278     GDALPythonFreeCStr(arg1, bToFree1);
12279   }
12280   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12281   return NULL;
12282 }
12283 
12284 
_wrap_VSIFOpenExL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12285 SWIGINTERN PyObject *_wrap_VSIFOpenExL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12286   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12287   char *arg1 = (char *) 0 ;
12288   char *arg2 = (char *) 0 ;
12289   int arg3 = (int) FALSE ;
12290   char **arg4 = (char **) NULL ;
12291   int bToFree1 = 0 ;
12292   int res2 ;
12293   char *buf2 = 0 ;
12294   int alloc2 = 0 ;
12295   int val3 ;
12296   int ecode3 = 0 ;
12297   PyObject * obj0 = 0 ;
12298   PyObject * obj1 = 0 ;
12299   PyObject * obj2 = 0 ;
12300   PyObject * obj3 = 0 ;
12301   VSILFILE *result = 0 ;
12302 
12303   if (!PyArg_ParseTuple(args,(char *)"OO|OO:VSIFOpenExL",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
12304   {
12305     /* %typemap(in) (const char *utf8_path) */
12306     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
12307     if (arg1 == NULL)
12308     {
12309       PyErr_SetString( PyExc_RuntimeError, "not a string" );
12310       SWIG_fail;
12311     }
12312   }
12313   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
12314   if (!SWIG_IsOK(res2)) {
12315     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VSIFOpenExL" "', argument " "2"" of type '" "char const *""'");
12316   }
12317   arg2 = reinterpret_cast< char * >(buf2);
12318   if (obj2) {
12319     ecode3 = SWIG_AsVal_int(obj2, &val3);
12320     if (!SWIG_IsOK(ecode3)) {
12321       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VSIFOpenExL" "', argument " "3"" of type '" "int""'");
12322     }
12323     arg3 = static_cast< int >(val3);
12324   }
12325   if (obj3) {
12326     {
12327       /* %typemap(in) char **options */
12328       int bErr = FALSE;
12329       arg4 = CSLFromPySequence(obj3, &bErr);
12330       if( bErr )
12331       {
12332         SWIG_fail;
12333       }
12334     }
12335   }
12336   {
12337     if (!arg1) {
12338       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12339     }
12340   }
12341   {
12342     if ( bUseExceptions ) {
12343       ClearErrorState();
12344     }
12345     {
12346       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12347       result = (VSILFILE *)wrapper_VSIFOpenExL((char const *)arg1,(char const *)arg2,arg3,arg4);
12348       SWIG_PYTHON_THREAD_END_ALLOW;
12349     }
12350 #ifndef SED_HACKS
12351     if ( bUseExceptions ) {
12352       CPLErr eclass = CPLGetLastErrorType();
12353       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12354         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12355       }
12356     }
12357 #endif
12358   }
12359   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_VSILFILE, 0 |  0 );
12360   {
12361     /* %typemap(freearg) (const char *utf8_path) */
12362     GDALPythonFreeCStr(arg1, bToFree1);
12363   }
12364   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12365   {
12366     /* %typemap(freearg) char **options */
12367     CSLDestroy( arg4 );
12368   }
12369   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12370   return resultobj;
12371 fail:
12372   {
12373     /* %typemap(freearg) (const char *utf8_path) */
12374     GDALPythonFreeCStr(arg1, bToFree1);
12375   }
12376   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
12377   {
12378     /* %typemap(freearg) char **options */
12379     CSLDestroy( arg4 );
12380   }
12381   return NULL;
12382 }
12383 
12384 
_wrap_VSIFEofL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12385 SWIGINTERN PyObject *_wrap_VSIFEofL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12386   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12387   VSILFILE *arg1 = (VSILFILE *) 0 ;
12388   void *argp1 = 0 ;
12389   int res1 = 0 ;
12390   PyObject * obj0 = 0 ;
12391   int result;
12392 
12393   if (!PyArg_ParseTuple(args,(char *)"O:VSIFEofL",&obj0)) SWIG_fail;
12394   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
12395   if (!SWIG_IsOK(res1)) {
12396     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFEofL" "', argument " "1"" of type '" "VSILFILE *""'");
12397   }
12398   arg1 = reinterpret_cast< VSILFILE * >(argp1);
12399   {
12400     if (!arg1) {
12401       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12402     }
12403   }
12404   {
12405     if ( bUseExceptions ) {
12406       ClearErrorState();
12407     }
12408     {
12409       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12410       result = (int)VSIFEofL(arg1);
12411       SWIG_PYTHON_THREAD_END_ALLOW;
12412     }
12413 #ifndef SED_HACKS
12414     if ( bUseExceptions ) {
12415       CPLErr eclass = CPLGetLastErrorType();
12416       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12417         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12418       }
12419     }
12420 #endif
12421   }
12422   resultobj = SWIG_From_int(static_cast< int >(result));
12423   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12424   return resultobj;
12425 fail:
12426   return NULL;
12427 }
12428 
12429 
_wrap_VSIFFlushL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12430 SWIGINTERN PyObject *_wrap_VSIFFlushL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12431   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12432   VSILFILE *arg1 = (VSILFILE *) 0 ;
12433   void *argp1 = 0 ;
12434   int res1 = 0 ;
12435   PyObject * obj0 = 0 ;
12436   int result;
12437 
12438   if (!PyArg_ParseTuple(args,(char *)"O:VSIFFlushL",&obj0)) SWIG_fail;
12439   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
12440   if (!SWIG_IsOK(res1)) {
12441     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFFlushL" "', argument " "1"" of type '" "VSILFILE *""'");
12442   }
12443   arg1 = reinterpret_cast< VSILFILE * >(argp1);
12444   {
12445     if (!arg1) {
12446       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12447     }
12448   }
12449   {
12450     if ( bUseExceptions ) {
12451       ClearErrorState();
12452     }
12453     {
12454       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12455       result = (int)VSIFFlushL(arg1);
12456       SWIG_PYTHON_THREAD_END_ALLOW;
12457     }
12458 #ifndef SED_HACKS
12459     if ( bUseExceptions ) {
12460       CPLErr eclass = CPLGetLastErrorType();
12461       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12462         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12463       }
12464     }
12465 #endif
12466   }
12467   resultobj = SWIG_From_int(static_cast< int >(result));
12468   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12469   return resultobj;
12470 fail:
12471   return NULL;
12472 }
12473 
12474 
_wrap_VSIFCloseL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12475 SWIGINTERN PyObject *_wrap_VSIFCloseL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12476   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12477   VSILFILE *arg1 = (VSILFILE *) 0 ;
12478   void *argp1 = 0 ;
12479   int res1 = 0 ;
12480   PyObject * obj0 = 0 ;
12481   VSI_RETVAL result;
12482 
12483   if (!PyArg_ParseTuple(args,(char *)"O:VSIFCloseL",&obj0)) SWIG_fail;
12484   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
12485   if (!SWIG_IsOK(res1)) {
12486     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFCloseL" "', argument " "1"" of type '" "VSILFILE *""'");
12487   }
12488   arg1 = reinterpret_cast< VSILFILE * >(argp1);
12489   {
12490     if (!arg1) {
12491       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12492     }
12493   }
12494   {
12495     if ( bUseExceptions ) {
12496       ClearErrorState();
12497     }
12498     {
12499       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12500       result = VSIFCloseL(arg1);
12501       SWIG_PYTHON_THREAD_END_ALLOW;
12502     }
12503 #ifndef SED_HACKS
12504     if ( bUseExceptions ) {
12505       CPLErr eclass = CPLGetLastErrorType();
12506       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12507         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12508       }
12509     }
12510 #endif
12511   }
12512   {
12513     /* %typemap(out) VSI_RETVAL */
12514     if ( result != 0 && bUseExceptions) {
12515       const char* pszMessage = CPLGetLastErrorMsg();
12516       if( pszMessage[0] != '\0' )
12517       PyErr_SetString( PyExc_RuntimeError, pszMessage );
12518       else
12519       PyErr_SetString( PyExc_RuntimeError, "unknown error occurred" );
12520       SWIG_fail;
12521     }
12522   }
12523   {
12524     /* %typemap(ret) VSI_RETVAL */
12525     resultobj = PyInt_FromLong( result );
12526   }
12527   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12528   return resultobj;
12529 fail:
12530   return NULL;
12531 }
12532 
12533 
_wrap_VSIFSeekL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12534 SWIGINTERN PyObject *_wrap_VSIFSeekL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12535   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12536   VSILFILE *arg1 = (VSILFILE *) 0 ;
12537   GIntBig arg2 ;
12538   int arg3 ;
12539   void *argp1 = 0 ;
12540   int res1 = 0 ;
12541   int val3 ;
12542   int ecode3 = 0 ;
12543   PyObject * obj0 = 0 ;
12544   PyObject * obj1 = 0 ;
12545   PyObject * obj2 = 0 ;
12546   int result;
12547 
12548   if (!PyArg_ParseTuple(args,(char *)"OOO:VSIFSeekL",&obj0,&obj1,&obj2)) SWIG_fail;
12549   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
12550   if (!SWIG_IsOK(res1)) {
12551     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFSeekL" "', argument " "1"" of type '" "VSILFILE *""'");
12552   }
12553   arg1 = reinterpret_cast< VSILFILE * >(argp1);
12554   {
12555     PY_LONG_LONG val;
12556     if ( !PyArg_Parse(obj1,"L",&val) ) {
12557       PyErr_SetString(PyExc_TypeError, "not an integer");
12558       SWIG_fail;
12559     }
12560     arg2 = (GIntBig)val;
12561   }
12562   ecode3 = SWIG_AsVal_int(obj2, &val3);
12563   if (!SWIG_IsOK(ecode3)) {
12564     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VSIFSeekL" "', argument " "3"" of type '" "int""'");
12565   }
12566   arg3 = static_cast< int >(val3);
12567   {
12568     if (!arg1) {
12569       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12570     }
12571   }
12572   {
12573     if ( bUseExceptions ) {
12574       ClearErrorState();
12575     }
12576     {
12577       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12578       result = (int)VSIFSeekL(arg1,arg2,arg3);
12579       SWIG_PYTHON_THREAD_END_ALLOW;
12580     }
12581 #ifndef SED_HACKS
12582     if ( bUseExceptions ) {
12583       CPLErr eclass = CPLGetLastErrorType();
12584       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12585         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12586       }
12587     }
12588 #endif
12589   }
12590   resultobj = SWIG_From_int(static_cast< int >(result));
12591   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12592   return resultobj;
12593 fail:
12594   return NULL;
12595 }
12596 
12597 
_wrap_VSIFTellL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12598 SWIGINTERN PyObject *_wrap_VSIFTellL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12599   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12600   VSILFILE *arg1 = (VSILFILE *) 0 ;
12601   void *argp1 = 0 ;
12602   int res1 = 0 ;
12603   PyObject * obj0 = 0 ;
12604   GIntBig result;
12605 
12606   if (!PyArg_ParseTuple(args,(char *)"O:VSIFTellL",&obj0)) SWIG_fail;
12607   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
12608   if (!SWIG_IsOK(res1)) {
12609     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFTellL" "', argument " "1"" of type '" "VSILFILE *""'");
12610   }
12611   arg1 = reinterpret_cast< VSILFILE * >(argp1);
12612   {
12613     if (!arg1) {
12614       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12615     }
12616   }
12617   {
12618     if ( bUseExceptions ) {
12619       ClearErrorState();
12620     }
12621     {
12622       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12623       result = VSIFTellL(arg1);
12624       SWIG_PYTHON_THREAD_END_ALLOW;
12625     }
12626 #ifndef SED_HACKS
12627     if ( bUseExceptions ) {
12628       CPLErr eclass = CPLGetLastErrorType();
12629       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12630         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12631       }
12632     }
12633 #endif
12634   }
12635   {
12636     char szTmp[32];
12637     sprintf(szTmp, CPL_FRMT_GIB, result);
12638     resultobj = PyLong_FromString(szTmp, NULL, 10);
12639   }
12640   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12641   return resultobj;
12642 fail:
12643   return NULL;
12644 }
12645 
12646 
_wrap_VSIFTruncateL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12647 SWIGINTERN PyObject *_wrap_VSIFTruncateL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12648   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12649   VSILFILE *arg1 = (VSILFILE *) 0 ;
12650   GIntBig arg2 ;
12651   void *argp1 = 0 ;
12652   int res1 = 0 ;
12653   PyObject * obj0 = 0 ;
12654   PyObject * obj1 = 0 ;
12655   int result;
12656 
12657   if (!PyArg_ParseTuple(args,(char *)"OO:VSIFTruncateL",&obj0,&obj1)) SWIG_fail;
12658   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
12659   if (!SWIG_IsOK(res1)) {
12660     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFTruncateL" "', argument " "1"" of type '" "VSILFILE *""'");
12661   }
12662   arg1 = reinterpret_cast< VSILFILE * >(argp1);
12663   {
12664     PY_LONG_LONG val;
12665     if ( !PyArg_Parse(obj1,"L",&val) ) {
12666       PyErr_SetString(PyExc_TypeError, "not an integer");
12667       SWIG_fail;
12668     }
12669     arg2 = (GIntBig)val;
12670   }
12671   {
12672     if (!arg1) {
12673       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12674     }
12675   }
12676   {
12677     if ( bUseExceptions ) {
12678       ClearErrorState();
12679     }
12680     {
12681       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12682       result = (int)VSIFTruncateL(arg1,arg2);
12683       SWIG_PYTHON_THREAD_END_ALLOW;
12684     }
12685 #ifndef SED_HACKS
12686     if ( bUseExceptions ) {
12687       CPLErr eclass = CPLGetLastErrorType();
12688       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12689         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12690       }
12691     }
12692 #endif
12693   }
12694   resultobj = SWIG_From_int(static_cast< int >(result));
12695   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12696   return resultobj;
12697 fail:
12698   return NULL;
12699 }
12700 
12701 
_wrap_VSISupportsSparseFiles(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12702 SWIGINTERN PyObject *_wrap_VSISupportsSparseFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12703   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12704   char *arg1 = (char *) 0 ;
12705   int bToFree1 = 0 ;
12706   PyObject * obj0 = 0 ;
12707   int result;
12708 
12709   if (!PyArg_ParseTuple(args,(char *)"O:VSISupportsSparseFiles",&obj0)) SWIG_fail;
12710   {
12711     /* %typemap(in) (const char *utf8_path) */
12712     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
12713     if (arg1 == NULL)
12714     {
12715       PyErr_SetString( PyExc_RuntimeError, "not a string" );
12716       SWIG_fail;
12717     }
12718   }
12719   {
12720     if (!arg1) {
12721       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12722     }
12723   }
12724   {
12725     if ( bUseExceptions ) {
12726       ClearErrorState();
12727     }
12728     {
12729       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12730       result = (int)VSISupportsSparseFiles((char const *)arg1);
12731       SWIG_PYTHON_THREAD_END_ALLOW;
12732     }
12733 #ifndef SED_HACKS
12734     if ( bUseExceptions ) {
12735       CPLErr eclass = CPLGetLastErrorType();
12736       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12737         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12738       }
12739     }
12740 #endif
12741   }
12742   resultobj = SWIG_From_int(static_cast< int >(result));
12743   {
12744     /* %typemap(freearg) (const char *utf8_path) */
12745     GDALPythonFreeCStr(arg1, bToFree1);
12746   }
12747   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12748   return resultobj;
12749 fail:
12750   {
12751     /* %typemap(freearg) (const char *utf8_path) */
12752     GDALPythonFreeCStr(arg1, bToFree1);
12753   }
12754   return NULL;
12755 }
12756 
12757 
_wrap_VSIFGetRangeStatusL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12758 SWIGINTERN PyObject *_wrap_VSIFGetRangeStatusL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12759   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12760   VSILFILE *arg1 = (VSILFILE *) 0 ;
12761   GIntBig arg2 ;
12762   GIntBig arg3 ;
12763   void *argp1 = 0 ;
12764   int res1 = 0 ;
12765   PyObject * obj0 = 0 ;
12766   PyObject * obj1 = 0 ;
12767   PyObject * obj2 = 0 ;
12768   int result;
12769 
12770   if (!PyArg_ParseTuple(args,(char *)"OOO:VSIFGetRangeStatusL",&obj0,&obj1,&obj2)) SWIG_fail;
12771   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_VSILFILE, 0 |  0 );
12772   if (!SWIG_IsOK(res1)) {
12773     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VSIFGetRangeStatusL" "', argument " "1"" of type '" "VSILFILE *""'");
12774   }
12775   arg1 = reinterpret_cast< VSILFILE * >(argp1);
12776   {
12777     PY_LONG_LONG val;
12778     if ( !PyArg_Parse(obj1,"L",&val) ) {
12779       PyErr_SetString(PyExc_TypeError, "not an integer");
12780       SWIG_fail;
12781     }
12782     arg2 = (GIntBig)val;
12783   }
12784   {
12785     PY_LONG_LONG val;
12786     if ( !PyArg_Parse(obj2,"L",&val) ) {
12787       PyErr_SetString(PyExc_TypeError, "not an integer");
12788       SWIG_fail;
12789     }
12790     arg3 = (GIntBig)val;
12791   }
12792   {
12793     if (!arg1) {
12794       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12795     }
12796   }
12797   {
12798     if ( bUseExceptions ) {
12799       ClearErrorState();
12800     }
12801     {
12802       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12803       result = (int)VSIFGetRangeStatusL(arg1,arg2,arg3);
12804       SWIG_PYTHON_THREAD_END_ALLOW;
12805     }
12806 #ifndef SED_HACKS
12807     if ( bUseExceptions ) {
12808       CPLErr eclass = CPLGetLastErrorType();
12809       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12810         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12811       }
12812     }
12813 #endif
12814   }
12815   resultobj = SWIG_From_int(static_cast< int >(result));
12816   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12817   return resultobj;
12818 fail:
12819   return NULL;
12820 }
12821 
12822 
_wrap_VSIFWriteL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12823 SWIGINTERN PyObject *_wrap_VSIFWriteL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12824   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12825   int arg1 ;
12826   char *arg2 = (char *) 0 ;
12827   int arg3 ;
12828   int arg4 ;
12829   VSILFILE *arg5 = (VSILFILE *) 0 ;
12830   int alloc1 = 0 ;
12831   bool viewIsValid1 = false ;
12832   Py_buffer view1 ;
12833   int val3 ;
12834   int ecode3 = 0 ;
12835   int val4 ;
12836   int ecode4 = 0 ;
12837   void *argp5 = 0 ;
12838   int res5 = 0 ;
12839   PyObject * obj0 = 0 ;
12840   PyObject * obj1 = 0 ;
12841   PyObject * obj2 = 0 ;
12842   PyObject * obj3 = 0 ;
12843   int result;
12844 
12845   if (!PyArg_ParseTuple(args,(char *)"OOOO:VSIFWriteL",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
12846   {
12847     /* %typemap(in,numinputs=1) (int nLen, char *pBuf ) */
12848     {
12849       if (PyObject_GetBuffer(obj0, &view1, PyBUF_SIMPLE) == 0)
12850       {
12851         if( view1.len > INT_MAX ) {
12852           PyBuffer_Release(&view1);
12853           SWIG_exception( SWIG_RuntimeError, "too large buffer (>2GB)" );
12854         }
12855         viewIsValid1 = true;
12856         arg1 = (int) view1.len;
12857         arg2 = (char *) view1.buf;
12858         goto ok;
12859       }
12860       else
12861       {
12862         PyErr_Clear();
12863       }
12864     }
12865     if (PyUnicode_Check(obj0))
12866     {
12867       size_t safeLen = 0;
12868       int ret = SWIG_AsCharPtrAndSize(obj0, (char**) &arg2, &safeLen, &alloc1);
12869       if (!SWIG_IsOK(ret)) {
12870         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
12871       }
12872 
12873       if (safeLen) safeLen--;
12874       if( safeLen > INT_MAX ) {
12875         SWIG_exception( SWIG_RuntimeError, "too large buffer (>2GB)" );
12876       }
12877       arg1 = (int) safeLen;
12878     }
12879     else
12880     {
12881       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
12882       SWIG_fail;
12883     }
12884     ok: ;
12885   }
12886   ecode3 = SWIG_AsVal_int(obj1, &val3);
12887   if (!SWIG_IsOK(ecode3)) {
12888     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VSIFWriteL" "', argument " "3"" of type '" "int""'");
12889   }
12890   arg3 = static_cast< int >(val3);
12891   ecode4 = SWIG_AsVal_int(obj2, &val4);
12892   if (!SWIG_IsOK(ecode4)) {
12893     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VSIFWriteL" "', argument " "4"" of type '" "int""'");
12894   }
12895   arg4 = static_cast< int >(val4);
12896   res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_VSILFILE, 0 |  0 );
12897   if (!SWIG_IsOK(res5)) {
12898     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "VSIFWriteL" "', argument " "5"" of type '" "VSILFILE *""'");
12899   }
12900   arg5 = reinterpret_cast< VSILFILE * >(argp5);
12901   {
12902     if (!arg5) {
12903       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12904     }
12905   }
12906   {
12907     if ( bUseExceptions ) {
12908       ClearErrorState();
12909     }
12910     {
12911       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12912       result = (int)wrapper_VSIFWriteL(arg1,arg2,arg3,arg4,arg5);
12913       SWIG_PYTHON_THREAD_END_ALLOW;
12914     }
12915 #ifndef SED_HACKS
12916     if ( bUseExceptions ) {
12917       CPLErr eclass = CPLGetLastErrorType();
12918       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12919         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12920       }
12921     }
12922 #endif
12923   }
12924   resultobj = SWIG_From_int(static_cast< int >(result));
12925   {
12926     /* %typemap(freearg) (int *nLen, char *pBuf ) */
12927     if( viewIsValid1 ) {
12928       PyBuffer_Release(&view1);
12929     }
12930     else if (ReturnSame(alloc1) == SWIG_NEWOBJ ) {
12931       delete[] arg2;
12932     }
12933   }
12934   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12935   return resultobj;
12936 fail:
12937   {
12938     /* %typemap(freearg) (int *nLen, char *pBuf ) */
12939     if( viewIsValid1 ) {
12940       PyBuffer_Release(&view1);
12941     }
12942     else if (ReturnSame(alloc1) == SWIG_NEWOBJ ) {
12943       delete[] arg2;
12944     }
12945   }
12946   return NULL;
12947 }
12948 
12949 
_wrap_VSICurlClearCache(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12950 SWIGINTERN PyObject *_wrap_VSICurlClearCache(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12951   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12952 
12953   if (!PyArg_ParseTuple(args,(char *)":VSICurlClearCache")) SWIG_fail;
12954   {
12955     if ( bUseExceptions ) {
12956       ClearErrorState();
12957     }
12958     {
12959       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12960       VSICurlClearCache();
12961       SWIG_PYTHON_THREAD_END_ALLOW;
12962     }
12963 #ifndef SED_HACKS
12964     if ( bUseExceptions ) {
12965       CPLErr eclass = CPLGetLastErrorType();
12966       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
12967         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
12968       }
12969     }
12970 #endif
12971   }
12972   resultobj = SWIG_Py_Void();
12973   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
12974   return resultobj;
12975 fail:
12976   return NULL;
12977 }
12978 
12979 
_wrap_VSICurlPartialClearCache(PyObject * SWIGUNUSEDPARM (self),PyObject * args)12980 SWIGINTERN PyObject *_wrap_VSICurlPartialClearCache(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
12981   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
12982   char *arg1 = (char *) 0 ;
12983   int bToFree1 = 0 ;
12984   PyObject * obj0 = 0 ;
12985 
12986   if (!PyArg_ParseTuple(args,(char *)"O:VSICurlPartialClearCache",&obj0)) SWIG_fail;
12987   {
12988     /* %typemap(in) (const char *utf8_path) */
12989     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
12990     if (arg1 == NULL)
12991     {
12992       PyErr_SetString( PyExc_RuntimeError, "not a string" );
12993       SWIG_fail;
12994     }
12995   }
12996   {
12997     if (!arg1) {
12998       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12999     }
13000   }
13001   {
13002     if ( bUseExceptions ) {
13003       ClearErrorState();
13004     }
13005     {
13006       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13007       VSICurlPartialClearCache((char const *)arg1);
13008       SWIG_PYTHON_THREAD_END_ALLOW;
13009     }
13010 #ifndef SED_HACKS
13011     if ( bUseExceptions ) {
13012       CPLErr eclass = CPLGetLastErrorType();
13013       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13014         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13015       }
13016     }
13017 #endif
13018   }
13019   resultobj = SWIG_Py_Void();
13020   {
13021     /* %typemap(freearg) (const char *utf8_path) */
13022     GDALPythonFreeCStr(arg1, bToFree1);
13023   }
13024   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13025   return resultobj;
13026 fail:
13027   {
13028     /* %typemap(freearg) (const char *utf8_path) */
13029     GDALPythonFreeCStr(arg1, bToFree1);
13030   }
13031   return NULL;
13032 }
13033 
13034 
_wrap_NetworkStatsReset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13035 SWIGINTERN PyObject *_wrap_NetworkStatsReset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13036   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13037 
13038   if (!PyArg_ParseTuple(args,(char *)":NetworkStatsReset")) SWIG_fail;
13039   {
13040     if ( bUseExceptions ) {
13041       ClearErrorState();
13042     }
13043     {
13044       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13045       VSINetworkStatsReset();
13046       SWIG_PYTHON_THREAD_END_ALLOW;
13047     }
13048 #ifndef SED_HACKS
13049     if ( bUseExceptions ) {
13050       CPLErr eclass = CPLGetLastErrorType();
13051       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13052         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13053       }
13054     }
13055 #endif
13056   }
13057   resultobj = SWIG_Py_Void();
13058   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13059   return resultobj;
13060 fail:
13061   return NULL;
13062 }
13063 
13064 
_wrap_NetworkStatsGetAsSerializedJSON(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13065 SWIGINTERN PyObject *_wrap_NetworkStatsGetAsSerializedJSON(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13066   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13067   char **arg1 = (char **) NULL ;
13068   PyObject * obj0 = 0 ;
13069   retStringAndCPLFree *result = 0 ;
13070 
13071   if (!PyArg_ParseTuple(args,(char *)"|O:NetworkStatsGetAsSerializedJSON",&obj0)) SWIG_fail;
13072   if (obj0) {
13073     {
13074       /* %typemap(in) char **options */
13075       int bErr = FALSE;
13076       arg1 = CSLFromPySequence(obj0, &bErr);
13077       if( bErr )
13078       {
13079         SWIG_fail;
13080       }
13081     }
13082   }
13083   {
13084     if ( bUseExceptions ) {
13085       ClearErrorState();
13086     }
13087     {
13088       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13089       result = (retStringAndCPLFree *)VSINetworkStatsGetAsSerializedJSON(arg1);
13090       SWIG_PYTHON_THREAD_END_ALLOW;
13091     }
13092 #ifndef SED_HACKS
13093     if ( bUseExceptions ) {
13094       CPLErr eclass = CPLGetLastErrorType();
13095       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13096         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13097       }
13098     }
13099 #endif
13100   }
13101   {
13102     /* %typemap(out) (retStringAndCPLFree*) */
13103     Py_XDECREF(resultobj);
13104     if(result)
13105     {
13106       resultobj = GDALPythonObjectFromCStr( (const char *)result);
13107       CPLFree(result);
13108     }
13109     else
13110     {
13111       resultobj = Py_None;
13112       Py_INCREF(resultobj);
13113     }
13114   }
13115   {
13116     /* %typemap(freearg) char **options */
13117     CSLDestroy( arg1 );
13118   }
13119   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13120   return resultobj;
13121 fail:
13122   {
13123     /* %typemap(freearg) char **options */
13124     CSLDestroy( arg1 );
13125   }
13126   return NULL;
13127 }
13128 
13129 
_wrap_ParseCommandLine(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13130 SWIGINTERN PyObject *_wrap_ParseCommandLine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13131   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13132   char *arg1 = (char *) 0 ;
13133   int bToFree1 = 0 ;
13134   PyObject * obj0 = 0 ;
13135   char **result = 0 ;
13136 
13137   if (!PyArg_ParseTuple(args,(char *)"O:ParseCommandLine",&obj0)) SWIG_fail;
13138   {
13139     /* %typemap(in) (const char *utf8_path) */
13140     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
13141     if (arg1 == NULL)
13142     {
13143       PyErr_SetString( PyExc_RuntimeError, "not a string" );
13144       SWIG_fail;
13145     }
13146   }
13147   {
13148     if (!arg1) {
13149       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13150     }
13151   }
13152   {
13153     if ( bUseExceptions ) {
13154       ClearErrorState();
13155     }
13156     {
13157       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13158       result = (char **)CSLParseCommandLine((char const *)arg1);
13159       SWIG_PYTHON_THREAD_END_ALLOW;
13160     }
13161 #ifndef SED_HACKS
13162     if ( bUseExceptions ) {
13163       CPLErr eclass = CPLGetLastErrorType();
13164       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13165         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13166       }
13167     }
13168 #endif
13169   }
13170   {
13171     /* %typemap(out) char **CSL -> ( string ) */
13172     char **stringarray = result;
13173     if ( stringarray == NULL ) {
13174       resultobj = Py_None;
13175       Py_INCREF( resultobj );
13176     }
13177     else {
13178       int len = CSLCount( stringarray );
13179       resultobj = PyList_New( len );
13180       for ( int i = 0; i < len; ++i ) {
13181         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
13182         PyList_SetItem(resultobj, i, o );
13183       }
13184     }
13185     CSLDestroy(result);
13186   }
13187   {
13188     /* %typemap(freearg) (const char *utf8_path) */
13189     GDALPythonFreeCStr(arg1, bToFree1);
13190   }
13191   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13192   return resultobj;
13193 fail:
13194   {
13195     /* %typemap(freearg) (const char *utf8_path) */
13196     GDALPythonFreeCStr(arg1, bToFree1);
13197   }
13198   return NULL;
13199 }
13200 
13201 
_wrap_MajorObject_GetDescription(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13202 SWIGINTERN PyObject *_wrap_MajorObject_GetDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13203   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13204   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13205   void *argp1 = 0 ;
13206   int res1 = 0 ;
13207   PyObject * obj0 = 0 ;
13208   char *result = 0 ;
13209 
13210   if (!PyArg_ParseTuple(args,(char *)"O:MajorObject_GetDescription",&obj0)) SWIG_fail;
13211   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13212   if (!SWIG_IsOK(res1)) {
13213     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetDescription" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13214   }
13215   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13216   {
13217     if ( bUseExceptions ) {
13218       ClearErrorState();
13219     }
13220     {
13221       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13222       result = (char *)GDALMajorObjectShadow_GetDescription(arg1);
13223       SWIG_PYTHON_THREAD_END_ALLOW;
13224     }
13225 #ifndef SED_HACKS
13226     if ( bUseExceptions ) {
13227       CPLErr eclass = CPLGetLastErrorType();
13228       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13229         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13230       }
13231     }
13232 #endif
13233   }
13234   resultobj = SWIG_FromCharPtr((const char *)result);
13235   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13236   return resultobj;
13237 fail:
13238   return NULL;
13239 }
13240 
13241 
_wrap_MajorObject_SetDescription(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13242 SWIGINTERN PyObject *_wrap_MajorObject_SetDescription(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13243   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13244   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13245   char *arg2 = (char *) 0 ;
13246   void *argp1 = 0 ;
13247   int res1 = 0 ;
13248   int res2 ;
13249   char *buf2 = 0 ;
13250   int alloc2 = 0 ;
13251   PyObject * obj0 = 0 ;
13252   PyObject * obj1 = 0 ;
13253 
13254   if (!PyArg_ParseTuple(args,(char *)"OO:MajorObject_SetDescription",&obj0,&obj1)) SWIG_fail;
13255   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13256   if (!SWIG_IsOK(res1)) {
13257     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetDescription" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13258   }
13259   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13260   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
13261   if (!SWIG_IsOK(res2)) {
13262     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_SetDescription" "', argument " "2"" of type '" "char const *""'");
13263   }
13264   arg2 = reinterpret_cast< char * >(buf2);
13265   {
13266     if (!arg2) {
13267       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13268     }
13269   }
13270   {
13271     if ( bUseExceptions ) {
13272       ClearErrorState();
13273     }
13274     {
13275       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13276       GDALMajorObjectShadow_SetDescription(arg1,(char const *)arg2);
13277       SWIG_PYTHON_THREAD_END_ALLOW;
13278     }
13279 #ifndef SED_HACKS
13280     if ( bUseExceptions ) {
13281       CPLErr eclass = CPLGetLastErrorType();
13282       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13283         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13284       }
13285     }
13286 #endif
13287   }
13288   resultobj = SWIG_Py_Void();
13289   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13290   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13291   return resultobj;
13292 fail:
13293   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13294   return NULL;
13295 }
13296 
13297 
_wrap_MajorObject_GetMetadataDomainList(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13298 SWIGINTERN PyObject *_wrap_MajorObject_GetMetadataDomainList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13299   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13300   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13301   void *argp1 = 0 ;
13302   int res1 = 0 ;
13303   PyObject * obj0 = 0 ;
13304   char **result = 0 ;
13305 
13306   if (!PyArg_ParseTuple(args,(char *)"O:MajorObject_GetMetadataDomainList",&obj0)) SWIG_fail;
13307   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13308   if (!SWIG_IsOK(res1)) {
13309     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetMetadataDomainList" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13310   }
13311   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13312   {
13313     if ( bUseExceptions ) {
13314       ClearErrorState();
13315     }
13316     {
13317       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13318       result = (char **)GDALMajorObjectShadow_GetMetadataDomainList(arg1);
13319       SWIG_PYTHON_THREAD_END_ALLOW;
13320     }
13321 #ifndef SED_HACKS
13322     if ( bUseExceptions ) {
13323       CPLErr eclass = CPLGetLastErrorType();
13324       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13325         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13326       }
13327     }
13328 #endif
13329   }
13330   {
13331     /* %typemap(out) char **CSL -> ( string ) */
13332     char **stringarray = result;
13333     if ( stringarray == NULL ) {
13334       resultobj = Py_None;
13335       Py_INCREF( resultobj );
13336     }
13337     else {
13338       int len = CSLCount( stringarray );
13339       resultobj = PyList_New( len );
13340       for ( int i = 0; i < len; ++i ) {
13341         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
13342         PyList_SetItem(resultobj, i, o );
13343       }
13344     }
13345     CSLDestroy(result);
13346   }
13347   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13348   return resultobj;
13349 fail:
13350   return NULL;
13351 }
13352 
13353 
_wrap_MajorObject_GetMetadata_Dict(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13354 SWIGINTERN PyObject *_wrap_MajorObject_GetMetadata_Dict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13355   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13356   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13357   char *arg2 = (char *) "" ;
13358   void *argp1 = 0 ;
13359   int res1 = 0 ;
13360   int res2 ;
13361   char *buf2 = 0 ;
13362   int alloc2 = 0 ;
13363   PyObject * obj0 = 0 ;
13364   PyObject * obj1 = 0 ;
13365   char **result = 0 ;
13366 
13367   if (!PyArg_ParseTuple(args,(char *)"O|O:MajorObject_GetMetadata_Dict",&obj0,&obj1)) SWIG_fail;
13368   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13369   if (!SWIG_IsOK(res1)) {
13370     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetMetadata_Dict" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13371   }
13372   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13373   if (obj1) {
13374     res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
13375     if (!SWIG_IsOK(res2)) {
13376       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_GetMetadata_Dict" "', argument " "2"" of type '" "char const *""'");
13377     }
13378     arg2 = reinterpret_cast< char * >(buf2);
13379   }
13380   {
13381     if ( bUseExceptions ) {
13382       ClearErrorState();
13383     }
13384     {
13385       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13386       result = (char **)GDALMajorObjectShadow_GetMetadata_Dict(arg1,(char const *)arg2);
13387       SWIG_PYTHON_THREAD_END_ALLOW;
13388     }
13389 #ifndef SED_HACKS
13390     if ( bUseExceptions ) {
13391       CPLErr eclass = CPLGetLastErrorType();
13392       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13393         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13394       }
13395     }
13396 #endif
13397   }
13398   {
13399     /* %typemap(out) char **dict */
13400     char **stringarray = result;
13401     resultobj = PyDict_New();
13402     if ( stringarray != NULL ) {
13403       while (*stringarray != NULL ) {
13404         char const *valptr;
13405         char *keyptr;
13406         const char* pszSep = strchr( *stringarray, '=' );
13407         if ( pszSep != NULL) {
13408           keyptr = CPLStrdup(*stringarray);
13409           keyptr[pszSep - *stringarray] = '\0';
13410           valptr = pszSep + 1;
13411           PyObject *nm = GDALPythonObjectFromCStr( keyptr );
13412           PyObject *val = GDALPythonObjectFromCStr( valptr );
13413           PyDict_SetItem(resultobj, nm, val );
13414           Py_DECREF(nm);
13415           Py_DECREF(val);
13416           CPLFree( keyptr );
13417         }
13418         stringarray++;
13419       }
13420     }
13421   }
13422   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13423   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13424   return resultobj;
13425 fail:
13426   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13427   return NULL;
13428 }
13429 
13430 
_wrap_MajorObject_GetMetadata_List(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13431 SWIGINTERN PyObject *_wrap_MajorObject_GetMetadata_List(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13432   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13433   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13434   char *arg2 = (char *) "" ;
13435   void *argp1 = 0 ;
13436   int res1 = 0 ;
13437   int res2 ;
13438   char *buf2 = 0 ;
13439   int alloc2 = 0 ;
13440   PyObject * obj0 = 0 ;
13441   PyObject * obj1 = 0 ;
13442   char **result = 0 ;
13443 
13444   if (!PyArg_ParseTuple(args,(char *)"O|O:MajorObject_GetMetadata_List",&obj0,&obj1)) SWIG_fail;
13445   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13446   if (!SWIG_IsOK(res1)) {
13447     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetMetadata_List" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13448   }
13449   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13450   if (obj1) {
13451     res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
13452     if (!SWIG_IsOK(res2)) {
13453       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_GetMetadata_List" "', argument " "2"" of type '" "char const *""'");
13454     }
13455     arg2 = reinterpret_cast< char * >(buf2);
13456   }
13457   {
13458     if ( bUseExceptions ) {
13459       ClearErrorState();
13460     }
13461     {
13462       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13463       result = (char **)GDALMajorObjectShadow_GetMetadata_List(arg1,(char const *)arg2);
13464       SWIG_PYTHON_THREAD_END_ALLOW;
13465     }
13466 #ifndef SED_HACKS
13467     if ( bUseExceptions ) {
13468       CPLErr eclass = CPLGetLastErrorType();
13469       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13470         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13471       }
13472     }
13473 #endif
13474   }
13475   {
13476     /* %typemap(out) char **options -> ( string ) */
13477     char **stringarray = result;
13478     if ( stringarray == NULL ) {
13479       resultobj = Py_None;
13480       Py_INCREF( resultobj );
13481     }
13482     else {
13483       int len = CSLCount( stringarray );
13484       resultobj = PyList_New( len );
13485       for ( int i = 0; i < len; ++i ) {
13486         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
13487         PyList_SetItem(resultobj, i, o );
13488       }
13489     }
13490   }
13491   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13492   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13493   return resultobj;
13494 fail:
13495   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13496   return NULL;
13497 }
13498 
13499 
_wrap_MajorObject_SetMetadata__SWIG_0(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13500 SWIGINTERN PyObject *_wrap_MajorObject_SetMetadata__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13501   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13502   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13503   char **arg2 = (char **) 0 ;
13504   char *arg3 = (char *) "" ;
13505   void *argp1 = 0 ;
13506   int res1 = 0 ;
13507   int res3 ;
13508   char *buf3 = 0 ;
13509   int alloc3 = 0 ;
13510   PyObject * obj0 = 0 ;
13511   PyObject * obj1 = 0 ;
13512   PyObject * obj2 = 0 ;
13513   CPLErr result;
13514 
13515   if (!PyArg_ParseTuple(args,(char *)"OO|O:MajorObject_SetMetadata",&obj0,&obj1,&obj2)) SWIG_fail;
13516   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13517   if (!SWIG_IsOK(res1)) {
13518     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetMetadata" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13519   }
13520   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13521   {
13522     /* %typemap(in) char **dict */
13523     arg2 = NULL;
13524     if ( PySequence_Check( obj1 ) ) {
13525       Py_ssize_t size = PySequence_Size(obj1);
13526       if( size != (int)size ) {
13527         PyErr_SetString(PyExc_TypeError, "too big sequence");
13528         SWIG_fail;
13529       }
13530       for (int i = 0; i < (int)size; i++) {
13531         PyObject* pyObj = PySequence_GetItem(obj1,i);
13532         int bFreeStr;
13533         char* pszStr = GDALPythonObjectToCStr(pyObj, &bFreeStr);
13534         if ( pszStr == NULL ) {
13535           Py_DECREF(pyObj);
13536           PyErr_SetString(PyExc_TypeError,"sequence must contain strings");
13537           SWIG_fail;
13538         }
13539         arg2 = CSLAddString( arg2, pszStr );
13540         GDALPythonFreeCStr(pszStr, bFreeStr);
13541         Py_DECREF(pyObj);
13542       }
13543     }
13544     else if ( PyMapping_Check( obj1 ) ) {
13545       /* We need to use the dictionary form. */
13546       Py_ssize_t size = PyMapping_Length( obj1 );
13547       if ( size > 0 && size == (int)size) {
13548         PyObject *item_list = PyMapping_Items( obj1 );
13549         for( int i=0; i<(int)size; i++ ) {
13550           PyObject *it = PySequence_GetItem( item_list, i );
13551 
13552           PyObject *k, *v;
13553           if ( ! PyArg_ParseTuple( it, "OO", &k, &v ) ) {
13554             Py_DECREF(it);
13555             Py_DECREF(item_list);
13556             PyErr_SetString(PyExc_TypeError,"Cannot retrieve key/value");
13557             SWIG_fail;
13558           }
13559 
13560           PyObject* kStr = PyObject_Str(k);
13561           if( PyErr_Occurred() )
13562           {
13563             Py_DECREF(it);
13564             Py_DECREF(item_list);
13565             SWIG_fail;
13566           }
13567 
13568           PyObject* vStr;
13569           if( PyBytes_Check(v) )
13570           {
13571             vStr = v;
13572             Py_INCREF(vStr);
13573           }
13574           else
13575           {
13576             vStr = PyObject_Str(v);
13577             if( PyErr_Occurred() )
13578             {
13579               Py_DECREF(it);
13580               Py_DECREF(kStr);
13581               Py_DECREF(item_list);
13582               SWIG_fail;
13583             }
13584           }
13585 
13586           int bFreeK, bFreeV;
13587           char* pszK = GDALPythonObjectToCStr(kStr, &bFreeK);
13588           char* pszV = GDALPythonObjectToCStr(vStr, &bFreeV);
13589           if( pszK == NULL || pszV == NULL )
13590           {
13591             GDALPythonFreeCStr(pszK, bFreeK);
13592             GDALPythonFreeCStr(pszV, bFreeV);
13593             Py_DECREF(kStr);
13594             Py_DECREF(vStr);
13595             Py_DECREF(it);
13596             Py_DECREF(item_list);
13597             PyErr_SetString(PyExc_TypeError,"Cannot get key/value as string");
13598             SWIG_fail;
13599           }
13600           arg2 = CSLAddNameValue( arg2, pszK, pszV );
13601 
13602           GDALPythonFreeCStr(pszK, bFreeK);
13603           GDALPythonFreeCStr(pszV, bFreeV);
13604           Py_DECREF(kStr);
13605           Py_DECREF(vStr);
13606           Py_DECREF(it);
13607         }
13608         Py_DECREF(item_list);
13609       }
13610     }
13611     else {
13612       PyErr_SetString(PyExc_TypeError,"Argument must be dictionary or sequence of strings");
13613       SWIG_fail;
13614     }
13615   }
13616   if (obj2) {
13617     res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
13618     if (!SWIG_IsOK(res3)) {
13619       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_SetMetadata" "', argument " "3"" of type '" "char const *""'");
13620     }
13621     arg3 = reinterpret_cast< char * >(buf3);
13622   }
13623   {
13624     if ( bUseExceptions ) {
13625       ClearErrorState();
13626     }
13627     {
13628       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13629       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMajorObjectShadow_SetMetadata__SWIG_0(arg1,arg2,(char const *)arg3));
13630       SWIG_PYTHON_THREAD_END_ALLOW;
13631     }
13632 #ifndef SED_HACKS
13633     if ( bUseExceptions ) {
13634       CPLErr eclass = CPLGetLastErrorType();
13635       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13636         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13637       }
13638     }
13639 #endif
13640   }
13641   resultobj = SWIG_From_int(static_cast< int >(result));
13642   {
13643     /* %typemap(freearg) char **dict */
13644     CSLDestroy( arg2 );
13645   }
13646   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13647   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13648   return resultobj;
13649 fail:
13650   {
13651     /* %typemap(freearg) char **dict */
13652     CSLDestroy( arg2 );
13653   }
13654   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13655   return NULL;
13656 }
13657 
13658 
_wrap_MajorObject_SetMetadata__SWIG_1(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13659 SWIGINTERN PyObject *_wrap_MajorObject_SetMetadata__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13660   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13661   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13662   char *arg2 = (char *) 0 ;
13663   char *arg3 = (char *) "" ;
13664   void *argp1 = 0 ;
13665   int res1 = 0 ;
13666   int res2 ;
13667   char *buf2 = 0 ;
13668   int alloc2 = 0 ;
13669   int res3 ;
13670   char *buf3 = 0 ;
13671   int alloc3 = 0 ;
13672   PyObject * obj0 = 0 ;
13673   PyObject * obj1 = 0 ;
13674   PyObject * obj2 = 0 ;
13675   CPLErr result;
13676 
13677   if (!PyArg_ParseTuple(args,(char *)"OO|O:MajorObject_SetMetadata",&obj0,&obj1,&obj2)) SWIG_fail;
13678   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13679   if (!SWIG_IsOK(res1)) {
13680     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetMetadata" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13681   }
13682   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13683   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
13684   if (!SWIG_IsOK(res2)) {
13685     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_SetMetadata" "', argument " "2"" of type '" "char *""'");
13686   }
13687   arg2 = reinterpret_cast< char * >(buf2);
13688   if (obj2) {
13689     res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
13690     if (!SWIG_IsOK(res3)) {
13691       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_SetMetadata" "', argument " "3"" of type '" "char const *""'");
13692     }
13693     arg3 = reinterpret_cast< char * >(buf3);
13694   }
13695   {
13696     if ( bUseExceptions ) {
13697       ClearErrorState();
13698     }
13699     {
13700       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13701       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMajorObjectShadow_SetMetadata__SWIG_1(arg1,arg2,(char const *)arg3));
13702       SWIG_PYTHON_THREAD_END_ALLOW;
13703     }
13704 #ifndef SED_HACKS
13705     if ( bUseExceptions ) {
13706       CPLErr eclass = CPLGetLastErrorType();
13707       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13708         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13709       }
13710     }
13711 #endif
13712   }
13713   resultobj = SWIG_From_int(static_cast< int >(result));
13714   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13715   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13716   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13717   return resultobj;
13718 fail:
13719   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13720   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13721   return NULL;
13722 }
13723 
13724 
_wrap_MajorObject_SetMetadata(PyObject * self,PyObject * args)13725 SWIGINTERN PyObject *_wrap_MajorObject_SetMetadata(PyObject *self, PyObject *args) {
13726   Py_ssize_t argc;
13727   PyObject *argv[4] = {
13728     0
13729   };
13730   Py_ssize_t ii;
13731 
13732   if (args == NULL || !PyTuple_Check(args)) SWIG_fail;
13733   argc = args ? PyObject_Length(args) : 0;
13734   for (ii = 0; (ii < 3) && (ii < argc); ii++) {
13735     argv[ii] = PyTuple_GET_ITEM(args,ii);
13736   }
13737   if ((argc >= 2) && (argc <= 3)) {
13738     int _v;
13739     void *vptr = 0;
13740     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_GDALMajorObjectShadow, 0);
13741     _v = SWIG_CheckState(res);
13742     if (_v) {
13743       {
13744         /* %typecheck(SWIG_TYPECHECK_POINTER) (char **dict) */
13745         /* Note: we exclude explicitly strings, because they can be considered as a sequence of characters, */
13746         /* which is not desirable since it makes it impossible to define bindings such as SetMetadata(string) and SetMetadata(array_of_string) */
13747         /* (see #4816) */
13748         _v = ((PyMapping_Check(argv[1]) || PySequence_Check(argv[1]) ) && !SWIG_CheckState(SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0)) ) ? 1 : 0;
13749       }
13750       if (_v) {
13751         if (argc <= 2) {
13752           return _wrap_MajorObject_SetMetadata__SWIG_0(self, args);
13753         }
13754         int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
13755         _v = SWIG_CheckState(res);
13756         if (_v) {
13757           return _wrap_MajorObject_SetMetadata__SWIG_0(self, args);
13758         }
13759       }
13760     }
13761   }
13762   if ((argc >= 2) && (argc <= 3)) {
13763     int _v;
13764     void *vptr = 0;
13765     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_GDALMajorObjectShadow, 0);
13766     _v = SWIG_CheckState(res);
13767     if (_v) {
13768       int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0);
13769       _v = SWIG_CheckState(res);
13770       if (_v) {
13771         if (argc <= 2) {
13772           return _wrap_MajorObject_SetMetadata__SWIG_1(self, args);
13773         }
13774         int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0);
13775         _v = SWIG_CheckState(res);
13776         if (_v) {
13777           return _wrap_MajorObject_SetMetadata__SWIG_1(self, args);
13778         }
13779       }
13780     }
13781   }
13782 
13783 fail:
13784   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'MajorObject_SetMetadata'.\n"
13785     "  Possible C/C++ prototypes are:\n"
13786     "    GDALMajorObjectShadow::SetMetadata(char **,char const *)\n"
13787     "    GDALMajorObjectShadow::SetMetadata(char *,char const *)\n");
13788   return 0;
13789 }
13790 
13791 
_wrap_MajorObject_GetMetadataItem(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13792 SWIGINTERN PyObject *_wrap_MajorObject_GetMetadataItem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13793   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13794   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13795   char *arg2 = (char *) 0 ;
13796   char *arg3 = (char *) "" ;
13797   void *argp1 = 0 ;
13798   int res1 = 0 ;
13799   int res2 ;
13800   char *buf2 = 0 ;
13801   int alloc2 = 0 ;
13802   int res3 ;
13803   char *buf3 = 0 ;
13804   int alloc3 = 0 ;
13805   PyObject * obj0 = 0 ;
13806   PyObject * obj1 = 0 ;
13807   PyObject * obj2 = 0 ;
13808   char *result = 0 ;
13809 
13810   if (!PyArg_ParseTuple(args,(char *)"OO|O:MajorObject_GetMetadataItem",&obj0,&obj1,&obj2)) SWIG_fail;
13811   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13812   if (!SWIG_IsOK(res1)) {
13813     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_GetMetadataItem" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13814   }
13815   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13816   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
13817   if (!SWIG_IsOK(res2)) {
13818     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_GetMetadataItem" "', argument " "2"" of type '" "char const *""'");
13819   }
13820   arg2 = reinterpret_cast< char * >(buf2);
13821   if (obj2) {
13822     res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
13823     if (!SWIG_IsOK(res3)) {
13824       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_GetMetadataItem" "', argument " "3"" of type '" "char const *""'");
13825     }
13826     arg3 = reinterpret_cast< char * >(buf3);
13827   }
13828   {
13829     if (!arg2) {
13830       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13831     }
13832   }
13833   {
13834     if ( bUseExceptions ) {
13835       ClearErrorState();
13836     }
13837     {
13838       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13839       result = (char *)GDALMajorObjectShadow_GetMetadataItem(arg1,(char const *)arg2,(char const *)arg3);
13840       SWIG_PYTHON_THREAD_END_ALLOW;
13841     }
13842 #ifndef SED_HACKS
13843     if ( bUseExceptions ) {
13844       CPLErr eclass = CPLGetLastErrorType();
13845       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13846         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13847       }
13848     }
13849 #endif
13850   }
13851   resultobj = SWIG_FromCharPtr((const char *)result);
13852   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13853   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13854   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13855   return resultobj;
13856 fail:
13857   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13858   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13859   return NULL;
13860 }
13861 
13862 
_wrap_MajorObject_SetMetadataItem(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13863 SWIGINTERN PyObject *_wrap_MajorObject_SetMetadataItem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13864   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13865   GDALMajorObjectShadow *arg1 = (GDALMajorObjectShadow *) 0 ;
13866   char *arg2 = (char *) 0 ;
13867   char *arg3 = (char *) 0 ;
13868   char *arg4 = (char *) "" ;
13869   void *argp1 = 0 ;
13870   int res1 = 0 ;
13871   int res2 ;
13872   char *buf2 = 0 ;
13873   int alloc2 = 0 ;
13874   int res3 ;
13875   char *buf3 = 0 ;
13876   int alloc3 = 0 ;
13877   int res4 ;
13878   char *buf4 = 0 ;
13879   int alloc4 = 0 ;
13880   PyObject * obj0 = 0 ;
13881   PyObject * obj1 = 0 ;
13882   PyObject * obj2 = 0 ;
13883   PyObject * obj3 = 0 ;
13884   CPLErr result;
13885 
13886   if (!PyArg_ParseTuple(args,(char *)"OOO|O:MajorObject_SetMetadataItem",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
13887   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMajorObjectShadow, 0 |  0 );
13888   if (!SWIG_IsOK(res1)) {
13889     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MajorObject_SetMetadataItem" "', argument " "1"" of type '" "GDALMajorObjectShadow *""'");
13890   }
13891   arg1 = reinterpret_cast< GDALMajorObjectShadow * >(argp1);
13892   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
13893   if (!SWIG_IsOK(res2)) {
13894     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MajorObject_SetMetadataItem" "', argument " "2"" of type '" "char const *""'");
13895   }
13896   arg2 = reinterpret_cast< char * >(buf2);
13897   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
13898   if (!SWIG_IsOK(res3)) {
13899     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "MajorObject_SetMetadataItem" "', argument " "3"" of type '" "char const *""'");
13900   }
13901   arg3 = reinterpret_cast< char * >(buf3);
13902   if (obj3) {
13903     res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
13904     if (!SWIG_IsOK(res4)) {
13905       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "MajorObject_SetMetadataItem" "', argument " "4"" of type '" "char const *""'");
13906     }
13907     arg4 = reinterpret_cast< char * >(buf4);
13908   }
13909   {
13910     if (!arg2) {
13911       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13912     }
13913   }
13914   {
13915     if ( bUseExceptions ) {
13916       ClearErrorState();
13917     }
13918     {
13919       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13920       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMajorObjectShadow_SetMetadataItem(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4));
13921       SWIG_PYTHON_THREAD_END_ALLOW;
13922     }
13923 #ifndef SED_HACKS
13924     if ( bUseExceptions ) {
13925       CPLErr eclass = CPLGetLastErrorType();
13926       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13927         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13928       }
13929     }
13930 #endif
13931   }
13932   resultobj = SWIG_From_int(static_cast< int >(result));
13933   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13934   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13935   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
13936   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13937   return resultobj;
13938 fail:
13939   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
13940   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
13941   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
13942   return NULL;
13943 }
13944 
13945 
MajorObject_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13946 SWIGINTERN PyObject *MajorObject_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13947   PyObject *obj;
13948   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
13949   SWIG_TypeNewClientData(SWIGTYPE_p_GDALMajorObjectShadow, SWIG_NewClientData(obj));
13950   return SWIG_Py_Void();
13951 }
13952 
_wrap_Driver_ShortName_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13953 SWIGINTERN PyObject *_wrap_Driver_ShortName_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13954   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13955   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
13956   void *argp1 = 0 ;
13957   int res1 = 0 ;
13958   PyObject * obj0 = 0 ;
13959   char *result = 0 ;
13960 
13961   if (!PyArg_ParseTuple(args,(char *)"O:Driver_ShortName_get",&obj0)) SWIG_fail;
13962   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
13963   if (!SWIG_IsOK(res1)) {
13964     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_ShortName_get" "', argument " "1"" of type '" "GDALDriverShadow *""'");
13965   }
13966   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
13967   {
13968     if ( bUseExceptions ) {
13969       ClearErrorState();
13970     }
13971     {
13972       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13973       result = (char *)GDALDriverShadow_ShortName_get(arg1);
13974       SWIG_PYTHON_THREAD_END_ALLOW;
13975     }
13976 #ifndef SED_HACKS
13977     if ( bUseExceptions ) {
13978       CPLErr eclass = CPLGetLastErrorType();
13979       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
13980         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
13981       }
13982     }
13983 #endif
13984   }
13985   resultobj = SWIG_FromCharPtr((const char *)result);
13986   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
13987   return resultobj;
13988 fail:
13989   return NULL;
13990 }
13991 
13992 
_wrap_Driver_LongName_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)13993 SWIGINTERN PyObject *_wrap_Driver_LongName_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
13994   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
13995   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
13996   void *argp1 = 0 ;
13997   int res1 = 0 ;
13998   PyObject * obj0 = 0 ;
13999   char *result = 0 ;
14000 
14001   if (!PyArg_ParseTuple(args,(char *)"O:Driver_LongName_get",&obj0)) SWIG_fail;
14002   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14003   if (!SWIG_IsOK(res1)) {
14004     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_LongName_get" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14005   }
14006   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14007   {
14008     if ( bUseExceptions ) {
14009       ClearErrorState();
14010     }
14011     {
14012       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14013       result = (char *)GDALDriverShadow_LongName_get(arg1);
14014       SWIG_PYTHON_THREAD_END_ALLOW;
14015     }
14016 #ifndef SED_HACKS
14017     if ( bUseExceptions ) {
14018       CPLErr eclass = CPLGetLastErrorType();
14019       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14020         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14021       }
14022     }
14023 #endif
14024   }
14025   resultobj = SWIG_FromCharPtr((const char *)result);
14026   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14027   return resultobj;
14028 fail:
14029   return NULL;
14030 }
14031 
14032 
_wrap_Driver_HelpTopic_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14033 SWIGINTERN PyObject *_wrap_Driver_HelpTopic_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14034   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14035   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14036   void *argp1 = 0 ;
14037   int res1 = 0 ;
14038   PyObject * obj0 = 0 ;
14039   char *result = 0 ;
14040 
14041   if (!PyArg_ParseTuple(args,(char *)"O:Driver_HelpTopic_get",&obj0)) SWIG_fail;
14042   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14043   if (!SWIG_IsOK(res1)) {
14044     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_HelpTopic_get" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14045   }
14046   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14047   {
14048     if ( bUseExceptions ) {
14049       ClearErrorState();
14050     }
14051     {
14052       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14053       result = (char *)GDALDriverShadow_HelpTopic_get(arg1);
14054       SWIG_PYTHON_THREAD_END_ALLOW;
14055     }
14056 #ifndef SED_HACKS
14057     if ( bUseExceptions ) {
14058       CPLErr eclass = CPLGetLastErrorType();
14059       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14060         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14061       }
14062     }
14063 #endif
14064   }
14065   resultobj = SWIG_FromCharPtr((const char *)result);
14066   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14067   return resultobj;
14068 fail:
14069   return NULL;
14070 }
14071 
14072 
_wrap_Driver_Create(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)14073 SWIGINTERN PyObject *_wrap_Driver_Create(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
14074   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14075   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14076   char *arg2 = (char *) 0 ;
14077   int arg3 ;
14078   int arg4 ;
14079   int arg5 = (int) 1 ;
14080   GDALDataType arg6 = (GDALDataType) GDT_Byte ;
14081   char **arg7 = (char **) 0 ;
14082   void *argp1 = 0 ;
14083   int res1 = 0 ;
14084   int bToFree2 = 0 ;
14085   int val3 ;
14086   int ecode3 = 0 ;
14087   int val4 ;
14088   int ecode4 = 0 ;
14089   int val5 ;
14090   int ecode5 = 0 ;
14091   PyObject * obj0 = 0 ;
14092   PyObject * obj1 = 0 ;
14093   PyObject * obj2 = 0 ;
14094   PyObject * obj3 = 0 ;
14095   PyObject * obj4 = 0 ;
14096   PyObject * obj5 = 0 ;
14097   PyObject * obj6 = 0 ;
14098   char *  kwnames[] = {
14099     (char *) "self",(char *) "utf8_path",(char *) "xsize",(char *) "ysize",(char *) "bands",(char *) "eType",(char *) "options", NULL
14100   };
14101   GDALDatasetShadow *result = 0 ;
14102 
14103   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO|OOO:Driver_Create",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
14104   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14105   if (!SWIG_IsOK(res1)) {
14106     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Create" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14107   }
14108   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14109   {
14110     /* %typemap(in) (const char *utf8_path) */
14111     arg2 = GDALPythonObjectToCStr( obj1, &bToFree2 );
14112     if (arg2 == NULL)
14113     {
14114       PyErr_SetString( PyExc_RuntimeError, "not a string" );
14115       SWIG_fail;
14116     }
14117   }
14118   ecode3 = SWIG_AsVal_int(obj2, &val3);
14119   if (!SWIG_IsOK(ecode3)) {
14120     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Driver_Create" "', argument " "3"" of type '" "int""'");
14121   }
14122   arg3 = static_cast< int >(val3);
14123   ecode4 = SWIG_AsVal_int(obj3, &val4);
14124   if (!SWIG_IsOK(ecode4)) {
14125     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Driver_Create" "', argument " "4"" of type '" "int""'");
14126   }
14127   arg4 = static_cast< int >(val4);
14128   if (obj4) {
14129     ecode5 = SWIG_AsVal_int(obj4, &val5);
14130     if (!SWIG_IsOK(ecode5)) {
14131       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Driver_Create" "', argument " "5"" of type '" "int""'");
14132     }
14133     arg5 = static_cast< int >(val5);
14134   }
14135   if (obj5) {
14136     {
14137       // %typemap(in) GDALDataType
14138       int val = 0;
14139       int ecode = SWIG_AsVal_int(obj5, &val);
14140       if (!SWIG_IsOK(ecode)) {
14141         SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
14142       }
14143       if( val < GDT_Unknown || val >= GDT_TypeCount )
14144       {
14145         SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
14146       }
14147       arg6 = static_cast<GDALDataType>(val);
14148     }
14149   }
14150   if (obj6) {
14151     {
14152       /* %typemap(in) char **options */
14153       int bErr = FALSE;
14154       arg7 = CSLFromPySequence(obj6, &bErr);
14155       if( bErr )
14156       {
14157         SWIG_fail;
14158       }
14159     }
14160   }
14161   {
14162     if (!arg2) {
14163       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14164     }
14165   }
14166   {
14167     if ( bUseExceptions ) {
14168       ClearErrorState();
14169     }
14170     {
14171       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14172       result = (GDALDatasetShadow *)GDALDriverShadow_Create(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
14173       SWIG_PYTHON_THREAD_END_ALLOW;
14174     }
14175 #ifndef SED_HACKS
14176     if ( bUseExceptions ) {
14177       CPLErr eclass = CPLGetLastErrorType();
14178       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14179         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14180       }
14181     }
14182 #endif
14183   }
14184   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
14185   {
14186     /* %typemap(freearg) (const char *utf8_path) */
14187     GDALPythonFreeCStr(arg2, bToFree2);
14188   }
14189   {
14190     /* %typemap(freearg) char **options */
14191     CSLDestroy( arg7 );
14192   }
14193   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14194   return resultobj;
14195 fail:
14196   {
14197     /* %typemap(freearg) (const char *utf8_path) */
14198     GDALPythonFreeCStr(arg2, bToFree2);
14199   }
14200   {
14201     /* %typemap(freearg) char **options */
14202     CSLDestroy( arg7 );
14203   }
14204   return NULL;
14205 }
14206 
14207 
_wrap_Driver_CreateMultiDimensional(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)14208 SWIGINTERN PyObject *_wrap_Driver_CreateMultiDimensional(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
14209   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14210   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14211   char *arg2 = (char *) 0 ;
14212   char **arg3 = (char **) 0 ;
14213   char **arg4 = (char **) 0 ;
14214   void *argp1 = 0 ;
14215   int res1 = 0 ;
14216   int bToFree2 = 0 ;
14217   PyObject * obj0 = 0 ;
14218   PyObject * obj1 = 0 ;
14219   PyObject * obj2 = 0 ;
14220   PyObject * obj3 = 0 ;
14221   char *  kwnames[] = {
14222     (char *) "self",(char *) "utf8_path",(char *) "root_group_options",(char *) "options", NULL
14223   };
14224   GDALDatasetShadow *result = 0 ;
14225 
14226   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:Driver_CreateMultiDimensional",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
14227   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14228   if (!SWIG_IsOK(res1)) {
14229     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_CreateMultiDimensional" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14230   }
14231   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14232   {
14233     /* %typemap(in) (const char *utf8_path) */
14234     arg2 = GDALPythonObjectToCStr( obj1, &bToFree2 );
14235     if (arg2 == NULL)
14236     {
14237       PyErr_SetString( PyExc_RuntimeError, "not a string" );
14238       SWIG_fail;
14239     }
14240   }
14241   if (obj2) {
14242     {
14243       /* %typemap(in) char **options */
14244       int bErr = FALSE;
14245       arg3 = CSLFromPySequence(obj2, &bErr);
14246       if( bErr )
14247       {
14248         SWIG_fail;
14249       }
14250     }
14251   }
14252   if (obj3) {
14253     {
14254       /* %typemap(in) char **options */
14255       int bErr = FALSE;
14256       arg4 = CSLFromPySequence(obj3, &bErr);
14257       if( bErr )
14258       {
14259         SWIG_fail;
14260       }
14261     }
14262   }
14263   {
14264     if (!arg2) {
14265       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14266     }
14267   }
14268   {
14269     if ( bUseExceptions ) {
14270       ClearErrorState();
14271     }
14272     {
14273       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14274       result = (GDALDatasetShadow *)GDALDriverShadow_CreateMultiDimensional(arg1,(char const *)arg2,arg3,arg4);
14275       SWIG_PYTHON_THREAD_END_ALLOW;
14276     }
14277 #ifndef SED_HACKS
14278     if ( bUseExceptions ) {
14279       CPLErr eclass = CPLGetLastErrorType();
14280       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14281         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14282       }
14283     }
14284 #endif
14285   }
14286   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
14287   {
14288     /* %typemap(freearg) (const char *utf8_path) */
14289     GDALPythonFreeCStr(arg2, bToFree2);
14290   }
14291   {
14292     /* %typemap(freearg) char **options */
14293     CSLDestroy( arg3 );
14294   }
14295   {
14296     /* %typemap(freearg) char **options */
14297     CSLDestroy( arg4 );
14298   }
14299   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14300   return resultobj;
14301 fail:
14302   {
14303     /* %typemap(freearg) (const char *utf8_path) */
14304     GDALPythonFreeCStr(arg2, bToFree2);
14305   }
14306   {
14307     /* %typemap(freearg) char **options */
14308     CSLDestroy( arg3 );
14309   }
14310   {
14311     /* %typemap(freearg) char **options */
14312     CSLDestroy( arg4 );
14313   }
14314   return NULL;
14315 }
14316 
14317 
_wrap_Driver_CreateCopy(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)14318 SWIGINTERN PyObject *_wrap_Driver_CreateCopy(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
14319   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14320   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14321   char *arg2 = (char *) 0 ;
14322   GDALDatasetShadow *arg3 = (GDALDatasetShadow *) 0 ;
14323   int arg4 = (int) 1 ;
14324   char **arg5 = (char **) 0 ;
14325   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
14326   void *arg7 = (void *) NULL ;
14327   void *argp1 = 0 ;
14328   int res1 = 0 ;
14329   int bToFree2 = 0 ;
14330   void *argp3 = 0 ;
14331   int res3 = 0 ;
14332   int val4 ;
14333   int ecode4 = 0 ;
14334   PyObject * obj0 = 0 ;
14335   PyObject * obj1 = 0 ;
14336   PyObject * obj2 = 0 ;
14337   PyObject * obj3 = 0 ;
14338   PyObject * obj4 = 0 ;
14339   PyObject * obj5 = 0 ;
14340   PyObject * obj6 = 0 ;
14341   char *  kwnames[] = {
14342     (char *) "self",(char *) "utf8_path",(char *) "src",(char *) "strict",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
14343   };
14344   GDALDatasetShadow *result = 0 ;
14345 
14346   /* %typemap(arginit) ( const char* callback_data=NULL)  */
14347   PyProgressData *psProgressInfo;
14348   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
14349   psProgressInfo->nLastReported = -1;
14350   psProgressInfo->psPyCallback = NULL;
14351   psProgressInfo->psPyCallbackData = NULL;
14352   arg7 = psProgressInfo;
14353   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OOOO:Driver_CreateCopy",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
14354   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14355   if (!SWIG_IsOK(res1)) {
14356     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_CreateCopy" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14357   }
14358   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14359   {
14360     /* %typemap(in) (const char *utf8_path) */
14361     arg2 = GDALPythonObjectToCStr( obj1, &bToFree2 );
14362     if (arg2 == NULL)
14363     {
14364       PyErr_SetString( PyExc_RuntimeError, "not a string" );
14365       SWIG_fail;
14366     }
14367   }
14368   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
14369   if (!SWIG_IsOK(res3)) {
14370     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Driver_CreateCopy" "', argument " "3"" of type '" "GDALDatasetShadow *""'");
14371   }
14372   arg3 = reinterpret_cast< GDALDatasetShadow * >(argp3);
14373   if (obj3) {
14374     ecode4 = SWIG_AsVal_int(obj3, &val4);
14375     if (!SWIG_IsOK(ecode4)) {
14376       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Driver_CreateCopy" "', argument " "4"" of type '" "int""'");
14377     }
14378     arg4 = static_cast< int >(val4);
14379   }
14380   if (obj4) {
14381     {
14382       /* %typemap(in) char **options */
14383       int bErr = FALSE;
14384       arg5 = CSLFromPySequence(obj4, &bErr);
14385       if( bErr )
14386       {
14387         SWIG_fail;
14388       }
14389     }
14390   }
14391   if (obj5) {
14392     {
14393       /* %typemap(in) (GDALProgressFunc callback = NULL) */
14394       /* callback_func typemap */
14395 
14396       /* In some cases 0 is passed instead of None. */
14397       /* See https://github.com/OSGeo/gdal/pull/219 */
14398       if ( PyLong_Check(obj5) || PyInt_Check(obj5) )
14399       {
14400         if( PyLong_AsLong(obj5) == 0 )
14401         {
14402           obj5 = Py_None;
14403         }
14404       }
14405 
14406       if (obj5 && obj5 != Py_None ) {
14407         void* cbfunction = NULL;
14408         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj5,
14409             (void**)&cbfunction,
14410             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
14411             SWIG_POINTER_EXCEPTION | 0 ));
14412 
14413         if ( cbfunction == GDALTermProgress ) {
14414           arg6 = GDALTermProgress;
14415         } else {
14416           if (!PyCallable_Check(obj5)) {
14417             PyErr_SetString( PyExc_RuntimeError,
14418               "Object given is not a Python function" );
14419             SWIG_fail;
14420           }
14421           psProgressInfo->psPyCallback = obj5;
14422           arg6 = PyProgressProxy;
14423         }
14424 
14425       }
14426 
14427     }
14428   }
14429   if (obj6) {
14430     {
14431       /* %typemap(in) ( void* callback_data=NULL)  */
14432       psProgressInfo->psPyCallbackData = obj6 ;
14433     }
14434   }
14435   {
14436     if (!arg2) {
14437       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14438     }
14439   }
14440   {
14441     if (!arg3) {
14442       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14443     }
14444   }
14445   {
14446     if ( bUseExceptions ) {
14447       ClearErrorState();
14448     }
14449     {
14450       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14451       result = (GDALDatasetShadow *)GDALDriverShadow_CreateCopy(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
14452       SWIG_PYTHON_THREAD_END_ALLOW;
14453     }
14454 #ifndef SED_HACKS
14455     if ( bUseExceptions ) {
14456       CPLErr eclass = CPLGetLastErrorType();
14457       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14458         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14459       }
14460     }
14461 #endif
14462   }
14463   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
14464   {
14465     /* %typemap(freearg) (const char *utf8_path) */
14466     GDALPythonFreeCStr(arg2, bToFree2);
14467   }
14468   {
14469     /* %typemap(freearg) char **options */
14470     CSLDestroy( arg5 );
14471   }
14472   {
14473     /* %typemap(freearg) ( void* callback_data=NULL)  */
14474 
14475     CPLFree(psProgressInfo);
14476 
14477   }
14478   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14479   return resultobj;
14480 fail:
14481   {
14482     /* %typemap(freearg) (const char *utf8_path) */
14483     GDALPythonFreeCStr(arg2, bToFree2);
14484   }
14485   {
14486     /* %typemap(freearg) char **options */
14487     CSLDestroy( arg5 );
14488   }
14489   {
14490     /* %typemap(freearg) ( void* callback_data=NULL)  */
14491 
14492     CPLFree(psProgressInfo);
14493 
14494   }
14495   return NULL;
14496 }
14497 
14498 
_wrap_Driver_Delete(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14499 SWIGINTERN PyObject *_wrap_Driver_Delete(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14500   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14501   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14502   char *arg2 = (char *) 0 ;
14503   void *argp1 = 0 ;
14504   int res1 = 0 ;
14505   int bToFree2 = 0 ;
14506   PyObject * obj0 = 0 ;
14507   PyObject * obj1 = 0 ;
14508   CPLErr result;
14509 
14510   if (!PyArg_ParseTuple(args,(char *)"OO:Driver_Delete",&obj0,&obj1)) SWIG_fail;
14511   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14512   if (!SWIG_IsOK(res1)) {
14513     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Delete" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14514   }
14515   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14516   {
14517     /* %typemap(in) (const char *utf8_path) */
14518     arg2 = GDALPythonObjectToCStr( obj1, &bToFree2 );
14519     if (arg2 == NULL)
14520     {
14521       PyErr_SetString( PyExc_RuntimeError, "not a string" );
14522       SWIG_fail;
14523     }
14524   }
14525   {
14526     if (!arg2) {
14527       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14528     }
14529   }
14530   {
14531     if ( bUseExceptions ) {
14532       ClearErrorState();
14533     }
14534     {
14535       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14536       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDriverShadow_Delete(arg1,(char const *)arg2));
14537       SWIG_PYTHON_THREAD_END_ALLOW;
14538     }
14539 #ifndef SED_HACKS
14540     if ( bUseExceptions ) {
14541       CPLErr eclass = CPLGetLastErrorType();
14542       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14543         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14544       }
14545     }
14546 #endif
14547   }
14548   resultobj = SWIG_From_int(static_cast< int >(result));
14549   {
14550     /* %typemap(freearg) (const char *utf8_path) */
14551     GDALPythonFreeCStr(arg2, bToFree2);
14552   }
14553   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14554   return resultobj;
14555 fail:
14556   {
14557     /* %typemap(freearg) (const char *utf8_path) */
14558     GDALPythonFreeCStr(arg2, bToFree2);
14559   }
14560   return NULL;
14561 }
14562 
14563 
_wrap_Driver_Rename(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14564 SWIGINTERN PyObject *_wrap_Driver_Rename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14565   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14566   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14567   char *arg2 = (char *) 0 ;
14568   char *arg3 = (char *) 0 ;
14569   void *argp1 = 0 ;
14570   int res1 = 0 ;
14571   int res2 ;
14572   char *buf2 = 0 ;
14573   int alloc2 = 0 ;
14574   int res3 ;
14575   char *buf3 = 0 ;
14576   int alloc3 = 0 ;
14577   PyObject * obj0 = 0 ;
14578   PyObject * obj1 = 0 ;
14579   PyObject * obj2 = 0 ;
14580   CPLErr result;
14581 
14582   if (!PyArg_ParseTuple(args,(char *)"OOO:Driver_Rename",&obj0,&obj1,&obj2)) SWIG_fail;
14583   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14584   if (!SWIG_IsOK(res1)) {
14585     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Rename" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14586   }
14587   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14588   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
14589   if (!SWIG_IsOK(res2)) {
14590     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_Rename" "', argument " "2"" of type '" "char const *""'");
14591   }
14592   arg2 = reinterpret_cast< char * >(buf2);
14593   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
14594   if (!SWIG_IsOK(res3)) {
14595     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Driver_Rename" "', argument " "3"" of type '" "char const *""'");
14596   }
14597   arg3 = reinterpret_cast< char * >(buf3);
14598   {
14599     if (!arg2) {
14600       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14601     }
14602   }
14603   {
14604     if (!arg3) {
14605       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14606     }
14607   }
14608   {
14609     if ( bUseExceptions ) {
14610       ClearErrorState();
14611     }
14612     {
14613       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14614       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDriverShadow_Rename(arg1,(char const *)arg2,(char const *)arg3));
14615       SWIG_PYTHON_THREAD_END_ALLOW;
14616     }
14617 #ifndef SED_HACKS
14618     if ( bUseExceptions ) {
14619       CPLErr eclass = CPLGetLastErrorType();
14620       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14621         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14622       }
14623     }
14624 #endif
14625   }
14626   resultobj = SWIG_From_int(static_cast< int >(result));
14627   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
14628   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
14629   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14630   return resultobj;
14631 fail:
14632   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
14633   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
14634   return NULL;
14635 }
14636 
14637 
_wrap_Driver_CopyFiles(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14638 SWIGINTERN PyObject *_wrap_Driver_CopyFiles(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14639   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14640   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14641   char *arg2 = (char *) 0 ;
14642   char *arg3 = (char *) 0 ;
14643   void *argp1 = 0 ;
14644   int res1 = 0 ;
14645   int res2 ;
14646   char *buf2 = 0 ;
14647   int alloc2 = 0 ;
14648   int res3 ;
14649   char *buf3 = 0 ;
14650   int alloc3 = 0 ;
14651   PyObject * obj0 = 0 ;
14652   PyObject * obj1 = 0 ;
14653   PyObject * obj2 = 0 ;
14654   CPLErr result;
14655 
14656   if (!PyArg_ParseTuple(args,(char *)"OOO:Driver_CopyFiles",&obj0,&obj1,&obj2)) SWIG_fail;
14657   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14658   if (!SWIG_IsOK(res1)) {
14659     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_CopyFiles" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14660   }
14661   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14662   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
14663   if (!SWIG_IsOK(res2)) {
14664     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Driver_CopyFiles" "', argument " "2"" of type '" "char const *""'");
14665   }
14666   arg2 = reinterpret_cast< char * >(buf2);
14667   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
14668   if (!SWIG_IsOK(res3)) {
14669     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Driver_CopyFiles" "', argument " "3"" of type '" "char const *""'");
14670   }
14671   arg3 = reinterpret_cast< char * >(buf3);
14672   {
14673     if (!arg2) {
14674       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14675     }
14676   }
14677   {
14678     if (!arg3) {
14679       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14680     }
14681   }
14682   {
14683     if ( bUseExceptions ) {
14684       ClearErrorState();
14685     }
14686     {
14687       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14688       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDriverShadow_CopyFiles(arg1,(char const *)arg2,(char const *)arg3));
14689       SWIG_PYTHON_THREAD_END_ALLOW;
14690     }
14691 #ifndef SED_HACKS
14692     if ( bUseExceptions ) {
14693       CPLErr eclass = CPLGetLastErrorType();
14694       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14695         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14696       }
14697     }
14698 #endif
14699   }
14700   resultobj = SWIG_From_int(static_cast< int >(result));
14701   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
14702   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
14703   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14704   return resultobj;
14705 fail:
14706   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
14707   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
14708   return NULL;
14709 }
14710 
14711 
_wrap_Driver_Register(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14712 SWIGINTERN PyObject *_wrap_Driver_Register(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14713   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14714   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14715   void *argp1 = 0 ;
14716   int res1 = 0 ;
14717   PyObject * obj0 = 0 ;
14718   int result;
14719 
14720   if (!PyArg_ParseTuple(args,(char *)"O:Driver_Register",&obj0)) SWIG_fail;
14721   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14722   if (!SWIG_IsOK(res1)) {
14723     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Register" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14724   }
14725   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14726   {
14727     if ( bUseExceptions ) {
14728       ClearErrorState();
14729     }
14730     {
14731       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14732       result = (int)GDALDriverShadow_Register(arg1);
14733       SWIG_PYTHON_THREAD_END_ALLOW;
14734     }
14735 #ifndef SED_HACKS
14736     if ( bUseExceptions ) {
14737       CPLErr eclass = CPLGetLastErrorType();
14738       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14739         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14740       }
14741     }
14742 #endif
14743   }
14744   resultobj = SWIG_From_int(static_cast< int >(result));
14745   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14746   return resultobj;
14747 fail:
14748   return NULL;
14749 }
14750 
14751 
_wrap_Driver_Deregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14752 SWIGINTERN PyObject *_wrap_Driver_Deregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14753   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14754   GDALDriverShadow *arg1 = (GDALDriverShadow *) 0 ;
14755   void *argp1 = 0 ;
14756   int res1 = 0 ;
14757   PyObject * obj0 = 0 ;
14758 
14759   if (!PyArg_ParseTuple(args,(char *)"O:Driver_Deregister",&obj0)) SWIG_fail;
14760   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
14761   if (!SWIG_IsOK(res1)) {
14762     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Driver_Deregister" "', argument " "1"" of type '" "GDALDriverShadow *""'");
14763   }
14764   arg1 = reinterpret_cast< GDALDriverShadow * >(argp1);
14765   {
14766     if ( bUseExceptions ) {
14767       ClearErrorState();
14768     }
14769     {
14770       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14771       GDALDriverShadow_Deregister(arg1);
14772       SWIG_PYTHON_THREAD_END_ALLOW;
14773     }
14774 #ifndef SED_HACKS
14775     if ( bUseExceptions ) {
14776       CPLErr eclass = CPLGetLastErrorType();
14777       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
14778         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
14779       }
14780     }
14781 #endif
14782   }
14783   resultobj = SWIG_Py_Void();
14784   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14785   return resultobj;
14786 fail:
14787   return NULL;
14788 }
14789 
14790 
Driver_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14791 SWIGINTERN PyObject *Driver_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14792   PyObject *obj;
14793   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
14794   SWIG_TypeNewClientData(SWIGTYPE_p_GDALDriverShadow, SWIG_NewClientData(obj));
14795   return SWIG_Py_Void();
14796 }
14797 
_wrap_ColorEntry_c1_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14798 SWIGINTERN PyObject *_wrap_ColorEntry_c1_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14799   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14800   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
14801   short arg2 ;
14802   GDALColorEntry ce1 ;
14803   short val2 ;
14804   int ecode2 = 0 ;
14805   PyObject * obj0 = 0 ;
14806   PyObject * obj1 = 0 ;
14807 
14808   if (!PyArg_ParseTuple(args,(char *)"OO:ColorEntry_c1_set",&obj0,&obj1)) SWIG_fail;
14809   {
14810     /* %typemap(in) GDALColorEntry* */
14811     ce1.c4 = 255;
14812     if (! PySequence_Check(obj0) ) {
14813       PyErr_SetString(PyExc_TypeError, "not a sequence");
14814       SWIG_fail;
14815     }
14816     Py_ssize_t size = PySequence_Size(obj0);
14817     if ( size > 4 ) {
14818       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
14819       SWIG_fail;
14820     }
14821     if ( size < 3 ) {
14822       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
14823       SWIG_fail;
14824     }
14825     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
14826       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
14827       SWIG_fail;
14828     }
14829     arg1 = &ce1;
14830   }
14831   ecode2 = SWIG_AsVal_short(obj1, &val2);
14832   if (!SWIG_IsOK(ecode2)) {
14833     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorEntry_c1_set" "', argument " "2"" of type '" "short""'");
14834   }
14835   arg2 = static_cast< short >(val2);
14836   {
14837     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14838     if (arg1) (arg1)->c1 = arg2;
14839     SWIG_PYTHON_THREAD_END_ALLOW;
14840   }
14841   resultobj = SWIG_Py_Void();
14842   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14843   return resultobj;
14844 fail:
14845   return NULL;
14846 }
14847 
14848 
_wrap_ColorEntry_c1_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14849 SWIGINTERN PyObject *_wrap_ColorEntry_c1_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14850   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14851   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
14852   GDALColorEntry ce1 ;
14853   PyObject * obj0 = 0 ;
14854   short result;
14855 
14856   if (!PyArg_ParseTuple(args,(char *)"O:ColorEntry_c1_get",&obj0)) SWIG_fail;
14857   {
14858     /* %typemap(in) GDALColorEntry* */
14859     ce1.c4 = 255;
14860     if (! PySequence_Check(obj0) ) {
14861       PyErr_SetString(PyExc_TypeError, "not a sequence");
14862       SWIG_fail;
14863     }
14864     Py_ssize_t size = PySequence_Size(obj0);
14865     if ( size > 4 ) {
14866       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
14867       SWIG_fail;
14868     }
14869     if ( size < 3 ) {
14870       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
14871       SWIG_fail;
14872     }
14873     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
14874       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
14875       SWIG_fail;
14876     }
14877     arg1 = &ce1;
14878   }
14879   {
14880     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14881     result = (short) ((arg1)->c1);
14882     SWIG_PYTHON_THREAD_END_ALLOW;
14883   }
14884   resultobj = SWIG_From_short(static_cast< short >(result));
14885   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14886   return resultobj;
14887 fail:
14888   return NULL;
14889 }
14890 
14891 
_wrap_ColorEntry_c2_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14892 SWIGINTERN PyObject *_wrap_ColorEntry_c2_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14893   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14894   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
14895   short arg2 ;
14896   GDALColorEntry ce1 ;
14897   short val2 ;
14898   int ecode2 = 0 ;
14899   PyObject * obj0 = 0 ;
14900   PyObject * obj1 = 0 ;
14901 
14902   if (!PyArg_ParseTuple(args,(char *)"OO:ColorEntry_c2_set",&obj0,&obj1)) SWIG_fail;
14903   {
14904     /* %typemap(in) GDALColorEntry* */
14905     ce1.c4 = 255;
14906     if (! PySequence_Check(obj0) ) {
14907       PyErr_SetString(PyExc_TypeError, "not a sequence");
14908       SWIG_fail;
14909     }
14910     Py_ssize_t size = PySequence_Size(obj0);
14911     if ( size > 4 ) {
14912       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
14913       SWIG_fail;
14914     }
14915     if ( size < 3 ) {
14916       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
14917       SWIG_fail;
14918     }
14919     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
14920       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
14921       SWIG_fail;
14922     }
14923     arg1 = &ce1;
14924   }
14925   ecode2 = SWIG_AsVal_short(obj1, &val2);
14926   if (!SWIG_IsOK(ecode2)) {
14927     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorEntry_c2_set" "', argument " "2"" of type '" "short""'");
14928   }
14929   arg2 = static_cast< short >(val2);
14930   {
14931     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14932     if (arg1) (arg1)->c2 = arg2;
14933     SWIG_PYTHON_THREAD_END_ALLOW;
14934   }
14935   resultobj = SWIG_Py_Void();
14936   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14937   return resultobj;
14938 fail:
14939   return NULL;
14940 }
14941 
14942 
_wrap_ColorEntry_c2_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14943 SWIGINTERN PyObject *_wrap_ColorEntry_c2_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14944   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14945   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
14946   GDALColorEntry ce1 ;
14947   PyObject * obj0 = 0 ;
14948   short result;
14949 
14950   if (!PyArg_ParseTuple(args,(char *)"O:ColorEntry_c2_get",&obj0)) SWIG_fail;
14951   {
14952     /* %typemap(in) GDALColorEntry* */
14953     ce1.c4 = 255;
14954     if (! PySequence_Check(obj0) ) {
14955       PyErr_SetString(PyExc_TypeError, "not a sequence");
14956       SWIG_fail;
14957     }
14958     Py_ssize_t size = PySequence_Size(obj0);
14959     if ( size > 4 ) {
14960       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
14961       SWIG_fail;
14962     }
14963     if ( size < 3 ) {
14964       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
14965       SWIG_fail;
14966     }
14967     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
14968       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
14969       SWIG_fail;
14970     }
14971     arg1 = &ce1;
14972   }
14973   {
14974     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
14975     result = (short) ((arg1)->c2);
14976     SWIG_PYTHON_THREAD_END_ALLOW;
14977   }
14978   resultobj = SWIG_From_short(static_cast< short >(result));
14979   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
14980   return resultobj;
14981 fail:
14982   return NULL;
14983 }
14984 
14985 
_wrap_ColorEntry_c3_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)14986 SWIGINTERN PyObject *_wrap_ColorEntry_c3_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
14987   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
14988   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
14989   short arg2 ;
14990   GDALColorEntry ce1 ;
14991   short val2 ;
14992   int ecode2 = 0 ;
14993   PyObject * obj0 = 0 ;
14994   PyObject * obj1 = 0 ;
14995 
14996   if (!PyArg_ParseTuple(args,(char *)"OO:ColorEntry_c3_set",&obj0,&obj1)) SWIG_fail;
14997   {
14998     /* %typemap(in) GDALColorEntry* */
14999     ce1.c4 = 255;
15000     if (! PySequence_Check(obj0) ) {
15001       PyErr_SetString(PyExc_TypeError, "not a sequence");
15002       SWIG_fail;
15003     }
15004     Py_ssize_t size = PySequence_Size(obj0);
15005     if ( size > 4 ) {
15006       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
15007       SWIG_fail;
15008     }
15009     if ( size < 3 ) {
15010       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
15011       SWIG_fail;
15012     }
15013     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
15014       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
15015       SWIG_fail;
15016     }
15017     arg1 = &ce1;
15018   }
15019   ecode2 = SWIG_AsVal_short(obj1, &val2);
15020   if (!SWIG_IsOK(ecode2)) {
15021     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorEntry_c3_set" "', argument " "2"" of type '" "short""'");
15022   }
15023   arg2 = static_cast< short >(val2);
15024   {
15025     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15026     if (arg1) (arg1)->c3 = arg2;
15027     SWIG_PYTHON_THREAD_END_ALLOW;
15028   }
15029   resultobj = SWIG_Py_Void();
15030   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15031   return resultobj;
15032 fail:
15033   return NULL;
15034 }
15035 
15036 
_wrap_ColorEntry_c3_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15037 SWIGINTERN PyObject *_wrap_ColorEntry_c3_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15038   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15039   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
15040   GDALColorEntry ce1 ;
15041   PyObject * obj0 = 0 ;
15042   short result;
15043 
15044   if (!PyArg_ParseTuple(args,(char *)"O:ColorEntry_c3_get",&obj0)) SWIG_fail;
15045   {
15046     /* %typemap(in) GDALColorEntry* */
15047     ce1.c4 = 255;
15048     if (! PySequence_Check(obj0) ) {
15049       PyErr_SetString(PyExc_TypeError, "not a sequence");
15050       SWIG_fail;
15051     }
15052     Py_ssize_t size = PySequence_Size(obj0);
15053     if ( size > 4 ) {
15054       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
15055       SWIG_fail;
15056     }
15057     if ( size < 3 ) {
15058       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
15059       SWIG_fail;
15060     }
15061     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
15062       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
15063       SWIG_fail;
15064     }
15065     arg1 = &ce1;
15066   }
15067   {
15068     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15069     result = (short) ((arg1)->c3);
15070     SWIG_PYTHON_THREAD_END_ALLOW;
15071   }
15072   resultobj = SWIG_From_short(static_cast< short >(result));
15073   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15074   return resultobj;
15075 fail:
15076   return NULL;
15077 }
15078 
15079 
_wrap_ColorEntry_c4_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15080 SWIGINTERN PyObject *_wrap_ColorEntry_c4_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15081   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15082   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
15083   short arg2 ;
15084   GDALColorEntry ce1 ;
15085   short val2 ;
15086   int ecode2 = 0 ;
15087   PyObject * obj0 = 0 ;
15088   PyObject * obj1 = 0 ;
15089 
15090   if (!PyArg_ParseTuple(args,(char *)"OO:ColorEntry_c4_set",&obj0,&obj1)) SWIG_fail;
15091   {
15092     /* %typemap(in) GDALColorEntry* */
15093     ce1.c4 = 255;
15094     if (! PySequence_Check(obj0) ) {
15095       PyErr_SetString(PyExc_TypeError, "not a sequence");
15096       SWIG_fail;
15097     }
15098     Py_ssize_t size = PySequence_Size(obj0);
15099     if ( size > 4 ) {
15100       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
15101       SWIG_fail;
15102     }
15103     if ( size < 3 ) {
15104       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
15105       SWIG_fail;
15106     }
15107     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
15108       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
15109       SWIG_fail;
15110     }
15111     arg1 = &ce1;
15112   }
15113   ecode2 = SWIG_AsVal_short(obj1, &val2);
15114   if (!SWIG_IsOK(ecode2)) {
15115     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorEntry_c4_set" "', argument " "2"" of type '" "short""'");
15116   }
15117   arg2 = static_cast< short >(val2);
15118   {
15119     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15120     if (arg1) (arg1)->c4 = arg2;
15121     SWIG_PYTHON_THREAD_END_ALLOW;
15122   }
15123   resultobj = SWIG_Py_Void();
15124   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15125   return resultobj;
15126 fail:
15127   return NULL;
15128 }
15129 
15130 
_wrap_ColorEntry_c4_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15131 SWIGINTERN PyObject *_wrap_ColorEntry_c4_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15132   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15133   GDALColorEntry *arg1 = (GDALColorEntry *) 0 ;
15134   GDALColorEntry ce1 ;
15135   PyObject * obj0 = 0 ;
15136   short result;
15137 
15138   if (!PyArg_ParseTuple(args,(char *)"O:ColorEntry_c4_get",&obj0)) SWIG_fail;
15139   {
15140     /* %typemap(in) GDALColorEntry* */
15141     ce1.c4 = 255;
15142     if (! PySequence_Check(obj0) ) {
15143       PyErr_SetString(PyExc_TypeError, "not a sequence");
15144       SWIG_fail;
15145     }
15146     Py_ssize_t size = PySequence_Size(obj0);
15147     if ( size > 4 ) {
15148       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
15149       SWIG_fail;
15150     }
15151     if ( size < 3 ) {
15152       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
15153       SWIG_fail;
15154     }
15155     if ( !PyArg_ParseTuple( obj0,"hhh|h", &ce1.c1, &ce1.c2, &ce1.c3, &ce1.c4 ) ) {
15156       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
15157       SWIG_fail;
15158     }
15159     arg1 = &ce1;
15160   }
15161   {
15162     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15163     result = (short) ((arg1)->c4);
15164     SWIG_PYTHON_THREAD_END_ALLOW;
15165   }
15166   resultobj = SWIG_From_short(static_cast< short >(result));
15167   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15168   return resultobj;
15169 fail:
15170   return NULL;
15171 }
15172 
15173 
ColorEntry_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15174 SWIGINTERN PyObject *ColorEntry_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15175   PyObject *obj;
15176   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
15177   SWIG_TypeNewClientData(SWIGTYPE_p_GDALColorEntry, SWIG_NewClientData(obj));
15178   return SWIG_Py_Void();
15179 }
15180 
_wrap_GCP_GCPX_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15181 SWIGINTERN PyObject *_wrap_GCP_GCPX_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15182   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15183   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15184   double arg2 ;
15185   void *argp1 = 0 ;
15186   int res1 = 0 ;
15187   double val2 ;
15188   int ecode2 = 0 ;
15189   PyObject * obj0 = 0 ;
15190   PyObject * obj1 = 0 ;
15191 
15192   if (!PyArg_ParseTuple(args,(char *)"OO:GCP_GCPX_set",&obj0,&obj1)) SWIG_fail;
15193   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15194   if (!SWIG_IsOK(res1)) {
15195     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPX_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
15196   }
15197   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15198   ecode2 = SWIG_AsVal_double(obj1, &val2);
15199   if (!SWIG_IsOK(ecode2)) {
15200     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_GCPX_set" "', argument " "2"" of type '" "double""'");
15201   }
15202   arg2 = static_cast< double >(val2);
15203   {
15204     if ( bUseExceptions ) {
15205       ClearErrorState();
15206     }
15207     {
15208       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15209       GDAL_GCP_GCPX_set(arg1,arg2);
15210       SWIG_PYTHON_THREAD_END_ALLOW;
15211     }
15212 #ifndef SED_HACKS
15213     if ( bUseExceptions ) {
15214       CPLErr eclass = CPLGetLastErrorType();
15215       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15216         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15217       }
15218     }
15219 #endif
15220   }
15221   resultobj = SWIG_Py_Void();
15222   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15223   return resultobj;
15224 fail:
15225   return NULL;
15226 }
15227 
15228 
_wrap_GCP_GCPX_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15229 SWIGINTERN PyObject *_wrap_GCP_GCPX_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15230   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15231   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15232   void *argp1 = 0 ;
15233   int res1 = 0 ;
15234   PyObject * obj0 = 0 ;
15235   double result;
15236 
15237   if (!PyArg_ParseTuple(args,(char *)"O:GCP_GCPX_get",&obj0)) SWIG_fail;
15238   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15239   if (!SWIG_IsOK(res1)) {
15240     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPX_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15241   }
15242   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15243   {
15244     if ( bUseExceptions ) {
15245       ClearErrorState();
15246     }
15247     {
15248       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15249       result = (double)GDAL_GCP_GCPX_get(arg1);
15250       SWIG_PYTHON_THREAD_END_ALLOW;
15251     }
15252 #ifndef SED_HACKS
15253     if ( bUseExceptions ) {
15254       CPLErr eclass = CPLGetLastErrorType();
15255       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15256         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15257       }
15258     }
15259 #endif
15260   }
15261   resultobj = SWIG_From_double(static_cast< double >(result));
15262   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15263   return resultobj;
15264 fail:
15265   return NULL;
15266 }
15267 
15268 
_wrap_GCP_GCPY_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15269 SWIGINTERN PyObject *_wrap_GCP_GCPY_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15270   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15271   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15272   double arg2 ;
15273   void *argp1 = 0 ;
15274   int res1 = 0 ;
15275   double val2 ;
15276   int ecode2 = 0 ;
15277   PyObject * obj0 = 0 ;
15278   PyObject * obj1 = 0 ;
15279 
15280   if (!PyArg_ParseTuple(args,(char *)"OO:GCP_GCPY_set",&obj0,&obj1)) SWIG_fail;
15281   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15282   if (!SWIG_IsOK(res1)) {
15283     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPY_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
15284   }
15285   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15286   ecode2 = SWIG_AsVal_double(obj1, &val2);
15287   if (!SWIG_IsOK(ecode2)) {
15288     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_GCPY_set" "', argument " "2"" of type '" "double""'");
15289   }
15290   arg2 = static_cast< double >(val2);
15291   {
15292     if ( bUseExceptions ) {
15293       ClearErrorState();
15294     }
15295     {
15296       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15297       GDAL_GCP_GCPY_set(arg1,arg2);
15298       SWIG_PYTHON_THREAD_END_ALLOW;
15299     }
15300 #ifndef SED_HACKS
15301     if ( bUseExceptions ) {
15302       CPLErr eclass = CPLGetLastErrorType();
15303       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15304         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15305       }
15306     }
15307 #endif
15308   }
15309   resultobj = SWIG_Py_Void();
15310   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15311   return resultobj;
15312 fail:
15313   return NULL;
15314 }
15315 
15316 
_wrap_GCP_GCPY_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15317 SWIGINTERN PyObject *_wrap_GCP_GCPY_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15318   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15319   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15320   void *argp1 = 0 ;
15321   int res1 = 0 ;
15322   PyObject * obj0 = 0 ;
15323   double result;
15324 
15325   if (!PyArg_ParseTuple(args,(char *)"O:GCP_GCPY_get",&obj0)) SWIG_fail;
15326   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15327   if (!SWIG_IsOK(res1)) {
15328     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPY_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15329   }
15330   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15331   {
15332     if ( bUseExceptions ) {
15333       ClearErrorState();
15334     }
15335     {
15336       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15337       result = (double)GDAL_GCP_GCPY_get(arg1);
15338       SWIG_PYTHON_THREAD_END_ALLOW;
15339     }
15340 #ifndef SED_HACKS
15341     if ( bUseExceptions ) {
15342       CPLErr eclass = CPLGetLastErrorType();
15343       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15344         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15345       }
15346     }
15347 #endif
15348   }
15349   resultobj = SWIG_From_double(static_cast< double >(result));
15350   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15351   return resultobj;
15352 fail:
15353   return NULL;
15354 }
15355 
15356 
_wrap_GCP_GCPZ_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15357 SWIGINTERN PyObject *_wrap_GCP_GCPZ_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15358   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15359   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15360   double arg2 ;
15361   void *argp1 = 0 ;
15362   int res1 = 0 ;
15363   double val2 ;
15364   int ecode2 = 0 ;
15365   PyObject * obj0 = 0 ;
15366   PyObject * obj1 = 0 ;
15367 
15368   if (!PyArg_ParseTuple(args,(char *)"OO:GCP_GCPZ_set",&obj0,&obj1)) SWIG_fail;
15369   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15370   if (!SWIG_IsOK(res1)) {
15371     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPZ_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
15372   }
15373   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15374   ecode2 = SWIG_AsVal_double(obj1, &val2);
15375   if (!SWIG_IsOK(ecode2)) {
15376     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_GCPZ_set" "', argument " "2"" of type '" "double""'");
15377   }
15378   arg2 = static_cast< double >(val2);
15379   {
15380     if ( bUseExceptions ) {
15381       ClearErrorState();
15382     }
15383     {
15384       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15385       GDAL_GCP_GCPZ_set(arg1,arg2);
15386       SWIG_PYTHON_THREAD_END_ALLOW;
15387     }
15388 #ifndef SED_HACKS
15389     if ( bUseExceptions ) {
15390       CPLErr eclass = CPLGetLastErrorType();
15391       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15392         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15393       }
15394     }
15395 #endif
15396   }
15397   resultobj = SWIG_Py_Void();
15398   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15399   return resultobj;
15400 fail:
15401   return NULL;
15402 }
15403 
15404 
_wrap_GCP_GCPZ_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15405 SWIGINTERN PyObject *_wrap_GCP_GCPZ_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15406   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15407   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15408   void *argp1 = 0 ;
15409   int res1 = 0 ;
15410   PyObject * obj0 = 0 ;
15411   double result;
15412 
15413   if (!PyArg_ParseTuple(args,(char *)"O:GCP_GCPZ_get",&obj0)) SWIG_fail;
15414   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15415   if (!SWIG_IsOK(res1)) {
15416     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPZ_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15417   }
15418   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15419   {
15420     if ( bUseExceptions ) {
15421       ClearErrorState();
15422     }
15423     {
15424       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15425       result = (double)GDAL_GCP_GCPZ_get(arg1);
15426       SWIG_PYTHON_THREAD_END_ALLOW;
15427     }
15428 #ifndef SED_HACKS
15429     if ( bUseExceptions ) {
15430       CPLErr eclass = CPLGetLastErrorType();
15431       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15432         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15433       }
15434     }
15435 #endif
15436   }
15437   resultobj = SWIG_From_double(static_cast< double >(result));
15438   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15439   return resultobj;
15440 fail:
15441   return NULL;
15442 }
15443 
15444 
_wrap_GCP_GCPPixel_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15445 SWIGINTERN PyObject *_wrap_GCP_GCPPixel_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15446   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15447   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15448   double arg2 ;
15449   void *argp1 = 0 ;
15450   int res1 = 0 ;
15451   double val2 ;
15452   int ecode2 = 0 ;
15453   PyObject * obj0 = 0 ;
15454   PyObject * obj1 = 0 ;
15455 
15456   if (!PyArg_ParseTuple(args,(char *)"OO:GCP_GCPPixel_set",&obj0,&obj1)) SWIG_fail;
15457   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15458   if (!SWIG_IsOK(res1)) {
15459     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPPixel_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
15460   }
15461   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15462   ecode2 = SWIG_AsVal_double(obj1, &val2);
15463   if (!SWIG_IsOK(ecode2)) {
15464     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_GCPPixel_set" "', argument " "2"" of type '" "double""'");
15465   }
15466   arg2 = static_cast< double >(val2);
15467   {
15468     if ( bUseExceptions ) {
15469       ClearErrorState();
15470     }
15471     {
15472       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15473       GDAL_GCP_GCPPixel_set(arg1,arg2);
15474       SWIG_PYTHON_THREAD_END_ALLOW;
15475     }
15476 #ifndef SED_HACKS
15477     if ( bUseExceptions ) {
15478       CPLErr eclass = CPLGetLastErrorType();
15479       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15480         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15481       }
15482     }
15483 #endif
15484   }
15485   resultobj = SWIG_Py_Void();
15486   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15487   return resultobj;
15488 fail:
15489   return NULL;
15490 }
15491 
15492 
_wrap_GCP_GCPPixel_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15493 SWIGINTERN PyObject *_wrap_GCP_GCPPixel_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15494   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15495   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15496   void *argp1 = 0 ;
15497   int res1 = 0 ;
15498   PyObject * obj0 = 0 ;
15499   double result;
15500 
15501   if (!PyArg_ParseTuple(args,(char *)"O:GCP_GCPPixel_get",&obj0)) SWIG_fail;
15502   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15503   if (!SWIG_IsOK(res1)) {
15504     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPPixel_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15505   }
15506   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15507   {
15508     if ( bUseExceptions ) {
15509       ClearErrorState();
15510     }
15511     {
15512       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15513       result = (double)GDAL_GCP_GCPPixel_get(arg1);
15514       SWIG_PYTHON_THREAD_END_ALLOW;
15515     }
15516 #ifndef SED_HACKS
15517     if ( bUseExceptions ) {
15518       CPLErr eclass = CPLGetLastErrorType();
15519       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15520         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15521       }
15522     }
15523 #endif
15524   }
15525   resultobj = SWIG_From_double(static_cast< double >(result));
15526   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15527   return resultobj;
15528 fail:
15529   return NULL;
15530 }
15531 
15532 
_wrap_GCP_GCPLine_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15533 SWIGINTERN PyObject *_wrap_GCP_GCPLine_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15534   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15535   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15536   double arg2 ;
15537   void *argp1 = 0 ;
15538   int res1 = 0 ;
15539   double val2 ;
15540   int ecode2 = 0 ;
15541   PyObject * obj0 = 0 ;
15542   PyObject * obj1 = 0 ;
15543 
15544   if (!PyArg_ParseTuple(args,(char *)"OO:GCP_GCPLine_set",&obj0,&obj1)) SWIG_fail;
15545   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15546   if (!SWIG_IsOK(res1)) {
15547     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPLine_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
15548   }
15549   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15550   ecode2 = SWIG_AsVal_double(obj1, &val2);
15551   if (!SWIG_IsOK(ecode2)) {
15552     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GCP_GCPLine_set" "', argument " "2"" of type '" "double""'");
15553   }
15554   arg2 = static_cast< double >(val2);
15555   {
15556     if ( bUseExceptions ) {
15557       ClearErrorState();
15558     }
15559     {
15560       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15561       GDAL_GCP_GCPLine_set(arg1,arg2);
15562       SWIG_PYTHON_THREAD_END_ALLOW;
15563     }
15564 #ifndef SED_HACKS
15565     if ( bUseExceptions ) {
15566       CPLErr eclass = CPLGetLastErrorType();
15567       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15568         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15569       }
15570     }
15571 #endif
15572   }
15573   resultobj = SWIG_Py_Void();
15574   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15575   return resultobj;
15576 fail:
15577   return NULL;
15578 }
15579 
15580 
_wrap_GCP_GCPLine_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15581 SWIGINTERN PyObject *_wrap_GCP_GCPLine_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15582   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15583   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15584   void *argp1 = 0 ;
15585   int res1 = 0 ;
15586   PyObject * obj0 = 0 ;
15587   double result;
15588 
15589   if (!PyArg_ParseTuple(args,(char *)"O:GCP_GCPLine_get",&obj0)) SWIG_fail;
15590   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15591   if (!SWIG_IsOK(res1)) {
15592     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_GCPLine_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15593   }
15594   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15595   {
15596     if ( bUseExceptions ) {
15597       ClearErrorState();
15598     }
15599     {
15600       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15601       result = (double)GDAL_GCP_GCPLine_get(arg1);
15602       SWIG_PYTHON_THREAD_END_ALLOW;
15603     }
15604 #ifndef SED_HACKS
15605     if ( bUseExceptions ) {
15606       CPLErr eclass = CPLGetLastErrorType();
15607       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15608         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15609       }
15610     }
15611 #endif
15612   }
15613   resultobj = SWIG_From_double(static_cast< double >(result));
15614   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15615   return resultobj;
15616 fail:
15617   return NULL;
15618 }
15619 
15620 
_wrap_GCP_Info_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15621 SWIGINTERN PyObject *_wrap_GCP_Info_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15622   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15623   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15624   char *arg2 = (char *) 0 ;
15625   void *argp1 = 0 ;
15626   int res1 = 0 ;
15627   int res2 ;
15628   char *buf2 = 0 ;
15629   int alloc2 = 0 ;
15630   PyObject * obj0 = 0 ;
15631   PyObject * obj1 = 0 ;
15632 
15633   if (!PyArg_ParseTuple(args,(char *)"OO:GCP_Info_set",&obj0,&obj1)) SWIG_fail;
15634   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15635   if (!SWIG_IsOK(res1)) {
15636     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Info_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
15637   }
15638   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15639   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
15640   if (!SWIG_IsOK(res2)) {
15641     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GCP_Info_set" "', argument " "2"" of type '" "char *""'");
15642   }
15643   arg2 = reinterpret_cast< char * >(buf2);
15644   {
15645     if ( bUseExceptions ) {
15646       ClearErrorState();
15647     }
15648     {
15649       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15650       GDAL_GCP_Info_set(arg1,arg2);
15651       SWIG_PYTHON_THREAD_END_ALLOW;
15652     }
15653 #ifndef SED_HACKS
15654     if ( bUseExceptions ) {
15655       CPLErr eclass = CPLGetLastErrorType();
15656       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15657         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15658       }
15659     }
15660 #endif
15661   }
15662   resultobj = SWIG_Py_Void();
15663   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
15664   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15665   return resultobj;
15666 fail:
15667   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
15668   return NULL;
15669 }
15670 
15671 
_wrap_GCP_Info_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15672 SWIGINTERN PyObject *_wrap_GCP_Info_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15673   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15674   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15675   void *argp1 = 0 ;
15676   int res1 = 0 ;
15677   PyObject * obj0 = 0 ;
15678   char *result = 0 ;
15679 
15680   if (!PyArg_ParseTuple(args,(char *)"O:GCP_Info_get",&obj0)) SWIG_fail;
15681   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15682   if (!SWIG_IsOK(res1)) {
15683     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Info_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15684   }
15685   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15686   {
15687     if ( bUseExceptions ) {
15688       ClearErrorState();
15689     }
15690     {
15691       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15692       result = (char *)GDAL_GCP_Info_get(arg1);
15693       SWIG_PYTHON_THREAD_END_ALLOW;
15694     }
15695 #ifndef SED_HACKS
15696     if ( bUseExceptions ) {
15697       CPLErr eclass = CPLGetLastErrorType();
15698       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15699         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15700       }
15701     }
15702 #endif
15703   }
15704   resultobj = SWIG_FromCharPtr((const char *)result);
15705   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15706   return resultobj;
15707 fail:
15708   return NULL;
15709 }
15710 
15711 
_wrap_GCP_Id_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15712 SWIGINTERN PyObject *_wrap_GCP_Id_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15713   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15714   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15715   char *arg2 = (char *) 0 ;
15716   void *argp1 = 0 ;
15717   int res1 = 0 ;
15718   int res2 ;
15719   char *buf2 = 0 ;
15720   int alloc2 = 0 ;
15721   PyObject * obj0 = 0 ;
15722   PyObject * obj1 = 0 ;
15723 
15724   if (!PyArg_ParseTuple(args,(char *)"OO:GCP_Id_set",&obj0,&obj1)) SWIG_fail;
15725   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15726   if (!SWIG_IsOK(res1)) {
15727     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Id_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
15728   }
15729   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15730   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
15731   if (!SWIG_IsOK(res2)) {
15732     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GCP_Id_set" "', argument " "2"" of type '" "char *""'");
15733   }
15734   arg2 = reinterpret_cast< char * >(buf2);
15735   {
15736     if ( bUseExceptions ) {
15737       ClearErrorState();
15738     }
15739     {
15740       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15741       GDAL_GCP_Id_set(arg1,arg2);
15742       SWIG_PYTHON_THREAD_END_ALLOW;
15743     }
15744 #ifndef SED_HACKS
15745     if ( bUseExceptions ) {
15746       CPLErr eclass = CPLGetLastErrorType();
15747       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15748         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15749       }
15750     }
15751 #endif
15752   }
15753   resultobj = SWIG_Py_Void();
15754   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
15755   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15756   return resultobj;
15757 fail:
15758   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
15759   return NULL;
15760 }
15761 
15762 
_wrap_GCP_Id_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15763 SWIGINTERN PyObject *_wrap_GCP_Id_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15764   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15765   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15766   void *argp1 = 0 ;
15767   int res1 = 0 ;
15768   PyObject * obj0 = 0 ;
15769   char *result = 0 ;
15770 
15771   if (!PyArg_ParseTuple(args,(char *)"O:GCP_Id_get",&obj0)) SWIG_fail;
15772   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15773   if (!SWIG_IsOK(res1)) {
15774     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GCP_Id_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15775   }
15776   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15777   {
15778     if ( bUseExceptions ) {
15779       ClearErrorState();
15780     }
15781     {
15782       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15783       result = (char *)GDAL_GCP_Id_get(arg1);
15784       SWIG_PYTHON_THREAD_END_ALLOW;
15785     }
15786 #ifndef SED_HACKS
15787     if ( bUseExceptions ) {
15788       CPLErr eclass = CPLGetLastErrorType();
15789       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15790         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15791       }
15792     }
15793 #endif
15794   }
15795   resultobj = SWIG_FromCharPtr((const char *)result);
15796   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15797   return resultobj;
15798 fail:
15799   return NULL;
15800 }
15801 
15802 
_wrap_new_GCP(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15803 SWIGINTERN PyObject *_wrap_new_GCP(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15804   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15805   double arg1 = (double) 0.0 ;
15806   double arg2 = (double) 0.0 ;
15807   double arg3 = (double) 0.0 ;
15808   double arg4 = (double) 0.0 ;
15809   double arg5 = (double) 0.0 ;
15810   char *arg6 = (char *) "" ;
15811   char *arg7 = (char *) "" ;
15812   double val1 ;
15813   int ecode1 = 0 ;
15814   double val2 ;
15815   int ecode2 = 0 ;
15816   double val3 ;
15817   int ecode3 = 0 ;
15818   double val4 ;
15819   int ecode4 = 0 ;
15820   double val5 ;
15821   int ecode5 = 0 ;
15822   int res6 ;
15823   char *buf6 = 0 ;
15824   int alloc6 = 0 ;
15825   int res7 ;
15826   char *buf7 = 0 ;
15827   int alloc7 = 0 ;
15828   PyObject * obj0 = 0 ;
15829   PyObject * obj1 = 0 ;
15830   PyObject * obj2 = 0 ;
15831   PyObject * obj3 = 0 ;
15832   PyObject * obj4 = 0 ;
15833   PyObject * obj5 = 0 ;
15834   PyObject * obj6 = 0 ;
15835   GDAL_GCP *result = 0 ;
15836 
15837   if (!PyArg_ParseTuple(args,(char *)"|OOOOOOO:new_GCP",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
15838   if (obj0) {
15839     ecode1 = SWIG_AsVal_double(obj0, &val1);
15840     if (!SWIG_IsOK(ecode1)) {
15841       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_GCP" "', argument " "1"" of type '" "double""'");
15842     }
15843     arg1 = static_cast< double >(val1);
15844   }
15845   if (obj1) {
15846     ecode2 = SWIG_AsVal_double(obj1, &val2);
15847     if (!SWIG_IsOK(ecode2)) {
15848       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_GCP" "', argument " "2"" of type '" "double""'");
15849     }
15850     arg2 = static_cast< double >(val2);
15851   }
15852   if (obj2) {
15853     ecode3 = SWIG_AsVal_double(obj2, &val3);
15854     if (!SWIG_IsOK(ecode3)) {
15855       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_GCP" "', argument " "3"" of type '" "double""'");
15856     }
15857     arg3 = static_cast< double >(val3);
15858   }
15859   if (obj3) {
15860     ecode4 = SWIG_AsVal_double(obj3, &val4);
15861     if (!SWIG_IsOK(ecode4)) {
15862       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_GCP" "', argument " "4"" of type '" "double""'");
15863     }
15864     arg4 = static_cast< double >(val4);
15865   }
15866   if (obj4) {
15867     ecode5 = SWIG_AsVal_double(obj4, &val5);
15868     if (!SWIG_IsOK(ecode5)) {
15869       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_GCP" "', argument " "5"" of type '" "double""'");
15870     }
15871     arg5 = static_cast< double >(val5);
15872   }
15873   if (obj5) {
15874     res6 = SWIG_AsCharPtrAndSize(obj5, &buf6, NULL, &alloc6);
15875     if (!SWIG_IsOK(res6)) {
15876       SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_GCP" "', argument " "6"" of type '" "char const *""'");
15877     }
15878     arg6 = reinterpret_cast< char * >(buf6);
15879   }
15880   if (obj6) {
15881     res7 = SWIG_AsCharPtrAndSize(obj6, &buf7, NULL, &alloc7);
15882     if (!SWIG_IsOK(res7)) {
15883       SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "new_GCP" "', argument " "7"" of type '" "char const *""'");
15884     }
15885     arg7 = reinterpret_cast< char * >(buf7);
15886   }
15887   {
15888     if ( bUseExceptions ) {
15889       ClearErrorState();
15890     }
15891     {
15892       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15893       result = (GDAL_GCP *)new_GDAL_GCP(arg1,arg2,arg3,arg4,arg5,(char const *)arg6,(char const *)arg7);
15894       SWIG_PYTHON_THREAD_END_ALLOW;
15895     }
15896 #ifndef SED_HACKS
15897     if ( bUseExceptions ) {
15898       CPLErr eclass = CPLGetLastErrorType();
15899       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15900         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15901       }
15902     }
15903 #endif
15904   }
15905   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDAL_GCP, SWIG_POINTER_NEW |  0 );
15906   if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
15907   if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
15908   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15909   return resultobj;
15910 fail:
15911   if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
15912   if (alloc7 == SWIG_NEWOBJ) delete[] buf7;
15913   return NULL;
15914 }
15915 
15916 
_wrap_delete_GCP(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15917 SWIGINTERN PyObject *_wrap_delete_GCP(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15918   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15919   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15920   void *argp1 = 0 ;
15921   int res1 = 0 ;
15922   PyObject * obj0 = 0 ;
15923 
15924   if (!PyArg_ParseTuple(args,(char *)"O:delete_GCP",&obj0)) SWIG_fail;
15925   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, SWIG_POINTER_DISOWN |  0 );
15926   if (!SWIG_IsOK(res1)) {
15927     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GCP" "', argument " "1"" of type '" "GDAL_GCP *""'");
15928   }
15929   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15930   {
15931     if ( bUseExceptions ) {
15932       ClearErrorState();
15933     }
15934     {
15935       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15936       delete_GDAL_GCP(arg1);
15937       SWIG_PYTHON_THREAD_END_ALLOW;
15938     }
15939 #ifndef SED_HACKS
15940     if ( bUseExceptions ) {
15941       CPLErr eclass = CPLGetLastErrorType();
15942       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15943         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15944       }
15945     }
15946 #endif
15947   }
15948   resultobj = SWIG_Py_Void();
15949   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
15950   return resultobj;
15951 fail:
15952   return NULL;
15953 }
15954 
15955 
GCP_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15956 SWIGINTERN PyObject *GCP_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15957   PyObject *obj;
15958   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
15959   SWIG_TypeNewClientData(SWIGTYPE_p_GDAL_GCP, SWIG_NewClientData(obj));
15960   return SWIG_Py_Void();
15961 }
15962 
_wrap_GDAL_GCP_GCPX_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)15963 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPX_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
15964   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
15965   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
15966   void *argp1 = 0 ;
15967   int res1 = 0 ;
15968   PyObject * obj0 = 0 ;
15969   double result;
15970 
15971   if (!PyArg_ParseTuple(args,(char *)"O:GDAL_GCP_GCPX_get",&obj0)) SWIG_fail;
15972   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
15973   if (!SWIG_IsOK(res1)) {
15974     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPX_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
15975   }
15976   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
15977   {
15978     if (!arg1) {
15979       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15980     }
15981   }
15982   {
15983     if ( bUseExceptions ) {
15984       ClearErrorState();
15985     }
15986     {
15987       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
15988       result = (double)GDAL_GCP_GCPX_get(arg1);
15989       SWIG_PYTHON_THREAD_END_ALLOW;
15990     }
15991 #ifndef SED_HACKS
15992     if ( bUseExceptions ) {
15993       CPLErr eclass = CPLGetLastErrorType();
15994       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
15995         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
15996       }
15997     }
15998 #endif
15999   }
16000   resultobj = SWIG_From_double(static_cast< double >(result));
16001   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16002   return resultobj;
16003 fail:
16004   return NULL;
16005 }
16006 
16007 
_wrap_GDAL_GCP_GCPX_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16008 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPX_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16009   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16010   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16011   double arg2 ;
16012   void *argp1 = 0 ;
16013   int res1 = 0 ;
16014   double val2 ;
16015   int ecode2 = 0 ;
16016   PyObject * obj0 = 0 ;
16017   PyObject * obj1 = 0 ;
16018 
16019   if (!PyArg_ParseTuple(args,(char *)"OO:GDAL_GCP_GCPX_set",&obj0,&obj1)) SWIG_fail;
16020   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16021   if (!SWIG_IsOK(res1)) {
16022     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPX_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
16023   }
16024   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16025   ecode2 = SWIG_AsVal_double(obj1, &val2);
16026   if (!SWIG_IsOK(ecode2)) {
16027     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPX_set" "', argument " "2"" of type '" "double""'");
16028   }
16029   arg2 = static_cast< double >(val2);
16030   {
16031     if (!arg1) {
16032       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16033     }
16034   }
16035   {
16036     if ( bUseExceptions ) {
16037       ClearErrorState();
16038     }
16039     {
16040       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16041       GDAL_GCP_GCPX_set(arg1,arg2);
16042       SWIG_PYTHON_THREAD_END_ALLOW;
16043     }
16044 #ifndef SED_HACKS
16045     if ( bUseExceptions ) {
16046       CPLErr eclass = CPLGetLastErrorType();
16047       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16048         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16049       }
16050     }
16051 #endif
16052   }
16053   resultobj = SWIG_Py_Void();
16054   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16055   return resultobj;
16056 fail:
16057   return NULL;
16058 }
16059 
16060 
_wrap_GDAL_GCP_GCPY_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16061 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPY_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16062   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16063   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16064   void *argp1 = 0 ;
16065   int res1 = 0 ;
16066   PyObject * obj0 = 0 ;
16067   double result;
16068 
16069   if (!PyArg_ParseTuple(args,(char *)"O:GDAL_GCP_GCPY_get",&obj0)) SWIG_fail;
16070   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16071   if (!SWIG_IsOK(res1)) {
16072     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPY_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
16073   }
16074   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16075   {
16076     if (!arg1) {
16077       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16078     }
16079   }
16080   {
16081     if ( bUseExceptions ) {
16082       ClearErrorState();
16083     }
16084     {
16085       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16086       result = (double)GDAL_GCP_GCPY_get(arg1);
16087       SWIG_PYTHON_THREAD_END_ALLOW;
16088     }
16089 #ifndef SED_HACKS
16090     if ( bUseExceptions ) {
16091       CPLErr eclass = CPLGetLastErrorType();
16092       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16093         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16094       }
16095     }
16096 #endif
16097   }
16098   resultobj = SWIG_From_double(static_cast< double >(result));
16099   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16100   return resultobj;
16101 fail:
16102   return NULL;
16103 }
16104 
16105 
_wrap_GDAL_GCP_GCPY_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16106 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPY_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16107   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16108   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16109   double arg2 ;
16110   void *argp1 = 0 ;
16111   int res1 = 0 ;
16112   double val2 ;
16113   int ecode2 = 0 ;
16114   PyObject * obj0 = 0 ;
16115   PyObject * obj1 = 0 ;
16116 
16117   if (!PyArg_ParseTuple(args,(char *)"OO:GDAL_GCP_GCPY_set",&obj0,&obj1)) SWIG_fail;
16118   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16119   if (!SWIG_IsOK(res1)) {
16120     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPY_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
16121   }
16122   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16123   ecode2 = SWIG_AsVal_double(obj1, &val2);
16124   if (!SWIG_IsOK(ecode2)) {
16125     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPY_set" "', argument " "2"" of type '" "double""'");
16126   }
16127   arg2 = static_cast< double >(val2);
16128   {
16129     if (!arg1) {
16130       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16131     }
16132   }
16133   {
16134     if ( bUseExceptions ) {
16135       ClearErrorState();
16136     }
16137     {
16138       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16139       GDAL_GCP_GCPY_set(arg1,arg2);
16140       SWIG_PYTHON_THREAD_END_ALLOW;
16141     }
16142 #ifndef SED_HACKS
16143     if ( bUseExceptions ) {
16144       CPLErr eclass = CPLGetLastErrorType();
16145       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16146         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16147       }
16148     }
16149 #endif
16150   }
16151   resultobj = SWIG_Py_Void();
16152   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16153   return resultobj;
16154 fail:
16155   return NULL;
16156 }
16157 
16158 
_wrap_GDAL_GCP_GCPZ_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16159 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPZ_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16160   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16161   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16162   void *argp1 = 0 ;
16163   int res1 = 0 ;
16164   PyObject * obj0 = 0 ;
16165   double result;
16166 
16167   if (!PyArg_ParseTuple(args,(char *)"O:GDAL_GCP_GCPZ_get",&obj0)) SWIG_fail;
16168   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16169   if (!SWIG_IsOK(res1)) {
16170     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPZ_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
16171   }
16172   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16173   {
16174     if (!arg1) {
16175       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16176     }
16177   }
16178   {
16179     if ( bUseExceptions ) {
16180       ClearErrorState();
16181     }
16182     {
16183       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16184       result = (double)GDAL_GCP_GCPZ_get(arg1);
16185       SWIG_PYTHON_THREAD_END_ALLOW;
16186     }
16187 #ifndef SED_HACKS
16188     if ( bUseExceptions ) {
16189       CPLErr eclass = CPLGetLastErrorType();
16190       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16191         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16192       }
16193     }
16194 #endif
16195   }
16196   resultobj = SWIG_From_double(static_cast< double >(result));
16197   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16198   return resultobj;
16199 fail:
16200   return NULL;
16201 }
16202 
16203 
_wrap_GDAL_GCP_GCPZ_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16204 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPZ_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16205   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16206   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16207   double arg2 ;
16208   void *argp1 = 0 ;
16209   int res1 = 0 ;
16210   double val2 ;
16211   int ecode2 = 0 ;
16212   PyObject * obj0 = 0 ;
16213   PyObject * obj1 = 0 ;
16214 
16215   if (!PyArg_ParseTuple(args,(char *)"OO:GDAL_GCP_GCPZ_set",&obj0,&obj1)) SWIG_fail;
16216   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16217   if (!SWIG_IsOK(res1)) {
16218     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPZ_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
16219   }
16220   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16221   ecode2 = SWIG_AsVal_double(obj1, &val2);
16222   if (!SWIG_IsOK(ecode2)) {
16223     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPZ_set" "', argument " "2"" of type '" "double""'");
16224   }
16225   arg2 = static_cast< double >(val2);
16226   {
16227     if (!arg1) {
16228       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16229     }
16230   }
16231   {
16232     if ( bUseExceptions ) {
16233       ClearErrorState();
16234     }
16235     {
16236       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16237       GDAL_GCP_GCPZ_set(arg1,arg2);
16238       SWIG_PYTHON_THREAD_END_ALLOW;
16239     }
16240 #ifndef SED_HACKS
16241     if ( bUseExceptions ) {
16242       CPLErr eclass = CPLGetLastErrorType();
16243       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16244         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16245       }
16246     }
16247 #endif
16248   }
16249   resultobj = SWIG_Py_Void();
16250   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16251   return resultobj;
16252 fail:
16253   return NULL;
16254 }
16255 
16256 
_wrap_GDAL_GCP_GCPPixel_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16257 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPPixel_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16258   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16259   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16260   void *argp1 = 0 ;
16261   int res1 = 0 ;
16262   PyObject * obj0 = 0 ;
16263   double result;
16264 
16265   if (!PyArg_ParseTuple(args,(char *)"O:GDAL_GCP_GCPPixel_get",&obj0)) SWIG_fail;
16266   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16267   if (!SWIG_IsOK(res1)) {
16268     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPPixel_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
16269   }
16270   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16271   {
16272     if (!arg1) {
16273       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16274     }
16275   }
16276   {
16277     if ( bUseExceptions ) {
16278       ClearErrorState();
16279     }
16280     {
16281       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16282       result = (double)GDAL_GCP_GCPPixel_get(arg1);
16283       SWIG_PYTHON_THREAD_END_ALLOW;
16284     }
16285 #ifndef SED_HACKS
16286     if ( bUseExceptions ) {
16287       CPLErr eclass = CPLGetLastErrorType();
16288       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16289         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16290       }
16291     }
16292 #endif
16293   }
16294   resultobj = SWIG_From_double(static_cast< double >(result));
16295   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16296   return resultobj;
16297 fail:
16298   return NULL;
16299 }
16300 
16301 
_wrap_GDAL_GCP_GCPPixel_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16302 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPPixel_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16303   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16304   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16305   double arg2 ;
16306   void *argp1 = 0 ;
16307   int res1 = 0 ;
16308   double val2 ;
16309   int ecode2 = 0 ;
16310   PyObject * obj0 = 0 ;
16311   PyObject * obj1 = 0 ;
16312 
16313   if (!PyArg_ParseTuple(args,(char *)"OO:GDAL_GCP_GCPPixel_set",&obj0,&obj1)) SWIG_fail;
16314   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16315   if (!SWIG_IsOK(res1)) {
16316     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPPixel_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
16317   }
16318   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16319   ecode2 = SWIG_AsVal_double(obj1, &val2);
16320   if (!SWIG_IsOK(ecode2)) {
16321     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPPixel_set" "', argument " "2"" of type '" "double""'");
16322   }
16323   arg2 = static_cast< double >(val2);
16324   {
16325     if (!arg1) {
16326       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16327     }
16328   }
16329   {
16330     if ( bUseExceptions ) {
16331       ClearErrorState();
16332     }
16333     {
16334       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16335       GDAL_GCP_GCPPixel_set(arg1,arg2);
16336       SWIG_PYTHON_THREAD_END_ALLOW;
16337     }
16338 #ifndef SED_HACKS
16339     if ( bUseExceptions ) {
16340       CPLErr eclass = CPLGetLastErrorType();
16341       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16342         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16343       }
16344     }
16345 #endif
16346   }
16347   resultobj = SWIG_Py_Void();
16348   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16349   return resultobj;
16350 fail:
16351   return NULL;
16352 }
16353 
16354 
_wrap_GDAL_GCP_GCPLine_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16355 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPLine_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16356   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16357   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16358   void *argp1 = 0 ;
16359   int res1 = 0 ;
16360   PyObject * obj0 = 0 ;
16361   double result;
16362 
16363   if (!PyArg_ParseTuple(args,(char *)"O:GDAL_GCP_GCPLine_get",&obj0)) SWIG_fail;
16364   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16365   if (!SWIG_IsOK(res1)) {
16366     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPLine_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
16367   }
16368   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16369   {
16370     if (!arg1) {
16371       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16372     }
16373   }
16374   {
16375     if ( bUseExceptions ) {
16376       ClearErrorState();
16377     }
16378     {
16379       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16380       result = (double)GDAL_GCP_GCPLine_get(arg1);
16381       SWIG_PYTHON_THREAD_END_ALLOW;
16382     }
16383 #ifndef SED_HACKS
16384     if ( bUseExceptions ) {
16385       CPLErr eclass = CPLGetLastErrorType();
16386       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16387         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16388       }
16389     }
16390 #endif
16391   }
16392   resultobj = SWIG_From_double(static_cast< double >(result));
16393   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16394   return resultobj;
16395 fail:
16396   return NULL;
16397 }
16398 
16399 
_wrap_GDAL_GCP_GCPLine_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16400 SWIGINTERN PyObject *_wrap_GDAL_GCP_GCPLine_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16401   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16402   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16403   double arg2 ;
16404   void *argp1 = 0 ;
16405   int res1 = 0 ;
16406   double val2 ;
16407   int ecode2 = 0 ;
16408   PyObject * obj0 = 0 ;
16409   PyObject * obj1 = 0 ;
16410 
16411   if (!PyArg_ParseTuple(args,(char *)"OO:GDAL_GCP_GCPLine_set",&obj0,&obj1)) SWIG_fail;
16412   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16413   if (!SWIG_IsOK(res1)) {
16414     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_GCPLine_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
16415   }
16416   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16417   ecode2 = SWIG_AsVal_double(obj1, &val2);
16418   if (!SWIG_IsOK(ecode2)) {
16419     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDAL_GCP_GCPLine_set" "', argument " "2"" of type '" "double""'");
16420   }
16421   arg2 = static_cast< double >(val2);
16422   {
16423     if (!arg1) {
16424       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16425     }
16426   }
16427   {
16428     if ( bUseExceptions ) {
16429       ClearErrorState();
16430     }
16431     {
16432       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16433       GDAL_GCP_GCPLine_set(arg1,arg2);
16434       SWIG_PYTHON_THREAD_END_ALLOW;
16435     }
16436 #ifndef SED_HACKS
16437     if ( bUseExceptions ) {
16438       CPLErr eclass = CPLGetLastErrorType();
16439       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16440         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16441       }
16442     }
16443 #endif
16444   }
16445   resultobj = SWIG_Py_Void();
16446   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16447   return resultobj;
16448 fail:
16449   return NULL;
16450 }
16451 
16452 
_wrap_GDAL_GCP_Info_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16453 SWIGINTERN PyObject *_wrap_GDAL_GCP_Info_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16454   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16455   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16456   void *argp1 = 0 ;
16457   int res1 = 0 ;
16458   PyObject * obj0 = 0 ;
16459   char *result = 0 ;
16460 
16461   if (!PyArg_ParseTuple(args,(char *)"O:GDAL_GCP_Info_get",&obj0)) SWIG_fail;
16462   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16463   if (!SWIG_IsOK(res1)) {
16464     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Info_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
16465   }
16466   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16467   {
16468     if (!arg1) {
16469       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16470     }
16471   }
16472   {
16473     if ( bUseExceptions ) {
16474       ClearErrorState();
16475     }
16476     {
16477       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16478       result = (char *)GDAL_GCP_Info_get(arg1);
16479       SWIG_PYTHON_THREAD_END_ALLOW;
16480     }
16481 #ifndef SED_HACKS
16482     if ( bUseExceptions ) {
16483       CPLErr eclass = CPLGetLastErrorType();
16484       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16485         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16486       }
16487     }
16488 #endif
16489   }
16490   resultobj = SWIG_FromCharPtr((const char *)result);
16491   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16492   return resultobj;
16493 fail:
16494   return NULL;
16495 }
16496 
16497 
_wrap_GDAL_GCP_Info_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16498 SWIGINTERN PyObject *_wrap_GDAL_GCP_Info_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16499   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16500   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16501   char *arg2 = (char *) 0 ;
16502   void *argp1 = 0 ;
16503   int res1 = 0 ;
16504   int res2 ;
16505   char *buf2 = 0 ;
16506   int alloc2 = 0 ;
16507   PyObject * obj0 = 0 ;
16508   PyObject * obj1 = 0 ;
16509 
16510   if (!PyArg_ParseTuple(args,(char *)"OO:GDAL_GCP_Info_set",&obj0,&obj1)) SWIG_fail;
16511   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16512   if (!SWIG_IsOK(res1)) {
16513     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Info_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
16514   }
16515   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16516   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
16517   if (!SWIG_IsOK(res2)) {
16518     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GDAL_GCP_Info_set" "', argument " "2"" of type '" "char const *""'");
16519   }
16520   arg2 = reinterpret_cast< char * >(buf2);
16521   {
16522     if (!arg1) {
16523       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16524     }
16525   }
16526   {
16527     if ( bUseExceptions ) {
16528       ClearErrorState();
16529     }
16530     {
16531       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16532       GDAL_GCP_Info_set(arg1,(char const *)arg2);
16533       SWIG_PYTHON_THREAD_END_ALLOW;
16534     }
16535 #ifndef SED_HACKS
16536     if ( bUseExceptions ) {
16537       CPLErr eclass = CPLGetLastErrorType();
16538       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16539         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16540       }
16541     }
16542 #endif
16543   }
16544   resultobj = SWIG_Py_Void();
16545   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16546   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16547   return resultobj;
16548 fail:
16549   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16550   return NULL;
16551 }
16552 
16553 
_wrap_GDAL_GCP_Id_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16554 SWIGINTERN PyObject *_wrap_GDAL_GCP_Id_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16555   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16556   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16557   void *argp1 = 0 ;
16558   int res1 = 0 ;
16559   PyObject * obj0 = 0 ;
16560   char *result = 0 ;
16561 
16562   if (!PyArg_ParseTuple(args,(char *)"O:GDAL_GCP_Id_get",&obj0)) SWIG_fail;
16563   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16564   if (!SWIG_IsOK(res1)) {
16565     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Id_get" "', argument " "1"" of type '" "GDAL_GCP *""'");
16566   }
16567   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16568   {
16569     if (!arg1) {
16570       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16571     }
16572   }
16573   {
16574     if ( bUseExceptions ) {
16575       ClearErrorState();
16576     }
16577     {
16578       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16579       result = (char *)GDAL_GCP_Id_get(arg1);
16580       SWIG_PYTHON_THREAD_END_ALLOW;
16581     }
16582 #ifndef SED_HACKS
16583     if ( bUseExceptions ) {
16584       CPLErr eclass = CPLGetLastErrorType();
16585       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16586         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16587       }
16588     }
16589 #endif
16590   }
16591   resultobj = SWIG_FromCharPtr((const char *)result);
16592   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16593   return resultobj;
16594 fail:
16595   return NULL;
16596 }
16597 
16598 
_wrap_GDAL_GCP_Id_set(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16599 SWIGINTERN PyObject *_wrap_GDAL_GCP_Id_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16600   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16601   GDAL_GCP *arg1 = (GDAL_GCP *) 0 ;
16602   char *arg2 = (char *) 0 ;
16603   void *argp1 = 0 ;
16604   int res1 = 0 ;
16605   int res2 ;
16606   char *buf2 = 0 ;
16607   int alloc2 = 0 ;
16608   PyObject * obj0 = 0 ;
16609   PyObject * obj1 = 0 ;
16610 
16611   if (!PyArg_ParseTuple(args,(char *)"OO:GDAL_GCP_Id_set",&obj0,&obj1)) SWIG_fail;
16612   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDAL_GCP, 0 |  0 );
16613   if (!SWIG_IsOK(res1)) {
16614     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDAL_GCP_Id_set" "', argument " "1"" of type '" "GDAL_GCP *""'");
16615   }
16616   arg1 = reinterpret_cast< GDAL_GCP * >(argp1);
16617   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
16618   if (!SWIG_IsOK(res2)) {
16619     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GDAL_GCP_Id_set" "', argument " "2"" of type '" "char const *""'");
16620   }
16621   arg2 = reinterpret_cast< char * >(buf2);
16622   {
16623     if (!arg1) {
16624       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16625     }
16626   }
16627   {
16628     if ( bUseExceptions ) {
16629       ClearErrorState();
16630     }
16631     {
16632       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16633       GDAL_GCP_Id_set(arg1,(char const *)arg2);
16634       SWIG_PYTHON_THREAD_END_ALLOW;
16635     }
16636 #ifndef SED_HACKS
16637     if ( bUseExceptions ) {
16638       CPLErr eclass = CPLGetLastErrorType();
16639       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16640         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16641       }
16642     }
16643 #endif
16644   }
16645   resultobj = SWIG_Py_Void();
16646   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16647   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16648   return resultobj;
16649 fail:
16650   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
16651   return NULL;
16652 }
16653 
16654 
_wrap_GCPsToGeoTransform(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16655 SWIGINTERN PyObject *_wrap_GCPsToGeoTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16656   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16657   int arg1 ;
16658   GDAL_GCP *arg2 = (GDAL_GCP *) 0 ;
16659   double *arg3 ;
16660   int arg4 = (int) 1 ;
16661   GDAL_GCP *tmpGCPList1 ;
16662   double argout3[6] ;
16663   int val4 ;
16664   int ecode4 = 0 ;
16665   PyObject * obj0 = 0 ;
16666   PyObject * obj1 = 0 ;
16667   RETURN_NONE result;
16668 
16669   {
16670     /* %typemap(in,numinputs=0) (double argout3[ANY]) */
16671     memset(argout3, 0, sizeof(argout3));
16672     arg3 = argout3;
16673   }
16674   if (!PyArg_ParseTuple(args,(char *)"O|O:GCPsToGeoTransform",&obj0,&obj1)) SWIG_fail;
16675   {
16676     /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
16677     /* check if is List */
16678     if ( !PySequence_Check(obj0) ) {
16679       PyErr_SetString(PyExc_TypeError, "not a sequence");
16680       SWIG_fail;
16681     }
16682     Py_ssize_t size = PySequence_Size(obj0);
16683     if( size != (int)size ) {
16684       PyErr_SetString(PyExc_TypeError, "too big sequence");
16685       SWIG_fail;
16686     }
16687     arg1 = (int)size;
16688     tmpGCPList1 = (GDAL_GCP*) malloc(arg1*sizeof(GDAL_GCP));
16689     arg2 = tmpGCPList1;
16690     for( int i = 0; i<arg1; i++ ) {
16691       PyObject *o = PySequence_GetItem(obj0,i);
16692       GDAL_GCP *item = 0;
16693       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&item, SWIGTYPE_p_GDAL_GCP, SWIG_POINTER_EXCEPTION | 0 ));
16694       if ( ! item ) {
16695         Py_DECREF(o);
16696         SWIG_fail;
16697       }
16698       memcpy( (void*) tmpGCPList1, (void*) item, sizeof( GDAL_GCP ) );
16699       ++tmpGCPList1;
16700       Py_DECREF(o);
16701     }
16702   }
16703   if (obj1) {
16704     ecode4 = SWIG_AsVal_int(obj1, &val4);
16705     if (!SWIG_IsOK(ecode4)) {
16706       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GCPsToGeoTransform" "', argument " "4"" of type '" "int""'");
16707     }
16708     arg4 = static_cast< int >(val4);
16709   }
16710   {
16711     if ( bUseExceptions ) {
16712       ClearErrorState();
16713     }
16714     {
16715       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16716       result = (RETURN_NONE)GDALGCPsToGeoTransform(arg1,(GDAL_GCP const *)arg2,arg3,arg4);
16717       SWIG_PYTHON_THREAD_END_ALLOW;
16718     }
16719 #ifndef SED_HACKS
16720     if ( bUseExceptions ) {
16721       CPLErr eclass = CPLGetLastErrorType();
16722       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16723         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16724       }
16725     }
16726 #endif
16727   }
16728   /*%typemap(out) IF_FALSE_RETURN_NONE */
16729   {
16730     /* %typemap(argout) (double argout[ANY]) */
16731     PyObject *out = CreateTupleFromDoubleArray( arg3, 6 );
16732     resultobj = t_output_helper(resultobj,out);
16733   }
16734   {
16735     /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
16736     if (arg2) {
16737       free( (void*) arg2 );
16738     }
16739   }
16740   {
16741     /* %typemap(ret) IF_FALSE_RETURN_NONE */
16742     if (result == 0 ) {
16743       Py_XDECREF( resultobj );
16744       resultobj = Py_None;
16745       Py_INCREF(resultobj);
16746     }
16747     if (resultobj == 0) {
16748       resultobj = Py_None;
16749       Py_INCREF(resultobj);
16750     }
16751   }
16752   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16753   return resultobj;
16754 fail:
16755   {
16756     /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
16757     if (arg2) {
16758       free( (void*) arg2 );
16759     }
16760   }
16761   return NULL;
16762 }
16763 
16764 
_wrap_delete_VirtualMem(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16765 SWIGINTERN PyObject *_wrap_delete_VirtualMem(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16766   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16767   CPLVirtualMemShadow *arg1 = (CPLVirtualMemShadow *) 0 ;
16768   void *argp1 = 0 ;
16769   int res1 = 0 ;
16770   PyObject * obj0 = 0 ;
16771 
16772   if (!PyArg_ParseTuple(args,(char *)"O:delete_VirtualMem",&obj0)) SWIG_fail;
16773   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CPLVirtualMemShadow, SWIG_POINTER_DISOWN |  0 );
16774   if (!SWIG_IsOK(res1)) {
16775     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VirtualMem" "', argument " "1"" of type '" "CPLVirtualMemShadow *""'");
16776   }
16777   arg1 = reinterpret_cast< CPLVirtualMemShadow * >(argp1);
16778   {
16779     if ( bUseExceptions ) {
16780       ClearErrorState();
16781     }
16782     {
16783       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16784       delete_CPLVirtualMemShadow(arg1);
16785       SWIG_PYTHON_THREAD_END_ALLOW;
16786     }
16787 #ifndef SED_HACKS
16788     if ( bUseExceptions ) {
16789       CPLErr eclass = CPLGetLastErrorType();
16790       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16791         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16792       }
16793     }
16794 #endif
16795   }
16796   resultobj = SWIG_Py_Void();
16797   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16798   return resultobj;
16799 fail:
16800   return NULL;
16801 }
16802 
16803 
_wrap_VirtualMem_GetAddr(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16804 SWIGINTERN PyObject *_wrap_VirtualMem_GetAddr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16805   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16806   CPLVirtualMemShadow *arg1 = (CPLVirtualMemShadow *) 0 ;
16807   void **arg2 = (void **) 0 ;
16808   size_t *arg3 = (size_t *) 0 ;
16809   GDALDataType *arg4 = (GDALDataType *) 0 ;
16810   int *arg5 = (int *) 0 ;
16811   void *argp1 = 0 ;
16812   int res1 = 0 ;
16813   void *ptr2 ;
16814   size_t nsize2 ;
16815   GDALDataType datatype2 ;
16816   int readonly2 ;
16817   PyObject * obj0 = 0 ;
16818 
16819   {
16820     /* %typemap(in,numinputs=0) (void** pptr, size_t* pnsize, GDALDataType* pdatatype, int* preadonly) */
16821     arg2 = &ptr2;
16822     arg3 = &nsize2;
16823     arg4 = &datatype2;
16824     arg5 = &readonly2;
16825   }
16826   if (!PyArg_ParseTuple(args,(char *)"O:VirtualMem_GetAddr",&obj0)) SWIG_fail;
16827   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CPLVirtualMemShadow, 0 |  0 );
16828   if (!SWIG_IsOK(res1)) {
16829     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VirtualMem_GetAddr" "', argument " "1"" of type '" "CPLVirtualMemShadow *""'");
16830   }
16831   arg1 = reinterpret_cast< CPLVirtualMemShadow * >(argp1);
16832   {
16833     if ( bUseExceptions ) {
16834       ClearErrorState();
16835     }
16836     {
16837       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16838       CPLVirtualMemShadow_GetAddr(arg1,arg2,arg3,arg4,arg5);
16839       SWIG_PYTHON_THREAD_END_ALLOW;
16840     }
16841 #ifndef SED_HACKS
16842     if ( bUseExceptions ) {
16843       CPLErr eclass = CPLGetLastErrorType();
16844       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16845         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16846       }
16847     }
16848 #endif
16849   }
16850   resultobj = SWIG_Py_Void();
16851   {
16852     /* %typemap(argout) (void** pptr, size_t* pnsize, GDALDataType* pdatatype, int* preadonly)*/
16853     Py_buffer *buf=(Py_buffer*)malloc(sizeof(Py_buffer));
16854 
16855     if (PyBuffer_FillInfo(buf, obj0, *(arg2), *(arg3), *(arg5), PyBUF_ND)) {
16856       // error, handle
16857     }
16858     if( *(arg4) == GDT_Byte )
16859     {
16860       buf->format = (char*) "B";
16861       buf->itemsize = 1;
16862     }
16863     else if( *(arg4) == GDT_Int16 )
16864     {
16865       buf->format = (char*) "h";
16866       buf->itemsize = 2;
16867     }
16868     else if( *(arg4) == GDT_UInt16 )
16869     {
16870       buf->format = (char*) "H";
16871       buf->itemsize = 2;
16872     }
16873     else if( *(arg4) == GDT_Int32 )
16874     {
16875       buf->format = (char*) "i";
16876       buf->itemsize = 4;
16877     }
16878     else if( *(arg4) == GDT_UInt32 )
16879     {
16880       buf->format = (char*) "I";
16881       buf->itemsize = 4;
16882     }
16883     else if( *(arg4) == GDT_Float32 )
16884     {
16885       buf->format = (char*) "f";
16886       buf->itemsize = 4;
16887     }
16888     else if( *(arg4) == GDT_Float64 )
16889     {
16890       buf->format = (char*) "F";
16891       buf->itemsize = 8;
16892     }
16893     else
16894     {
16895       buf->format = (char*) "B";
16896       buf->itemsize = 1;
16897     }
16898     Py_DECREF(resultobj);
16899     resultobj = PyMemoryView_FromBuffer(buf);
16900   }
16901   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16902   return resultobj;
16903 fail:
16904   return NULL;
16905 }
16906 
16907 
_wrap_VirtualMem_Pin(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16908 SWIGINTERN PyObject *_wrap_VirtualMem_Pin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16909   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16910   CPLVirtualMemShadow *arg1 = (CPLVirtualMemShadow *) 0 ;
16911   size_t arg2 = (size_t) 0 ;
16912   size_t arg3 = (size_t) 0 ;
16913   int arg4 = (int) 0 ;
16914   void *argp1 = 0 ;
16915   int res1 = 0 ;
16916   size_t val2 ;
16917   int ecode2 = 0 ;
16918   size_t val3 ;
16919   int ecode3 = 0 ;
16920   int val4 ;
16921   int ecode4 = 0 ;
16922   PyObject * obj0 = 0 ;
16923   PyObject * obj1 = 0 ;
16924   PyObject * obj2 = 0 ;
16925   PyObject * obj3 = 0 ;
16926 
16927   if (!PyArg_ParseTuple(args,(char *)"O|OOO:VirtualMem_Pin",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
16928   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CPLVirtualMemShadow, 0 |  0 );
16929   if (!SWIG_IsOK(res1)) {
16930     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VirtualMem_Pin" "', argument " "1"" of type '" "CPLVirtualMemShadow *""'");
16931   }
16932   arg1 = reinterpret_cast< CPLVirtualMemShadow * >(argp1);
16933   if (obj1) {
16934     ecode2 = SWIG_AsVal_size_t(obj1, &val2);
16935     if (!SWIG_IsOK(ecode2)) {
16936       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VirtualMem_Pin" "', argument " "2"" of type '" "size_t""'");
16937     }
16938     arg2 = static_cast< size_t >(val2);
16939   }
16940   if (obj2) {
16941     ecode3 = SWIG_AsVal_size_t(obj2, &val3);
16942     if (!SWIG_IsOK(ecode3)) {
16943       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VirtualMem_Pin" "', argument " "3"" of type '" "size_t""'");
16944     }
16945     arg3 = static_cast< size_t >(val3);
16946   }
16947   if (obj3) {
16948     ecode4 = SWIG_AsVal_int(obj3, &val4);
16949     if (!SWIG_IsOK(ecode4)) {
16950       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VirtualMem_Pin" "', argument " "4"" of type '" "int""'");
16951     }
16952     arg4 = static_cast< int >(val4);
16953   }
16954   {
16955     if ( bUseExceptions ) {
16956       ClearErrorState();
16957     }
16958     {
16959       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
16960       CPLVirtualMemShadow_Pin(arg1,arg2,arg3,arg4);
16961       SWIG_PYTHON_THREAD_END_ALLOW;
16962     }
16963 #ifndef SED_HACKS
16964     if ( bUseExceptions ) {
16965       CPLErr eclass = CPLGetLastErrorType();
16966       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
16967         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
16968       }
16969     }
16970 #endif
16971   }
16972   resultobj = SWIG_Py_Void();
16973   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
16974   return resultobj;
16975 fail:
16976   return NULL;
16977 }
16978 
16979 
VirtualMem_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16980 SWIGINTERN PyObject *VirtualMem_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16981   PyObject *obj;
16982   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
16983   SWIG_TypeNewClientData(SWIGTYPE_p_CPLVirtualMemShadow, SWIG_NewClientData(obj));
16984   return SWIG_Py_Void();
16985 }
16986 
_wrap_delete_AsyncReader(PyObject * SWIGUNUSEDPARM (self),PyObject * args)16987 SWIGINTERN PyObject *_wrap_delete_AsyncReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16988   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
16989   GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
16990   void *argp1 = 0 ;
16991   int res1 = 0 ;
16992   PyObject * obj0 = 0 ;
16993 
16994   if (!PyArg_ParseTuple(args,(char *)"O:delete_AsyncReader",&obj0)) SWIG_fail;
16995   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, SWIG_POINTER_DISOWN |  0 );
16996   if (!SWIG_IsOK(res1)) {
16997     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_AsyncReader" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
16998   }
16999   arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
17000   {
17001     if ( bUseExceptions ) {
17002       ClearErrorState();
17003     }
17004     {
17005       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17006       delete_GDALAsyncReaderShadow(arg1);
17007       SWIG_PYTHON_THREAD_END_ALLOW;
17008     }
17009 #ifndef SED_HACKS
17010     if ( bUseExceptions ) {
17011       CPLErr eclass = CPLGetLastErrorType();
17012       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17013         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17014       }
17015     }
17016 #endif
17017   }
17018   resultobj = SWIG_Py_Void();
17019   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17020   return resultobj;
17021 fail:
17022   return NULL;
17023 }
17024 
17025 
_wrap_AsyncReader_GetNextUpdatedRegion(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17026 SWIGINTERN PyObject *_wrap_AsyncReader_GetNextUpdatedRegion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17027   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17028   GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
17029   double arg2 ;
17030   int *arg3 = (int *) 0 ;
17031   int *arg4 = (int *) 0 ;
17032   int *arg5 = (int *) 0 ;
17033   int *arg6 = (int *) 0 ;
17034   void *argp1 = 0 ;
17035   int res1 = 0 ;
17036   double val2 ;
17037   int ecode2 = 0 ;
17038   int temp3 ;
17039   int res3 = SWIG_TMPOBJ ;
17040   int temp4 ;
17041   int res4 = SWIG_TMPOBJ ;
17042   int temp5 ;
17043   int res5 = SWIG_TMPOBJ ;
17044   int temp6 ;
17045   int res6 = SWIG_TMPOBJ ;
17046   PyObject * obj0 = 0 ;
17047   PyObject * obj1 = 0 ;
17048   GDALAsyncStatusType result;
17049 
17050   arg3 = &temp3;
17051   arg4 = &temp4;
17052   arg5 = &temp5;
17053   arg6 = &temp6;
17054   if (!PyArg_ParseTuple(args,(char *)"OO:AsyncReader_GetNextUpdatedRegion",&obj0,&obj1)) SWIG_fail;
17055   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
17056   if (!SWIG_IsOK(res1)) {
17057     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AsyncReader_GetNextUpdatedRegion" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
17058   }
17059   arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
17060   ecode2 = SWIG_AsVal_double(obj1, &val2);
17061   if (!SWIG_IsOK(ecode2)) {
17062     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AsyncReader_GetNextUpdatedRegion" "', argument " "2"" of type '" "double""'");
17063   }
17064   arg2 = static_cast< double >(val2);
17065   {
17066     if ( bUseExceptions ) {
17067       ClearErrorState();
17068     }
17069     {
17070       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17071       result = (GDALAsyncStatusType)GDALAsyncReaderShadow_GetNextUpdatedRegion(arg1,arg2,arg3,arg4,arg5,arg6);
17072       SWIG_PYTHON_THREAD_END_ALLOW;
17073     }
17074 #ifndef SED_HACKS
17075     if ( bUseExceptions ) {
17076       CPLErr eclass = CPLGetLastErrorType();
17077       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17078         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17079       }
17080     }
17081 #endif
17082   }
17083   resultobj = SWIG_From_int(static_cast< int >(result));
17084   if (ReturnSame(SWIG_IsTmpObj(res3))) {
17085     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3)));
17086   } else {
17087     int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
17088     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags));
17089   }
17090   if (ReturnSame(SWIG_IsTmpObj(res4))) {
17091     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg4)));
17092   } else {
17093     int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
17094     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_int, new_flags));
17095   }
17096   if (ReturnSame(SWIG_IsTmpObj(res5))) {
17097     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg5)));
17098   } else {
17099     int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
17100     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_int, new_flags));
17101   }
17102   if (ReturnSame(SWIG_IsTmpObj(res6))) {
17103     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg6)));
17104   } else {
17105     int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
17106     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_int, new_flags));
17107   }
17108   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17109   return resultobj;
17110 fail:
17111   return NULL;
17112 }
17113 
17114 
_wrap_AsyncReader_GetBuffer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17115 SWIGINTERN PyObject *_wrap_AsyncReader_GetBuffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17116   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17117   GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
17118   void **arg2 = (void **) 0 ;
17119   void *argp1 = 0 ;
17120   int res1 = 0 ;
17121   void *pyObject2 = NULL ;
17122   PyObject * obj0 = 0 ;
17123 
17124   {
17125     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject2 = NULL ) */
17126     arg2 = &pyObject2;
17127   }
17128   if (!PyArg_ParseTuple(args,(char *)"O:AsyncReader_GetBuffer",&obj0)) SWIG_fail;
17129   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
17130   if (!SWIG_IsOK(res1)) {
17131     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AsyncReader_GetBuffer" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
17132   }
17133   arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
17134   {
17135     if ( bUseExceptions ) {
17136       ClearErrorState();
17137     }
17138     {
17139       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17140       GDALAsyncReaderShadow_GetBuffer(arg1,arg2);
17141       SWIG_PYTHON_THREAD_END_ALLOW;
17142     }
17143 #ifndef SED_HACKS
17144     if ( bUseExceptions ) {
17145       CPLErr eclass = CPLGetLastErrorType();
17146       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17147         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17148       }
17149     }
17150 #endif
17151   }
17152   resultobj = SWIG_Py_Void();
17153   {
17154     /* %typemap(argout) ( void **outPythonObject ) */
17155     Py_XDECREF(resultobj);
17156     if (*arg2)
17157     {
17158       resultobj = (PyObject*)*arg2;
17159     }
17160     else
17161     {
17162       resultobj = Py_None;
17163       Py_INCREF(resultobj);
17164     }
17165   }
17166   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17167   return resultobj;
17168 fail:
17169   return NULL;
17170 }
17171 
17172 
_wrap_AsyncReader_LockBuffer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17173 SWIGINTERN PyObject *_wrap_AsyncReader_LockBuffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17174   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17175   GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
17176   double arg2 ;
17177   void *argp1 = 0 ;
17178   int res1 = 0 ;
17179   double val2 ;
17180   int ecode2 = 0 ;
17181   PyObject * obj0 = 0 ;
17182   PyObject * obj1 = 0 ;
17183   int result;
17184 
17185   if (!PyArg_ParseTuple(args,(char *)"OO:AsyncReader_LockBuffer",&obj0,&obj1)) SWIG_fail;
17186   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
17187   if (!SWIG_IsOK(res1)) {
17188     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AsyncReader_LockBuffer" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
17189   }
17190   arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
17191   ecode2 = SWIG_AsVal_double(obj1, &val2);
17192   if (!SWIG_IsOK(ecode2)) {
17193     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AsyncReader_LockBuffer" "', argument " "2"" of type '" "double""'");
17194   }
17195   arg2 = static_cast< double >(val2);
17196   {
17197     if ( bUseExceptions ) {
17198       ClearErrorState();
17199     }
17200     {
17201       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17202       result = (int)GDALAsyncReaderShadow_LockBuffer(arg1,arg2);
17203       SWIG_PYTHON_THREAD_END_ALLOW;
17204     }
17205 #ifndef SED_HACKS
17206     if ( bUseExceptions ) {
17207       CPLErr eclass = CPLGetLastErrorType();
17208       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17209         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17210       }
17211     }
17212 #endif
17213   }
17214   resultobj = SWIG_From_int(static_cast< int >(result));
17215   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17216   return resultobj;
17217 fail:
17218   return NULL;
17219 }
17220 
17221 
_wrap_AsyncReader_UnlockBuffer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17222 SWIGINTERN PyObject *_wrap_AsyncReader_UnlockBuffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17223   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17224   GDALAsyncReaderShadow *arg1 = (GDALAsyncReaderShadow *) 0 ;
17225   void *argp1 = 0 ;
17226   int res1 = 0 ;
17227   PyObject * obj0 = 0 ;
17228 
17229   if (!PyArg_ParseTuple(args,(char *)"O:AsyncReader_UnlockBuffer",&obj0)) SWIG_fail;
17230   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
17231   if (!SWIG_IsOK(res1)) {
17232     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AsyncReader_UnlockBuffer" "', argument " "1"" of type '" "GDALAsyncReaderShadow *""'");
17233   }
17234   arg1 = reinterpret_cast< GDALAsyncReaderShadow * >(argp1);
17235   {
17236     if ( bUseExceptions ) {
17237       ClearErrorState();
17238     }
17239     {
17240       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17241       GDALAsyncReaderShadow_UnlockBuffer(arg1);
17242       SWIG_PYTHON_THREAD_END_ALLOW;
17243     }
17244 #ifndef SED_HACKS
17245     if ( bUseExceptions ) {
17246       CPLErr eclass = CPLGetLastErrorType();
17247       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17248         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17249       }
17250     }
17251 #endif
17252   }
17253   resultobj = SWIG_Py_Void();
17254   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17255   return resultobj;
17256 fail:
17257   return NULL;
17258 }
17259 
17260 
AsyncReader_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17261 SWIGINTERN PyObject *AsyncReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17262   PyObject *obj;
17263   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
17264   SWIG_TypeNewClientData(SWIGTYPE_p_GDALAsyncReaderShadow, SWIG_NewClientData(obj));
17265   return SWIG_Py_Void();
17266 }
17267 
_wrap_Dataset_RasterXSize_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17268 SWIGINTERN PyObject *_wrap_Dataset_RasterXSize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17269   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17270   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17271   void *argp1 = 0 ;
17272   int res1 = 0 ;
17273   PyObject * obj0 = 0 ;
17274   int result;
17275 
17276   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_RasterXSize_get",&obj0)) SWIG_fail;
17277   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17278   if (!SWIG_IsOK(res1)) {
17279     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_RasterXSize_get" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17280   }
17281   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17282   {
17283     if ( bUseExceptions ) {
17284       ClearErrorState();
17285     }
17286     {
17287       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17288       result = (int)GDALDatasetShadow_RasterXSize_get(arg1);
17289       SWIG_PYTHON_THREAD_END_ALLOW;
17290     }
17291 #ifndef SED_HACKS
17292     if ( bUseExceptions ) {
17293       CPLErr eclass = CPLGetLastErrorType();
17294       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17295         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17296       }
17297     }
17298 #endif
17299   }
17300   resultobj = SWIG_From_int(static_cast< int >(result));
17301   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17302   return resultobj;
17303 fail:
17304   return NULL;
17305 }
17306 
17307 
_wrap_Dataset_RasterYSize_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17308 SWIGINTERN PyObject *_wrap_Dataset_RasterYSize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17309   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17310   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17311   void *argp1 = 0 ;
17312   int res1 = 0 ;
17313   PyObject * obj0 = 0 ;
17314   int result;
17315 
17316   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_RasterYSize_get",&obj0)) SWIG_fail;
17317   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17318   if (!SWIG_IsOK(res1)) {
17319     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_RasterYSize_get" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17320   }
17321   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17322   {
17323     if ( bUseExceptions ) {
17324       ClearErrorState();
17325     }
17326     {
17327       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17328       result = (int)GDALDatasetShadow_RasterYSize_get(arg1);
17329       SWIG_PYTHON_THREAD_END_ALLOW;
17330     }
17331 #ifndef SED_HACKS
17332     if ( bUseExceptions ) {
17333       CPLErr eclass = CPLGetLastErrorType();
17334       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17335         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17336       }
17337     }
17338 #endif
17339   }
17340   resultobj = SWIG_From_int(static_cast< int >(result));
17341   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17342   return resultobj;
17343 fail:
17344   return NULL;
17345 }
17346 
17347 
_wrap_Dataset_RasterCount_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17348 SWIGINTERN PyObject *_wrap_Dataset_RasterCount_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17349   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17350   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17351   void *argp1 = 0 ;
17352   int res1 = 0 ;
17353   PyObject * obj0 = 0 ;
17354   int result;
17355 
17356   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_RasterCount_get",&obj0)) SWIG_fail;
17357   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17358   if (!SWIG_IsOK(res1)) {
17359     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_RasterCount_get" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17360   }
17361   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17362   {
17363     if ( bUseExceptions ) {
17364       ClearErrorState();
17365     }
17366     {
17367       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17368       result = (int)GDALDatasetShadow_RasterCount_get(arg1);
17369       SWIG_PYTHON_THREAD_END_ALLOW;
17370     }
17371 #ifndef SED_HACKS
17372     if ( bUseExceptions ) {
17373       CPLErr eclass = CPLGetLastErrorType();
17374       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17375         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17376       }
17377     }
17378 #endif
17379   }
17380   resultobj = SWIG_From_int(static_cast< int >(result));
17381   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17382   return resultobj;
17383 fail:
17384   return NULL;
17385 }
17386 
17387 
_wrap_delete_Dataset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17388 SWIGINTERN PyObject *_wrap_delete_Dataset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17389   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17390   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17391   void *argp1 = 0 ;
17392   int res1 = 0 ;
17393   PyObject * obj0 = 0 ;
17394 
17395   if (!PyArg_ParseTuple(args,(char *)"O:delete_Dataset",&obj0)) SWIG_fail;
17396   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_DISOWN |  0 );
17397   if (!SWIG_IsOK(res1)) {
17398     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Dataset" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17399   }
17400   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17401   {
17402     if ( bUseExceptions ) {
17403       ClearErrorState();
17404     }
17405     {
17406       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17407       delete_GDALDatasetShadow(arg1);
17408       SWIG_PYTHON_THREAD_END_ALLOW;
17409     }
17410 #ifndef SED_HACKS
17411     if ( bUseExceptions ) {
17412       CPLErr eclass = CPLGetLastErrorType();
17413       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17414         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17415       }
17416     }
17417 #endif
17418   }
17419   resultobj = SWIG_Py_Void();
17420   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17421   return resultobj;
17422 fail:
17423   return NULL;
17424 }
17425 
17426 
_wrap_Dataset_GetDriver(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17427 SWIGINTERN PyObject *_wrap_Dataset_GetDriver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17428   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17429   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17430   void *argp1 = 0 ;
17431   int res1 = 0 ;
17432   PyObject * obj0 = 0 ;
17433   GDALDriverShadow *result = 0 ;
17434 
17435   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetDriver",&obj0)) SWIG_fail;
17436   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17437   if (!SWIG_IsOK(res1)) {
17438     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetDriver" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17439   }
17440   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17441   {
17442     if ( bUseExceptions ) {
17443       ClearErrorState();
17444     }
17445     {
17446       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17447       result = (GDALDriverShadow *)GDALDatasetShadow_GetDriver(arg1);
17448       SWIG_PYTHON_THREAD_END_ALLOW;
17449     }
17450 #ifndef SED_HACKS
17451     if ( bUseExceptions ) {
17452       CPLErr eclass = CPLGetLastErrorType();
17453       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17454         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17455       }
17456     }
17457 #endif
17458   }
17459   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
17460   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17461   return resultobj;
17462 fail:
17463   return NULL;
17464 }
17465 
17466 
_wrap_Dataset_GetRasterBand(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17467 SWIGINTERN PyObject *_wrap_Dataset_GetRasterBand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17468   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17469   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17470   int arg2 ;
17471   void *argp1 = 0 ;
17472   int res1 = 0 ;
17473   int val2 ;
17474   int ecode2 = 0 ;
17475   PyObject * obj0 = 0 ;
17476   PyObject * obj1 = 0 ;
17477   GDALRasterBandShadow *result = 0 ;
17478 
17479   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_GetRasterBand",&obj0,&obj1)) SWIG_fail;
17480   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17481   if (!SWIG_IsOK(res1)) {
17482     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetRasterBand" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17483   }
17484   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17485   ecode2 = SWIG_AsVal_int(obj1, &val2);
17486   if (!SWIG_IsOK(ecode2)) {
17487     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_GetRasterBand" "', argument " "2"" of type '" "int""'");
17488   }
17489   arg2 = static_cast< int >(val2);
17490   {
17491     if ( bUseExceptions ) {
17492       ClearErrorState();
17493     }
17494     {
17495       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17496       result = (GDALRasterBandShadow *)GDALDatasetShadow_GetRasterBand(arg1,arg2);
17497       SWIG_PYTHON_THREAD_END_ALLOW;
17498     }
17499 #ifndef SED_HACKS
17500     if ( bUseExceptions ) {
17501       CPLErr eclass = CPLGetLastErrorType();
17502       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17503         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17504       }
17505     }
17506 #endif
17507   }
17508   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
17509   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17510   return resultobj;
17511 fail:
17512   return NULL;
17513 }
17514 
17515 
_wrap_Dataset_GetRootGroup(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17516 SWIGINTERN PyObject *_wrap_Dataset_GetRootGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17517   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17518   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17519   void *argp1 = 0 ;
17520   int res1 = 0 ;
17521   PyObject * obj0 = 0 ;
17522   GDALGroupHS *result = 0 ;
17523 
17524   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetRootGroup",&obj0)) SWIG_fail;
17525   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17526   if (!SWIG_IsOK(res1)) {
17527     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetRootGroup" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17528   }
17529   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17530   {
17531     if ( bUseExceptions ) {
17532       ClearErrorState();
17533     }
17534     {
17535       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17536       result = (GDALGroupHS *)GDALDatasetShadow_GetRootGroup(arg1);
17537       SWIG_PYTHON_THREAD_END_ALLOW;
17538     }
17539 #ifndef SED_HACKS
17540     if ( bUseExceptions ) {
17541       CPLErr eclass = CPLGetLastErrorType();
17542       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17543         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17544       }
17545     }
17546 #endif
17547   }
17548   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_POINTER_OWN |  0 );
17549   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17550   return resultobj;
17551 fail:
17552   return NULL;
17553 }
17554 
17555 
_wrap_Dataset_GetProjection(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17556 SWIGINTERN PyObject *_wrap_Dataset_GetProjection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17557   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17558   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17559   void *argp1 = 0 ;
17560   int res1 = 0 ;
17561   PyObject * obj0 = 0 ;
17562   char *result = 0 ;
17563 
17564   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetProjection",&obj0)) SWIG_fail;
17565   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17566   if (!SWIG_IsOK(res1)) {
17567     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetProjection" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17568   }
17569   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17570   {
17571     if ( bUseExceptions ) {
17572       ClearErrorState();
17573     }
17574     {
17575       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17576       result = (char *)GDALDatasetShadow_GetProjection(arg1);
17577       SWIG_PYTHON_THREAD_END_ALLOW;
17578     }
17579 #ifndef SED_HACKS
17580     if ( bUseExceptions ) {
17581       CPLErr eclass = CPLGetLastErrorType();
17582       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17583         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17584       }
17585     }
17586 #endif
17587   }
17588   resultobj = SWIG_FromCharPtr((const char *)result);
17589   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17590   return resultobj;
17591 fail:
17592   return NULL;
17593 }
17594 
17595 
_wrap_Dataset_GetProjectionRef(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17596 SWIGINTERN PyObject *_wrap_Dataset_GetProjectionRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17597   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17598   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17599   void *argp1 = 0 ;
17600   int res1 = 0 ;
17601   PyObject * obj0 = 0 ;
17602   char *result = 0 ;
17603 
17604   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetProjectionRef",&obj0)) SWIG_fail;
17605   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17606   if (!SWIG_IsOK(res1)) {
17607     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetProjectionRef" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17608   }
17609   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17610   {
17611     if ( bUseExceptions ) {
17612       ClearErrorState();
17613     }
17614     {
17615       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17616       result = (char *)GDALDatasetShadow_GetProjectionRef(arg1);
17617       SWIG_PYTHON_THREAD_END_ALLOW;
17618     }
17619 #ifndef SED_HACKS
17620     if ( bUseExceptions ) {
17621       CPLErr eclass = CPLGetLastErrorType();
17622       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17623         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17624       }
17625     }
17626 #endif
17627   }
17628   resultobj = SWIG_FromCharPtr((const char *)result);
17629   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17630   return resultobj;
17631 fail:
17632   return NULL;
17633 }
17634 
17635 
_wrap_Dataset_GetSpatialRef(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17636 SWIGINTERN PyObject *_wrap_Dataset_GetSpatialRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17637   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17638   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17639   void *argp1 = 0 ;
17640   int res1 = 0 ;
17641   PyObject * obj0 = 0 ;
17642   OSRSpatialReferenceShadow *result = 0 ;
17643 
17644   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetSpatialRef",&obj0)) SWIG_fail;
17645   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17646   if (!SWIG_IsOK(res1)) {
17647     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetSpatialRef" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17648   }
17649   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17650   {
17651     if ( bUseExceptions ) {
17652       ClearErrorState();
17653     }
17654     {
17655       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17656       result = (OSRSpatialReferenceShadow *)GDALDatasetShadow_GetSpatialRef(arg1);
17657       SWIG_PYTHON_THREAD_END_ALLOW;
17658     }
17659 #ifndef SED_HACKS
17660     if ( bUseExceptions ) {
17661       CPLErr eclass = CPLGetLastErrorType();
17662       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17663         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17664       }
17665     }
17666 #endif
17667   }
17668   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_POINTER_OWN |  0 );
17669   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17670   return resultobj;
17671 fail:
17672   return NULL;
17673 }
17674 
17675 
_wrap_Dataset_SetProjection(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17676 SWIGINTERN PyObject *_wrap_Dataset_SetProjection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17677   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17678   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17679   char *arg2 = (char *) 0 ;
17680   void *argp1 = 0 ;
17681   int res1 = 0 ;
17682   int res2 ;
17683   char *buf2 = 0 ;
17684   int alloc2 = 0 ;
17685   PyObject * obj0 = 0 ;
17686   PyObject * obj1 = 0 ;
17687   CPLErr result;
17688 
17689   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_SetProjection",&obj0,&obj1)) SWIG_fail;
17690   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17691   if (!SWIG_IsOK(res1)) {
17692     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_SetProjection" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17693   }
17694   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17695   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
17696   if (!SWIG_IsOK(res2)) {
17697     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_SetProjection" "', argument " "2"" of type '" "char const *""'");
17698   }
17699   arg2 = reinterpret_cast< char * >(buf2);
17700   {
17701     if (!arg2) {
17702       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17703     }
17704   }
17705   {
17706     if ( bUseExceptions ) {
17707       ClearErrorState();
17708     }
17709     {
17710       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17711       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_SetProjection(arg1,(char const *)arg2));
17712       SWIG_PYTHON_THREAD_END_ALLOW;
17713     }
17714 #ifndef SED_HACKS
17715     if ( bUseExceptions ) {
17716       CPLErr eclass = CPLGetLastErrorType();
17717       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17718         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17719       }
17720     }
17721 #endif
17722   }
17723   resultobj = SWIG_From_int(static_cast< int >(result));
17724   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
17725   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17726   return resultobj;
17727 fail:
17728   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
17729   return NULL;
17730 }
17731 
17732 
_wrap_Dataset_SetSpatialRef(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17733 SWIGINTERN PyObject *_wrap_Dataset_SetSpatialRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17734   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17735   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17736   OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
17737   void *argp1 = 0 ;
17738   int res1 = 0 ;
17739   void *argp2 = 0 ;
17740   int res2 = 0 ;
17741   PyObject * obj0 = 0 ;
17742   PyObject * obj1 = 0 ;
17743   CPLErr result;
17744 
17745   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_SetSpatialRef",&obj0,&obj1)) SWIG_fail;
17746   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17747   if (!SWIG_IsOK(res1)) {
17748     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_SetSpatialRef" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17749   }
17750   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17751   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
17752   if (!SWIG_IsOK(res2)) {
17753     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_SetSpatialRef" "', argument " "2"" of type '" "OSRSpatialReferenceShadow *""'");
17754   }
17755   arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
17756   {
17757     if ( bUseExceptions ) {
17758       ClearErrorState();
17759     }
17760     {
17761       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17762       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_SetSpatialRef(arg1,arg2));
17763       SWIG_PYTHON_THREAD_END_ALLOW;
17764     }
17765 #ifndef SED_HACKS
17766     if ( bUseExceptions ) {
17767       CPLErr eclass = CPLGetLastErrorType();
17768       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17769         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17770       }
17771     }
17772 #endif
17773   }
17774   resultobj = SWIG_From_int(static_cast< int >(result));
17775   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17776   return resultobj;
17777 fail:
17778   return NULL;
17779 }
17780 
17781 
_wrap_Dataset_GetGeoTransform(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)17782 SWIGINTERN PyObject *_wrap_Dataset_GetGeoTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
17783   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17784   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17785   double *arg2 ;
17786   int *arg3 = (int *) 0 ;
17787   int *arg4 = (int *) 0 ;
17788   void *argp1 = 0 ;
17789   int res1 = 0 ;
17790   double argout2[6] ;
17791   int isvalid2 ;
17792   int val4 ;
17793   PyObject * obj0 = 0 ;
17794   PyObject * obj1 = 0 ;
17795   char *  kwnames[] = {
17796     (char *) "self",(char *) "can_return_null", NULL
17797   };
17798 
17799   {
17800     /* %typemap(in,numinputs=0) (double argout2[6], int* isvalid2) */
17801     arg2 = argout2;
17802     arg3 = &isvalid2;
17803   }
17804   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Dataset_GetGeoTransform",kwnames,&obj0,&obj1)) SWIG_fail;
17805   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17806   if (!SWIG_IsOK(res1)) {
17807     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetGeoTransform" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17808   }
17809   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17810   if (obj1) {
17811     {
17812       /* %typemap(in) (int *optional_##int) */
17813       if ( obj1 == Py_None ) {
17814         arg4 = 0;
17815       }
17816       else if ( PyArg_Parse( obj1,"i" ,&val4 ) ) {
17817         arg4 = (int *) &val4;
17818       }
17819       else {
17820         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
17821         SWIG_fail;
17822       }
17823     }
17824   }
17825   {
17826     if ( bUseExceptions ) {
17827       ClearErrorState();
17828     }
17829     {
17830       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17831       GDALDatasetShadow_GetGeoTransform(arg1,arg2,arg3,arg4);
17832       SWIG_PYTHON_THREAD_END_ALLOW;
17833     }
17834 #ifndef SED_HACKS
17835     if ( bUseExceptions ) {
17836       CPLErr eclass = CPLGetLastErrorType();
17837       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17838         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17839       }
17840     }
17841 #endif
17842   }
17843   resultobj = SWIG_Py_Void();
17844   {
17845     /* %typemap(argout) (double argout[6], int* isvalid)  */
17846     PyObject *r;
17847     if ( !*arg3 ) {
17848       Py_INCREF(Py_None);
17849       r = Py_None;
17850     }
17851     else {
17852       r = CreateTupleFromDoubleArray(arg2, 6);
17853     }
17854     resultobj = t_output_helper(resultobj,r);
17855   }
17856   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17857   return resultobj;
17858 fail:
17859   return NULL;
17860 }
17861 
17862 
_wrap_Dataset_SetGeoTransform(PyObject * SWIGUNUSEDPARM (self),PyObject * args)17863 SWIGINTERN PyObject *_wrap_Dataset_SetGeoTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
17864   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17865   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17866   double *arg2 ;
17867   void *argp1 = 0 ;
17868   int res1 = 0 ;
17869   double argin2[6] ;
17870   PyObject * obj0 = 0 ;
17871   PyObject * obj1 = 0 ;
17872   CPLErr result;
17873 
17874   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_SetGeoTransform",&obj0,&obj1)) SWIG_fail;
17875   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17876   if (!SWIG_IsOK(res1)) {
17877     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_SetGeoTransform" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17878   }
17879   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17880   {
17881     /* %typemap(in) (double argin2[ANY]) */
17882     arg2 = argin2;
17883     if (! PySequence_Check(obj1) ) {
17884       PyErr_SetString(PyExc_TypeError, "not a sequence");
17885       SWIG_fail;
17886     }
17887     Py_ssize_t seq_size = PySequence_Size(obj1);
17888     if ( seq_size != 6 ) {
17889       PyErr_SetString(PyExc_TypeError, "sequence must have length ##size");
17890       SWIG_fail;
17891     }
17892     for (unsigned int i=0; i<6; i++) {
17893       PyObject *o = PySequence_GetItem(obj1,i);
17894       double val;
17895       if ( !PyArg_Parse(o, "d", &val ) ) {
17896         PyErr_SetString(PyExc_TypeError, "not a number");
17897         Py_DECREF(o);
17898         SWIG_fail;
17899       }
17900       arg2[i] =  val;
17901       Py_DECREF(o);
17902     }
17903   }
17904   {
17905     if ( bUseExceptions ) {
17906       ClearErrorState();
17907     }
17908     {
17909       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17910       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_SetGeoTransform(arg1,arg2));
17911       SWIG_PYTHON_THREAD_END_ALLOW;
17912     }
17913 #ifndef SED_HACKS
17914     if ( bUseExceptions ) {
17915       CPLErr eclass = CPLGetLastErrorType();
17916       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
17917         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
17918       }
17919     }
17920 #endif
17921   }
17922   resultobj = SWIG_From_int(static_cast< int >(result));
17923   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
17924   return resultobj;
17925 fail:
17926   return NULL;
17927 }
17928 
17929 
_wrap_Dataset_BuildOverviews(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)17930 SWIGINTERN PyObject *_wrap_Dataset_BuildOverviews(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
17931   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
17932   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
17933   char *arg2 = (char *) "NEAREST" ;
17934   int arg3 = (int) 0 ;
17935   int *arg4 = (int *) 0 ;
17936   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
17937   void *arg6 = (void *) NULL ;
17938   void *argp1 = 0 ;
17939   int res1 = 0 ;
17940   int res2 ;
17941   char *buf2 = 0 ;
17942   int alloc2 = 0 ;
17943   PyObject * obj0 = 0 ;
17944   PyObject * obj1 = 0 ;
17945   PyObject * obj2 = 0 ;
17946   PyObject * obj3 = 0 ;
17947   PyObject * obj4 = 0 ;
17948   char *  kwnames[] = {
17949     (char *) "self",(char *) "resampling",(char *) "overviewlist",(char *) "callback",(char *) "callback_data", NULL
17950   };
17951   int result;
17952 
17953   /* %typemap(arginit) ( const char* callback_data=NULL)  */
17954   PyProgressData *psProgressInfo;
17955   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
17956   psProgressInfo->nLastReported = -1;
17957   psProgressInfo->psPyCallback = NULL;
17958   psProgressInfo->psPyCallbackData = NULL;
17959   arg6 = psProgressInfo;
17960   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:Dataset_BuildOverviews",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
17961   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
17962   if (!SWIG_IsOK(res1)) {
17963     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_BuildOverviews" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
17964   }
17965   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
17966   if (obj1) {
17967     res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
17968     if (!SWIG_IsOK(res2)) {
17969       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_BuildOverviews" "', argument " "2"" of type '" "char const *""'");
17970     }
17971     arg2 = reinterpret_cast< char * >(buf2);
17972   }
17973   if (obj2) {
17974     {
17975       /* %typemap(in,numinputs=1) (int nList, int* pList)*/
17976       arg4 = CreateCIntListFromSequence(obj2, &arg3);
17977       if( arg3 < 0 ) {
17978         SWIG_fail;
17979       }
17980     }
17981   }
17982   if (obj3) {
17983     {
17984       /* %typemap(in) (GDALProgressFunc callback = NULL) */
17985       /* callback_func typemap */
17986 
17987       /* In some cases 0 is passed instead of None. */
17988       /* See https://github.com/OSGeo/gdal/pull/219 */
17989       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
17990       {
17991         if( PyLong_AsLong(obj3) == 0 )
17992         {
17993           obj3 = Py_None;
17994         }
17995       }
17996 
17997       if (obj3 && obj3 != Py_None ) {
17998         void* cbfunction = NULL;
17999         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
18000             (void**)&cbfunction,
18001             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
18002             SWIG_POINTER_EXCEPTION | 0 ));
18003 
18004         if ( cbfunction == GDALTermProgress ) {
18005           arg5 = GDALTermProgress;
18006         } else {
18007           if (!PyCallable_Check(obj3)) {
18008             PyErr_SetString( PyExc_RuntimeError,
18009               "Object given is not a Python function" );
18010             SWIG_fail;
18011           }
18012           psProgressInfo->psPyCallback = obj3;
18013           arg5 = PyProgressProxy;
18014         }
18015 
18016       }
18017 
18018     }
18019   }
18020   if (obj4) {
18021     {
18022       /* %typemap(in) ( void* callback_data=NULL)  */
18023       psProgressInfo->psPyCallbackData = obj4 ;
18024     }
18025   }
18026   {
18027     if ( bUseExceptions ) {
18028       ClearErrorState();
18029     }
18030     {
18031       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18032       result = (int)GDALDatasetShadow_BuildOverviews(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
18033       SWIG_PYTHON_THREAD_END_ALLOW;
18034     }
18035 #ifndef SED_HACKS
18036     if ( bUseExceptions ) {
18037       CPLErr eclass = CPLGetLastErrorType();
18038       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18039         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18040       }
18041     }
18042 #endif
18043   }
18044   resultobj = SWIG_From_int(static_cast< int >(result));
18045   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18046   {
18047     /* %typemap(freearg) (int nList, int* pList) */
18048     free(arg4);
18049   }
18050   {
18051     /* %typemap(freearg) ( void* callback_data=NULL)  */
18052 
18053     CPLFree(psProgressInfo);
18054 
18055   }
18056   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18057   return resultobj;
18058 fail:
18059   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
18060   {
18061     /* %typemap(freearg) (int nList, int* pList) */
18062     free(arg4);
18063   }
18064   {
18065     /* %typemap(freearg) ( void* callback_data=NULL)  */
18066 
18067     CPLFree(psProgressInfo);
18068 
18069   }
18070   return NULL;
18071 }
18072 
18073 
_wrap_Dataset_GetGCPCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18074 SWIGINTERN PyObject *_wrap_Dataset_GetGCPCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18075   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18076   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18077   void *argp1 = 0 ;
18078   int res1 = 0 ;
18079   PyObject * obj0 = 0 ;
18080   int result;
18081 
18082   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetGCPCount",&obj0)) SWIG_fail;
18083   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18084   if (!SWIG_IsOK(res1)) {
18085     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetGCPCount" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18086   }
18087   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18088   {
18089     if ( bUseExceptions ) {
18090       ClearErrorState();
18091     }
18092     {
18093       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18094       result = (int)GDALDatasetShadow_GetGCPCount(arg1);
18095       SWIG_PYTHON_THREAD_END_ALLOW;
18096     }
18097 #ifndef SED_HACKS
18098     if ( bUseExceptions ) {
18099       CPLErr eclass = CPLGetLastErrorType();
18100       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18101         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18102       }
18103     }
18104 #endif
18105   }
18106   resultobj = SWIG_From_int(static_cast< int >(result));
18107   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18108   return resultobj;
18109 fail:
18110   return NULL;
18111 }
18112 
18113 
_wrap_Dataset_GetGCPProjection(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18114 SWIGINTERN PyObject *_wrap_Dataset_GetGCPProjection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18115   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18116   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18117   void *argp1 = 0 ;
18118   int res1 = 0 ;
18119   PyObject * obj0 = 0 ;
18120   char *result = 0 ;
18121 
18122   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetGCPProjection",&obj0)) SWIG_fail;
18123   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18124   if (!SWIG_IsOK(res1)) {
18125     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetGCPProjection" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18126   }
18127   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18128   {
18129     if ( bUseExceptions ) {
18130       ClearErrorState();
18131     }
18132     {
18133       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18134       result = (char *)GDALDatasetShadow_GetGCPProjection(arg1);
18135       SWIG_PYTHON_THREAD_END_ALLOW;
18136     }
18137 #ifndef SED_HACKS
18138     if ( bUseExceptions ) {
18139       CPLErr eclass = CPLGetLastErrorType();
18140       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18141         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18142       }
18143     }
18144 #endif
18145   }
18146   resultobj = SWIG_FromCharPtr((const char *)result);
18147   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18148   return resultobj;
18149 fail:
18150   return NULL;
18151 }
18152 
18153 
_wrap_Dataset_GetGCPSpatialRef(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18154 SWIGINTERN PyObject *_wrap_Dataset_GetGCPSpatialRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18155   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18156   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18157   void *argp1 = 0 ;
18158   int res1 = 0 ;
18159   PyObject * obj0 = 0 ;
18160   OSRSpatialReferenceShadow *result = 0 ;
18161 
18162   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetGCPSpatialRef",&obj0)) SWIG_fail;
18163   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18164   if (!SWIG_IsOK(res1)) {
18165     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetGCPSpatialRef" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18166   }
18167   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18168   {
18169     if ( bUseExceptions ) {
18170       ClearErrorState();
18171     }
18172     {
18173       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18174       result = (OSRSpatialReferenceShadow *)GDALDatasetShadow_GetGCPSpatialRef(arg1);
18175       SWIG_PYTHON_THREAD_END_ALLOW;
18176     }
18177 #ifndef SED_HACKS
18178     if ( bUseExceptions ) {
18179       CPLErr eclass = CPLGetLastErrorType();
18180       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18181         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18182       }
18183     }
18184 #endif
18185   }
18186   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_POINTER_OWN |  0 );
18187   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18188   return resultobj;
18189 fail:
18190   return NULL;
18191 }
18192 
18193 
_wrap_Dataset_GetGCPs(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18194 SWIGINTERN PyObject *_wrap_Dataset_GetGCPs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18195   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18196   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18197   int *arg2 = (int *) 0 ;
18198   GDAL_GCP **arg3 = (GDAL_GCP **) 0 ;
18199   void *argp1 = 0 ;
18200   int res1 = 0 ;
18201   int nGCPs2 = 0 ;
18202   GDAL_GCP *pGCPs2 = 0 ;
18203   PyObject * obj0 = 0 ;
18204 
18205   {
18206     /* %typemap(in,numinputs=0) (int *nGCPs2, GDAL_GCP const **pGCPs2 ) */
18207     arg2 = &nGCPs2;
18208     arg3 = &pGCPs2;
18209   }
18210   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetGCPs",&obj0)) SWIG_fail;
18211   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18212   if (!SWIG_IsOK(res1)) {
18213     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetGCPs" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18214   }
18215   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18216   {
18217     if ( bUseExceptions ) {
18218       ClearErrorState();
18219     }
18220     {
18221       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18222       GDALDatasetShadow_GetGCPs(arg1,arg2,(GDAL_GCP const **)arg3);
18223       SWIG_PYTHON_THREAD_END_ALLOW;
18224     }
18225 #ifndef SED_HACKS
18226     if ( bUseExceptions ) {
18227       CPLErr eclass = CPLGetLastErrorType();
18228       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18229         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18230       }
18231     }
18232 #endif
18233   }
18234   resultobj = SWIG_Py_Void();
18235   {
18236     /* %typemap(argout) (int *nGCPs, GDAL_GCP const **pGCPs ) */
18237     PyObject *dict = PyTuple_New( *arg2 );
18238     for( int i = 0; i < *arg2; i++ ) {
18239       GDAL_GCP *o = new_GDAL_GCP( (*arg3)[i].dfGCPX,
18240         (*arg3)[i].dfGCPY,
18241         (*arg3)[i].dfGCPZ,
18242         (*arg3)[i].dfGCPPixel,
18243         (*arg3)[i].dfGCPLine,
18244         (*arg3)[i].pszInfo,
18245         (*arg3)[i].pszId );
18246 
18247       PyTuple_SetItem(dict, i,
18248         SWIG_NewPointerObj((void*)o,SWIGTYPE_p_GDAL_GCP,1) );
18249     }
18250     Py_DECREF(resultobj);
18251     resultobj = dict;
18252   }
18253   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18254   return resultobj;
18255 fail:
18256   return NULL;
18257 }
18258 
18259 
_wrap_Dataset__SetGCPs(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18260 SWIGINTERN PyObject *_wrap_Dataset__SetGCPs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18261   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18262   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18263   int arg2 ;
18264   GDAL_GCP *arg3 = (GDAL_GCP *) 0 ;
18265   char *arg4 = (char *) 0 ;
18266   void *argp1 = 0 ;
18267   int res1 = 0 ;
18268   GDAL_GCP *tmpGCPList2 ;
18269   int res4 ;
18270   char *buf4 = 0 ;
18271   int alloc4 = 0 ;
18272   PyObject * obj0 = 0 ;
18273   PyObject * obj1 = 0 ;
18274   PyObject * obj2 = 0 ;
18275   CPLErr result;
18276 
18277   if (!PyArg_ParseTuple(args,(char *)"OOO:Dataset__SetGCPs",&obj0,&obj1,&obj2)) SWIG_fail;
18278   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18279   if (!SWIG_IsOK(res1)) {
18280     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset__SetGCPs" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18281   }
18282   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18283   {
18284     /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
18285     /* check if is List */
18286     if ( !PySequence_Check(obj1) ) {
18287       PyErr_SetString(PyExc_TypeError, "not a sequence");
18288       SWIG_fail;
18289     }
18290     Py_ssize_t size = PySequence_Size(obj1);
18291     if( size != (int)size ) {
18292       PyErr_SetString(PyExc_TypeError, "too big sequence");
18293       SWIG_fail;
18294     }
18295     arg2 = (int)size;
18296     tmpGCPList2 = (GDAL_GCP*) malloc(arg2*sizeof(GDAL_GCP));
18297     arg3 = tmpGCPList2;
18298     for( int i = 0; i<arg2; i++ ) {
18299       PyObject *o = PySequence_GetItem(obj1,i);
18300       GDAL_GCP *item = 0;
18301       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&item, SWIGTYPE_p_GDAL_GCP, SWIG_POINTER_EXCEPTION | 0 ));
18302       if ( ! item ) {
18303         Py_DECREF(o);
18304         SWIG_fail;
18305       }
18306       memcpy( (void*) tmpGCPList2, (void*) item, sizeof( GDAL_GCP ) );
18307       ++tmpGCPList2;
18308       Py_DECREF(o);
18309     }
18310   }
18311   res4 = SWIG_AsCharPtrAndSize(obj2, &buf4, NULL, &alloc4);
18312   if (!SWIG_IsOK(res4)) {
18313     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Dataset__SetGCPs" "', argument " "4"" of type '" "char const *""'");
18314   }
18315   arg4 = reinterpret_cast< char * >(buf4);
18316   {
18317     if ( bUseExceptions ) {
18318       ClearErrorState();
18319     }
18320     {
18321       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18322       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_SetGCPs(arg1,arg2,(GDAL_GCP const *)arg3,(char const *)arg4));
18323       SWIG_PYTHON_THREAD_END_ALLOW;
18324     }
18325 #ifndef SED_HACKS
18326     if ( bUseExceptions ) {
18327       CPLErr eclass = CPLGetLastErrorType();
18328       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18329         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18330       }
18331     }
18332 #endif
18333   }
18334   resultobj = SWIG_From_int(static_cast< int >(result));
18335   {
18336     /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
18337     if (arg3) {
18338       free( (void*) arg3 );
18339     }
18340   }
18341   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
18342   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18343   return resultobj;
18344 fail:
18345   {
18346     /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
18347     if (arg3) {
18348       free( (void*) arg3 );
18349     }
18350   }
18351   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
18352   return NULL;
18353 }
18354 
18355 
_wrap_Dataset__SetGCPs2(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18356 SWIGINTERN PyObject *_wrap_Dataset__SetGCPs2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18357   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18358   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18359   int arg2 ;
18360   GDAL_GCP *arg3 = (GDAL_GCP *) 0 ;
18361   OSRSpatialReferenceShadow *arg4 = (OSRSpatialReferenceShadow *) 0 ;
18362   void *argp1 = 0 ;
18363   int res1 = 0 ;
18364   GDAL_GCP *tmpGCPList2 ;
18365   void *argp4 = 0 ;
18366   int res4 = 0 ;
18367   PyObject * obj0 = 0 ;
18368   PyObject * obj1 = 0 ;
18369   PyObject * obj2 = 0 ;
18370   CPLErr result;
18371 
18372   if (!PyArg_ParseTuple(args,(char *)"OOO:Dataset__SetGCPs2",&obj0,&obj1,&obj2)) SWIG_fail;
18373   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18374   if (!SWIG_IsOK(res1)) {
18375     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset__SetGCPs2" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18376   }
18377   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18378   {
18379     /* %typemap(in,numinputs=1) (int nGCPs, GDAL_GCP const *pGCPs ) */
18380     /* check if is List */
18381     if ( !PySequence_Check(obj1) ) {
18382       PyErr_SetString(PyExc_TypeError, "not a sequence");
18383       SWIG_fail;
18384     }
18385     Py_ssize_t size = PySequence_Size(obj1);
18386     if( size != (int)size ) {
18387       PyErr_SetString(PyExc_TypeError, "too big sequence");
18388       SWIG_fail;
18389     }
18390     arg2 = (int)size;
18391     tmpGCPList2 = (GDAL_GCP*) malloc(arg2*sizeof(GDAL_GCP));
18392     arg3 = tmpGCPList2;
18393     for( int i = 0; i<arg2; i++ ) {
18394       PyObject *o = PySequence_GetItem(obj1,i);
18395       GDAL_GCP *item = 0;
18396       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&item, SWIGTYPE_p_GDAL_GCP, SWIG_POINTER_EXCEPTION | 0 ));
18397       if ( ! item ) {
18398         Py_DECREF(o);
18399         SWIG_fail;
18400       }
18401       memcpy( (void*) tmpGCPList2, (void*) item, sizeof( GDAL_GCP ) );
18402       ++tmpGCPList2;
18403       Py_DECREF(o);
18404     }
18405   }
18406   res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
18407   if (!SWIG_IsOK(res4)) {
18408     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Dataset__SetGCPs2" "', argument " "4"" of type '" "OSRSpatialReferenceShadow *""'");
18409   }
18410   arg4 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp4);
18411   {
18412     if ( bUseExceptions ) {
18413       ClearErrorState();
18414     }
18415     {
18416       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18417       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_SetGCPs2(arg1,arg2,(GDAL_GCP const *)arg3,arg4));
18418       SWIG_PYTHON_THREAD_END_ALLOW;
18419     }
18420 #ifndef SED_HACKS
18421     if ( bUseExceptions ) {
18422       CPLErr eclass = CPLGetLastErrorType();
18423       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18424         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18425       }
18426     }
18427 #endif
18428   }
18429   resultobj = SWIG_From_int(static_cast< int >(result));
18430   {
18431     /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
18432     if (arg3) {
18433       free( (void*) arg3 );
18434     }
18435   }
18436   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18437   return resultobj;
18438 fail:
18439   {
18440     /* %typemap(freearg) (int nGCPs, GDAL_GCP const *pGCPs ) */
18441     if (arg3) {
18442       free( (void*) arg3 );
18443     }
18444   }
18445   return NULL;
18446 }
18447 
18448 
_wrap_Dataset_FlushCache(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18449 SWIGINTERN PyObject *_wrap_Dataset_FlushCache(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18450   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18451   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18452   void *argp1 = 0 ;
18453   int res1 = 0 ;
18454   PyObject * obj0 = 0 ;
18455 
18456   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_FlushCache",&obj0)) SWIG_fail;
18457   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18458   if (!SWIG_IsOK(res1)) {
18459     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_FlushCache" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18460   }
18461   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18462   {
18463     if ( bUseExceptions ) {
18464       ClearErrorState();
18465     }
18466     {
18467       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18468       GDALDatasetShadow_FlushCache(arg1);
18469       SWIG_PYTHON_THREAD_END_ALLOW;
18470     }
18471 #ifndef SED_HACKS
18472     if ( bUseExceptions ) {
18473       CPLErr eclass = CPLGetLastErrorType();
18474       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18475         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18476       }
18477     }
18478 #endif
18479   }
18480   resultobj = SWIG_Py_Void();
18481   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18482   return resultobj;
18483 fail:
18484   return NULL;
18485 }
18486 
18487 
_wrap_Dataset_AddBand(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)18488 SWIGINTERN PyObject *_wrap_Dataset_AddBand(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
18489   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18490   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18491   GDALDataType arg2 = (GDALDataType) GDT_Byte ;
18492   char **arg3 = (char **) 0 ;
18493   void *argp1 = 0 ;
18494   int res1 = 0 ;
18495   PyObject * obj0 = 0 ;
18496   PyObject * obj1 = 0 ;
18497   PyObject * obj2 = 0 ;
18498   char *  kwnames[] = {
18499     (char *) "self",(char *) "datatype",(char *) "options", NULL
18500   };
18501   CPLErr result;
18502 
18503   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OO:Dataset_AddBand",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
18504   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18505   if (!SWIG_IsOK(res1)) {
18506     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_AddBand" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18507   }
18508   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18509   if (obj1) {
18510     {
18511       // %typemap(in) GDALDataType
18512       int val = 0;
18513       int ecode = SWIG_AsVal_int(obj1, &val);
18514       if (!SWIG_IsOK(ecode)) {
18515         SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
18516       }
18517       if( val < GDT_Unknown || val >= GDT_TypeCount )
18518       {
18519         SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
18520       }
18521       arg2 = static_cast<GDALDataType>(val);
18522     }
18523   }
18524   if (obj2) {
18525     {
18526       /* %typemap(in) char **options */
18527       int bErr = FALSE;
18528       arg3 = CSLFromPySequence(obj2, &bErr);
18529       if( bErr )
18530       {
18531         SWIG_fail;
18532       }
18533     }
18534   }
18535   {
18536     if ( bUseExceptions ) {
18537       ClearErrorState();
18538     }
18539     {
18540       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18541       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_AddBand(arg1,arg2,arg3));
18542       SWIG_PYTHON_THREAD_END_ALLOW;
18543     }
18544 #ifndef SED_HACKS
18545     if ( bUseExceptions ) {
18546       CPLErr eclass = CPLGetLastErrorType();
18547       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18548         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18549       }
18550     }
18551 #endif
18552   }
18553   resultobj = SWIG_From_int(static_cast< int >(result));
18554   {
18555     /* %typemap(freearg) char **options */
18556     CSLDestroy( arg3 );
18557   }
18558   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18559   return resultobj;
18560 fail:
18561   {
18562     /* %typemap(freearg) char **options */
18563     CSLDestroy( arg3 );
18564   }
18565   return NULL;
18566 }
18567 
18568 
_wrap_Dataset_CreateMaskBand(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18569 SWIGINTERN PyObject *_wrap_Dataset_CreateMaskBand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18570   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18571   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18572   int arg2 ;
18573   void *argp1 = 0 ;
18574   int res1 = 0 ;
18575   int val2 ;
18576   int ecode2 = 0 ;
18577   PyObject * obj0 = 0 ;
18578   PyObject * obj1 = 0 ;
18579   CPLErr result;
18580 
18581   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_CreateMaskBand",&obj0,&obj1)) SWIG_fail;
18582   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18583   if (!SWIG_IsOK(res1)) {
18584     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_CreateMaskBand" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18585   }
18586   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18587   ecode2 = SWIG_AsVal_int(obj1, &val2);
18588   if (!SWIG_IsOK(ecode2)) {
18589     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_CreateMaskBand" "', argument " "2"" of type '" "int""'");
18590   }
18591   arg2 = static_cast< int >(val2);
18592   {
18593     if ( bUseExceptions ) {
18594       ClearErrorState();
18595     }
18596     {
18597       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18598       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_CreateMaskBand(arg1,arg2));
18599       SWIG_PYTHON_THREAD_END_ALLOW;
18600     }
18601 #ifndef SED_HACKS
18602     if ( bUseExceptions ) {
18603       CPLErr eclass = CPLGetLastErrorType();
18604       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18605         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18606       }
18607     }
18608 #endif
18609   }
18610   resultobj = SWIG_From_int(static_cast< int >(result));
18611   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18612   return resultobj;
18613 fail:
18614   return NULL;
18615 }
18616 
18617 
_wrap_Dataset_GetFileList(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18618 SWIGINTERN PyObject *_wrap_Dataset_GetFileList(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18619   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18620   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18621   void *argp1 = 0 ;
18622   int res1 = 0 ;
18623   PyObject * obj0 = 0 ;
18624   char **result = 0 ;
18625 
18626   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetFileList",&obj0)) SWIG_fail;
18627   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18628   if (!SWIG_IsOK(res1)) {
18629     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetFileList" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18630   }
18631   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18632   {
18633     if ( bUseExceptions ) {
18634       ClearErrorState();
18635     }
18636     {
18637       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18638       result = (char **)GDALDatasetShadow_GetFileList(arg1);
18639       SWIG_PYTHON_THREAD_END_ALLOW;
18640     }
18641 #ifndef SED_HACKS
18642     if ( bUseExceptions ) {
18643       CPLErr eclass = CPLGetLastErrorType();
18644       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18645         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18646       }
18647     }
18648 #endif
18649   }
18650   {
18651     /* %typemap(out) char **CSL -> ( string ) */
18652     char **stringarray = result;
18653     if ( stringarray == NULL ) {
18654       resultobj = Py_None;
18655       Py_INCREF( resultobj );
18656     }
18657     else {
18658       int len = CSLCount( stringarray );
18659       resultobj = PyList_New( len );
18660       for ( int i = 0; i < len; ++i ) {
18661         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
18662         PyList_SetItem(resultobj, i, o );
18663       }
18664     }
18665     CSLDestroy(result);
18666   }
18667   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18668   return resultobj;
18669 fail:
18670   return NULL;
18671 }
18672 
18673 
_wrap_Dataset_WriteRaster(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)18674 SWIGINTERN PyObject *_wrap_Dataset_WriteRaster(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
18675   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18676   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18677   int arg2 ;
18678   int arg3 ;
18679   int arg4 ;
18680   int arg5 ;
18681   GIntBig arg6 ;
18682   char *arg7 = (char *) 0 ;
18683   int *arg8 = (int *) 0 ;
18684   int *arg9 = (int *) 0 ;
18685   GDALDataType *arg10 = (GDALDataType *) 0 ;
18686   int arg11 = (int) 0 ;
18687   int *arg12 = (int *) 0 ;
18688   GIntBig *arg13 = (GIntBig *) 0 ;
18689   GIntBig *arg14 = (GIntBig *) 0 ;
18690   GIntBig *arg15 = (GIntBig *) 0 ;
18691   void *argp1 = 0 ;
18692   int res1 = 0 ;
18693   int val2 ;
18694   int ecode2 = 0 ;
18695   int val3 ;
18696   int ecode3 = 0 ;
18697   int val4 ;
18698   int ecode4 = 0 ;
18699   int val5 ;
18700   int ecode5 = 0 ;
18701   int alloc6 = 0 ;
18702   bool viewIsValid6 = false ;
18703   Py_buffer view6 ;
18704   int val8 ;
18705   int val9 ;
18706   GDALDataType val10 ;
18707   GIntBig val13 ;
18708   GIntBig val14 ;
18709   GIntBig val15 ;
18710   PyObject * obj0 = 0 ;
18711   PyObject * obj1 = 0 ;
18712   PyObject * obj2 = 0 ;
18713   PyObject * obj3 = 0 ;
18714   PyObject * obj4 = 0 ;
18715   PyObject * obj5 = 0 ;
18716   PyObject * obj6 = 0 ;
18717   PyObject * obj7 = 0 ;
18718   PyObject * obj8 = 0 ;
18719   PyObject * obj9 = 0 ;
18720   PyObject * obj10 = 0 ;
18721   PyObject * obj11 = 0 ;
18722   PyObject * obj12 = 0 ;
18723   char *  kwnames[] = {
18724     (char *) "self",(char *) "xoff",(char *) "yoff",(char *) "xsize",(char *) "ysize",(char *) "buf_len",(char *) "buf_xsize",(char *) "buf_ysize",(char *) "buf_type",(char *) "band_list",(char *) "buf_pixel_space",(char *) "buf_line_space",(char *) "buf_band_space", NULL
18725   };
18726   CPLErr result;
18727 
18728   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOO|OOOOOOO:Dataset_WriteRaster",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail;
18729   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18730   if (!SWIG_IsOK(res1)) {
18731     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_WriteRaster" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18732   }
18733   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18734   ecode2 = SWIG_AsVal_int(obj1, &val2);
18735   if (!SWIG_IsOK(ecode2)) {
18736     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_WriteRaster" "', argument " "2"" of type '" "int""'");
18737   }
18738   arg2 = static_cast< int >(val2);
18739   ecode3 = SWIG_AsVal_int(obj2, &val3);
18740   if (!SWIG_IsOK(ecode3)) {
18741     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_WriteRaster" "', argument " "3"" of type '" "int""'");
18742   }
18743   arg3 = static_cast< int >(val3);
18744   ecode4 = SWIG_AsVal_int(obj3, &val4);
18745   if (!SWIG_IsOK(ecode4)) {
18746     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_WriteRaster" "', argument " "4"" of type '" "int""'");
18747   }
18748   arg4 = static_cast< int >(val4);
18749   ecode5 = SWIG_AsVal_int(obj4, &val5);
18750   if (!SWIG_IsOK(ecode5)) {
18751     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset_WriteRaster" "', argument " "5"" of type '" "int""'");
18752   }
18753   arg5 = static_cast< int >(val5);
18754   {
18755     /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
18756     {
18757       if (PyObject_GetBuffer(obj5, &view6, PyBUF_SIMPLE) == 0)
18758       {
18759         viewIsValid6 = true;
18760         arg6 = view6.len;
18761         arg7 = (char *) view6.buf;
18762         goto ok;
18763       }
18764       else
18765       {
18766         PyErr_Clear();
18767       }
18768     }
18769     if (PyUnicode_Check(obj5))
18770     {
18771       size_t safeLen = 0;
18772       int ret = SWIG_AsCharPtrAndSize(obj5, (char**) &arg7, &safeLen, &alloc6);
18773       if (!SWIG_IsOK(ret)) {
18774         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
18775       }
18776 
18777       if (safeLen) safeLen--;
18778       arg6 = (GIntBig) safeLen;
18779     }
18780     else
18781     {
18782       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
18783       SWIG_fail;
18784     }
18785     ok: ;
18786   }
18787   if (obj6) {
18788     {
18789       /* %typemap(in) (int *optional_##int) */
18790       if ( obj6 == Py_None ) {
18791         arg8 = 0;
18792       }
18793       else if ( PyArg_Parse( obj6,"i" ,&val8 ) ) {
18794         arg8 = (int *) &val8;
18795       }
18796       else {
18797         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
18798         SWIG_fail;
18799       }
18800     }
18801   }
18802   if (obj7) {
18803     {
18804       /* %typemap(in) (int *optional_##int) */
18805       if ( obj7 == Py_None ) {
18806         arg9 = 0;
18807       }
18808       else if ( PyArg_Parse( obj7,"i" ,&val9 ) ) {
18809         arg9 = (int *) &val9;
18810       }
18811       else {
18812         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
18813         SWIG_fail;
18814       }
18815     }
18816   }
18817   if (obj8) {
18818     {
18819       /* %typemap(in) (GDALDataType *optional_GDALDataType) */
18820       int intval = 0;
18821       if ( obj8 == Py_None ) {
18822         arg10 = NULL;
18823       }
18824       else if ( SWIG_IsOK(SWIG_AsVal_int(obj8, &intval)) ) {
18825         if( intval < GDT_Unknown || intval >= GDT_TypeCount )
18826         {
18827           SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
18828         }
18829         val10 = static_cast<GDALDataType>(intval);
18830         arg10 = &val10;
18831       }
18832       else {
18833         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
18834         SWIG_fail;
18835       }
18836     }
18837   }
18838   if (obj9) {
18839     {
18840       /* %typemap(in,numinputs=1) (int nList, int* pList)*/
18841       arg12 = CreateCIntListFromSequence(obj9, &arg11);
18842       if( arg11 < 0 ) {
18843         SWIG_fail;
18844       }
18845     }
18846   }
18847   if (obj10) {
18848     {
18849       /* %typemap(in) (GIntBig *optional_##GIntBig) */
18850       if ( obj10 == Py_None ) {
18851         arg13 = 0;
18852       }
18853       else if ( PyArg_Parse( obj10,"L" ,&val13 ) ) {
18854         arg13 = (GIntBig *) &val13;
18855       }
18856       else {
18857         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
18858         SWIG_fail;
18859       }
18860     }
18861   }
18862   if (obj11) {
18863     {
18864       /* %typemap(in) (GIntBig *optional_##GIntBig) */
18865       if ( obj11 == Py_None ) {
18866         arg14 = 0;
18867       }
18868       else if ( PyArg_Parse( obj11,"L" ,&val14 ) ) {
18869         arg14 = (GIntBig *) &val14;
18870       }
18871       else {
18872         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
18873         SWIG_fail;
18874       }
18875     }
18876   }
18877   if (obj12) {
18878     {
18879       /* %typemap(in) (GIntBig *optional_##GIntBig) */
18880       if ( obj12 == Py_None ) {
18881         arg15 = 0;
18882       }
18883       else if ( PyArg_Parse( obj12,"L" ,&val15 ) ) {
18884         arg15 = (GIntBig *) &val15;
18885       }
18886       else {
18887         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
18888         SWIG_fail;
18889       }
18890     }
18891   }
18892   {
18893     if ( bUseExceptions ) {
18894       ClearErrorState();
18895     }
18896     {
18897       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18898       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_WriteRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15));
18899       SWIG_PYTHON_THREAD_END_ALLOW;
18900     }
18901 #ifndef SED_HACKS
18902     if ( bUseExceptions ) {
18903       CPLErr eclass = CPLGetLastErrorType();
18904       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
18905         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
18906       }
18907     }
18908 #endif
18909   }
18910   resultobj = SWIG_From_int(static_cast< int >(result));
18911   {
18912     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
18913     if( viewIsValid6 ) {
18914       PyBuffer_Release(&view6);
18915     }
18916     else if (ReturnSame(alloc6) == SWIG_NEWOBJ ) {
18917       delete[] arg7;
18918     }
18919   }
18920   {
18921     /* %typemap(freearg) (int nList, int* pList) */
18922     free(arg12);
18923   }
18924   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
18925   return resultobj;
18926 fail:
18927   {
18928     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
18929     if( viewIsValid6 ) {
18930       PyBuffer_Release(&view6);
18931     }
18932     else if (ReturnSame(alloc6) == SWIG_NEWOBJ ) {
18933       delete[] arg7;
18934     }
18935   }
18936   {
18937     /* %typemap(freearg) (int nList, int* pList) */
18938     free(arg12);
18939   }
18940   return NULL;
18941 }
18942 
18943 
_wrap_Dataset_AdviseRead(PyObject * SWIGUNUSEDPARM (self),PyObject * args)18944 SWIGINTERN PyObject *_wrap_Dataset_AdviseRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
18945   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
18946   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
18947   int arg2 ;
18948   int arg3 ;
18949   int arg4 ;
18950   int arg5 ;
18951   int *arg6 = (int *) 0 ;
18952   int *arg7 = (int *) 0 ;
18953   GDALDataType *arg8 = (GDALDataType *) 0 ;
18954   int arg9 = (int) 0 ;
18955   int *arg10 = (int *) 0 ;
18956   char **arg11 = (char **) NULL ;
18957   void *argp1 = 0 ;
18958   int res1 = 0 ;
18959   int val2 ;
18960   int ecode2 = 0 ;
18961   int val3 ;
18962   int ecode3 = 0 ;
18963   int val4 ;
18964   int ecode4 = 0 ;
18965   int val5 ;
18966   int ecode5 = 0 ;
18967   void *argp6 = 0 ;
18968   int res6 = 0 ;
18969   void *argp7 = 0 ;
18970   int res7 = 0 ;
18971   int val8 ;
18972   PyObject * obj0 = 0 ;
18973   PyObject * obj1 = 0 ;
18974   PyObject * obj2 = 0 ;
18975   PyObject * obj3 = 0 ;
18976   PyObject * obj4 = 0 ;
18977   PyObject * obj5 = 0 ;
18978   PyObject * obj6 = 0 ;
18979   PyObject * obj7 = 0 ;
18980   PyObject * obj8 = 0 ;
18981   PyObject * obj9 = 0 ;
18982   CPLErr result;
18983 
18984   if (!PyArg_ParseTuple(args,(char *)"OOOOO|OOOOO:Dataset_AdviseRead",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
18985   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
18986   if (!SWIG_IsOK(res1)) {
18987     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_AdviseRead" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
18988   }
18989   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
18990   ecode2 = SWIG_AsVal_int(obj1, &val2);
18991   if (!SWIG_IsOK(ecode2)) {
18992     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_AdviseRead" "', argument " "2"" of type '" "int""'");
18993   }
18994   arg2 = static_cast< int >(val2);
18995   ecode3 = SWIG_AsVal_int(obj2, &val3);
18996   if (!SWIG_IsOK(ecode3)) {
18997     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_AdviseRead" "', argument " "3"" of type '" "int""'");
18998   }
18999   arg3 = static_cast< int >(val3);
19000   ecode4 = SWIG_AsVal_int(obj3, &val4);
19001   if (!SWIG_IsOK(ecode4)) {
19002     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_AdviseRead" "', argument " "4"" of type '" "int""'");
19003   }
19004   arg4 = static_cast< int >(val4);
19005   ecode5 = SWIG_AsVal_int(obj4, &val5);
19006   if (!SWIG_IsOK(ecode5)) {
19007     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset_AdviseRead" "', argument " "5"" of type '" "int""'");
19008   }
19009   arg5 = static_cast< int >(val5);
19010   if (obj5) {
19011     res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 |  0 );
19012     if (!SWIG_IsOK(res6)) {
19013       SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Dataset_AdviseRead" "', argument " "6"" of type '" "int *""'");
19014     }
19015     arg6 = reinterpret_cast< int * >(argp6);
19016   }
19017   if (obj6) {
19018     res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 |  0 );
19019     if (!SWIG_IsOK(res7)) {
19020       SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Dataset_AdviseRead" "', argument " "7"" of type '" "int *""'");
19021     }
19022     arg7 = reinterpret_cast< int * >(argp7);
19023   }
19024   if (obj7) {
19025     {
19026       /* %typemap(in) (int *optional_##int) */
19027       if ( obj7 == Py_None ) {
19028         arg8 = 0;
19029       }
19030       else if ( PyArg_Parse( obj7,"i" ,&val8 ) ) {
19031         arg8 = (GDALDataType *) &val8;
19032       }
19033       else {
19034         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
19035         SWIG_fail;
19036       }
19037     }
19038   }
19039   if (obj8) {
19040     {
19041       /* %typemap(in,numinputs=1) (int nList, int* pList)*/
19042       arg10 = CreateCIntListFromSequence(obj8, &arg9);
19043       if( arg9 < 0 ) {
19044         SWIG_fail;
19045       }
19046     }
19047   }
19048   if (obj9) {
19049     {
19050       /* %typemap(in) char **options */
19051       int bErr = FALSE;
19052       arg11 = CSLFromPySequence(obj9, &bErr);
19053       if( bErr )
19054       {
19055         SWIG_fail;
19056       }
19057     }
19058   }
19059   {
19060     if ( bUseExceptions ) {
19061       ClearErrorState();
19062     }
19063     {
19064       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19065       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_AdviseRead(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11));
19066       SWIG_PYTHON_THREAD_END_ALLOW;
19067     }
19068 #ifndef SED_HACKS
19069     if ( bUseExceptions ) {
19070       CPLErr eclass = CPLGetLastErrorType();
19071       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19072         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19073       }
19074     }
19075 #endif
19076   }
19077   resultobj = SWIG_From_int(static_cast< int >(result));
19078   {
19079     /* %typemap(freearg) (int nList, int* pList) */
19080     free(arg10);
19081   }
19082   {
19083     /* %typemap(freearg) char **options */
19084     CSLDestroy( arg11 );
19085   }
19086   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19087   return resultobj;
19088 fail:
19089   {
19090     /* %typemap(freearg) (int nList, int* pList) */
19091     free(arg10);
19092   }
19093   {
19094     /* %typemap(freearg) char **options */
19095     CSLDestroy( arg11 );
19096   }
19097   return NULL;
19098 }
19099 
19100 
_wrap_Dataset_BeginAsyncReader(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)19101 SWIGINTERN PyObject *_wrap_Dataset_BeginAsyncReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
19102   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19103   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19104   int arg2 ;
19105   int arg3 ;
19106   int arg4 ;
19107   int arg5 ;
19108   int arg6 ;
19109   char *arg7 = (char *) 0 ;
19110   void *arg8 = (void *) 0 ;
19111   int arg9 ;
19112   int arg10 ;
19113   GDALDataType arg11 = (GDALDataType) (GDALDataType) 0 ;
19114   int arg12 = (int) 0 ;
19115   int *arg13 = (int *) 0 ;
19116   int arg14 = (int) 0 ;
19117   int arg15 = (int) 0 ;
19118   int arg16 = (int) 0 ;
19119   char **arg17 = (char **) 0 ;
19120   void *argp1 = 0 ;
19121   int res1 = 0 ;
19122   int val2 ;
19123   int ecode2 = 0 ;
19124   int val3 ;
19125   int ecode3 = 0 ;
19126   int val4 ;
19127   int ecode4 = 0 ;
19128   int val5 ;
19129   int ecode5 = 0 ;
19130   int val9 ;
19131   int ecode9 = 0 ;
19132   int val10 ;
19133   int ecode10 = 0 ;
19134   int val14 ;
19135   int ecode14 = 0 ;
19136   int val15 ;
19137   int ecode15 = 0 ;
19138   int val16 ;
19139   int ecode16 = 0 ;
19140   PyObject * obj0 = 0 ;
19141   PyObject * obj1 = 0 ;
19142   PyObject * obj2 = 0 ;
19143   PyObject * obj3 = 0 ;
19144   PyObject * obj4 = 0 ;
19145   PyObject * obj5 = 0 ;
19146   PyObject * obj6 = 0 ;
19147   PyObject * obj7 = 0 ;
19148   PyObject * obj8 = 0 ;
19149   PyObject * obj9 = 0 ;
19150   PyObject * obj10 = 0 ;
19151   PyObject * obj11 = 0 ;
19152   PyObject * obj12 = 0 ;
19153   PyObject * obj13 = 0 ;
19154   char *  kwnames[] = {
19155     (char *) "self",(char *) "xOff",(char *) "yOff",(char *) "xSize",(char *) "ySize",(char *) "buf_len",(char *) "buf_xsize",(char *) "buf_ysize",(char *) "bufType",(char *) "band_list",(char *) "nPixelSpace",(char *) "nLineSpace",(char *) "nBandSpace",(char *) "options", NULL
19156   };
19157   GDALAsyncReaderShadow *result = 0 ;
19158 
19159   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOOOO|OOOOOO:Dataset_BeginAsyncReader",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13)) SWIG_fail;
19160   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19161   if (!SWIG_IsOK(res1)) {
19162     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_BeginAsyncReader" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19163   }
19164   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19165   ecode2 = SWIG_AsVal_int(obj1, &val2);
19166   if (!SWIG_IsOK(ecode2)) {
19167     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_BeginAsyncReader" "', argument " "2"" of type '" "int""'");
19168   }
19169   arg2 = static_cast< int >(val2);
19170   ecode3 = SWIG_AsVal_int(obj2, &val3);
19171   if (!SWIG_IsOK(ecode3)) {
19172     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_BeginAsyncReader" "', argument " "3"" of type '" "int""'");
19173   }
19174   arg3 = static_cast< int >(val3);
19175   ecode4 = SWIG_AsVal_int(obj3, &val4);
19176   if (!SWIG_IsOK(ecode4)) {
19177     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_BeginAsyncReader" "', argument " "4"" of type '" "int""'");
19178   }
19179   arg4 = static_cast< int >(val4);
19180   ecode5 = SWIG_AsVal_int(obj4, &val5);
19181   if (!SWIG_IsOK(ecode5)) {
19182     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset_BeginAsyncReader" "', argument " "5"" of type '" "int""'");
19183   }
19184   arg5 = static_cast< int >(val5);
19185   {
19186     /* %typemap(in,numinputs=1) (int nLenKeepObject, char *pBufKeepObject, void* pyObject) */
19187     if (PyBytes_Check(obj5))
19188     {
19189       Py_ssize_t safeLen = 0;
19190       PyBytes_AsStringAndSize(obj5, (char**) &arg7, &safeLen);
19191       arg6 = (int) safeLen;
19192       arg8 = obj5;
19193     }
19194     else
19195     {
19196       PyErr_SetString(PyExc_TypeError, "not a bytes");
19197       SWIG_fail;
19198     }
19199   }
19200   ecode9 = SWIG_AsVal_int(obj6, &val9);
19201   if (!SWIG_IsOK(ecode9)) {
19202     SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Dataset_BeginAsyncReader" "', argument " "9"" of type '" "int""'");
19203   }
19204   arg9 = static_cast< int >(val9);
19205   ecode10 = SWIG_AsVal_int(obj7, &val10);
19206   if (!SWIG_IsOK(ecode10)) {
19207     SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Dataset_BeginAsyncReader" "', argument " "10"" of type '" "int""'");
19208   }
19209   arg10 = static_cast< int >(val10);
19210   if (obj8) {
19211     {
19212       // %typemap(in) GDALDataType
19213       int val = 0;
19214       int ecode = SWIG_AsVal_int(obj8, &val);
19215       if (!SWIG_IsOK(ecode)) {
19216         SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
19217       }
19218       if( val < GDT_Unknown || val >= GDT_TypeCount )
19219       {
19220         SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
19221       }
19222       arg11 = static_cast<GDALDataType>(val);
19223     }
19224   }
19225   if (obj9) {
19226     {
19227       /* %typemap(in,numinputs=1) (int nList, int* pList)*/
19228       arg13 = CreateCIntListFromSequence(obj9, &arg12);
19229       if( arg12 < 0 ) {
19230         SWIG_fail;
19231       }
19232     }
19233   }
19234   if (obj10) {
19235     ecode14 = SWIG_AsVal_int(obj10, &val14);
19236     if (!SWIG_IsOK(ecode14)) {
19237       SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "Dataset_BeginAsyncReader" "', argument " "14"" of type '" "int""'");
19238     }
19239     arg14 = static_cast< int >(val14);
19240   }
19241   if (obj11) {
19242     ecode15 = SWIG_AsVal_int(obj11, &val15);
19243     if (!SWIG_IsOK(ecode15)) {
19244       SWIG_exception_fail(SWIG_ArgError(ecode15), "in method '" "Dataset_BeginAsyncReader" "', argument " "15"" of type '" "int""'");
19245     }
19246     arg15 = static_cast< int >(val15);
19247   }
19248   if (obj12) {
19249     ecode16 = SWIG_AsVal_int(obj12, &val16);
19250     if (!SWIG_IsOK(ecode16)) {
19251       SWIG_exception_fail(SWIG_ArgError(ecode16), "in method '" "Dataset_BeginAsyncReader" "', argument " "16"" of type '" "int""'");
19252     }
19253     arg16 = static_cast< int >(val16);
19254   }
19255   if (obj13) {
19256     {
19257       /* %typemap(in) char **options */
19258       int bErr = FALSE;
19259       arg17 = CSLFromPySequence(obj13, &bErr);
19260       if( bErr )
19261       {
19262         SWIG_fail;
19263       }
19264     }
19265   }
19266   {
19267     if ( bUseExceptions ) {
19268       ClearErrorState();
19269     }
19270     {
19271       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19272       result = (GDALAsyncReaderShadow *)GDALDatasetShadow_BeginAsyncReader(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17);
19273       SWIG_PYTHON_THREAD_END_ALLOW;
19274     }
19275 #ifndef SED_HACKS
19276     if ( bUseExceptions ) {
19277       CPLErr eclass = CPLGetLastErrorType();
19278       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19279         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19280       }
19281     }
19282 #endif
19283   }
19284   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAsyncReaderShadow, SWIG_POINTER_OWN |  0 );
19285   {
19286     /* %typemap(freearg) (int nList, int* pList) */
19287     free(arg13);
19288   }
19289   {
19290     /* %typemap(freearg) char **options */
19291     CSLDestroy( arg17 );
19292   }
19293   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19294   return resultobj;
19295 fail:
19296   {
19297     /* %typemap(freearg) (int nList, int* pList) */
19298     free(arg13);
19299   }
19300   {
19301     /* %typemap(freearg) char **options */
19302     CSLDestroy( arg17 );
19303   }
19304   return NULL;
19305 }
19306 
19307 
_wrap_Dataset_EndAsyncReader(PyObject * SWIGUNUSEDPARM (self),PyObject * args)19308 SWIGINTERN PyObject *_wrap_Dataset_EndAsyncReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19309   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19310   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19311   GDALAsyncReaderShadow *arg2 = (GDALAsyncReaderShadow *) 0 ;
19312   void *argp1 = 0 ;
19313   int res1 = 0 ;
19314   void *argp2 = 0 ;
19315   int res2 = 0 ;
19316   PyObject * obj0 = 0 ;
19317   PyObject * obj1 = 0 ;
19318 
19319   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_EndAsyncReader",&obj0,&obj1)) SWIG_fail;
19320   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19321   if (!SWIG_IsOK(res1)) {
19322     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_EndAsyncReader" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19323   }
19324   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19325   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALAsyncReaderShadow, 0 |  0 );
19326   if (!SWIG_IsOK(res2)) {
19327     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_EndAsyncReader" "', argument " "2"" of type '" "GDALAsyncReaderShadow *""'");
19328   }
19329   arg2 = reinterpret_cast< GDALAsyncReaderShadow * >(argp2);
19330   {
19331     if ( bUseExceptions ) {
19332       ClearErrorState();
19333     }
19334     {
19335       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19336       GDALDatasetShadow_EndAsyncReader(arg1,arg2);
19337       SWIG_PYTHON_THREAD_END_ALLOW;
19338     }
19339 #ifndef SED_HACKS
19340     if ( bUseExceptions ) {
19341       CPLErr eclass = CPLGetLastErrorType();
19342       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19343         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19344       }
19345     }
19346 #endif
19347   }
19348   resultobj = SWIG_Py_Void();
19349   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19350   return resultobj;
19351 fail:
19352   return NULL;
19353 }
19354 
19355 
_wrap_Dataset_GetVirtualMem(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)19356 SWIGINTERN PyObject *_wrap_Dataset_GetVirtualMem(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
19357   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19358   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19359   GDALRWFlag arg2 ;
19360   int arg3 ;
19361   int arg4 ;
19362   int arg5 ;
19363   int arg6 ;
19364   int arg7 ;
19365   int arg8 ;
19366   GDALDataType arg9 ;
19367   int arg10 ;
19368   int *arg11 = (int *) 0 ;
19369   int arg12 ;
19370   size_t arg13 ;
19371   size_t arg14 ;
19372   char **arg15 = (char **) NULL ;
19373   void *argp1 = 0 ;
19374   int res1 = 0 ;
19375   int val2 ;
19376   int ecode2 = 0 ;
19377   int val3 ;
19378   int ecode3 = 0 ;
19379   int val4 ;
19380   int ecode4 = 0 ;
19381   int val5 ;
19382   int ecode5 = 0 ;
19383   int val6 ;
19384   int ecode6 = 0 ;
19385   int val7 ;
19386   int ecode7 = 0 ;
19387   int val8 ;
19388   int ecode8 = 0 ;
19389   int val12 ;
19390   int ecode12 = 0 ;
19391   size_t val13 ;
19392   int ecode13 = 0 ;
19393   size_t val14 ;
19394   int ecode14 = 0 ;
19395   PyObject * obj0 = 0 ;
19396   PyObject * obj1 = 0 ;
19397   PyObject * obj2 = 0 ;
19398   PyObject * obj3 = 0 ;
19399   PyObject * obj4 = 0 ;
19400   PyObject * obj5 = 0 ;
19401   PyObject * obj6 = 0 ;
19402   PyObject * obj7 = 0 ;
19403   PyObject * obj8 = 0 ;
19404   PyObject * obj9 = 0 ;
19405   PyObject * obj10 = 0 ;
19406   PyObject * obj11 = 0 ;
19407   PyObject * obj12 = 0 ;
19408   PyObject * obj13 = 0 ;
19409   char *  kwnames[] = {
19410     (char *) "self",(char *) "eRWFlag",(char *) "nXOff",(char *) "nYOff",(char *) "nXSize",(char *) "nYSize",(char *) "nBufXSize",(char *) "nBufYSize",(char *) "eBufType",(char *) "band_list",(char *) "bIsBandSequential",(char *) "nCacheSize",(char *) "nPageSizeHint",(char *) "options", NULL
19411   };
19412   CPLVirtualMemShadow *result = 0 ;
19413 
19414   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOOOOOOOOO|O:Dataset_GetVirtualMem",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13)) SWIG_fail;
19415   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19416   if (!SWIG_IsOK(res1)) {
19417     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetVirtualMem" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19418   }
19419   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19420   ecode2 = SWIG_AsVal_int(obj1, &val2);
19421   if (!SWIG_IsOK(ecode2)) {
19422     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_GetVirtualMem" "', argument " "2"" of type '" "GDALRWFlag""'");
19423   }
19424   arg2 = static_cast< GDALRWFlag >(val2);
19425   ecode3 = SWIG_AsVal_int(obj2, &val3);
19426   if (!SWIG_IsOK(ecode3)) {
19427     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_GetVirtualMem" "', argument " "3"" of type '" "int""'");
19428   }
19429   arg3 = static_cast< int >(val3);
19430   ecode4 = SWIG_AsVal_int(obj3, &val4);
19431   if (!SWIG_IsOK(ecode4)) {
19432     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_GetVirtualMem" "', argument " "4"" of type '" "int""'");
19433   }
19434   arg4 = static_cast< int >(val4);
19435   ecode5 = SWIG_AsVal_int(obj4, &val5);
19436   if (!SWIG_IsOK(ecode5)) {
19437     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset_GetVirtualMem" "', argument " "5"" of type '" "int""'");
19438   }
19439   arg5 = static_cast< int >(val5);
19440   ecode6 = SWIG_AsVal_int(obj5, &val6);
19441   if (!SWIG_IsOK(ecode6)) {
19442     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Dataset_GetVirtualMem" "', argument " "6"" of type '" "int""'");
19443   }
19444   arg6 = static_cast< int >(val6);
19445   ecode7 = SWIG_AsVal_int(obj6, &val7);
19446   if (!SWIG_IsOK(ecode7)) {
19447     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Dataset_GetVirtualMem" "', argument " "7"" of type '" "int""'");
19448   }
19449   arg7 = static_cast< int >(val7);
19450   ecode8 = SWIG_AsVal_int(obj7, &val8);
19451   if (!SWIG_IsOK(ecode8)) {
19452     SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Dataset_GetVirtualMem" "', argument " "8"" of type '" "int""'");
19453   }
19454   arg8 = static_cast< int >(val8);
19455   {
19456     // %typemap(in) GDALDataType
19457     int val = 0;
19458     int ecode = SWIG_AsVal_int(obj8, &val);
19459     if (!SWIG_IsOK(ecode)) {
19460       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
19461     }
19462     if( val < GDT_Unknown || val >= GDT_TypeCount )
19463     {
19464       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
19465     }
19466     arg9 = static_cast<GDALDataType>(val);
19467   }
19468   {
19469     /* %typemap(in,numinputs=1) (int nList, int* pList)*/
19470     arg11 = CreateCIntListFromSequence(obj9, &arg10);
19471     if( arg10 < 0 ) {
19472       SWIG_fail;
19473     }
19474   }
19475   ecode12 = SWIG_AsVal_int(obj10, &val12);
19476   if (!SWIG_IsOK(ecode12)) {
19477     SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "Dataset_GetVirtualMem" "', argument " "12"" of type '" "int""'");
19478   }
19479   arg12 = static_cast< int >(val12);
19480   ecode13 = SWIG_AsVal_size_t(obj11, &val13);
19481   if (!SWIG_IsOK(ecode13)) {
19482     SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "Dataset_GetVirtualMem" "', argument " "13"" of type '" "size_t""'");
19483   }
19484   arg13 = static_cast< size_t >(val13);
19485   ecode14 = SWIG_AsVal_size_t(obj12, &val14);
19486   if (!SWIG_IsOK(ecode14)) {
19487     SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "Dataset_GetVirtualMem" "', argument " "14"" of type '" "size_t""'");
19488   }
19489   arg14 = static_cast< size_t >(val14);
19490   if (obj13) {
19491     {
19492       /* %typemap(in) char **options */
19493       int bErr = FALSE;
19494       arg15 = CSLFromPySequence(obj13, &bErr);
19495       if( bErr )
19496       {
19497         SWIG_fail;
19498       }
19499     }
19500   }
19501   {
19502     if ( bUseExceptions ) {
19503       ClearErrorState();
19504     }
19505     {
19506       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19507       result = (CPLVirtualMemShadow *)GDALDatasetShadow_GetVirtualMem(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15);
19508       SWIG_PYTHON_THREAD_END_ALLOW;
19509     }
19510 #ifndef SED_HACKS
19511     if ( bUseExceptions ) {
19512       CPLErr eclass = CPLGetLastErrorType();
19513       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19514         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19515       }
19516     }
19517 #endif
19518   }
19519   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CPLVirtualMemShadow, SWIG_POINTER_OWN |  0 );
19520   {
19521     /* %typemap(freearg) (int nList, int* pList) */
19522     free(arg11);
19523   }
19524   {
19525     /* %typemap(freearg) char **options */
19526     CSLDestroy( arg15 );
19527   }
19528   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19529   return resultobj;
19530 fail:
19531   {
19532     /* %typemap(freearg) (int nList, int* pList) */
19533     free(arg11);
19534   }
19535   {
19536     /* %typemap(freearg) char **options */
19537     CSLDestroy( arg15 );
19538   }
19539   return NULL;
19540 }
19541 
19542 
_wrap_Dataset_GetTiledVirtualMem(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)19543 SWIGINTERN PyObject *_wrap_Dataset_GetTiledVirtualMem(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
19544   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19545   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19546   GDALRWFlag arg2 ;
19547   int arg3 ;
19548   int arg4 ;
19549   int arg5 ;
19550   int arg6 ;
19551   int arg7 ;
19552   int arg8 ;
19553   GDALDataType arg9 ;
19554   int arg10 ;
19555   int *arg11 = (int *) 0 ;
19556   GDALTileOrganization arg12 ;
19557   size_t arg13 ;
19558   char **arg14 = (char **) NULL ;
19559   void *argp1 = 0 ;
19560   int res1 = 0 ;
19561   int val2 ;
19562   int ecode2 = 0 ;
19563   int val3 ;
19564   int ecode3 = 0 ;
19565   int val4 ;
19566   int ecode4 = 0 ;
19567   int val5 ;
19568   int ecode5 = 0 ;
19569   int val6 ;
19570   int ecode6 = 0 ;
19571   int val7 ;
19572   int ecode7 = 0 ;
19573   int val8 ;
19574   int ecode8 = 0 ;
19575   int val12 ;
19576   int ecode12 = 0 ;
19577   size_t val13 ;
19578   int ecode13 = 0 ;
19579   PyObject * obj0 = 0 ;
19580   PyObject * obj1 = 0 ;
19581   PyObject * obj2 = 0 ;
19582   PyObject * obj3 = 0 ;
19583   PyObject * obj4 = 0 ;
19584   PyObject * obj5 = 0 ;
19585   PyObject * obj6 = 0 ;
19586   PyObject * obj7 = 0 ;
19587   PyObject * obj8 = 0 ;
19588   PyObject * obj9 = 0 ;
19589   PyObject * obj10 = 0 ;
19590   PyObject * obj11 = 0 ;
19591   PyObject * obj12 = 0 ;
19592   char *  kwnames[] = {
19593     (char *) "self",(char *) "eRWFlag",(char *) "nXOff",(char *) "nYOff",(char *) "nXSize",(char *) "nYSize",(char *) "nTileXSize",(char *) "nTileYSize",(char *) "eBufType",(char *) "band_list",(char *) "eTileOrganization",(char *) "nCacheSize",(char *) "options", NULL
19594   };
19595   CPLVirtualMemShadow *result = 0 ;
19596 
19597   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOOOOOOOO|O:Dataset_GetTiledVirtualMem",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12)) SWIG_fail;
19598   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19599   if (!SWIG_IsOK(res1)) {
19600     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19601   }
19602   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19603   ecode2 = SWIG_AsVal_int(obj1, &val2);
19604   if (!SWIG_IsOK(ecode2)) {
19605     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "2"" of type '" "GDALRWFlag""'");
19606   }
19607   arg2 = static_cast< GDALRWFlag >(val2);
19608   ecode3 = SWIG_AsVal_int(obj2, &val3);
19609   if (!SWIG_IsOK(ecode3)) {
19610     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "3"" of type '" "int""'");
19611   }
19612   arg3 = static_cast< int >(val3);
19613   ecode4 = SWIG_AsVal_int(obj3, &val4);
19614   if (!SWIG_IsOK(ecode4)) {
19615     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "4"" of type '" "int""'");
19616   }
19617   arg4 = static_cast< int >(val4);
19618   ecode5 = SWIG_AsVal_int(obj4, &val5);
19619   if (!SWIG_IsOK(ecode5)) {
19620     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "5"" of type '" "int""'");
19621   }
19622   arg5 = static_cast< int >(val5);
19623   ecode6 = SWIG_AsVal_int(obj5, &val6);
19624   if (!SWIG_IsOK(ecode6)) {
19625     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "6"" of type '" "int""'");
19626   }
19627   arg6 = static_cast< int >(val6);
19628   ecode7 = SWIG_AsVal_int(obj6, &val7);
19629   if (!SWIG_IsOK(ecode7)) {
19630     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "7"" of type '" "int""'");
19631   }
19632   arg7 = static_cast< int >(val7);
19633   ecode8 = SWIG_AsVal_int(obj7, &val8);
19634   if (!SWIG_IsOK(ecode8)) {
19635     SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "8"" of type '" "int""'");
19636   }
19637   arg8 = static_cast< int >(val8);
19638   {
19639     // %typemap(in) GDALDataType
19640     int val = 0;
19641     int ecode = SWIG_AsVal_int(obj8, &val);
19642     if (!SWIG_IsOK(ecode)) {
19643       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
19644     }
19645     if( val < GDT_Unknown || val >= GDT_TypeCount )
19646     {
19647       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
19648     }
19649     arg9 = static_cast<GDALDataType>(val);
19650   }
19651   {
19652     /* %typemap(in,numinputs=1) (int nList, int* pList)*/
19653     arg11 = CreateCIntListFromSequence(obj9, &arg10);
19654     if( arg10 < 0 ) {
19655       SWIG_fail;
19656     }
19657   }
19658   ecode12 = SWIG_AsVal_int(obj10, &val12);
19659   if (!SWIG_IsOK(ecode12)) {
19660     SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "12"" of type '" "GDALTileOrganization""'");
19661   }
19662   arg12 = static_cast< GDALTileOrganization >(val12);
19663   ecode13 = SWIG_AsVal_size_t(obj11, &val13);
19664   if (!SWIG_IsOK(ecode13)) {
19665     SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "Dataset_GetTiledVirtualMem" "', argument " "13"" of type '" "size_t""'");
19666   }
19667   arg13 = static_cast< size_t >(val13);
19668   if (obj12) {
19669     {
19670       /* %typemap(in) char **options */
19671       int bErr = FALSE;
19672       arg14 = CSLFromPySequence(obj12, &bErr);
19673       if( bErr )
19674       {
19675         SWIG_fail;
19676       }
19677     }
19678   }
19679   {
19680     if ( bUseExceptions ) {
19681       ClearErrorState();
19682     }
19683     {
19684       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19685       result = (CPLVirtualMemShadow *)GDALDatasetShadow_GetTiledVirtualMem(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14);
19686       SWIG_PYTHON_THREAD_END_ALLOW;
19687     }
19688 #ifndef SED_HACKS
19689     if ( bUseExceptions ) {
19690       CPLErr eclass = CPLGetLastErrorType();
19691       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19692         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19693       }
19694     }
19695 #endif
19696   }
19697   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CPLVirtualMemShadow, SWIG_POINTER_OWN |  0 );
19698   {
19699     /* %typemap(freearg) (int nList, int* pList) */
19700     free(arg11);
19701   }
19702   {
19703     /* %typemap(freearg) char **options */
19704     CSLDestroy( arg14 );
19705   }
19706   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19707   return resultobj;
19708 fail:
19709   {
19710     /* %typemap(freearg) (int nList, int* pList) */
19711     free(arg11);
19712   }
19713   {
19714     /* %typemap(freearg) char **options */
19715     CSLDestroy( arg14 );
19716   }
19717   return NULL;
19718 }
19719 
19720 
_wrap_Dataset_CreateLayer(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)19721 SWIGINTERN PyObject *_wrap_Dataset_CreateLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
19722   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19723   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19724   char *arg2 = (char *) 0 ;
19725   OSRSpatialReferenceShadow *arg3 = (OSRSpatialReferenceShadow *) NULL ;
19726   OGRwkbGeometryType arg4 = (OGRwkbGeometryType) wkbUnknown ;
19727   char **arg5 = (char **) 0 ;
19728   void *argp1 = 0 ;
19729   int res1 = 0 ;
19730   int res2 ;
19731   char *buf2 = 0 ;
19732   int alloc2 = 0 ;
19733   void *argp3 = 0 ;
19734   int res3 = 0 ;
19735   int val4 ;
19736   int ecode4 = 0 ;
19737   PyObject * obj0 = 0 ;
19738   PyObject * obj1 = 0 ;
19739   PyObject * obj2 = 0 ;
19740   PyObject * obj3 = 0 ;
19741   PyObject * obj4 = 0 ;
19742   char *  kwnames[] = {
19743     (char *) "self",(char *) "name",(char *) "srs",(char *) "geom_type",(char *) "options", NULL
19744   };
19745   OGRLayerShadow *result = 0 ;
19746 
19747   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOO:Dataset_CreateLayer",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
19748   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19749   if (!SWIG_IsOK(res1)) {
19750     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_CreateLayer" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19751   }
19752   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19753   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
19754   if (!SWIG_IsOK(res2)) {
19755     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_CreateLayer" "', argument " "2"" of type '" "char const *""'");
19756   }
19757   arg2 = reinterpret_cast< char * >(buf2);
19758   if (obj2) {
19759     res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
19760     if (!SWIG_IsOK(res3)) {
19761       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Dataset_CreateLayer" "', argument " "3"" of type '" "OSRSpatialReferenceShadow *""'");
19762     }
19763     arg3 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp3);
19764   }
19765   if (obj3) {
19766     ecode4 = SWIG_AsVal_int(obj3, &val4);
19767     if (!SWIG_IsOK(ecode4)) {
19768       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_CreateLayer" "', argument " "4"" of type '" "OGRwkbGeometryType""'");
19769     }
19770     arg4 = static_cast< OGRwkbGeometryType >(val4);
19771   }
19772   if (obj4) {
19773     {
19774       /* %typemap(in) char **options */
19775       int bErr = FALSE;
19776       arg5 = CSLFromPySequence(obj4, &bErr);
19777       if( bErr )
19778       {
19779         SWIG_fail;
19780       }
19781     }
19782   }
19783   {
19784     if ( bUseExceptions ) {
19785       ClearErrorState();
19786     }
19787     {
19788       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19789       result = (OGRLayerShadow *)GDALDatasetShadow_CreateLayer(arg1,(char const *)arg2,arg3,arg4,arg5);
19790       SWIG_PYTHON_THREAD_END_ALLOW;
19791     }
19792 #ifndef SED_HACKS
19793     if ( bUseExceptions ) {
19794       CPLErr eclass = CPLGetLastErrorType();
19795       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19796         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19797       }
19798     }
19799 #endif
19800   }
19801   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
19802   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19803   {
19804     /* %typemap(freearg) char **options */
19805     CSLDestroy( arg5 );
19806   }
19807   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19808   return resultobj;
19809 fail:
19810   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
19811   {
19812     /* %typemap(freearg) char **options */
19813     CSLDestroy( arg5 );
19814   }
19815   return NULL;
19816 }
19817 
19818 
_wrap_Dataset_CopyLayer(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)19819 SWIGINTERN PyObject *_wrap_Dataset_CopyLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
19820   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19821   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19822   OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
19823   char *arg3 = (char *) 0 ;
19824   char **arg4 = (char **) 0 ;
19825   void *argp1 = 0 ;
19826   int res1 = 0 ;
19827   void *argp2 = 0 ;
19828   int res2 = 0 ;
19829   int res3 ;
19830   char *buf3 = 0 ;
19831   int alloc3 = 0 ;
19832   PyObject * obj0 = 0 ;
19833   PyObject * obj1 = 0 ;
19834   PyObject * obj2 = 0 ;
19835   PyObject * obj3 = 0 ;
19836   char *  kwnames[] = {
19837     (char *) "self",(char *) "src_layer",(char *) "new_name",(char *) "options", NULL
19838   };
19839   OGRLayerShadow *result = 0 ;
19840 
19841   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Dataset_CopyLayer",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
19842   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19843   if (!SWIG_IsOK(res1)) {
19844     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_CopyLayer" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19845   }
19846   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19847   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
19848   if (!SWIG_IsOK(res2)) {
19849     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_CopyLayer" "', argument " "2"" of type '" "OGRLayerShadow *""'");
19850   }
19851   arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
19852   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
19853   if (!SWIG_IsOK(res3)) {
19854     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Dataset_CopyLayer" "', argument " "3"" of type '" "char const *""'");
19855   }
19856   arg3 = reinterpret_cast< char * >(buf3);
19857   if (obj3) {
19858     {
19859       /* %typemap(in) char **options */
19860       int bErr = FALSE;
19861       arg4 = CSLFromPySequence(obj3, &bErr);
19862       if( bErr )
19863       {
19864         SWIG_fail;
19865       }
19866     }
19867   }
19868   {
19869     if (!arg2) {
19870       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19871     }
19872   }
19873   {
19874     if ( bUseExceptions ) {
19875       ClearErrorState();
19876     }
19877     {
19878       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19879       result = (OGRLayerShadow *)GDALDatasetShadow_CopyLayer(arg1,arg2,(char const *)arg3,arg4);
19880       SWIG_PYTHON_THREAD_END_ALLOW;
19881     }
19882 #ifndef SED_HACKS
19883     if ( bUseExceptions ) {
19884       CPLErr eclass = CPLGetLastErrorType();
19885       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19886         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19887       }
19888     }
19889 #endif
19890   }
19891   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
19892   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
19893   {
19894     /* %typemap(freearg) char **options */
19895     CSLDestroy( arg4 );
19896   }
19897   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19898   return resultobj;
19899 fail:
19900   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
19901   {
19902     /* %typemap(freearg) char **options */
19903     CSLDestroy( arg4 );
19904   }
19905   return NULL;
19906 }
19907 
19908 
_wrap_Dataset_DeleteLayer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)19909 SWIGINTERN PyObject *_wrap_Dataset_DeleteLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19910   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19911   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19912   int arg2 ;
19913   void *argp1 = 0 ;
19914   int res1 = 0 ;
19915   int val2 ;
19916   int ecode2 = 0 ;
19917   PyObject * obj0 = 0 ;
19918   PyObject * obj1 = 0 ;
19919   OGRErr result;
19920 
19921   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_DeleteLayer",&obj0,&obj1)) SWIG_fail;
19922   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19923   if (!SWIG_IsOK(res1)) {
19924     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_DeleteLayer" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19925   }
19926   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19927   ecode2 = SWIG_AsVal_int(obj1, &val2);
19928   if (!SWIG_IsOK(ecode2)) {
19929     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_DeleteLayer" "', argument " "2"" of type '" "int""'");
19930   }
19931   arg2 = static_cast< int >(val2);
19932   {
19933     if ( bUseExceptions ) {
19934       ClearErrorState();
19935     }
19936     {
19937       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19938       result = (OGRErr)GDALDatasetShadow_DeleteLayer(arg1,arg2);
19939       SWIG_PYTHON_THREAD_END_ALLOW;
19940     }
19941 #ifndef SED_HACKS
19942     if ( bUseExceptions ) {
19943       CPLErr eclass = CPLGetLastErrorType();
19944       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
19945         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
19946       }
19947     }
19948 #endif
19949   }
19950   {
19951     /* %typemap(out) OGRErr */
19952     if ( result != 0 && bUseExceptions) {
19953       const char* pszMessage = CPLGetLastErrorMsg();
19954       if( pszMessage[0] != '\0' )
19955       PyErr_SetString( PyExc_RuntimeError, pszMessage );
19956       else
19957       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
19958       SWIG_fail;
19959     }
19960   }
19961   {
19962     /* %typemap(ret) OGRErr */
19963     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
19964       resultobj = PyInt_FromLong( result );
19965     }
19966   }
19967   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
19968   return resultobj;
19969 fail:
19970   return NULL;
19971 }
19972 
19973 
_wrap_Dataset_GetLayerCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)19974 SWIGINTERN PyObject *_wrap_Dataset_GetLayerCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
19975   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
19976   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
19977   void *argp1 = 0 ;
19978   int res1 = 0 ;
19979   PyObject * obj0 = 0 ;
19980   int result;
19981 
19982   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetLayerCount",&obj0)) SWIG_fail;
19983   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
19984   if (!SWIG_IsOK(res1)) {
19985     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetLayerCount" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
19986   }
19987   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
19988   {
19989     if ( bUseExceptions ) {
19990       ClearErrorState();
19991     }
19992     {
19993       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19994       result = (int)GDALDatasetShadow_GetLayerCount(arg1);
19995       SWIG_PYTHON_THREAD_END_ALLOW;
19996     }
19997 #ifndef SED_HACKS
19998     if ( bUseExceptions ) {
19999       CPLErr eclass = CPLGetLastErrorType();
20000       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20001         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20002       }
20003     }
20004 #endif
20005   }
20006   resultobj = SWIG_From_int(static_cast< int >(result));
20007   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20008   return resultobj;
20009 fail:
20010   return NULL;
20011 }
20012 
20013 
_wrap_Dataset_GetLayerByIndex(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20014 SWIGINTERN PyObject *_wrap_Dataset_GetLayerByIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20015   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20016   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20017   int arg2 = (int) 0 ;
20018   void *argp1 = 0 ;
20019   int res1 = 0 ;
20020   int val2 ;
20021   int ecode2 = 0 ;
20022   PyObject * obj0 = 0 ;
20023   PyObject * obj1 = 0 ;
20024   OGRLayerShadow *result = 0 ;
20025 
20026   if (!PyArg_ParseTuple(args,(char *)"O|O:Dataset_GetLayerByIndex",&obj0,&obj1)) SWIG_fail;
20027   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20028   if (!SWIG_IsOK(res1)) {
20029     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetLayerByIndex" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20030   }
20031   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20032   if (obj1) {
20033     ecode2 = SWIG_AsVal_int(obj1, &val2);
20034     if (!SWIG_IsOK(ecode2)) {
20035       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_GetLayerByIndex" "', argument " "2"" of type '" "int""'");
20036     }
20037     arg2 = static_cast< int >(val2);
20038   }
20039   {
20040     if ( bUseExceptions ) {
20041       ClearErrorState();
20042     }
20043     {
20044       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20045       result = (OGRLayerShadow *)GDALDatasetShadow_GetLayerByIndex(arg1,arg2);
20046       SWIG_PYTHON_THREAD_END_ALLOW;
20047     }
20048 #ifndef SED_HACKS
20049     if ( bUseExceptions ) {
20050       CPLErr eclass = CPLGetLastErrorType();
20051       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20052         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20053       }
20054     }
20055 #endif
20056   }
20057   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
20058   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20059   return resultobj;
20060 fail:
20061   return NULL;
20062 }
20063 
20064 
_wrap_Dataset_GetLayerByName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20065 SWIGINTERN PyObject *_wrap_Dataset_GetLayerByName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20066   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20067   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20068   char *arg2 = (char *) 0 ;
20069   void *argp1 = 0 ;
20070   int res1 = 0 ;
20071   int res2 ;
20072   char *buf2 = 0 ;
20073   int alloc2 = 0 ;
20074   PyObject * obj0 = 0 ;
20075   PyObject * obj1 = 0 ;
20076   OGRLayerShadow *result = 0 ;
20077 
20078   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_GetLayerByName",&obj0,&obj1)) SWIG_fail;
20079   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20080   if (!SWIG_IsOK(res1)) {
20081     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetLayerByName" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20082   }
20083   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20084   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
20085   if (!SWIG_IsOK(res2)) {
20086     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_GetLayerByName" "', argument " "2"" of type '" "char const *""'");
20087   }
20088   arg2 = reinterpret_cast< char * >(buf2);
20089   {
20090     if ( bUseExceptions ) {
20091       ClearErrorState();
20092     }
20093     {
20094       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20095       result = (OGRLayerShadow *)GDALDatasetShadow_GetLayerByName(arg1,(char const *)arg2);
20096       SWIG_PYTHON_THREAD_END_ALLOW;
20097     }
20098 #ifndef SED_HACKS
20099     if ( bUseExceptions ) {
20100       CPLErr eclass = CPLGetLastErrorType();
20101       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20102         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20103       }
20104     }
20105 #endif
20106   }
20107   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
20108   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20109   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20110   return resultobj;
20111 fail:
20112   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20113   return NULL;
20114 }
20115 
20116 
_wrap_Dataset_ResetReading(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20117 SWIGINTERN PyObject *_wrap_Dataset_ResetReading(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20118   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20119   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20120   void *argp1 = 0 ;
20121   int res1 = 0 ;
20122   PyObject * obj0 = 0 ;
20123 
20124   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_ResetReading",&obj0)) SWIG_fail;
20125   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20126   if (!SWIG_IsOK(res1)) {
20127     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_ResetReading" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20128   }
20129   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20130   {
20131     if ( bUseExceptions ) {
20132       ClearErrorState();
20133     }
20134     {
20135       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20136       GDALDatasetShadow_ResetReading(arg1);
20137       SWIG_PYTHON_THREAD_END_ALLOW;
20138     }
20139 #ifndef SED_HACKS
20140     if ( bUseExceptions ) {
20141       CPLErr eclass = CPLGetLastErrorType();
20142       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20143         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20144       }
20145     }
20146 #endif
20147   }
20148   resultobj = SWIG_Py_Void();
20149   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20150   return resultobj;
20151 fail:
20152   return NULL;
20153 }
20154 
20155 
_wrap_Dataset_GetNextFeature(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)20156 SWIGINTERN PyObject *_wrap_Dataset_GetNextFeature(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
20157   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20158   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20159   bool arg2 = (bool) true ;
20160   bool arg3 = (bool) false ;
20161   OGRLayerShadow **arg4 = (OGRLayerShadow **) NULL ;
20162   double *arg5 = (double *) NULL ;
20163   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
20164   void *arg7 = (void *) NULL ;
20165   void *argp1 = 0 ;
20166   int res1 = 0 ;
20167   bool val2 ;
20168   int ecode2 = 0 ;
20169   bool val3 ;
20170   int ecode3 = 0 ;
20171   OGRLayerShadow *poBelongingLayer4 = NULL ;
20172   double dfProgressPct4 = 0 ;
20173   PyObject * obj0 = 0 ;
20174   PyObject * obj1 = 0 ;
20175   PyObject * obj2 = 0 ;
20176   PyObject * obj3 = 0 ;
20177   PyObject * obj4 = 0 ;
20178   char *  kwnames[] = {
20179     (char *) "self",(char *) "include_layer",(char *) "include_pct",(char *) "callback",(char *) "callback_data", NULL
20180   };
20181   OGRFeatureShadow *result = 0 ;
20182 
20183   /* %typemap(arginit) ( const char* callback_data=NULL)  */
20184   PyProgressData *psProgressInfo;
20185   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
20186   psProgressInfo->nLastReported = -1;
20187   psProgressInfo->psPyCallback = NULL;
20188   psProgressInfo->psPyCallbackData = NULL;
20189   arg7 = psProgressInfo;
20190   {
20191     /* %typemap(in) (OGRLayerShadow** ppoBelongingLayer, double* pdfProgressPct)  */
20192     arg4 = &poBelongingLayer4;
20193     arg5 = &dfProgressPct4;
20194   }
20195   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:Dataset_GetNextFeature",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
20196   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20197   if (!SWIG_IsOK(res1)) {
20198     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetNextFeature" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20199   }
20200   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20201   if (obj1) {
20202     ecode2 = SWIG_AsVal_bool(obj1, &val2);
20203     if (!SWIG_IsOK(ecode2)) {
20204       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_GetNextFeature" "', argument " "2"" of type '" "bool""'");
20205     }
20206     arg2 = static_cast< bool >(val2);
20207   }
20208   if (obj2) {
20209     ecode3 = SWIG_AsVal_bool(obj2, &val3);
20210     if (!SWIG_IsOK(ecode3)) {
20211       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_GetNextFeature" "', argument " "3"" of type '" "bool""'");
20212     }
20213     arg3 = static_cast< bool >(val3);
20214   }
20215   if (obj3) {
20216     {
20217       /* %typemap(in) (GDALProgressFunc callback = NULL) */
20218       /* callback_func typemap */
20219 
20220       /* In some cases 0 is passed instead of None. */
20221       /* See https://github.com/OSGeo/gdal/pull/219 */
20222       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
20223       {
20224         if( PyLong_AsLong(obj3) == 0 )
20225         {
20226           obj3 = Py_None;
20227         }
20228       }
20229 
20230       if (obj3 && obj3 != Py_None ) {
20231         void* cbfunction = NULL;
20232         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
20233             (void**)&cbfunction,
20234             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
20235             SWIG_POINTER_EXCEPTION | 0 ));
20236 
20237         if ( cbfunction == GDALTermProgress ) {
20238           arg6 = GDALTermProgress;
20239         } else {
20240           if (!PyCallable_Check(obj3)) {
20241             PyErr_SetString( PyExc_RuntimeError,
20242               "Object given is not a Python function" );
20243             SWIG_fail;
20244           }
20245           psProgressInfo->psPyCallback = obj3;
20246           arg6 = PyProgressProxy;
20247         }
20248 
20249       }
20250 
20251     }
20252   }
20253   if (obj4) {
20254     {
20255       /* %typemap(in) ( void* callback_data=NULL)  */
20256       psProgressInfo->psPyCallbackData = obj4 ;
20257     }
20258   }
20259   {
20260     /* %typemap(check) (OGRLayerShadow** ppoBelongingLayer, double* pdfProgressPct)  */
20261     if( !arg3 )
20262     arg5 = NULL;
20263   }
20264   {
20265     if ( bUseExceptions ) {
20266       ClearErrorState();
20267     }
20268     {
20269       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20270       result = (OGRFeatureShadow *)GDALDatasetShadow_GetNextFeature(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
20271       SWIG_PYTHON_THREAD_END_ALLOW;
20272     }
20273 #ifndef SED_HACKS
20274     if ( bUseExceptions ) {
20275       CPLErr eclass = CPLGetLastErrorType();
20276       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20277         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20278       }
20279     }
20280 #endif
20281   }
20282   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFeatureShadow, SWIG_POINTER_OWN |  0 );
20283   {
20284     /* %typemap(argout) (OGRLayerShadow** ppoBelongingLayer, double* pdfProgressPct)  */
20285 
20286     if( arg2 )
20287     {
20288       if( resultobj == Py_None )
20289       {
20290         resultobj = PyList_New(1);
20291         PyList_SetItem(resultobj, 0, Py_None);
20292       }
20293 
20294       if ( !*arg4 ) {
20295         Py_INCREF(Py_None);
20296         resultobj = SWIG_Python_AppendOutput(resultobj, Py_None);
20297       }
20298       else {
20299         resultobj = SWIG_Python_AppendOutput(resultobj,
20300           SWIG_NewPointerObj(SWIG_as_voidptr( *arg4), SWIGTYPE_p_OGRLayerShadow, 0 ));
20301       }
20302     }
20303 
20304     if( arg3 )
20305     {
20306       if( resultobj == Py_None )
20307       {
20308         resultobj = PyList_New(1);
20309         PyList_SetItem(resultobj, 0, Py_None);
20310       }
20311       resultobj = SWIG_Python_AppendOutput(resultobj, PyFloat_FromDouble( *arg5));
20312     }
20313 
20314   }
20315   {
20316     /* %typemap(freearg) ( void* callback_data=NULL)  */
20317 
20318     CPLFree(psProgressInfo);
20319 
20320   }
20321   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20322   return resultobj;
20323 fail:
20324   {
20325     /* %typemap(freearg) ( void* callback_data=NULL)  */
20326 
20327     CPLFree(psProgressInfo);
20328 
20329   }
20330   return NULL;
20331 }
20332 
20333 
_wrap_Dataset_TestCapability(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20334 SWIGINTERN PyObject *_wrap_Dataset_TestCapability(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20335   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20336   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20337   char *arg2 = (char *) 0 ;
20338   void *argp1 = 0 ;
20339   int res1 = 0 ;
20340   int res2 ;
20341   char *buf2 = 0 ;
20342   int alloc2 = 0 ;
20343   PyObject * obj0 = 0 ;
20344   PyObject * obj1 = 0 ;
20345   bool result;
20346 
20347   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_TestCapability",&obj0,&obj1)) SWIG_fail;
20348   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20349   if (!SWIG_IsOK(res1)) {
20350     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_TestCapability" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20351   }
20352   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20353   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
20354   if (!SWIG_IsOK(res2)) {
20355     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_TestCapability" "', argument " "2"" of type '" "char const *""'");
20356   }
20357   arg2 = reinterpret_cast< char * >(buf2);
20358   {
20359     if ( bUseExceptions ) {
20360       ClearErrorState();
20361     }
20362     {
20363       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20364       result = (bool)GDALDatasetShadow_TestCapability(arg1,(char const *)arg2);
20365       SWIG_PYTHON_THREAD_END_ALLOW;
20366     }
20367 #ifndef SED_HACKS
20368     if ( bUseExceptions ) {
20369       CPLErr eclass = CPLGetLastErrorType();
20370       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20371         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20372       }
20373     }
20374 #endif
20375   }
20376   resultobj = SWIG_From_bool(static_cast< bool >(result));
20377   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20378   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20379   return resultobj;
20380 fail:
20381   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20382   return NULL;
20383 }
20384 
20385 
_wrap_Dataset_ExecuteSQL(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)20386 SWIGINTERN PyObject *_wrap_Dataset_ExecuteSQL(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
20387   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20388   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20389   char *arg2 = (char *) 0 ;
20390   OGRGeometryShadow *arg3 = (OGRGeometryShadow *) NULL ;
20391   char *arg4 = (char *) "" ;
20392   void *argp1 = 0 ;
20393   int res1 = 0 ;
20394   int res2 ;
20395   char *buf2 = 0 ;
20396   int alloc2 = 0 ;
20397   void *argp3 = 0 ;
20398   int res3 = 0 ;
20399   int res4 ;
20400   char *buf4 = 0 ;
20401   int alloc4 = 0 ;
20402   PyObject * obj0 = 0 ;
20403   PyObject * obj1 = 0 ;
20404   PyObject * obj2 = 0 ;
20405   PyObject * obj3 = 0 ;
20406   char *  kwnames[] = {
20407     (char *) "self",(char *) "statement",(char *) "spatialFilter",(char *) "dialect", NULL
20408   };
20409   OGRLayerShadow *result = 0 ;
20410 
20411   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OO:Dataset_ExecuteSQL",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
20412   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20413   if (!SWIG_IsOK(res1)) {
20414     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_ExecuteSQL" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20415   }
20416   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20417   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
20418   if (!SWIG_IsOK(res2)) {
20419     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_ExecuteSQL" "', argument " "2"" of type '" "char const *""'");
20420   }
20421   arg2 = reinterpret_cast< char * >(buf2);
20422   if (obj2) {
20423     res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OGRGeometryShadow, 0 |  0 );
20424     if (!SWIG_IsOK(res3)) {
20425       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Dataset_ExecuteSQL" "', argument " "3"" of type '" "OGRGeometryShadow *""'");
20426     }
20427     arg3 = reinterpret_cast< OGRGeometryShadow * >(argp3);
20428   }
20429   if (obj3) {
20430     res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
20431     if (!SWIG_IsOK(res4)) {
20432       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Dataset_ExecuteSQL" "', argument " "4"" of type '" "char const *""'");
20433     }
20434     arg4 = reinterpret_cast< char * >(buf4);
20435   }
20436   {
20437     if (!arg2) {
20438       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20439     }
20440   }
20441   {
20442     if ( bUseExceptions ) {
20443       ClearErrorState();
20444     }
20445     {
20446       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20447       result = (OGRLayerShadow *)GDALDatasetShadow_ExecuteSQL(arg1,(char const *)arg2,arg3,(char const *)arg4);
20448       SWIG_PYTHON_THREAD_END_ALLOW;
20449     }
20450 #ifndef SED_HACKS
20451     if ( bUseExceptions ) {
20452       CPLErr eclass = CPLGetLastErrorType();
20453       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20454         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20455       }
20456     }
20457 #endif
20458   }
20459   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
20460   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20461   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
20462   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20463   return resultobj;
20464 fail:
20465   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20466   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
20467   return NULL;
20468 }
20469 
20470 
_wrap_Dataset_ReleaseResultSet(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20471 SWIGINTERN PyObject *_wrap_Dataset_ReleaseResultSet(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20472   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20473   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20474   OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
20475   void *argp1 = 0 ;
20476   int res1 = 0 ;
20477   int res2 = 0 ;
20478   PyObject * obj0 = 0 ;
20479   PyObject * obj1 = 0 ;
20480 
20481   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_ReleaseResultSet",&obj0,&obj1)) SWIG_fail;
20482   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20483   if (!SWIG_IsOK(res1)) {
20484     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_ReleaseResultSet" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20485   }
20486   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20487   res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&arg2), SWIGTYPE_p_OGRLayerShadow, SWIG_POINTER_DISOWN |  0 );
20488   if (!SWIG_IsOK(res2)) {
20489     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_ReleaseResultSet" "', argument " "2"" of type '" "OGRLayerShadow *""'");
20490   }
20491   {
20492     if ( bUseExceptions ) {
20493       ClearErrorState();
20494     }
20495     {
20496       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20497       GDALDatasetShadow_ReleaseResultSet(arg1,arg2);
20498       SWIG_PYTHON_THREAD_END_ALLOW;
20499     }
20500 #ifndef SED_HACKS
20501     if ( bUseExceptions ) {
20502       CPLErr eclass = CPLGetLastErrorType();
20503       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20504         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20505       }
20506     }
20507 #endif
20508   }
20509   resultobj = SWIG_Py_Void();
20510   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20511   return resultobj;
20512 fail:
20513   return NULL;
20514 }
20515 
20516 
_wrap_Dataset_GetStyleTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20517 SWIGINTERN PyObject *_wrap_Dataset_GetStyleTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20518   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20519   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20520   void *argp1 = 0 ;
20521   int res1 = 0 ;
20522   PyObject * obj0 = 0 ;
20523   OGRStyleTableShadow *result = 0 ;
20524 
20525   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_GetStyleTable",&obj0)) SWIG_fail;
20526   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20527   if (!SWIG_IsOK(res1)) {
20528     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetStyleTable" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20529   }
20530   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20531   {
20532     if ( bUseExceptions ) {
20533       ClearErrorState();
20534     }
20535     {
20536       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20537       result = (OGRStyleTableShadow *)GDALDatasetShadow_GetStyleTable(arg1);
20538       SWIG_PYTHON_THREAD_END_ALLOW;
20539     }
20540 #ifndef SED_HACKS
20541     if ( bUseExceptions ) {
20542       CPLErr eclass = CPLGetLastErrorType();
20543       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20544         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20545       }
20546     }
20547 #endif
20548   }
20549   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRStyleTableShadow, 0 |  0 );
20550   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20551   return resultobj;
20552 fail:
20553   return NULL;
20554 }
20555 
20556 
_wrap_Dataset_SetStyleTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20557 SWIGINTERN PyObject *_wrap_Dataset_SetStyleTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20558   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20559   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20560   OGRStyleTableShadow *arg2 = (OGRStyleTableShadow *) 0 ;
20561   void *argp1 = 0 ;
20562   int res1 = 0 ;
20563   void *argp2 = 0 ;
20564   int res2 = 0 ;
20565   PyObject * obj0 = 0 ;
20566   PyObject * obj1 = 0 ;
20567 
20568   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_SetStyleTable",&obj0,&obj1)) SWIG_fail;
20569   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20570   if (!SWIG_IsOK(res1)) {
20571     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_SetStyleTable" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20572   }
20573   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20574   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OGRStyleTableShadow, 0 |  0 );
20575   if (!SWIG_IsOK(res2)) {
20576     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_SetStyleTable" "', argument " "2"" of type '" "OGRStyleTableShadow *""'");
20577   }
20578   arg2 = reinterpret_cast< OGRStyleTableShadow * >(argp2);
20579   {
20580     if ( bUseExceptions ) {
20581       ClearErrorState();
20582     }
20583     {
20584       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20585       GDALDatasetShadow_SetStyleTable(arg1,arg2);
20586       SWIG_PYTHON_THREAD_END_ALLOW;
20587     }
20588 #ifndef SED_HACKS
20589     if ( bUseExceptions ) {
20590       CPLErr eclass = CPLGetLastErrorType();
20591       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20592         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20593       }
20594     }
20595 #endif
20596   }
20597   resultobj = SWIG_Py_Void();
20598   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20599   return resultobj;
20600 fail:
20601   return NULL;
20602 }
20603 
20604 
_wrap_Dataset_AbortSQL(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20605 SWIGINTERN PyObject *_wrap_Dataset_AbortSQL(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20606   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20607   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20608   void *argp1 = 0 ;
20609   int res1 = 0 ;
20610   PyObject * obj0 = 0 ;
20611   OGRErr result;
20612 
20613   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_AbortSQL",&obj0)) SWIG_fail;
20614   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20615   if (!SWIG_IsOK(res1)) {
20616     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_AbortSQL" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20617   }
20618   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20619   {
20620     if ( bUseExceptions ) {
20621       ClearErrorState();
20622     }
20623     {
20624       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20625       result = (OGRErr)GDALDatasetShadow_AbortSQL(arg1);
20626       SWIG_PYTHON_THREAD_END_ALLOW;
20627     }
20628 #ifndef SED_HACKS
20629     if ( bUseExceptions ) {
20630       CPLErr eclass = CPLGetLastErrorType();
20631       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20632         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20633       }
20634     }
20635 #endif
20636   }
20637   {
20638     /* %typemap(out) OGRErr */
20639     if ( result != 0 && bUseExceptions) {
20640       const char* pszMessage = CPLGetLastErrorMsg();
20641       if( pszMessage[0] != '\0' )
20642       PyErr_SetString( PyExc_RuntimeError, pszMessage );
20643       else
20644       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
20645       SWIG_fail;
20646     }
20647   }
20648   {
20649     /* %typemap(ret) OGRErr */
20650     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
20651       resultobj = PyInt_FromLong( result );
20652     }
20653   }
20654   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20655   return resultobj;
20656 fail:
20657   return NULL;
20658 }
20659 
20660 
_wrap_Dataset_StartTransaction(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)20661 SWIGINTERN PyObject *_wrap_Dataset_StartTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
20662   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20663   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20664   int arg2 = (int) FALSE ;
20665   void *argp1 = 0 ;
20666   int res1 = 0 ;
20667   int val2 ;
20668   int ecode2 = 0 ;
20669   PyObject * obj0 = 0 ;
20670   PyObject * obj1 = 0 ;
20671   char *  kwnames[] = {
20672     (char *) "self",(char *) "force", NULL
20673   };
20674   OGRErr result;
20675 
20676   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|O:Dataset_StartTransaction",kwnames,&obj0,&obj1)) SWIG_fail;
20677   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20678   if (!SWIG_IsOK(res1)) {
20679     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_StartTransaction" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20680   }
20681   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20682   if (obj1) {
20683     ecode2 = SWIG_AsVal_int(obj1, &val2);
20684     if (!SWIG_IsOK(ecode2)) {
20685       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_StartTransaction" "', argument " "2"" of type '" "int""'");
20686     }
20687     arg2 = static_cast< int >(val2);
20688   }
20689   {
20690     if ( bUseExceptions ) {
20691       ClearErrorState();
20692     }
20693     {
20694       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20695       result = (OGRErr)GDALDatasetShadow_StartTransaction(arg1,arg2);
20696       SWIG_PYTHON_THREAD_END_ALLOW;
20697     }
20698 #ifndef SED_HACKS
20699     if ( bUseExceptions ) {
20700       CPLErr eclass = CPLGetLastErrorType();
20701       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20702         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20703       }
20704     }
20705 #endif
20706   }
20707   {
20708     /* %typemap(out) OGRErr */
20709     if ( result != 0 && bUseExceptions) {
20710       const char* pszMessage = CPLGetLastErrorMsg();
20711       if( pszMessage[0] != '\0' )
20712       PyErr_SetString( PyExc_RuntimeError, pszMessage );
20713       else
20714       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
20715       SWIG_fail;
20716     }
20717   }
20718   {
20719     /* %typemap(ret) OGRErr */
20720     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
20721       resultobj = PyInt_FromLong( result );
20722     }
20723   }
20724   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20725   return resultobj;
20726 fail:
20727   return NULL;
20728 }
20729 
20730 
_wrap_Dataset_CommitTransaction(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20731 SWIGINTERN PyObject *_wrap_Dataset_CommitTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20732   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20733   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20734   void *argp1 = 0 ;
20735   int res1 = 0 ;
20736   PyObject * obj0 = 0 ;
20737   OGRErr result;
20738 
20739   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_CommitTransaction",&obj0)) SWIG_fail;
20740   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20741   if (!SWIG_IsOK(res1)) {
20742     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_CommitTransaction" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20743   }
20744   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20745   {
20746     if ( bUseExceptions ) {
20747       ClearErrorState();
20748     }
20749     {
20750       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20751       result = (OGRErr)GDALDatasetShadow_CommitTransaction(arg1);
20752       SWIG_PYTHON_THREAD_END_ALLOW;
20753     }
20754 #ifndef SED_HACKS
20755     if ( bUseExceptions ) {
20756       CPLErr eclass = CPLGetLastErrorType();
20757       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20758         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20759       }
20760     }
20761 #endif
20762   }
20763   {
20764     /* %typemap(out) OGRErr */
20765     if ( result != 0 && bUseExceptions) {
20766       const char* pszMessage = CPLGetLastErrorMsg();
20767       if( pszMessage[0] != '\0' )
20768       PyErr_SetString( PyExc_RuntimeError, pszMessage );
20769       else
20770       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
20771       SWIG_fail;
20772     }
20773   }
20774   {
20775     /* %typemap(ret) OGRErr */
20776     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
20777       resultobj = PyInt_FromLong( result );
20778     }
20779   }
20780   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20781   return resultobj;
20782 fail:
20783   return NULL;
20784 }
20785 
20786 
_wrap_Dataset_RollbackTransaction(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20787 SWIGINTERN PyObject *_wrap_Dataset_RollbackTransaction(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20788   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20789   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20790   void *argp1 = 0 ;
20791   int res1 = 0 ;
20792   PyObject * obj0 = 0 ;
20793   OGRErr result;
20794 
20795   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_RollbackTransaction",&obj0)) SWIG_fail;
20796   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20797   if (!SWIG_IsOK(res1)) {
20798     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_RollbackTransaction" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20799   }
20800   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20801   {
20802     if ( bUseExceptions ) {
20803       ClearErrorState();
20804     }
20805     {
20806       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20807       result = (OGRErr)GDALDatasetShadow_RollbackTransaction(arg1);
20808       SWIG_PYTHON_THREAD_END_ALLOW;
20809     }
20810 #ifndef SED_HACKS
20811     if ( bUseExceptions ) {
20812       CPLErr eclass = CPLGetLastErrorType();
20813       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20814         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20815       }
20816     }
20817 #endif
20818   }
20819   {
20820     /* %typemap(out) OGRErr */
20821     if ( result != 0 && bUseExceptions) {
20822       const char* pszMessage = CPLGetLastErrorMsg();
20823       if( pszMessage[0] != '\0' )
20824       PyErr_SetString( PyExc_RuntimeError, pszMessage );
20825       else
20826       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
20827       SWIG_fail;
20828     }
20829   }
20830   {
20831     /* %typemap(ret) OGRErr */
20832     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
20833       resultobj = PyInt_FromLong( result );
20834     }
20835   }
20836   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20837   return resultobj;
20838 fail:
20839   return NULL;
20840 }
20841 
20842 
_wrap_Dataset_ClearStatistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20843 SWIGINTERN PyObject *_wrap_Dataset_ClearStatistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20844   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20845   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20846   void *argp1 = 0 ;
20847   int res1 = 0 ;
20848   PyObject * obj0 = 0 ;
20849 
20850   if (!PyArg_ParseTuple(args,(char *)"O:Dataset_ClearStatistics",&obj0)) SWIG_fail;
20851   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20852   if (!SWIG_IsOK(res1)) {
20853     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_ClearStatistics" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20854   }
20855   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20856   {
20857     if ( bUseExceptions ) {
20858       ClearErrorState();
20859     }
20860     {
20861       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20862       GDALDatasetShadow_ClearStatistics(arg1);
20863       SWIG_PYTHON_THREAD_END_ALLOW;
20864     }
20865 #ifndef SED_HACKS
20866     if ( bUseExceptions ) {
20867       CPLErr eclass = CPLGetLastErrorType();
20868       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20869         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20870       }
20871     }
20872 #endif
20873   }
20874   resultobj = SWIG_Py_Void();
20875   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20876   return resultobj;
20877 fail:
20878   return NULL;
20879 }
20880 
20881 
_wrap_Dataset_GetFieldDomain(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20882 SWIGINTERN PyObject *_wrap_Dataset_GetFieldDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20883   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20884   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20885   char *arg2 = (char *) 0 ;
20886   void *argp1 = 0 ;
20887   int res1 = 0 ;
20888   int res2 ;
20889   char *buf2 = 0 ;
20890   int alloc2 = 0 ;
20891   PyObject * obj0 = 0 ;
20892   PyObject * obj1 = 0 ;
20893   OGRFieldDomainShadow *result = 0 ;
20894 
20895   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_GetFieldDomain",&obj0,&obj1)) SWIG_fail;
20896   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20897   if (!SWIG_IsOK(res1)) {
20898     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_GetFieldDomain" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20899   }
20900   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20901   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
20902   if (!SWIG_IsOK(res2)) {
20903     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_GetFieldDomain" "', argument " "2"" of type '" "char const *""'");
20904   }
20905   arg2 = reinterpret_cast< char * >(buf2);
20906   {
20907     if (!arg2) {
20908       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20909     }
20910   }
20911   {
20912     if ( bUseExceptions ) {
20913       ClearErrorState();
20914     }
20915     {
20916       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20917       result = (OGRFieldDomainShadow *)GDALDatasetShadow_GetFieldDomain(arg1,(char const *)arg2);
20918       SWIG_PYTHON_THREAD_END_ALLOW;
20919     }
20920 #ifndef SED_HACKS
20921     if ( bUseExceptions ) {
20922       CPLErr eclass = CPLGetLastErrorType();
20923       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20924         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20925       }
20926     }
20927 #endif
20928   }
20929   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OGRFieldDomainShadow, 0 |  0 );
20930   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20931   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20932   return resultobj;
20933 fail:
20934   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
20935   return NULL;
20936 }
20937 
20938 
_wrap_Dataset_AddFieldDomain(PyObject * SWIGUNUSEDPARM (self),PyObject * args)20939 SWIGINTERN PyObject *_wrap_Dataset_AddFieldDomain(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
20940   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20941   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20942   OGRFieldDomainShadow *arg2 = (OGRFieldDomainShadow *) 0 ;
20943   void *argp1 = 0 ;
20944   int res1 = 0 ;
20945   void *argp2 = 0 ;
20946   int res2 = 0 ;
20947   PyObject * obj0 = 0 ;
20948   PyObject * obj1 = 0 ;
20949   bool result;
20950 
20951   if (!PyArg_ParseTuple(args,(char *)"OO:Dataset_AddFieldDomain",&obj0,&obj1)) SWIG_fail;
20952   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
20953   if (!SWIG_IsOK(res1)) {
20954     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_AddFieldDomain" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
20955   }
20956   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
20957   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OGRFieldDomainShadow, 0 |  0 );
20958   if (!SWIG_IsOK(res2)) {
20959     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dataset_AddFieldDomain" "', argument " "2"" of type '" "OGRFieldDomainShadow *""'");
20960   }
20961   arg2 = reinterpret_cast< OGRFieldDomainShadow * >(argp2);
20962   {
20963     if (!arg2) {
20964       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20965     }
20966   }
20967   {
20968     if ( bUseExceptions ) {
20969       ClearErrorState();
20970     }
20971     {
20972       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20973       result = (bool)GDALDatasetShadow_AddFieldDomain(arg1,arg2);
20974       SWIG_PYTHON_THREAD_END_ALLOW;
20975     }
20976 #ifndef SED_HACKS
20977     if ( bUseExceptions ) {
20978       CPLErr eclass = CPLGetLastErrorType();
20979       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
20980         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
20981       }
20982     }
20983 #endif
20984   }
20985   resultobj = SWIG_From_bool(static_cast< bool >(result));
20986   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
20987   return resultobj;
20988 fail:
20989   return NULL;
20990 }
20991 
20992 
_wrap_Dataset_ReadRaster1(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)20993 SWIGINTERN PyObject *_wrap_Dataset_ReadRaster1(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
20994   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
20995   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
20996   double arg2 ;
20997   double arg3 ;
20998   double arg4 ;
20999   double arg5 ;
21000   void **arg6 = (void **) 0 ;
21001   int *arg7 = (int *) 0 ;
21002   int *arg8 = (int *) 0 ;
21003   GDALDataType *arg9 = (GDALDataType *) 0 ;
21004   int arg10 = (int) 0 ;
21005   int *arg11 = (int *) 0 ;
21006   GIntBig *arg12 = (GIntBig *) 0 ;
21007   GIntBig *arg13 = (GIntBig *) 0 ;
21008   GIntBig *arg14 = (GIntBig *) 0 ;
21009   GDALRIOResampleAlg arg15 = (GDALRIOResampleAlg) GRIORA_NearestNeighbour ;
21010   GDALProgressFunc arg16 = (GDALProgressFunc) NULL ;
21011   void *arg17 = (void *) NULL ;
21012   void *arg18 = (void *) NULL ;
21013   void *argp1 = 0 ;
21014   int res1 = 0 ;
21015   double val2 ;
21016   int ecode2 = 0 ;
21017   double val3 ;
21018   int ecode3 = 0 ;
21019   double val4 ;
21020   int ecode4 = 0 ;
21021   double val5 ;
21022   int ecode5 = 0 ;
21023   void *pyObject6 = NULL ;
21024   int val7 ;
21025   int val8 ;
21026   GDALDataType val9 ;
21027   GIntBig val12 ;
21028   GIntBig val13 ;
21029   GIntBig val14 ;
21030   PyObject * obj0 = 0 ;
21031   PyObject * obj1 = 0 ;
21032   PyObject * obj2 = 0 ;
21033   PyObject * obj3 = 0 ;
21034   PyObject * obj4 = 0 ;
21035   PyObject * obj5 = 0 ;
21036   PyObject * obj6 = 0 ;
21037   PyObject * obj7 = 0 ;
21038   PyObject * obj8 = 0 ;
21039   PyObject * obj9 = 0 ;
21040   PyObject * obj10 = 0 ;
21041   PyObject * obj11 = 0 ;
21042   PyObject * obj12 = 0 ;
21043   PyObject * obj13 = 0 ;
21044   PyObject * obj14 = 0 ;
21045   PyObject * obj15 = 0 ;
21046   char *  kwnames[] = {
21047     (char *) "self",(char *) "xoff",(char *) "yoff",(char *) "xsize",(char *) "ysize",(char *) "buf_xsize",(char *) "buf_ysize",(char *) "buf_type",(char *) "band_list",(char *) "buf_pixel_space",(char *) "buf_line_space",(char *) "buf_band_space",(char *) "resample_alg",(char *) "callback",(char *) "callback_data",(char *) "inputOutputBuf", NULL
21048   };
21049   CPLErr result;
21050 
21051   /* %typemap(arginit) ( const char* callback_data=NULL)  */
21052   PyProgressData *psProgressInfo;
21053   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
21054   psProgressInfo->nLastReported = -1;
21055   psProgressInfo->psPyCallback = NULL;
21056   psProgressInfo->psPyCallbackData = NULL;
21057   arg17 = psProgressInfo;
21058   {
21059     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject6 = NULL ) */
21060     arg6 = &pyObject6;
21061   }
21062   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOO|OOOOOOOOOOO:Dataset_ReadRaster1",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13,&obj14,&obj15)) SWIG_fail;
21063   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
21064   if (!SWIG_IsOK(res1)) {
21065     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dataset_ReadRaster1" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
21066   }
21067   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
21068   ecode2 = SWIG_AsVal_double(obj1, &val2);
21069   if (!SWIG_IsOK(ecode2)) {
21070     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Dataset_ReadRaster1" "', argument " "2"" of type '" "double""'");
21071   }
21072   arg2 = static_cast< double >(val2);
21073   ecode3 = SWIG_AsVal_double(obj2, &val3);
21074   if (!SWIG_IsOK(ecode3)) {
21075     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Dataset_ReadRaster1" "', argument " "3"" of type '" "double""'");
21076   }
21077   arg3 = static_cast< double >(val3);
21078   ecode4 = SWIG_AsVal_double(obj3, &val4);
21079   if (!SWIG_IsOK(ecode4)) {
21080     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Dataset_ReadRaster1" "', argument " "4"" of type '" "double""'");
21081   }
21082   arg4 = static_cast< double >(val4);
21083   ecode5 = SWIG_AsVal_double(obj4, &val5);
21084   if (!SWIG_IsOK(ecode5)) {
21085     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Dataset_ReadRaster1" "', argument " "5"" of type '" "double""'");
21086   }
21087   arg5 = static_cast< double >(val5);
21088   if (obj5) {
21089     {
21090       /* %typemap(in) (int *optional_##int) */
21091       if ( obj5 == Py_None ) {
21092         arg7 = 0;
21093       }
21094       else if ( PyArg_Parse( obj5,"i" ,&val7 ) ) {
21095         arg7 = (int *) &val7;
21096       }
21097       else {
21098         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
21099         SWIG_fail;
21100       }
21101     }
21102   }
21103   if (obj6) {
21104     {
21105       /* %typemap(in) (int *optional_##int) */
21106       if ( obj6 == Py_None ) {
21107         arg8 = 0;
21108       }
21109       else if ( PyArg_Parse( obj6,"i" ,&val8 ) ) {
21110         arg8 = (int *) &val8;
21111       }
21112       else {
21113         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
21114         SWIG_fail;
21115       }
21116     }
21117   }
21118   if (obj7) {
21119     {
21120       /* %typemap(in) (GDALDataType *optional_GDALDataType) */
21121       int intval = 0;
21122       if ( obj7 == Py_None ) {
21123         arg9 = NULL;
21124       }
21125       else if ( SWIG_IsOK(SWIG_AsVal_int(obj7, &intval)) ) {
21126         if( intval < GDT_Unknown || intval >= GDT_TypeCount )
21127         {
21128           SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
21129         }
21130         val9 = static_cast<GDALDataType>(intval);
21131         arg9 = &val9;
21132       }
21133       else {
21134         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
21135         SWIG_fail;
21136       }
21137     }
21138   }
21139   if (obj8) {
21140     {
21141       /* %typemap(in,numinputs=1) (int nList, int* pList)*/
21142       arg11 = CreateCIntListFromSequence(obj8, &arg10);
21143       if( arg10 < 0 ) {
21144         SWIG_fail;
21145       }
21146     }
21147   }
21148   if (obj9) {
21149     {
21150       /* %typemap(in) (GIntBig *optional_##GIntBig) */
21151       if ( obj9 == Py_None ) {
21152         arg12 = 0;
21153       }
21154       else if ( PyArg_Parse( obj9,"L" ,&val12 ) ) {
21155         arg12 = (GIntBig *) &val12;
21156       }
21157       else {
21158         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
21159         SWIG_fail;
21160       }
21161     }
21162   }
21163   if (obj10) {
21164     {
21165       /* %typemap(in) (GIntBig *optional_##GIntBig) */
21166       if ( obj10 == Py_None ) {
21167         arg13 = 0;
21168       }
21169       else if ( PyArg_Parse( obj10,"L" ,&val13 ) ) {
21170         arg13 = (GIntBig *) &val13;
21171       }
21172       else {
21173         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
21174         SWIG_fail;
21175       }
21176     }
21177   }
21178   if (obj11) {
21179     {
21180       /* %typemap(in) (GIntBig *optional_##GIntBig) */
21181       if ( obj11 == Py_None ) {
21182         arg14 = 0;
21183       }
21184       else if ( PyArg_Parse( obj11,"L" ,&val14 ) ) {
21185         arg14 = (GIntBig *) &val14;
21186       }
21187       else {
21188         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
21189         SWIG_fail;
21190       }
21191     }
21192   }
21193   if (obj12) {
21194     {
21195       // %typemap(in) GDALRIOResampleAlg
21196       int val = 0;
21197       int ecode = SWIG_AsVal_int(obj12, &val);
21198       if (!SWIG_IsOK(ecode)) {
21199         SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALRIOResampleAlg");
21200       }
21201       if( val < 0 ||
21202         ( val >= static_cast<int>(GRIORA_RESERVED_START) &&
21203           val <= static_cast<int>(GRIORA_RESERVED_END) ) ||
21204         val > static_cast<int>(GRIORA_LAST) )
21205       {
21206         SWIG_exception_fail(SWIG_ValueError, "Invalid value for resample_alg");
21207       }
21208       arg15 = static_cast< GDALRIOResampleAlg >(val);
21209     }
21210   }
21211   if (obj13) {
21212     {
21213       /* %typemap(in) (GDALProgressFunc callback = NULL) */
21214       /* callback_func typemap */
21215 
21216       /* In some cases 0 is passed instead of None. */
21217       /* See https://github.com/OSGeo/gdal/pull/219 */
21218       if ( PyLong_Check(obj13) || PyInt_Check(obj13) )
21219       {
21220         if( PyLong_AsLong(obj13) == 0 )
21221         {
21222           obj13 = Py_None;
21223         }
21224       }
21225 
21226       if (obj13 && obj13 != Py_None ) {
21227         void* cbfunction = NULL;
21228         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj13,
21229             (void**)&cbfunction,
21230             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
21231             SWIG_POINTER_EXCEPTION | 0 ));
21232 
21233         if ( cbfunction == GDALTermProgress ) {
21234           arg16 = GDALTermProgress;
21235         } else {
21236           if (!PyCallable_Check(obj13)) {
21237             PyErr_SetString( PyExc_RuntimeError,
21238               "Object given is not a Python function" );
21239             SWIG_fail;
21240           }
21241           psProgressInfo->psPyCallback = obj13;
21242           arg16 = PyProgressProxy;
21243         }
21244 
21245       }
21246 
21247     }
21248   }
21249   if (obj14) {
21250     {
21251       /* %typemap(in) ( void* callback_data=NULL)  */
21252       psProgressInfo->psPyCallbackData = obj14 ;
21253     }
21254   }
21255   if (obj15) {
21256     {
21257       /* %typemap(in) ( void *inPythonObject ) */
21258       arg18 = obj15;
21259     }
21260   }
21261   {
21262     if ( bUseExceptions ) {
21263       ClearErrorState();
21264     }
21265     {
21266       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21267       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALDatasetShadow_ReadRaster1(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18));
21268       SWIG_PYTHON_THREAD_END_ALLOW;
21269     }
21270 #ifndef SED_HACKS
21271     if ( bUseExceptions ) {
21272       CPLErr eclass = CPLGetLastErrorType();
21273       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21274         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21275       }
21276     }
21277 #endif
21278   }
21279   resultobj = SWIG_From_int(static_cast< int >(result));
21280   {
21281     /* %typemap(argout) ( void **outPythonObject ) */
21282     Py_XDECREF(resultobj);
21283     if (*arg6)
21284     {
21285       resultobj = (PyObject*)*arg6;
21286     }
21287     else
21288     {
21289       resultobj = Py_None;
21290       Py_INCREF(resultobj);
21291     }
21292   }
21293   {
21294     /* %typemap(freearg) (int nList, int* pList) */
21295     free(arg11);
21296   }
21297   {
21298     /* %typemap(freearg) ( void* callback_data=NULL)  */
21299 
21300     CPLFree(psProgressInfo);
21301 
21302   }
21303   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21304   return resultobj;
21305 fail:
21306   {
21307     /* %typemap(freearg) (int nList, int* pList) */
21308     free(arg11);
21309   }
21310   {
21311     /* %typemap(freearg) ( void* callback_data=NULL)  */
21312 
21313     CPLFree(psProgressInfo);
21314 
21315   }
21316   return NULL;
21317 }
21318 
21319 
Dataset_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21320 SWIGINTERN PyObject *Dataset_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21321   PyObject *obj;
21322   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
21323   SWIG_TypeNewClientData(SWIGTYPE_p_GDALDatasetShadow, SWIG_NewClientData(obj));
21324   return SWIG_Py_Void();
21325 }
21326 
_wrap_delete_Group(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21327 SWIGINTERN PyObject *_wrap_delete_Group(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21328   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21329   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21330   void *argp1 = 0 ;
21331   int res1 = 0 ;
21332   PyObject * obj0 = 0 ;
21333 
21334   if (!PyArg_ParseTuple(args,(char *)"O:delete_Group",&obj0)) SWIG_fail;
21335   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, SWIG_POINTER_DISOWN |  0 );
21336   if (!SWIG_IsOK(res1)) {
21337     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Group" "', argument " "1"" of type '" "GDALGroupHS *""'");
21338   }
21339   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21340   {
21341     if ( bUseExceptions ) {
21342       ClearErrorState();
21343     }
21344     {
21345       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21346       delete_GDALGroupHS(arg1);
21347       SWIG_PYTHON_THREAD_END_ALLOW;
21348     }
21349 #ifndef SED_HACKS
21350     if ( bUseExceptions ) {
21351       CPLErr eclass = CPLGetLastErrorType();
21352       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21353         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21354       }
21355     }
21356 #endif
21357   }
21358   resultobj = SWIG_Py_Void();
21359   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21360   return resultobj;
21361 fail:
21362   return NULL;
21363 }
21364 
21365 
_wrap_Group_GetName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21366 SWIGINTERN PyObject *_wrap_Group_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21367   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21368   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21369   void *argp1 = 0 ;
21370   int res1 = 0 ;
21371   PyObject * obj0 = 0 ;
21372   char *result = 0 ;
21373 
21374   if (!PyArg_ParseTuple(args,(char *)"O:Group_GetName",&obj0)) SWIG_fail;
21375   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21376   if (!SWIG_IsOK(res1)) {
21377     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetName" "', argument " "1"" of type '" "GDALGroupHS *""'");
21378   }
21379   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21380   {
21381     if ( bUseExceptions ) {
21382       ClearErrorState();
21383     }
21384     {
21385       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21386       result = (char *)GDALGroupHS_GetName(arg1);
21387       SWIG_PYTHON_THREAD_END_ALLOW;
21388     }
21389 #ifndef SED_HACKS
21390     if ( bUseExceptions ) {
21391       CPLErr eclass = CPLGetLastErrorType();
21392       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21393         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21394       }
21395     }
21396 #endif
21397   }
21398   resultobj = SWIG_FromCharPtr((const char *)result);
21399   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21400   return resultobj;
21401 fail:
21402   return NULL;
21403 }
21404 
21405 
_wrap_Group_GetFullName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21406 SWIGINTERN PyObject *_wrap_Group_GetFullName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21407   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21408   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21409   void *argp1 = 0 ;
21410   int res1 = 0 ;
21411   PyObject * obj0 = 0 ;
21412   char *result = 0 ;
21413 
21414   if (!PyArg_ParseTuple(args,(char *)"O:Group_GetFullName",&obj0)) SWIG_fail;
21415   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21416   if (!SWIG_IsOK(res1)) {
21417     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetFullName" "', argument " "1"" of type '" "GDALGroupHS *""'");
21418   }
21419   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21420   {
21421     if ( bUseExceptions ) {
21422       ClearErrorState();
21423     }
21424     {
21425       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21426       result = (char *)GDALGroupHS_GetFullName(arg1);
21427       SWIG_PYTHON_THREAD_END_ALLOW;
21428     }
21429 #ifndef SED_HACKS
21430     if ( bUseExceptions ) {
21431       CPLErr eclass = CPLGetLastErrorType();
21432       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21433         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21434       }
21435     }
21436 #endif
21437   }
21438   resultobj = SWIG_FromCharPtr((const char *)result);
21439   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21440   return resultobj;
21441 fail:
21442   return NULL;
21443 }
21444 
21445 
_wrap_Group_GetMDArrayNames(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21446 SWIGINTERN PyObject *_wrap_Group_GetMDArrayNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21447   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21448   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21449   char **arg2 = (char **) 0 ;
21450   void *argp1 = 0 ;
21451   int res1 = 0 ;
21452   PyObject * obj0 = 0 ;
21453   PyObject * obj1 = 0 ;
21454   char **result = 0 ;
21455 
21456   if (!PyArg_ParseTuple(args,(char *)"O|O:Group_GetMDArrayNames",&obj0,&obj1)) SWIG_fail;
21457   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21458   if (!SWIG_IsOK(res1)) {
21459     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetMDArrayNames" "', argument " "1"" of type '" "GDALGroupHS *""'");
21460   }
21461   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21462   if (obj1) {
21463     {
21464       /* %typemap(in) char **options */
21465       int bErr = FALSE;
21466       arg2 = CSLFromPySequence(obj1, &bErr);
21467       if( bErr )
21468       {
21469         SWIG_fail;
21470       }
21471     }
21472   }
21473   {
21474     if ( bUseExceptions ) {
21475       ClearErrorState();
21476     }
21477     {
21478       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21479       result = (char **)GDALGroupHS_GetMDArrayNames(arg1,arg2);
21480       SWIG_PYTHON_THREAD_END_ALLOW;
21481     }
21482 #ifndef SED_HACKS
21483     if ( bUseExceptions ) {
21484       CPLErr eclass = CPLGetLastErrorType();
21485       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21486         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21487       }
21488     }
21489 #endif
21490   }
21491   {
21492     /* %typemap(out) char **CSL -> ( string ) */
21493     char **stringarray = result;
21494     if ( stringarray == NULL ) {
21495       resultobj = Py_None;
21496       Py_INCREF( resultobj );
21497     }
21498     else {
21499       int len = CSLCount( stringarray );
21500       resultobj = PyList_New( len );
21501       for ( int i = 0; i < len; ++i ) {
21502         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
21503         PyList_SetItem(resultobj, i, o );
21504       }
21505     }
21506     CSLDestroy(result);
21507   }
21508   {
21509     /* %typemap(freearg) char **options */
21510     CSLDestroy( arg2 );
21511   }
21512   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21513   return resultobj;
21514 fail:
21515   {
21516     /* %typemap(freearg) char **options */
21517     CSLDestroy( arg2 );
21518   }
21519   return NULL;
21520 }
21521 
21522 
_wrap_Group_OpenMDArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21523 SWIGINTERN PyObject *_wrap_Group_OpenMDArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21524   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21525   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21526   char *arg2 = (char *) 0 ;
21527   char **arg3 = (char **) 0 ;
21528   void *argp1 = 0 ;
21529   int res1 = 0 ;
21530   int res2 ;
21531   char *buf2 = 0 ;
21532   int alloc2 = 0 ;
21533   PyObject * obj0 = 0 ;
21534   PyObject * obj1 = 0 ;
21535   PyObject * obj2 = 0 ;
21536   GDALMDArrayHS *result = 0 ;
21537 
21538   if (!PyArg_ParseTuple(args,(char *)"OO|O:Group_OpenMDArray",&obj0,&obj1,&obj2)) SWIG_fail;
21539   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21540   if (!SWIG_IsOK(res1)) {
21541     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenMDArray" "', argument " "1"" of type '" "GDALGroupHS *""'");
21542   }
21543   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21544   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
21545   if (!SWIG_IsOK(res2)) {
21546     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenMDArray" "', argument " "2"" of type '" "char const *""'");
21547   }
21548   arg2 = reinterpret_cast< char * >(buf2);
21549   if (obj2) {
21550     {
21551       /* %typemap(in) char **options */
21552       int bErr = FALSE;
21553       arg3 = CSLFromPySequence(obj2, &bErr);
21554       if( bErr )
21555       {
21556         SWIG_fail;
21557       }
21558     }
21559   }
21560   {
21561     if (!arg2) {
21562       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21563     }
21564   }
21565   {
21566     if ( bUseExceptions ) {
21567       ClearErrorState();
21568     }
21569     {
21570       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21571       result = (GDALMDArrayHS *)GDALGroupHS_OpenMDArray(arg1,(char const *)arg2,arg3);
21572       SWIG_PYTHON_THREAD_END_ALLOW;
21573     }
21574 #ifndef SED_HACKS
21575     if ( bUseExceptions ) {
21576       CPLErr eclass = CPLGetLastErrorType();
21577       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21578         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21579       }
21580     }
21581 #endif
21582   }
21583   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
21584   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21585   {
21586     /* %typemap(freearg) char **options */
21587     CSLDestroy( arg3 );
21588   }
21589   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21590   return resultobj;
21591 fail:
21592   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21593   {
21594     /* %typemap(freearg) char **options */
21595     CSLDestroy( arg3 );
21596   }
21597   return NULL;
21598 }
21599 
21600 
_wrap_Group_OpenMDArrayFromFullname(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21601 SWIGINTERN PyObject *_wrap_Group_OpenMDArrayFromFullname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21602   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21603   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21604   char *arg2 = (char *) 0 ;
21605   char **arg3 = (char **) 0 ;
21606   void *argp1 = 0 ;
21607   int res1 = 0 ;
21608   int res2 ;
21609   char *buf2 = 0 ;
21610   int alloc2 = 0 ;
21611   PyObject * obj0 = 0 ;
21612   PyObject * obj1 = 0 ;
21613   PyObject * obj2 = 0 ;
21614   GDALMDArrayHS *result = 0 ;
21615 
21616   if (!PyArg_ParseTuple(args,(char *)"OO|O:Group_OpenMDArrayFromFullname",&obj0,&obj1,&obj2)) SWIG_fail;
21617   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21618   if (!SWIG_IsOK(res1)) {
21619     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenMDArrayFromFullname" "', argument " "1"" of type '" "GDALGroupHS *""'");
21620   }
21621   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21622   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
21623   if (!SWIG_IsOK(res2)) {
21624     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenMDArrayFromFullname" "', argument " "2"" of type '" "char const *""'");
21625   }
21626   arg2 = reinterpret_cast< char * >(buf2);
21627   if (obj2) {
21628     {
21629       /* %typemap(in) char **options */
21630       int bErr = FALSE;
21631       arg3 = CSLFromPySequence(obj2, &bErr);
21632       if( bErr )
21633       {
21634         SWIG_fail;
21635       }
21636     }
21637   }
21638   {
21639     if (!arg2) {
21640       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21641     }
21642   }
21643   {
21644     if ( bUseExceptions ) {
21645       ClearErrorState();
21646     }
21647     {
21648       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21649       result = (GDALMDArrayHS *)GDALGroupHS_OpenMDArrayFromFullname(arg1,(char const *)arg2,arg3);
21650       SWIG_PYTHON_THREAD_END_ALLOW;
21651     }
21652 #ifndef SED_HACKS
21653     if ( bUseExceptions ) {
21654       CPLErr eclass = CPLGetLastErrorType();
21655       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21656         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21657       }
21658     }
21659 #endif
21660   }
21661   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
21662   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21663   {
21664     /* %typemap(freearg) char **options */
21665     CSLDestroy( arg3 );
21666   }
21667   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21668   return resultobj;
21669 fail:
21670   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21671   {
21672     /* %typemap(freearg) char **options */
21673     CSLDestroy( arg3 );
21674   }
21675   return NULL;
21676 }
21677 
21678 
_wrap_Group_ResolveMDArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21679 SWIGINTERN PyObject *_wrap_Group_ResolveMDArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21680   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21681   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21682   char *arg2 = (char *) 0 ;
21683   char *arg3 = (char *) 0 ;
21684   char **arg4 = (char **) 0 ;
21685   void *argp1 = 0 ;
21686   int res1 = 0 ;
21687   int res2 ;
21688   char *buf2 = 0 ;
21689   int alloc2 = 0 ;
21690   int res3 ;
21691   char *buf3 = 0 ;
21692   int alloc3 = 0 ;
21693   PyObject * obj0 = 0 ;
21694   PyObject * obj1 = 0 ;
21695   PyObject * obj2 = 0 ;
21696   PyObject * obj3 = 0 ;
21697   GDALMDArrayHS *result = 0 ;
21698 
21699   if (!PyArg_ParseTuple(args,(char *)"OOO|O:Group_ResolveMDArray",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
21700   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21701   if (!SWIG_IsOK(res1)) {
21702     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_ResolveMDArray" "', argument " "1"" of type '" "GDALGroupHS *""'");
21703   }
21704   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21705   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
21706   if (!SWIG_IsOK(res2)) {
21707     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_ResolveMDArray" "', argument " "2"" of type '" "char const *""'");
21708   }
21709   arg2 = reinterpret_cast< char * >(buf2);
21710   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
21711   if (!SWIG_IsOK(res3)) {
21712     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Group_ResolveMDArray" "', argument " "3"" of type '" "char const *""'");
21713   }
21714   arg3 = reinterpret_cast< char * >(buf3);
21715   if (obj3) {
21716     {
21717       /* %typemap(in) char **options */
21718       int bErr = FALSE;
21719       arg4 = CSLFromPySequence(obj3, &bErr);
21720       if( bErr )
21721       {
21722         SWIG_fail;
21723       }
21724     }
21725   }
21726   {
21727     if (!arg2) {
21728       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21729     }
21730   }
21731   {
21732     if ( bUseExceptions ) {
21733       ClearErrorState();
21734     }
21735     {
21736       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21737       result = (GDALMDArrayHS *)GDALGroupHS_ResolveMDArray(arg1,(char const *)arg2,(char const *)arg3,arg4);
21738       SWIG_PYTHON_THREAD_END_ALLOW;
21739     }
21740 #ifndef SED_HACKS
21741     if ( bUseExceptions ) {
21742       CPLErr eclass = CPLGetLastErrorType();
21743       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21744         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21745       }
21746     }
21747 #endif
21748   }
21749   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
21750   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21751   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
21752   {
21753     /* %typemap(freearg) char **options */
21754     CSLDestroy( arg4 );
21755   }
21756   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21757   return resultobj;
21758 fail:
21759   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21760   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
21761   {
21762     /* %typemap(freearg) char **options */
21763     CSLDestroy( arg4 );
21764   }
21765   return NULL;
21766 }
21767 
21768 
_wrap_Group_GetGroupNames(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21769 SWIGINTERN PyObject *_wrap_Group_GetGroupNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21770   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21771   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21772   char **arg2 = (char **) 0 ;
21773   void *argp1 = 0 ;
21774   int res1 = 0 ;
21775   PyObject * obj0 = 0 ;
21776   PyObject * obj1 = 0 ;
21777   char **result = 0 ;
21778 
21779   if (!PyArg_ParseTuple(args,(char *)"O|O:Group_GetGroupNames",&obj0,&obj1)) SWIG_fail;
21780   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21781   if (!SWIG_IsOK(res1)) {
21782     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetGroupNames" "', argument " "1"" of type '" "GDALGroupHS *""'");
21783   }
21784   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21785   if (obj1) {
21786     {
21787       /* %typemap(in) char **options */
21788       int bErr = FALSE;
21789       arg2 = CSLFromPySequence(obj1, &bErr);
21790       if( bErr )
21791       {
21792         SWIG_fail;
21793       }
21794     }
21795   }
21796   {
21797     if ( bUseExceptions ) {
21798       ClearErrorState();
21799     }
21800     {
21801       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21802       result = (char **)GDALGroupHS_GetGroupNames(arg1,arg2);
21803       SWIG_PYTHON_THREAD_END_ALLOW;
21804     }
21805 #ifndef SED_HACKS
21806     if ( bUseExceptions ) {
21807       CPLErr eclass = CPLGetLastErrorType();
21808       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21809         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21810       }
21811     }
21812 #endif
21813   }
21814   {
21815     /* %typemap(out) char **CSL -> ( string ) */
21816     char **stringarray = result;
21817     if ( stringarray == NULL ) {
21818       resultobj = Py_None;
21819       Py_INCREF( resultobj );
21820     }
21821     else {
21822       int len = CSLCount( stringarray );
21823       resultobj = PyList_New( len );
21824       for ( int i = 0; i < len; ++i ) {
21825         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
21826         PyList_SetItem(resultobj, i, o );
21827       }
21828     }
21829     CSLDestroy(result);
21830   }
21831   {
21832     /* %typemap(freearg) char **options */
21833     CSLDestroy( arg2 );
21834   }
21835   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21836   return resultobj;
21837 fail:
21838   {
21839     /* %typemap(freearg) char **options */
21840     CSLDestroy( arg2 );
21841   }
21842   return NULL;
21843 }
21844 
21845 
_wrap_Group_OpenGroup(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21846 SWIGINTERN PyObject *_wrap_Group_OpenGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21847   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21848   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21849   char *arg2 = (char *) 0 ;
21850   char **arg3 = (char **) 0 ;
21851   void *argp1 = 0 ;
21852   int res1 = 0 ;
21853   int res2 ;
21854   char *buf2 = 0 ;
21855   int alloc2 = 0 ;
21856   PyObject * obj0 = 0 ;
21857   PyObject * obj1 = 0 ;
21858   PyObject * obj2 = 0 ;
21859   GDALGroupHS *result = 0 ;
21860 
21861   if (!PyArg_ParseTuple(args,(char *)"OO|O:Group_OpenGroup",&obj0,&obj1,&obj2)) SWIG_fail;
21862   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21863   if (!SWIG_IsOK(res1)) {
21864     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenGroup" "', argument " "1"" of type '" "GDALGroupHS *""'");
21865   }
21866   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21867   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
21868   if (!SWIG_IsOK(res2)) {
21869     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenGroup" "', argument " "2"" of type '" "char const *""'");
21870   }
21871   arg2 = reinterpret_cast< char * >(buf2);
21872   if (obj2) {
21873     {
21874       /* %typemap(in) char **options */
21875       int bErr = FALSE;
21876       arg3 = CSLFromPySequence(obj2, &bErr);
21877       if( bErr )
21878       {
21879         SWIG_fail;
21880       }
21881     }
21882   }
21883   {
21884     if (!arg2) {
21885       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21886     }
21887   }
21888   {
21889     if ( bUseExceptions ) {
21890       ClearErrorState();
21891     }
21892     {
21893       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21894       result = (GDALGroupHS *)GDALGroupHS_OpenGroup(arg1,(char const *)arg2,arg3);
21895       SWIG_PYTHON_THREAD_END_ALLOW;
21896     }
21897 #ifndef SED_HACKS
21898     if ( bUseExceptions ) {
21899       CPLErr eclass = CPLGetLastErrorType();
21900       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21901         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21902       }
21903     }
21904 #endif
21905   }
21906   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_POINTER_OWN |  0 );
21907   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21908   {
21909     /* %typemap(freearg) char **options */
21910     CSLDestroy( arg3 );
21911   }
21912   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21913   return resultobj;
21914 fail:
21915   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21916   {
21917     /* %typemap(freearg) char **options */
21918     CSLDestroy( arg3 );
21919   }
21920   return NULL;
21921 }
21922 
21923 
_wrap_Group_OpenGroupFromFullname(PyObject * SWIGUNUSEDPARM (self),PyObject * args)21924 SWIGINTERN PyObject *_wrap_Group_OpenGroupFromFullname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
21925   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
21926   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
21927   char *arg2 = (char *) 0 ;
21928   char **arg3 = (char **) 0 ;
21929   void *argp1 = 0 ;
21930   int res1 = 0 ;
21931   int res2 ;
21932   char *buf2 = 0 ;
21933   int alloc2 = 0 ;
21934   PyObject * obj0 = 0 ;
21935   PyObject * obj1 = 0 ;
21936   PyObject * obj2 = 0 ;
21937   GDALGroupHS *result = 0 ;
21938 
21939   if (!PyArg_ParseTuple(args,(char *)"OO|O:Group_OpenGroupFromFullname",&obj0,&obj1,&obj2)) SWIG_fail;
21940   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
21941   if (!SWIG_IsOK(res1)) {
21942     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_OpenGroupFromFullname" "', argument " "1"" of type '" "GDALGroupHS *""'");
21943   }
21944   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
21945   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
21946   if (!SWIG_IsOK(res2)) {
21947     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_OpenGroupFromFullname" "', argument " "2"" of type '" "char const *""'");
21948   }
21949   arg2 = reinterpret_cast< char * >(buf2);
21950   if (obj2) {
21951     {
21952       /* %typemap(in) char **options */
21953       int bErr = FALSE;
21954       arg3 = CSLFromPySequence(obj2, &bErr);
21955       if( bErr )
21956       {
21957         SWIG_fail;
21958       }
21959     }
21960   }
21961   {
21962     if (!arg2) {
21963       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21964     }
21965   }
21966   {
21967     if ( bUseExceptions ) {
21968       ClearErrorState();
21969     }
21970     {
21971       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21972       result = (GDALGroupHS *)GDALGroupHS_OpenGroupFromFullname(arg1,(char const *)arg2,arg3);
21973       SWIG_PYTHON_THREAD_END_ALLOW;
21974     }
21975 #ifndef SED_HACKS
21976     if ( bUseExceptions ) {
21977       CPLErr eclass = CPLGetLastErrorType();
21978       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
21979         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
21980       }
21981     }
21982 #endif
21983   }
21984   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_POINTER_OWN |  0 );
21985   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21986   {
21987     /* %typemap(freearg) char **options */
21988     CSLDestroy( arg3 );
21989   }
21990   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
21991   return resultobj;
21992 fail:
21993   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
21994   {
21995     /* %typemap(freearg) char **options */
21996     CSLDestroy( arg3 );
21997   }
21998   return NULL;
21999 }
22000 
22001 
_wrap_Group_GetDimensions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22002 SWIGINTERN PyObject *_wrap_Group_GetDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22003   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22004   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22005   GDALDimensionHS ***arg2 = (GDALDimensionHS ***) 0 ;
22006   size_t *arg3 = (size_t *) 0 ;
22007   char **arg4 = (char **) 0 ;
22008   void *argp1 = 0 ;
22009   int res1 = 0 ;
22010   GDALDimensionHS **dims2 = 0 ;
22011   size_t nCount2 = 0 ;
22012   PyObject * obj0 = 0 ;
22013   PyObject * obj1 = 0 ;
22014 
22015   {
22016     /* %typemap(in,numinputs=0) (GDALDimensionHS*** pdims, size_t* pnCount) */
22017     arg2 = &dims2;
22018     arg3 = &nCount2;
22019   }
22020   if (!PyArg_ParseTuple(args,(char *)"O|O:Group_GetDimensions",&obj0,&obj1)) SWIG_fail;
22021   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22022   if (!SWIG_IsOK(res1)) {
22023     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetDimensions" "', argument " "1"" of type '" "GDALGroupHS *""'");
22024   }
22025   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22026   if (obj1) {
22027     {
22028       /* %typemap(in) char **options */
22029       int bErr = FALSE;
22030       arg4 = CSLFromPySequence(obj1, &bErr);
22031       if( bErr )
22032       {
22033         SWIG_fail;
22034       }
22035     }
22036   }
22037   {
22038     if ( bUseExceptions ) {
22039       ClearErrorState();
22040     }
22041     {
22042       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22043       GDALGroupHS_GetDimensions(arg1,arg2,arg3,arg4);
22044       SWIG_PYTHON_THREAD_END_ALLOW;
22045     }
22046 #ifndef SED_HACKS
22047     if ( bUseExceptions ) {
22048       CPLErr eclass = CPLGetLastErrorType();
22049       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22050         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22051       }
22052     }
22053 #endif
22054   }
22055   resultobj = SWIG_Py_Void();
22056   {
22057     /* %typemap(argout) (GDALDimensionHS*** pdims, size_t* pnCount) */
22058     PyObject *list = PyList_New( *arg3 );
22059     for( size_t i = 0; i < *arg3; i++ ) {
22060       PyList_SetItem(list, i,
22061         SWIG_NewPointerObj((void*)(*arg2)[i],SWIGTYPE_p_GDALDimensionHS,SWIG_POINTER_OWN) );
22062     }
22063     Py_DECREF(resultobj);
22064     resultobj = list;
22065   }
22066   {
22067     /* %typemap(freearg) (GDALDimensionHS*** pdims, size_t* pnCount) */
22068     CPLFree(*arg2);
22069   }
22070   {
22071     /* %typemap(freearg) char **options */
22072     CSLDestroy( arg4 );
22073   }
22074   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22075   return resultobj;
22076 fail:
22077   {
22078     /* %typemap(freearg) (GDALDimensionHS*** pdims, size_t* pnCount) */
22079     CPLFree(*arg2);
22080   }
22081   {
22082     /* %typemap(freearg) char **options */
22083     CSLDestroy( arg4 );
22084   }
22085   return NULL;
22086 }
22087 
22088 
_wrap_Group_GetAttribute(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22089 SWIGINTERN PyObject *_wrap_Group_GetAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22090   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22091   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22092   char *arg2 = (char *) 0 ;
22093   void *argp1 = 0 ;
22094   int res1 = 0 ;
22095   int res2 ;
22096   char *buf2 = 0 ;
22097   int alloc2 = 0 ;
22098   PyObject * obj0 = 0 ;
22099   PyObject * obj1 = 0 ;
22100   GDALAttributeHS *result = 0 ;
22101 
22102   if (!PyArg_ParseTuple(args,(char *)"OO:Group_GetAttribute",&obj0,&obj1)) SWIG_fail;
22103   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22104   if (!SWIG_IsOK(res1)) {
22105     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetAttribute" "', argument " "1"" of type '" "GDALGroupHS *""'");
22106   }
22107   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22108   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
22109   if (!SWIG_IsOK(res2)) {
22110     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_GetAttribute" "', argument " "2"" of type '" "char const *""'");
22111   }
22112   arg2 = reinterpret_cast< char * >(buf2);
22113   {
22114     if (!arg2) {
22115       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22116     }
22117   }
22118   {
22119     if ( bUseExceptions ) {
22120       ClearErrorState();
22121     }
22122     {
22123       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22124       result = (GDALAttributeHS *)GDALGroupHS_GetAttribute(arg1,(char const *)arg2);
22125       SWIG_PYTHON_THREAD_END_ALLOW;
22126     }
22127 #ifndef SED_HACKS
22128     if ( bUseExceptions ) {
22129       CPLErr eclass = CPLGetLastErrorType();
22130       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22131         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22132       }
22133     }
22134 #endif
22135   }
22136   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_POINTER_OWN |  0 );
22137   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22138   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22139   return resultobj;
22140 fail:
22141   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22142   return NULL;
22143 }
22144 
22145 
_wrap_Group_GetAttributes(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22146 SWIGINTERN PyObject *_wrap_Group_GetAttributes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22147   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22148   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22149   GDALAttributeHS ***arg2 = (GDALAttributeHS ***) 0 ;
22150   size_t *arg3 = (size_t *) 0 ;
22151   char **arg4 = (char **) 0 ;
22152   void *argp1 = 0 ;
22153   int res1 = 0 ;
22154   GDALAttributeHS **attrs2 = 0 ;
22155   size_t nCount2 = 0 ;
22156   PyObject * obj0 = 0 ;
22157   PyObject * obj1 = 0 ;
22158 
22159   {
22160     /* %typemap(in,numinputs=0) (GDALAttributeHS*** pattrs, size_t* pnCount) */
22161     arg2 = &attrs2;
22162     arg3 = &nCount2;
22163   }
22164   if (!PyArg_ParseTuple(args,(char *)"O|O:Group_GetAttributes",&obj0,&obj1)) SWIG_fail;
22165   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22166   if (!SWIG_IsOK(res1)) {
22167     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetAttributes" "', argument " "1"" of type '" "GDALGroupHS *""'");
22168   }
22169   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22170   if (obj1) {
22171     {
22172       /* %typemap(in) char **options */
22173       int bErr = FALSE;
22174       arg4 = CSLFromPySequence(obj1, &bErr);
22175       if( bErr )
22176       {
22177         SWIG_fail;
22178       }
22179     }
22180   }
22181   {
22182     if ( bUseExceptions ) {
22183       ClearErrorState();
22184     }
22185     {
22186       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22187       GDALGroupHS_GetAttributes(arg1,arg2,arg3,arg4);
22188       SWIG_PYTHON_THREAD_END_ALLOW;
22189     }
22190 #ifndef SED_HACKS
22191     if ( bUseExceptions ) {
22192       CPLErr eclass = CPLGetLastErrorType();
22193       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22194         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22195       }
22196     }
22197 #endif
22198   }
22199   resultobj = SWIG_Py_Void();
22200   {
22201     /* %typemap(argout) (GDALAttributeHS*** pattrs, size_t* pnCount) */
22202     PyObject *list = PyList_New( *arg3 );
22203     for( size_t i = 0; i < *arg3; i++ ) {
22204       PyList_SetItem(list, i,
22205         SWIG_NewPointerObj((void*)(*arg2)[i],SWIGTYPE_p_GDALAttributeHS,SWIG_POINTER_OWN) );
22206     }
22207     Py_DECREF(resultobj);
22208     resultobj = list;
22209   }
22210   {
22211     /* %typemap(freearg) (GDALAttributeHS*** pattrs, size_t* pnCount) */
22212     CPLFree(*arg2);
22213   }
22214   {
22215     /* %typemap(freearg) char **options */
22216     CSLDestroy( arg4 );
22217   }
22218   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22219   return resultobj;
22220 fail:
22221   {
22222     /* %typemap(freearg) (GDALAttributeHS*** pattrs, size_t* pnCount) */
22223     CPLFree(*arg2);
22224   }
22225   {
22226     /* %typemap(freearg) char **options */
22227     CSLDestroy( arg4 );
22228   }
22229   return NULL;
22230 }
22231 
22232 
_wrap_Group_GetStructuralInfo(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22233 SWIGINTERN PyObject *_wrap_Group_GetStructuralInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22234   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22235   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22236   void *argp1 = 0 ;
22237   int res1 = 0 ;
22238   PyObject * obj0 = 0 ;
22239   char **result = 0 ;
22240 
22241   if (!PyArg_ParseTuple(args,(char *)"O:Group_GetStructuralInfo",&obj0)) SWIG_fail;
22242   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22243   if (!SWIG_IsOK(res1)) {
22244     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_GetStructuralInfo" "', argument " "1"" of type '" "GDALGroupHS *""'");
22245   }
22246   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22247   {
22248     if ( bUseExceptions ) {
22249       ClearErrorState();
22250     }
22251     {
22252       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22253       result = (char **)GDALGroupHS_GetStructuralInfo(arg1);
22254       SWIG_PYTHON_THREAD_END_ALLOW;
22255     }
22256 #ifndef SED_HACKS
22257     if ( bUseExceptions ) {
22258       CPLErr eclass = CPLGetLastErrorType();
22259       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22260         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22261       }
22262     }
22263 #endif
22264   }
22265   {
22266     /* %typemap(out) char **dict */
22267     char **stringarray = result;
22268     resultobj = PyDict_New();
22269     if ( stringarray != NULL ) {
22270       while (*stringarray != NULL ) {
22271         char const *valptr;
22272         char *keyptr;
22273         const char* pszSep = strchr( *stringarray, '=' );
22274         if ( pszSep != NULL) {
22275           keyptr = CPLStrdup(*stringarray);
22276           keyptr[pszSep - *stringarray] = '\0';
22277           valptr = pszSep + 1;
22278           PyObject *nm = GDALPythonObjectFromCStr( keyptr );
22279           PyObject *val = GDALPythonObjectFromCStr( valptr );
22280           PyDict_SetItem(resultobj, nm, val );
22281           Py_DECREF(nm);
22282           Py_DECREF(val);
22283           CPLFree( keyptr );
22284         }
22285         stringarray++;
22286       }
22287     }
22288   }
22289   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22290   return resultobj;
22291 fail:
22292   return NULL;
22293 }
22294 
22295 
_wrap_Group_CreateGroup(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22296 SWIGINTERN PyObject *_wrap_Group_CreateGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22297   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22298   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22299   char *arg2 = (char *) 0 ;
22300   char **arg3 = (char **) 0 ;
22301   void *argp1 = 0 ;
22302   int res1 = 0 ;
22303   int res2 ;
22304   char *buf2 = 0 ;
22305   int alloc2 = 0 ;
22306   PyObject * obj0 = 0 ;
22307   PyObject * obj1 = 0 ;
22308   PyObject * obj2 = 0 ;
22309   GDALGroupHS *result = 0 ;
22310 
22311   if (!PyArg_ParseTuple(args,(char *)"OO|O:Group_CreateGroup",&obj0,&obj1,&obj2)) SWIG_fail;
22312   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22313   if (!SWIG_IsOK(res1)) {
22314     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_CreateGroup" "', argument " "1"" of type '" "GDALGroupHS *""'");
22315   }
22316   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22317   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
22318   if (!SWIG_IsOK(res2)) {
22319     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_CreateGroup" "', argument " "2"" of type '" "char const *""'");
22320   }
22321   arg2 = reinterpret_cast< char * >(buf2);
22322   if (obj2) {
22323     {
22324       /* %typemap(in) char **options */
22325       int bErr = FALSE;
22326       arg3 = CSLFromPySequence(obj2, &bErr);
22327       if( bErr )
22328       {
22329         SWIG_fail;
22330       }
22331     }
22332   }
22333   {
22334     if (!arg2) {
22335       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22336     }
22337   }
22338   {
22339     if ( bUseExceptions ) {
22340       ClearErrorState();
22341     }
22342     {
22343       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22344       result = (GDALGroupHS *)GDALGroupHS_CreateGroup(arg1,(char const *)arg2,arg3);
22345       SWIG_PYTHON_THREAD_END_ALLOW;
22346     }
22347 #ifndef SED_HACKS
22348     if ( bUseExceptions ) {
22349       CPLErr eclass = CPLGetLastErrorType();
22350       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22351         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22352       }
22353     }
22354 #endif
22355   }
22356   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGroupHS, SWIG_POINTER_OWN |  0 );
22357   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22358   {
22359     /* %typemap(freearg) char **options */
22360     CSLDestroy( arg3 );
22361   }
22362   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22363   return resultobj;
22364 fail:
22365   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22366   {
22367     /* %typemap(freearg) char **options */
22368     CSLDestroy( arg3 );
22369   }
22370   return NULL;
22371 }
22372 
22373 
_wrap_Group_CreateDimension(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22374 SWIGINTERN PyObject *_wrap_Group_CreateDimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22375   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22376   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22377   char *arg2 = (char *) 0 ;
22378   char *arg3 = (char *) 0 ;
22379   char *arg4 = (char *) 0 ;
22380   unsigned long long arg5 ;
22381   char **arg6 = (char **) 0 ;
22382   void *argp1 = 0 ;
22383   int res1 = 0 ;
22384   int res2 ;
22385   char *buf2 = 0 ;
22386   int alloc2 = 0 ;
22387   int res3 ;
22388   char *buf3 = 0 ;
22389   int alloc3 = 0 ;
22390   int res4 ;
22391   char *buf4 = 0 ;
22392   int alloc4 = 0 ;
22393   unsigned long long val5 ;
22394   int ecode5 = 0 ;
22395   PyObject * obj0 = 0 ;
22396   PyObject * obj1 = 0 ;
22397   PyObject * obj2 = 0 ;
22398   PyObject * obj3 = 0 ;
22399   PyObject * obj4 = 0 ;
22400   PyObject * obj5 = 0 ;
22401   GDALDimensionHS *result = 0 ;
22402 
22403   if (!PyArg_ParseTuple(args,(char *)"OOOOO|O:Group_CreateDimension",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
22404   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22405   if (!SWIG_IsOK(res1)) {
22406     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_CreateDimension" "', argument " "1"" of type '" "GDALGroupHS *""'");
22407   }
22408   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22409   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
22410   if (!SWIG_IsOK(res2)) {
22411     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_CreateDimension" "', argument " "2"" of type '" "char const *""'");
22412   }
22413   arg2 = reinterpret_cast< char * >(buf2);
22414   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
22415   if (!SWIG_IsOK(res3)) {
22416     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Group_CreateDimension" "', argument " "3"" of type '" "char const *""'");
22417   }
22418   arg3 = reinterpret_cast< char * >(buf3);
22419   res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
22420   if (!SWIG_IsOK(res4)) {
22421     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Group_CreateDimension" "', argument " "4"" of type '" "char const *""'");
22422   }
22423   arg4 = reinterpret_cast< char * >(buf4);
22424   ecode5 = SWIG_AsVal_unsigned_SS_long_SS_long(obj4, &val5);
22425   if (!SWIG_IsOK(ecode5)) {
22426     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Group_CreateDimension" "', argument " "5"" of type '" "unsigned long long""'");
22427   }
22428   arg5 = static_cast< unsigned long long >(val5);
22429   if (obj5) {
22430     {
22431       /* %typemap(in) char **options */
22432       int bErr = FALSE;
22433       arg6 = CSLFromPySequence(obj5, &bErr);
22434       if( bErr )
22435       {
22436         SWIG_fail;
22437       }
22438     }
22439   }
22440   {
22441     if (!arg2) {
22442       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22443     }
22444   }
22445   {
22446     if ( bUseExceptions ) {
22447       ClearErrorState();
22448     }
22449     {
22450       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22451       result = (GDALDimensionHS *)GDALGroupHS_CreateDimension(arg1,(char const *)arg2,(char const *)arg3,(char const *)arg4,arg5,arg6);
22452       SWIG_PYTHON_THREAD_END_ALLOW;
22453     }
22454 #ifndef SED_HACKS
22455     if ( bUseExceptions ) {
22456       CPLErr eclass = CPLGetLastErrorType();
22457       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22458         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22459       }
22460     }
22461 #endif
22462   }
22463   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDimensionHS, SWIG_POINTER_OWN |  0 );
22464   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22465   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
22466   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
22467   {
22468     /* %typemap(freearg) char **options */
22469     CSLDestroy( arg6 );
22470   }
22471   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22472   return resultobj;
22473 fail:
22474   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22475   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
22476   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
22477   {
22478     /* %typemap(freearg) char **options */
22479     CSLDestroy( arg6 );
22480   }
22481   return NULL;
22482 }
22483 
22484 
_wrap_Group_CreateMDArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22485 SWIGINTERN PyObject *_wrap_Group_CreateMDArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22486   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22487   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22488   char *arg2 = (char *) 0 ;
22489   int arg3 ;
22490   GDALDimensionHS **arg4 = (GDALDimensionHS **) 0 ;
22491   GDALExtendedDataTypeHS *arg5 = (GDALExtendedDataTypeHS *) 0 ;
22492   char **arg6 = (char **) 0 ;
22493   void *argp1 = 0 ;
22494   int res1 = 0 ;
22495   int res2 ;
22496   char *buf2 = 0 ;
22497   int alloc2 = 0 ;
22498   void *argp5 = 0 ;
22499   int res5 = 0 ;
22500   PyObject * obj0 = 0 ;
22501   PyObject * obj1 = 0 ;
22502   PyObject * obj2 = 0 ;
22503   PyObject * obj3 = 0 ;
22504   PyObject * obj4 = 0 ;
22505   GDALMDArrayHS *result = 0 ;
22506 
22507   if (!PyArg_ParseTuple(args,(char *)"OOOO|O:Group_CreateMDArray",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
22508   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22509   if (!SWIG_IsOK(res1)) {
22510     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_CreateMDArray" "', argument " "1"" of type '" "GDALGroupHS *""'");
22511   }
22512   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22513   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
22514   if (!SWIG_IsOK(res2)) {
22515     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_CreateMDArray" "', argument " "2"" of type '" "char const *""'");
22516   }
22517   arg2 = reinterpret_cast< char * >(buf2);
22518   {
22519     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALDimensionHS *optional_##GDALDimensionHS)*/
22520     if ( !PySequence_Check(obj2) ) {
22521       PyErr_SetString(PyExc_TypeError, "not a sequence");
22522       SWIG_fail;
22523     }
22524     Py_ssize_t size = PySequence_Size(obj2);
22525     if( size != (int)size ) {
22526       PyErr_SetString(PyExc_TypeError, "too big sequence");
22527       SWIG_fail;
22528     }
22529     arg3 = (int)size;
22530     arg4 = (GDALDimensionHS**) CPLMalloc(arg3*sizeof(GDALDimensionHS*));
22531 
22532     for( int i = 0; i<arg3; i++ ) {
22533       PyObject *o = PySequence_GetItem(obj2,i);
22534       GDALDimensionHS* rawobjectpointer = NULL;
22535       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALDimensionHS, SWIG_POINTER_EXCEPTION | 0 ));
22536       if (!rawobjectpointer) {
22537         Py_DECREF(o);
22538         PyErr_SetString(PyExc_TypeError, "object of wrong GDALDimensionHS");
22539         SWIG_fail;
22540       }
22541       arg4[i] = rawobjectpointer;
22542       Py_DECREF(o);
22543 
22544     }
22545   }
22546   res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
22547   if (!SWIG_IsOK(res5)) {
22548     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Group_CreateMDArray" "', argument " "5"" of type '" "GDALExtendedDataTypeHS *""'");
22549   }
22550   arg5 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp5);
22551   if (obj4) {
22552     {
22553       /* %typemap(in) char **options */
22554       int bErr = FALSE;
22555       arg6 = CSLFromPySequence(obj4, &bErr);
22556       if( bErr )
22557       {
22558         SWIG_fail;
22559       }
22560     }
22561   }
22562   {
22563     if (!arg2) {
22564       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22565     }
22566   }
22567   {
22568     if (!arg5) {
22569       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22570     }
22571   }
22572   {
22573     if ( bUseExceptions ) {
22574       ClearErrorState();
22575     }
22576     {
22577       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22578       result = (GDALMDArrayHS *)GDALGroupHS_CreateMDArray(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
22579       SWIG_PYTHON_THREAD_END_ALLOW;
22580     }
22581 #ifndef SED_HACKS
22582     if ( bUseExceptions ) {
22583       CPLErr eclass = CPLGetLastErrorType();
22584       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22585         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22586       }
22587     }
22588 #endif
22589   }
22590   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
22591   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22592   {
22593     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDimensionHS **poObjects)*/
22594     CPLFree( arg4 );
22595   }
22596   {
22597     /* %typemap(freearg) char **options */
22598     CSLDestroy( arg6 );
22599   }
22600   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22601   return resultobj;
22602 fail:
22603   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22604   {
22605     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDimensionHS **poObjects)*/
22606     CPLFree( arg4 );
22607   }
22608   {
22609     /* %typemap(freearg) char **options */
22610     CSLDestroy( arg6 );
22611   }
22612   return NULL;
22613 }
22614 
22615 
_wrap_Group_CreateAttribute(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22616 SWIGINTERN PyObject *_wrap_Group_CreateAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22617   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22618   GDALGroupHS *arg1 = (GDALGroupHS *) 0 ;
22619   char *arg2 = (char *) 0 ;
22620   int arg3 ;
22621   GUIntBig *arg4 = (GUIntBig *) 0 ;
22622   GDALExtendedDataTypeHS *arg5 = (GDALExtendedDataTypeHS *) 0 ;
22623   char **arg6 = (char **) 0 ;
22624   void *argp1 = 0 ;
22625   int res1 = 0 ;
22626   int res2 ;
22627   char *buf2 = 0 ;
22628   int alloc2 = 0 ;
22629   void *argp5 = 0 ;
22630   int res5 = 0 ;
22631   PyObject * obj0 = 0 ;
22632   PyObject * obj1 = 0 ;
22633   PyObject * obj2 = 0 ;
22634   PyObject * obj3 = 0 ;
22635   PyObject * obj4 = 0 ;
22636   GDALAttributeHS *result = 0 ;
22637 
22638   if (!PyArg_ParseTuple(args,(char *)"OOOO|O:Group_CreateAttribute",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
22639   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGroupHS, 0 |  0 );
22640   if (!SWIG_IsOK(res1)) {
22641     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Group_CreateAttribute" "', argument " "1"" of type '" "GDALGroupHS *""'");
22642   }
22643   arg1 = reinterpret_cast< GDALGroupHS * >(argp1);
22644   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
22645   if (!SWIG_IsOK(res2)) {
22646     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Group_CreateAttribute" "', argument " "2"" of type '" "char const *""'");
22647   }
22648   arg2 = reinterpret_cast< char * >(buf2);
22649   {
22650     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
22651     /* check if is List */
22652     if ( !PySequence_Check(obj2) ) {
22653       PyErr_SetString(PyExc_TypeError, "not a sequence");
22654       SWIG_fail;
22655     }
22656     Py_ssize_t size = PySequence_Size(obj2);
22657     if( size != (int)size ) {
22658       PyErr_SetString(PyExc_TypeError, "too big sequence");
22659       SWIG_fail;
22660     }
22661     arg3 = (int)size;
22662     arg4 = (GUIntBig*) malloc(arg3*sizeof(GUIntBig));
22663     for( int i = 0; i<arg3; i++ ) {
22664       PyObject *o = PySequence_GetItem(obj2,i);
22665       PY_LONG_LONG val;
22666       if ( !PyArg_Parse(o,"K",&val) ) {
22667         PyErr_SetString(PyExc_TypeError, "not an integer");
22668         Py_DECREF(o);
22669         SWIG_fail;
22670       }
22671       arg4[i] = (GUIntBig)val;
22672       Py_DECREF(o);
22673     }
22674   }
22675   res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
22676   if (!SWIG_IsOK(res5)) {
22677     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Group_CreateAttribute" "', argument " "5"" of type '" "GDALExtendedDataTypeHS *""'");
22678   }
22679   arg5 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp5);
22680   if (obj4) {
22681     {
22682       /* %typemap(in) char **options */
22683       int bErr = FALSE;
22684       arg6 = CSLFromPySequence(obj4, &bErr);
22685       if( bErr )
22686       {
22687         SWIG_fail;
22688       }
22689     }
22690   }
22691   {
22692     if (!arg2) {
22693       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22694     }
22695   }
22696   {
22697     if (!arg5) {
22698       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22699     }
22700   }
22701   {
22702     if ( bUseExceptions ) {
22703       ClearErrorState();
22704     }
22705     {
22706       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22707       result = (GDALAttributeHS *)GDALGroupHS_CreateAttribute(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
22708       SWIG_PYTHON_THREAD_END_ALLOW;
22709     }
22710 #ifndef SED_HACKS
22711     if ( bUseExceptions ) {
22712       CPLErr eclass = CPLGetLastErrorType();
22713       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22714         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22715       }
22716     }
22717 #endif
22718   }
22719   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_POINTER_OWN |  0 );
22720   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22721   {
22722     /* %typemap(freearg) (int nList, GUIntBig* pList) */
22723     if (arg4) {
22724       free((void*) arg4);
22725     }
22726   }
22727   {
22728     /* %typemap(freearg) char **options */
22729     CSLDestroy( arg6 );
22730   }
22731   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22732   return resultobj;
22733 fail:
22734   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
22735   {
22736     /* %typemap(freearg) (int nList, GUIntBig* pList) */
22737     if (arg4) {
22738       free((void*) arg4);
22739     }
22740   }
22741   {
22742     /* %typemap(freearg) char **options */
22743     CSLDestroy( arg6 );
22744   }
22745   return NULL;
22746 }
22747 
22748 
Group_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22749 SWIGINTERN PyObject *Group_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22750   PyObject *obj;
22751   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
22752   SWIG_TypeNewClientData(SWIGTYPE_p_GDALGroupHS, SWIG_NewClientData(obj));
22753   return SWIG_Py_Void();
22754 }
22755 
_wrap_Statistics_min_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22756 SWIGINTERN PyObject *_wrap_Statistics_min_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22757   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22758   Statistics *arg1 = (Statistics *) 0 ;
22759   void *argp1 = 0 ;
22760   int res1 = 0 ;
22761   PyObject * obj0 = 0 ;
22762   double result;
22763 
22764   if (!PyArg_ParseTuple(args,(char *)"O:Statistics_min_get",&obj0)) SWIG_fail;
22765   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
22766   if (!SWIG_IsOK(res1)) {
22767     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_min_get" "', argument " "1"" of type '" "Statistics *""'");
22768   }
22769   arg1 = reinterpret_cast< Statistics * >(argp1);
22770   {
22771     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22772     result = (double) ((arg1)->min);
22773     SWIG_PYTHON_THREAD_END_ALLOW;
22774   }
22775   resultobj = SWIG_From_double(static_cast< double >(result));
22776   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22777   return resultobj;
22778 fail:
22779   return NULL;
22780 }
22781 
22782 
_wrap_Statistics_max_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22783 SWIGINTERN PyObject *_wrap_Statistics_max_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22784   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22785   Statistics *arg1 = (Statistics *) 0 ;
22786   void *argp1 = 0 ;
22787   int res1 = 0 ;
22788   PyObject * obj0 = 0 ;
22789   double result;
22790 
22791   if (!PyArg_ParseTuple(args,(char *)"O:Statistics_max_get",&obj0)) SWIG_fail;
22792   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
22793   if (!SWIG_IsOK(res1)) {
22794     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_max_get" "', argument " "1"" of type '" "Statistics *""'");
22795   }
22796   arg1 = reinterpret_cast< Statistics * >(argp1);
22797   {
22798     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22799     result = (double) ((arg1)->max);
22800     SWIG_PYTHON_THREAD_END_ALLOW;
22801   }
22802   resultobj = SWIG_From_double(static_cast< double >(result));
22803   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22804   return resultobj;
22805 fail:
22806   return NULL;
22807 }
22808 
22809 
_wrap_Statistics_mean_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22810 SWIGINTERN PyObject *_wrap_Statistics_mean_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22811   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22812   Statistics *arg1 = (Statistics *) 0 ;
22813   void *argp1 = 0 ;
22814   int res1 = 0 ;
22815   PyObject * obj0 = 0 ;
22816   double result;
22817 
22818   if (!PyArg_ParseTuple(args,(char *)"O:Statistics_mean_get",&obj0)) SWIG_fail;
22819   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
22820   if (!SWIG_IsOK(res1)) {
22821     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_mean_get" "', argument " "1"" of type '" "Statistics *""'");
22822   }
22823   arg1 = reinterpret_cast< Statistics * >(argp1);
22824   {
22825     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22826     result = (double) ((arg1)->mean);
22827     SWIG_PYTHON_THREAD_END_ALLOW;
22828   }
22829   resultobj = SWIG_From_double(static_cast< double >(result));
22830   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22831   return resultobj;
22832 fail:
22833   return NULL;
22834 }
22835 
22836 
_wrap_Statistics_std_dev_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22837 SWIGINTERN PyObject *_wrap_Statistics_std_dev_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22838   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22839   Statistics *arg1 = (Statistics *) 0 ;
22840   void *argp1 = 0 ;
22841   int res1 = 0 ;
22842   PyObject * obj0 = 0 ;
22843   double result;
22844 
22845   if (!PyArg_ParseTuple(args,(char *)"O:Statistics_std_dev_get",&obj0)) SWIG_fail;
22846   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
22847   if (!SWIG_IsOK(res1)) {
22848     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_std_dev_get" "', argument " "1"" of type '" "Statistics *""'");
22849   }
22850   arg1 = reinterpret_cast< Statistics * >(argp1);
22851   {
22852     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22853     result = (double) ((arg1)->std_dev);
22854     SWIG_PYTHON_THREAD_END_ALLOW;
22855   }
22856   resultobj = SWIG_From_double(static_cast< double >(result));
22857   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22858   return resultobj;
22859 fail:
22860   return NULL;
22861 }
22862 
22863 
_wrap_Statistics_valid_count_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22864 SWIGINTERN PyObject *_wrap_Statistics_valid_count_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22865   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22866   Statistics *arg1 = (Statistics *) 0 ;
22867   void *argp1 = 0 ;
22868   int res1 = 0 ;
22869   PyObject * obj0 = 0 ;
22870   GIntBig result;
22871 
22872   if (!PyArg_ParseTuple(args,(char *)"O:Statistics_valid_count_get",&obj0)) SWIG_fail;
22873   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Statistics, 0 |  0 );
22874   if (!SWIG_IsOK(res1)) {
22875     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Statistics_valid_count_get" "', argument " "1"" of type '" "Statistics *""'");
22876   }
22877   arg1 = reinterpret_cast< Statistics * >(argp1);
22878   {
22879     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22880     result =  ((arg1)->valid_count);
22881     SWIG_PYTHON_THREAD_END_ALLOW;
22882   }
22883   {
22884     char szTmp[32];
22885     sprintf(szTmp, CPL_FRMT_GIB, result);
22886     resultobj = PyLong_FromString(szTmp, NULL, 10);
22887   }
22888   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22889   return resultobj;
22890 fail:
22891   return NULL;
22892 }
22893 
22894 
_wrap_delete_Statistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22895 SWIGINTERN PyObject *_wrap_delete_Statistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22896   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22897   Statistics *arg1 = (Statistics *) 0 ;
22898   void *argp1 = 0 ;
22899   int res1 = 0 ;
22900   PyObject * obj0 = 0 ;
22901 
22902   if (!PyArg_ParseTuple(args,(char *)"O:delete_Statistics",&obj0)) SWIG_fail;
22903   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Statistics, SWIG_POINTER_DISOWN |  0 );
22904   if (!SWIG_IsOK(res1)) {
22905     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Statistics" "', argument " "1"" of type '" "Statistics *""'");
22906   }
22907   arg1 = reinterpret_cast< Statistics * >(argp1);
22908   {
22909     if ( bUseExceptions ) {
22910       ClearErrorState();
22911     }
22912     {
22913       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22914       delete_Statistics(arg1);
22915       SWIG_PYTHON_THREAD_END_ALLOW;
22916     }
22917 #ifndef SED_HACKS
22918     if ( bUseExceptions ) {
22919       CPLErr eclass = CPLGetLastErrorType();
22920       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22921         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22922       }
22923     }
22924 #endif
22925   }
22926   resultobj = SWIG_Py_Void();
22927   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22928   return resultobj;
22929 fail:
22930   return NULL;
22931 }
22932 
22933 
_wrap_new_Statistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22934 SWIGINTERN PyObject *_wrap_new_Statistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22935   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22936   Statistics *result = 0 ;
22937 
22938   if (!PyArg_ParseTuple(args,(char *)":new_Statistics")) SWIG_fail;
22939   {
22940     if ( bUseExceptions ) {
22941       ClearErrorState();
22942     }
22943     {
22944       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22945       result = (Statistics *)new Statistics();
22946       SWIG_PYTHON_THREAD_END_ALLOW;
22947     }
22948 #ifndef SED_HACKS
22949     if ( bUseExceptions ) {
22950       CPLErr eclass = CPLGetLastErrorType();
22951       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22952         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22953       }
22954     }
22955 #endif
22956   }
22957   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Statistics, SWIG_POINTER_NEW |  0 );
22958   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
22959   return resultobj;
22960 fail:
22961   return NULL;
22962 }
22963 
22964 
Statistics_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22965 SWIGINTERN PyObject *Statistics_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22966   PyObject *obj;
22967   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
22968   SWIG_TypeNewClientData(SWIGTYPE_p_Statistics, SWIG_NewClientData(obj));
22969   return SWIG_Py_Void();
22970 }
22971 
_wrap_delete_MDArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)22972 SWIGINTERN PyObject *_wrap_delete_MDArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
22973   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
22974   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
22975   void *argp1 = 0 ;
22976   int res1 = 0 ;
22977   PyObject * obj0 = 0 ;
22978 
22979   if (!PyArg_ParseTuple(args,(char *)"O:delete_MDArray",&obj0)) SWIG_fail;
22980   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_DISOWN |  0 );
22981   if (!SWIG_IsOK(res1)) {
22982     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MDArray" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
22983   }
22984   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
22985   {
22986     if ( bUseExceptions ) {
22987       ClearErrorState();
22988     }
22989     {
22990       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
22991       delete_GDALMDArrayHS(arg1);
22992       SWIG_PYTHON_THREAD_END_ALLOW;
22993     }
22994 #ifndef SED_HACKS
22995     if ( bUseExceptions ) {
22996       CPLErr eclass = CPLGetLastErrorType();
22997       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
22998         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
22999       }
23000     }
23001 #endif
23002   }
23003   resultobj = SWIG_Py_Void();
23004   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23005   return resultobj;
23006 fail:
23007   return NULL;
23008 }
23009 
23010 
_wrap_MDArray_GetName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23011 SWIGINTERN PyObject *_wrap_MDArray_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23012   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23013   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23014   void *argp1 = 0 ;
23015   int res1 = 0 ;
23016   PyObject * obj0 = 0 ;
23017   char *result = 0 ;
23018 
23019   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetName",&obj0)) SWIG_fail;
23020   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23021   if (!SWIG_IsOK(res1)) {
23022     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetName" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23023   }
23024   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23025   {
23026     if ( bUseExceptions ) {
23027       ClearErrorState();
23028     }
23029     {
23030       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23031       result = (char *)GDALMDArrayHS_GetName(arg1);
23032       SWIG_PYTHON_THREAD_END_ALLOW;
23033     }
23034 #ifndef SED_HACKS
23035     if ( bUseExceptions ) {
23036       CPLErr eclass = CPLGetLastErrorType();
23037       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23038         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23039       }
23040     }
23041 #endif
23042   }
23043   resultobj = SWIG_FromCharPtr((const char *)result);
23044   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23045   return resultobj;
23046 fail:
23047   return NULL;
23048 }
23049 
23050 
_wrap_MDArray_GetFullName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23051 SWIGINTERN PyObject *_wrap_MDArray_GetFullName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23052   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23053   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23054   void *argp1 = 0 ;
23055   int res1 = 0 ;
23056   PyObject * obj0 = 0 ;
23057   char *result = 0 ;
23058 
23059   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetFullName",&obj0)) SWIG_fail;
23060   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23061   if (!SWIG_IsOK(res1)) {
23062     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetFullName" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23063   }
23064   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23065   {
23066     if ( bUseExceptions ) {
23067       ClearErrorState();
23068     }
23069     {
23070       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23071       result = (char *)GDALMDArrayHS_GetFullName(arg1);
23072       SWIG_PYTHON_THREAD_END_ALLOW;
23073     }
23074 #ifndef SED_HACKS
23075     if ( bUseExceptions ) {
23076       CPLErr eclass = CPLGetLastErrorType();
23077       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23078         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23079       }
23080     }
23081 #endif
23082   }
23083   resultobj = SWIG_FromCharPtr((const char *)result);
23084   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23085   return resultobj;
23086 fail:
23087   return NULL;
23088 }
23089 
23090 
_wrap_MDArray_GetTotalElementsCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23091 SWIGINTERN PyObject *_wrap_MDArray_GetTotalElementsCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23092   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23093   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23094   void *argp1 = 0 ;
23095   int res1 = 0 ;
23096   PyObject * obj0 = 0 ;
23097   unsigned long long result;
23098 
23099   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetTotalElementsCount",&obj0)) SWIG_fail;
23100   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23101   if (!SWIG_IsOK(res1)) {
23102     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetTotalElementsCount" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23103   }
23104   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23105   {
23106     if ( bUseExceptions ) {
23107       ClearErrorState();
23108     }
23109     {
23110       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23111       result = (unsigned long long)GDALMDArrayHS_GetTotalElementsCount(arg1);
23112       SWIG_PYTHON_THREAD_END_ALLOW;
23113     }
23114 #ifndef SED_HACKS
23115     if ( bUseExceptions ) {
23116       CPLErr eclass = CPLGetLastErrorType();
23117       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23118         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23119       }
23120     }
23121 #endif
23122   }
23123   resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result));
23124   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23125   return resultobj;
23126 fail:
23127   return NULL;
23128 }
23129 
23130 
_wrap_MDArray_GetDimensionCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23131 SWIGINTERN PyObject *_wrap_MDArray_GetDimensionCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23132   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23133   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23134   void *argp1 = 0 ;
23135   int res1 = 0 ;
23136   PyObject * obj0 = 0 ;
23137   size_t result;
23138 
23139   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetDimensionCount",&obj0)) SWIG_fail;
23140   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23141   if (!SWIG_IsOK(res1)) {
23142     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetDimensionCount" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23143   }
23144   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23145   {
23146     if ( bUseExceptions ) {
23147       ClearErrorState();
23148     }
23149     {
23150       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23151       result = GDALMDArrayHS_GetDimensionCount(arg1);
23152       SWIG_PYTHON_THREAD_END_ALLOW;
23153     }
23154 #ifndef SED_HACKS
23155     if ( bUseExceptions ) {
23156       CPLErr eclass = CPLGetLastErrorType();
23157       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23158         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23159       }
23160     }
23161 #endif
23162   }
23163   resultobj = SWIG_From_size_t(static_cast< size_t >(result));
23164   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23165   return resultobj;
23166 fail:
23167   return NULL;
23168 }
23169 
23170 
_wrap_MDArray_GetDimensions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23171 SWIGINTERN PyObject *_wrap_MDArray_GetDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23172   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23173   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23174   GDALDimensionHS ***arg2 = (GDALDimensionHS ***) 0 ;
23175   size_t *arg3 = (size_t *) 0 ;
23176   void *argp1 = 0 ;
23177   int res1 = 0 ;
23178   GDALDimensionHS **dims2 = 0 ;
23179   size_t nCount2 = 0 ;
23180   PyObject * obj0 = 0 ;
23181 
23182   {
23183     /* %typemap(in,numinputs=0) (GDALDimensionHS*** pdims, size_t* pnCount) */
23184     arg2 = &dims2;
23185     arg3 = &nCount2;
23186   }
23187   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetDimensions",&obj0)) SWIG_fail;
23188   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23189   if (!SWIG_IsOK(res1)) {
23190     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetDimensions" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23191   }
23192   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23193   {
23194     if ( bUseExceptions ) {
23195       ClearErrorState();
23196     }
23197     {
23198       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23199       GDALMDArrayHS_GetDimensions(arg1,arg2,arg3);
23200       SWIG_PYTHON_THREAD_END_ALLOW;
23201     }
23202 #ifndef SED_HACKS
23203     if ( bUseExceptions ) {
23204       CPLErr eclass = CPLGetLastErrorType();
23205       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23206         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23207       }
23208     }
23209 #endif
23210   }
23211   resultobj = SWIG_Py_Void();
23212   {
23213     /* %typemap(argout) (GDALDimensionHS*** pdims, size_t* pnCount) */
23214     PyObject *list = PyList_New( *arg3 );
23215     for( size_t i = 0; i < *arg3; i++ ) {
23216       PyList_SetItem(list, i,
23217         SWIG_NewPointerObj((void*)(*arg2)[i],SWIGTYPE_p_GDALDimensionHS,SWIG_POINTER_OWN) );
23218     }
23219     Py_DECREF(resultobj);
23220     resultobj = list;
23221   }
23222   {
23223     /* %typemap(freearg) (GDALDimensionHS*** pdims, size_t* pnCount) */
23224     CPLFree(*arg2);
23225   }
23226   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23227   return resultobj;
23228 fail:
23229   {
23230     /* %typemap(freearg) (GDALDimensionHS*** pdims, size_t* pnCount) */
23231     CPLFree(*arg2);
23232   }
23233   return NULL;
23234 }
23235 
23236 
_wrap_MDArray_GetBlockSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23237 SWIGINTERN PyObject *_wrap_MDArray_GetBlockSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23238   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23239   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23240   GUIntBig **arg2 = (GUIntBig **) 0 ;
23241   size_t *arg3 = (size_t *) 0 ;
23242   void *argp1 = 0 ;
23243   int res1 = 0 ;
23244   GUIntBig *vals2 = 0 ;
23245   size_t nCount2 = 0 ;
23246   PyObject * obj0 = 0 ;
23247 
23248   {
23249     /* %typemap(in,numinputs=0) (GUIntBig** pvals, size_t* pnCount) */
23250     arg2 = &vals2;
23251     arg3 = &nCount2;
23252   }
23253   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetBlockSize",&obj0)) SWIG_fail;
23254   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23255   if (!SWIG_IsOK(res1)) {
23256     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetBlockSize" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23257   }
23258   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23259   {
23260     if ( bUseExceptions ) {
23261       ClearErrorState();
23262     }
23263     {
23264       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23265       GDALMDArrayHS_GetBlockSize(arg1,arg2,arg3);
23266       SWIG_PYTHON_THREAD_END_ALLOW;
23267     }
23268 #ifndef SED_HACKS
23269     if ( bUseExceptions ) {
23270       CPLErr eclass = CPLGetLastErrorType();
23271       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23272         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23273       }
23274     }
23275 #endif
23276   }
23277   resultobj = SWIG_Py_Void();
23278   {
23279     /* %typemap(argout) (GUIntBig** pvals, size_t* pnCount) */
23280     PyObject *list = PyList_New( *arg3 );
23281     for( size_t i = 0; i < *arg3; i++ ) {
23282       char szTmp[32];
23283       sprintf(szTmp, CPL_FRMT_GUIB, (*arg2)[i]);
23284       PyObject *o = PyLong_FromString(szTmp, NULL, 10);
23285       PyList_SetItem(list, i, o );
23286     }
23287     Py_DECREF(resultobj);
23288     resultobj = list;
23289   }
23290   {
23291     /* %typemap(freearg) (GUIntBig** pvals, size_t* pnCount) */
23292     CPLFree(*arg2);
23293   }
23294   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23295   return resultobj;
23296 fail:
23297   {
23298     /* %typemap(freearg) (GUIntBig** pvals, size_t* pnCount) */
23299     CPLFree(*arg2);
23300   }
23301   return NULL;
23302 }
23303 
23304 
_wrap_MDArray_GetProcessingChunkSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23305 SWIGINTERN PyObject *_wrap_MDArray_GetProcessingChunkSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23306   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23307   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23308   size_t arg2 ;
23309   GUIntBig **arg3 = (GUIntBig **) 0 ;
23310   size_t *arg4 = (size_t *) 0 ;
23311   void *argp1 = 0 ;
23312   int res1 = 0 ;
23313   size_t val2 ;
23314   int ecode2 = 0 ;
23315   GUIntBig *vals3 = 0 ;
23316   size_t nCount3 = 0 ;
23317   PyObject * obj0 = 0 ;
23318   PyObject * obj1 = 0 ;
23319 
23320   {
23321     /* %typemap(in,numinputs=0) (GUIntBig** pvals, size_t* pnCount) */
23322     arg3 = &vals3;
23323     arg4 = &nCount3;
23324   }
23325   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_GetProcessingChunkSize",&obj0,&obj1)) SWIG_fail;
23326   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23327   if (!SWIG_IsOK(res1)) {
23328     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetProcessingChunkSize" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23329   }
23330   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23331   ecode2 = SWIG_AsVal_size_t(obj1, &val2);
23332   if (!SWIG_IsOK(ecode2)) {
23333     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_GetProcessingChunkSize" "', argument " "2"" of type '" "size_t""'");
23334   }
23335   arg2 = static_cast< size_t >(val2);
23336   {
23337     if ( bUseExceptions ) {
23338       ClearErrorState();
23339     }
23340     {
23341       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23342       GDALMDArrayHS_GetProcessingChunkSize(arg1,arg2,arg3,arg4);
23343       SWIG_PYTHON_THREAD_END_ALLOW;
23344     }
23345 #ifndef SED_HACKS
23346     if ( bUseExceptions ) {
23347       CPLErr eclass = CPLGetLastErrorType();
23348       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23349         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23350       }
23351     }
23352 #endif
23353   }
23354   resultobj = SWIG_Py_Void();
23355   {
23356     /* %typemap(argout) (GUIntBig** pvals, size_t* pnCount) */
23357     PyObject *list = PyList_New( *arg4 );
23358     for( size_t i = 0; i < *arg4; i++ ) {
23359       char szTmp[32];
23360       sprintf(szTmp, CPL_FRMT_GUIB, (*arg3)[i]);
23361       PyObject *o = PyLong_FromString(szTmp, NULL, 10);
23362       PyList_SetItem(list, i, o );
23363     }
23364     Py_DECREF(resultobj);
23365     resultobj = list;
23366   }
23367   {
23368     /* %typemap(freearg) (GUIntBig** pvals, size_t* pnCount) */
23369     CPLFree(*arg3);
23370   }
23371   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23372   return resultobj;
23373 fail:
23374   {
23375     /* %typemap(freearg) (GUIntBig** pvals, size_t* pnCount) */
23376     CPLFree(*arg3);
23377   }
23378   return NULL;
23379 }
23380 
23381 
_wrap_MDArray_GetDataType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23382 SWIGINTERN PyObject *_wrap_MDArray_GetDataType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23383   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23384   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23385   void *argp1 = 0 ;
23386   int res1 = 0 ;
23387   PyObject * obj0 = 0 ;
23388   GDALExtendedDataTypeHS *result = 0 ;
23389 
23390   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetDataType",&obj0)) SWIG_fail;
23391   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23392   if (!SWIG_IsOK(res1)) {
23393     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetDataType" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23394   }
23395   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23396   {
23397     if ( bUseExceptions ) {
23398       ClearErrorState();
23399     }
23400     {
23401       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23402       result = (GDALExtendedDataTypeHS *)GDALMDArrayHS_GetDataType(arg1);
23403       SWIG_PYTHON_THREAD_END_ALLOW;
23404     }
23405 #ifndef SED_HACKS
23406     if ( bUseExceptions ) {
23407       CPLErr eclass = CPLGetLastErrorType();
23408       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23409         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23410       }
23411     }
23412 #endif
23413   }
23414   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_OWN |  0 );
23415   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23416   return resultobj;
23417 fail:
23418   return NULL;
23419 }
23420 
23421 
_wrap_MDArray_GetStructuralInfo(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23422 SWIGINTERN PyObject *_wrap_MDArray_GetStructuralInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23423   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23424   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23425   void *argp1 = 0 ;
23426   int res1 = 0 ;
23427   PyObject * obj0 = 0 ;
23428   char **result = 0 ;
23429 
23430   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetStructuralInfo",&obj0)) SWIG_fail;
23431   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23432   if (!SWIG_IsOK(res1)) {
23433     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetStructuralInfo" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23434   }
23435   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23436   {
23437     if ( bUseExceptions ) {
23438       ClearErrorState();
23439     }
23440     {
23441       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23442       result = (char **)GDALMDArrayHS_GetStructuralInfo(arg1);
23443       SWIG_PYTHON_THREAD_END_ALLOW;
23444     }
23445 #ifndef SED_HACKS
23446     if ( bUseExceptions ) {
23447       CPLErr eclass = CPLGetLastErrorType();
23448       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23449         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23450       }
23451     }
23452 #endif
23453   }
23454   {
23455     /* %typemap(out) char **dict */
23456     char **stringarray = result;
23457     resultobj = PyDict_New();
23458     if ( stringarray != NULL ) {
23459       while (*stringarray != NULL ) {
23460         char const *valptr;
23461         char *keyptr;
23462         const char* pszSep = strchr( *stringarray, '=' );
23463         if ( pszSep != NULL) {
23464           keyptr = CPLStrdup(*stringarray);
23465           keyptr[pszSep - *stringarray] = '\0';
23466           valptr = pszSep + 1;
23467           PyObject *nm = GDALPythonObjectFromCStr( keyptr );
23468           PyObject *val = GDALPythonObjectFromCStr( valptr );
23469           PyDict_SetItem(resultobj, nm, val );
23470           Py_DECREF(nm);
23471           Py_DECREF(val);
23472           CPLFree( keyptr );
23473         }
23474         stringarray++;
23475       }
23476     }
23477   }
23478   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23479   return resultobj;
23480 fail:
23481   return NULL;
23482 }
23483 
23484 
_wrap_MDArray_Read(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23485 SWIGINTERN PyObject *_wrap_MDArray_Read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23486   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23487   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23488   int arg2 ;
23489   GUIntBig *arg3 = (GUIntBig *) 0 ;
23490   int arg4 ;
23491   GUIntBig *arg5 = (GUIntBig *) 0 ;
23492   int arg6 ;
23493   GIntBig *arg7 = (GIntBig *) 0 ;
23494   int arg8 ;
23495   GIntBig *arg9 = (GIntBig *) 0 ;
23496   GDALExtendedDataTypeHS *arg10 = (GDALExtendedDataTypeHS *) 0 ;
23497   void **arg11 = (void **) 0 ;
23498   void *argp1 = 0 ;
23499   int res1 = 0 ;
23500   void *argp10 = 0 ;
23501   int res10 = 0 ;
23502   void *pyObject11 = NULL ;
23503   PyObject * obj0 = 0 ;
23504   PyObject * obj1 = 0 ;
23505   PyObject * obj2 = 0 ;
23506   PyObject * obj3 = 0 ;
23507   PyObject * obj4 = 0 ;
23508   PyObject * obj5 = 0 ;
23509   CPLErr result;
23510 
23511   {
23512     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject11 = NULL ) */
23513     arg11 = &pyObject11;
23514   }
23515   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:MDArray_Read",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
23516   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23517   if (!SWIG_IsOK(res1)) {
23518     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_Read" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23519   }
23520   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23521   {
23522     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
23523     /* check if is List */
23524     if ( !PySequence_Check(obj1) ) {
23525       PyErr_SetString(PyExc_TypeError, "not a sequence");
23526       SWIG_fail;
23527     }
23528     Py_ssize_t size = PySequence_Size(obj1);
23529     if( size != (int)size ) {
23530       PyErr_SetString(PyExc_TypeError, "too big sequence");
23531       SWIG_fail;
23532     }
23533     arg2 = (int)size;
23534     arg3 = (GUIntBig*) malloc(arg2*sizeof(GUIntBig));
23535     for( int i = 0; i<arg2; i++ ) {
23536       PyObject *o = PySequence_GetItem(obj1,i);
23537       PY_LONG_LONG val;
23538       if ( !PyArg_Parse(o,"K",&val) ) {
23539         PyErr_SetString(PyExc_TypeError, "not an integer");
23540         Py_DECREF(o);
23541         SWIG_fail;
23542       }
23543       arg3[i] = (GUIntBig)val;
23544       Py_DECREF(o);
23545     }
23546   }
23547   {
23548     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
23549     /* check if is List */
23550     if ( !PySequence_Check(obj2) ) {
23551       PyErr_SetString(PyExc_TypeError, "not a sequence");
23552       SWIG_fail;
23553     }
23554     Py_ssize_t size = PySequence_Size(obj2);
23555     if( size != (int)size ) {
23556       PyErr_SetString(PyExc_TypeError, "too big sequence");
23557       SWIG_fail;
23558     }
23559     arg4 = (int)size;
23560     arg5 = (GUIntBig*) malloc(arg4*sizeof(GUIntBig));
23561     for( int i = 0; i<arg4; i++ ) {
23562       PyObject *o = PySequence_GetItem(obj2,i);
23563       PY_LONG_LONG val;
23564       if ( !PyArg_Parse(o,"K",&val) ) {
23565         PyErr_SetString(PyExc_TypeError, "not an integer");
23566         Py_DECREF(o);
23567         SWIG_fail;
23568       }
23569       arg5[i] = (GUIntBig)val;
23570       Py_DECREF(o);
23571     }
23572   }
23573   {
23574     /* %typemap(in,numinputs=1) (int nList, GIntBig* pList)*/
23575     /* check if is List */
23576     if ( !PySequence_Check(obj3) ) {
23577       PyErr_SetString(PyExc_TypeError, "not a sequence");
23578       SWIG_fail;
23579     }
23580     Py_ssize_t size = PySequence_Size(obj3);
23581     if( size != (int)size ) {
23582       PyErr_SetString(PyExc_TypeError, "too big sequence");
23583       SWIG_fail;
23584     }
23585     arg6 = (int)size;
23586     arg7 = (GIntBig*) malloc(arg6*sizeof(GIntBig));
23587     for( int i = 0; i<arg6; i++ ) {
23588       PyObject *o = PySequence_GetItem(obj3,i);
23589       PY_LONG_LONG val;
23590       if ( !PyArg_Parse(o,"L",&val) ) {
23591         PyErr_SetString(PyExc_TypeError, "not an integer");
23592         Py_DECREF(o);
23593         SWIG_fail;
23594       }
23595       arg7[i] = (GIntBig)val;
23596       Py_DECREF(o);
23597     }
23598   }
23599   {
23600     /* %typemap(in,numinputs=1) (int nList, GIntBig* pList)*/
23601     /* check if is List */
23602     if ( !PySequence_Check(obj4) ) {
23603       PyErr_SetString(PyExc_TypeError, "not a sequence");
23604       SWIG_fail;
23605     }
23606     Py_ssize_t size = PySequence_Size(obj4);
23607     if( size != (int)size ) {
23608       PyErr_SetString(PyExc_TypeError, "too big sequence");
23609       SWIG_fail;
23610     }
23611     arg8 = (int)size;
23612     arg9 = (GIntBig*) malloc(arg8*sizeof(GIntBig));
23613     for( int i = 0; i<arg8; i++ ) {
23614       PyObject *o = PySequence_GetItem(obj4,i);
23615       PY_LONG_LONG val;
23616       if ( !PyArg_Parse(o,"L",&val) ) {
23617         PyErr_SetString(PyExc_TypeError, "not an integer");
23618         Py_DECREF(o);
23619         SWIG_fail;
23620       }
23621       arg9[i] = (GIntBig)val;
23622       Py_DECREF(o);
23623     }
23624   }
23625   res10 = SWIG_ConvertPtr(obj5, &argp10,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23626   if (!SWIG_IsOK(res10)) {
23627     SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "MDArray_Read" "', argument " "10"" of type '" "GDALExtendedDataTypeHS *""'");
23628   }
23629   arg10 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp10);
23630   {
23631     if (!arg10) {
23632       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23633     }
23634   }
23635   {
23636     if ( bUseExceptions ) {
23637       ClearErrorState();
23638     }
23639     {
23640       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23641       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_Read(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11));
23642       SWIG_PYTHON_THREAD_END_ALLOW;
23643     }
23644 #ifndef SED_HACKS
23645     if ( bUseExceptions ) {
23646       CPLErr eclass = CPLGetLastErrorType();
23647       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23648         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23649       }
23650     }
23651 #endif
23652   }
23653   resultobj = SWIG_From_int(static_cast< int >(result));
23654   {
23655     /* %typemap(argout) ( void **outPythonObject ) */
23656     Py_XDECREF(resultobj);
23657     if (*arg11)
23658     {
23659       resultobj = (PyObject*)*arg11;
23660     }
23661     else
23662     {
23663       resultobj = Py_None;
23664       Py_INCREF(resultobj);
23665     }
23666   }
23667   {
23668     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23669     if (arg3) {
23670       free((void*) arg3);
23671     }
23672   }
23673   {
23674     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23675     if (arg5) {
23676       free((void*) arg5);
23677     }
23678   }
23679   {
23680     /* %typemap(freearg) (int nList, GIntBig* pList) */
23681     if (arg7) {
23682       free((void*) arg7);
23683     }
23684   }
23685   {
23686     /* %typemap(freearg) (int nList, GIntBig* pList) */
23687     if (arg9) {
23688       free((void*) arg9);
23689     }
23690   }
23691   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23692   return resultobj;
23693 fail:
23694   {
23695     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23696     if (arg3) {
23697       free((void*) arg3);
23698     }
23699   }
23700   {
23701     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23702     if (arg5) {
23703       free((void*) arg5);
23704     }
23705   }
23706   {
23707     /* %typemap(freearg) (int nList, GIntBig* pList) */
23708     if (arg7) {
23709       free((void*) arg7);
23710     }
23711   }
23712   {
23713     /* %typemap(freearg) (int nList, GIntBig* pList) */
23714     if (arg9) {
23715       free((void*) arg9);
23716     }
23717   }
23718   return NULL;
23719 }
23720 
23721 
_wrap_MDArray_WriteStringArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23722 SWIGINTERN PyObject *_wrap_MDArray_WriteStringArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23723   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23724   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23725   int arg2 ;
23726   GUIntBig *arg3 = (GUIntBig *) 0 ;
23727   int arg4 ;
23728   GUIntBig *arg5 = (GUIntBig *) 0 ;
23729   int arg6 ;
23730   GIntBig *arg7 = (GIntBig *) 0 ;
23731   GDALExtendedDataTypeHS *arg8 = (GDALExtendedDataTypeHS *) 0 ;
23732   char **arg9 = (char **) 0 ;
23733   void *argp1 = 0 ;
23734   int res1 = 0 ;
23735   void *argp8 = 0 ;
23736   int res8 = 0 ;
23737   PyObject * obj0 = 0 ;
23738   PyObject * obj1 = 0 ;
23739   PyObject * obj2 = 0 ;
23740   PyObject * obj3 = 0 ;
23741   PyObject * obj4 = 0 ;
23742   PyObject * obj5 = 0 ;
23743   CPLErr result;
23744 
23745   if (!PyArg_ParseTuple(args,(char *)"OOOOOO:MDArray_WriteStringArray",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
23746   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23747   if (!SWIG_IsOK(res1)) {
23748     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_WriteStringArray" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23749   }
23750   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23751   {
23752     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
23753     /* check if is List */
23754     if ( !PySequence_Check(obj1) ) {
23755       PyErr_SetString(PyExc_TypeError, "not a sequence");
23756       SWIG_fail;
23757     }
23758     Py_ssize_t size = PySequence_Size(obj1);
23759     if( size != (int)size ) {
23760       PyErr_SetString(PyExc_TypeError, "too big sequence");
23761       SWIG_fail;
23762     }
23763     arg2 = (int)size;
23764     arg3 = (GUIntBig*) malloc(arg2*sizeof(GUIntBig));
23765     for( int i = 0; i<arg2; i++ ) {
23766       PyObject *o = PySequence_GetItem(obj1,i);
23767       PY_LONG_LONG val;
23768       if ( !PyArg_Parse(o,"K",&val) ) {
23769         PyErr_SetString(PyExc_TypeError, "not an integer");
23770         Py_DECREF(o);
23771         SWIG_fail;
23772       }
23773       arg3[i] = (GUIntBig)val;
23774       Py_DECREF(o);
23775     }
23776   }
23777   {
23778     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
23779     /* check if is List */
23780     if ( !PySequence_Check(obj2) ) {
23781       PyErr_SetString(PyExc_TypeError, "not a sequence");
23782       SWIG_fail;
23783     }
23784     Py_ssize_t size = PySequence_Size(obj2);
23785     if( size != (int)size ) {
23786       PyErr_SetString(PyExc_TypeError, "too big sequence");
23787       SWIG_fail;
23788     }
23789     arg4 = (int)size;
23790     arg5 = (GUIntBig*) malloc(arg4*sizeof(GUIntBig));
23791     for( int i = 0; i<arg4; i++ ) {
23792       PyObject *o = PySequence_GetItem(obj2,i);
23793       PY_LONG_LONG val;
23794       if ( !PyArg_Parse(o,"K",&val) ) {
23795         PyErr_SetString(PyExc_TypeError, "not an integer");
23796         Py_DECREF(o);
23797         SWIG_fail;
23798       }
23799       arg5[i] = (GUIntBig)val;
23800       Py_DECREF(o);
23801     }
23802   }
23803   {
23804     /* %typemap(in,numinputs=1) (int nList, GIntBig* pList)*/
23805     /* check if is List */
23806     if ( !PySequence_Check(obj3) ) {
23807       PyErr_SetString(PyExc_TypeError, "not a sequence");
23808       SWIG_fail;
23809     }
23810     Py_ssize_t size = PySequence_Size(obj3);
23811     if( size != (int)size ) {
23812       PyErr_SetString(PyExc_TypeError, "too big sequence");
23813       SWIG_fail;
23814     }
23815     arg6 = (int)size;
23816     arg7 = (GIntBig*) malloc(arg6*sizeof(GIntBig));
23817     for( int i = 0; i<arg6; i++ ) {
23818       PyObject *o = PySequence_GetItem(obj3,i);
23819       PY_LONG_LONG val;
23820       if ( !PyArg_Parse(o,"L",&val) ) {
23821         PyErr_SetString(PyExc_TypeError, "not an integer");
23822         Py_DECREF(o);
23823         SWIG_fail;
23824       }
23825       arg7[i] = (GIntBig)val;
23826       Py_DECREF(o);
23827     }
23828   }
23829   res8 = SWIG_ConvertPtr(obj4, &argp8,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
23830   if (!SWIG_IsOK(res8)) {
23831     SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "MDArray_WriteStringArray" "', argument " "8"" of type '" "GDALExtendedDataTypeHS *""'");
23832   }
23833   arg8 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp8);
23834   {
23835     /* %typemap(in) char **options */
23836     int bErr = FALSE;
23837     arg9 = CSLFromPySequence(obj5, &bErr);
23838     if( bErr )
23839     {
23840       SWIG_fail;
23841     }
23842   }
23843   {
23844     if (!arg8) {
23845       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23846     }
23847   }
23848   {
23849     if ( bUseExceptions ) {
23850       ClearErrorState();
23851     }
23852     {
23853       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23854       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_WriteStringArray(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9));
23855       SWIG_PYTHON_THREAD_END_ALLOW;
23856     }
23857 #ifndef SED_HACKS
23858     if ( bUseExceptions ) {
23859       CPLErr eclass = CPLGetLastErrorType();
23860       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
23861         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
23862       }
23863     }
23864 #endif
23865   }
23866   resultobj = SWIG_From_int(static_cast< int >(result));
23867   {
23868     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23869     if (arg3) {
23870       free((void*) arg3);
23871     }
23872   }
23873   {
23874     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23875     if (arg5) {
23876       free((void*) arg5);
23877     }
23878   }
23879   {
23880     /* %typemap(freearg) (int nList, GIntBig* pList) */
23881     if (arg7) {
23882       free((void*) arg7);
23883     }
23884   }
23885   {
23886     /* %typemap(freearg) char **options */
23887     CSLDestroy( arg9 );
23888   }
23889   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
23890   return resultobj;
23891 fail:
23892   {
23893     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23894     if (arg3) {
23895       free((void*) arg3);
23896     }
23897   }
23898   {
23899     /* %typemap(freearg) (int nList, GUIntBig* pList) */
23900     if (arg5) {
23901       free((void*) arg5);
23902     }
23903   }
23904   {
23905     /* %typemap(freearg) (int nList, GIntBig* pList) */
23906     if (arg7) {
23907       free((void*) arg7);
23908     }
23909   }
23910   {
23911     /* %typemap(freearg) char **options */
23912     CSLDestroy( arg9 );
23913   }
23914   return NULL;
23915 }
23916 
23917 
_wrap_MDArray_Write(PyObject * SWIGUNUSEDPARM (self),PyObject * args)23918 SWIGINTERN PyObject *_wrap_MDArray_Write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
23919   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
23920   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
23921   int arg2 ;
23922   GUIntBig *arg3 = (GUIntBig *) 0 ;
23923   int arg4 ;
23924   GUIntBig *arg5 = (GUIntBig *) 0 ;
23925   int arg6 ;
23926   GIntBig *arg7 = (GIntBig *) 0 ;
23927   int arg8 ;
23928   GIntBig *arg9 = (GIntBig *) 0 ;
23929   GDALExtendedDataTypeHS *arg10 = (GDALExtendedDataTypeHS *) 0 ;
23930   GIntBig arg11 ;
23931   char *arg12 = (char *) 0 ;
23932   void *argp1 = 0 ;
23933   int res1 = 0 ;
23934   void *argp10 = 0 ;
23935   int res10 = 0 ;
23936   int alloc11 = 0 ;
23937   bool viewIsValid11 = false ;
23938   Py_buffer view11 ;
23939   PyObject * obj0 = 0 ;
23940   PyObject * obj1 = 0 ;
23941   PyObject * obj2 = 0 ;
23942   PyObject * obj3 = 0 ;
23943   PyObject * obj4 = 0 ;
23944   PyObject * obj5 = 0 ;
23945   PyObject * obj6 = 0 ;
23946   CPLErr result;
23947 
23948   if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:MDArray_Write",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
23949   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
23950   if (!SWIG_IsOK(res1)) {
23951     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_Write" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
23952   }
23953   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
23954   {
23955     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
23956     /* check if is List */
23957     if ( !PySequence_Check(obj1) ) {
23958       PyErr_SetString(PyExc_TypeError, "not a sequence");
23959       SWIG_fail;
23960     }
23961     Py_ssize_t size = PySequence_Size(obj1);
23962     if( size != (int)size ) {
23963       PyErr_SetString(PyExc_TypeError, "too big sequence");
23964       SWIG_fail;
23965     }
23966     arg2 = (int)size;
23967     arg3 = (GUIntBig*) malloc(arg2*sizeof(GUIntBig));
23968     for( int i = 0; i<arg2; i++ ) {
23969       PyObject *o = PySequence_GetItem(obj1,i);
23970       PY_LONG_LONG val;
23971       if ( !PyArg_Parse(o,"K",&val) ) {
23972         PyErr_SetString(PyExc_TypeError, "not an integer");
23973         Py_DECREF(o);
23974         SWIG_fail;
23975       }
23976       arg3[i] = (GUIntBig)val;
23977       Py_DECREF(o);
23978     }
23979   }
23980   {
23981     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
23982     /* check if is List */
23983     if ( !PySequence_Check(obj2) ) {
23984       PyErr_SetString(PyExc_TypeError, "not a sequence");
23985       SWIG_fail;
23986     }
23987     Py_ssize_t size = PySequence_Size(obj2);
23988     if( size != (int)size ) {
23989       PyErr_SetString(PyExc_TypeError, "too big sequence");
23990       SWIG_fail;
23991     }
23992     arg4 = (int)size;
23993     arg5 = (GUIntBig*) malloc(arg4*sizeof(GUIntBig));
23994     for( int i = 0; i<arg4; i++ ) {
23995       PyObject *o = PySequence_GetItem(obj2,i);
23996       PY_LONG_LONG val;
23997       if ( !PyArg_Parse(o,"K",&val) ) {
23998         PyErr_SetString(PyExc_TypeError, "not an integer");
23999         Py_DECREF(o);
24000         SWIG_fail;
24001       }
24002       arg5[i] = (GUIntBig)val;
24003       Py_DECREF(o);
24004     }
24005   }
24006   {
24007     /* %typemap(in,numinputs=1) (int nList, GIntBig* pList)*/
24008     /* check if is List */
24009     if ( !PySequence_Check(obj3) ) {
24010       PyErr_SetString(PyExc_TypeError, "not a sequence");
24011       SWIG_fail;
24012     }
24013     Py_ssize_t size = PySequence_Size(obj3);
24014     if( size != (int)size ) {
24015       PyErr_SetString(PyExc_TypeError, "too big sequence");
24016       SWIG_fail;
24017     }
24018     arg6 = (int)size;
24019     arg7 = (GIntBig*) malloc(arg6*sizeof(GIntBig));
24020     for( int i = 0; i<arg6; i++ ) {
24021       PyObject *o = PySequence_GetItem(obj3,i);
24022       PY_LONG_LONG val;
24023       if ( !PyArg_Parse(o,"L",&val) ) {
24024         PyErr_SetString(PyExc_TypeError, "not an integer");
24025         Py_DECREF(o);
24026         SWIG_fail;
24027       }
24028       arg7[i] = (GIntBig)val;
24029       Py_DECREF(o);
24030     }
24031   }
24032   {
24033     /* %typemap(in,numinputs=1) (int nList, GIntBig* pList)*/
24034     /* check if is List */
24035     if ( !PySequence_Check(obj4) ) {
24036       PyErr_SetString(PyExc_TypeError, "not a sequence");
24037       SWIG_fail;
24038     }
24039     Py_ssize_t size = PySequence_Size(obj4);
24040     if( size != (int)size ) {
24041       PyErr_SetString(PyExc_TypeError, "too big sequence");
24042       SWIG_fail;
24043     }
24044     arg8 = (int)size;
24045     arg9 = (GIntBig*) malloc(arg8*sizeof(GIntBig));
24046     for( int i = 0; i<arg8; i++ ) {
24047       PyObject *o = PySequence_GetItem(obj4,i);
24048       PY_LONG_LONG val;
24049       if ( !PyArg_Parse(o,"L",&val) ) {
24050         PyErr_SetString(PyExc_TypeError, "not an integer");
24051         Py_DECREF(o);
24052         SWIG_fail;
24053       }
24054       arg9[i] = (GIntBig)val;
24055       Py_DECREF(o);
24056     }
24057   }
24058   res10 = SWIG_ConvertPtr(obj5, &argp10,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
24059   if (!SWIG_IsOK(res10)) {
24060     SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "MDArray_Write" "', argument " "10"" of type '" "GDALExtendedDataTypeHS *""'");
24061   }
24062   arg10 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp10);
24063   {
24064     /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
24065     {
24066       if (PyObject_GetBuffer(obj6, &view11, PyBUF_SIMPLE) == 0)
24067       {
24068         viewIsValid11 = true;
24069         arg11 = view11.len;
24070         arg12 = (char *) view11.buf;
24071         goto ok;
24072       }
24073       else
24074       {
24075         PyErr_Clear();
24076       }
24077     }
24078     if (PyUnicode_Check(obj6))
24079     {
24080       size_t safeLen = 0;
24081       int ret = SWIG_AsCharPtrAndSize(obj6, (char**) &arg12, &safeLen, &alloc11);
24082       if (!SWIG_IsOK(ret)) {
24083         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
24084       }
24085 
24086       if (safeLen) safeLen--;
24087       arg11 = (GIntBig) safeLen;
24088     }
24089     else
24090     {
24091       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
24092       SWIG_fail;
24093     }
24094     ok: ;
24095   }
24096   {
24097     if (!arg10) {
24098       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24099     }
24100   }
24101   {
24102     if ( bUseExceptions ) {
24103       ClearErrorState();
24104     }
24105     {
24106       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24107       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_Write(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12));
24108       SWIG_PYTHON_THREAD_END_ALLOW;
24109     }
24110 #ifndef SED_HACKS
24111     if ( bUseExceptions ) {
24112       CPLErr eclass = CPLGetLastErrorType();
24113       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24114         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24115       }
24116     }
24117 #endif
24118   }
24119   resultobj = SWIG_From_int(static_cast< int >(result));
24120   {
24121     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24122     if (arg3) {
24123       free((void*) arg3);
24124     }
24125   }
24126   {
24127     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24128     if (arg5) {
24129       free((void*) arg5);
24130     }
24131   }
24132   {
24133     /* %typemap(freearg) (int nList, GIntBig* pList) */
24134     if (arg7) {
24135       free((void*) arg7);
24136     }
24137   }
24138   {
24139     /* %typemap(freearg) (int nList, GIntBig* pList) */
24140     if (arg9) {
24141       free((void*) arg9);
24142     }
24143   }
24144   {
24145     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
24146     if( viewIsValid11 ) {
24147       PyBuffer_Release(&view11);
24148     }
24149     else if( alloc11 == SWIG_NEWOBJ ) {
24150       delete[] arg12;
24151     }
24152   }
24153   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24154   return resultobj;
24155 fail:
24156   {
24157     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24158     if (arg3) {
24159       free((void*) arg3);
24160     }
24161   }
24162   {
24163     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24164     if (arg5) {
24165       free((void*) arg5);
24166     }
24167   }
24168   {
24169     /* %typemap(freearg) (int nList, GIntBig* pList) */
24170     if (arg7) {
24171       free((void*) arg7);
24172     }
24173   }
24174   {
24175     /* %typemap(freearg) (int nList, GIntBig* pList) */
24176     if (arg9) {
24177       free((void*) arg9);
24178     }
24179   }
24180   {
24181     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
24182     if( viewIsValid11 ) {
24183       PyBuffer_Release(&view11);
24184     }
24185     else if( alloc11 == SWIG_NEWOBJ ) {
24186       delete[] arg12;
24187     }
24188   }
24189   return NULL;
24190 }
24191 
24192 
_wrap_MDArray_AdviseRead(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24193 SWIGINTERN PyObject *_wrap_MDArray_AdviseRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24194   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24195   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24196   int arg2 ;
24197   GUIntBig *arg3 = (GUIntBig *) 0 ;
24198   int arg4 ;
24199   GUIntBig *arg5 = (GUIntBig *) 0 ;
24200   void *argp1 = 0 ;
24201   int res1 = 0 ;
24202   PyObject * obj0 = 0 ;
24203   PyObject * obj1 = 0 ;
24204   PyObject * obj2 = 0 ;
24205   CPLErr result;
24206 
24207   if (!PyArg_ParseTuple(args,(char *)"OOO:MDArray_AdviseRead",&obj0,&obj1,&obj2)) SWIG_fail;
24208   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24209   if (!SWIG_IsOK(res1)) {
24210     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_AdviseRead" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24211   }
24212   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24213   {
24214     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
24215     /* check if is List */
24216     if ( !PySequence_Check(obj1) ) {
24217       PyErr_SetString(PyExc_TypeError, "not a sequence");
24218       SWIG_fail;
24219     }
24220     Py_ssize_t size = PySequence_Size(obj1);
24221     if( size != (int)size ) {
24222       PyErr_SetString(PyExc_TypeError, "too big sequence");
24223       SWIG_fail;
24224     }
24225     arg2 = (int)size;
24226     arg3 = (GUIntBig*) malloc(arg2*sizeof(GUIntBig));
24227     for( int i = 0; i<arg2; i++ ) {
24228       PyObject *o = PySequence_GetItem(obj1,i);
24229       PY_LONG_LONG val;
24230       if ( !PyArg_Parse(o,"K",&val) ) {
24231         PyErr_SetString(PyExc_TypeError, "not an integer");
24232         Py_DECREF(o);
24233         SWIG_fail;
24234       }
24235       arg3[i] = (GUIntBig)val;
24236       Py_DECREF(o);
24237     }
24238   }
24239   {
24240     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
24241     /* check if is List */
24242     if ( !PySequence_Check(obj2) ) {
24243       PyErr_SetString(PyExc_TypeError, "not a sequence");
24244       SWIG_fail;
24245     }
24246     Py_ssize_t size = PySequence_Size(obj2);
24247     if( size != (int)size ) {
24248       PyErr_SetString(PyExc_TypeError, "too big sequence");
24249       SWIG_fail;
24250     }
24251     arg4 = (int)size;
24252     arg5 = (GUIntBig*) malloc(arg4*sizeof(GUIntBig));
24253     for( int i = 0; i<arg4; i++ ) {
24254       PyObject *o = PySequence_GetItem(obj2,i);
24255       PY_LONG_LONG val;
24256       if ( !PyArg_Parse(o,"K",&val) ) {
24257         PyErr_SetString(PyExc_TypeError, "not an integer");
24258         Py_DECREF(o);
24259         SWIG_fail;
24260       }
24261       arg5[i] = (GUIntBig)val;
24262       Py_DECREF(o);
24263     }
24264   }
24265   {
24266     if ( bUseExceptions ) {
24267       ClearErrorState();
24268     }
24269     {
24270       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24271       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_AdviseRead(arg1,arg2,arg3,arg4,arg5));
24272       SWIG_PYTHON_THREAD_END_ALLOW;
24273     }
24274 #ifndef SED_HACKS
24275     if ( bUseExceptions ) {
24276       CPLErr eclass = CPLGetLastErrorType();
24277       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24278         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24279       }
24280     }
24281 #endif
24282   }
24283   resultobj = SWIG_From_int(static_cast< int >(result));
24284   {
24285     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24286     if (arg3) {
24287       free((void*) arg3);
24288     }
24289   }
24290   {
24291     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24292     if (arg5) {
24293       free((void*) arg5);
24294     }
24295   }
24296   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24297   return resultobj;
24298 fail:
24299   {
24300     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24301     if (arg3) {
24302       free((void*) arg3);
24303     }
24304   }
24305   {
24306     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24307     if (arg5) {
24308       free((void*) arg5);
24309     }
24310   }
24311   return NULL;
24312 }
24313 
24314 
_wrap_MDArray_GetAttribute(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24315 SWIGINTERN PyObject *_wrap_MDArray_GetAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24316   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24317   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24318   char *arg2 = (char *) 0 ;
24319   void *argp1 = 0 ;
24320   int res1 = 0 ;
24321   int res2 ;
24322   char *buf2 = 0 ;
24323   int alloc2 = 0 ;
24324   PyObject * obj0 = 0 ;
24325   PyObject * obj1 = 0 ;
24326   GDALAttributeHS *result = 0 ;
24327 
24328   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_GetAttribute",&obj0,&obj1)) SWIG_fail;
24329   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24330   if (!SWIG_IsOK(res1)) {
24331     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetAttribute" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24332   }
24333   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24334   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
24335   if (!SWIG_IsOK(res2)) {
24336     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_GetAttribute" "', argument " "2"" of type '" "char const *""'");
24337   }
24338   arg2 = reinterpret_cast< char * >(buf2);
24339   {
24340     if (!arg2) {
24341       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24342     }
24343   }
24344   {
24345     if ( bUseExceptions ) {
24346       ClearErrorState();
24347     }
24348     {
24349       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24350       result = (GDALAttributeHS *)GDALMDArrayHS_GetAttribute(arg1,(char const *)arg2);
24351       SWIG_PYTHON_THREAD_END_ALLOW;
24352     }
24353 #ifndef SED_HACKS
24354     if ( bUseExceptions ) {
24355       CPLErr eclass = CPLGetLastErrorType();
24356       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24357         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24358       }
24359     }
24360 #endif
24361   }
24362   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_POINTER_OWN |  0 );
24363   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
24364   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24365   return resultobj;
24366 fail:
24367   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
24368   return NULL;
24369 }
24370 
24371 
_wrap_MDArray_GetAttributes(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24372 SWIGINTERN PyObject *_wrap_MDArray_GetAttributes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24373   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24374   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24375   GDALAttributeHS ***arg2 = (GDALAttributeHS ***) 0 ;
24376   size_t *arg3 = (size_t *) 0 ;
24377   char **arg4 = (char **) 0 ;
24378   void *argp1 = 0 ;
24379   int res1 = 0 ;
24380   GDALAttributeHS **attrs2 = 0 ;
24381   size_t nCount2 = 0 ;
24382   PyObject * obj0 = 0 ;
24383   PyObject * obj1 = 0 ;
24384 
24385   {
24386     /* %typemap(in,numinputs=0) (GDALAttributeHS*** pattrs, size_t* pnCount) */
24387     arg2 = &attrs2;
24388     arg3 = &nCount2;
24389   }
24390   if (!PyArg_ParseTuple(args,(char *)"O|O:MDArray_GetAttributes",&obj0,&obj1)) SWIG_fail;
24391   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24392   if (!SWIG_IsOK(res1)) {
24393     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetAttributes" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24394   }
24395   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24396   if (obj1) {
24397     {
24398       /* %typemap(in) char **options */
24399       int bErr = FALSE;
24400       arg4 = CSLFromPySequence(obj1, &bErr);
24401       if( bErr )
24402       {
24403         SWIG_fail;
24404       }
24405     }
24406   }
24407   {
24408     if ( bUseExceptions ) {
24409       ClearErrorState();
24410     }
24411     {
24412       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24413       GDALMDArrayHS_GetAttributes(arg1,arg2,arg3,arg4);
24414       SWIG_PYTHON_THREAD_END_ALLOW;
24415     }
24416 #ifndef SED_HACKS
24417     if ( bUseExceptions ) {
24418       CPLErr eclass = CPLGetLastErrorType();
24419       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24420         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24421       }
24422     }
24423 #endif
24424   }
24425   resultobj = SWIG_Py_Void();
24426   {
24427     /* %typemap(argout) (GDALAttributeHS*** pattrs, size_t* pnCount) */
24428     PyObject *list = PyList_New( *arg3 );
24429     for( size_t i = 0; i < *arg3; i++ ) {
24430       PyList_SetItem(list, i,
24431         SWIG_NewPointerObj((void*)(*arg2)[i],SWIGTYPE_p_GDALAttributeHS,SWIG_POINTER_OWN) );
24432     }
24433     Py_DECREF(resultobj);
24434     resultobj = list;
24435   }
24436   {
24437     /* %typemap(freearg) (GDALAttributeHS*** pattrs, size_t* pnCount) */
24438     CPLFree(*arg2);
24439   }
24440   {
24441     /* %typemap(freearg) char **options */
24442     CSLDestroy( arg4 );
24443   }
24444   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24445   return resultobj;
24446 fail:
24447   {
24448     /* %typemap(freearg) (GDALAttributeHS*** pattrs, size_t* pnCount) */
24449     CPLFree(*arg2);
24450   }
24451   {
24452     /* %typemap(freearg) char **options */
24453     CSLDestroy( arg4 );
24454   }
24455   return NULL;
24456 }
24457 
24458 
_wrap_MDArray_CreateAttribute(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24459 SWIGINTERN PyObject *_wrap_MDArray_CreateAttribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24460   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24461   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24462   char *arg2 = (char *) 0 ;
24463   int arg3 ;
24464   GUIntBig *arg4 = (GUIntBig *) 0 ;
24465   GDALExtendedDataTypeHS *arg5 = (GDALExtendedDataTypeHS *) 0 ;
24466   char **arg6 = (char **) 0 ;
24467   void *argp1 = 0 ;
24468   int res1 = 0 ;
24469   int res2 ;
24470   char *buf2 = 0 ;
24471   int alloc2 = 0 ;
24472   void *argp5 = 0 ;
24473   int res5 = 0 ;
24474   PyObject * obj0 = 0 ;
24475   PyObject * obj1 = 0 ;
24476   PyObject * obj2 = 0 ;
24477   PyObject * obj3 = 0 ;
24478   PyObject * obj4 = 0 ;
24479   GDALAttributeHS *result = 0 ;
24480 
24481   if (!PyArg_ParseTuple(args,(char *)"OOOO|O:MDArray_CreateAttribute",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
24482   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24483   if (!SWIG_IsOK(res1)) {
24484     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_CreateAttribute" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24485   }
24486   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24487   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
24488   if (!SWIG_IsOK(res2)) {
24489     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_CreateAttribute" "', argument " "2"" of type '" "char const *""'");
24490   }
24491   arg2 = reinterpret_cast< char * >(buf2);
24492   {
24493     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
24494     /* check if is List */
24495     if ( !PySequence_Check(obj2) ) {
24496       PyErr_SetString(PyExc_TypeError, "not a sequence");
24497       SWIG_fail;
24498     }
24499     Py_ssize_t size = PySequence_Size(obj2);
24500     if( size != (int)size ) {
24501       PyErr_SetString(PyExc_TypeError, "too big sequence");
24502       SWIG_fail;
24503     }
24504     arg3 = (int)size;
24505     arg4 = (GUIntBig*) malloc(arg3*sizeof(GUIntBig));
24506     for( int i = 0; i<arg3; i++ ) {
24507       PyObject *o = PySequence_GetItem(obj2,i);
24508       PY_LONG_LONG val;
24509       if ( !PyArg_Parse(o,"K",&val) ) {
24510         PyErr_SetString(PyExc_TypeError, "not an integer");
24511         Py_DECREF(o);
24512         SWIG_fail;
24513       }
24514       arg4[i] = (GUIntBig)val;
24515       Py_DECREF(o);
24516     }
24517   }
24518   res5 = SWIG_ConvertPtr(obj3, &argp5,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
24519   if (!SWIG_IsOK(res5)) {
24520     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "MDArray_CreateAttribute" "', argument " "5"" of type '" "GDALExtendedDataTypeHS *""'");
24521   }
24522   arg5 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp5);
24523   if (obj4) {
24524     {
24525       /* %typemap(in) char **options */
24526       int bErr = FALSE;
24527       arg6 = CSLFromPySequence(obj4, &bErr);
24528       if( bErr )
24529       {
24530         SWIG_fail;
24531       }
24532     }
24533   }
24534   {
24535     if (!arg2) {
24536       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24537     }
24538   }
24539   {
24540     if (!arg5) {
24541       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24542     }
24543   }
24544   {
24545     if ( bUseExceptions ) {
24546       ClearErrorState();
24547     }
24548     {
24549       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24550       result = (GDALAttributeHS *)GDALMDArrayHS_CreateAttribute(arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
24551       SWIG_PYTHON_THREAD_END_ALLOW;
24552     }
24553 #ifndef SED_HACKS
24554     if ( bUseExceptions ) {
24555       CPLErr eclass = CPLGetLastErrorType();
24556       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24557         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24558       }
24559     }
24560 #endif
24561   }
24562   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALAttributeHS, SWIG_POINTER_OWN |  0 );
24563   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
24564   {
24565     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24566     if (arg4) {
24567       free((void*) arg4);
24568     }
24569   }
24570   {
24571     /* %typemap(freearg) char **options */
24572     CSLDestroy( arg6 );
24573   }
24574   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24575   return resultobj;
24576 fail:
24577   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
24578   {
24579     /* %typemap(freearg) (int nList, GUIntBig* pList) */
24580     if (arg4) {
24581       free((void*) arg4);
24582     }
24583   }
24584   {
24585     /* %typemap(freearg) char **options */
24586     CSLDestroy( arg6 );
24587   }
24588   return NULL;
24589 }
24590 
24591 
_wrap_MDArray_GetNoDataValueAsRaw(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24592 SWIGINTERN PyObject *_wrap_MDArray_GetNoDataValueAsRaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24593   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24594   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24595   void **arg2 = (void **) 0 ;
24596   void *argp1 = 0 ;
24597   int res1 = 0 ;
24598   void *pyObject2 = NULL ;
24599   PyObject * obj0 = 0 ;
24600   CPLErr result;
24601 
24602   {
24603     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject2 = NULL ) */
24604     arg2 = &pyObject2;
24605   }
24606   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetNoDataValueAsRaw",&obj0)) SWIG_fail;
24607   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24608   if (!SWIG_IsOK(res1)) {
24609     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetNoDataValueAsRaw" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24610   }
24611   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24612   {
24613     if ( bUseExceptions ) {
24614       ClearErrorState();
24615     }
24616     {
24617       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24618       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_GetNoDataValueAsRaw(arg1,arg2));
24619       SWIG_PYTHON_THREAD_END_ALLOW;
24620     }
24621 #ifndef SED_HACKS
24622     if ( bUseExceptions ) {
24623       CPLErr eclass = CPLGetLastErrorType();
24624       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24625         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24626       }
24627     }
24628 #endif
24629   }
24630   resultobj = SWIG_From_int(static_cast< int >(result));
24631   {
24632     /* %typemap(argout) ( void **outPythonObject ) */
24633     Py_XDECREF(resultobj);
24634     if (*arg2)
24635     {
24636       resultobj = (PyObject*)*arg2;
24637     }
24638     else
24639     {
24640       resultobj = Py_None;
24641       Py_INCREF(resultobj);
24642     }
24643   }
24644   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24645   return resultobj;
24646 fail:
24647   return NULL;
24648 }
24649 
24650 
_wrap_MDArray_GetNoDataValueAsDouble(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24651 SWIGINTERN PyObject *_wrap_MDArray_GetNoDataValueAsDouble(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24652   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24653   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24654   double *arg2 = (double *) 0 ;
24655   int *arg3 = (int *) 0 ;
24656   void *argp1 = 0 ;
24657   int res1 = 0 ;
24658   double tmpval2 ;
24659   int tmphasval2 ;
24660   PyObject * obj0 = 0 ;
24661 
24662   {
24663     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
24664     arg2 = &tmpval2;
24665     arg3 = &tmphasval2;
24666   }
24667   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetNoDataValueAsDouble",&obj0)) SWIG_fail;
24668   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24669   if (!SWIG_IsOK(res1)) {
24670     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetNoDataValueAsDouble" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24671   }
24672   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24673   {
24674     if ( bUseExceptions ) {
24675       ClearErrorState();
24676     }
24677     {
24678       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24679       GDALMDArrayHS_GetNoDataValueAsDouble(arg1,arg2,arg3);
24680       SWIG_PYTHON_THREAD_END_ALLOW;
24681     }
24682 #ifndef SED_HACKS
24683     if ( bUseExceptions ) {
24684       CPLErr eclass = CPLGetLastErrorType();
24685       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24686         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24687       }
24688     }
24689 #endif
24690   }
24691   resultobj = SWIG_Py_Void();
24692   {
24693     /* %typemap(python,argout) (double *val, int*hasval) */
24694     PyObject *r;
24695     if ( !*arg3 ) {
24696       Py_INCREF(Py_None);
24697       r = Py_None;
24698       resultobj = t_output_helper(resultobj,r);
24699     }
24700     else {
24701       r = PyFloat_FromDouble( *arg2 );
24702       resultobj = t_output_helper(resultobj,r);
24703     }
24704   }
24705   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24706   return resultobj;
24707 fail:
24708   return NULL;
24709 }
24710 
24711 
_wrap_MDArray_SetNoDataValueDouble(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24712 SWIGINTERN PyObject *_wrap_MDArray_SetNoDataValueDouble(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24713   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24714   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24715   double arg2 ;
24716   void *argp1 = 0 ;
24717   int res1 = 0 ;
24718   double val2 ;
24719   int ecode2 = 0 ;
24720   PyObject * obj0 = 0 ;
24721   PyObject * obj1 = 0 ;
24722   CPLErr result;
24723 
24724   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_SetNoDataValueDouble",&obj0,&obj1)) SWIG_fail;
24725   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24726   if (!SWIG_IsOK(res1)) {
24727     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetNoDataValueDouble" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24728   }
24729   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24730   ecode2 = SWIG_AsVal_double(obj1, &val2);
24731   if (!SWIG_IsOK(ecode2)) {
24732     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_SetNoDataValueDouble" "', argument " "2"" of type '" "double""'");
24733   }
24734   arg2 = static_cast< double >(val2);
24735   {
24736     if ( bUseExceptions ) {
24737       ClearErrorState();
24738     }
24739     {
24740       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24741       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_SetNoDataValueDouble(arg1,arg2));
24742       SWIG_PYTHON_THREAD_END_ALLOW;
24743     }
24744 #ifndef SED_HACKS
24745     if ( bUseExceptions ) {
24746       CPLErr eclass = CPLGetLastErrorType();
24747       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24748         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24749       }
24750     }
24751 #endif
24752   }
24753   resultobj = SWIG_From_int(static_cast< int >(result));
24754   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24755   return resultobj;
24756 fail:
24757   return NULL;
24758 }
24759 
24760 
_wrap_MDArray_SetNoDataValueRaw(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24761 SWIGINTERN PyObject *_wrap_MDArray_SetNoDataValueRaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24762   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24763   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24764   GIntBig arg2 ;
24765   char *arg3 = (char *) 0 ;
24766   void *argp1 = 0 ;
24767   int res1 = 0 ;
24768   int alloc2 = 0 ;
24769   bool viewIsValid2 = false ;
24770   Py_buffer view2 ;
24771   PyObject * obj0 = 0 ;
24772   PyObject * obj1 = 0 ;
24773   CPLErr result;
24774 
24775   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_SetNoDataValueRaw",&obj0,&obj1)) SWIG_fail;
24776   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24777   if (!SWIG_IsOK(res1)) {
24778     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetNoDataValueRaw" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24779   }
24780   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24781   {
24782     /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
24783     {
24784       if (PyObject_GetBuffer(obj1, &view2, PyBUF_SIMPLE) == 0)
24785       {
24786         viewIsValid2 = true;
24787         arg2 = view2.len;
24788         arg3 = (char *) view2.buf;
24789         goto ok;
24790       }
24791       else
24792       {
24793         PyErr_Clear();
24794       }
24795     }
24796     if (PyUnicode_Check(obj1))
24797     {
24798       size_t safeLen = 0;
24799       int ret = SWIG_AsCharPtrAndSize(obj1, (char**) &arg3, &safeLen, &alloc2);
24800       if (!SWIG_IsOK(ret)) {
24801         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
24802       }
24803 
24804       if (safeLen) safeLen--;
24805       arg2 = (GIntBig) safeLen;
24806     }
24807     else
24808     {
24809       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
24810       SWIG_fail;
24811     }
24812     ok: ;
24813   }
24814   {
24815     if ( bUseExceptions ) {
24816       ClearErrorState();
24817     }
24818     {
24819       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24820       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_SetNoDataValueRaw(arg1,arg2,arg3));
24821       SWIG_PYTHON_THREAD_END_ALLOW;
24822     }
24823 #ifndef SED_HACKS
24824     if ( bUseExceptions ) {
24825       CPLErr eclass = CPLGetLastErrorType();
24826       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24827         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24828       }
24829     }
24830 #endif
24831   }
24832   resultobj = SWIG_From_int(static_cast< int >(result));
24833   {
24834     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
24835     if( viewIsValid2 ) {
24836       PyBuffer_Release(&view2);
24837     }
24838     else if (ReturnSame(alloc2) == SWIG_NEWOBJ ) {
24839       delete[] arg3;
24840     }
24841   }
24842   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24843   return resultobj;
24844 fail:
24845   {
24846     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
24847     if( viewIsValid2 ) {
24848       PyBuffer_Release(&view2);
24849     }
24850     else if (ReturnSame(alloc2) == SWIG_NEWOBJ ) {
24851       delete[] arg3;
24852     }
24853   }
24854   return NULL;
24855 }
24856 
24857 
_wrap_MDArray_DeleteNoDataValue(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24858 SWIGINTERN PyObject *_wrap_MDArray_DeleteNoDataValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24859   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24860   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24861   void *argp1 = 0 ;
24862   int res1 = 0 ;
24863   PyObject * obj0 = 0 ;
24864   CPLErr result;
24865 
24866   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_DeleteNoDataValue",&obj0)) SWIG_fail;
24867   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24868   if (!SWIG_IsOK(res1)) {
24869     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_DeleteNoDataValue" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24870   }
24871   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24872   {
24873     if ( bUseExceptions ) {
24874       ClearErrorState();
24875     }
24876     {
24877       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24878       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_DeleteNoDataValue(arg1));
24879       SWIG_PYTHON_THREAD_END_ALLOW;
24880     }
24881 #ifndef SED_HACKS
24882     if ( bUseExceptions ) {
24883       CPLErr eclass = CPLGetLastErrorType();
24884       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24885         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24886       }
24887     }
24888 #endif
24889   }
24890   resultobj = SWIG_From_int(static_cast< int >(result));
24891   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24892   return resultobj;
24893 fail:
24894   return NULL;
24895 }
24896 
24897 
_wrap_MDArray_GetOffset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24898 SWIGINTERN PyObject *_wrap_MDArray_GetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24899   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24900   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24901   double *arg2 = (double *) 0 ;
24902   int *arg3 = (int *) 0 ;
24903   void *argp1 = 0 ;
24904   int res1 = 0 ;
24905   double tmpval2 ;
24906   int tmphasval2 ;
24907   PyObject * obj0 = 0 ;
24908 
24909   {
24910     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
24911     arg2 = &tmpval2;
24912     arg3 = &tmphasval2;
24913   }
24914   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetOffset",&obj0)) SWIG_fail;
24915   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24916   if (!SWIG_IsOK(res1)) {
24917     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetOffset" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24918   }
24919   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24920   {
24921     if ( bUseExceptions ) {
24922       ClearErrorState();
24923     }
24924     {
24925       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24926       GDALMDArrayHS_GetOffset(arg1,arg2,arg3);
24927       SWIG_PYTHON_THREAD_END_ALLOW;
24928     }
24929 #ifndef SED_HACKS
24930     if ( bUseExceptions ) {
24931       CPLErr eclass = CPLGetLastErrorType();
24932       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24933         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24934       }
24935     }
24936 #endif
24937   }
24938   resultobj = SWIG_Py_Void();
24939   {
24940     /* %typemap(python,argout) (double *val, int*hasval) */
24941     PyObject *r;
24942     if ( !*arg3 ) {
24943       Py_INCREF(Py_None);
24944       r = Py_None;
24945       resultobj = t_output_helper(resultobj,r);
24946     }
24947     else {
24948       r = PyFloat_FromDouble( *arg2 );
24949       resultobj = t_output_helper(resultobj,r);
24950     }
24951   }
24952   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24953   return resultobj;
24954 fail:
24955   return NULL;
24956 }
24957 
24958 
_wrap_MDArray_GetOffsetStorageType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24959 SWIGINTERN PyObject *_wrap_MDArray_GetOffsetStorageType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
24960   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
24961   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
24962   void *argp1 = 0 ;
24963   int res1 = 0 ;
24964   PyObject * obj0 = 0 ;
24965   GDALDataType result;
24966 
24967   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetOffsetStorageType",&obj0)) SWIG_fail;
24968   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
24969   if (!SWIG_IsOK(res1)) {
24970     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetOffsetStorageType" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
24971   }
24972   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
24973   {
24974     if ( bUseExceptions ) {
24975       ClearErrorState();
24976     }
24977     {
24978       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24979       result = (GDALDataType)GDALMDArrayHS_GetOffsetStorageType(arg1);
24980       SWIG_PYTHON_THREAD_END_ALLOW;
24981     }
24982 #ifndef SED_HACKS
24983     if ( bUseExceptions ) {
24984       CPLErr eclass = CPLGetLastErrorType();
24985       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
24986         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
24987       }
24988     }
24989 #endif
24990   }
24991   resultobj = SWIG_From_int(static_cast< int >(result));
24992   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
24993   return resultobj;
24994 fail:
24995   return NULL;
24996 }
24997 
24998 
_wrap_MDArray_GetScale(PyObject * SWIGUNUSEDPARM (self),PyObject * args)24999 SWIGINTERN PyObject *_wrap_MDArray_GetScale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25000   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25001   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25002   double *arg2 = (double *) 0 ;
25003   int *arg3 = (int *) 0 ;
25004   void *argp1 = 0 ;
25005   int res1 = 0 ;
25006   double tmpval2 ;
25007   int tmphasval2 ;
25008   PyObject * obj0 = 0 ;
25009 
25010   {
25011     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
25012     arg2 = &tmpval2;
25013     arg3 = &tmphasval2;
25014   }
25015   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetScale",&obj0)) SWIG_fail;
25016   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25017   if (!SWIG_IsOK(res1)) {
25018     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetScale" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25019   }
25020   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25021   {
25022     if ( bUseExceptions ) {
25023       ClearErrorState();
25024     }
25025     {
25026       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25027       GDALMDArrayHS_GetScale(arg1,arg2,arg3);
25028       SWIG_PYTHON_THREAD_END_ALLOW;
25029     }
25030 #ifndef SED_HACKS
25031     if ( bUseExceptions ) {
25032       CPLErr eclass = CPLGetLastErrorType();
25033       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25034         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25035       }
25036     }
25037 #endif
25038   }
25039   resultobj = SWIG_Py_Void();
25040   {
25041     /* %typemap(python,argout) (double *val, int*hasval) */
25042     PyObject *r;
25043     if ( !*arg3 ) {
25044       Py_INCREF(Py_None);
25045       r = Py_None;
25046       resultobj = t_output_helper(resultobj,r);
25047     }
25048     else {
25049       r = PyFloat_FromDouble( *arg2 );
25050       resultobj = t_output_helper(resultobj,r);
25051     }
25052   }
25053   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25054   return resultobj;
25055 fail:
25056   return NULL;
25057 }
25058 
25059 
_wrap_MDArray_GetScaleStorageType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25060 SWIGINTERN PyObject *_wrap_MDArray_GetScaleStorageType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25061   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25062   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25063   void *argp1 = 0 ;
25064   int res1 = 0 ;
25065   PyObject * obj0 = 0 ;
25066   GDALDataType result;
25067 
25068   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetScaleStorageType",&obj0)) SWIG_fail;
25069   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25070   if (!SWIG_IsOK(res1)) {
25071     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetScaleStorageType" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25072   }
25073   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25074   {
25075     if ( bUseExceptions ) {
25076       ClearErrorState();
25077     }
25078     {
25079       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25080       result = (GDALDataType)GDALMDArrayHS_GetScaleStorageType(arg1);
25081       SWIG_PYTHON_THREAD_END_ALLOW;
25082     }
25083 #ifndef SED_HACKS
25084     if ( bUseExceptions ) {
25085       CPLErr eclass = CPLGetLastErrorType();
25086       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25087         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25088       }
25089     }
25090 #endif
25091   }
25092   resultobj = SWIG_From_int(static_cast< int >(result));
25093   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25094   return resultobj;
25095 fail:
25096   return NULL;
25097 }
25098 
25099 
_wrap_MDArray_SetOffset(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)25100 SWIGINTERN PyObject *_wrap_MDArray_SetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
25101   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25102   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25103   double arg2 ;
25104   GDALDataType arg3 = (GDALDataType) GDT_Unknown ;
25105   void *argp1 = 0 ;
25106   int res1 = 0 ;
25107   double val2 ;
25108   int ecode2 = 0 ;
25109   PyObject * obj0 = 0 ;
25110   PyObject * obj1 = 0 ;
25111   PyObject * obj2 = 0 ;
25112   char *  kwnames[] = {
25113     (char *) "self",(char *) "val",(char *) "storageType", NULL
25114   };
25115   CPLErr result;
25116 
25117   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:MDArray_SetOffset",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
25118   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25119   if (!SWIG_IsOK(res1)) {
25120     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetOffset" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25121   }
25122   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25123   ecode2 = SWIG_AsVal_double(obj1, &val2);
25124   if (!SWIG_IsOK(ecode2)) {
25125     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_SetOffset" "', argument " "2"" of type '" "double""'");
25126   }
25127   arg2 = static_cast< double >(val2);
25128   if (obj2) {
25129     {
25130       // %typemap(in) GDALDataType
25131       int val = 0;
25132       int ecode = SWIG_AsVal_int(obj2, &val);
25133       if (!SWIG_IsOK(ecode)) {
25134         SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
25135       }
25136       if( val < GDT_Unknown || val >= GDT_TypeCount )
25137       {
25138         SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
25139       }
25140       arg3 = static_cast<GDALDataType>(val);
25141     }
25142   }
25143   {
25144     if ( bUseExceptions ) {
25145       ClearErrorState();
25146     }
25147     {
25148       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25149       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_SetOffset(arg1,arg2,arg3));
25150       SWIG_PYTHON_THREAD_END_ALLOW;
25151     }
25152 #ifndef SED_HACKS
25153     if ( bUseExceptions ) {
25154       CPLErr eclass = CPLGetLastErrorType();
25155       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25156         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25157       }
25158     }
25159 #endif
25160   }
25161   resultobj = SWIG_From_int(static_cast< int >(result));
25162   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25163   return resultobj;
25164 fail:
25165   return NULL;
25166 }
25167 
25168 
_wrap_MDArray_SetScale(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)25169 SWIGINTERN PyObject *_wrap_MDArray_SetScale(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
25170   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25171   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25172   double arg2 ;
25173   GDALDataType arg3 = (GDALDataType) GDT_Unknown ;
25174   void *argp1 = 0 ;
25175   int res1 = 0 ;
25176   double val2 ;
25177   int ecode2 = 0 ;
25178   PyObject * obj0 = 0 ;
25179   PyObject * obj1 = 0 ;
25180   PyObject * obj2 = 0 ;
25181   char *  kwnames[] = {
25182     (char *) "self",(char *) "val",(char *) "storageType", NULL
25183   };
25184   CPLErr result;
25185 
25186   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:MDArray_SetScale",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
25187   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25188   if (!SWIG_IsOK(res1)) {
25189     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetScale" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25190   }
25191   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25192   ecode2 = SWIG_AsVal_double(obj1, &val2);
25193   if (!SWIG_IsOK(ecode2)) {
25194     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_SetScale" "', argument " "2"" of type '" "double""'");
25195   }
25196   arg2 = static_cast< double >(val2);
25197   if (obj2) {
25198     {
25199       // %typemap(in) GDALDataType
25200       int val = 0;
25201       int ecode = SWIG_AsVal_int(obj2, &val);
25202       if (!SWIG_IsOK(ecode)) {
25203         SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
25204       }
25205       if( val < GDT_Unknown || val >= GDT_TypeCount )
25206       {
25207         SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
25208       }
25209       arg3 = static_cast<GDALDataType>(val);
25210     }
25211   }
25212   {
25213     if ( bUseExceptions ) {
25214       ClearErrorState();
25215     }
25216     {
25217       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25218       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_SetScale(arg1,arg2,arg3));
25219       SWIG_PYTHON_THREAD_END_ALLOW;
25220     }
25221 #ifndef SED_HACKS
25222     if ( bUseExceptions ) {
25223       CPLErr eclass = CPLGetLastErrorType();
25224       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25225         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25226       }
25227     }
25228 #endif
25229   }
25230   resultobj = SWIG_From_int(static_cast< int >(result));
25231   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25232   return resultobj;
25233 fail:
25234   return NULL;
25235 }
25236 
25237 
_wrap_MDArray_SetUnit(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25238 SWIGINTERN PyObject *_wrap_MDArray_SetUnit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25239   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25240   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25241   char *arg2 = (char *) 0 ;
25242   void *argp1 = 0 ;
25243   int res1 = 0 ;
25244   int res2 ;
25245   char *buf2 = 0 ;
25246   int alloc2 = 0 ;
25247   PyObject * obj0 = 0 ;
25248   PyObject * obj1 = 0 ;
25249   CPLErr result;
25250 
25251   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_SetUnit",&obj0,&obj1)) SWIG_fail;
25252   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25253   if (!SWIG_IsOK(res1)) {
25254     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetUnit" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25255   }
25256   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25257   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
25258   if (!SWIG_IsOK(res2)) {
25259     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_SetUnit" "', argument " "2"" of type '" "char const *""'");
25260   }
25261   arg2 = reinterpret_cast< char * >(buf2);
25262   {
25263     if ( bUseExceptions ) {
25264       ClearErrorState();
25265     }
25266     {
25267       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25268       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALMDArrayHS_SetUnit(arg1,(char const *)arg2));
25269       SWIG_PYTHON_THREAD_END_ALLOW;
25270     }
25271 #ifndef SED_HACKS
25272     if ( bUseExceptions ) {
25273       CPLErr eclass = CPLGetLastErrorType();
25274       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25275         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25276       }
25277     }
25278 #endif
25279   }
25280   resultobj = SWIG_From_int(static_cast< int >(result));
25281   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
25282   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25283   return resultobj;
25284 fail:
25285   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
25286   return NULL;
25287 }
25288 
25289 
_wrap_MDArray_GetUnit(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25290 SWIGINTERN PyObject *_wrap_MDArray_GetUnit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25291   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25292   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25293   void *argp1 = 0 ;
25294   int res1 = 0 ;
25295   PyObject * obj0 = 0 ;
25296   char *result = 0 ;
25297 
25298   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetUnit",&obj0)) SWIG_fail;
25299   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25300   if (!SWIG_IsOK(res1)) {
25301     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetUnit" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25302   }
25303   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25304   {
25305     if ( bUseExceptions ) {
25306       ClearErrorState();
25307     }
25308     {
25309       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25310       result = (char *)GDALMDArrayHS_GetUnit(arg1);
25311       SWIG_PYTHON_THREAD_END_ALLOW;
25312     }
25313 #ifndef SED_HACKS
25314     if ( bUseExceptions ) {
25315       CPLErr eclass = CPLGetLastErrorType();
25316       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25317         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25318       }
25319     }
25320 #endif
25321   }
25322   resultobj = SWIG_FromCharPtr((const char *)result);
25323   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25324   return resultobj;
25325 fail:
25326   return NULL;
25327 }
25328 
25329 
_wrap_MDArray_SetSpatialRef(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25330 SWIGINTERN PyObject *_wrap_MDArray_SetSpatialRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25331   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25332   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25333   OSRSpatialReferenceShadow *arg2 = (OSRSpatialReferenceShadow *) 0 ;
25334   void *argp1 = 0 ;
25335   int res1 = 0 ;
25336   void *argp2 = 0 ;
25337   int res2 = 0 ;
25338   PyObject * obj0 = 0 ;
25339   PyObject * obj1 = 0 ;
25340   OGRErr result;
25341 
25342   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_SetSpatialRef",&obj0,&obj1)) SWIG_fail;
25343   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25344   if (!SWIG_IsOK(res1)) {
25345     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_SetSpatialRef" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25346   }
25347   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25348   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OSRSpatialReferenceShadow, 0 |  0 );
25349   if (!SWIG_IsOK(res2)) {
25350     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_SetSpatialRef" "', argument " "2"" of type '" "OSRSpatialReferenceShadow *""'");
25351   }
25352   arg2 = reinterpret_cast< OSRSpatialReferenceShadow * >(argp2);
25353   {
25354     if ( bUseExceptions ) {
25355       ClearErrorState();
25356     }
25357     {
25358       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25359       result = (OGRErr)GDALMDArrayHS_SetSpatialRef(arg1,arg2);
25360       SWIG_PYTHON_THREAD_END_ALLOW;
25361     }
25362 #ifndef SED_HACKS
25363     if ( bUseExceptions ) {
25364       CPLErr eclass = CPLGetLastErrorType();
25365       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25366         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25367       }
25368     }
25369 #endif
25370   }
25371   {
25372     /* %typemap(out) OGRErr */
25373     if ( result != 0 && bUseExceptions) {
25374       const char* pszMessage = CPLGetLastErrorMsg();
25375       if( pszMessage[0] != '\0' )
25376       PyErr_SetString( PyExc_RuntimeError, pszMessage );
25377       else
25378       PyErr_SetString( PyExc_RuntimeError, OGRErrMessages(result) );
25379       SWIG_fail;
25380     }
25381   }
25382   {
25383     /* %typemap(ret) OGRErr */
25384     if ( ReturnSame(resultobj == Py_None || resultobj == 0) ) {
25385       resultobj = PyInt_FromLong( result );
25386     }
25387   }
25388   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25389   return resultobj;
25390 fail:
25391   return NULL;
25392 }
25393 
25394 
_wrap_MDArray_GetSpatialRef(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25395 SWIGINTERN PyObject *_wrap_MDArray_GetSpatialRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25396   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25397   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25398   void *argp1 = 0 ;
25399   int res1 = 0 ;
25400   PyObject * obj0 = 0 ;
25401   OSRSpatialReferenceShadow *result = 0 ;
25402 
25403   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetSpatialRef",&obj0)) SWIG_fail;
25404   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25405   if (!SWIG_IsOK(res1)) {
25406     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetSpatialRef" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25407   }
25408   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25409   {
25410     if ( bUseExceptions ) {
25411       ClearErrorState();
25412     }
25413     {
25414       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25415       result = (OSRSpatialReferenceShadow *)GDALMDArrayHS_GetSpatialRef(arg1);
25416       SWIG_PYTHON_THREAD_END_ALLOW;
25417     }
25418 #ifndef SED_HACKS
25419     if ( bUseExceptions ) {
25420       CPLErr eclass = CPLGetLastErrorType();
25421       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25422         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25423       }
25424     }
25425 #endif
25426   }
25427   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_OSRSpatialReferenceShadow, SWIG_POINTER_OWN |  0 );
25428   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25429   return resultobj;
25430 fail:
25431   return NULL;
25432 }
25433 
25434 
_wrap_MDArray_GetView(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25435 SWIGINTERN PyObject *_wrap_MDArray_GetView(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25436   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25437   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25438   char *arg2 = (char *) 0 ;
25439   void *argp1 = 0 ;
25440   int res1 = 0 ;
25441   int res2 ;
25442   char *buf2 = 0 ;
25443   int alloc2 = 0 ;
25444   PyObject * obj0 = 0 ;
25445   PyObject * obj1 = 0 ;
25446   GDALMDArrayHS *result = 0 ;
25447 
25448   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_GetView",&obj0,&obj1)) SWIG_fail;
25449   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25450   if (!SWIG_IsOK(res1)) {
25451     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetView" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25452   }
25453   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25454   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
25455   if (!SWIG_IsOK(res2)) {
25456     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_GetView" "', argument " "2"" of type '" "char const *""'");
25457   }
25458   arg2 = reinterpret_cast< char * >(buf2);
25459   {
25460     if (!arg2) {
25461       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25462     }
25463   }
25464   {
25465     if ( bUseExceptions ) {
25466       ClearErrorState();
25467     }
25468     {
25469       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25470       result = (GDALMDArrayHS *)GDALMDArrayHS_GetView(arg1,(char const *)arg2);
25471       SWIG_PYTHON_THREAD_END_ALLOW;
25472     }
25473 #ifndef SED_HACKS
25474     if ( bUseExceptions ) {
25475       CPLErr eclass = CPLGetLastErrorType();
25476       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25477         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25478       }
25479     }
25480 #endif
25481   }
25482   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
25483   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
25484   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25485   return resultobj;
25486 fail:
25487   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
25488   return NULL;
25489 }
25490 
25491 
_wrap_MDArray_Transpose(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25492 SWIGINTERN PyObject *_wrap_MDArray_Transpose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25493   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25494   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25495   int arg2 ;
25496   int *arg3 = (int *) 0 ;
25497   void *argp1 = 0 ;
25498   int res1 = 0 ;
25499   PyObject * obj0 = 0 ;
25500   PyObject * obj1 = 0 ;
25501   GDALMDArrayHS *result = 0 ;
25502 
25503   if (!PyArg_ParseTuple(args,(char *)"OO:MDArray_Transpose",&obj0,&obj1)) SWIG_fail;
25504   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25505   if (!SWIG_IsOK(res1)) {
25506     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_Transpose" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25507   }
25508   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25509   {
25510     /* %typemap(in,numinputs=1) (int nList, int* pList)*/
25511     arg3 = CreateCIntListFromSequence(obj1, &arg2);
25512     if( arg2 < 0 ) {
25513       SWIG_fail;
25514     }
25515   }
25516   {
25517     if ( bUseExceptions ) {
25518       ClearErrorState();
25519     }
25520     {
25521       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25522       result = (GDALMDArrayHS *)GDALMDArrayHS_Transpose(arg1,arg2,arg3);
25523       SWIG_PYTHON_THREAD_END_ALLOW;
25524     }
25525 #ifndef SED_HACKS
25526     if ( bUseExceptions ) {
25527       CPLErr eclass = CPLGetLastErrorType();
25528       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25529         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25530       }
25531     }
25532 #endif
25533   }
25534   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
25535   {
25536     /* %typemap(freearg) (int nList, int* pList) */
25537     free(arg3);
25538   }
25539   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25540   return resultobj;
25541 fail:
25542   {
25543     /* %typemap(freearg) (int nList, int* pList) */
25544     free(arg3);
25545   }
25546   return NULL;
25547 }
25548 
25549 
_wrap_MDArray_GetUnscaled(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25550 SWIGINTERN PyObject *_wrap_MDArray_GetUnscaled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25551   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25552   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25553   void *argp1 = 0 ;
25554   int res1 = 0 ;
25555   PyObject * obj0 = 0 ;
25556   GDALMDArrayHS *result = 0 ;
25557 
25558   if (!PyArg_ParseTuple(args,(char *)"O:MDArray_GetUnscaled",&obj0)) SWIG_fail;
25559   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25560   if (!SWIG_IsOK(res1)) {
25561     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetUnscaled" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25562   }
25563   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25564   {
25565     if ( bUseExceptions ) {
25566       ClearErrorState();
25567     }
25568     {
25569       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25570       result = (GDALMDArrayHS *)GDALMDArrayHS_GetUnscaled(arg1);
25571       SWIG_PYTHON_THREAD_END_ALLOW;
25572     }
25573 #ifndef SED_HACKS
25574     if ( bUseExceptions ) {
25575       CPLErr eclass = CPLGetLastErrorType();
25576       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25577         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25578       }
25579     }
25580 #endif
25581   }
25582   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
25583   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25584   return resultobj;
25585 fail:
25586   return NULL;
25587 }
25588 
25589 
_wrap_MDArray_GetMask(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25590 SWIGINTERN PyObject *_wrap_MDArray_GetMask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25591   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25592   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25593   char **arg2 = (char **) 0 ;
25594   void *argp1 = 0 ;
25595   int res1 = 0 ;
25596   PyObject * obj0 = 0 ;
25597   PyObject * obj1 = 0 ;
25598   GDALMDArrayHS *result = 0 ;
25599 
25600   if (!PyArg_ParseTuple(args,(char *)"O|O:MDArray_GetMask",&obj0,&obj1)) SWIG_fail;
25601   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25602   if (!SWIG_IsOK(res1)) {
25603     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetMask" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25604   }
25605   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25606   if (obj1) {
25607     {
25608       /* %typemap(in) char **options */
25609       int bErr = FALSE;
25610       arg2 = CSLFromPySequence(obj1, &bErr);
25611       if( bErr )
25612       {
25613         SWIG_fail;
25614       }
25615     }
25616   }
25617   {
25618     if ( bUseExceptions ) {
25619       ClearErrorState();
25620     }
25621     {
25622       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25623       result = (GDALMDArrayHS *)GDALMDArrayHS_GetMask(arg1,arg2);
25624       SWIG_PYTHON_THREAD_END_ALLOW;
25625     }
25626 #ifndef SED_HACKS
25627     if ( bUseExceptions ) {
25628       CPLErr eclass = CPLGetLastErrorType();
25629       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25630         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25631       }
25632     }
25633 #endif
25634   }
25635   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
25636   {
25637     /* %typemap(freearg) char **options */
25638     CSLDestroy( arg2 );
25639   }
25640   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25641   return resultobj;
25642 fail:
25643   {
25644     /* %typemap(freearg) char **options */
25645     CSLDestroy( arg2 );
25646   }
25647   return NULL;
25648 }
25649 
25650 
_wrap_MDArray_AsClassicDataset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25651 SWIGINTERN PyObject *_wrap_MDArray_AsClassicDataset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25652   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25653   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25654   size_t arg2 ;
25655   size_t arg3 ;
25656   void *argp1 = 0 ;
25657   int res1 = 0 ;
25658   size_t val2 ;
25659   int ecode2 = 0 ;
25660   size_t val3 ;
25661   int ecode3 = 0 ;
25662   PyObject * obj0 = 0 ;
25663   PyObject * obj1 = 0 ;
25664   PyObject * obj2 = 0 ;
25665   GDALDatasetShadow *result = 0 ;
25666 
25667   if (!PyArg_ParseTuple(args,(char *)"OOO:MDArray_AsClassicDataset",&obj0,&obj1,&obj2)) SWIG_fail;
25668   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25669   if (!SWIG_IsOK(res1)) {
25670     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_AsClassicDataset" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25671   }
25672   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25673   ecode2 = SWIG_AsVal_size_t(obj1, &val2);
25674   if (!SWIG_IsOK(ecode2)) {
25675     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "MDArray_AsClassicDataset" "', argument " "2"" of type '" "size_t""'");
25676   }
25677   arg2 = static_cast< size_t >(val2);
25678   ecode3 = SWIG_AsVal_size_t(obj2, &val3);
25679   if (!SWIG_IsOK(ecode3)) {
25680     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_AsClassicDataset" "', argument " "3"" of type '" "size_t""'");
25681   }
25682   arg3 = static_cast< size_t >(val3);
25683   {
25684     if ( bUseExceptions ) {
25685       ClearErrorState();
25686     }
25687     {
25688       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25689       result = (GDALDatasetShadow *)GDALMDArrayHS_AsClassicDataset(arg1,arg2,arg3);
25690       SWIG_PYTHON_THREAD_END_ALLOW;
25691     }
25692 #ifndef SED_HACKS
25693     if ( bUseExceptions ) {
25694       CPLErr eclass = CPLGetLastErrorType();
25695       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25696         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25697       }
25698     }
25699 #endif
25700   }
25701   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
25702   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25703   return resultobj;
25704 fail:
25705   return NULL;
25706 }
25707 
25708 
_wrap_MDArray_GetStatistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)25709 SWIGINTERN PyObject *_wrap_MDArray_GetStatistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
25710   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25711   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25712   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) NULL ;
25713   bool arg3 = (bool) FALSE ;
25714   bool arg4 = (bool) TRUE ;
25715   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
25716   void *arg6 = (void *) NULL ;
25717   void *argp1 = 0 ;
25718   int res1 = 0 ;
25719   void *argp2 = 0 ;
25720   int res2 = 0 ;
25721   bool val3 ;
25722   int ecode3 = 0 ;
25723   bool val4 ;
25724   int ecode4 = 0 ;
25725   PyObject * obj0 = 0 ;
25726   PyObject * obj1 = 0 ;
25727   PyObject * obj2 = 0 ;
25728   PyObject * obj3 = 0 ;
25729   PyObject * obj4 = 0 ;
25730   PyObject * obj5 = 0 ;
25731   char *  kwnames[] = {
25732     (char *) "self",(char *) "ds",(char *) "approx_ok",(char *) "force",(char *) "callback",(char *) "callback_data", NULL
25733   };
25734   Statistics *result = 0 ;
25735 
25736   /* %typemap(arginit) ( const char* callback_data=NULL)  */
25737   PyProgressData *psProgressInfo;
25738   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
25739   psProgressInfo->nLastReported = -1;
25740   psProgressInfo->psPyCallback = NULL;
25741   psProgressInfo->psPyCallbackData = NULL;
25742   arg6 = psProgressInfo;
25743   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOOO:MDArray_GetStatistics",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
25744   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25745   if (!SWIG_IsOK(res1)) {
25746     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_GetStatistics" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25747   }
25748   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25749   if (obj1) {
25750     res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
25751     if (!SWIG_IsOK(res2)) {
25752       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_GetStatistics" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
25753     }
25754     arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
25755   }
25756   if (obj2) {
25757     ecode3 = SWIG_AsVal_bool(obj2, &val3);
25758     if (!SWIG_IsOK(ecode3)) {
25759       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_GetStatistics" "', argument " "3"" of type '" "bool""'");
25760     }
25761     arg3 = static_cast< bool >(val3);
25762   }
25763   if (obj3) {
25764     ecode4 = SWIG_AsVal_bool(obj3, &val4);
25765     if (!SWIG_IsOK(ecode4)) {
25766       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "MDArray_GetStatistics" "', argument " "4"" of type '" "bool""'");
25767     }
25768     arg4 = static_cast< bool >(val4);
25769   }
25770   if (obj4) {
25771     {
25772       /* %typemap(in) (GDALProgressFunc callback = NULL) */
25773       /* callback_func typemap */
25774 
25775       /* In some cases 0 is passed instead of None. */
25776       /* See https://github.com/OSGeo/gdal/pull/219 */
25777       if ( PyLong_Check(obj4) || PyInt_Check(obj4) )
25778       {
25779         if( PyLong_AsLong(obj4) == 0 )
25780         {
25781           obj4 = Py_None;
25782         }
25783       }
25784 
25785       if (obj4 && obj4 != Py_None ) {
25786         void* cbfunction = NULL;
25787         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj4,
25788             (void**)&cbfunction,
25789             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
25790             SWIG_POINTER_EXCEPTION | 0 ));
25791 
25792         if ( cbfunction == GDALTermProgress ) {
25793           arg5 = GDALTermProgress;
25794         } else {
25795           if (!PyCallable_Check(obj4)) {
25796             PyErr_SetString( PyExc_RuntimeError,
25797               "Object given is not a Python function" );
25798             SWIG_fail;
25799           }
25800           psProgressInfo->psPyCallback = obj4;
25801           arg5 = PyProgressProxy;
25802         }
25803 
25804       }
25805 
25806     }
25807   }
25808   if (obj5) {
25809     {
25810       /* %typemap(in) ( void* callback_data=NULL)  */
25811       psProgressInfo->psPyCallbackData = obj5 ;
25812     }
25813   }
25814   {
25815     if ( bUseExceptions ) {
25816       ClearErrorState();
25817     }
25818     {
25819       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25820       result = (Statistics *)GDALMDArrayHS_GetStatistics(arg1,arg2,arg3,arg4,arg5,arg6);
25821       SWIG_PYTHON_THREAD_END_ALLOW;
25822     }
25823 #ifndef SED_HACKS
25824     if ( bUseExceptions ) {
25825       CPLErr eclass = CPLGetLastErrorType();
25826       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25827         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25828       }
25829     }
25830 #endif
25831   }
25832   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Statistics, 0 |  0 );
25833   {
25834     /* %typemap(freearg) ( void* callback_data=NULL)  */
25835 
25836     CPLFree(psProgressInfo);
25837 
25838   }
25839   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25840   return resultobj;
25841 fail:
25842   {
25843     /* %typemap(freearg) ( void* callback_data=NULL)  */
25844 
25845     CPLFree(psProgressInfo);
25846 
25847   }
25848   return NULL;
25849 }
25850 
25851 
_wrap_MDArray_ComputeStatistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)25852 SWIGINTERN PyObject *_wrap_MDArray_ComputeStatistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
25853   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25854   GDALMDArrayHS *arg1 = (GDALMDArrayHS *) 0 ;
25855   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) NULL ;
25856   bool arg3 = (bool) FALSE ;
25857   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
25858   void *arg5 = (void *) NULL ;
25859   void *argp1 = 0 ;
25860   int res1 = 0 ;
25861   void *argp2 = 0 ;
25862   int res2 = 0 ;
25863   bool val3 ;
25864   int ecode3 = 0 ;
25865   PyObject * obj0 = 0 ;
25866   PyObject * obj1 = 0 ;
25867   PyObject * obj2 = 0 ;
25868   PyObject * obj3 = 0 ;
25869   PyObject * obj4 = 0 ;
25870   char *  kwnames[] = {
25871     (char *) "self",(char *) "ds",(char *) "approx_ok",(char *) "callback",(char *) "callback_data", NULL
25872   };
25873   Statistics *result = 0 ;
25874 
25875   /* %typemap(arginit) ( const char* callback_data=NULL)  */
25876   PyProgressData *psProgressInfo;
25877   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
25878   psProgressInfo->nLastReported = -1;
25879   psProgressInfo->psPyCallback = NULL;
25880   psProgressInfo->psPyCallbackData = NULL;
25881   arg5 = psProgressInfo;
25882   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:MDArray_ComputeStatistics",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
25883   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
25884   if (!SWIG_IsOK(res1)) {
25885     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MDArray_ComputeStatistics" "', argument " "1"" of type '" "GDALMDArrayHS *""'");
25886   }
25887   arg1 = reinterpret_cast< GDALMDArrayHS * >(argp1);
25888   if (obj1) {
25889     res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
25890     if (!SWIG_IsOK(res2)) {
25891       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MDArray_ComputeStatistics" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
25892     }
25893     arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
25894   }
25895   if (obj2) {
25896     ecode3 = SWIG_AsVal_bool(obj2, &val3);
25897     if (!SWIG_IsOK(ecode3)) {
25898       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "MDArray_ComputeStatistics" "', argument " "3"" of type '" "bool""'");
25899     }
25900     arg3 = static_cast< bool >(val3);
25901   }
25902   if (obj3) {
25903     {
25904       /* %typemap(in) (GDALProgressFunc callback = NULL) */
25905       /* callback_func typemap */
25906 
25907       /* In some cases 0 is passed instead of None. */
25908       /* See https://github.com/OSGeo/gdal/pull/219 */
25909       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
25910       {
25911         if( PyLong_AsLong(obj3) == 0 )
25912         {
25913           obj3 = Py_None;
25914         }
25915       }
25916 
25917       if (obj3 && obj3 != Py_None ) {
25918         void* cbfunction = NULL;
25919         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
25920             (void**)&cbfunction,
25921             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
25922             SWIG_POINTER_EXCEPTION | 0 ));
25923 
25924         if ( cbfunction == GDALTermProgress ) {
25925           arg4 = GDALTermProgress;
25926         } else {
25927           if (!PyCallable_Check(obj3)) {
25928             PyErr_SetString( PyExc_RuntimeError,
25929               "Object given is not a Python function" );
25930             SWIG_fail;
25931           }
25932           psProgressInfo->psPyCallback = obj3;
25933           arg4 = PyProgressProxy;
25934         }
25935 
25936       }
25937 
25938     }
25939   }
25940   if (obj4) {
25941     {
25942       /* %typemap(in) ( void* callback_data=NULL)  */
25943       psProgressInfo->psPyCallbackData = obj4 ;
25944     }
25945   }
25946   {
25947     if ( bUseExceptions ) {
25948       ClearErrorState();
25949     }
25950     {
25951       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25952       result = (Statistics *)GDALMDArrayHS_ComputeStatistics(arg1,arg2,arg3,arg4,arg5);
25953       SWIG_PYTHON_THREAD_END_ALLOW;
25954     }
25955 #ifndef SED_HACKS
25956     if ( bUseExceptions ) {
25957       CPLErr eclass = CPLGetLastErrorType();
25958       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
25959         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
25960       }
25961     }
25962 #endif
25963   }
25964   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Statistics, 0 |  0 );
25965   {
25966     /* %typemap(freearg) ( void* callback_data=NULL)  */
25967 
25968     CPLFree(psProgressInfo);
25969 
25970   }
25971   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
25972   return resultobj;
25973 fail:
25974   {
25975     /* %typemap(freearg) ( void* callback_data=NULL)  */
25976 
25977     CPLFree(psProgressInfo);
25978 
25979   }
25980   return NULL;
25981 }
25982 
25983 
MDArray_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25984 SWIGINTERN PyObject *MDArray_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25985   PyObject *obj;
25986   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
25987   SWIG_TypeNewClientData(SWIGTYPE_p_GDALMDArrayHS, SWIG_NewClientData(obj));
25988   return SWIG_Py_Void();
25989 }
25990 
_wrap_delete_Attribute(PyObject * SWIGUNUSEDPARM (self),PyObject * args)25991 SWIGINTERN PyObject *_wrap_delete_Attribute(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
25992   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
25993   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
25994   void *argp1 = 0 ;
25995   int res1 = 0 ;
25996   PyObject * obj0 = 0 ;
25997 
25998   if (!PyArg_ParseTuple(args,(char *)"O:delete_Attribute",&obj0)) SWIG_fail;
25999   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, SWIG_POINTER_DISOWN |  0 );
26000   if (!SWIG_IsOK(res1)) {
26001     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Attribute" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26002   }
26003   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26004   {
26005     if ( bUseExceptions ) {
26006       ClearErrorState();
26007     }
26008     {
26009       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26010       delete_GDALAttributeHS(arg1);
26011       SWIG_PYTHON_THREAD_END_ALLOW;
26012     }
26013 #ifndef SED_HACKS
26014     if ( bUseExceptions ) {
26015       CPLErr eclass = CPLGetLastErrorType();
26016       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26017         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26018       }
26019     }
26020 #endif
26021   }
26022   resultobj = SWIG_Py_Void();
26023   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26024   return resultobj;
26025 fail:
26026   return NULL;
26027 }
26028 
26029 
_wrap_Attribute_GetName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26030 SWIGINTERN PyObject *_wrap_Attribute_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26031   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26032   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26033   void *argp1 = 0 ;
26034   int res1 = 0 ;
26035   PyObject * obj0 = 0 ;
26036   char *result = 0 ;
26037 
26038   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_GetName",&obj0)) SWIG_fail;
26039   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26040   if (!SWIG_IsOK(res1)) {
26041     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetName" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26042   }
26043   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26044   {
26045     if ( bUseExceptions ) {
26046       ClearErrorState();
26047     }
26048     {
26049       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26050       result = (char *)GDALAttributeHS_GetName(arg1);
26051       SWIG_PYTHON_THREAD_END_ALLOW;
26052     }
26053 #ifndef SED_HACKS
26054     if ( bUseExceptions ) {
26055       CPLErr eclass = CPLGetLastErrorType();
26056       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26057         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26058       }
26059     }
26060 #endif
26061   }
26062   resultobj = SWIG_FromCharPtr((const char *)result);
26063   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26064   return resultobj;
26065 fail:
26066   return NULL;
26067 }
26068 
26069 
_wrap_Attribute_GetFullName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26070 SWIGINTERN PyObject *_wrap_Attribute_GetFullName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26071   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26072   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26073   void *argp1 = 0 ;
26074   int res1 = 0 ;
26075   PyObject * obj0 = 0 ;
26076   char *result = 0 ;
26077 
26078   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_GetFullName",&obj0)) SWIG_fail;
26079   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26080   if (!SWIG_IsOK(res1)) {
26081     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetFullName" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26082   }
26083   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26084   {
26085     if ( bUseExceptions ) {
26086       ClearErrorState();
26087     }
26088     {
26089       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26090       result = (char *)GDALAttributeHS_GetFullName(arg1);
26091       SWIG_PYTHON_THREAD_END_ALLOW;
26092     }
26093 #ifndef SED_HACKS
26094     if ( bUseExceptions ) {
26095       CPLErr eclass = CPLGetLastErrorType();
26096       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26097         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26098       }
26099     }
26100 #endif
26101   }
26102   resultobj = SWIG_FromCharPtr((const char *)result);
26103   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26104   return resultobj;
26105 fail:
26106   return NULL;
26107 }
26108 
26109 
_wrap_Attribute_GetTotalElementsCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26110 SWIGINTERN PyObject *_wrap_Attribute_GetTotalElementsCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26111   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26112   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26113   void *argp1 = 0 ;
26114   int res1 = 0 ;
26115   PyObject * obj0 = 0 ;
26116   unsigned long long result;
26117 
26118   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_GetTotalElementsCount",&obj0)) SWIG_fail;
26119   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26120   if (!SWIG_IsOK(res1)) {
26121     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetTotalElementsCount" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26122   }
26123   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26124   {
26125     if ( bUseExceptions ) {
26126       ClearErrorState();
26127     }
26128     {
26129       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26130       result = (unsigned long long)GDALAttributeHS_GetTotalElementsCount(arg1);
26131       SWIG_PYTHON_THREAD_END_ALLOW;
26132     }
26133 #ifndef SED_HACKS
26134     if ( bUseExceptions ) {
26135       CPLErr eclass = CPLGetLastErrorType();
26136       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26137         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26138       }
26139     }
26140 #endif
26141   }
26142   resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result));
26143   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26144   return resultobj;
26145 fail:
26146   return NULL;
26147 }
26148 
26149 
_wrap_Attribute_GetDimensionCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26150 SWIGINTERN PyObject *_wrap_Attribute_GetDimensionCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26151   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26152   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26153   void *argp1 = 0 ;
26154   int res1 = 0 ;
26155   PyObject * obj0 = 0 ;
26156   size_t result;
26157 
26158   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_GetDimensionCount",&obj0)) SWIG_fail;
26159   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26160   if (!SWIG_IsOK(res1)) {
26161     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetDimensionCount" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26162   }
26163   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26164   {
26165     if ( bUseExceptions ) {
26166       ClearErrorState();
26167     }
26168     {
26169       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26170       result = GDALAttributeHS_GetDimensionCount(arg1);
26171       SWIG_PYTHON_THREAD_END_ALLOW;
26172     }
26173 #ifndef SED_HACKS
26174     if ( bUseExceptions ) {
26175       CPLErr eclass = CPLGetLastErrorType();
26176       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26177         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26178       }
26179     }
26180 #endif
26181   }
26182   resultobj = SWIG_From_size_t(static_cast< size_t >(result));
26183   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26184   return resultobj;
26185 fail:
26186   return NULL;
26187 }
26188 
26189 
_wrap_Attribute_GetDimensionsSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26190 SWIGINTERN PyObject *_wrap_Attribute_GetDimensionsSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26191   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26192   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26193   GUIntBig **arg2 = (GUIntBig **) 0 ;
26194   size_t *arg3 = (size_t *) 0 ;
26195   void *argp1 = 0 ;
26196   int res1 = 0 ;
26197   GUIntBig *vals2 = 0 ;
26198   size_t nCount2 = 0 ;
26199   PyObject * obj0 = 0 ;
26200 
26201   {
26202     /* %typemap(in,numinputs=0) (GUIntBig** pvals, size_t* pnCount) */
26203     arg2 = &vals2;
26204     arg3 = &nCount2;
26205   }
26206   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_GetDimensionsSize",&obj0)) SWIG_fail;
26207   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26208   if (!SWIG_IsOK(res1)) {
26209     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetDimensionsSize" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26210   }
26211   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26212   {
26213     if ( bUseExceptions ) {
26214       ClearErrorState();
26215     }
26216     {
26217       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26218       GDALAttributeHS_GetDimensionsSize(arg1,arg2,arg3);
26219       SWIG_PYTHON_THREAD_END_ALLOW;
26220     }
26221 #ifndef SED_HACKS
26222     if ( bUseExceptions ) {
26223       CPLErr eclass = CPLGetLastErrorType();
26224       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26225         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26226       }
26227     }
26228 #endif
26229   }
26230   resultobj = SWIG_Py_Void();
26231   {
26232     /* %typemap(argout) (GUIntBig** pvals, size_t* pnCount) */
26233     PyObject *list = PyList_New( *arg3 );
26234     for( size_t i = 0; i < *arg3; i++ ) {
26235       char szTmp[32];
26236       sprintf(szTmp, CPL_FRMT_GUIB, (*arg2)[i]);
26237       PyObject *o = PyLong_FromString(szTmp, NULL, 10);
26238       PyList_SetItem(list, i, o );
26239     }
26240     Py_DECREF(resultobj);
26241     resultobj = list;
26242   }
26243   {
26244     /* %typemap(freearg) (GUIntBig** pvals, size_t* pnCount) */
26245     CPLFree(*arg2);
26246   }
26247   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26248   return resultobj;
26249 fail:
26250   {
26251     /* %typemap(freearg) (GUIntBig** pvals, size_t* pnCount) */
26252     CPLFree(*arg2);
26253   }
26254   return NULL;
26255 }
26256 
26257 
_wrap_Attribute_GetDataType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26258 SWIGINTERN PyObject *_wrap_Attribute_GetDataType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26259   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26260   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26261   void *argp1 = 0 ;
26262   int res1 = 0 ;
26263   PyObject * obj0 = 0 ;
26264   GDALExtendedDataTypeHS *result = 0 ;
26265 
26266   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_GetDataType",&obj0)) SWIG_fail;
26267   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26268   if (!SWIG_IsOK(res1)) {
26269     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_GetDataType" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26270   }
26271   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26272   {
26273     if ( bUseExceptions ) {
26274       ClearErrorState();
26275     }
26276     {
26277       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26278       result = (GDALExtendedDataTypeHS *)GDALAttributeHS_GetDataType(arg1);
26279       SWIG_PYTHON_THREAD_END_ALLOW;
26280     }
26281 #ifndef SED_HACKS
26282     if ( bUseExceptions ) {
26283       CPLErr eclass = CPLGetLastErrorType();
26284       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26285         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26286       }
26287     }
26288 #endif
26289   }
26290   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_OWN |  0 );
26291   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26292   return resultobj;
26293 fail:
26294   return NULL;
26295 }
26296 
26297 
_wrap_Attribute_ReadAsRaw(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26298 SWIGINTERN PyObject *_wrap_Attribute_ReadAsRaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26299   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26300   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26301   void **arg2 = (void **) 0 ;
26302   void *argp1 = 0 ;
26303   int res1 = 0 ;
26304   void *pyObject2 = NULL ;
26305   PyObject * obj0 = 0 ;
26306   CPLErr result;
26307 
26308   {
26309     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject2 = NULL ) */
26310     arg2 = &pyObject2;
26311   }
26312   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_ReadAsRaw",&obj0)) SWIG_fail;
26313   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26314   if (!SWIG_IsOK(res1)) {
26315     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsRaw" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26316   }
26317   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26318   {
26319     if ( bUseExceptions ) {
26320       ClearErrorState();
26321     }
26322     {
26323       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26324       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALAttributeHS_ReadAsRaw(arg1,arg2));
26325       SWIG_PYTHON_THREAD_END_ALLOW;
26326     }
26327 #ifndef SED_HACKS
26328     if ( bUseExceptions ) {
26329       CPLErr eclass = CPLGetLastErrorType();
26330       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26331         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26332       }
26333     }
26334 #endif
26335   }
26336   resultobj = SWIG_From_int(static_cast< int >(result));
26337   {
26338     /* %typemap(argout) ( void **outPythonObject ) */
26339     Py_XDECREF(resultobj);
26340     if (*arg2)
26341     {
26342       resultobj = (PyObject*)*arg2;
26343     }
26344     else
26345     {
26346       resultobj = Py_None;
26347       Py_INCREF(resultobj);
26348     }
26349   }
26350   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26351   return resultobj;
26352 fail:
26353   return NULL;
26354 }
26355 
26356 
_wrap_Attribute_ReadAsString(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26357 SWIGINTERN PyObject *_wrap_Attribute_ReadAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26358   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26359   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26360   void *argp1 = 0 ;
26361   int res1 = 0 ;
26362   PyObject * obj0 = 0 ;
26363   char *result = 0 ;
26364 
26365   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_ReadAsString",&obj0)) SWIG_fail;
26366   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26367   if (!SWIG_IsOK(res1)) {
26368     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsString" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26369   }
26370   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26371   {
26372     if ( bUseExceptions ) {
26373       ClearErrorState();
26374     }
26375     {
26376       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26377       result = (char *)GDALAttributeHS_ReadAsString(arg1);
26378       SWIG_PYTHON_THREAD_END_ALLOW;
26379     }
26380 #ifndef SED_HACKS
26381     if ( bUseExceptions ) {
26382       CPLErr eclass = CPLGetLastErrorType();
26383       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26384         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26385       }
26386     }
26387 #endif
26388   }
26389   resultobj = SWIG_FromCharPtr((const char *)result);
26390   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26391   return resultobj;
26392 fail:
26393   return NULL;
26394 }
26395 
26396 
_wrap_Attribute_ReadAsInt(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26397 SWIGINTERN PyObject *_wrap_Attribute_ReadAsInt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26398   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26399   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26400   void *argp1 = 0 ;
26401   int res1 = 0 ;
26402   PyObject * obj0 = 0 ;
26403   int result;
26404 
26405   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_ReadAsInt",&obj0)) SWIG_fail;
26406   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26407   if (!SWIG_IsOK(res1)) {
26408     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsInt" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26409   }
26410   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26411   {
26412     if ( bUseExceptions ) {
26413       ClearErrorState();
26414     }
26415     {
26416       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26417       result = (int)GDALAttributeHS_ReadAsInt(arg1);
26418       SWIG_PYTHON_THREAD_END_ALLOW;
26419     }
26420 #ifndef SED_HACKS
26421     if ( bUseExceptions ) {
26422       CPLErr eclass = CPLGetLastErrorType();
26423       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26424         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26425       }
26426     }
26427 #endif
26428   }
26429   resultobj = SWIG_From_int(static_cast< int >(result));
26430   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26431   return resultobj;
26432 fail:
26433   return NULL;
26434 }
26435 
26436 
_wrap_Attribute_ReadAsDouble(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26437 SWIGINTERN PyObject *_wrap_Attribute_ReadAsDouble(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26438   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26439   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26440   void *argp1 = 0 ;
26441   int res1 = 0 ;
26442   PyObject * obj0 = 0 ;
26443   double result;
26444 
26445   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_ReadAsDouble",&obj0)) SWIG_fail;
26446   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26447   if (!SWIG_IsOK(res1)) {
26448     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsDouble" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26449   }
26450   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26451   {
26452     if ( bUseExceptions ) {
26453       ClearErrorState();
26454     }
26455     {
26456       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26457       result = (double)GDALAttributeHS_ReadAsDouble(arg1);
26458       SWIG_PYTHON_THREAD_END_ALLOW;
26459     }
26460 #ifndef SED_HACKS
26461     if ( bUseExceptions ) {
26462       CPLErr eclass = CPLGetLastErrorType();
26463       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26464         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26465       }
26466     }
26467 #endif
26468   }
26469   resultobj = SWIG_From_double(static_cast< double >(result));
26470   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26471   return resultobj;
26472 fail:
26473   return NULL;
26474 }
26475 
26476 
_wrap_Attribute_ReadAsStringArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26477 SWIGINTERN PyObject *_wrap_Attribute_ReadAsStringArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26478   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26479   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26480   void *argp1 = 0 ;
26481   int res1 = 0 ;
26482   PyObject * obj0 = 0 ;
26483   char **result = 0 ;
26484 
26485   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_ReadAsStringArray",&obj0)) SWIG_fail;
26486   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26487   if (!SWIG_IsOK(res1)) {
26488     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsStringArray" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26489   }
26490   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26491   {
26492     if ( bUseExceptions ) {
26493       ClearErrorState();
26494     }
26495     {
26496       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26497       result = (char **)GDALAttributeHS_ReadAsStringArray(arg1);
26498       SWIG_PYTHON_THREAD_END_ALLOW;
26499     }
26500 #ifndef SED_HACKS
26501     if ( bUseExceptions ) {
26502       CPLErr eclass = CPLGetLastErrorType();
26503       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26504         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26505       }
26506     }
26507 #endif
26508   }
26509   {
26510     /* %typemap(out) char **CSL -> ( string ) */
26511     char **stringarray = result;
26512     if ( stringarray == NULL ) {
26513       resultobj = Py_None;
26514       Py_INCREF( resultobj );
26515     }
26516     else {
26517       int len = CSLCount( stringarray );
26518       resultobj = PyList_New( len );
26519       for ( int i = 0; i < len; ++i ) {
26520         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
26521         PyList_SetItem(resultobj, i, o );
26522       }
26523     }
26524     CSLDestroy(result);
26525   }
26526   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26527   return resultobj;
26528 fail:
26529   return NULL;
26530 }
26531 
26532 
_wrap_Attribute_ReadAsIntArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26533 SWIGINTERN PyObject *_wrap_Attribute_ReadAsIntArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26534   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26535   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26536   int **arg2 = (int **) 0 ;
26537   size_t *arg3 = (size_t *) 0 ;
26538   void *argp1 = 0 ;
26539   int res1 = 0 ;
26540   int *vals2 = 0 ;
26541   size_t nCount2 = 0 ;
26542   PyObject * obj0 = 0 ;
26543 
26544   {
26545     /* %typemap(in,numinputs=0) (int** pvals, size_t* pnCount) */
26546     arg2 = &vals2;
26547     arg3 = &nCount2;
26548   }
26549   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_ReadAsIntArray",&obj0)) SWIG_fail;
26550   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26551   if (!SWIG_IsOK(res1)) {
26552     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsIntArray" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26553   }
26554   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26555   {
26556     if ( bUseExceptions ) {
26557       ClearErrorState();
26558     }
26559     {
26560       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26561       GDALAttributeHS_ReadAsIntArray(arg1,arg2,arg3);
26562       SWIG_PYTHON_THREAD_END_ALLOW;
26563     }
26564 #ifndef SED_HACKS
26565     if ( bUseExceptions ) {
26566       CPLErr eclass = CPLGetLastErrorType();
26567       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26568         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26569       }
26570     }
26571 #endif
26572   }
26573   resultobj = SWIG_Py_Void();
26574   {
26575     /* %typemap(argout) (int** pvals, size_t* pnCount) */
26576     PyObject *out = PyTuple_New( *arg3 );
26577     for( unsigned int i=0; i<*arg3; i++ ) {
26578       PyObject *val = PyInt_FromLong( (*arg2)[i] );
26579       PyTuple_SetItem( out, i, val );
26580     }
26581     Py_DECREF(resultobj);
26582     resultobj = out;
26583   }
26584   {
26585     /* %typemap(freearg) (int** pvals, size_t* pnCount) */
26586     CPLFree(*arg2);
26587   }
26588   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26589   return resultobj;
26590 fail:
26591   {
26592     /* %typemap(freearg) (int** pvals, size_t* pnCount) */
26593     CPLFree(*arg2);
26594   }
26595   return NULL;
26596 }
26597 
26598 
_wrap_Attribute_ReadAsDoubleArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26599 SWIGINTERN PyObject *_wrap_Attribute_ReadAsDoubleArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26600   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26601   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26602   double **arg2 = (double **) 0 ;
26603   size_t *arg3 = (size_t *) 0 ;
26604   void *argp1 = 0 ;
26605   int res1 = 0 ;
26606   double *vals2 = 0 ;
26607   size_t nCount2 = 0 ;
26608   PyObject * obj0 = 0 ;
26609 
26610   {
26611     /* %typemap(in,numinputs=0) (double** pvals, size_t* pnCount) */
26612     arg2 = &vals2;
26613     arg3 = &nCount2;
26614   }
26615   if (!PyArg_ParseTuple(args,(char *)"O:Attribute_ReadAsDoubleArray",&obj0)) SWIG_fail;
26616   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26617   if (!SWIG_IsOK(res1)) {
26618     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_ReadAsDoubleArray" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26619   }
26620   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26621   {
26622     if ( bUseExceptions ) {
26623       ClearErrorState();
26624     }
26625     {
26626       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26627       GDALAttributeHS_ReadAsDoubleArray(arg1,arg2,arg3);
26628       SWIG_PYTHON_THREAD_END_ALLOW;
26629     }
26630 #ifndef SED_HACKS
26631     if ( bUseExceptions ) {
26632       CPLErr eclass = CPLGetLastErrorType();
26633       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26634         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26635       }
26636     }
26637 #endif
26638   }
26639   resultobj = SWIG_Py_Void();
26640   {
26641     /* %typemap(argout) (double** pvals, size_t* pnCount) */
26642     PyObject *list = CreateTupleFromDoubleArray(*arg2, *arg3);
26643     Py_DECREF(resultobj);
26644     resultobj = list;
26645   }
26646   {
26647     /* %typemap(freearg) (double** pvals, size_t* pnCount) */
26648     CPLFree(*arg2);
26649   }
26650   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26651   return resultobj;
26652 fail:
26653   {
26654     /* %typemap(freearg) (double** pvals, size_t* pnCount) */
26655     CPLFree(*arg2);
26656   }
26657   return NULL;
26658 }
26659 
26660 
_wrap_Attribute_WriteRaw(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26661 SWIGINTERN PyObject *_wrap_Attribute_WriteRaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26662   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26663   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26664   GIntBig arg2 ;
26665   char *arg3 = (char *) 0 ;
26666   void *argp1 = 0 ;
26667   int res1 = 0 ;
26668   int alloc2 = 0 ;
26669   bool viewIsValid2 = false ;
26670   Py_buffer view2 ;
26671   PyObject * obj0 = 0 ;
26672   PyObject * obj1 = 0 ;
26673   CPLErr result;
26674 
26675   if (!PyArg_ParseTuple(args,(char *)"OO:Attribute_WriteRaw",&obj0,&obj1)) SWIG_fail;
26676   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26677   if (!SWIG_IsOK(res1)) {
26678     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteRaw" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26679   }
26680   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26681   {
26682     /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
26683     {
26684       if (PyObject_GetBuffer(obj1, &view2, PyBUF_SIMPLE) == 0)
26685       {
26686         viewIsValid2 = true;
26687         arg2 = view2.len;
26688         arg3 = (char *) view2.buf;
26689         goto ok;
26690       }
26691       else
26692       {
26693         PyErr_Clear();
26694       }
26695     }
26696     if (PyUnicode_Check(obj1))
26697     {
26698       size_t safeLen = 0;
26699       int ret = SWIG_AsCharPtrAndSize(obj1, (char**) &arg3, &safeLen, &alloc2);
26700       if (!SWIG_IsOK(ret)) {
26701         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
26702       }
26703 
26704       if (safeLen) safeLen--;
26705       arg2 = (GIntBig) safeLen;
26706     }
26707     else
26708     {
26709       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
26710       SWIG_fail;
26711     }
26712     ok: ;
26713   }
26714   {
26715     if ( bUseExceptions ) {
26716       ClearErrorState();
26717     }
26718     {
26719       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26720       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALAttributeHS_WriteRaw(arg1,arg2,arg3));
26721       SWIG_PYTHON_THREAD_END_ALLOW;
26722     }
26723 #ifndef SED_HACKS
26724     if ( bUseExceptions ) {
26725       CPLErr eclass = CPLGetLastErrorType();
26726       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26727         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26728       }
26729     }
26730 #endif
26731   }
26732   resultobj = SWIG_From_int(static_cast< int >(result));
26733   {
26734     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
26735     if( viewIsValid2 ) {
26736       PyBuffer_Release(&view2);
26737     }
26738     else if (ReturnSame(alloc2) == SWIG_NEWOBJ ) {
26739       delete[] arg3;
26740     }
26741   }
26742   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26743   return resultobj;
26744 fail:
26745   {
26746     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
26747     if( viewIsValid2 ) {
26748       PyBuffer_Release(&view2);
26749     }
26750     else if (ReturnSame(alloc2) == SWIG_NEWOBJ ) {
26751       delete[] arg3;
26752     }
26753   }
26754   return NULL;
26755 }
26756 
26757 
_wrap_Attribute_WriteString(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26758 SWIGINTERN PyObject *_wrap_Attribute_WriteString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26759   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26760   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26761   char *arg2 = (char *) 0 ;
26762   void *argp1 = 0 ;
26763   int res1 = 0 ;
26764   int res2 ;
26765   char *buf2 = 0 ;
26766   int alloc2 = 0 ;
26767   PyObject * obj0 = 0 ;
26768   PyObject * obj1 = 0 ;
26769   CPLErr result;
26770 
26771   if (!PyArg_ParseTuple(args,(char *)"OO:Attribute_WriteString",&obj0,&obj1)) SWIG_fail;
26772   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26773   if (!SWIG_IsOK(res1)) {
26774     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteString" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26775   }
26776   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26777   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
26778   if (!SWIG_IsOK(res2)) {
26779     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Attribute_WriteString" "', argument " "2"" of type '" "char const *""'");
26780   }
26781   arg2 = reinterpret_cast< char * >(buf2);
26782   {
26783     if ( bUseExceptions ) {
26784       ClearErrorState();
26785     }
26786     {
26787       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26788       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALAttributeHS_WriteString(arg1,(char const *)arg2));
26789       SWIG_PYTHON_THREAD_END_ALLOW;
26790     }
26791 #ifndef SED_HACKS
26792     if ( bUseExceptions ) {
26793       CPLErr eclass = CPLGetLastErrorType();
26794       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26795         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26796       }
26797     }
26798 #endif
26799   }
26800   resultobj = SWIG_From_int(static_cast< int >(result));
26801   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
26802   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26803   return resultobj;
26804 fail:
26805   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
26806   return NULL;
26807 }
26808 
26809 
_wrap_Attribute_WriteStringArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26810 SWIGINTERN PyObject *_wrap_Attribute_WriteStringArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26811   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26812   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26813   char **arg2 = (char **) 0 ;
26814   void *argp1 = 0 ;
26815   int res1 = 0 ;
26816   PyObject * obj0 = 0 ;
26817   PyObject * obj1 = 0 ;
26818   CPLErr result;
26819 
26820   if (!PyArg_ParseTuple(args,(char *)"OO:Attribute_WriteStringArray",&obj0,&obj1)) SWIG_fail;
26821   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26822   if (!SWIG_IsOK(res1)) {
26823     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteStringArray" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26824   }
26825   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26826   {
26827     /* %typemap(in) char **options */
26828     int bErr = FALSE;
26829     arg2 = CSLFromPySequence(obj1, &bErr);
26830     if( bErr )
26831     {
26832       SWIG_fail;
26833     }
26834   }
26835   {
26836     if ( bUseExceptions ) {
26837       ClearErrorState();
26838     }
26839     {
26840       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26841       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALAttributeHS_WriteStringArray(arg1,arg2));
26842       SWIG_PYTHON_THREAD_END_ALLOW;
26843     }
26844 #ifndef SED_HACKS
26845     if ( bUseExceptions ) {
26846       CPLErr eclass = CPLGetLastErrorType();
26847       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26848         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26849       }
26850     }
26851 #endif
26852   }
26853   resultobj = SWIG_From_int(static_cast< int >(result));
26854   {
26855     /* %typemap(freearg) char **options */
26856     CSLDestroy( arg2 );
26857   }
26858   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26859   return resultobj;
26860 fail:
26861   {
26862     /* %typemap(freearg) char **options */
26863     CSLDestroy( arg2 );
26864   }
26865   return NULL;
26866 }
26867 
26868 
_wrap_Attribute_WriteInt(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26869 SWIGINTERN PyObject *_wrap_Attribute_WriteInt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26870   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26871   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26872   int arg2 ;
26873   void *argp1 = 0 ;
26874   int res1 = 0 ;
26875   int val2 ;
26876   int ecode2 = 0 ;
26877   PyObject * obj0 = 0 ;
26878   PyObject * obj1 = 0 ;
26879   CPLErr result;
26880 
26881   if (!PyArg_ParseTuple(args,(char *)"OO:Attribute_WriteInt",&obj0,&obj1)) SWIG_fail;
26882   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26883   if (!SWIG_IsOK(res1)) {
26884     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteInt" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26885   }
26886   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26887   ecode2 = SWIG_AsVal_int(obj1, &val2);
26888   if (!SWIG_IsOK(ecode2)) {
26889     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Attribute_WriteInt" "', argument " "2"" of type '" "int""'");
26890   }
26891   arg2 = static_cast< int >(val2);
26892   {
26893     if ( bUseExceptions ) {
26894       ClearErrorState();
26895     }
26896     {
26897       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26898       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALAttributeHS_WriteInt(arg1,arg2));
26899       SWIG_PYTHON_THREAD_END_ALLOW;
26900     }
26901 #ifndef SED_HACKS
26902     if ( bUseExceptions ) {
26903       CPLErr eclass = CPLGetLastErrorType();
26904       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26905         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26906       }
26907     }
26908 #endif
26909   }
26910   resultobj = SWIG_From_int(static_cast< int >(result));
26911   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26912   return resultobj;
26913 fail:
26914   return NULL;
26915 }
26916 
26917 
_wrap_Attribute_WriteDouble(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26918 SWIGINTERN PyObject *_wrap_Attribute_WriteDouble(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26919   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26920   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26921   double arg2 ;
26922   void *argp1 = 0 ;
26923   int res1 = 0 ;
26924   double val2 ;
26925   int ecode2 = 0 ;
26926   PyObject * obj0 = 0 ;
26927   PyObject * obj1 = 0 ;
26928   CPLErr result;
26929 
26930   if (!PyArg_ParseTuple(args,(char *)"OO:Attribute_WriteDouble",&obj0,&obj1)) SWIG_fail;
26931   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26932   if (!SWIG_IsOK(res1)) {
26933     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteDouble" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26934   }
26935   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26936   ecode2 = SWIG_AsVal_double(obj1, &val2);
26937   if (!SWIG_IsOK(ecode2)) {
26938     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Attribute_WriteDouble" "', argument " "2"" of type '" "double""'");
26939   }
26940   arg2 = static_cast< double >(val2);
26941   {
26942     if ( bUseExceptions ) {
26943       ClearErrorState();
26944     }
26945     {
26946       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26947       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALAttributeHS_WriteDouble(arg1,arg2));
26948       SWIG_PYTHON_THREAD_END_ALLOW;
26949     }
26950 #ifndef SED_HACKS
26951     if ( bUseExceptions ) {
26952       CPLErr eclass = CPLGetLastErrorType();
26953       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
26954         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
26955       }
26956     }
26957 #endif
26958   }
26959   resultobj = SWIG_From_int(static_cast< int >(result));
26960   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
26961   return resultobj;
26962 fail:
26963   return NULL;
26964 }
26965 
26966 
_wrap_Attribute_WriteDoubleArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)26967 SWIGINTERN PyObject *_wrap_Attribute_WriteDoubleArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
26968   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
26969   GDALAttributeHS *arg1 = (GDALAttributeHS *) 0 ;
26970   int arg2 ;
26971   double *arg3 = (double *) 0 ;
26972   void *argp1 = 0 ;
26973   int res1 = 0 ;
26974   PyObject * obj0 = 0 ;
26975   PyObject * obj1 = 0 ;
26976   CPLErr result;
26977 
26978   if (!PyArg_ParseTuple(args,(char *)"OO:Attribute_WriteDoubleArray",&obj0,&obj1)) SWIG_fail;
26979   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALAttributeHS, 0 |  0 );
26980   if (!SWIG_IsOK(res1)) {
26981     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Attribute_WriteDoubleArray" "', argument " "1"" of type '" "GDALAttributeHS *""'");
26982   }
26983   arg1 = reinterpret_cast< GDALAttributeHS * >(argp1);
26984   {
26985     /* %typemap(in,numinputs=1) (int nList, double* pList)*/
26986     /* check if is List */
26987     if ( !PySequence_Check(obj1) ) {
26988       PyErr_SetString(PyExc_TypeError, "not a sequence");
26989       SWIG_fail;
26990     }
26991     Py_ssize_t size = PySequence_Size(obj1);
26992     if( size != (int)size ) {
26993       PyErr_SetString(PyExc_TypeError, "too big sequence");
26994       SWIG_fail;
26995     }
26996     arg2 = (int)size;
26997     arg3 = (double*) malloc(arg2*sizeof(double));
26998     for( int i = 0; i<arg2; i++ ) {
26999       PyObject *o = PySequence_GetItem(obj1,i);
27000       if ( !PyArg_Parse(o,"d",&arg3[i]) ) {
27001         PyErr_SetString(PyExc_TypeError, "not a number");
27002         Py_DECREF(o);
27003         SWIG_fail;
27004       }
27005       Py_DECREF(o);
27006     }
27007   }
27008   {
27009     if ( bUseExceptions ) {
27010       ClearErrorState();
27011     }
27012     {
27013       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27014       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALAttributeHS_WriteDoubleArray(arg1,arg2,arg3));
27015       SWIG_PYTHON_THREAD_END_ALLOW;
27016     }
27017 #ifndef SED_HACKS
27018     if ( bUseExceptions ) {
27019       CPLErr eclass = CPLGetLastErrorType();
27020       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27021         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27022       }
27023     }
27024 #endif
27025   }
27026   resultobj = SWIG_From_int(static_cast< int >(result));
27027   {
27028     /* %typemap(freearg) (int nList, double* pList) */
27029     if (arg3) {
27030       free((void*) arg3);
27031     }
27032   }
27033   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27034   return resultobj;
27035 fail:
27036   {
27037     /* %typemap(freearg) (int nList, double* pList) */
27038     if (arg3) {
27039       free((void*) arg3);
27040     }
27041   }
27042   return NULL;
27043 }
27044 
27045 
Attribute_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27046 SWIGINTERN PyObject *Attribute_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27047   PyObject *obj;
27048   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
27049   SWIG_TypeNewClientData(SWIGTYPE_p_GDALAttributeHS, SWIG_NewClientData(obj));
27050   return SWIG_Py_Void();
27051 }
27052 
_wrap_delete_Dimension(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27053 SWIGINTERN PyObject *_wrap_delete_Dimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27054   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27055   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27056   void *argp1 = 0 ;
27057   int res1 = 0 ;
27058   PyObject * obj0 = 0 ;
27059 
27060   if (!PyArg_ParseTuple(args,(char *)"O:delete_Dimension",&obj0)) SWIG_fail;
27061   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, SWIG_POINTER_DISOWN |  0 );
27062   if (!SWIG_IsOK(res1)) {
27063     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Dimension" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27064   }
27065   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27066   {
27067     if ( bUseExceptions ) {
27068       ClearErrorState();
27069     }
27070     {
27071       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27072       delete_GDALDimensionHS(arg1);
27073       SWIG_PYTHON_THREAD_END_ALLOW;
27074     }
27075 #ifndef SED_HACKS
27076     if ( bUseExceptions ) {
27077       CPLErr eclass = CPLGetLastErrorType();
27078       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27079         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27080       }
27081     }
27082 #endif
27083   }
27084   resultobj = SWIG_Py_Void();
27085   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27086   return resultobj;
27087 fail:
27088   return NULL;
27089 }
27090 
27091 
_wrap_Dimension_GetName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27092 SWIGINTERN PyObject *_wrap_Dimension_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27093   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27094   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27095   void *argp1 = 0 ;
27096   int res1 = 0 ;
27097   PyObject * obj0 = 0 ;
27098   char *result = 0 ;
27099 
27100   if (!PyArg_ParseTuple(args,(char *)"O:Dimension_GetName",&obj0)) SWIG_fail;
27101   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
27102   if (!SWIG_IsOK(res1)) {
27103     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetName" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27104   }
27105   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27106   {
27107     if ( bUseExceptions ) {
27108       ClearErrorState();
27109     }
27110     {
27111       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27112       result = (char *)GDALDimensionHS_GetName(arg1);
27113       SWIG_PYTHON_THREAD_END_ALLOW;
27114     }
27115 #ifndef SED_HACKS
27116     if ( bUseExceptions ) {
27117       CPLErr eclass = CPLGetLastErrorType();
27118       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27119         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27120       }
27121     }
27122 #endif
27123   }
27124   resultobj = SWIG_FromCharPtr((const char *)result);
27125   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27126   return resultobj;
27127 fail:
27128   return NULL;
27129 }
27130 
27131 
_wrap_Dimension_GetFullName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27132 SWIGINTERN PyObject *_wrap_Dimension_GetFullName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27133   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27134   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27135   void *argp1 = 0 ;
27136   int res1 = 0 ;
27137   PyObject * obj0 = 0 ;
27138   char *result = 0 ;
27139 
27140   if (!PyArg_ParseTuple(args,(char *)"O:Dimension_GetFullName",&obj0)) SWIG_fail;
27141   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
27142   if (!SWIG_IsOK(res1)) {
27143     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetFullName" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27144   }
27145   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27146   {
27147     if ( bUseExceptions ) {
27148       ClearErrorState();
27149     }
27150     {
27151       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27152       result = (char *)GDALDimensionHS_GetFullName(arg1);
27153       SWIG_PYTHON_THREAD_END_ALLOW;
27154     }
27155 #ifndef SED_HACKS
27156     if ( bUseExceptions ) {
27157       CPLErr eclass = CPLGetLastErrorType();
27158       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27159         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27160       }
27161     }
27162 #endif
27163   }
27164   resultobj = SWIG_FromCharPtr((const char *)result);
27165   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27166   return resultobj;
27167 fail:
27168   return NULL;
27169 }
27170 
27171 
_wrap_Dimension_GetType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27172 SWIGINTERN PyObject *_wrap_Dimension_GetType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27173   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27174   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27175   void *argp1 = 0 ;
27176   int res1 = 0 ;
27177   PyObject * obj0 = 0 ;
27178   char *result = 0 ;
27179 
27180   if (!PyArg_ParseTuple(args,(char *)"O:Dimension_GetType",&obj0)) SWIG_fail;
27181   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
27182   if (!SWIG_IsOK(res1)) {
27183     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetType" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27184   }
27185   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27186   {
27187     if ( bUseExceptions ) {
27188       ClearErrorState();
27189     }
27190     {
27191       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27192       result = (char *)GDALDimensionHS_GetType(arg1);
27193       SWIG_PYTHON_THREAD_END_ALLOW;
27194     }
27195 #ifndef SED_HACKS
27196     if ( bUseExceptions ) {
27197       CPLErr eclass = CPLGetLastErrorType();
27198       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27199         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27200       }
27201     }
27202 #endif
27203   }
27204   resultobj = SWIG_FromCharPtr((const char *)result);
27205   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27206   return resultobj;
27207 fail:
27208   return NULL;
27209 }
27210 
27211 
_wrap_Dimension_GetDirection(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27212 SWIGINTERN PyObject *_wrap_Dimension_GetDirection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27213   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27214   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27215   void *argp1 = 0 ;
27216   int res1 = 0 ;
27217   PyObject * obj0 = 0 ;
27218   char *result = 0 ;
27219 
27220   if (!PyArg_ParseTuple(args,(char *)"O:Dimension_GetDirection",&obj0)) SWIG_fail;
27221   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
27222   if (!SWIG_IsOK(res1)) {
27223     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetDirection" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27224   }
27225   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27226   {
27227     if ( bUseExceptions ) {
27228       ClearErrorState();
27229     }
27230     {
27231       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27232       result = (char *)GDALDimensionHS_GetDirection(arg1);
27233       SWIG_PYTHON_THREAD_END_ALLOW;
27234     }
27235 #ifndef SED_HACKS
27236     if ( bUseExceptions ) {
27237       CPLErr eclass = CPLGetLastErrorType();
27238       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27239         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27240       }
27241     }
27242 #endif
27243   }
27244   resultobj = SWIG_FromCharPtr((const char *)result);
27245   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27246   return resultobj;
27247 fail:
27248   return NULL;
27249 }
27250 
27251 
_wrap_Dimension_GetSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27252 SWIGINTERN PyObject *_wrap_Dimension_GetSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27253   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27254   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27255   void *argp1 = 0 ;
27256   int res1 = 0 ;
27257   PyObject * obj0 = 0 ;
27258   unsigned long long result;
27259 
27260   if (!PyArg_ParseTuple(args,(char *)"O:Dimension_GetSize",&obj0)) SWIG_fail;
27261   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
27262   if (!SWIG_IsOK(res1)) {
27263     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetSize" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27264   }
27265   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27266   {
27267     if ( bUseExceptions ) {
27268       ClearErrorState();
27269     }
27270     {
27271       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27272       result = (unsigned long long)GDALDimensionHS_GetSize(arg1);
27273       SWIG_PYTHON_THREAD_END_ALLOW;
27274     }
27275 #ifndef SED_HACKS
27276     if ( bUseExceptions ) {
27277       CPLErr eclass = CPLGetLastErrorType();
27278       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27279         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27280       }
27281     }
27282 #endif
27283   }
27284   resultobj = SWIG_From_unsigned_SS_long_SS_long(static_cast< unsigned long long >(result));
27285   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27286   return resultobj;
27287 fail:
27288   return NULL;
27289 }
27290 
27291 
_wrap_Dimension_GetIndexingVariable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27292 SWIGINTERN PyObject *_wrap_Dimension_GetIndexingVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27293   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27294   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27295   void *argp1 = 0 ;
27296   int res1 = 0 ;
27297   PyObject * obj0 = 0 ;
27298   GDALMDArrayHS *result = 0 ;
27299 
27300   if (!PyArg_ParseTuple(args,(char *)"O:Dimension_GetIndexingVariable",&obj0)) SWIG_fail;
27301   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
27302   if (!SWIG_IsOK(res1)) {
27303     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_GetIndexingVariable" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27304   }
27305   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27306   {
27307     if ( bUseExceptions ) {
27308       ClearErrorState();
27309     }
27310     {
27311       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27312       result = (GDALMDArrayHS *)GDALDimensionHS_GetIndexingVariable(arg1);
27313       SWIG_PYTHON_THREAD_END_ALLOW;
27314     }
27315 #ifndef SED_HACKS
27316     if ( bUseExceptions ) {
27317       CPLErr eclass = CPLGetLastErrorType();
27318       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27319         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27320       }
27321     }
27322 #endif
27323   }
27324   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
27325   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27326   return resultobj;
27327 fail:
27328   return NULL;
27329 }
27330 
27331 
_wrap_Dimension_SetIndexingVariable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27332 SWIGINTERN PyObject *_wrap_Dimension_SetIndexingVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27333   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27334   GDALDimensionHS *arg1 = (GDALDimensionHS *) 0 ;
27335   GDALMDArrayHS *arg2 = (GDALMDArrayHS *) 0 ;
27336   void *argp1 = 0 ;
27337   int res1 = 0 ;
27338   void *argp2 = 0 ;
27339   int res2 = 0 ;
27340   PyObject * obj0 = 0 ;
27341   PyObject * obj1 = 0 ;
27342   bool result;
27343 
27344   if (!PyArg_ParseTuple(args,(char *)"OO:Dimension_SetIndexingVariable",&obj0,&obj1)) SWIG_fail;
27345   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDimensionHS, 0 |  0 );
27346   if (!SWIG_IsOK(res1)) {
27347     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Dimension_SetIndexingVariable" "', argument " "1"" of type '" "GDALDimensionHS *""'");
27348   }
27349   arg1 = reinterpret_cast< GDALDimensionHS * >(argp1);
27350   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALMDArrayHS, 0 |  0 );
27351   if (!SWIG_IsOK(res2)) {
27352     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Dimension_SetIndexingVariable" "', argument " "2"" of type '" "GDALMDArrayHS *""'");
27353   }
27354   arg2 = reinterpret_cast< GDALMDArrayHS * >(argp2);
27355   {
27356     if ( bUseExceptions ) {
27357       ClearErrorState();
27358     }
27359     {
27360       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27361       result = (bool)GDALDimensionHS_SetIndexingVariable(arg1,arg2);
27362       SWIG_PYTHON_THREAD_END_ALLOW;
27363     }
27364 #ifndef SED_HACKS
27365     if ( bUseExceptions ) {
27366       CPLErr eclass = CPLGetLastErrorType();
27367       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27368         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27369       }
27370     }
27371 #endif
27372   }
27373   resultobj = SWIG_From_bool(static_cast< bool >(result));
27374   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27375   return resultobj;
27376 fail:
27377   return NULL;
27378 }
27379 
27380 
Dimension_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27381 SWIGINTERN PyObject *Dimension_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27382   PyObject *obj;
27383   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
27384   SWIG_TypeNewClientData(SWIGTYPE_p_GDALDimensionHS, SWIG_NewClientData(obj));
27385   return SWIG_Py_Void();
27386 }
27387 
_wrap_delete_ExtendedDataType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27388 SWIGINTERN PyObject *_wrap_delete_ExtendedDataType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27389   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27390   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27391   void *argp1 = 0 ;
27392   int res1 = 0 ;
27393   PyObject * obj0 = 0 ;
27394 
27395   if (!PyArg_ParseTuple(args,(char *)"O:delete_ExtendedDataType",&obj0)) SWIG_fail;
27396   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_DISOWN |  0 );
27397   if (!SWIG_IsOK(res1)) {
27398     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ExtendedDataType" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27399   }
27400   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27401   {
27402     if ( bUseExceptions ) {
27403       ClearErrorState();
27404     }
27405     {
27406       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27407       delete_GDALExtendedDataTypeHS(arg1);
27408       SWIG_PYTHON_THREAD_END_ALLOW;
27409     }
27410 #ifndef SED_HACKS
27411     if ( bUseExceptions ) {
27412       CPLErr eclass = CPLGetLastErrorType();
27413       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27414         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27415       }
27416     }
27417 #endif
27418   }
27419   resultobj = SWIG_Py_Void();
27420   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27421   return resultobj;
27422 fail:
27423   return NULL;
27424 }
27425 
27426 
_wrap_ExtendedDataType_Create(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27427 SWIGINTERN PyObject *_wrap_ExtendedDataType_Create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27428   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27429   GDALDataType arg1 ;
27430   PyObject * obj0 = 0 ;
27431   GDALExtendedDataTypeHS *result = 0 ;
27432 
27433   if (!PyArg_ParseTuple(args,(char *)"O:ExtendedDataType_Create",&obj0)) SWIG_fail;
27434   {
27435     // %typemap(in) GDALDataType
27436     int val = 0;
27437     int ecode = SWIG_AsVal_int(obj0, &val);
27438     if (!SWIG_IsOK(ecode)) {
27439       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
27440     }
27441     if( val < GDT_Unknown || val >= GDT_TypeCount )
27442     {
27443       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
27444     }
27445     arg1 = static_cast<GDALDataType>(val);
27446   }
27447   {
27448     if ( bUseExceptions ) {
27449       ClearErrorState();
27450     }
27451     {
27452       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27453       result = (GDALExtendedDataTypeHS *)GDALExtendedDataTypeHS_Create(arg1);
27454       SWIG_PYTHON_THREAD_END_ALLOW;
27455     }
27456 #ifndef SED_HACKS
27457     if ( bUseExceptions ) {
27458       CPLErr eclass = CPLGetLastErrorType();
27459       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27460         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27461       }
27462     }
27463 #endif
27464   }
27465   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_OWN |  0 );
27466   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27467   return resultobj;
27468 fail:
27469   return NULL;
27470 }
27471 
27472 
_wrap_ExtendedDataType_CreateString(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27473 SWIGINTERN PyObject *_wrap_ExtendedDataType_CreateString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27474   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27475   size_t arg1 = (size_t) 0 ;
27476   size_t val1 ;
27477   int ecode1 = 0 ;
27478   PyObject * obj0 = 0 ;
27479   GDALExtendedDataTypeHS *result = 0 ;
27480 
27481   if (!PyArg_ParseTuple(args,(char *)"|O:ExtendedDataType_CreateString",&obj0)) SWIG_fail;
27482   if (obj0) {
27483     ecode1 = SWIG_AsVal_size_t(obj0, &val1);
27484     if (!SWIG_IsOK(ecode1)) {
27485       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ExtendedDataType_CreateString" "', argument " "1"" of type '" "size_t""'");
27486     }
27487     arg1 = static_cast< size_t >(val1);
27488   }
27489   {
27490     if ( bUseExceptions ) {
27491       ClearErrorState();
27492     }
27493     {
27494       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27495       result = (GDALExtendedDataTypeHS *)GDALExtendedDataTypeHS_CreateString(arg1);
27496       SWIG_PYTHON_THREAD_END_ALLOW;
27497     }
27498 #ifndef SED_HACKS
27499     if ( bUseExceptions ) {
27500       CPLErr eclass = CPLGetLastErrorType();
27501       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27502         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27503       }
27504     }
27505 #endif
27506   }
27507   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_OWN |  0 );
27508   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27509   return resultobj;
27510 fail:
27511   return NULL;
27512 }
27513 
27514 
_wrap_ExtendedDataType_CreateCompound(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27515 SWIGINTERN PyObject *_wrap_ExtendedDataType_CreateCompound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27516   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27517   char *arg1 = (char *) 0 ;
27518   size_t arg2 ;
27519   int arg3 ;
27520   GDALEDTComponentHS **arg4 = (GDALEDTComponentHS **) 0 ;
27521   int res1 ;
27522   char *buf1 = 0 ;
27523   int alloc1 = 0 ;
27524   size_t val2 ;
27525   int ecode2 = 0 ;
27526   PyObject * obj0 = 0 ;
27527   PyObject * obj1 = 0 ;
27528   PyObject * obj2 = 0 ;
27529   GDALExtendedDataTypeHS *result = 0 ;
27530 
27531   if (!PyArg_ParseTuple(args,(char *)"OOO:ExtendedDataType_CreateCompound",&obj0,&obj1,&obj2)) SWIG_fail;
27532   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
27533   if (!SWIG_IsOK(res1)) {
27534     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_CreateCompound" "', argument " "1"" of type '" "char const *""'");
27535   }
27536   arg1 = reinterpret_cast< char * >(buf1);
27537   ecode2 = SWIG_AsVal_size_t(obj1, &val2);
27538   if (!SWIG_IsOK(ecode2)) {
27539     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ExtendedDataType_CreateCompound" "', argument " "2"" of type '" "size_t""'");
27540   }
27541   arg2 = static_cast< size_t >(val2);
27542   {
27543     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALEDTComponentHS *optional_##GDALEDTComponentHS)*/
27544     if ( !PySequence_Check(obj2) ) {
27545       PyErr_SetString(PyExc_TypeError, "not a sequence");
27546       SWIG_fail;
27547     }
27548     Py_ssize_t size = PySequence_Size(obj2);
27549     if( size != (int)size ) {
27550       PyErr_SetString(PyExc_TypeError, "too big sequence");
27551       SWIG_fail;
27552     }
27553     arg3 = (int)size;
27554     arg4 = (GDALEDTComponentHS**) CPLMalloc(arg3*sizeof(GDALEDTComponentHS*));
27555 
27556     for( int i = 0; i<arg3; i++ ) {
27557       PyObject *o = PySequence_GetItem(obj2,i);
27558       GDALEDTComponentHS* rawobjectpointer = NULL;
27559       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALEDTComponentHS, SWIG_POINTER_EXCEPTION | 0 ));
27560       if (!rawobjectpointer) {
27561         Py_DECREF(o);
27562         PyErr_SetString(PyExc_TypeError, "object of wrong GDALEDTComponentHS");
27563         SWIG_fail;
27564       }
27565       arg4[i] = rawobjectpointer;
27566       Py_DECREF(o);
27567 
27568     }
27569   }
27570   {
27571     if (!arg1) {
27572       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27573     }
27574   }
27575   {
27576     if ( bUseExceptions ) {
27577       ClearErrorState();
27578     }
27579     {
27580       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27581       result = (GDALExtendedDataTypeHS *)GDALExtendedDataTypeHS_CreateCompound((char const *)arg1,arg2,arg3,arg4);
27582       SWIG_PYTHON_THREAD_END_ALLOW;
27583     }
27584 #ifndef SED_HACKS
27585     if ( bUseExceptions ) {
27586       CPLErr eclass = CPLGetLastErrorType();
27587       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27588         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27589       }
27590     }
27591 #endif
27592   }
27593   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_OWN |  0 );
27594   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
27595   {
27596     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALEDTComponentHS **poObjects)*/
27597     CPLFree( arg4 );
27598   }
27599   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27600   return resultobj;
27601 fail:
27602   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
27603   {
27604     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALEDTComponentHS **poObjects)*/
27605     CPLFree( arg4 );
27606   }
27607   return NULL;
27608 }
27609 
27610 
_wrap_ExtendedDataType_GetName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27611 SWIGINTERN PyObject *_wrap_ExtendedDataType_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27612   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27613   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27614   void *argp1 = 0 ;
27615   int res1 = 0 ;
27616   PyObject * obj0 = 0 ;
27617   char *result = 0 ;
27618 
27619   if (!PyArg_ParseTuple(args,(char *)"O:ExtendedDataType_GetName",&obj0)) SWIG_fail;
27620   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27621   if (!SWIG_IsOK(res1)) {
27622     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetName" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27623   }
27624   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27625   {
27626     if ( bUseExceptions ) {
27627       ClearErrorState();
27628     }
27629     {
27630       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27631       result = (char *)GDALExtendedDataTypeHS_GetName(arg1);
27632       SWIG_PYTHON_THREAD_END_ALLOW;
27633     }
27634 #ifndef SED_HACKS
27635     if ( bUseExceptions ) {
27636       CPLErr eclass = CPLGetLastErrorType();
27637       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27638         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27639       }
27640     }
27641 #endif
27642   }
27643   resultobj = SWIG_FromCharPtr((const char *)result);
27644   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27645   return resultobj;
27646 fail:
27647   return NULL;
27648 }
27649 
27650 
_wrap_ExtendedDataType_GetClass(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27651 SWIGINTERN PyObject *_wrap_ExtendedDataType_GetClass(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27652   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27653   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27654   void *argp1 = 0 ;
27655   int res1 = 0 ;
27656   PyObject * obj0 = 0 ;
27657   GDALExtendedDataTypeClass result;
27658 
27659   if (!PyArg_ParseTuple(args,(char *)"O:ExtendedDataType_GetClass",&obj0)) SWIG_fail;
27660   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27661   if (!SWIG_IsOK(res1)) {
27662     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetClass" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27663   }
27664   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27665   {
27666     if ( bUseExceptions ) {
27667       ClearErrorState();
27668     }
27669     {
27670       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27671       result = (GDALExtendedDataTypeClass)GDALExtendedDataTypeHS_GetClass(arg1);
27672       SWIG_PYTHON_THREAD_END_ALLOW;
27673     }
27674 #ifndef SED_HACKS
27675     if ( bUseExceptions ) {
27676       CPLErr eclass = CPLGetLastErrorType();
27677       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27678         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27679       }
27680     }
27681 #endif
27682   }
27683   resultobj = SWIG_From_int(static_cast< int >(result));
27684   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27685   return resultobj;
27686 fail:
27687   return NULL;
27688 }
27689 
27690 
_wrap_ExtendedDataType_GetNumericDataType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27691 SWIGINTERN PyObject *_wrap_ExtendedDataType_GetNumericDataType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27692   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27693   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27694   void *argp1 = 0 ;
27695   int res1 = 0 ;
27696   PyObject * obj0 = 0 ;
27697   GDALDataType result;
27698 
27699   if (!PyArg_ParseTuple(args,(char *)"O:ExtendedDataType_GetNumericDataType",&obj0)) SWIG_fail;
27700   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27701   if (!SWIG_IsOK(res1)) {
27702     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetNumericDataType" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27703   }
27704   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27705   {
27706     if ( bUseExceptions ) {
27707       ClearErrorState();
27708     }
27709     {
27710       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27711       result = (GDALDataType)GDALExtendedDataTypeHS_GetNumericDataType(arg1);
27712       SWIG_PYTHON_THREAD_END_ALLOW;
27713     }
27714 #ifndef SED_HACKS
27715     if ( bUseExceptions ) {
27716       CPLErr eclass = CPLGetLastErrorType();
27717       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27718         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27719       }
27720     }
27721 #endif
27722   }
27723   resultobj = SWIG_From_int(static_cast< int >(result));
27724   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27725   return resultobj;
27726 fail:
27727   return NULL;
27728 }
27729 
27730 
_wrap_ExtendedDataType_GetSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27731 SWIGINTERN PyObject *_wrap_ExtendedDataType_GetSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27732   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27733   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27734   void *argp1 = 0 ;
27735   int res1 = 0 ;
27736   PyObject * obj0 = 0 ;
27737   size_t result;
27738 
27739   if (!PyArg_ParseTuple(args,(char *)"O:ExtendedDataType_GetSize",&obj0)) SWIG_fail;
27740   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27741   if (!SWIG_IsOK(res1)) {
27742     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetSize" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27743   }
27744   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27745   {
27746     if ( bUseExceptions ) {
27747       ClearErrorState();
27748     }
27749     {
27750       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27751       result = GDALExtendedDataTypeHS_GetSize(arg1);
27752       SWIG_PYTHON_THREAD_END_ALLOW;
27753     }
27754 #ifndef SED_HACKS
27755     if ( bUseExceptions ) {
27756       CPLErr eclass = CPLGetLastErrorType();
27757       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27758         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27759       }
27760     }
27761 #endif
27762   }
27763   resultobj = SWIG_From_size_t(static_cast< size_t >(result));
27764   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27765   return resultobj;
27766 fail:
27767   return NULL;
27768 }
27769 
27770 
_wrap_ExtendedDataType_GetMaxStringLength(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27771 SWIGINTERN PyObject *_wrap_ExtendedDataType_GetMaxStringLength(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27772   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27773   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27774   void *argp1 = 0 ;
27775   int res1 = 0 ;
27776   PyObject * obj0 = 0 ;
27777   size_t result;
27778 
27779   if (!PyArg_ParseTuple(args,(char *)"O:ExtendedDataType_GetMaxStringLength",&obj0)) SWIG_fail;
27780   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27781   if (!SWIG_IsOK(res1)) {
27782     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetMaxStringLength" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27783   }
27784   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27785   {
27786     if ( bUseExceptions ) {
27787       ClearErrorState();
27788     }
27789     {
27790       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27791       result = GDALExtendedDataTypeHS_GetMaxStringLength(arg1);
27792       SWIG_PYTHON_THREAD_END_ALLOW;
27793     }
27794 #ifndef SED_HACKS
27795     if ( bUseExceptions ) {
27796       CPLErr eclass = CPLGetLastErrorType();
27797       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27798         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27799       }
27800     }
27801 #endif
27802   }
27803   resultobj = SWIG_From_size_t(static_cast< size_t >(result));
27804   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27805   return resultobj;
27806 fail:
27807   return NULL;
27808 }
27809 
27810 
_wrap_ExtendedDataType_GetComponents(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27811 SWIGINTERN PyObject *_wrap_ExtendedDataType_GetComponents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27812   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27813   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27814   GDALEDTComponentHS ***arg2 = (GDALEDTComponentHS ***) 0 ;
27815   size_t *arg3 = (size_t *) 0 ;
27816   void *argp1 = 0 ;
27817   int res1 = 0 ;
27818   GDALEDTComponentHS **comps2 = 0 ;
27819   size_t nCount2 = 0 ;
27820   PyObject * obj0 = 0 ;
27821 
27822   {
27823     /* %typemap(in,numinputs=0) (GDALEDTComponentHS*** pcomps, size_t* pnCount) */
27824     arg2 = &comps2;
27825     arg3 = &nCount2;
27826   }
27827   if (!PyArg_ParseTuple(args,(char *)"O:ExtendedDataType_GetComponents",&obj0)) SWIG_fail;
27828   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27829   if (!SWIG_IsOK(res1)) {
27830     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_GetComponents" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27831   }
27832   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27833   {
27834     if ( bUseExceptions ) {
27835       ClearErrorState();
27836     }
27837     {
27838       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27839       GDALExtendedDataTypeHS_GetComponents(arg1,arg2,arg3);
27840       SWIG_PYTHON_THREAD_END_ALLOW;
27841     }
27842 #ifndef SED_HACKS
27843     if ( bUseExceptions ) {
27844       CPLErr eclass = CPLGetLastErrorType();
27845       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27846         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27847       }
27848     }
27849 #endif
27850   }
27851   resultobj = SWIG_Py_Void();
27852   {
27853     /* %typemap(argout) (GDALEDTComponentHS*** pcomps, size_t* pnCount) */
27854     PyObject *list = PyList_New( *arg3 );
27855     for( size_t i = 0; i < *arg3; i++ ) {
27856       PyList_SetItem(list, i,
27857         SWIG_NewPointerObj((void*)(*arg2)[i],SWIGTYPE_p_GDALEDTComponentHS,SWIG_POINTER_OWN) );
27858     }
27859     Py_DECREF(resultobj);
27860     resultobj = list;
27861   }
27862   {
27863     /* %typemap(freearg) (GDALEDTComponentHS*** pcomps, size_t* pnCount) */
27864     CPLFree(*arg2);
27865   }
27866   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27867   return resultobj;
27868 fail:
27869   {
27870     /* %typemap(freearg) (GDALEDTComponentHS*** pcomps, size_t* pnCount) */
27871     CPLFree(*arg2);
27872   }
27873   return NULL;
27874 }
27875 
27876 
_wrap_ExtendedDataType_CanConvertTo(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27877 SWIGINTERN PyObject *_wrap_ExtendedDataType_CanConvertTo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27878   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27879   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27880   GDALExtendedDataTypeHS *arg2 = (GDALExtendedDataTypeHS *) 0 ;
27881   void *argp1 = 0 ;
27882   int res1 = 0 ;
27883   void *argp2 = 0 ;
27884   int res2 = 0 ;
27885   PyObject * obj0 = 0 ;
27886   PyObject * obj1 = 0 ;
27887   bool result;
27888 
27889   if (!PyArg_ParseTuple(args,(char *)"OO:ExtendedDataType_CanConvertTo",&obj0,&obj1)) SWIG_fail;
27890   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27891   if (!SWIG_IsOK(res1)) {
27892     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_CanConvertTo" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27893   }
27894   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27895   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27896   if (!SWIG_IsOK(res2)) {
27897     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExtendedDataType_CanConvertTo" "', argument " "2"" of type '" "GDALExtendedDataTypeHS *""'");
27898   }
27899   arg2 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp2);
27900   {
27901     if (!arg2) {
27902       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27903     }
27904   }
27905   {
27906     if ( bUseExceptions ) {
27907       ClearErrorState();
27908     }
27909     {
27910       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27911       result = (bool)GDALExtendedDataTypeHS_CanConvertTo(arg1,arg2);
27912       SWIG_PYTHON_THREAD_END_ALLOW;
27913     }
27914 #ifndef SED_HACKS
27915     if ( bUseExceptions ) {
27916       CPLErr eclass = CPLGetLastErrorType();
27917       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27918         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27919       }
27920     }
27921 #endif
27922   }
27923   resultobj = SWIG_From_bool(static_cast< bool >(result));
27924   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27925   return resultobj;
27926 fail:
27927   return NULL;
27928 }
27929 
27930 
_wrap_ExtendedDataType_Equals(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27931 SWIGINTERN PyObject *_wrap_ExtendedDataType_Equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27932   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27933   GDALExtendedDataTypeHS *arg1 = (GDALExtendedDataTypeHS *) 0 ;
27934   GDALExtendedDataTypeHS *arg2 = (GDALExtendedDataTypeHS *) 0 ;
27935   void *argp1 = 0 ;
27936   int res1 = 0 ;
27937   void *argp2 = 0 ;
27938   int res2 = 0 ;
27939   PyObject * obj0 = 0 ;
27940   PyObject * obj1 = 0 ;
27941   bool result;
27942 
27943   if (!PyArg_ParseTuple(args,(char *)"OO:ExtendedDataType_Equals",&obj0,&obj1)) SWIG_fail;
27944   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27945   if (!SWIG_IsOK(res1)) {
27946     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ExtendedDataType_Equals" "', argument " "1"" of type '" "GDALExtendedDataTypeHS *""'");
27947   }
27948   arg1 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp1);
27949   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
27950   if (!SWIG_IsOK(res2)) {
27951     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ExtendedDataType_Equals" "', argument " "2"" of type '" "GDALExtendedDataTypeHS *""'");
27952   }
27953   arg2 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp2);
27954   {
27955     if (!arg2) {
27956       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27957     }
27958   }
27959   {
27960     if ( bUseExceptions ) {
27961       ClearErrorState();
27962     }
27963     {
27964       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
27965       result = (bool)GDALExtendedDataTypeHS_Equals(arg1,arg2);
27966       SWIG_PYTHON_THREAD_END_ALLOW;
27967     }
27968 #ifndef SED_HACKS
27969     if ( bUseExceptions ) {
27970       CPLErr eclass = CPLGetLastErrorType();
27971       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
27972         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
27973       }
27974     }
27975 #endif
27976   }
27977   resultobj = SWIG_From_bool(static_cast< bool >(result));
27978   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
27979   return resultobj;
27980 fail:
27981   return NULL;
27982 }
27983 
27984 
ExtendedDataType_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27985 SWIGINTERN PyObject *ExtendedDataType_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27986   PyObject *obj;
27987   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
27988   SWIG_TypeNewClientData(SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_NewClientData(obj));
27989   return SWIG_Py_Void();
27990 }
27991 
_wrap_delete_EDTComponent(PyObject * SWIGUNUSEDPARM (self),PyObject * args)27992 SWIGINTERN PyObject *_wrap_delete_EDTComponent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
27993   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
27994   GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
27995   void *argp1 = 0 ;
27996   int res1 = 0 ;
27997   PyObject * obj0 = 0 ;
27998 
27999   if (!PyArg_ParseTuple(args,(char *)"O:delete_EDTComponent",&obj0)) SWIG_fail;
28000   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALEDTComponentHS, SWIG_POINTER_DISOWN |  0 );
28001   if (!SWIG_IsOK(res1)) {
28002     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_EDTComponent" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
28003   }
28004   arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
28005   {
28006     if ( bUseExceptions ) {
28007       ClearErrorState();
28008     }
28009     {
28010       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28011       delete_GDALEDTComponentHS(arg1);
28012       SWIG_PYTHON_THREAD_END_ALLOW;
28013     }
28014 #ifndef SED_HACKS
28015     if ( bUseExceptions ) {
28016       CPLErr eclass = CPLGetLastErrorType();
28017       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28018         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28019       }
28020     }
28021 #endif
28022   }
28023   resultobj = SWIG_Py_Void();
28024   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28025   return resultobj;
28026 fail:
28027   return NULL;
28028 }
28029 
28030 
_wrap_EDTComponent_Create(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28031 SWIGINTERN PyObject *_wrap_EDTComponent_Create(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28032   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28033   char *arg1 = (char *) 0 ;
28034   size_t arg2 ;
28035   GDALExtendedDataTypeHS *arg3 = (GDALExtendedDataTypeHS *) 0 ;
28036   int res1 ;
28037   char *buf1 = 0 ;
28038   int alloc1 = 0 ;
28039   size_t val2 ;
28040   int ecode2 = 0 ;
28041   void *argp3 = 0 ;
28042   int res3 = 0 ;
28043   PyObject * obj0 = 0 ;
28044   PyObject * obj1 = 0 ;
28045   PyObject * obj2 = 0 ;
28046   GDALEDTComponentHS *result = 0 ;
28047 
28048   if (!PyArg_ParseTuple(args,(char *)"OOO:EDTComponent_Create",&obj0,&obj1,&obj2)) SWIG_fail;
28049   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
28050   if (!SWIG_IsOK(res1)) {
28051     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent_Create" "', argument " "1"" of type '" "char const *""'");
28052   }
28053   arg1 = reinterpret_cast< char * >(buf1);
28054   ecode2 = SWIG_AsVal_size_t(obj1, &val2);
28055   if (!SWIG_IsOK(ecode2)) {
28056     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EDTComponent_Create" "', argument " "2"" of type '" "size_t""'");
28057   }
28058   arg2 = static_cast< size_t >(val2);
28059   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALExtendedDataTypeHS, 0 |  0 );
28060   if (!SWIG_IsOK(res3)) {
28061     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EDTComponent_Create" "', argument " "3"" of type '" "GDALExtendedDataTypeHS *""'");
28062   }
28063   arg3 = reinterpret_cast< GDALExtendedDataTypeHS * >(argp3);
28064   {
28065     if (!arg1) {
28066       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28067     }
28068   }
28069   {
28070     if (!arg3) {
28071       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28072     }
28073   }
28074   {
28075     if ( bUseExceptions ) {
28076       ClearErrorState();
28077     }
28078     {
28079       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28080       result = (GDALEDTComponentHS *)GDALEDTComponentHS_Create((char const *)arg1,arg2,arg3);
28081       SWIG_PYTHON_THREAD_END_ALLOW;
28082     }
28083 #ifndef SED_HACKS
28084     if ( bUseExceptions ) {
28085       CPLErr eclass = CPLGetLastErrorType();
28086       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28087         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28088       }
28089     }
28090 #endif
28091   }
28092   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALEDTComponentHS, SWIG_POINTER_OWN |  0 );
28093   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
28094   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28095   return resultobj;
28096 fail:
28097   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
28098   return NULL;
28099 }
28100 
28101 
_wrap_EDTComponent_GetName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28102 SWIGINTERN PyObject *_wrap_EDTComponent_GetName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28103   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28104   GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
28105   void *argp1 = 0 ;
28106   int res1 = 0 ;
28107   PyObject * obj0 = 0 ;
28108   char *result = 0 ;
28109 
28110   if (!PyArg_ParseTuple(args,(char *)"O:EDTComponent_GetName",&obj0)) SWIG_fail;
28111   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALEDTComponentHS, 0 |  0 );
28112   if (!SWIG_IsOK(res1)) {
28113     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent_GetName" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
28114   }
28115   arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
28116   {
28117     if ( bUseExceptions ) {
28118       ClearErrorState();
28119     }
28120     {
28121       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28122       result = (char *)GDALEDTComponentHS_GetName(arg1);
28123       SWIG_PYTHON_THREAD_END_ALLOW;
28124     }
28125 #ifndef SED_HACKS
28126     if ( bUseExceptions ) {
28127       CPLErr eclass = CPLGetLastErrorType();
28128       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28129         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28130       }
28131     }
28132 #endif
28133   }
28134   resultobj = SWIG_FromCharPtr((const char *)result);
28135   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28136   return resultobj;
28137 fail:
28138   return NULL;
28139 }
28140 
28141 
_wrap_EDTComponent_GetOffset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28142 SWIGINTERN PyObject *_wrap_EDTComponent_GetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28143   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28144   GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
28145   void *argp1 = 0 ;
28146   int res1 = 0 ;
28147   PyObject * obj0 = 0 ;
28148   size_t result;
28149 
28150   if (!PyArg_ParseTuple(args,(char *)"O:EDTComponent_GetOffset",&obj0)) SWIG_fail;
28151   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALEDTComponentHS, 0 |  0 );
28152   if (!SWIG_IsOK(res1)) {
28153     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent_GetOffset" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
28154   }
28155   arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
28156   {
28157     if ( bUseExceptions ) {
28158       ClearErrorState();
28159     }
28160     {
28161       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28162       result = GDALEDTComponentHS_GetOffset(arg1);
28163       SWIG_PYTHON_THREAD_END_ALLOW;
28164     }
28165 #ifndef SED_HACKS
28166     if ( bUseExceptions ) {
28167       CPLErr eclass = CPLGetLastErrorType();
28168       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28169         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28170       }
28171     }
28172 #endif
28173   }
28174   resultobj = SWIG_From_size_t(static_cast< size_t >(result));
28175   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28176   return resultobj;
28177 fail:
28178   return NULL;
28179 }
28180 
28181 
_wrap_EDTComponent_GetType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28182 SWIGINTERN PyObject *_wrap_EDTComponent_GetType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28183   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28184   GDALEDTComponentHS *arg1 = (GDALEDTComponentHS *) 0 ;
28185   void *argp1 = 0 ;
28186   int res1 = 0 ;
28187   PyObject * obj0 = 0 ;
28188   GDALExtendedDataTypeHS *result = 0 ;
28189 
28190   if (!PyArg_ParseTuple(args,(char *)"O:EDTComponent_GetType",&obj0)) SWIG_fail;
28191   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALEDTComponentHS, 0 |  0 );
28192   if (!SWIG_IsOK(res1)) {
28193     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EDTComponent_GetType" "', argument " "1"" of type '" "GDALEDTComponentHS *""'");
28194   }
28195   arg1 = reinterpret_cast< GDALEDTComponentHS * >(argp1);
28196   {
28197     if ( bUseExceptions ) {
28198       ClearErrorState();
28199     }
28200     {
28201       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28202       result = (GDALExtendedDataTypeHS *)GDALEDTComponentHS_GetType(arg1);
28203       SWIG_PYTHON_THREAD_END_ALLOW;
28204     }
28205 #ifndef SED_HACKS
28206     if ( bUseExceptions ) {
28207       CPLErr eclass = CPLGetLastErrorType();
28208       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28209         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28210       }
28211     }
28212 #endif
28213   }
28214   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALExtendedDataTypeHS, SWIG_POINTER_OWN |  0 );
28215   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28216   return resultobj;
28217 fail:
28218   return NULL;
28219 }
28220 
28221 
EDTComponent_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28222 SWIGINTERN PyObject *EDTComponent_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28223   PyObject *obj;
28224   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
28225   SWIG_TypeNewClientData(SWIGTYPE_p_GDALEDTComponentHS, SWIG_NewClientData(obj));
28226   return SWIG_Py_Void();
28227 }
28228 
_wrap_Band_XSize_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28229 SWIGINTERN PyObject *_wrap_Band_XSize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28230   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28231   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28232   void *argp1 = 0 ;
28233   int res1 = 0 ;
28234   PyObject * obj0 = 0 ;
28235   int result;
28236 
28237   if (!PyArg_ParseTuple(args,(char *)"O:Band_XSize_get",&obj0)) SWIG_fail;
28238   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28239   if (!SWIG_IsOK(res1)) {
28240     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_XSize_get" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28241   }
28242   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28243   {
28244     if ( bUseExceptions ) {
28245       ClearErrorState();
28246     }
28247     {
28248       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28249       result = (int)GDALRasterBandShadow_XSize_get(arg1);
28250       SWIG_PYTHON_THREAD_END_ALLOW;
28251     }
28252 #ifndef SED_HACKS
28253     if ( bUseExceptions ) {
28254       CPLErr eclass = CPLGetLastErrorType();
28255       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28256         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28257       }
28258     }
28259 #endif
28260   }
28261   resultobj = SWIG_From_int(static_cast< int >(result));
28262   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28263   return resultobj;
28264 fail:
28265   return NULL;
28266 }
28267 
28268 
_wrap_Band_YSize_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28269 SWIGINTERN PyObject *_wrap_Band_YSize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28270   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28271   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28272   void *argp1 = 0 ;
28273   int res1 = 0 ;
28274   PyObject * obj0 = 0 ;
28275   int result;
28276 
28277   if (!PyArg_ParseTuple(args,(char *)"O:Band_YSize_get",&obj0)) SWIG_fail;
28278   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28279   if (!SWIG_IsOK(res1)) {
28280     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_YSize_get" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28281   }
28282   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28283   {
28284     if ( bUseExceptions ) {
28285       ClearErrorState();
28286     }
28287     {
28288       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28289       result = (int)GDALRasterBandShadow_YSize_get(arg1);
28290       SWIG_PYTHON_THREAD_END_ALLOW;
28291     }
28292 #ifndef SED_HACKS
28293     if ( bUseExceptions ) {
28294       CPLErr eclass = CPLGetLastErrorType();
28295       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28296         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28297       }
28298     }
28299 #endif
28300   }
28301   resultobj = SWIG_From_int(static_cast< int >(result));
28302   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28303   return resultobj;
28304 fail:
28305   return NULL;
28306 }
28307 
28308 
_wrap_Band_DataType_get(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28309 SWIGINTERN PyObject *_wrap_Band_DataType_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28310   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28311   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28312   void *argp1 = 0 ;
28313   int res1 = 0 ;
28314   PyObject * obj0 = 0 ;
28315   GDALDataType result;
28316 
28317   if (!PyArg_ParseTuple(args,(char *)"O:Band_DataType_get",&obj0)) SWIG_fail;
28318   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28319   if (!SWIG_IsOK(res1)) {
28320     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_DataType_get" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28321   }
28322   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28323   {
28324     if ( bUseExceptions ) {
28325       ClearErrorState();
28326     }
28327     {
28328       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28329       result = (GDALDataType)GDALRasterBandShadow_DataType_get(arg1);
28330       SWIG_PYTHON_THREAD_END_ALLOW;
28331     }
28332 #ifndef SED_HACKS
28333     if ( bUseExceptions ) {
28334       CPLErr eclass = CPLGetLastErrorType();
28335       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28336         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28337       }
28338     }
28339 #endif
28340   }
28341   resultobj = SWIG_From_int(static_cast< int >(result));
28342   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28343   return resultobj;
28344 fail:
28345   return NULL;
28346 }
28347 
28348 
_wrap_Band_GetDataset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28349 SWIGINTERN PyObject *_wrap_Band_GetDataset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28350   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28351   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28352   void *argp1 = 0 ;
28353   int res1 = 0 ;
28354   PyObject * obj0 = 0 ;
28355   GDALDatasetShadow *result = 0 ;
28356 
28357   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetDataset",&obj0)) SWIG_fail;
28358   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28359   if (!SWIG_IsOK(res1)) {
28360     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetDataset" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28361   }
28362   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28363   {
28364     if ( bUseExceptions ) {
28365       ClearErrorState();
28366     }
28367     {
28368       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28369       result = (GDALDatasetShadow *)GDALRasterBandShadow_GetDataset(arg1);
28370       SWIG_PYTHON_THREAD_END_ALLOW;
28371     }
28372 #ifndef SED_HACKS
28373     if ( bUseExceptions ) {
28374       CPLErr eclass = CPLGetLastErrorType();
28375       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28376         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28377       }
28378     }
28379 #endif
28380   }
28381   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
28382   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28383   return resultobj;
28384 fail:
28385   return NULL;
28386 }
28387 
28388 
_wrap_Band_GetBand(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28389 SWIGINTERN PyObject *_wrap_Band_GetBand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28390   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28391   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28392   void *argp1 = 0 ;
28393   int res1 = 0 ;
28394   PyObject * obj0 = 0 ;
28395   int result;
28396 
28397   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetBand",&obj0)) SWIG_fail;
28398   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28399   if (!SWIG_IsOK(res1)) {
28400     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetBand" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28401   }
28402   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28403   {
28404     if ( bUseExceptions ) {
28405       ClearErrorState();
28406     }
28407     {
28408       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28409       result = (int)GDALRasterBandShadow_GetBand(arg1);
28410       SWIG_PYTHON_THREAD_END_ALLOW;
28411     }
28412 #ifndef SED_HACKS
28413     if ( bUseExceptions ) {
28414       CPLErr eclass = CPLGetLastErrorType();
28415       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28416         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28417       }
28418     }
28419 #endif
28420   }
28421   resultobj = SWIG_From_int(static_cast< int >(result));
28422   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28423   return resultobj;
28424 fail:
28425   return NULL;
28426 }
28427 
28428 
_wrap_Band_GetBlockSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28429 SWIGINTERN PyObject *_wrap_Band_GetBlockSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28430   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28431   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28432   int *arg2 = (int *) 0 ;
28433   int *arg3 = (int *) 0 ;
28434   void *argp1 = 0 ;
28435   int res1 = 0 ;
28436   int temp2 ;
28437   int res2 = SWIG_TMPOBJ ;
28438   int temp3 ;
28439   int res3 = SWIG_TMPOBJ ;
28440   PyObject * obj0 = 0 ;
28441 
28442   arg2 = &temp2;
28443   arg3 = &temp3;
28444   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetBlockSize",&obj0)) SWIG_fail;
28445   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28446   if (!SWIG_IsOK(res1)) {
28447     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetBlockSize" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28448   }
28449   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28450   {
28451     if ( bUseExceptions ) {
28452       ClearErrorState();
28453     }
28454     {
28455       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28456       GDALRasterBandShadow_GetBlockSize(arg1,arg2,arg3);
28457       SWIG_PYTHON_THREAD_END_ALLOW;
28458     }
28459 #ifndef SED_HACKS
28460     if ( bUseExceptions ) {
28461       CPLErr eclass = CPLGetLastErrorType();
28462       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28463         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28464       }
28465     }
28466 #endif
28467   }
28468   resultobj = SWIG_Py_Void();
28469   if (ReturnSame(SWIG_IsTmpObj(res2))) {
28470     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg2)));
28471   } else {
28472     int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
28473     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_int, new_flags));
28474   }
28475   if (ReturnSame(SWIG_IsTmpObj(res3))) {
28476     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_int((*arg3)));
28477   } else {
28478     int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
28479     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_int, new_flags));
28480   }
28481   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28482   return resultobj;
28483 fail:
28484   return NULL;
28485 }
28486 
28487 
_wrap_Band_GetActualBlockSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28488 SWIGINTERN PyObject *_wrap_Band_GetActualBlockSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28489   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28490   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28491   int arg2 ;
28492   int arg3 ;
28493   int *arg4 = (int *) 0 ;
28494   int *arg5 = (int *) 0 ;
28495   int *arg6 = (int *) 0 ;
28496   void *argp1 = 0 ;
28497   int res1 = 0 ;
28498   int val2 ;
28499   int ecode2 = 0 ;
28500   int val3 ;
28501   int ecode3 = 0 ;
28502   int nxvalid4 = 0 ;
28503   int nyvalid4 = 0 ;
28504   int isvalid4 = 0 ;
28505   PyObject * obj0 = 0 ;
28506   PyObject * obj1 = 0 ;
28507   PyObject * obj2 = 0 ;
28508 
28509   {
28510     /* %typemap(in) (int *pnxvalid, int *pnyvalid, int* pisvalid) */
28511     arg4 = &nxvalid4;
28512     arg5 = &nyvalid4;
28513     arg6 = &isvalid4;
28514   }
28515   if (!PyArg_ParseTuple(args,(char *)"OOO:Band_GetActualBlockSize",&obj0,&obj1,&obj2)) SWIG_fail;
28516   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28517   if (!SWIG_IsOK(res1)) {
28518     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetActualBlockSize" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28519   }
28520   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28521   ecode2 = SWIG_AsVal_int(obj1, &val2);
28522   if (!SWIG_IsOK(ecode2)) {
28523     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetActualBlockSize" "', argument " "2"" of type '" "int""'");
28524   }
28525   arg2 = static_cast< int >(val2);
28526   ecode3 = SWIG_AsVal_int(obj2, &val3);
28527   if (!SWIG_IsOK(ecode3)) {
28528     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_GetActualBlockSize" "', argument " "3"" of type '" "int""'");
28529   }
28530   arg3 = static_cast< int >(val3);
28531   {
28532     if ( bUseExceptions ) {
28533       ClearErrorState();
28534     }
28535     {
28536       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28537       GDALRasterBandShadow_GetActualBlockSize(arg1,arg2,arg3,arg4,arg5,arg6);
28538       SWIG_PYTHON_THREAD_END_ALLOW;
28539     }
28540 #ifndef SED_HACKS
28541     if ( bUseExceptions ) {
28542       CPLErr eclass = CPLGetLastErrorType();
28543       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28544         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28545       }
28546     }
28547 #endif
28548   }
28549   resultobj = SWIG_Py_Void();
28550   {
28551     /* %typemap(argout) (int *pnxvalid, int *pnyvalid, int* pisvalid)  */
28552     PyObject *r;
28553     if ( !*arg6 ) {
28554       Py_INCREF(Py_None);
28555       r = Py_None;
28556     }
28557     else {
28558       r = PyTuple_New( 2 );
28559       PyTuple_SetItem( r, 0, PyLong_FromLong(*arg4) );
28560       PyTuple_SetItem( r, 1, PyLong_FromLong(*arg5) );
28561     }
28562     resultobj = t_output_helper(resultobj,r);
28563   }
28564   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28565   return resultobj;
28566 fail:
28567   return NULL;
28568 }
28569 
28570 
_wrap_Band_GetColorInterpretation(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28571 SWIGINTERN PyObject *_wrap_Band_GetColorInterpretation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28572   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28573   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28574   void *argp1 = 0 ;
28575   int res1 = 0 ;
28576   PyObject * obj0 = 0 ;
28577   GDALColorInterp result;
28578 
28579   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetColorInterpretation",&obj0)) SWIG_fail;
28580   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28581   if (!SWIG_IsOK(res1)) {
28582     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28583   }
28584   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28585   {
28586     if ( bUseExceptions ) {
28587       ClearErrorState();
28588     }
28589     {
28590       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28591       result = (GDALColorInterp)GDALRasterBandShadow_GetColorInterpretation(arg1);
28592       SWIG_PYTHON_THREAD_END_ALLOW;
28593     }
28594 #ifndef SED_HACKS
28595     if ( bUseExceptions ) {
28596       CPLErr eclass = CPLGetLastErrorType();
28597       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28598         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28599       }
28600     }
28601 #endif
28602   }
28603   resultobj = SWIG_From_int(static_cast< int >(result));
28604   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28605   return resultobj;
28606 fail:
28607   return NULL;
28608 }
28609 
28610 
_wrap_Band_GetRasterColorInterpretation(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28611 SWIGINTERN PyObject *_wrap_Band_GetRasterColorInterpretation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28612   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28613   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28614   void *argp1 = 0 ;
28615   int res1 = 0 ;
28616   PyObject * obj0 = 0 ;
28617   GDALColorInterp result;
28618 
28619   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetRasterColorInterpretation",&obj0)) SWIG_fail;
28620   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28621   if (!SWIG_IsOK(res1)) {
28622     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetRasterColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28623   }
28624   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28625   {
28626     if ( bUseExceptions ) {
28627       ClearErrorState();
28628     }
28629     {
28630       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28631       result = (GDALColorInterp)GDALRasterBandShadow_GetRasterColorInterpretation(arg1);
28632       SWIG_PYTHON_THREAD_END_ALLOW;
28633     }
28634 #ifndef SED_HACKS
28635     if ( bUseExceptions ) {
28636       CPLErr eclass = CPLGetLastErrorType();
28637       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28638         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28639       }
28640     }
28641 #endif
28642   }
28643   resultobj = SWIG_From_int(static_cast< int >(result));
28644   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28645   return resultobj;
28646 fail:
28647   return NULL;
28648 }
28649 
28650 
_wrap_Band_SetColorInterpretation(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28651 SWIGINTERN PyObject *_wrap_Band_SetColorInterpretation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28652   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28653   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28654   GDALColorInterp arg2 ;
28655   void *argp1 = 0 ;
28656   int res1 = 0 ;
28657   int val2 ;
28658   int ecode2 = 0 ;
28659   PyObject * obj0 = 0 ;
28660   PyObject * obj1 = 0 ;
28661   CPLErr result;
28662 
28663   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetColorInterpretation",&obj0,&obj1)) SWIG_fail;
28664   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28665   if (!SWIG_IsOK(res1)) {
28666     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28667   }
28668   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28669   ecode2 = SWIG_AsVal_int(obj1, &val2);
28670   if (!SWIG_IsOK(ecode2)) {
28671     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetColorInterpretation" "', argument " "2"" of type '" "GDALColorInterp""'");
28672   }
28673   arg2 = static_cast< GDALColorInterp >(val2);
28674   {
28675     if ( bUseExceptions ) {
28676       ClearErrorState();
28677     }
28678     {
28679       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28680       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetColorInterpretation(arg1,arg2));
28681       SWIG_PYTHON_THREAD_END_ALLOW;
28682     }
28683 #ifndef SED_HACKS
28684     if ( bUseExceptions ) {
28685       CPLErr eclass = CPLGetLastErrorType();
28686       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28687         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28688       }
28689     }
28690 #endif
28691   }
28692   resultobj = SWIG_From_int(static_cast< int >(result));
28693   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28694   return resultobj;
28695 fail:
28696   return NULL;
28697 }
28698 
28699 
_wrap_Band_SetRasterColorInterpretation(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28700 SWIGINTERN PyObject *_wrap_Band_SetRasterColorInterpretation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28701   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28702   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28703   GDALColorInterp arg2 ;
28704   void *argp1 = 0 ;
28705   int res1 = 0 ;
28706   int val2 ;
28707   int ecode2 = 0 ;
28708   PyObject * obj0 = 0 ;
28709   PyObject * obj1 = 0 ;
28710   CPLErr result;
28711 
28712   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetRasterColorInterpretation",&obj0,&obj1)) SWIG_fail;
28713   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28714   if (!SWIG_IsOK(res1)) {
28715     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetRasterColorInterpretation" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28716   }
28717   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28718   ecode2 = SWIG_AsVal_int(obj1, &val2);
28719   if (!SWIG_IsOK(ecode2)) {
28720     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetRasterColorInterpretation" "', argument " "2"" of type '" "GDALColorInterp""'");
28721   }
28722   arg2 = static_cast< GDALColorInterp >(val2);
28723   {
28724     if ( bUseExceptions ) {
28725       ClearErrorState();
28726     }
28727     {
28728       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28729       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetRasterColorInterpretation(arg1,arg2));
28730       SWIG_PYTHON_THREAD_END_ALLOW;
28731     }
28732 #ifndef SED_HACKS
28733     if ( bUseExceptions ) {
28734       CPLErr eclass = CPLGetLastErrorType();
28735       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28736         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28737       }
28738     }
28739 #endif
28740   }
28741   resultobj = SWIG_From_int(static_cast< int >(result));
28742   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28743   return resultobj;
28744 fail:
28745   return NULL;
28746 }
28747 
28748 
_wrap_Band_GetNoDataValue(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28749 SWIGINTERN PyObject *_wrap_Band_GetNoDataValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28750   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28751   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28752   double *arg2 = (double *) 0 ;
28753   int *arg3 = (int *) 0 ;
28754   void *argp1 = 0 ;
28755   int res1 = 0 ;
28756   double tmpval2 ;
28757   int tmphasval2 ;
28758   PyObject * obj0 = 0 ;
28759 
28760   {
28761     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
28762     arg2 = &tmpval2;
28763     arg3 = &tmphasval2;
28764   }
28765   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetNoDataValue",&obj0)) SWIG_fail;
28766   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28767   if (!SWIG_IsOK(res1)) {
28768     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetNoDataValue" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28769   }
28770   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28771   {
28772     if ( bUseExceptions ) {
28773       ClearErrorState();
28774     }
28775     {
28776       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28777       GDALRasterBandShadow_GetNoDataValue(arg1,arg2,arg3);
28778       SWIG_PYTHON_THREAD_END_ALLOW;
28779     }
28780 #ifndef SED_HACKS
28781     if ( bUseExceptions ) {
28782       CPLErr eclass = CPLGetLastErrorType();
28783       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28784         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28785       }
28786     }
28787 #endif
28788   }
28789   resultobj = SWIG_Py_Void();
28790   {
28791     /* %typemap(python,argout) (double *val, int*hasval) */
28792     PyObject *r;
28793     if ( !*arg3 ) {
28794       Py_INCREF(Py_None);
28795       r = Py_None;
28796       resultobj = t_output_helper(resultobj,r);
28797     }
28798     else {
28799       r = PyFloat_FromDouble( *arg2 );
28800       resultobj = t_output_helper(resultobj,r);
28801     }
28802   }
28803   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28804   return resultobj;
28805 fail:
28806   return NULL;
28807 }
28808 
28809 
_wrap_Band_SetNoDataValue(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28810 SWIGINTERN PyObject *_wrap_Band_SetNoDataValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28811   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28812   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28813   double arg2 ;
28814   void *argp1 = 0 ;
28815   int res1 = 0 ;
28816   double val2 ;
28817   int ecode2 = 0 ;
28818   PyObject * obj0 = 0 ;
28819   PyObject * obj1 = 0 ;
28820   CPLErr result;
28821 
28822   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetNoDataValue",&obj0,&obj1)) SWIG_fail;
28823   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28824   if (!SWIG_IsOK(res1)) {
28825     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetNoDataValue" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28826   }
28827   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28828   ecode2 = SWIG_AsVal_double(obj1, &val2);
28829   if (!SWIG_IsOK(ecode2)) {
28830     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetNoDataValue" "', argument " "2"" of type '" "double""'");
28831   }
28832   arg2 = static_cast< double >(val2);
28833   {
28834     if ( bUseExceptions ) {
28835       ClearErrorState();
28836     }
28837     {
28838       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28839       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetNoDataValue(arg1,arg2));
28840       SWIG_PYTHON_THREAD_END_ALLOW;
28841     }
28842 #ifndef SED_HACKS
28843     if ( bUseExceptions ) {
28844       CPLErr eclass = CPLGetLastErrorType();
28845       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28846         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28847       }
28848     }
28849 #endif
28850   }
28851   resultobj = SWIG_From_int(static_cast< int >(result));
28852   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28853   return resultobj;
28854 fail:
28855   return NULL;
28856 }
28857 
28858 
_wrap_Band_DeleteNoDataValue(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28859 SWIGINTERN PyObject *_wrap_Band_DeleteNoDataValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28860   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28861   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28862   void *argp1 = 0 ;
28863   int res1 = 0 ;
28864   PyObject * obj0 = 0 ;
28865   CPLErr result;
28866 
28867   if (!PyArg_ParseTuple(args,(char *)"O:Band_DeleteNoDataValue",&obj0)) SWIG_fail;
28868   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28869   if (!SWIG_IsOK(res1)) {
28870     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_DeleteNoDataValue" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28871   }
28872   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28873   {
28874     if ( bUseExceptions ) {
28875       ClearErrorState();
28876     }
28877     {
28878       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28879       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_DeleteNoDataValue(arg1));
28880       SWIG_PYTHON_THREAD_END_ALLOW;
28881     }
28882 #ifndef SED_HACKS
28883     if ( bUseExceptions ) {
28884       CPLErr eclass = CPLGetLastErrorType();
28885       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28886         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28887       }
28888     }
28889 #endif
28890   }
28891   resultobj = SWIG_From_int(static_cast< int >(result));
28892   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28893   return resultobj;
28894 fail:
28895   return NULL;
28896 }
28897 
28898 
_wrap_Band_GetUnitType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28899 SWIGINTERN PyObject *_wrap_Band_GetUnitType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28900   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28901   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28902   void *argp1 = 0 ;
28903   int res1 = 0 ;
28904   PyObject * obj0 = 0 ;
28905   char *result = 0 ;
28906 
28907   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetUnitType",&obj0)) SWIG_fail;
28908   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28909   if (!SWIG_IsOK(res1)) {
28910     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetUnitType" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28911   }
28912   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28913   {
28914     if ( bUseExceptions ) {
28915       ClearErrorState();
28916     }
28917     {
28918       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28919       result = (char *)GDALRasterBandShadow_GetUnitType(arg1);
28920       SWIG_PYTHON_THREAD_END_ALLOW;
28921     }
28922 #ifndef SED_HACKS
28923     if ( bUseExceptions ) {
28924       CPLErr eclass = CPLGetLastErrorType();
28925       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28926         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28927       }
28928     }
28929 #endif
28930   }
28931   resultobj = SWIG_FromCharPtr((const char *)result);
28932   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28933   return resultobj;
28934 fail:
28935   return NULL;
28936 }
28937 
28938 
_wrap_Band_SetUnitType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28939 SWIGINTERN PyObject *_wrap_Band_SetUnitType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28940   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28941   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28942   char *arg2 = (char *) 0 ;
28943   void *argp1 = 0 ;
28944   int res1 = 0 ;
28945   int res2 ;
28946   char *buf2 = 0 ;
28947   int alloc2 = 0 ;
28948   PyObject * obj0 = 0 ;
28949   PyObject * obj1 = 0 ;
28950   CPLErr result;
28951 
28952   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetUnitType",&obj0,&obj1)) SWIG_fail;
28953   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
28954   if (!SWIG_IsOK(res1)) {
28955     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetUnitType" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
28956   }
28957   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
28958   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
28959   if (!SWIG_IsOK(res2)) {
28960     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetUnitType" "', argument " "2"" of type '" "char const *""'");
28961   }
28962   arg2 = reinterpret_cast< char * >(buf2);
28963   {
28964     if ( bUseExceptions ) {
28965       ClearErrorState();
28966     }
28967     {
28968       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28969       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetUnitType(arg1,(char const *)arg2));
28970       SWIG_PYTHON_THREAD_END_ALLOW;
28971     }
28972 #ifndef SED_HACKS
28973     if ( bUseExceptions ) {
28974       CPLErr eclass = CPLGetLastErrorType();
28975       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
28976         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
28977       }
28978     }
28979 #endif
28980   }
28981   resultobj = SWIG_From_int(static_cast< int >(result));
28982   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
28983   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
28984   return resultobj;
28985 fail:
28986   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
28987   return NULL;
28988 }
28989 
28990 
_wrap_Band_GetRasterCategoryNames(PyObject * SWIGUNUSEDPARM (self),PyObject * args)28991 SWIGINTERN PyObject *_wrap_Band_GetRasterCategoryNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
28992   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
28993   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
28994   void *argp1 = 0 ;
28995   int res1 = 0 ;
28996   PyObject * obj0 = 0 ;
28997   char **result = 0 ;
28998 
28999   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetRasterCategoryNames",&obj0)) SWIG_fail;
29000   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29001   if (!SWIG_IsOK(res1)) {
29002     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetRasterCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29003   }
29004   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29005   {
29006     if ( bUseExceptions ) {
29007       ClearErrorState();
29008     }
29009     {
29010       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29011       result = (char **)GDALRasterBandShadow_GetRasterCategoryNames(arg1);
29012       SWIG_PYTHON_THREAD_END_ALLOW;
29013     }
29014 #ifndef SED_HACKS
29015     if ( bUseExceptions ) {
29016       CPLErr eclass = CPLGetLastErrorType();
29017       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29018         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29019       }
29020     }
29021 #endif
29022   }
29023   {
29024     /* %typemap(out) char **options -> ( string ) */
29025     char **stringarray = result;
29026     if ( stringarray == NULL ) {
29027       resultobj = Py_None;
29028       Py_INCREF( resultobj );
29029     }
29030     else {
29031       int len = CSLCount( stringarray );
29032       resultobj = PyList_New( len );
29033       for ( int i = 0; i < len; ++i ) {
29034         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
29035         PyList_SetItem(resultobj, i, o );
29036       }
29037     }
29038   }
29039   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29040   return resultobj;
29041 fail:
29042   return NULL;
29043 }
29044 
29045 
_wrap_Band_SetRasterCategoryNames(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29046 SWIGINTERN PyObject *_wrap_Band_SetRasterCategoryNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29047   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29048   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29049   char **arg2 = (char **) 0 ;
29050   void *argp1 = 0 ;
29051   int res1 = 0 ;
29052   PyObject * obj0 = 0 ;
29053   PyObject * obj1 = 0 ;
29054   CPLErr result;
29055 
29056   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetRasterCategoryNames",&obj0,&obj1)) SWIG_fail;
29057   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29058   if (!SWIG_IsOK(res1)) {
29059     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetRasterCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29060   }
29061   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29062   {
29063     /* %typemap(in) char **options */
29064     int bErr = FALSE;
29065     arg2 = CSLFromPySequence(obj1, &bErr);
29066     if( bErr )
29067     {
29068       SWIG_fail;
29069     }
29070   }
29071   {
29072     if ( bUseExceptions ) {
29073       ClearErrorState();
29074     }
29075     {
29076       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29077       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetRasterCategoryNames(arg1,arg2));
29078       SWIG_PYTHON_THREAD_END_ALLOW;
29079     }
29080 #ifndef SED_HACKS
29081     if ( bUseExceptions ) {
29082       CPLErr eclass = CPLGetLastErrorType();
29083       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29084         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29085       }
29086     }
29087 #endif
29088   }
29089   resultobj = SWIG_From_int(static_cast< int >(result));
29090   {
29091     /* %typemap(freearg) char **options */
29092     CSLDestroy( arg2 );
29093   }
29094   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29095   return resultobj;
29096 fail:
29097   {
29098     /* %typemap(freearg) char **options */
29099     CSLDestroy( arg2 );
29100   }
29101   return NULL;
29102 }
29103 
29104 
_wrap_Band_GetMinimum(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29105 SWIGINTERN PyObject *_wrap_Band_GetMinimum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29106   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29107   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29108   double *arg2 = (double *) 0 ;
29109   int *arg3 = (int *) 0 ;
29110   void *argp1 = 0 ;
29111   int res1 = 0 ;
29112   double tmpval2 ;
29113   int tmphasval2 ;
29114   PyObject * obj0 = 0 ;
29115 
29116   {
29117     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
29118     arg2 = &tmpval2;
29119     arg3 = &tmphasval2;
29120   }
29121   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetMinimum",&obj0)) SWIG_fail;
29122   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29123   if (!SWIG_IsOK(res1)) {
29124     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetMinimum" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29125   }
29126   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29127   {
29128     if ( bUseExceptions ) {
29129       ClearErrorState();
29130     }
29131     {
29132       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29133       GDALRasterBandShadow_GetMinimum(arg1,arg2,arg3);
29134       SWIG_PYTHON_THREAD_END_ALLOW;
29135     }
29136 #ifndef SED_HACKS
29137     if ( bUseExceptions ) {
29138       CPLErr eclass = CPLGetLastErrorType();
29139       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29140         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29141       }
29142     }
29143 #endif
29144   }
29145   resultobj = SWIG_Py_Void();
29146   {
29147     /* %typemap(python,argout) (double *val, int*hasval) */
29148     PyObject *r;
29149     if ( !*arg3 ) {
29150       Py_INCREF(Py_None);
29151       r = Py_None;
29152       resultobj = t_output_helper(resultobj,r);
29153     }
29154     else {
29155       r = PyFloat_FromDouble( *arg2 );
29156       resultobj = t_output_helper(resultobj,r);
29157     }
29158   }
29159   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29160   return resultobj;
29161 fail:
29162   return NULL;
29163 }
29164 
29165 
_wrap_Band_GetMaximum(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29166 SWIGINTERN PyObject *_wrap_Band_GetMaximum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29167   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29168   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29169   double *arg2 = (double *) 0 ;
29170   int *arg3 = (int *) 0 ;
29171   void *argp1 = 0 ;
29172   int res1 = 0 ;
29173   double tmpval2 ;
29174   int tmphasval2 ;
29175   PyObject * obj0 = 0 ;
29176 
29177   {
29178     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
29179     arg2 = &tmpval2;
29180     arg3 = &tmphasval2;
29181   }
29182   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetMaximum",&obj0)) SWIG_fail;
29183   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29184   if (!SWIG_IsOK(res1)) {
29185     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetMaximum" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29186   }
29187   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29188   {
29189     if ( bUseExceptions ) {
29190       ClearErrorState();
29191     }
29192     {
29193       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29194       GDALRasterBandShadow_GetMaximum(arg1,arg2,arg3);
29195       SWIG_PYTHON_THREAD_END_ALLOW;
29196     }
29197 #ifndef SED_HACKS
29198     if ( bUseExceptions ) {
29199       CPLErr eclass = CPLGetLastErrorType();
29200       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29201         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29202       }
29203     }
29204 #endif
29205   }
29206   resultobj = SWIG_Py_Void();
29207   {
29208     /* %typemap(python,argout) (double *val, int*hasval) */
29209     PyObject *r;
29210     if ( !*arg3 ) {
29211       Py_INCREF(Py_None);
29212       r = Py_None;
29213       resultobj = t_output_helper(resultobj,r);
29214     }
29215     else {
29216       r = PyFloat_FromDouble( *arg2 );
29217       resultobj = t_output_helper(resultobj,r);
29218     }
29219   }
29220   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29221   return resultobj;
29222 fail:
29223   return NULL;
29224 }
29225 
29226 
_wrap_Band_GetOffset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29227 SWIGINTERN PyObject *_wrap_Band_GetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29228   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29229   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29230   double *arg2 = (double *) 0 ;
29231   int *arg3 = (int *) 0 ;
29232   void *argp1 = 0 ;
29233   int res1 = 0 ;
29234   double tmpval2 ;
29235   int tmphasval2 ;
29236   PyObject * obj0 = 0 ;
29237 
29238   {
29239     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
29240     arg2 = &tmpval2;
29241     arg3 = &tmphasval2;
29242   }
29243   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetOffset",&obj0)) SWIG_fail;
29244   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29245   if (!SWIG_IsOK(res1)) {
29246     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetOffset" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29247   }
29248   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29249   {
29250     if ( bUseExceptions ) {
29251       ClearErrorState();
29252     }
29253     {
29254       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29255       GDALRasterBandShadow_GetOffset(arg1,arg2,arg3);
29256       SWIG_PYTHON_THREAD_END_ALLOW;
29257     }
29258 #ifndef SED_HACKS
29259     if ( bUseExceptions ) {
29260       CPLErr eclass = CPLGetLastErrorType();
29261       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29262         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29263       }
29264     }
29265 #endif
29266   }
29267   resultobj = SWIG_Py_Void();
29268   {
29269     /* %typemap(python,argout) (double *val, int*hasval) */
29270     PyObject *r;
29271     if ( !*arg3 ) {
29272       Py_INCREF(Py_None);
29273       r = Py_None;
29274       resultobj = t_output_helper(resultobj,r);
29275     }
29276     else {
29277       r = PyFloat_FromDouble( *arg2 );
29278       resultobj = t_output_helper(resultobj,r);
29279     }
29280   }
29281   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29282   return resultobj;
29283 fail:
29284   return NULL;
29285 }
29286 
29287 
_wrap_Band_GetScale(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29288 SWIGINTERN PyObject *_wrap_Band_GetScale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29289   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29290   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29291   double *arg2 = (double *) 0 ;
29292   int *arg3 = (int *) 0 ;
29293   void *argp1 = 0 ;
29294   int res1 = 0 ;
29295   double tmpval2 ;
29296   int tmphasval2 ;
29297   PyObject * obj0 = 0 ;
29298 
29299   {
29300     /* %typemap(python,in,numinputs=0) (double *val, int*hasval) */
29301     arg2 = &tmpval2;
29302     arg3 = &tmphasval2;
29303   }
29304   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetScale",&obj0)) SWIG_fail;
29305   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29306   if (!SWIG_IsOK(res1)) {
29307     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetScale" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29308   }
29309   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29310   {
29311     if ( bUseExceptions ) {
29312       ClearErrorState();
29313     }
29314     {
29315       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29316       GDALRasterBandShadow_GetScale(arg1,arg2,arg3);
29317       SWIG_PYTHON_THREAD_END_ALLOW;
29318     }
29319 #ifndef SED_HACKS
29320     if ( bUseExceptions ) {
29321       CPLErr eclass = CPLGetLastErrorType();
29322       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29323         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29324       }
29325     }
29326 #endif
29327   }
29328   resultobj = SWIG_Py_Void();
29329   {
29330     /* %typemap(python,argout) (double *val, int*hasval) */
29331     PyObject *r;
29332     if ( !*arg3 ) {
29333       Py_INCREF(Py_None);
29334       r = Py_None;
29335       resultobj = t_output_helper(resultobj,r);
29336     }
29337     else {
29338       r = PyFloat_FromDouble( *arg2 );
29339       resultobj = t_output_helper(resultobj,r);
29340     }
29341   }
29342   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29343   return resultobj;
29344 fail:
29345   return NULL;
29346 }
29347 
29348 
_wrap_Band_SetOffset(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29349 SWIGINTERN PyObject *_wrap_Band_SetOffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29350   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29351   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29352   double arg2 ;
29353   void *argp1 = 0 ;
29354   int res1 = 0 ;
29355   double val2 ;
29356   int ecode2 = 0 ;
29357   PyObject * obj0 = 0 ;
29358   PyObject * obj1 = 0 ;
29359   CPLErr result;
29360 
29361   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetOffset",&obj0,&obj1)) SWIG_fail;
29362   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29363   if (!SWIG_IsOK(res1)) {
29364     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetOffset" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29365   }
29366   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29367   ecode2 = SWIG_AsVal_double(obj1, &val2);
29368   if (!SWIG_IsOK(ecode2)) {
29369     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetOffset" "', argument " "2"" of type '" "double""'");
29370   }
29371   arg2 = static_cast< double >(val2);
29372   {
29373     if ( bUseExceptions ) {
29374       ClearErrorState();
29375     }
29376     {
29377       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29378       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetOffset(arg1,arg2));
29379       SWIG_PYTHON_THREAD_END_ALLOW;
29380     }
29381 #ifndef SED_HACKS
29382     if ( bUseExceptions ) {
29383       CPLErr eclass = CPLGetLastErrorType();
29384       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29385         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29386       }
29387     }
29388 #endif
29389   }
29390   resultobj = SWIG_From_int(static_cast< int >(result));
29391   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29392   return resultobj;
29393 fail:
29394   return NULL;
29395 }
29396 
29397 
_wrap_Band_SetScale(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29398 SWIGINTERN PyObject *_wrap_Band_SetScale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29399   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29400   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29401   double arg2 ;
29402   void *argp1 = 0 ;
29403   int res1 = 0 ;
29404   double val2 ;
29405   int ecode2 = 0 ;
29406   PyObject * obj0 = 0 ;
29407   PyObject * obj1 = 0 ;
29408   CPLErr result;
29409 
29410   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetScale",&obj0,&obj1)) SWIG_fail;
29411   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29412   if (!SWIG_IsOK(res1)) {
29413     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetScale" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29414   }
29415   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29416   ecode2 = SWIG_AsVal_double(obj1, &val2);
29417   if (!SWIG_IsOK(ecode2)) {
29418     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetScale" "', argument " "2"" of type '" "double""'");
29419   }
29420   arg2 = static_cast< double >(val2);
29421   {
29422     if ( bUseExceptions ) {
29423       ClearErrorState();
29424     }
29425     {
29426       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29427       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetScale(arg1,arg2));
29428       SWIG_PYTHON_THREAD_END_ALLOW;
29429     }
29430 #ifndef SED_HACKS
29431     if ( bUseExceptions ) {
29432       CPLErr eclass = CPLGetLastErrorType();
29433       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29434         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29435       }
29436     }
29437 #endif
29438   }
29439   resultobj = SWIG_From_int(static_cast< int >(result));
29440   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29441   return resultobj;
29442 fail:
29443   return NULL;
29444 }
29445 
29446 
_wrap_Band_GetStatistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29447 SWIGINTERN PyObject *_wrap_Band_GetStatistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29448   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29449   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29450   int arg2 ;
29451   int arg3 ;
29452   double *arg4 = (double *) 0 ;
29453   double *arg5 = (double *) 0 ;
29454   double *arg6 = (double *) 0 ;
29455   double *arg7 = (double *) 0 ;
29456   void *argp1 = 0 ;
29457   int res1 = 0 ;
29458   int val2 ;
29459   int ecode2 = 0 ;
29460   int val3 ;
29461   int ecode3 = 0 ;
29462   double temp4 ;
29463   int res4 = SWIG_TMPOBJ ;
29464   double temp5 ;
29465   int res5 = SWIG_TMPOBJ ;
29466   double temp6 ;
29467   int res6 = SWIG_TMPOBJ ;
29468   double temp7 ;
29469   int res7 = SWIG_TMPOBJ ;
29470   PyObject * obj0 = 0 ;
29471   PyObject * obj1 = 0 ;
29472   PyObject * obj2 = 0 ;
29473   CPLErr result;
29474 
29475   arg4 = &temp4;
29476   arg5 = &temp5;
29477   arg6 = &temp6;
29478   arg7 = &temp7;
29479   if (!PyArg_ParseTuple(args,(char *)"OOO:Band_GetStatistics",&obj0,&obj1,&obj2)) SWIG_fail;
29480   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29481   if (!SWIG_IsOK(res1)) {
29482     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetStatistics" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29483   }
29484   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29485   ecode2 = SWIG_AsVal_int(obj1, &val2);
29486   if (!SWIG_IsOK(ecode2)) {
29487     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetStatistics" "', argument " "2"" of type '" "int""'");
29488   }
29489   arg2 = static_cast< int >(val2);
29490   ecode3 = SWIG_AsVal_int(obj2, &val3);
29491   if (!SWIG_IsOK(ecode3)) {
29492     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_GetStatistics" "', argument " "3"" of type '" "int""'");
29493   }
29494   arg3 = static_cast< int >(val3);
29495   {
29496     if ( bUseExceptions ) {
29497       ClearErrorState();
29498     }
29499     {
29500       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29501       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_GetStatistics(arg1,arg2,arg3,arg4,arg5,arg6,arg7));
29502       SWIG_PYTHON_THREAD_END_ALLOW;
29503     }
29504 #ifndef SED_HACKS
29505     if ( bUseExceptions ) {
29506       CPLErr eclass = CPLGetLastErrorType();
29507       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29508         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29509       }
29510     }
29511 #endif
29512   }
29513   {
29514     /* %typemap(out) IF_ERROR_RETURN_NONE */
29515   }
29516   if (ReturnSame(SWIG_IsTmpObj(res4))) {
29517     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg4)));
29518   } else {
29519     int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29520     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags));
29521   }
29522   if (ReturnSame(SWIG_IsTmpObj(res5))) {
29523     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg5)));
29524   } else {
29525     int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29526     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags));
29527   }
29528   if (ReturnSame(SWIG_IsTmpObj(res6))) {
29529     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg6)));
29530   } else {
29531     int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29532     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_double, new_flags));
29533   }
29534   if (ReturnSame(SWIG_IsTmpObj(res7))) {
29535     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg7)));
29536   } else {
29537     int new_flags = SWIG_IsNewObj(res7) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29538     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_double, new_flags));
29539   }
29540   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29541   return resultobj;
29542 fail:
29543   return NULL;
29544 }
29545 
29546 
_wrap_Band_ComputeStatistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29547 SWIGINTERN PyObject *_wrap_Band_ComputeStatistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29548   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29549   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29550   bool arg2 ;
29551   double *arg3 = (double *) NULL ;
29552   double *arg4 = (double *) NULL ;
29553   double *arg5 = (double *) NULL ;
29554   double *arg6 = (double *) NULL ;
29555   GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
29556   void *arg8 = (void *) NULL ;
29557   void *argp1 = 0 ;
29558   int res1 = 0 ;
29559   bool val2 ;
29560   int ecode2 = 0 ;
29561   double temp3 ;
29562   int res3 = SWIG_TMPOBJ ;
29563   double temp4 ;
29564   int res4 = SWIG_TMPOBJ ;
29565   double temp5 ;
29566   int res5 = SWIG_TMPOBJ ;
29567   double temp6 ;
29568   int res6 = SWIG_TMPOBJ ;
29569   PyObject * obj0 = 0 ;
29570   PyObject * obj1 = 0 ;
29571   PyObject * obj2 = 0 ;
29572   PyObject * obj3 = 0 ;
29573   CPLErr result;
29574 
29575   /* %typemap(arginit) ( const char* callback_data=NULL)  */
29576   PyProgressData *psProgressInfo;
29577   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
29578   psProgressInfo->nLastReported = -1;
29579   psProgressInfo->psPyCallback = NULL;
29580   psProgressInfo->psPyCallbackData = NULL;
29581   arg8 = psProgressInfo;
29582   arg3 = &temp3;
29583   arg4 = &temp4;
29584   arg5 = &temp5;
29585   arg6 = &temp6;
29586   if (!PyArg_ParseTuple(args,(char *)"OO|OO:Band_ComputeStatistics",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
29587   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29588   if (!SWIG_IsOK(res1)) {
29589     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ComputeStatistics" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29590   }
29591   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29592   ecode2 = SWIG_AsVal_bool(obj1, &val2);
29593   if (!SWIG_IsOK(ecode2)) {
29594     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_ComputeStatistics" "', argument " "2"" of type '" "bool""'");
29595   }
29596   arg2 = static_cast< bool >(val2);
29597   if (obj2) {
29598     {
29599       /* %typemap(in) (GDALProgressFunc callback = NULL) */
29600       /* callback_func typemap */
29601 
29602       /* In some cases 0 is passed instead of None. */
29603       /* See https://github.com/OSGeo/gdal/pull/219 */
29604       if ( PyLong_Check(obj2) || PyInt_Check(obj2) )
29605       {
29606         if( PyLong_AsLong(obj2) == 0 )
29607         {
29608           obj2 = Py_None;
29609         }
29610       }
29611 
29612       if (obj2 && obj2 != Py_None ) {
29613         void* cbfunction = NULL;
29614         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj2,
29615             (void**)&cbfunction,
29616             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
29617             SWIG_POINTER_EXCEPTION | 0 ));
29618 
29619         if ( cbfunction == GDALTermProgress ) {
29620           arg7 = GDALTermProgress;
29621         } else {
29622           if (!PyCallable_Check(obj2)) {
29623             PyErr_SetString( PyExc_RuntimeError,
29624               "Object given is not a Python function" );
29625             SWIG_fail;
29626           }
29627           psProgressInfo->psPyCallback = obj2;
29628           arg7 = PyProgressProxy;
29629         }
29630 
29631       }
29632 
29633     }
29634   }
29635   if (obj3) {
29636     {
29637       /* %typemap(in) ( void* callback_data=NULL)  */
29638       psProgressInfo->psPyCallbackData = obj3 ;
29639     }
29640   }
29641   {
29642     if ( bUseExceptions ) {
29643       ClearErrorState();
29644     }
29645     {
29646       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29647       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_ComputeStatistics(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8));
29648       SWIG_PYTHON_THREAD_END_ALLOW;
29649     }
29650 #ifndef SED_HACKS
29651     if ( bUseExceptions ) {
29652       CPLErr eclass = CPLGetLastErrorType();
29653       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29654         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29655       }
29656     }
29657 #endif
29658   }
29659   {
29660     /* %typemap(out) IF_ERROR_RETURN_NONE */
29661   }
29662   if (ReturnSame(SWIG_IsTmpObj(res3))) {
29663     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg3)));
29664   } else {
29665     int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29666     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags));
29667   }
29668   if (ReturnSame(SWIG_IsTmpObj(res4))) {
29669     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg4)));
29670   } else {
29671     int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29672     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags));
29673   }
29674   if (ReturnSame(SWIG_IsTmpObj(res5))) {
29675     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg5)));
29676   } else {
29677     int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29678     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags));
29679   }
29680   if (ReturnSame(SWIG_IsTmpObj(res6))) {
29681     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg6)));
29682   } else {
29683     int new_flags = SWIG_IsNewObj(res6) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
29684     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg6), SWIGTYPE_p_double, new_flags));
29685   }
29686   {
29687     /* %typemap(freearg) ( void* callback_data=NULL)  */
29688 
29689     CPLFree(psProgressInfo);
29690 
29691   }
29692   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29693   return resultobj;
29694 fail:
29695   {
29696     /* %typemap(freearg) ( void* callback_data=NULL)  */
29697 
29698     CPLFree(psProgressInfo);
29699 
29700   }
29701   return NULL;
29702 }
29703 
29704 
_wrap_Band_SetStatistics(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29705 SWIGINTERN PyObject *_wrap_Band_SetStatistics(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29706   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29707   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29708   double arg2 ;
29709   double arg3 ;
29710   double arg4 ;
29711   double arg5 ;
29712   void *argp1 = 0 ;
29713   int res1 = 0 ;
29714   double val2 ;
29715   int ecode2 = 0 ;
29716   double val3 ;
29717   int ecode3 = 0 ;
29718   double val4 ;
29719   int ecode4 = 0 ;
29720   double val5 ;
29721   int ecode5 = 0 ;
29722   PyObject * obj0 = 0 ;
29723   PyObject * obj1 = 0 ;
29724   PyObject * obj2 = 0 ;
29725   PyObject * obj3 = 0 ;
29726   PyObject * obj4 = 0 ;
29727   CPLErr result;
29728 
29729   if (!PyArg_ParseTuple(args,(char *)"OOOOO:Band_SetStatistics",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
29730   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29731   if (!SWIG_IsOK(res1)) {
29732     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetStatistics" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29733   }
29734   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29735   ecode2 = SWIG_AsVal_double(obj1, &val2);
29736   if (!SWIG_IsOK(ecode2)) {
29737     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetStatistics" "', argument " "2"" of type '" "double""'");
29738   }
29739   arg2 = static_cast< double >(val2);
29740   ecode3 = SWIG_AsVal_double(obj2, &val3);
29741   if (!SWIG_IsOK(ecode3)) {
29742     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_SetStatistics" "', argument " "3"" of type '" "double""'");
29743   }
29744   arg3 = static_cast< double >(val3);
29745   ecode4 = SWIG_AsVal_double(obj3, &val4);
29746   if (!SWIG_IsOK(ecode4)) {
29747     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_SetStatistics" "', argument " "4"" of type '" "double""'");
29748   }
29749   arg4 = static_cast< double >(val4);
29750   ecode5 = SWIG_AsVal_double(obj4, &val5);
29751   if (!SWIG_IsOK(ecode5)) {
29752     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_SetStatistics" "', argument " "5"" of type '" "double""'");
29753   }
29754   arg5 = static_cast< double >(val5);
29755   {
29756     if ( bUseExceptions ) {
29757       ClearErrorState();
29758     }
29759     {
29760       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29761       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetStatistics(arg1,arg2,arg3,arg4,arg5));
29762       SWIG_PYTHON_THREAD_END_ALLOW;
29763     }
29764 #ifndef SED_HACKS
29765     if ( bUseExceptions ) {
29766       CPLErr eclass = CPLGetLastErrorType();
29767       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29768         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29769       }
29770     }
29771 #endif
29772   }
29773   resultobj = SWIG_From_int(static_cast< int >(result));
29774   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29775   return resultobj;
29776 fail:
29777   return NULL;
29778 }
29779 
29780 
_wrap_Band_GetOverviewCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29781 SWIGINTERN PyObject *_wrap_Band_GetOverviewCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29782   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29783   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29784   void *argp1 = 0 ;
29785   int res1 = 0 ;
29786   PyObject * obj0 = 0 ;
29787   int result;
29788 
29789   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetOverviewCount",&obj0)) SWIG_fail;
29790   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29791   if (!SWIG_IsOK(res1)) {
29792     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetOverviewCount" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29793   }
29794   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29795   {
29796     if ( bUseExceptions ) {
29797       ClearErrorState();
29798     }
29799     {
29800       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29801       result = (int)GDALRasterBandShadow_GetOverviewCount(arg1);
29802       SWIG_PYTHON_THREAD_END_ALLOW;
29803     }
29804 #ifndef SED_HACKS
29805     if ( bUseExceptions ) {
29806       CPLErr eclass = CPLGetLastErrorType();
29807       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29808         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29809       }
29810     }
29811 #endif
29812   }
29813   resultobj = SWIG_From_int(static_cast< int >(result));
29814   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29815   return resultobj;
29816 fail:
29817   return NULL;
29818 }
29819 
29820 
_wrap_Band_GetOverview(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29821 SWIGINTERN PyObject *_wrap_Band_GetOverview(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29822   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29823   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29824   int arg2 ;
29825   void *argp1 = 0 ;
29826   int res1 = 0 ;
29827   int val2 ;
29828   int ecode2 = 0 ;
29829   PyObject * obj0 = 0 ;
29830   PyObject * obj1 = 0 ;
29831   GDALRasterBandShadow *result = 0 ;
29832 
29833   if (!PyArg_ParseTuple(args,(char *)"OO:Band_GetOverview",&obj0,&obj1)) SWIG_fail;
29834   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29835   if (!SWIG_IsOK(res1)) {
29836     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetOverview" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29837   }
29838   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29839   ecode2 = SWIG_AsVal_int(obj1, &val2);
29840   if (!SWIG_IsOK(ecode2)) {
29841     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetOverview" "', argument " "2"" of type '" "int""'");
29842   }
29843   arg2 = static_cast< int >(val2);
29844   {
29845     if ( bUseExceptions ) {
29846       ClearErrorState();
29847     }
29848     {
29849       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29850       result = (GDALRasterBandShadow *)GDALRasterBandShadow_GetOverview(arg1,arg2);
29851       SWIG_PYTHON_THREAD_END_ALLOW;
29852     }
29853 #ifndef SED_HACKS
29854     if ( bUseExceptions ) {
29855       CPLErr eclass = CPLGetLastErrorType();
29856       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29857         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29858       }
29859     }
29860 #endif
29861   }
29862   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29863   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29864   return resultobj;
29865 fail:
29866   return NULL;
29867 }
29868 
29869 
_wrap_Band_Checksum(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)29870 SWIGINTERN PyObject *_wrap_Band_Checksum(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
29871   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29872   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29873   int arg2 = (int) 0 ;
29874   int arg3 = (int) 0 ;
29875   int *arg4 = (int *) 0 ;
29876   int *arg5 = (int *) 0 ;
29877   void *argp1 = 0 ;
29878   int res1 = 0 ;
29879   int val2 ;
29880   int ecode2 = 0 ;
29881   int val3 ;
29882   int ecode3 = 0 ;
29883   int val4 ;
29884   int val5 ;
29885   PyObject * obj0 = 0 ;
29886   PyObject * obj1 = 0 ;
29887   PyObject * obj2 = 0 ;
29888   PyObject * obj3 = 0 ;
29889   PyObject * obj4 = 0 ;
29890   char *  kwnames[] = {
29891     (char *) "self",(char *) "xoff",(char *) "yoff",(char *) "xsize",(char *) "ysize", NULL
29892   };
29893   int result;
29894 
29895   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:Band_Checksum",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
29896   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29897   if (!SWIG_IsOK(res1)) {
29898     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_Checksum" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29899   }
29900   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29901   if (obj1) {
29902     ecode2 = SWIG_AsVal_int(obj1, &val2);
29903     if (!SWIG_IsOK(ecode2)) {
29904       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_Checksum" "', argument " "2"" of type '" "int""'");
29905     }
29906     arg2 = static_cast< int >(val2);
29907   }
29908   if (obj2) {
29909     ecode3 = SWIG_AsVal_int(obj2, &val3);
29910     if (!SWIG_IsOK(ecode3)) {
29911       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_Checksum" "', argument " "3"" of type '" "int""'");
29912     }
29913     arg3 = static_cast< int >(val3);
29914   }
29915   if (obj3) {
29916     {
29917       /* %typemap(in) (int *optional_##int) */
29918       if ( obj3 == Py_None ) {
29919         arg4 = 0;
29920       }
29921       else if ( PyArg_Parse( obj3,"i" ,&val4 ) ) {
29922         arg4 = (int *) &val4;
29923       }
29924       else {
29925         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
29926         SWIG_fail;
29927       }
29928     }
29929   }
29930   if (obj4) {
29931     {
29932       /* %typemap(in) (int *optional_##int) */
29933       if ( obj4 == Py_None ) {
29934         arg5 = 0;
29935       }
29936       else if ( PyArg_Parse( obj4,"i" ,&val5 ) ) {
29937         arg5 = (int *) &val5;
29938       }
29939       else {
29940         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
29941         SWIG_fail;
29942       }
29943     }
29944   }
29945   {
29946     if ( bUseExceptions ) {
29947       ClearErrorState();
29948     }
29949     {
29950       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29951       result = (int)GDALRasterBandShadow_Checksum(arg1,arg2,arg3,arg4,arg5);
29952       SWIG_PYTHON_THREAD_END_ALLOW;
29953     }
29954 #ifndef SED_HACKS
29955     if ( bUseExceptions ) {
29956       CPLErr eclass = CPLGetLastErrorType();
29957       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
29958         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
29959       }
29960     }
29961 #endif
29962   }
29963   resultobj = SWIG_From_int(static_cast< int >(result));
29964   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
29965   return resultobj;
29966 fail:
29967   return NULL;
29968 }
29969 
29970 
_wrap_Band_ComputeRasterMinMax(PyObject * SWIGUNUSEDPARM (self),PyObject * args)29971 SWIGINTERN PyObject *_wrap_Band_ComputeRasterMinMax(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
29972   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
29973   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
29974   double *arg2 ;
29975   int arg3 = (int) 0 ;
29976   void *argp1 = 0 ;
29977   int res1 = 0 ;
29978   double argout2[2] ;
29979   int val3 ;
29980   int ecode3 = 0 ;
29981   PyObject * obj0 = 0 ;
29982   PyObject * obj1 = 0 ;
29983 
29984   {
29985     /* %typemap(in,numinputs=0) (double argout2[ANY]) */
29986     memset(argout2, 0, sizeof(argout2));
29987     arg2 = argout2;
29988   }
29989   if (!PyArg_ParseTuple(args,(char *)"O|O:Band_ComputeRasterMinMax",&obj0,&obj1)) SWIG_fail;
29990   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
29991   if (!SWIG_IsOK(res1)) {
29992     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ComputeRasterMinMax" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
29993   }
29994   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
29995   if (obj1) {
29996     ecode3 = SWIG_AsVal_int(obj1, &val3);
29997     if (!SWIG_IsOK(ecode3)) {
29998       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_ComputeRasterMinMax" "', argument " "3"" of type '" "int""'");
29999     }
30000     arg3 = static_cast< int >(val3);
30001   }
30002   {
30003     if ( bUseExceptions ) {
30004       ClearErrorState();
30005     }
30006     {
30007       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30008       GDALRasterBandShadow_ComputeRasterMinMax(arg1,arg2,arg3);
30009       SWIG_PYTHON_THREAD_END_ALLOW;
30010     }
30011 #ifndef SED_HACKS
30012     if ( bUseExceptions ) {
30013       CPLErr eclass = CPLGetLastErrorType();
30014       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30015         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30016       }
30017     }
30018 #endif
30019   }
30020   resultobj = SWIG_Py_Void();
30021   {
30022     /* %typemap(argout) (double argout[ANY]) */
30023     PyObject *out = CreateTupleFromDoubleArray( arg2, 2 );
30024     resultobj = t_output_helper(resultobj,out);
30025   }
30026   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30027   return resultobj;
30028 fail:
30029   return NULL;
30030 }
30031 
30032 
_wrap_Band_ComputeBandStats(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30033 SWIGINTERN PyObject *_wrap_Band_ComputeBandStats(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30034   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30035   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30036   double *arg2 ;
30037   int arg3 = (int) 1 ;
30038   void *argp1 = 0 ;
30039   int res1 = 0 ;
30040   double argout2[2] ;
30041   int val3 ;
30042   int ecode3 = 0 ;
30043   PyObject * obj0 = 0 ;
30044   PyObject * obj1 = 0 ;
30045 
30046   {
30047     /* %typemap(in,numinputs=0) (double argout2[ANY]) */
30048     memset(argout2, 0, sizeof(argout2));
30049     arg2 = argout2;
30050   }
30051   if (!PyArg_ParseTuple(args,(char *)"O|O:Band_ComputeBandStats",&obj0,&obj1)) SWIG_fail;
30052   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30053   if (!SWIG_IsOK(res1)) {
30054     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ComputeBandStats" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30055   }
30056   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30057   if (obj1) {
30058     ecode3 = SWIG_AsVal_int(obj1, &val3);
30059     if (!SWIG_IsOK(ecode3)) {
30060       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_ComputeBandStats" "', argument " "3"" of type '" "int""'");
30061     }
30062     arg3 = static_cast< int >(val3);
30063   }
30064   {
30065     if ( bUseExceptions ) {
30066       ClearErrorState();
30067     }
30068     {
30069       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30070       GDALRasterBandShadow_ComputeBandStats(arg1,arg2,arg3);
30071       SWIG_PYTHON_THREAD_END_ALLOW;
30072     }
30073 #ifndef SED_HACKS
30074     if ( bUseExceptions ) {
30075       CPLErr eclass = CPLGetLastErrorType();
30076       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30077         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30078       }
30079     }
30080 #endif
30081   }
30082   resultobj = SWIG_Py_Void();
30083   {
30084     /* %typemap(argout) (double argout[ANY]) */
30085     PyObject *out = CreateTupleFromDoubleArray( arg2, 2 );
30086     resultobj = t_output_helper(resultobj,out);
30087   }
30088   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30089   return resultobj;
30090 fail:
30091   return NULL;
30092 }
30093 
30094 
_wrap_Band_Fill(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30095 SWIGINTERN PyObject *_wrap_Band_Fill(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30096   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30097   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30098   double arg2 ;
30099   double arg3 = (double) 0.0 ;
30100   void *argp1 = 0 ;
30101   int res1 = 0 ;
30102   double val2 ;
30103   int ecode2 = 0 ;
30104   double val3 ;
30105   int ecode3 = 0 ;
30106   PyObject * obj0 = 0 ;
30107   PyObject * obj1 = 0 ;
30108   PyObject * obj2 = 0 ;
30109   CPLErr result;
30110 
30111   if (!PyArg_ParseTuple(args,(char *)"OO|O:Band_Fill",&obj0,&obj1,&obj2)) SWIG_fail;
30112   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30113   if (!SWIG_IsOK(res1)) {
30114     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_Fill" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30115   }
30116   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30117   ecode2 = SWIG_AsVal_double(obj1, &val2);
30118   if (!SWIG_IsOK(ecode2)) {
30119     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_Fill" "', argument " "2"" of type '" "double""'");
30120   }
30121   arg2 = static_cast< double >(val2);
30122   if (obj2) {
30123     ecode3 = SWIG_AsVal_double(obj2, &val3);
30124     if (!SWIG_IsOK(ecode3)) {
30125       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_Fill" "', argument " "3"" of type '" "double""'");
30126     }
30127     arg3 = static_cast< double >(val3);
30128   }
30129   {
30130     if ( bUseExceptions ) {
30131       ClearErrorState();
30132     }
30133     {
30134       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30135       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_Fill(arg1,arg2,arg3));
30136       SWIG_PYTHON_THREAD_END_ALLOW;
30137     }
30138 #ifndef SED_HACKS
30139     if ( bUseExceptions ) {
30140       CPLErr eclass = CPLGetLastErrorType();
30141       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30142         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30143       }
30144     }
30145 #endif
30146   }
30147   resultobj = SWIG_From_int(static_cast< int >(result));
30148   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30149   return resultobj;
30150 fail:
30151   return NULL;
30152 }
30153 
30154 
_wrap_Band_WriteRaster(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)30155 SWIGINTERN PyObject *_wrap_Band_WriteRaster(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
30156   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30157   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30158   int arg2 ;
30159   int arg3 ;
30160   int arg4 ;
30161   int arg5 ;
30162   GIntBig arg6 ;
30163   char *arg7 = (char *) 0 ;
30164   int *arg8 = (int *) 0 ;
30165   int *arg9 = (int *) 0 ;
30166   GDALDataType *arg10 = (GDALDataType *) 0 ;
30167   GIntBig *arg11 = (GIntBig *) 0 ;
30168   GIntBig *arg12 = (GIntBig *) 0 ;
30169   void *argp1 = 0 ;
30170   int res1 = 0 ;
30171   int val2 ;
30172   int ecode2 = 0 ;
30173   int val3 ;
30174   int ecode3 = 0 ;
30175   int val4 ;
30176   int ecode4 = 0 ;
30177   int val5 ;
30178   int ecode5 = 0 ;
30179   int alloc6 = 0 ;
30180   bool viewIsValid6 = false ;
30181   Py_buffer view6 ;
30182   int val8 ;
30183   int val9 ;
30184   GDALDataType val10 ;
30185   GIntBig val11 ;
30186   GIntBig val12 ;
30187   PyObject * obj0 = 0 ;
30188   PyObject * obj1 = 0 ;
30189   PyObject * obj2 = 0 ;
30190   PyObject * obj3 = 0 ;
30191   PyObject * obj4 = 0 ;
30192   PyObject * obj5 = 0 ;
30193   PyObject * obj6 = 0 ;
30194   PyObject * obj7 = 0 ;
30195   PyObject * obj8 = 0 ;
30196   PyObject * obj9 = 0 ;
30197   PyObject * obj10 = 0 ;
30198   char *  kwnames[] = {
30199     (char *) "self",(char *) "xoff",(char *) "yoff",(char *) "xsize",(char *) "ysize",(char *) "buf_len",(char *) "buf_xsize",(char *) "buf_ysize",(char *) "buf_type",(char *) "buf_pixel_space",(char *) "buf_line_space", NULL
30200   };
30201   CPLErr result;
30202 
30203   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOO|OOOOO:Band_WriteRaster",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
30204   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30205   if (!SWIG_IsOK(res1)) {
30206     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_WriteRaster" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30207   }
30208   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30209   ecode2 = SWIG_AsVal_int(obj1, &val2);
30210   if (!SWIG_IsOK(ecode2)) {
30211     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_WriteRaster" "', argument " "2"" of type '" "int""'");
30212   }
30213   arg2 = static_cast< int >(val2);
30214   ecode3 = SWIG_AsVal_int(obj2, &val3);
30215   if (!SWIG_IsOK(ecode3)) {
30216     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_WriteRaster" "', argument " "3"" of type '" "int""'");
30217   }
30218   arg3 = static_cast< int >(val3);
30219   ecode4 = SWIG_AsVal_int(obj3, &val4);
30220   if (!SWIG_IsOK(ecode4)) {
30221     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_WriteRaster" "', argument " "4"" of type '" "int""'");
30222   }
30223   arg4 = static_cast< int >(val4);
30224   ecode5 = SWIG_AsVal_int(obj4, &val5);
30225   if (!SWIG_IsOK(ecode5)) {
30226     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_WriteRaster" "', argument " "5"" of type '" "int""'");
30227   }
30228   arg5 = static_cast< int >(val5);
30229   {
30230     /* %typemap(in,numinputs=1) (GIntBig nLen, char *pBuf ) */
30231     {
30232       if (PyObject_GetBuffer(obj5, &view6, PyBUF_SIMPLE) == 0)
30233       {
30234         viewIsValid6 = true;
30235         arg6 = view6.len;
30236         arg7 = (char *) view6.buf;
30237         goto ok;
30238       }
30239       else
30240       {
30241         PyErr_Clear();
30242       }
30243     }
30244     if (PyUnicode_Check(obj5))
30245     {
30246       size_t safeLen = 0;
30247       int ret = SWIG_AsCharPtrAndSize(obj5, (char**) &arg7, &safeLen, &alloc6);
30248       if (!SWIG_IsOK(ret)) {
30249         SWIG_exception( SWIG_RuntimeError, "invalid Unicode string" );
30250       }
30251 
30252       if (safeLen) safeLen--;
30253       arg6 = (GIntBig) safeLen;
30254     }
30255     else
30256     {
30257       PyErr_SetString(PyExc_TypeError, "not a unicode string, bytes, bytearray or memoryview");
30258       SWIG_fail;
30259     }
30260     ok: ;
30261   }
30262   if (obj6) {
30263     {
30264       /* %typemap(in) (int *optional_##int) */
30265       if ( obj6 == Py_None ) {
30266         arg8 = 0;
30267       }
30268       else if ( PyArg_Parse( obj6,"i" ,&val8 ) ) {
30269         arg8 = (int *) &val8;
30270       }
30271       else {
30272         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
30273         SWIG_fail;
30274       }
30275     }
30276   }
30277   if (obj7) {
30278     {
30279       /* %typemap(in) (int *optional_##int) */
30280       if ( obj7 == Py_None ) {
30281         arg9 = 0;
30282       }
30283       else if ( PyArg_Parse( obj7,"i" ,&val9 ) ) {
30284         arg9 = (int *) &val9;
30285       }
30286       else {
30287         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
30288         SWIG_fail;
30289       }
30290     }
30291   }
30292   if (obj8) {
30293     {
30294       /* %typemap(in) (GDALDataType *optional_GDALDataType) */
30295       int intval = 0;
30296       if ( obj8 == Py_None ) {
30297         arg10 = NULL;
30298       }
30299       else if ( SWIG_IsOK(SWIG_AsVal_int(obj8, &intval)) ) {
30300         if( intval < GDT_Unknown || intval >= GDT_TypeCount )
30301         {
30302           SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
30303         }
30304         val10 = static_cast<GDALDataType>(intval);
30305         arg10 = &val10;
30306       }
30307       else {
30308         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
30309         SWIG_fail;
30310       }
30311     }
30312   }
30313   if (obj9) {
30314     {
30315       /* %typemap(in) (GIntBig *optional_##GIntBig) */
30316       if ( obj9 == Py_None ) {
30317         arg11 = 0;
30318       }
30319       else if ( PyArg_Parse( obj9,"L" ,&val11 ) ) {
30320         arg11 = (GIntBig *) &val11;
30321       }
30322       else {
30323         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
30324         SWIG_fail;
30325       }
30326     }
30327   }
30328   if (obj10) {
30329     {
30330       /* %typemap(in) (GIntBig *optional_##GIntBig) */
30331       if ( obj10 == Py_None ) {
30332         arg12 = 0;
30333       }
30334       else if ( PyArg_Parse( obj10,"L" ,&val12 ) ) {
30335         arg12 = (GIntBig *) &val12;
30336       }
30337       else {
30338         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
30339         SWIG_fail;
30340       }
30341     }
30342   }
30343   {
30344     if ( bUseExceptions ) {
30345       ClearErrorState();
30346     }
30347     {
30348       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30349       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_WriteRaster(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12));
30350       SWIG_PYTHON_THREAD_END_ALLOW;
30351     }
30352 #ifndef SED_HACKS
30353     if ( bUseExceptions ) {
30354       CPLErr eclass = CPLGetLastErrorType();
30355       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30356         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30357       }
30358     }
30359 #endif
30360   }
30361   resultobj = SWIG_From_int(static_cast< int >(result));
30362   {
30363     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
30364     if( viewIsValid6 ) {
30365       PyBuffer_Release(&view6);
30366     }
30367     else if (ReturnSame(alloc6) == SWIG_NEWOBJ ) {
30368       delete[] arg7;
30369     }
30370   }
30371   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30372   return resultobj;
30373 fail:
30374   {
30375     /* %typemap(freearg) (GIntBig *nLen, char *pBuf ) */
30376     if( viewIsValid6 ) {
30377       PyBuffer_Release(&view6);
30378     }
30379     else if (ReturnSame(alloc6) == SWIG_NEWOBJ ) {
30380       delete[] arg7;
30381     }
30382   }
30383   return NULL;
30384 }
30385 
30386 
_wrap_Band_FlushCache(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30387 SWIGINTERN PyObject *_wrap_Band_FlushCache(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30388   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30389   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30390   void *argp1 = 0 ;
30391   int res1 = 0 ;
30392   PyObject * obj0 = 0 ;
30393 
30394   if (!PyArg_ParseTuple(args,(char *)"O:Band_FlushCache",&obj0)) SWIG_fail;
30395   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30396   if (!SWIG_IsOK(res1)) {
30397     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_FlushCache" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30398   }
30399   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30400   {
30401     if ( bUseExceptions ) {
30402       ClearErrorState();
30403     }
30404     {
30405       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30406       GDALRasterBandShadow_FlushCache(arg1);
30407       SWIG_PYTHON_THREAD_END_ALLOW;
30408     }
30409 #ifndef SED_HACKS
30410     if ( bUseExceptions ) {
30411       CPLErr eclass = CPLGetLastErrorType();
30412       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30413         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30414       }
30415     }
30416 #endif
30417   }
30418   resultobj = SWIG_Py_Void();
30419   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30420   return resultobj;
30421 fail:
30422   return NULL;
30423 }
30424 
30425 
_wrap_Band_GetRasterColorTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30426 SWIGINTERN PyObject *_wrap_Band_GetRasterColorTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30427   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30428   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30429   void *argp1 = 0 ;
30430   int res1 = 0 ;
30431   PyObject * obj0 = 0 ;
30432   GDALColorTableShadow *result = 0 ;
30433 
30434   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetRasterColorTable",&obj0)) SWIG_fail;
30435   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30436   if (!SWIG_IsOK(res1)) {
30437     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetRasterColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30438   }
30439   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30440   {
30441     if ( bUseExceptions ) {
30442       ClearErrorState();
30443     }
30444     {
30445       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30446       result = (GDALColorTableShadow *)GDALRasterBandShadow_GetRasterColorTable(arg1);
30447       SWIG_PYTHON_THREAD_END_ALLOW;
30448     }
30449 #ifndef SED_HACKS
30450     if ( bUseExceptions ) {
30451       CPLErr eclass = CPLGetLastErrorType();
30452       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30453         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30454       }
30455     }
30456 #endif
30457   }
30458   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
30459   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30460   return resultobj;
30461 fail:
30462   return NULL;
30463 }
30464 
30465 
_wrap_Band_GetColorTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30466 SWIGINTERN PyObject *_wrap_Band_GetColorTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30467   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30468   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30469   void *argp1 = 0 ;
30470   int res1 = 0 ;
30471   PyObject * obj0 = 0 ;
30472   GDALColorTableShadow *result = 0 ;
30473 
30474   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetColorTable",&obj0)) SWIG_fail;
30475   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30476   if (!SWIG_IsOK(res1)) {
30477     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30478   }
30479   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30480   {
30481     if ( bUseExceptions ) {
30482       ClearErrorState();
30483     }
30484     {
30485       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30486       result = (GDALColorTableShadow *)GDALRasterBandShadow_GetColorTable(arg1);
30487       SWIG_PYTHON_THREAD_END_ALLOW;
30488     }
30489 #ifndef SED_HACKS
30490     if ( bUseExceptions ) {
30491       CPLErr eclass = CPLGetLastErrorType();
30492       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30493         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30494       }
30495     }
30496 #endif
30497   }
30498   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
30499   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30500   return resultobj;
30501 fail:
30502   return NULL;
30503 }
30504 
30505 
_wrap_Band_SetRasterColorTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30506 SWIGINTERN PyObject *_wrap_Band_SetRasterColorTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30507   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30508   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30509   GDALColorTableShadow *arg2 = (GDALColorTableShadow *) 0 ;
30510   void *argp1 = 0 ;
30511   int res1 = 0 ;
30512   void *argp2 = 0 ;
30513   int res2 = 0 ;
30514   PyObject * obj0 = 0 ;
30515   PyObject * obj1 = 0 ;
30516   int result;
30517 
30518   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetRasterColorTable",&obj0,&obj1)) SWIG_fail;
30519   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30520   if (!SWIG_IsOK(res1)) {
30521     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetRasterColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30522   }
30523   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30524   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
30525   if (!SWIG_IsOK(res2)) {
30526     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetRasterColorTable" "', argument " "2"" of type '" "GDALColorTableShadow *""'");
30527   }
30528   arg2 = reinterpret_cast< GDALColorTableShadow * >(argp2);
30529   {
30530     if ( bUseExceptions ) {
30531       ClearErrorState();
30532     }
30533     {
30534       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30535       result = (int)GDALRasterBandShadow_SetRasterColorTable(arg1,arg2);
30536       SWIG_PYTHON_THREAD_END_ALLOW;
30537     }
30538 #ifndef SED_HACKS
30539     if ( bUseExceptions ) {
30540       CPLErr eclass = CPLGetLastErrorType();
30541       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30542         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30543       }
30544     }
30545 #endif
30546   }
30547   resultobj = SWIG_From_int(static_cast< int >(result));
30548   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30549   return resultobj;
30550 fail:
30551   return NULL;
30552 }
30553 
30554 
_wrap_Band_SetColorTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30555 SWIGINTERN PyObject *_wrap_Band_SetColorTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30556   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30557   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30558   GDALColorTableShadow *arg2 = (GDALColorTableShadow *) 0 ;
30559   void *argp1 = 0 ;
30560   int res1 = 0 ;
30561   void *argp2 = 0 ;
30562   int res2 = 0 ;
30563   PyObject * obj0 = 0 ;
30564   PyObject * obj1 = 0 ;
30565   int result;
30566 
30567   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetColorTable",&obj0,&obj1)) SWIG_fail;
30568   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30569   if (!SWIG_IsOK(res1)) {
30570     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetColorTable" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30571   }
30572   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30573   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
30574   if (!SWIG_IsOK(res2)) {
30575     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetColorTable" "', argument " "2"" of type '" "GDALColorTableShadow *""'");
30576   }
30577   arg2 = reinterpret_cast< GDALColorTableShadow * >(argp2);
30578   {
30579     if ( bUseExceptions ) {
30580       ClearErrorState();
30581     }
30582     {
30583       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30584       result = (int)GDALRasterBandShadow_SetColorTable(arg1,arg2);
30585       SWIG_PYTHON_THREAD_END_ALLOW;
30586     }
30587 #ifndef SED_HACKS
30588     if ( bUseExceptions ) {
30589       CPLErr eclass = CPLGetLastErrorType();
30590       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30591         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30592       }
30593     }
30594 #endif
30595   }
30596   resultobj = SWIG_From_int(static_cast< int >(result));
30597   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30598   return resultobj;
30599 fail:
30600   return NULL;
30601 }
30602 
30603 
_wrap_Band_GetDefaultRAT(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30604 SWIGINTERN PyObject *_wrap_Band_GetDefaultRAT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30605   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30606   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30607   void *argp1 = 0 ;
30608   int res1 = 0 ;
30609   PyObject * obj0 = 0 ;
30610   GDALRasterAttributeTableShadow *result = 0 ;
30611 
30612   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetDefaultRAT",&obj0)) SWIG_fail;
30613   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30614   if (!SWIG_IsOK(res1)) {
30615     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetDefaultRAT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30616   }
30617   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30618   {
30619     if ( bUseExceptions ) {
30620       ClearErrorState();
30621     }
30622     {
30623       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30624       result = (GDALRasterAttributeTableShadow *)GDALRasterBandShadow_GetDefaultRAT(arg1);
30625       SWIG_PYTHON_THREAD_END_ALLOW;
30626     }
30627 #ifndef SED_HACKS
30628     if ( bUseExceptions ) {
30629       CPLErr eclass = CPLGetLastErrorType();
30630       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30631         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30632       }
30633     }
30634 #endif
30635   }
30636   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30637   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30638   return resultobj;
30639 fail:
30640   return NULL;
30641 }
30642 
30643 
_wrap_Band_SetDefaultRAT(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30644 SWIGINTERN PyObject *_wrap_Band_SetDefaultRAT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30645   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30646   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30647   GDALRasterAttributeTableShadow *arg2 = (GDALRasterAttributeTableShadow *) 0 ;
30648   void *argp1 = 0 ;
30649   int res1 = 0 ;
30650   void *argp2 = 0 ;
30651   int res2 = 0 ;
30652   PyObject * obj0 = 0 ;
30653   PyObject * obj1 = 0 ;
30654   int result;
30655 
30656   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetDefaultRAT",&obj0,&obj1)) SWIG_fail;
30657   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30658   if (!SWIG_IsOK(res1)) {
30659     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetDefaultRAT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30660   }
30661   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30662   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
30663   if (!SWIG_IsOK(res2)) {
30664     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_SetDefaultRAT" "', argument " "2"" of type '" "GDALRasterAttributeTableShadow *""'");
30665   }
30666   arg2 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp2);
30667   {
30668     if ( bUseExceptions ) {
30669       ClearErrorState();
30670     }
30671     {
30672       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30673       result = (int)GDALRasterBandShadow_SetDefaultRAT(arg1,arg2);
30674       SWIG_PYTHON_THREAD_END_ALLOW;
30675     }
30676 #ifndef SED_HACKS
30677     if ( bUseExceptions ) {
30678       CPLErr eclass = CPLGetLastErrorType();
30679       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30680         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30681       }
30682     }
30683 #endif
30684   }
30685   resultobj = SWIG_From_int(static_cast< int >(result));
30686   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30687   return resultobj;
30688 fail:
30689   return NULL;
30690 }
30691 
30692 
_wrap_Band_GetMaskBand(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30693 SWIGINTERN PyObject *_wrap_Band_GetMaskBand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30694   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30695   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30696   void *argp1 = 0 ;
30697   int res1 = 0 ;
30698   PyObject * obj0 = 0 ;
30699   GDALRasterBandShadow *result = 0 ;
30700 
30701   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetMaskBand",&obj0)) SWIG_fail;
30702   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30703   if (!SWIG_IsOK(res1)) {
30704     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetMaskBand" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30705   }
30706   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30707   {
30708     if ( bUseExceptions ) {
30709       ClearErrorState();
30710     }
30711     {
30712       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30713       result = (GDALRasterBandShadow *)GDALRasterBandShadow_GetMaskBand(arg1);
30714       SWIG_PYTHON_THREAD_END_ALLOW;
30715     }
30716 #ifndef SED_HACKS
30717     if ( bUseExceptions ) {
30718       CPLErr eclass = CPLGetLastErrorType();
30719       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30720         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30721       }
30722     }
30723 #endif
30724   }
30725   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30726   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30727   return resultobj;
30728 fail:
30729   return NULL;
30730 }
30731 
30732 
_wrap_Band_GetMaskFlags(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30733 SWIGINTERN PyObject *_wrap_Band_GetMaskFlags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30734   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30735   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30736   void *argp1 = 0 ;
30737   int res1 = 0 ;
30738   PyObject * obj0 = 0 ;
30739   int result;
30740 
30741   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetMaskFlags",&obj0)) SWIG_fail;
30742   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30743   if (!SWIG_IsOK(res1)) {
30744     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetMaskFlags" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30745   }
30746   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30747   {
30748     if ( bUseExceptions ) {
30749       ClearErrorState();
30750     }
30751     {
30752       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30753       result = (int)GDALRasterBandShadow_GetMaskFlags(arg1);
30754       SWIG_PYTHON_THREAD_END_ALLOW;
30755     }
30756 #ifndef SED_HACKS
30757     if ( bUseExceptions ) {
30758       CPLErr eclass = CPLGetLastErrorType();
30759       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30760         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30761       }
30762     }
30763 #endif
30764   }
30765   resultobj = SWIG_From_int(static_cast< int >(result));
30766   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30767   return resultobj;
30768 fail:
30769   return NULL;
30770 }
30771 
30772 
_wrap_Band_CreateMaskBand(PyObject * SWIGUNUSEDPARM (self),PyObject * args)30773 SWIGINTERN PyObject *_wrap_Band_CreateMaskBand(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
30774   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30775   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30776   int arg2 ;
30777   void *argp1 = 0 ;
30778   int res1 = 0 ;
30779   int val2 ;
30780   int ecode2 = 0 ;
30781   PyObject * obj0 = 0 ;
30782   PyObject * obj1 = 0 ;
30783   CPLErr result;
30784 
30785   if (!PyArg_ParseTuple(args,(char *)"OO:Band_CreateMaskBand",&obj0,&obj1)) SWIG_fail;
30786   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30787   if (!SWIG_IsOK(res1)) {
30788     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_CreateMaskBand" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30789   }
30790   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30791   ecode2 = SWIG_AsVal_int(obj1, &val2);
30792   if (!SWIG_IsOK(ecode2)) {
30793     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_CreateMaskBand" "', argument " "2"" of type '" "int""'");
30794   }
30795   arg2 = static_cast< int >(val2);
30796   {
30797     if ( bUseExceptions ) {
30798       ClearErrorState();
30799     }
30800     {
30801       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30802       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_CreateMaskBand(arg1,arg2));
30803       SWIG_PYTHON_THREAD_END_ALLOW;
30804     }
30805 #ifndef SED_HACKS
30806     if ( bUseExceptions ) {
30807       CPLErr eclass = CPLGetLastErrorType();
30808       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30809         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30810       }
30811     }
30812 #endif
30813   }
30814   resultobj = SWIG_From_int(static_cast< int >(result));
30815   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
30816   return resultobj;
30817 fail:
30818   return NULL;
30819 }
30820 
30821 
_wrap_Band_GetHistogram(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)30822 SWIGINTERN PyObject *_wrap_Band_GetHistogram(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
30823   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
30824   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
30825   double arg2 = (double) -0.5 ;
30826   double arg3 = (double) 255.5 ;
30827   int arg4 = (int) 256 ;
30828   GUIntBig *arg5 = (GUIntBig *) NULL ;
30829   int arg6 = (int) 0 ;
30830   int arg7 = (int) 1 ;
30831   GDALProgressFunc arg8 = (GDALProgressFunc) NULL ;
30832   void *arg9 = (void *) NULL ;
30833   void *argp1 = 0 ;
30834   int res1 = 0 ;
30835   double val2 ;
30836   int ecode2 = 0 ;
30837   double val3 ;
30838   int ecode3 = 0 ;
30839   int val6 ;
30840   int ecode6 = 0 ;
30841   int val7 ;
30842   int ecode7 = 0 ;
30843   PyObject * obj0 = 0 ;
30844   PyObject * obj1 = 0 ;
30845   PyObject * obj2 = 0 ;
30846   PyObject * obj3 = 0 ;
30847   PyObject * obj4 = 0 ;
30848   PyObject * obj5 = 0 ;
30849   PyObject * obj6 = 0 ;
30850   PyObject * obj7 = 0 ;
30851   char *  kwnames[] = {
30852     (char *) "self",(char *) "min",(char *) "max",(char *) "buckets",(char *) "include_out_of_range",(char *) "approx_ok",(char *) "callback",(char *) "callback_data", NULL
30853   };
30854   CPLErr result;
30855 
30856   {
30857     /* %typemap(in) int buckets, GUIntBig* panHistogram -> list */
30858     arg5 = (GUIntBig *) VSICalloc(sizeof(GUIntBig),arg4);
30859   }
30860   /* %typemap(arginit) ( const char* callback_data=NULL)  */
30861   PyProgressData *psProgressInfo;
30862   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
30863   psProgressInfo->nLastReported = -1;
30864   psProgressInfo->psPyCallback = NULL;
30865   psProgressInfo->psPyCallbackData = NULL;
30866   arg9 = psProgressInfo;
30867   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOOOOO:Band_GetHistogram",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
30868   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
30869   if (!SWIG_IsOK(res1)) {
30870     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetHistogram" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
30871   }
30872   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
30873   if (obj1) {
30874     ecode2 = SWIG_AsVal_double(obj1, &val2);
30875     if (!SWIG_IsOK(ecode2)) {
30876       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetHistogram" "', argument " "2"" of type '" "double""'");
30877     }
30878     arg2 = static_cast< double >(val2);
30879   }
30880   if (obj2) {
30881     ecode3 = SWIG_AsVal_double(obj2, &val3);
30882     if (!SWIG_IsOK(ecode3)) {
30883       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_GetHistogram" "', argument " "3"" of type '" "double""'");
30884     }
30885     arg3 = static_cast< double >(val3);
30886   }
30887   if (obj3) {
30888     {
30889       /* %typemap(in) int buckets, GUIntBig* panHistogram -> list */
30890       int requested_buckets = 0;
30891       CPL_IGNORE_RET_VAL(SWIG_AsVal_int(obj3, &requested_buckets));
30892       if( requested_buckets != arg4 )
30893       {
30894         arg4 = requested_buckets;
30895         if (requested_buckets <= 0 || requested_buckets > (int)(INT_MAX / sizeof(GUIntBig)))
30896         {
30897           PyErr_SetString( PyExc_RuntimeError, "Bad value for buckets" );
30898           SWIG_fail;
30899         }
30900         arg5 = (GUIntBig *) VSIRealloc(arg5, sizeof(GUIntBig) * requested_buckets);
30901       }
30902       if (arg5 == NULL)
30903       {
30904         PyErr_SetString( PyExc_RuntimeError, "Cannot allocate buckets" );
30905         SWIG_fail;
30906       }
30907     }
30908   }
30909   if (obj4) {
30910     ecode6 = SWIG_AsVal_int(obj4, &val6);
30911     if (!SWIG_IsOK(ecode6)) {
30912       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Band_GetHistogram" "', argument " "6"" of type '" "int""'");
30913     }
30914     arg6 = static_cast< int >(val6);
30915   }
30916   if (obj5) {
30917     ecode7 = SWIG_AsVal_int(obj5, &val7);
30918     if (!SWIG_IsOK(ecode7)) {
30919       SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Band_GetHistogram" "', argument " "7"" of type '" "int""'");
30920     }
30921     arg7 = static_cast< int >(val7);
30922   }
30923   if (obj6) {
30924     {
30925       /* %typemap(in) (GDALProgressFunc callback = NULL) */
30926       /* callback_func typemap */
30927 
30928       /* In some cases 0 is passed instead of None. */
30929       /* See https://github.com/OSGeo/gdal/pull/219 */
30930       if ( PyLong_Check(obj6) || PyInt_Check(obj6) )
30931       {
30932         if( PyLong_AsLong(obj6) == 0 )
30933         {
30934           obj6 = Py_None;
30935         }
30936       }
30937 
30938       if (obj6 && obj6 != Py_None ) {
30939         void* cbfunction = NULL;
30940         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj6,
30941             (void**)&cbfunction,
30942             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
30943             SWIG_POINTER_EXCEPTION | 0 ));
30944 
30945         if ( cbfunction == GDALTermProgress ) {
30946           arg8 = GDALTermProgress;
30947         } else {
30948           if (!PyCallable_Check(obj6)) {
30949             PyErr_SetString( PyExc_RuntimeError,
30950               "Object given is not a Python function" );
30951             SWIG_fail;
30952           }
30953           psProgressInfo->psPyCallback = obj6;
30954           arg8 = PyProgressProxy;
30955         }
30956 
30957       }
30958 
30959     }
30960   }
30961   if (obj7) {
30962     {
30963       /* %typemap(in) ( void* callback_data=NULL)  */
30964       psProgressInfo->psPyCallbackData = obj7 ;
30965     }
30966   }
30967   {
30968     if ( bUseExceptions ) {
30969       ClearErrorState();
30970     }
30971     {
30972       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30973       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_GetHistogram(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9));
30974       SWIG_PYTHON_THREAD_END_ALLOW;
30975     }
30976 #ifndef SED_HACKS
30977     if ( bUseExceptions ) {
30978       CPLErr eclass = CPLGetLastErrorType();
30979       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
30980         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
30981       }
30982     }
30983 #endif
30984   }
30985   resultobj = SWIG_From_int(static_cast< int >(result));
30986   {
30987     /* %typemap(out) int buckets, GUIntBig* panHistogram -> list */
30988     GUIntBig *integerarray = arg5;
30989     Py_DECREF( resultobj );
30990     if ( integerarray == NULL ) {
30991       resultobj = Py_None;
30992       Py_INCREF( resultobj );
30993     }
30994     else {
30995       resultobj = PyList_New( arg4 );
30996       for ( int i = 0; i < arg4; ++i ) {
30997         char szTmp[32];
30998         sprintf(szTmp, CPL_FRMT_GUIB, integerarray[i]);
30999         PyObject *o = PyLong_FromString(szTmp, NULL, 10);
31000         PyList_SetItem(resultobj, i, o );
31001       }
31002     }
31003   }
31004   {
31005     /* %typemap(freearg) (int buckets, GUIntBig* panHistogram)*/
31006     if ( arg5 ) {
31007       VSIFree( arg5 );
31008     }
31009   }
31010   {
31011     /* %typemap(freearg) ( void* callback_data=NULL)  */
31012 
31013     CPLFree(psProgressInfo);
31014 
31015   }
31016   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31017   return resultobj;
31018 fail:
31019   {
31020     /* %typemap(freearg) (int buckets, GUIntBig* panHistogram)*/
31021     if ( arg5 ) {
31022       VSIFree( arg5 );
31023     }
31024   }
31025   {
31026     /* %typemap(freearg) ( void* callback_data=NULL)  */
31027 
31028     CPLFree(psProgressInfo);
31029 
31030   }
31031   return NULL;
31032 }
31033 
31034 
_wrap_Band_GetDefaultHistogram(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)31035 SWIGINTERN PyObject *_wrap_Band_GetDefaultHistogram(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
31036   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31037   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31038   double *arg2 = (double *) NULL ;
31039   double *arg3 = (double *) NULL ;
31040   int *arg4 = (int *) NULL ;
31041   GUIntBig **arg5 = (GUIntBig **) NULL ;
31042   int arg6 = (int) 1 ;
31043   GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
31044   void *arg8 = (void *) NULL ;
31045   void *argp1 = 0 ;
31046   int res1 = 0 ;
31047   void *argp2 = 0 ;
31048   int res2 = 0 ;
31049   void *argp3 = 0 ;
31050   int res3 = 0 ;
31051   void *argp4 = 0 ;
31052   int res4 = 0 ;
31053   void *argp5 = 0 ;
31054   int res5 = 0 ;
31055   int val6 ;
31056   int ecode6 = 0 ;
31057   PyObject * obj0 = 0 ;
31058   PyObject * obj1 = 0 ;
31059   PyObject * obj2 = 0 ;
31060   PyObject * obj3 = 0 ;
31061   PyObject * obj4 = 0 ;
31062   PyObject * obj5 = 0 ;
31063   PyObject * obj6 = 0 ;
31064   PyObject * obj7 = 0 ;
31065   char *  kwnames[] = {
31066     (char *) "self",(char *) "min_ret",(char *) "max_ret",(char *) "buckets_ret",(char *) "ppanHistogram",(char *) "force",(char *) "callback",(char *) "callback_data", NULL
31067   };
31068   CPLErr result;
31069 
31070   double min_val = 0.0, max_val = 0.0;
31071   int buckets_val = 0;
31072   GUIntBig *panHistogram = NULL;
31073 
31074   arg2 = &min_val;
31075   arg3 = &max_val;
31076   arg4 = &buckets_val;
31077   arg5 = &panHistogram;
31078   /* %typemap(arginit) ( const char* callback_data=NULL)  */
31079   PyProgressData *psProgressInfo;
31080   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
31081   psProgressInfo->nLastReported = -1;
31082   psProgressInfo->psPyCallback = NULL;
31083   psProgressInfo->psPyCallbackData = NULL;
31084   arg8 = psProgressInfo;
31085   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOOOOO:Band_GetDefaultHistogram",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
31086   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31087   if (!SWIG_IsOK(res1)) {
31088     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetDefaultHistogram" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31089   }
31090   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31091   if (obj1) {
31092     res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
31093     if (!SWIG_IsOK(res2)) {
31094       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Band_GetDefaultHistogram" "', argument " "2"" of type '" "double *""'");
31095     }
31096     arg2 = reinterpret_cast< double * >(argp2);
31097   }
31098   if (obj2) {
31099     res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
31100     if (!SWIG_IsOK(res3)) {
31101       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Band_GetDefaultHistogram" "', argument " "3"" of type '" "double *""'");
31102     }
31103     arg3 = reinterpret_cast< double * >(argp3);
31104   }
31105   if (obj3) {
31106     res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 |  0 );
31107     if (!SWIG_IsOK(res4)) {
31108       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Band_GetDefaultHistogram" "', argument " "4"" of type '" "int *""'");
31109     }
31110     arg4 = reinterpret_cast< int * >(argp4);
31111   }
31112   if (obj4) {
31113     res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_p_GUIntBig, 0 |  0 );
31114     if (!SWIG_IsOK(res5)) {
31115       SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Band_GetDefaultHistogram" "', argument " "5"" of type '" "GUIntBig **""'");
31116     }
31117     arg5 = reinterpret_cast< GUIntBig ** >(argp5);
31118   }
31119   if (obj5) {
31120     ecode6 = SWIG_AsVal_int(obj5, &val6);
31121     if (!SWIG_IsOK(ecode6)) {
31122       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Band_GetDefaultHistogram" "', argument " "6"" of type '" "int""'");
31123     }
31124     arg6 = static_cast< int >(val6);
31125   }
31126   if (obj6) {
31127     {
31128       /* %typemap(in) (GDALProgressFunc callback = NULL) */
31129       /* callback_func typemap */
31130 
31131       /* In some cases 0 is passed instead of None. */
31132       /* See https://github.com/OSGeo/gdal/pull/219 */
31133       if ( PyLong_Check(obj6) || PyInt_Check(obj6) )
31134       {
31135         if( PyLong_AsLong(obj6) == 0 )
31136         {
31137           obj6 = Py_None;
31138         }
31139       }
31140 
31141       if (obj6 && obj6 != Py_None ) {
31142         void* cbfunction = NULL;
31143         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj6,
31144             (void**)&cbfunction,
31145             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
31146             SWIG_POINTER_EXCEPTION | 0 ));
31147 
31148         if ( cbfunction == GDALTermProgress ) {
31149           arg7 = GDALTermProgress;
31150         } else {
31151           if (!PyCallable_Check(obj6)) {
31152             PyErr_SetString( PyExc_RuntimeError,
31153               "Object given is not a Python function" );
31154             SWIG_fail;
31155           }
31156           psProgressInfo->psPyCallback = obj6;
31157           arg7 = PyProgressProxy;
31158         }
31159 
31160       }
31161 
31162     }
31163   }
31164   if (obj7) {
31165     {
31166       /* %typemap(in) ( void* callback_data=NULL)  */
31167       psProgressInfo->psPyCallbackData = obj7 ;
31168     }
31169   }
31170   {
31171     if ( bUseExceptions ) {
31172       ClearErrorState();
31173     }
31174     {
31175       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31176       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_GetDefaultHistogram(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8));
31177       SWIG_PYTHON_THREAD_END_ALLOW;
31178     }
31179 #ifndef SED_HACKS
31180     if ( bUseExceptions ) {
31181       CPLErr eclass = CPLGetLastErrorType();
31182       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31183         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31184       }
31185     }
31186 #endif
31187   }
31188   resultobj = SWIG_From_int(static_cast< int >(result));
31189   {
31190     int i;
31191     PyObject *psList = NULL;
31192 
31193     Py_XDECREF(resultobj);
31194 
31195     if (panHistogram)
31196     {
31197       psList = PyList_New(buckets_val);
31198       for( i = 0; i < buckets_val; i++ )
31199       PyList_SetItem(psList, i, Py_BuildValue("K", panHistogram[i] ));
31200 
31201       CPLFree( panHistogram );
31202 
31203       resultobj = Py_BuildValue( "(ddiO)", min_val, max_val, buckets_val, psList );
31204       Py_XDECREF(psList);
31205     }
31206     else
31207     {
31208       resultobj = Py_None;
31209       Py_INCREF(resultobj);
31210     }
31211   }
31212   {
31213     /* %typemap(freearg) ( void* callback_data=NULL)  */
31214 
31215     CPLFree(psProgressInfo);
31216 
31217   }
31218   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31219   return resultobj;
31220 fail:
31221   {
31222     /* %typemap(freearg) ( void* callback_data=NULL)  */
31223 
31224     CPLFree(psProgressInfo);
31225 
31226   }
31227   return NULL;
31228 }
31229 
31230 
_wrap_Band_SetDefaultHistogram(PyObject * SWIGUNUSEDPARM (self),PyObject * args)31231 SWIGINTERN PyObject *_wrap_Band_SetDefaultHistogram(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
31232   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31233   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31234   double arg2 ;
31235   double arg3 ;
31236   int arg4 ;
31237   GUIntBig *arg5 = (GUIntBig *) 0 ;
31238   void *argp1 = 0 ;
31239   int res1 = 0 ;
31240   double val2 ;
31241   int ecode2 = 0 ;
31242   double val3 ;
31243   int ecode3 = 0 ;
31244   PyObject * obj0 = 0 ;
31245   PyObject * obj1 = 0 ;
31246   PyObject * obj2 = 0 ;
31247   PyObject * obj3 = 0 ;
31248   CPLErr result;
31249 
31250   if (!PyArg_ParseTuple(args,(char *)"OOOO:Band_SetDefaultHistogram",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
31251   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31252   if (!SWIG_IsOK(res1)) {
31253     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetDefaultHistogram" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31254   }
31255   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31256   ecode2 = SWIG_AsVal_double(obj1, &val2);
31257   if (!SWIG_IsOK(ecode2)) {
31258     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_SetDefaultHistogram" "', argument " "2"" of type '" "double""'");
31259   }
31260   arg2 = static_cast< double >(val2);
31261   ecode3 = SWIG_AsVal_double(obj2, &val3);
31262   if (!SWIG_IsOK(ecode3)) {
31263     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_SetDefaultHistogram" "', argument " "3"" of type '" "double""'");
31264   }
31265   arg3 = static_cast< double >(val3);
31266   {
31267     /* %typemap(in,numinputs=1) (int nList, GUIntBig* pList)*/
31268     /* check if is List */
31269     if ( !PySequence_Check(obj3) ) {
31270       PyErr_SetString(PyExc_TypeError, "not a sequence");
31271       SWIG_fail;
31272     }
31273     Py_ssize_t size = PySequence_Size(obj3);
31274     if( size != (int)size ) {
31275       PyErr_SetString(PyExc_TypeError, "too big sequence");
31276       SWIG_fail;
31277     }
31278     arg4 = (int)size;
31279     arg5 = (GUIntBig*) malloc(arg4*sizeof(GUIntBig));
31280     for( int i = 0; i<arg4; i++ ) {
31281       PyObject *o = PySequence_GetItem(obj3,i);
31282       PY_LONG_LONG val;
31283       if ( !PyArg_Parse(o,"K",&val) ) {
31284         PyErr_SetString(PyExc_TypeError, "not an integer");
31285         Py_DECREF(o);
31286         SWIG_fail;
31287       }
31288       arg5[i] = (GUIntBig)val;
31289       Py_DECREF(o);
31290     }
31291   }
31292   {
31293     if ( bUseExceptions ) {
31294       ClearErrorState();
31295     }
31296     {
31297       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31298       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetDefaultHistogram(arg1,arg2,arg3,arg4,arg5));
31299       SWIG_PYTHON_THREAD_END_ALLOW;
31300     }
31301 #ifndef SED_HACKS
31302     if ( bUseExceptions ) {
31303       CPLErr eclass = CPLGetLastErrorType();
31304       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31305         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31306       }
31307     }
31308 #endif
31309   }
31310   resultobj = SWIG_From_int(static_cast< int >(result));
31311   {
31312     /* %typemap(freearg) (int nList, GUIntBig* pList) */
31313     if (arg5) {
31314       free((void*) arg5);
31315     }
31316   }
31317   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31318   return resultobj;
31319 fail:
31320   {
31321     /* %typemap(freearg) (int nList, GUIntBig* pList) */
31322     if (arg5) {
31323       free((void*) arg5);
31324     }
31325   }
31326   return NULL;
31327 }
31328 
31329 
_wrap_Band_HasArbitraryOverviews(PyObject * SWIGUNUSEDPARM (self),PyObject * args)31330 SWIGINTERN PyObject *_wrap_Band_HasArbitraryOverviews(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
31331   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31332   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31333   void *argp1 = 0 ;
31334   int res1 = 0 ;
31335   PyObject * obj0 = 0 ;
31336   bool result;
31337 
31338   if (!PyArg_ParseTuple(args,(char *)"O:Band_HasArbitraryOverviews",&obj0)) SWIG_fail;
31339   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31340   if (!SWIG_IsOK(res1)) {
31341     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_HasArbitraryOverviews" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31342   }
31343   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31344   {
31345     if ( bUseExceptions ) {
31346       ClearErrorState();
31347     }
31348     {
31349       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31350       result = (bool)GDALRasterBandShadow_HasArbitraryOverviews(arg1);
31351       SWIG_PYTHON_THREAD_END_ALLOW;
31352     }
31353 #ifndef SED_HACKS
31354     if ( bUseExceptions ) {
31355       CPLErr eclass = CPLGetLastErrorType();
31356       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31357         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31358       }
31359     }
31360 #endif
31361   }
31362   resultobj = SWIG_From_bool(static_cast< bool >(result));
31363   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31364   return resultobj;
31365 fail:
31366   return NULL;
31367 }
31368 
31369 
_wrap_Band_GetCategoryNames(PyObject * SWIGUNUSEDPARM (self),PyObject * args)31370 SWIGINTERN PyObject *_wrap_Band_GetCategoryNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
31371   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31372   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31373   void *argp1 = 0 ;
31374   int res1 = 0 ;
31375   PyObject * obj0 = 0 ;
31376   char **result = 0 ;
31377 
31378   if (!PyArg_ParseTuple(args,(char *)"O:Band_GetCategoryNames",&obj0)) SWIG_fail;
31379   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31380   if (!SWIG_IsOK(res1)) {
31381     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31382   }
31383   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31384   {
31385     if ( bUseExceptions ) {
31386       ClearErrorState();
31387     }
31388     {
31389       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31390       result = (char **)GDALRasterBandShadow_GetCategoryNames(arg1);
31391       SWIG_PYTHON_THREAD_END_ALLOW;
31392     }
31393 #ifndef SED_HACKS
31394     if ( bUseExceptions ) {
31395       CPLErr eclass = CPLGetLastErrorType();
31396       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31397         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31398       }
31399     }
31400 #endif
31401   }
31402   {
31403     /* %typemap(out) char **options -> ( string ) */
31404     char **stringarray = result;
31405     if ( stringarray == NULL ) {
31406       resultobj = Py_None;
31407       Py_INCREF( resultobj );
31408     }
31409     else {
31410       int len = CSLCount( stringarray );
31411       resultobj = PyList_New( len );
31412       for ( int i = 0; i < len; ++i ) {
31413         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
31414         PyList_SetItem(resultobj, i, o );
31415       }
31416     }
31417   }
31418   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31419   return resultobj;
31420 fail:
31421   return NULL;
31422 }
31423 
31424 
_wrap_Band_SetCategoryNames(PyObject * SWIGUNUSEDPARM (self),PyObject * args)31425 SWIGINTERN PyObject *_wrap_Band_SetCategoryNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
31426   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31427   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31428   char **arg2 = (char **) 0 ;
31429   void *argp1 = 0 ;
31430   int res1 = 0 ;
31431   PyObject * obj0 = 0 ;
31432   PyObject * obj1 = 0 ;
31433   CPLErr result;
31434 
31435   if (!PyArg_ParseTuple(args,(char *)"OO:Band_SetCategoryNames",&obj0,&obj1)) SWIG_fail;
31436   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31437   if (!SWIG_IsOK(res1)) {
31438     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_SetCategoryNames" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31439   }
31440   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31441   {
31442     /* %typemap(in) char **options */
31443     int bErr = FALSE;
31444     arg2 = CSLFromPySequence(obj1, &bErr);
31445     if( bErr )
31446     {
31447       SWIG_fail;
31448     }
31449   }
31450   {
31451     if ( bUseExceptions ) {
31452       ClearErrorState();
31453     }
31454     {
31455       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31456       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_SetCategoryNames(arg1,arg2));
31457       SWIG_PYTHON_THREAD_END_ALLOW;
31458     }
31459 #ifndef SED_HACKS
31460     if ( bUseExceptions ) {
31461       CPLErr eclass = CPLGetLastErrorType();
31462       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31463         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31464       }
31465     }
31466 #endif
31467   }
31468   resultobj = SWIG_From_int(static_cast< int >(result));
31469   {
31470     /* %typemap(freearg) char **options */
31471     CSLDestroy( arg2 );
31472   }
31473   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31474   return resultobj;
31475 fail:
31476   {
31477     /* %typemap(freearg) char **options */
31478     CSLDestroy( arg2 );
31479   }
31480   return NULL;
31481 }
31482 
31483 
_wrap_Band_GetVirtualMem(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)31484 SWIGINTERN PyObject *_wrap_Band_GetVirtualMem(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
31485   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31486   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31487   GDALRWFlag arg2 ;
31488   int arg3 ;
31489   int arg4 ;
31490   int arg5 ;
31491   int arg6 ;
31492   int arg7 ;
31493   int arg8 ;
31494   GDALDataType arg9 ;
31495   size_t arg10 ;
31496   size_t arg11 ;
31497   char **arg12 = (char **) NULL ;
31498   void *argp1 = 0 ;
31499   int res1 = 0 ;
31500   int val2 ;
31501   int ecode2 = 0 ;
31502   int val3 ;
31503   int ecode3 = 0 ;
31504   int val4 ;
31505   int ecode4 = 0 ;
31506   int val5 ;
31507   int ecode5 = 0 ;
31508   int val6 ;
31509   int ecode6 = 0 ;
31510   int val7 ;
31511   int ecode7 = 0 ;
31512   int val8 ;
31513   int ecode8 = 0 ;
31514   size_t val10 ;
31515   int ecode10 = 0 ;
31516   size_t val11 ;
31517   int ecode11 = 0 ;
31518   PyObject * obj0 = 0 ;
31519   PyObject * obj1 = 0 ;
31520   PyObject * obj2 = 0 ;
31521   PyObject * obj3 = 0 ;
31522   PyObject * obj4 = 0 ;
31523   PyObject * obj5 = 0 ;
31524   PyObject * obj6 = 0 ;
31525   PyObject * obj7 = 0 ;
31526   PyObject * obj8 = 0 ;
31527   PyObject * obj9 = 0 ;
31528   PyObject * obj10 = 0 ;
31529   PyObject * obj11 = 0 ;
31530   char *  kwnames[] = {
31531     (char *) "self",(char *) "eRWFlag",(char *) "nXOff",(char *) "nYOff",(char *) "nXSize",(char *) "nYSize",(char *) "nBufXSize",(char *) "nBufYSize",(char *) "eBufType",(char *) "nCacheSize",(char *) "nPageSizeHint",(char *) "options", NULL
31532   };
31533   CPLVirtualMemShadow *result = 0 ;
31534 
31535   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOOOOOOO|O:Band_GetVirtualMem",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11)) SWIG_fail;
31536   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31537   if (!SWIG_IsOK(res1)) {
31538     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetVirtualMem" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31539   }
31540   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31541   ecode2 = SWIG_AsVal_int(obj1, &val2);
31542   if (!SWIG_IsOK(ecode2)) {
31543     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetVirtualMem" "', argument " "2"" of type '" "GDALRWFlag""'");
31544   }
31545   arg2 = static_cast< GDALRWFlag >(val2);
31546   ecode3 = SWIG_AsVal_int(obj2, &val3);
31547   if (!SWIG_IsOK(ecode3)) {
31548     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_GetVirtualMem" "', argument " "3"" of type '" "int""'");
31549   }
31550   arg3 = static_cast< int >(val3);
31551   ecode4 = SWIG_AsVal_int(obj3, &val4);
31552   if (!SWIG_IsOK(ecode4)) {
31553     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_GetVirtualMem" "', argument " "4"" of type '" "int""'");
31554   }
31555   arg4 = static_cast< int >(val4);
31556   ecode5 = SWIG_AsVal_int(obj4, &val5);
31557   if (!SWIG_IsOK(ecode5)) {
31558     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_GetVirtualMem" "', argument " "5"" of type '" "int""'");
31559   }
31560   arg5 = static_cast< int >(val5);
31561   ecode6 = SWIG_AsVal_int(obj5, &val6);
31562   if (!SWIG_IsOK(ecode6)) {
31563     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Band_GetVirtualMem" "', argument " "6"" of type '" "int""'");
31564   }
31565   arg6 = static_cast< int >(val6);
31566   ecode7 = SWIG_AsVal_int(obj6, &val7);
31567   if (!SWIG_IsOK(ecode7)) {
31568     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Band_GetVirtualMem" "', argument " "7"" of type '" "int""'");
31569   }
31570   arg7 = static_cast< int >(val7);
31571   ecode8 = SWIG_AsVal_int(obj7, &val8);
31572   if (!SWIG_IsOK(ecode8)) {
31573     SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Band_GetVirtualMem" "', argument " "8"" of type '" "int""'");
31574   }
31575   arg8 = static_cast< int >(val8);
31576   {
31577     // %typemap(in) GDALDataType
31578     int val = 0;
31579     int ecode = SWIG_AsVal_int(obj8, &val);
31580     if (!SWIG_IsOK(ecode)) {
31581       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
31582     }
31583     if( val < GDT_Unknown || val >= GDT_TypeCount )
31584     {
31585       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
31586     }
31587     arg9 = static_cast<GDALDataType>(val);
31588   }
31589   ecode10 = SWIG_AsVal_size_t(obj9, &val10);
31590   if (!SWIG_IsOK(ecode10)) {
31591     SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Band_GetVirtualMem" "', argument " "10"" of type '" "size_t""'");
31592   }
31593   arg10 = static_cast< size_t >(val10);
31594   ecode11 = SWIG_AsVal_size_t(obj10, &val11);
31595   if (!SWIG_IsOK(ecode11)) {
31596     SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "Band_GetVirtualMem" "', argument " "11"" of type '" "size_t""'");
31597   }
31598   arg11 = static_cast< size_t >(val11);
31599   if (obj11) {
31600     {
31601       /* %typemap(in) char **options */
31602       int bErr = FALSE;
31603       arg12 = CSLFromPySequence(obj11, &bErr);
31604       if( bErr )
31605       {
31606         SWIG_fail;
31607       }
31608     }
31609   }
31610   {
31611     if ( bUseExceptions ) {
31612       ClearErrorState();
31613     }
31614     {
31615       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31616       result = (CPLVirtualMemShadow *)GDALRasterBandShadow_GetVirtualMem(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
31617       SWIG_PYTHON_THREAD_END_ALLOW;
31618     }
31619 #ifndef SED_HACKS
31620     if ( bUseExceptions ) {
31621       CPLErr eclass = CPLGetLastErrorType();
31622       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31623         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31624       }
31625     }
31626 #endif
31627   }
31628   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CPLVirtualMemShadow, SWIG_POINTER_OWN |  0 );
31629   {
31630     /* %typemap(freearg) char **options */
31631     CSLDestroy( arg12 );
31632   }
31633   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31634   return resultobj;
31635 fail:
31636   {
31637     /* %typemap(freearg) char **options */
31638     CSLDestroy( arg12 );
31639   }
31640   return NULL;
31641 }
31642 
31643 
_wrap_Band_GetVirtualMemAuto(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)31644 SWIGINTERN PyObject *_wrap_Band_GetVirtualMemAuto(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
31645   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31646   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31647   GDALRWFlag arg2 ;
31648   char **arg3 = (char **) NULL ;
31649   void *argp1 = 0 ;
31650   int res1 = 0 ;
31651   int val2 ;
31652   int ecode2 = 0 ;
31653   PyObject * obj0 = 0 ;
31654   PyObject * obj1 = 0 ;
31655   PyObject * obj2 = 0 ;
31656   char *  kwnames[] = {
31657     (char *) "self",(char *) "eRWFlag",(char *) "options", NULL
31658   };
31659   CPLVirtualMemShadow *result = 0 ;
31660 
31661   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|O:Band_GetVirtualMemAuto",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
31662   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31663   if (!SWIG_IsOK(res1)) {
31664     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetVirtualMemAuto" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31665   }
31666   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31667   ecode2 = SWIG_AsVal_int(obj1, &val2);
31668   if (!SWIG_IsOK(ecode2)) {
31669     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetVirtualMemAuto" "', argument " "2"" of type '" "GDALRWFlag""'");
31670   }
31671   arg2 = static_cast< GDALRWFlag >(val2);
31672   if (obj2) {
31673     {
31674       /* %typemap(in) char **options */
31675       int bErr = FALSE;
31676       arg3 = CSLFromPySequence(obj2, &bErr);
31677       if( bErr )
31678       {
31679         SWIG_fail;
31680       }
31681     }
31682   }
31683   {
31684     if ( bUseExceptions ) {
31685       ClearErrorState();
31686     }
31687     {
31688       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31689       result = (CPLVirtualMemShadow *)GDALRasterBandShadow_GetVirtualMemAuto(arg1,arg2,arg3);
31690       SWIG_PYTHON_THREAD_END_ALLOW;
31691     }
31692 #ifndef SED_HACKS
31693     if ( bUseExceptions ) {
31694       CPLErr eclass = CPLGetLastErrorType();
31695       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31696         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31697       }
31698     }
31699 #endif
31700   }
31701   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CPLVirtualMemShadow, SWIG_POINTER_OWN |  0 );
31702   {
31703     /* %typemap(freearg) char **options */
31704     CSLDestroy( arg3 );
31705   }
31706   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31707   return resultobj;
31708 fail:
31709   {
31710     /* %typemap(freearg) char **options */
31711     CSLDestroy( arg3 );
31712   }
31713   return NULL;
31714 }
31715 
31716 
_wrap_Band_GetTiledVirtualMem(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)31717 SWIGINTERN PyObject *_wrap_Band_GetTiledVirtualMem(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
31718   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31719   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31720   GDALRWFlag arg2 ;
31721   int arg3 ;
31722   int arg4 ;
31723   int arg5 ;
31724   int arg6 ;
31725   int arg7 ;
31726   int arg8 ;
31727   GDALDataType arg9 ;
31728   size_t arg10 ;
31729   char **arg11 = (char **) NULL ;
31730   void *argp1 = 0 ;
31731   int res1 = 0 ;
31732   int val2 ;
31733   int ecode2 = 0 ;
31734   int val3 ;
31735   int ecode3 = 0 ;
31736   int val4 ;
31737   int ecode4 = 0 ;
31738   int val5 ;
31739   int ecode5 = 0 ;
31740   int val6 ;
31741   int ecode6 = 0 ;
31742   int val7 ;
31743   int ecode7 = 0 ;
31744   int val8 ;
31745   int ecode8 = 0 ;
31746   size_t val10 ;
31747   int ecode10 = 0 ;
31748   PyObject * obj0 = 0 ;
31749   PyObject * obj1 = 0 ;
31750   PyObject * obj2 = 0 ;
31751   PyObject * obj3 = 0 ;
31752   PyObject * obj4 = 0 ;
31753   PyObject * obj5 = 0 ;
31754   PyObject * obj6 = 0 ;
31755   PyObject * obj7 = 0 ;
31756   PyObject * obj8 = 0 ;
31757   PyObject * obj9 = 0 ;
31758   PyObject * obj10 = 0 ;
31759   char *  kwnames[] = {
31760     (char *) "self",(char *) "eRWFlag",(char *) "nXOff",(char *) "nYOff",(char *) "nXSize",(char *) "nYSize",(char *) "nTileXSize",(char *) "nTileYSize",(char *) "eBufType",(char *) "nCacheSize",(char *) "options", NULL
31761   };
31762   CPLVirtualMemShadow *result = 0 ;
31763 
31764   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOOOOOO|O:Band_GetTiledVirtualMem",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
31765   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31766   if (!SWIG_IsOK(res1)) {
31767     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetTiledVirtualMem" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31768   }
31769   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31770   ecode2 = SWIG_AsVal_int(obj1, &val2);
31771   if (!SWIG_IsOK(ecode2)) {
31772     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetTiledVirtualMem" "', argument " "2"" of type '" "GDALRWFlag""'");
31773   }
31774   arg2 = static_cast< GDALRWFlag >(val2);
31775   ecode3 = SWIG_AsVal_int(obj2, &val3);
31776   if (!SWIG_IsOK(ecode3)) {
31777     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_GetTiledVirtualMem" "', argument " "3"" of type '" "int""'");
31778   }
31779   arg3 = static_cast< int >(val3);
31780   ecode4 = SWIG_AsVal_int(obj3, &val4);
31781   if (!SWIG_IsOK(ecode4)) {
31782     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_GetTiledVirtualMem" "', argument " "4"" of type '" "int""'");
31783   }
31784   arg4 = static_cast< int >(val4);
31785   ecode5 = SWIG_AsVal_int(obj4, &val5);
31786   if (!SWIG_IsOK(ecode5)) {
31787     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_GetTiledVirtualMem" "', argument " "5"" of type '" "int""'");
31788   }
31789   arg5 = static_cast< int >(val5);
31790   ecode6 = SWIG_AsVal_int(obj5, &val6);
31791   if (!SWIG_IsOK(ecode6)) {
31792     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Band_GetTiledVirtualMem" "', argument " "6"" of type '" "int""'");
31793   }
31794   arg6 = static_cast< int >(val6);
31795   ecode7 = SWIG_AsVal_int(obj6, &val7);
31796   if (!SWIG_IsOK(ecode7)) {
31797     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Band_GetTiledVirtualMem" "', argument " "7"" of type '" "int""'");
31798   }
31799   arg7 = static_cast< int >(val7);
31800   ecode8 = SWIG_AsVal_int(obj7, &val8);
31801   if (!SWIG_IsOK(ecode8)) {
31802     SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Band_GetTiledVirtualMem" "', argument " "8"" of type '" "int""'");
31803   }
31804   arg8 = static_cast< int >(val8);
31805   {
31806     // %typemap(in) GDALDataType
31807     int val = 0;
31808     int ecode = SWIG_AsVal_int(obj8, &val);
31809     if (!SWIG_IsOK(ecode)) {
31810       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
31811     }
31812     if( val < GDT_Unknown || val >= GDT_TypeCount )
31813     {
31814       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
31815     }
31816     arg9 = static_cast<GDALDataType>(val);
31817   }
31818   ecode10 = SWIG_AsVal_size_t(obj9, &val10);
31819   if (!SWIG_IsOK(ecode10)) {
31820     SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Band_GetTiledVirtualMem" "', argument " "10"" of type '" "size_t""'");
31821   }
31822   arg10 = static_cast< size_t >(val10);
31823   if (obj10) {
31824     {
31825       /* %typemap(in) char **options */
31826       int bErr = FALSE;
31827       arg11 = CSLFromPySequence(obj10, &bErr);
31828       if( bErr )
31829       {
31830         SWIG_fail;
31831       }
31832     }
31833   }
31834   {
31835     if ( bUseExceptions ) {
31836       ClearErrorState();
31837     }
31838     {
31839       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31840       result = (CPLVirtualMemShadow *)GDALRasterBandShadow_GetTiledVirtualMem(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
31841       SWIG_PYTHON_THREAD_END_ALLOW;
31842     }
31843 #ifndef SED_HACKS
31844     if ( bUseExceptions ) {
31845       CPLErr eclass = CPLGetLastErrorType();
31846       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31847         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31848       }
31849     }
31850 #endif
31851   }
31852   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CPLVirtualMemShadow, SWIG_POINTER_OWN |  0 );
31853   {
31854     /* %typemap(freearg) char **options */
31855     CSLDestroy( arg11 );
31856   }
31857   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31858   return resultobj;
31859 fail:
31860   {
31861     /* %typemap(freearg) char **options */
31862     CSLDestroy( arg11 );
31863   }
31864   return NULL;
31865 }
31866 
31867 
_wrap_Band_GetDataCoverageStatus(PyObject * SWIGUNUSEDPARM (self),PyObject * args)31868 SWIGINTERN PyObject *_wrap_Band_GetDataCoverageStatus(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
31869   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31870   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31871   int arg2 ;
31872   int arg3 ;
31873   int arg4 ;
31874   int arg5 ;
31875   int arg6 = (int) 0 ;
31876   double *arg7 = (double *) NULL ;
31877   void *argp1 = 0 ;
31878   int res1 = 0 ;
31879   int val2 ;
31880   int ecode2 = 0 ;
31881   int val3 ;
31882   int ecode3 = 0 ;
31883   int val4 ;
31884   int ecode4 = 0 ;
31885   int val5 ;
31886   int ecode5 = 0 ;
31887   int val6 ;
31888   int ecode6 = 0 ;
31889   double temp7 ;
31890   int res7 = SWIG_TMPOBJ ;
31891   PyObject * obj0 = 0 ;
31892   PyObject * obj1 = 0 ;
31893   PyObject * obj2 = 0 ;
31894   PyObject * obj3 = 0 ;
31895   PyObject * obj4 = 0 ;
31896   PyObject * obj5 = 0 ;
31897   int result;
31898 
31899   arg7 = &temp7;
31900   if (!PyArg_ParseTuple(args,(char *)"OOOOO|O:Band_GetDataCoverageStatus",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
31901   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
31902   if (!SWIG_IsOK(res1)) {
31903     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_GetDataCoverageStatus" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
31904   }
31905   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
31906   ecode2 = SWIG_AsVal_int(obj1, &val2);
31907   if (!SWIG_IsOK(ecode2)) {
31908     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_GetDataCoverageStatus" "', argument " "2"" of type '" "int""'");
31909   }
31910   arg2 = static_cast< int >(val2);
31911   ecode3 = SWIG_AsVal_int(obj2, &val3);
31912   if (!SWIG_IsOK(ecode3)) {
31913     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_GetDataCoverageStatus" "', argument " "3"" of type '" "int""'");
31914   }
31915   arg3 = static_cast< int >(val3);
31916   ecode4 = SWIG_AsVal_int(obj3, &val4);
31917   if (!SWIG_IsOK(ecode4)) {
31918     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_GetDataCoverageStatus" "', argument " "4"" of type '" "int""'");
31919   }
31920   arg4 = static_cast< int >(val4);
31921   ecode5 = SWIG_AsVal_int(obj4, &val5);
31922   if (!SWIG_IsOK(ecode5)) {
31923     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_GetDataCoverageStatus" "', argument " "5"" of type '" "int""'");
31924   }
31925   arg5 = static_cast< int >(val5);
31926   if (obj5) {
31927     ecode6 = SWIG_AsVal_int(obj5, &val6);
31928     if (!SWIG_IsOK(ecode6)) {
31929       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Band_GetDataCoverageStatus" "', argument " "6"" of type '" "int""'");
31930     }
31931     arg6 = static_cast< int >(val6);
31932   }
31933   {
31934     if ( bUseExceptions ) {
31935       ClearErrorState();
31936     }
31937     {
31938       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
31939       result = (int)GDALRasterBandShadow_GetDataCoverageStatus(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
31940       SWIG_PYTHON_THREAD_END_ALLOW;
31941     }
31942 #ifndef SED_HACKS
31943     if ( bUseExceptions ) {
31944       CPLErr eclass = CPLGetLastErrorType();
31945       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
31946         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
31947       }
31948     }
31949 #endif
31950   }
31951   resultobj = SWIG_From_int(static_cast< int >(result));
31952   if (ReturnSame(SWIG_IsTmpObj(res7))) {
31953     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg7)));
31954   } else {
31955     int new_flags = SWIG_IsNewObj(res7) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
31956     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg7), SWIGTYPE_p_double, new_flags));
31957   }
31958   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
31959   return resultobj;
31960 fail:
31961   return NULL;
31962 }
31963 
31964 
_wrap_Band_AdviseRead(PyObject * SWIGUNUSEDPARM (self),PyObject * args)31965 SWIGINTERN PyObject *_wrap_Band_AdviseRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
31966   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
31967   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
31968   int arg2 ;
31969   int arg3 ;
31970   int arg4 ;
31971   int arg5 ;
31972   int *arg6 = (int *) 0 ;
31973   int *arg7 = (int *) 0 ;
31974   GDALDataType *arg8 = (GDALDataType *) 0 ;
31975   char **arg9 = (char **) NULL ;
31976   void *argp1 = 0 ;
31977   int res1 = 0 ;
31978   int val2 ;
31979   int ecode2 = 0 ;
31980   int val3 ;
31981   int ecode3 = 0 ;
31982   int val4 ;
31983   int ecode4 = 0 ;
31984   int val5 ;
31985   int ecode5 = 0 ;
31986   void *argp6 = 0 ;
31987   int res6 = 0 ;
31988   void *argp7 = 0 ;
31989   int res7 = 0 ;
31990   int val8 ;
31991   PyObject * obj0 = 0 ;
31992   PyObject * obj1 = 0 ;
31993   PyObject * obj2 = 0 ;
31994   PyObject * obj3 = 0 ;
31995   PyObject * obj4 = 0 ;
31996   PyObject * obj5 = 0 ;
31997   PyObject * obj6 = 0 ;
31998   PyObject * obj7 = 0 ;
31999   PyObject * obj8 = 0 ;
32000   CPLErr result;
32001 
32002   if (!PyArg_ParseTuple(args,(char *)"OOOOO|OOOO:Band_AdviseRead",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
32003   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32004   if (!SWIG_IsOK(res1)) {
32005     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_AdviseRead" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32006   }
32007   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32008   ecode2 = SWIG_AsVal_int(obj1, &val2);
32009   if (!SWIG_IsOK(ecode2)) {
32010     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_AdviseRead" "', argument " "2"" of type '" "int""'");
32011   }
32012   arg2 = static_cast< int >(val2);
32013   ecode3 = SWIG_AsVal_int(obj2, &val3);
32014   if (!SWIG_IsOK(ecode3)) {
32015     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_AdviseRead" "', argument " "3"" of type '" "int""'");
32016   }
32017   arg3 = static_cast< int >(val3);
32018   ecode4 = SWIG_AsVal_int(obj3, &val4);
32019   if (!SWIG_IsOK(ecode4)) {
32020     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_AdviseRead" "', argument " "4"" of type '" "int""'");
32021   }
32022   arg4 = static_cast< int >(val4);
32023   ecode5 = SWIG_AsVal_int(obj4, &val5);
32024   if (!SWIG_IsOK(ecode5)) {
32025     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_AdviseRead" "', argument " "5"" of type '" "int""'");
32026   }
32027   arg5 = static_cast< int >(val5);
32028   if (obj5) {
32029     res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 |  0 );
32030     if (!SWIG_IsOK(res6)) {
32031       SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Band_AdviseRead" "', argument " "6"" of type '" "int *""'");
32032     }
32033     arg6 = reinterpret_cast< int * >(argp6);
32034   }
32035   if (obj6) {
32036     res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_int, 0 |  0 );
32037     if (!SWIG_IsOK(res7)) {
32038       SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Band_AdviseRead" "', argument " "7"" of type '" "int *""'");
32039     }
32040     arg7 = reinterpret_cast< int * >(argp7);
32041   }
32042   if (obj7) {
32043     {
32044       /* %typemap(in) (int *optional_##int) */
32045       if ( obj7 == Py_None ) {
32046         arg8 = 0;
32047       }
32048       else if ( PyArg_Parse( obj7,"i" ,&val8 ) ) {
32049         arg8 = (GDALDataType *) &val8;
32050       }
32051       else {
32052         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
32053         SWIG_fail;
32054       }
32055     }
32056   }
32057   if (obj8) {
32058     {
32059       /* %typemap(in) char **options */
32060       int bErr = FALSE;
32061       arg9 = CSLFromPySequence(obj8, &bErr);
32062       if( bErr )
32063       {
32064         SWIG_fail;
32065       }
32066     }
32067   }
32068   {
32069     if ( bUseExceptions ) {
32070       ClearErrorState();
32071     }
32072     {
32073       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32074       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_AdviseRead(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9));
32075       SWIG_PYTHON_THREAD_END_ALLOW;
32076     }
32077 #ifndef SED_HACKS
32078     if ( bUseExceptions ) {
32079       CPLErr eclass = CPLGetLastErrorType();
32080       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32081         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32082       }
32083     }
32084 #endif
32085   }
32086   resultobj = SWIG_From_int(static_cast< int >(result));
32087   {
32088     /* %typemap(freearg) char **options */
32089     CSLDestroy( arg9 );
32090   }
32091   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32092   return resultobj;
32093 fail:
32094   {
32095     /* %typemap(freearg) char **options */
32096     CSLDestroy( arg9 );
32097   }
32098   return NULL;
32099 }
32100 
32101 
_wrap_Band_AsMDArray(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32102 SWIGINTERN PyObject *_wrap_Band_AsMDArray(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32103   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32104   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32105   void *argp1 = 0 ;
32106   int res1 = 0 ;
32107   PyObject * obj0 = 0 ;
32108   GDALMDArrayHS *result = 0 ;
32109 
32110   if (!PyArg_ParseTuple(args,(char *)"O:Band_AsMDArray",&obj0)) SWIG_fail;
32111   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32112   if (!SWIG_IsOK(res1)) {
32113     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_AsMDArray" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32114   }
32115   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32116   {
32117     if ( bUseExceptions ) {
32118       ClearErrorState();
32119     }
32120     {
32121       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32122       result = (GDALMDArrayHS *)GDALRasterBandShadow_AsMDArray(arg1);
32123       SWIG_PYTHON_THREAD_END_ALLOW;
32124     }
32125 #ifndef SED_HACKS
32126     if ( bUseExceptions ) {
32127       CPLErr eclass = CPLGetLastErrorType();
32128       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32129         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32130       }
32131     }
32132 #endif
32133   }
32134   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMDArrayHS, SWIG_POINTER_OWN |  0 );
32135   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32136   return resultobj;
32137 fail:
32138   return NULL;
32139 }
32140 
32141 
_wrap_Band_ReadRaster1(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)32142 SWIGINTERN PyObject *_wrap_Band_ReadRaster1(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
32143   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32144   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32145   double arg2 ;
32146   double arg3 ;
32147   double arg4 ;
32148   double arg5 ;
32149   void **arg6 = (void **) 0 ;
32150   int *arg7 = (int *) 0 ;
32151   int *arg8 = (int *) 0 ;
32152   GDALDataType *arg9 = (GDALDataType *) 0 ;
32153   GIntBig *arg10 = (GIntBig *) 0 ;
32154   GIntBig *arg11 = (GIntBig *) 0 ;
32155   GDALRIOResampleAlg arg12 = (GDALRIOResampleAlg) GRIORA_NearestNeighbour ;
32156   GDALProgressFunc arg13 = (GDALProgressFunc) NULL ;
32157   void *arg14 = (void *) NULL ;
32158   void *arg15 = (void *) NULL ;
32159   void *argp1 = 0 ;
32160   int res1 = 0 ;
32161   double val2 ;
32162   int ecode2 = 0 ;
32163   double val3 ;
32164   int ecode3 = 0 ;
32165   double val4 ;
32166   int ecode4 = 0 ;
32167   double val5 ;
32168   int ecode5 = 0 ;
32169   void *pyObject6 = NULL ;
32170   int val7 ;
32171   int val8 ;
32172   GDALDataType val9 ;
32173   GIntBig val10 ;
32174   GIntBig val11 ;
32175   PyObject * obj0 = 0 ;
32176   PyObject * obj1 = 0 ;
32177   PyObject * obj2 = 0 ;
32178   PyObject * obj3 = 0 ;
32179   PyObject * obj4 = 0 ;
32180   PyObject * obj5 = 0 ;
32181   PyObject * obj6 = 0 ;
32182   PyObject * obj7 = 0 ;
32183   PyObject * obj8 = 0 ;
32184   PyObject * obj9 = 0 ;
32185   PyObject * obj10 = 0 ;
32186   PyObject * obj11 = 0 ;
32187   PyObject * obj12 = 0 ;
32188   PyObject * obj13 = 0 ;
32189   char *  kwnames[] = {
32190     (char *) "self",(char *) "xoff",(char *) "yoff",(char *) "xsize",(char *) "ysize",(char *) "buf_xsize",(char *) "buf_ysize",(char *) "buf_type",(char *) "buf_pixel_space",(char *) "buf_line_space",(char *) "resample_alg",(char *) "callback",(char *) "callback_data",(char *) "inputOutputBuf", NULL
32191   };
32192   CPLErr result;
32193 
32194   /* %typemap(arginit) ( const char* callback_data=NULL)  */
32195   PyProgressData *psProgressInfo;
32196   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
32197   psProgressInfo->nLastReported = -1;
32198   psProgressInfo->psPyCallback = NULL;
32199   psProgressInfo->psPyCallbackData = NULL;
32200   arg14 = psProgressInfo;
32201   {
32202     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject6 = NULL ) */
32203     arg6 = &pyObject6;
32204   }
32205   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOO|OOOOOOOOO:Band_ReadRaster1",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13)) SWIG_fail;
32206   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32207   if (!SWIG_IsOK(res1)) {
32208     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ReadRaster1" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32209   }
32210   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32211   ecode2 = SWIG_AsVal_double(obj1, &val2);
32212   if (!SWIG_IsOK(ecode2)) {
32213     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_ReadRaster1" "', argument " "2"" of type '" "double""'");
32214   }
32215   arg2 = static_cast< double >(val2);
32216   ecode3 = SWIG_AsVal_double(obj2, &val3);
32217   if (!SWIG_IsOK(ecode3)) {
32218     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_ReadRaster1" "', argument " "3"" of type '" "double""'");
32219   }
32220   arg3 = static_cast< double >(val3);
32221   ecode4 = SWIG_AsVal_double(obj3, &val4);
32222   if (!SWIG_IsOK(ecode4)) {
32223     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Band_ReadRaster1" "', argument " "4"" of type '" "double""'");
32224   }
32225   arg4 = static_cast< double >(val4);
32226   ecode5 = SWIG_AsVal_double(obj4, &val5);
32227   if (!SWIG_IsOK(ecode5)) {
32228     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Band_ReadRaster1" "', argument " "5"" of type '" "double""'");
32229   }
32230   arg5 = static_cast< double >(val5);
32231   if (obj5) {
32232     {
32233       /* %typemap(in) (int *optional_##int) */
32234       if ( obj5 == Py_None ) {
32235         arg7 = 0;
32236       }
32237       else if ( PyArg_Parse( obj5,"i" ,&val7 ) ) {
32238         arg7 = (int *) &val7;
32239       }
32240       else {
32241         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
32242         SWIG_fail;
32243       }
32244     }
32245   }
32246   if (obj6) {
32247     {
32248       /* %typemap(in) (int *optional_##int) */
32249       if ( obj6 == Py_None ) {
32250         arg8 = 0;
32251       }
32252       else if ( PyArg_Parse( obj6,"i" ,&val8 ) ) {
32253         arg8 = (int *) &val8;
32254       }
32255       else {
32256         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
32257         SWIG_fail;
32258       }
32259     }
32260   }
32261   if (obj7) {
32262     {
32263       /* %typemap(in) (GDALDataType *optional_GDALDataType) */
32264       int intval = 0;
32265       if ( obj7 == Py_None ) {
32266         arg9 = NULL;
32267       }
32268       else if ( SWIG_IsOK(SWIG_AsVal_int(obj7, &intval)) ) {
32269         if( intval < GDT_Unknown || intval >= GDT_TypeCount )
32270         {
32271           SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
32272         }
32273         val9 = static_cast<GDALDataType>(intval);
32274         arg9 = &val9;
32275       }
32276       else {
32277         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
32278         SWIG_fail;
32279       }
32280     }
32281   }
32282   if (obj8) {
32283     {
32284       /* %typemap(in) (GIntBig *optional_##GIntBig) */
32285       if ( obj8 == Py_None ) {
32286         arg10 = 0;
32287       }
32288       else if ( PyArg_Parse( obj8,"L" ,&val10 ) ) {
32289         arg10 = (GIntBig *) &val10;
32290       }
32291       else {
32292         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
32293         SWIG_fail;
32294       }
32295     }
32296   }
32297   if (obj9) {
32298     {
32299       /* %typemap(in) (GIntBig *optional_##GIntBig) */
32300       if ( obj9 == Py_None ) {
32301         arg11 = 0;
32302       }
32303       else if ( PyArg_Parse( obj9,"L" ,&val11 ) ) {
32304         arg11 = (GIntBig *) &val11;
32305       }
32306       else {
32307         PyErr_SetString( PyExc_TypeError, "Invalid Parameter" );
32308         SWIG_fail;
32309       }
32310     }
32311   }
32312   if (obj10) {
32313     {
32314       // %typemap(in) GDALRIOResampleAlg
32315       int val = 0;
32316       int ecode = SWIG_AsVal_int(obj10, &val);
32317       if (!SWIG_IsOK(ecode)) {
32318         SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALRIOResampleAlg");
32319       }
32320       if( val < 0 ||
32321         ( val >= static_cast<int>(GRIORA_RESERVED_START) &&
32322           val <= static_cast<int>(GRIORA_RESERVED_END) ) ||
32323         val > static_cast<int>(GRIORA_LAST) )
32324       {
32325         SWIG_exception_fail(SWIG_ValueError, "Invalid value for resample_alg");
32326       }
32327       arg12 = static_cast< GDALRIOResampleAlg >(val);
32328     }
32329   }
32330   if (obj11) {
32331     {
32332       /* %typemap(in) (GDALProgressFunc callback = NULL) */
32333       /* callback_func typemap */
32334 
32335       /* In some cases 0 is passed instead of None. */
32336       /* See https://github.com/OSGeo/gdal/pull/219 */
32337       if ( PyLong_Check(obj11) || PyInt_Check(obj11) )
32338       {
32339         if( PyLong_AsLong(obj11) == 0 )
32340         {
32341           obj11 = Py_None;
32342         }
32343       }
32344 
32345       if (obj11 && obj11 != Py_None ) {
32346         void* cbfunction = NULL;
32347         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj11,
32348             (void**)&cbfunction,
32349             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
32350             SWIG_POINTER_EXCEPTION | 0 ));
32351 
32352         if ( cbfunction == GDALTermProgress ) {
32353           arg13 = GDALTermProgress;
32354         } else {
32355           if (!PyCallable_Check(obj11)) {
32356             PyErr_SetString( PyExc_RuntimeError,
32357               "Object given is not a Python function" );
32358             SWIG_fail;
32359           }
32360           psProgressInfo->psPyCallback = obj11;
32361           arg13 = PyProgressProxy;
32362         }
32363 
32364       }
32365 
32366     }
32367   }
32368   if (obj12) {
32369     {
32370       /* %typemap(in) ( void* callback_data=NULL)  */
32371       psProgressInfo->psPyCallbackData = obj12 ;
32372     }
32373   }
32374   if (obj13) {
32375     {
32376       /* %typemap(in) ( void *inPythonObject ) */
32377       arg15 = obj13;
32378     }
32379   }
32380   {
32381     if ( bUseExceptions ) {
32382       ClearErrorState();
32383     }
32384     {
32385       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32386       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_ReadRaster1(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15));
32387       SWIG_PYTHON_THREAD_END_ALLOW;
32388     }
32389 #ifndef SED_HACKS
32390     if ( bUseExceptions ) {
32391       CPLErr eclass = CPLGetLastErrorType();
32392       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32393         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32394       }
32395     }
32396 #endif
32397   }
32398   resultobj = SWIG_From_int(static_cast< int >(result));
32399   {
32400     /* %typemap(argout) ( void **outPythonObject ) */
32401     Py_XDECREF(resultobj);
32402     if (*arg6)
32403     {
32404       resultobj = (PyObject*)*arg6;
32405     }
32406     else
32407     {
32408       resultobj = Py_None;
32409       Py_INCREF(resultobj);
32410     }
32411   }
32412   {
32413     /* %typemap(freearg) ( void* callback_data=NULL)  */
32414 
32415     CPLFree(psProgressInfo);
32416 
32417   }
32418   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32419   return resultobj;
32420 fail:
32421   {
32422     /* %typemap(freearg) ( void* callback_data=NULL)  */
32423 
32424     CPLFree(psProgressInfo);
32425 
32426   }
32427   return NULL;
32428 }
32429 
32430 
_wrap_Band_ReadBlock(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)32431 SWIGINTERN PyObject *_wrap_Band_ReadBlock(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
32432   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32433   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
32434   int arg2 ;
32435   int arg3 ;
32436   void **arg4 = (void **) 0 ;
32437   void *arg5 = (void *) NULL ;
32438   void *argp1 = 0 ;
32439   int res1 = 0 ;
32440   int val2 ;
32441   int ecode2 = 0 ;
32442   int val3 ;
32443   int ecode3 = 0 ;
32444   void *pyObject4 = NULL ;
32445   PyObject * obj0 = 0 ;
32446   PyObject * obj1 = 0 ;
32447   PyObject * obj2 = 0 ;
32448   PyObject * obj3 = 0 ;
32449   char *  kwnames[] = {
32450     (char *) "self",(char *) "xoff",(char *) "yoff",(char *) "buf_obj", NULL
32451   };
32452   CPLErr result;
32453 
32454   {
32455     /* %typemap(in,numinputs=0) ( void **outPythonObject ) ( void *pyObject4 = NULL ) */
32456     arg4 = &pyObject4;
32457   }
32458   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Band_ReadBlock",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
32459   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
32460   if (!SWIG_IsOK(res1)) {
32461     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Band_ReadBlock" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
32462   }
32463   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
32464   ecode2 = SWIG_AsVal_int(obj1, &val2);
32465   if (!SWIG_IsOK(ecode2)) {
32466     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Band_ReadBlock" "', argument " "2"" of type '" "int""'");
32467   }
32468   arg2 = static_cast< int >(val2);
32469   ecode3 = SWIG_AsVal_int(obj2, &val3);
32470   if (!SWIG_IsOK(ecode3)) {
32471     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Band_ReadBlock" "', argument " "3"" of type '" "int""'");
32472   }
32473   arg3 = static_cast< int >(val3);
32474   if (obj3) {
32475     {
32476       /* %typemap(in) ( void *inPythonObject ) */
32477       arg5 = obj3;
32478     }
32479   }
32480   {
32481     if ( bUseExceptions ) {
32482       ClearErrorState();
32483     }
32484     {
32485       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32486       CPL_IGNORE_RET_VAL(result = (CPLErr)GDALRasterBandShadow_ReadBlock(arg1,arg2,arg3,arg4,arg5));
32487       SWIG_PYTHON_THREAD_END_ALLOW;
32488     }
32489 #ifndef SED_HACKS
32490     if ( bUseExceptions ) {
32491       CPLErr eclass = CPLGetLastErrorType();
32492       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32493         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32494       }
32495     }
32496 #endif
32497   }
32498   resultobj = SWIG_From_int(static_cast< int >(result));
32499   {
32500     /* %typemap(argout) ( void **outPythonObject ) */
32501     Py_XDECREF(resultobj);
32502     if (*arg4)
32503     {
32504       resultobj = (PyObject*)*arg4;
32505     }
32506     else
32507     {
32508       resultobj = Py_None;
32509       Py_INCREF(resultobj);
32510     }
32511   }
32512   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32513   return resultobj;
32514 fail:
32515   return NULL;
32516 }
32517 
32518 
Band_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32519 SWIGINTERN PyObject *Band_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32520   PyObject *obj;
32521   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
32522   SWIG_TypeNewClientData(SWIGTYPE_p_GDALRasterBandShadow, SWIG_NewClientData(obj));
32523   return SWIG_Py_Void();
32524 }
32525 
_wrap_new_ColorTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)32526 SWIGINTERN PyObject *_wrap_new_ColorTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
32527   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32528   GDALPaletteInterp arg1 = (GDALPaletteInterp) GPI_RGB ;
32529   int val1 ;
32530   int ecode1 = 0 ;
32531   PyObject * obj0 = 0 ;
32532   char *  kwnames[] = {
32533     (char *) "palette", NULL
32534   };
32535   GDALColorTableShadow *result = 0 ;
32536 
32537   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"|O:new_ColorTable",kwnames,&obj0)) SWIG_fail;
32538   if (obj0) {
32539     ecode1 = SWIG_AsVal_int(obj0, &val1);
32540     if (!SWIG_IsOK(ecode1)) {
32541       SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_ColorTable" "', argument " "1"" of type '" "GDALPaletteInterp""'");
32542     }
32543     arg1 = static_cast< GDALPaletteInterp >(val1);
32544   }
32545   {
32546     if ( bUseExceptions ) {
32547       ClearErrorState();
32548     }
32549     {
32550       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32551       result = (GDALColorTableShadow *)new_GDALColorTableShadow(arg1);
32552       SWIG_PYTHON_THREAD_END_ALLOW;
32553     }
32554 #ifndef SED_HACKS
32555     if ( bUseExceptions ) {
32556       CPLErr eclass = CPLGetLastErrorType();
32557       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32558         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32559       }
32560     }
32561 #endif
32562   }
32563   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, SWIG_POINTER_NEW |  0 );
32564   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32565   return resultobj;
32566 fail:
32567   return NULL;
32568 }
32569 
32570 
_wrap_delete_ColorTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32571 SWIGINTERN PyObject *_wrap_delete_ColorTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32572   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32573   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32574   void *argp1 = 0 ;
32575   int res1 = 0 ;
32576   PyObject * obj0 = 0 ;
32577 
32578   if (!PyArg_ParseTuple(args,(char *)"O:delete_ColorTable",&obj0)) SWIG_fail;
32579   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, SWIG_POINTER_DISOWN |  0 );
32580   if (!SWIG_IsOK(res1)) {
32581     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ColorTable" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32582   }
32583   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32584   {
32585     if ( bUseExceptions ) {
32586       ClearErrorState();
32587     }
32588     {
32589       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32590       delete_GDALColorTableShadow(arg1);
32591       SWIG_PYTHON_THREAD_END_ALLOW;
32592     }
32593 #ifndef SED_HACKS
32594     if ( bUseExceptions ) {
32595       CPLErr eclass = CPLGetLastErrorType();
32596       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32597         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32598       }
32599     }
32600 #endif
32601   }
32602   resultobj = SWIG_Py_Void();
32603   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32604   return resultobj;
32605 fail:
32606   return NULL;
32607 }
32608 
32609 
_wrap_ColorTable_Clone(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32610 SWIGINTERN PyObject *_wrap_ColorTable_Clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32611   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32612   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32613   void *argp1 = 0 ;
32614   int res1 = 0 ;
32615   PyObject * obj0 = 0 ;
32616   GDALColorTableShadow *result = 0 ;
32617 
32618   if (!PyArg_ParseTuple(args,(char *)"O:ColorTable_Clone",&obj0)) SWIG_fail;
32619   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
32620   if (!SWIG_IsOK(res1)) {
32621     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_Clone" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32622   }
32623   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32624   {
32625     if ( bUseExceptions ) {
32626       ClearErrorState();
32627     }
32628     {
32629       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32630       result = (GDALColorTableShadow *)GDALColorTableShadow_Clone(arg1);
32631       SWIG_PYTHON_THREAD_END_ALLOW;
32632     }
32633 #ifndef SED_HACKS
32634     if ( bUseExceptions ) {
32635       CPLErr eclass = CPLGetLastErrorType();
32636       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32637         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32638       }
32639     }
32640 #endif
32641   }
32642   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALColorTableShadow, SWIG_POINTER_OWN |  0 );
32643   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32644   return resultobj;
32645 fail:
32646   return NULL;
32647 }
32648 
32649 
_wrap_ColorTable_GetPaletteInterpretation(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32650 SWIGINTERN PyObject *_wrap_ColorTable_GetPaletteInterpretation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32651   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32652   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32653   void *argp1 = 0 ;
32654   int res1 = 0 ;
32655   PyObject * obj0 = 0 ;
32656   GDALPaletteInterp result;
32657 
32658   if (!PyArg_ParseTuple(args,(char *)"O:ColorTable_GetPaletteInterpretation",&obj0)) SWIG_fail;
32659   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
32660   if (!SWIG_IsOK(res1)) {
32661     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_GetPaletteInterpretation" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32662   }
32663   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32664   {
32665     if ( bUseExceptions ) {
32666       ClearErrorState();
32667     }
32668     {
32669       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32670       result = (GDALPaletteInterp)GDALColorTableShadow_GetPaletteInterpretation(arg1);
32671       SWIG_PYTHON_THREAD_END_ALLOW;
32672     }
32673 #ifndef SED_HACKS
32674     if ( bUseExceptions ) {
32675       CPLErr eclass = CPLGetLastErrorType();
32676       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32677         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32678       }
32679     }
32680 #endif
32681   }
32682   resultobj = SWIG_From_int(static_cast< int >(result));
32683   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32684   return resultobj;
32685 fail:
32686   return NULL;
32687 }
32688 
32689 
_wrap_ColorTable_GetCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32690 SWIGINTERN PyObject *_wrap_ColorTable_GetCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32691   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32692   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32693   void *argp1 = 0 ;
32694   int res1 = 0 ;
32695   PyObject * obj0 = 0 ;
32696   int result;
32697 
32698   if (!PyArg_ParseTuple(args,(char *)"O:ColorTable_GetCount",&obj0)) SWIG_fail;
32699   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
32700   if (!SWIG_IsOK(res1)) {
32701     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_GetCount" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32702   }
32703   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32704   {
32705     if ( bUseExceptions ) {
32706       ClearErrorState();
32707     }
32708     {
32709       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32710       result = (int)GDALColorTableShadow_GetColorEntryCount(arg1);
32711       SWIG_PYTHON_THREAD_END_ALLOW;
32712     }
32713 #ifndef SED_HACKS
32714     if ( bUseExceptions ) {
32715       CPLErr eclass = CPLGetLastErrorType();
32716       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32717         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32718       }
32719     }
32720 #endif
32721   }
32722   resultobj = SWIG_From_int(static_cast< int >(result));
32723   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32724   return resultobj;
32725 fail:
32726   return NULL;
32727 }
32728 
32729 
_wrap_ColorTable_GetColorEntry(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32730 SWIGINTERN PyObject *_wrap_ColorTable_GetColorEntry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32731   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32732   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32733   int arg2 ;
32734   void *argp1 = 0 ;
32735   int res1 = 0 ;
32736   int val2 ;
32737   int ecode2 = 0 ;
32738   PyObject * obj0 = 0 ;
32739   PyObject * obj1 = 0 ;
32740   GDALColorEntry *result = 0 ;
32741 
32742   if (!PyArg_ParseTuple(args,(char *)"OO:ColorTable_GetColorEntry",&obj0,&obj1)) SWIG_fail;
32743   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
32744   if (!SWIG_IsOK(res1)) {
32745     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_GetColorEntry" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32746   }
32747   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32748   ecode2 = SWIG_AsVal_int(obj1, &val2);
32749   if (!SWIG_IsOK(ecode2)) {
32750     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable_GetColorEntry" "', argument " "2"" of type '" "int""'");
32751   }
32752   arg2 = static_cast< int >(val2);
32753   {
32754     if ( bUseExceptions ) {
32755       ClearErrorState();
32756     }
32757     {
32758       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32759       result = (GDALColorEntry *)GDALColorTableShadow_GetColorEntry(arg1,arg2);
32760       SWIG_PYTHON_THREAD_END_ALLOW;
32761     }
32762 #ifndef SED_HACKS
32763     if ( bUseExceptions ) {
32764       CPLErr eclass = CPLGetLastErrorType();
32765       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32766         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32767       }
32768     }
32769 #endif
32770   }
32771   {
32772     /* %typemap(out) GDALColorEntry* */
32773     if ( result != NULL )
32774     resultobj = Py_BuildValue( "(hhhh)", (*result).c1,(*result).c2,(*result).c3,(*result).c4);
32775     else
32776     resultobj = NULL;
32777   }
32778   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32779   return resultobj;
32780 fail:
32781   return NULL;
32782 }
32783 
32784 
_wrap_ColorTable_GetColorEntryAsRGB(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32785 SWIGINTERN PyObject *_wrap_ColorTable_GetColorEntryAsRGB(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32786   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32787   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32788   int arg2 ;
32789   GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
32790   void *argp1 = 0 ;
32791   int res1 = 0 ;
32792   int val2 ;
32793   int ecode2 = 0 ;
32794   GDALColorEntry ce3 ;
32795   PyObject * obj0 = 0 ;
32796   PyObject * obj1 = 0 ;
32797   PyObject * obj2 = 0 ;
32798   int result;
32799 
32800   if (!PyArg_ParseTuple(args,(char *)"OOO:ColorTable_GetColorEntryAsRGB",&obj0,&obj1,&obj2)) SWIG_fail;
32801   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
32802   if (!SWIG_IsOK(res1)) {
32803     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_GetColorEntryAsRGB" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32804   }
32805   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32806   ecode2 = SWIG_AsVal_int(obj1, &val2);
32807   if (!SWIG_IsOK(ecode2)) {
32808     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable_GetColorEntryAsRGB" "', argument " "2"" of type '" "int""'");
32809   }
32810   arg2 = static_cast< int >(val2);
32811   {
32812     /* %typemap(in) GDALColorEntry* */
32813     ce3.c4 = 255;
32814     if (! PySequence_Check(obj2) ) {
32815       PyErr_SetString(PyExc_TypeError, "not a sequence");
32816       SWIG_fail;
32817     }
32818     Py_ssize_t size = PySequence_Size(obj2);
32819     if ( size > 4 ) {
32820       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
32821       SWIG_fail;
32822     }
32823     if ( size < 3 ) {
32824       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
32825       SWIG_fail;
32826     }
32827     if ( !PyArg_ParseTuple( obj2,"hhh|h", &ce3.c1, &ce3.c2, &ce3.c3, &ce3.c4 ) ) {
32828       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
32829       SWIG_fail;
32830     }
32831     arg3 = &ce3;
32832   }
32833   {
32834     if ( bUseExceptions ) {
32835       ClearErrorState();
32836     }
32837     {
32838       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32839       result = (int)GDALColorTableShadow_GetColorEntryAsRGB(arg1,arg2,arg3);
32840       SWIG_PYTHON_THREAD_END_ALLOW;
32841     }
32842 #ifndef SED_HACKS
32843     if ( bUseExceptions ) {
32844       CPLErr eclass = CPLGetLastErrorType();
32845       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32846         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32847       }
32848     }
32849 #endif
32850   }
32851   resultobj = SWIG_From_int(static_cast< int >(result));
32852   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32853   return resultobj;
32854 fail:
32855   return NULL;
32856 }
32857 
32858 
_wrap_ColorTable_SetColorEntry(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32859 SWIGINTERN PyObject *_wrap_ColorTable_SetColorEntry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32860   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32861   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32862   int arg2 ;
32863   GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
32864   void *argp1 = 0 ;
32865   int res1 = 0 ;
32866   int val2 ;
32867   int ecode2 = 0 ;
32868   GDALColorEntry ce3 ;
32869   PyObject * obj0 = 0 ;
32870   PyObject * obj1 = 0 ;
32871   PyObject * obj2 = 0 ;
32872 
32873   if (!PyArg_ParseTuple(args,(char *)"OOO:ColorTable_SetColorEntry",&obj0,&obj1,&obj2)) SWIG_fail;
32874   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
32875   if (!SWIG_IsOK(res1)) {
32876     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_SetColorEntry" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32877   }
32878   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32879   ecode2 = SWIG_AsVal_int(obj1, &val2);
32880   if (!SWIG_IsOK(ecode2)) {
32881     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable_SetColorEntry" "', argument " "2"" of type '" "int""'");
32882   }
32883   arg2 = static_cast< int >(val2);
32884   {
32885     /* %typemap(in) GDALColorEntry* */
32886     ce3.c4 = 255;
32887     if (! PySequence_Check(obj2) ) {
32888       PyErr_SetString(PyExc_TypeError, "not a sequence");
32889       SWIG_fail;
32890     }
32891     Py_ssize_t size = PySequence_Size(obj2);
32892     if ( size > 4 ) {
32893       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
32894       SWIG_fail;
32895     }
32896     if ( size < 3 ) {
32897       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
32898       SWIG_fail;
32899     }
32900     if ( !PyArg_ParseTuple( obj2,"hhh|h", &ce3.c1, &ce3.c2, &ce3.c3, &ce3.c4 ) ) {
32901       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
32902       SWIG_fail;
32903     }
32904     arg3 = &ce3;
32905   }
32906   {
32907     if ( bUseExceptions ) {
32908       ClearErrorState();
32909     }
32910     {
32911       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
32912       GDALColorTableShadow_SetColorEntry(arg1,arg2,(GDALColorEntry const *)arg3);
32913       SWIG_PYTHON_THREAD_END_ALLOW;
32914     }
32915 #ifndef SED_HACKS
32916     if ( bUseExceptions ) {
32917       CPLErr eclass = CPLGetLastErrorType();
32918       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
32919         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
32920       }
32921     }
32922 #endif
32923   }
32924   resultobj = SWIG_Py_Void();
32925   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
32926   return resultobj;
32927 fail:
32928   return NULL;
32929 }
32930 
32931 
_wrap_ColorTable_CreateColorRamp(PyObject * SWIGUNUSEDPARM (self),PyObject * args)32932 SWIGINTERN PyObject *_wrap_ColorTable_CreateColorRamp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
32933   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
32934   GDALColorTableShadow *arg1 = (GDALColorTableShadow *) 0 ;
32935   int arg2 ;
32936   GDALColorEntry *arg3 = (GDALColorEntry *) 0 ;
32937   int arg4 ;
32938   GDALColorEntry *arg5 = (GDALColorEntry *) 0 ;
32939   void *argp1 = 0 ;
32940   int res1 = 0 ;
32941   int val2 ;
32942   int ecode2 = 0 ;
32943   GDALColorEntry ce3 ;
32944   int val4 ;
32945   int ecode4 = 0 ;
32946   GDALColorEntry ce5 ;
32947   PyObject * obj0 = 0 ;
32948   PyObject * obj1 = 0 ;
32949   PyObject * obj2 = 0 ;
32950   PyObject * obj3 = 0 ;
32951   PyObject * obj4 = 0 ;
32952 
32953   if (!PyArg_ParseTuple(args,(char *)"OOOOO:ColorTable_CreateColorRamp",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
32954   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
32955   if (!SWIG_IsOK(res1)) {
32956     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ColorTable_CreateColorRamp" "', argument " "1"" of type '" "GDALColorTableShadow *""'");
32957   }
32958   arg1 = reinterpret_cast< GDALColorTableShadow * >(argp1);
32959   ecode2 = SWIG_AsVal_int(obj1, &val2);
32960   if (!SWIG_IsOK(ecode2)) {
32961     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ColorTable_CreateColorRamp" "', argument " "2"" of type '" "int""'");
32962   }
32963   arg2 = static_cast< int >(val2);
32964   {
32965     /* %typemap(in) GDALColorEntry* */
32966     ce3.c4 = 255;
32967     if (! PySequence_Check(obj2) ) {
32968       PyErr_SetString(PyExc_TypeError, "not a sequence");
32969       SWIG_fail;
32970     }
32971     Py_ssize_t size = PySequence_Size(obj2);
32972     if ( size > 4 ) {
32973       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
32974       SWIG_fail;
32975     }
32976     if ( size < 3 ) {
32977       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
32978       SWIG_fail;
32979     }
32980     if ( !PyArg_ParseTuple( obj2,"hhh|h", &ce3.c1, &ce3.c2, &ce3.c3, &ce3.c4 ) ) {
32981       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
32982       SWIG_fail;
32983     }
32984     arg3 = &ce3;
32985   }
32986   ecode4 = SWIG_AsVal_int(obj3, &val4);
32987   if (!SWIG_IsOK(ecode4)) {
32988     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ColorTable_CreateColorRamp" "', argument " "4"" of type '" "int""'");
32989   }
32990   arg4 = static_cast< int >(val4);
32991   {
32992     /* %typemap(in) GDALColorEntry* */
32993     ce5.c4 = 255;
32994     if (! PySequence_Check(obj4) ) {
32995       PyErr_SetString(PyExc_TypeError, "not a sequence");
32996       SWIG_fail;
32997     }
32998     Py_ssize_t size = PySequence_Size(obj4);
32999     if ( size > 4 ) {
33000       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too long");
33001       SWIG_fail;
33002     }
33003     if ( size < 3 ) {
33004       PyErr_SetString(PyExc_TypeError, "ColorEntry sequence too short");
33005       SWIG_fail;
33006     }
33007     if ( !PyArg_ParseTuple( obj4,"hhh|h", &ce5.c1, &ce5.c2, &ce5.c3, &ce5.c4 ) ) {
33008       PyErr_SetString(PyExc_TypeError, "Invalid values in ColorEntry sequence ");
33009       SWIG_fail;
33010     }
33011     arg5 = &ce5;
33012   }
33013   {
33014     if ( bUseExceptions ) {
33015       ClearErrorState();
33016     }
33017     {
33018       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33019       GDALColorTableShadow_CreateColorRamp(arg1,arg2,(GDALColorEntry const *)arg3,arg4,(GDALColorEntry const *)arg5);
33020       SWIG_PYTHON_THREAD_END_ALLOW;
33021     }
33022 #ifndef SED_HACKS
33023     if ( bUseExceptions ) {
33024       CPLErr eclass = CPLGetLastErrorType();
33025       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33026         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33027       }
33028     }
33029 #endif
33030   }
33031   resultobj = SWIG_Py_Void();
33032   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33033   return resultobj;
33034 fail:
33035   return NULL;
33036 }
33037 
33038 
ColorTable_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33039 SWIGINTERN PyObject *ColorTable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33040   PyObject *obj;
33041   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
33042   SWIG_TypeNewClientData(SWIGTYPE_p_GDALColorTableShadow, SWIG_NewClientData(obj));
33043   return SWIG_Py_Void();
33044 }
33045 
_wrap_new_RasterAttributeTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33046 SWIGINTERN PyObject *_wrap_new_RasterAttributeTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33047   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33048   GDALRasterAttributeTableShadow *result = 0 ;
33049 
33050   if (!PyArg_ParseTuple(args,(char *)":new_RasterAttributeTable")) SWIG_fail;
33051   {
33052     if ( bUseExceptions ) {
33053       ClearErrorState();
33054     }
33055     {
33056       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33057       result = (GDALRasterAttributeTableShadow *)new_GDALRasterAttributeTableShadow();
33058       SWIG_PYTHON_THREAD_END_ALLOW;
33059     }
33060 #ifndef SED_HACKS
33061     if ( bUseExceptions ) {
33062       CPLErr eclass = CPLGetLastErrorType();
33063       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33064         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33065       }
33066     }
33067 #endif
33068   }
33069   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterAttributeTableShadow, SWIG_POINTER_NEW |  0 );
33070   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33071   return resultobj;
33072 fail:
33073   return NULL;
33074 }
33075 
33076 
_wrap_delete_RasterAttributeTable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33077 SWIGINTERN PyObject *_wrap_delete_RasterAttributeTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33078   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33079   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33080   void *argp1 = 0 ;
33081   int res1 = 0 ;
33082   PyObject * obj0 = 0 ;
33083 
33084   if (!PyArg_ParseTuple(args,(char *)"O:delete_RasterAttributeTable",&obj0)) SWIG_fail;
33085   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, SWIG_POINTER_DISOWN |  0 );
33086   if (!SWIG_IsOK(res1)) {
33087     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_RasterAttributeTable" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33088   }
33089   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33090   {
33091     if ( bUseExceptions ) {
33092       ClearErrorState();
33093     }
33094     {
33095       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33096       delete_GDALRasterAttributeTableShadow(arg1);
33097       SWIG_PYTHON_THREAD_END_ALLOW;
33098     }
33099 #ifndef SED_HACKS
33100     if ( bUseExceptions ) {
33101       CPLErr eclass = CPLGetLastErrorType();
33102       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33103         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33104       }
33105     }
33106 #endif
33107   }
33108   resultobj = SWIG_Py_Void();
33109   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33110   return resultobj;
33111 fail:
33112   return NULL;
33113 }
33114 
33115 
_wrap_RasterAttributeTable_Clone(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33116 SWIGINTERN PyObject *_wrap_RasterAttributeTable_Clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33117   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33118   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33119   void *argp1 = 0 ;
33120   int res1 = 0 ;
33121   PyObject * obj0 = 0 ;
33122   GDALRasterAttributeTableShadow *result = 0 ;
33123 
33124   if (!PyArg_ParseTuple(args,(char *)"O:RasterAttributeTable_Clone",&obj0)) SWIG_fail;
33125   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33126   if (!SWIG_IsOK(res1)) {
33127     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_Clone" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33128   }
33129   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33130   {
33131     if ( bUseExceptions ) {
33132       ClearErrorState();
33133     }
33134     {
33135       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33136       result = (GDALRasterAttributeTableShadow *)GDALRasterAttributeTableShadow_Clone(arg1);
33137       SWIG_PYTHON_THREAD_END_ALLOW;
33138     }
33139 #ifndef SED_HACKS
33140     if ( bUseExceptions ) {
33141       CPLErr eclass = CPLGetLastErrorType();
33142       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33143         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33144       }
33145     }
33146 #endif
33147   }
33148   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterAttributeTableShadow, SWIG_POINTER_OWN |  0 );
33149   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33150   return resultobj;
33151 fail:
33152   return NULL;
33153 }
33154 
33155 
_wrap_RasterAttributeTable_GetColumnCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33156 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetColumnCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33157   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33158   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33159   void *argp1 = 0 ;
33160   int res1 = 0 ;
33161   PyObject * obj0 = 0 ;
33162   int result;
33163 
33164   if (!PyArg_ParseTuple(args,(char *)"O:RasterAttributeTable_GetColumnCount",&obj0)) SWIG_fail;
33165   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33166   if (!SWIG_IsOK(res1)) {
33167     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetColumnCount" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33168   }
33169   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33170   {
33171     if ( bUseExceptions ) {
33172       ClearErrorState();
33173     }
33174     {
33175       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33176       result = (int)GDALRasterAttributeTableShadow_GetColumnCount(arg1);
33177       SWIG_PYTHON_THREAD_END_ALLOW;
33178     }
33179 #ifndef SED_HACKS
33180     if ( bUseExceptions ) {
33181       CPLErr eclass = CPLGetLastErrorType();
33182       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33183         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33184       }
33185     }
33186 #endif
33187   }
33188   resultobj = SWIG_From_int(static_cast< int >(result));
33189   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33190   return resultobj;
33191 fail:
33192   return NULL;
33193 }
33194 
33195 
_wrap_RasterAttributeTable_GetNameOfCol(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33196 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetNameOfCol(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33197   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33198   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33199   int arg2 ;
33200   void *argp1 = 0 ;
33201   int res1 = 0 ;
33202   int val2 ;
33203   int ecode2 = 0 ;
33204   PyObject * obj0 = 0 ;
33205   PyObject * obj1 = 0 ;
33206   char *result = 0 ;
33207 
33208   if (!PyArg_ParseTuple(args,(char *)"OO:RasterAttributeTable_GetNameOfCol",&obj0,&obj1)) SWIG_fail;
33209   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33210   if (!SWIG_IsOK(res1)) {
33211     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetNameOfCol" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33212   }
33213   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33214   ecode2 = SWIG_AsVal_int(obj1, &val2);
33215   if (!SWIG_IsOK(ecode2)) {
33216     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetNameOfCol" "', argument " "2"" of type '" "int""'");
33217   }
33218   arg2 = static_cast< int >(val2);
33219   {
33220     if ( bUseExceptions ) {
33221       ClearErrorState();
33222     }
33223     {
33224       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33225       result = (char *)GDALRasterAttributeTableShadow_GetNameOfCol(arg1,arg2);
33226       SWIG_PYTHON_THREAD_END_ALLOW;
33227     }
33228 #ifndef SED_HACKS
33229     if ( bUseExceptions ) {
33230       CPLErr eclass = CPLGetLastErrorType();
33231       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33232         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33233       }
33234     }
33235 #endif
33236   }
33237   resultobj = SWIG_FromCharPtr((const char *)result);
33238   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33239   return resultobj;
33240 fail:
33241   return NULL;
33242 }
33243 
33244 
_wrap_RasterAttributeTable_GetUsageOfCol(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33245 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetUsageOfCol(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33246   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33247   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33248   int arg2 ;
33249   void *argp1 = 0 ;
33250   int res1 = 0 ;
33251   int val2 ;
33252   int ecode2 = 0 ;
33253   PyObject * obj0 = 0 ;
33254   PyObject * obj1 = 0 ;
33255   GDALRATFieldUsage result;
33256 
33257   if (!PyArg_ParseTuple(args,(char *)"OO:RasterAttributeTable_GetUsageOfCol",&obj0,&obj1)) SWIG_fail;
33258   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33259   if (!SWIG_IsOK(res1)) {
33260     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetUsageOfCol" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33261   }
33262   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33263   ecode2 = SWIG_AsVal_int(obj1, &val2);
33264   if (!SWIG_IsOK(ecode2)) {
33265     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetUsageOfCol" "', argument " "2"" of type '" "int""'");
33266   }
33267   arg2 = static_cast< int >(val2);
33268   {
33269     if ( bUseExceptions ) {
33270       ClearErrorState();
33271     }
33272     {
33273       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33274       result = (GDALRATFieldUsage)GDALRasterAttributeTableShadow_GetUsageOfCol(arg1,arg2);
33275       SWIG_PYTHON_THREAD_END_ALLOW;
33276     }
33277 #ifndef SED_HACKS
33278     if ( bUseExceptions ) {
33279       CPLErr eclass = CPLGetLastErrorType();
33280       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33281         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33282       }
33283     }
33284 #endif
33285   }
33286   resultobj = SWIG_From_int(static_cast< int >(result));
33287   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33288   return resultobj;
33289 fail:
33290   return NULL;
33291 }
33292 
33293 
_wrap_RasterAttributeTable_GetTypeOfCol(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33294 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetTypeOfCol(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33295   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33296   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33297   int arg2 ;
33298   void *argp1 = 0 ;
33299   int res1 = 0 ;
33300   int val2 ;
33301   int ecode2 = 0 ;
33302   PyObject * obj0 = 0 ;
33303   PyObject * obj1 = 0 ;
33304   GDALRATFieldType result;
33305 
33306   if (!PyArg_ParseTuple(args,(char *)"OO:RasterAttributeTable_GetTypeOfCol",&obj0,&obj1)) SWIG_fail;
33307   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33308   if (!SWIG_IsOK(res1)) {
33309     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetTypeOfCol" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33310   }
33311   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33312   ecode2 = SWIG_AsVal_int(obj1, &val2);
33313   if (!SWIG_IsOK(ecode2)) {
33314     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetTypeOfCol" "', argument " "2"" of type '" "int""'");
33315   }
33316   arg2 = static_cast< int >(val2);
33317   {
33318     if ( bUseExceptions ) {
33319       ClearErrorState();
33320     }
33321     {
33322       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33323       result = (GDALRATFieldType)GDALRasterAttributeTableShadow_GetTypeOfCol(arg1,arg2);
33324       SWIG_PYTHON_THREAD_END_ALLOW;
33325     }
33326 #ifndef SED_HACKS
33327     if ( bUseExceptions ) {
33328       CPLErr eclass = CPLGetLastErrorType();
33329       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33330         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33331       }
33332     }
33333 #endif
33334   }
33335   resultobj = SWIG_From_int(static_cast< int >(result));
33336   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33337   return resultobj;
33338 fail:
33339   return NULL;
33340 }
33341 
33342 
_wrap_RasterAttributeTable_GetColOfUsage(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33343 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetColOfUsage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33344   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33345   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33346   GDALRATFieldUsage arg2 ;
33347   void *argp1 = 0 ;
33348   int res1 = 0 ;
33349   int val2 ;
33350   int ecode2 = 0 ;
33351   PyObject * obj0 = 0 ;
33352   PyObject * obj1 = 0 ;
33353   int result;
33354 
33355   if (!PyArg_ParseTuple(args,(char *)"OO:RasterAttributeTable_GetColOfUsage",&obj0,&obj1)) SWIG_fail;
33356   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33357   if (!SWIG_IsOK(res1)) {
33358     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetColOfUsage" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33359   }
33360   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33361   ecode2 = SWIG_AsVal_int(obj1, &val2);
33362   if (!SWIG_IsOK(ecode2)) {
33363     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetColOfUsage" "', argument " "2"" of type '" "GDALRATFieldUsage""'");
33364   }
33365   arg2 = static_cast< GDALRATFieldUsage >(val2);
33366   {
33367     if ( bUseExceptions ) {
33368       ClearErrorState();
33369     }
33370     {
33371       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33372       result = (int)GDALRasterAttributeTableShadow_GetColOfUsage(arg1,arg2);
33373       SWIG_PYTHON_THREAD_END_ALLOW;
33374     }
33375 #ifndef SED_HACKS
33376     if ( bUseExceptions ) {
33377       CPLErr eclass = CPLGetLastErrorType();
33378       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33379         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33380       }
33381     }
33382 #endif
33383   }
33384   resultobj = SWIG_From_int(static_cast< int >(result));
33385   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33386   return resultobj;
33387 fail:
33388   return NULL;
33389 }
33390 
33391 
_wrap_RasterAttributeTable_GetRowCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33392 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetRowCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33393   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33394   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33395   void *argp1 = 0 ;
33396   int res1 = 0 ;
33397   PyObject * obj0 = 0 ;
33398   int result;
33399 
33400   if (!PyArg_ParseTuple(args,(char *)"O:RasterAttributeTable_GetRowCount",&obj0)) SWIG_fail;
33401   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33402   if (!SWIG_IsOK(res1)) {
33403     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetRowCount" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33404   }
33405   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33406   {
33407     if ( bUseExceptions ) {
33408       ClearErrorState();
33409     }
33410     {
33411       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33412       result = (int)GDALRasterAttributeTableShadow_GetRowCount(arg1);
33413       SWIG_PYTHON_THREAD_END_ALLOW;
33414     }
33415 #ifndef SED_HACKS
33416     if ( bUseExceptions ) {
33417       CPLErr eclass = CPLGetLastErrorType();
33418       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33419         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33420       }
33421     }
33422 #endif
33423   }
33424   resultobj = SWIG_From_int(static_cast< int >(result));
33425   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33426   return resultobj;
33427 fail:
33428   return NULL;
33429 }
33430 
33431 
_wrap_RasterAttributeTable_GetValueAsString(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33432 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33433   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33434   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33435   int arg2 ;
33436   int arg3 ;
33437   void *argp1 = 0 ;
33438   int res1 = 0 ;
33439   int val2 ;
33440   int ecode2 = 0 ;
33441   int val3 ;
33442   int ecode3 = 0 ;
33443   PyObject * obj0 = 0 ;
33444   PyObject * obj1 = 0 ;
33445   PyObject * obj2 = 0 ;
33446   char *result = 0 ;
33447 
33448   if (!PyArg_ParseTuple(args,(char *)"OOO:RasterAttributeTable_GetValueAsString",&obj0,&obj1,&obj2)) SWIG_fail;
33449   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33450   if (!SWIG_IsOK(res1)) {
33451     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetValueAsString" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33452   }
33453   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33454   ecode2 = SWIG_AsVal_int(obj1, &val2);
33455   if (!SWIG_IsOK(ecode2)) {
33456     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetValueAsString" "', argument " "2"" of type '" "int""'");
33457   }
33458   arg2 = static_cast< int >(val2);
33459   ecode3 = SWIG_AsVal_int(obj2, &val3);
33460   if (!SWIG_IsOK(ecode3)) {
33461     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_GetValueAsString" "', argument " "3"" of type '" "int""'");
33462   }
33463   arg3 = static_cast< int >(val3);
33464   {
33465     if ( bUseExceptions ) {
33466       ClearErrorState();
33467     }
33468     {
33469       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33470       result = (char *)GDALRasterAttributeTableShadow_GetValueAsString(arg1,arg2,arg3);
33471       SWIG_PYTHON_THREAD_END_ALLOW;
33472     }
33473 #ifndef SED_HACKS
33474     if ( bUseExceptions ) {
33475       CPLErr eclass = CPLGetLastErrorType();
33476       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33477         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33478       }
33479     }
33480 #endif
33481   }
33482   resultobj = SWIG_FromCharPtr((const char *)result);
33483   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33484   return resultobj;
33485 fail:
33486   return NULL;
33487 }
33488 
33489 
_wrap_RasterAttributeTable_GetValueAsInt(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33490 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetValueAsInt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33491   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33492   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33493   int arg2 ;
33494   int arg3 ;
33495   void *argp1 = 0 ;
33496   int res1 = 0 ;
33497   int val2 ;
33498   int ecode2 = 0 ;
33499   int val3 ;
33500   int ecode3 = 0 ;
33501   PyObject * obj0 = 0 ;
33502   PyObject * obj1 = 0 ;
33503   PyObject * obj2 = 0 ;
33504   int result;
33505 
33506   if (!PyArg_ParseTuple(args,(char *)"OOO:RasterAttributeTable_GetValueAsInt",&obj0,&obj1,&obj2)) SWIG_fail;
33507   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33508   if (!SWIG_IsOK(res1)) {
33509     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetValueAsInt" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33510   }
33511   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33512   ecode2 = SWIG_AsVal_int(obj1, &val2);
33513   if (!SWIG_IsOK(ecode2)) {
33514     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetValueAsInt" "', argument " "2"" of type '" "int""'");
33515   }
33516   arg2 = static_cast< int >(val2);
33517   ecode3 = SWIG_AsVal_int(obj2, &val3);
33518   if (!SWIG_IsOK(ecode3)) {
33519     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_GetValueAsInt" "', argument " "3"" of type '" "int""'");
33520   }
33521   arg3 = static_cast< int >(val3);
33522   {
33523     if ( bUseExceptions ) {
33524       ClearErrorState();
33525     }
33526     {
33527       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33528       result = (int)GDALRasterAttributeTableShadow_GetValueAsInt(arg1,arg2,arg3);
33529       SWIG_PYTHON_THREAD_END_ALLOW;
33530     }
33531 #ifndef SED_HACKS
33532     if ( bUseExceptions ) {
33533       CPLErr eclass = CPLGetLastErrorType();
33534       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33535         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33536       }
33537     }
33538 #endif
33539   }
33540   resultobj = SWIG_From_int(static_cast< int >(result));
33541   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33542   return resultobj;
33543 fail:
33544   return NULL;
33545 }
33546 
33547 
_wrap_RasterAttributeTable_GetValueAsDouble(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33548 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetValueAsDouble(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33549   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33550   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33551   int arg2 ;
33552   int arg3 ;
33553   void *argp1 = 0 ;
33554   int res1 = 0 ;
33555   int val2 ;
33556   int ecode2 = 0 ;
33557   int val3 ;
33558   int ecode3 = 0 ;
33559   PyObject * obj0 = 0 ;
33560   PyObject * obj1 = 0 ;
33561   PyObject * obj2 = 0 ;
33562   double result;
33563 
33564   if (!PyArg_ParseTuple(args,(char *)"OOO:RasterAttributeTable_GetValueAsDouble",&obj0,&obj1,&obj2)) SWIG_fail;
33565   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33566   if (!SWIG_IsOK(res1)) {
33567     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetValueAsDouble" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33568   }
33569   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33570   ecode2 = SWIG_AsVal_int(obj1, &val2);
33571   if (!SWIG_IsOK(ecode2)) {
33572     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetValueAsDouble" "', argument " "2"" of type '" "int""'");
33573   }
33574   arg2 = static_cast< int >(val2);
33575   ecode3 = SWIG_AsVal_int(obj2, &val3);
33576   if (!SWIG_IsOK(ecode3)) {
33577     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_GetValueAsDouble" "', argument " "3"" of type '" "int""'");
33578   }
33579   arg3 = static_cast< int >(val3);
33580   {
33581     if ( bUseExceptions ) {
33582       ClearErrorState();
33583     }
33584     {
33585       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33586       result = (double)GDALRasterAttributeTableShadow_GetValueAsDouble(arg1,arg2,arg3);
33587       SWIG_PYTHON_THREAD_END_ALLOW;
33588     }
33589 #ifndef SED_HACKS
33590     if ( bUseExceptions ) {
33591       CPLErr eclass = CPLGetLastErrorType();
33592       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33593         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33594       }
33595     }
33596 #endif
33597   }
33598   resultobj = SWIG_From_double(static_cast< double >(result));
33599   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33600   return resultobj;
33601 fail:
33602   return NULL;
33603 }
33604 
33605 
_wrap_RasterAttributeTable_SetValueAsString(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33606 SWIGINTERN PyObject *_wrap_RasterAttributeTable_SetValueAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33607   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33608   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33609   int arg2 ;
33610   int arg3 ;
33611   char *arg4 = (char *) 0 ;
33612   void *argp1 = 0 ;
33613   int res1 = 0 ;
33614   int val2 ;
33615   int ecode2 = 0 ;
33616   int val3 ;
33617   int ecode3 = 0 ;
33618   PyObject *str4 = 0 ;
33619   int bToFree4 = 0 ;
33620   PyObject * obj0 = 0 ;
33621   PyObject * obj1 = 0 ;
33622   PyObject * obj2 = 0 ;
33623   PyObject * obj3 = 0 ;
33624 
33625   if (!PyArg_ParseTuple(args,(char *)"OOOO:RasterAttributeTable_SetValueAsString",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
33626   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33627   if (!SWIG_IsOK(res1)) {
33628     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetValueAsString" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33629   }
33630   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33631   ecode2 = SWIG_AsVal_int(obj1, &val2);
33632   if (!SWIG_IsOK(ecode2)) {
33633     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetValueAsString" "', argument " "2"" of type '" "int""'");
33634   }
33635   arg2 = static_cast< int >(val2);
33636   ecode3 = SWIG_AsVal_int(obj2, &val3);
33637   if (!SWIG_IsOK(ecode3)) {
33638     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetValueAsString" "', argument " "3"" of type '" "int""'");
33639   }
33640   arg3 = static_cast< int >(val3);
33641   {
33642     /* %typemap(in) (tostring argin) */
33643     str4 = PyObject_Str( obj3 );
33644     if ( str4 == 0 ) {
33645       PyErr_SetString( PyExc_RuntimeError, "Unable to format argument as string");
33646       SWIG_fail;
33647     }
33648 
33649     arg4 = GDALPythonObjectToCStr(str4, &bToFree4);
33650   }
33651   {
33652     if ( bUseExceptions ) {
33653       ClearErrorState();
33654     }
33655     {
33656       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33657       GDALRasterAttributeTableShadow_SetValueAsString(arg1,arg2,arg3,(char const *)arg4);
33658       SWIG_PYTHON_THREAD_END_ALLOW;
33659     }
33660 #ifndef SED_HACKS
33661     if ( bUseExceptions ) {
33662       CPLErr eclass = CPLGetLastErrorType();
33663       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33664         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33665       }
33666     }
33667 #endif
33668   }
33669   resultobj = SWIG_Py_Void();
33670   {
33671     /* %typemap(freearg) (tostring argin) */
33672     if ( str4 != NULL)
33673     {
33674       Py_DECREF(str4);
33675     }
33676     GDALPythonFreeCStr(arg4, bToFree4);
33677   }
33678   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33679   return resultobj;
33680 fail:
33681   {
33682     /* %typemap(freearg) (tostring argin) */
33683     if ( str4 != NULL)
33684     {
33685       Py_DECREF(str4);
33686     }
33687     GDALPythonFreeCStr(arg4, bToFree4);
33688   }
33689   return NULL;
33690 }
33691 
33692 
_wrap_RasterAttributeTable_SetValueAsInt(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33693 SWIGINTERN PyObject *_wrap_RasterAttributeTable_SetValueAsInt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33694   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33695   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33696   int arg2 ;
33697   int arg3 ;
33698   int arg4 ;
33699   void *argp1 = 0 ;
33700   int res1 = 0 ;
33701   int val2 ;
33702   int ecode2 = 0 ;
33703   int val3 ;
33704   int ecode3 = 0 ;
33705   int val4 ;
33706   int ecode4 = 0 ;
33707   PyObject * obj0 = 0 ;
33708   PyObject * obj1 = 0 ;
33709   PyObject * obj2 = 0 ;
33710   PyObject * obj3 = 0 ;
33711 
33712   if (!PyArg_ParseTuple(args,(char *)"OOOO:RasterAttributeTable_SetValueAsInt",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
33713   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33714   if (!SWIG_IsOK(res1)) {
33715     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33716   }
33717   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33718   ecode2 = SWIG_AsVal_int(obj1, &val2);
33719   if (!SWIG_IsOK(ecode2)) {
33720     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "2"" of type '" "int""'");
33721   }
33722   arg2 = static_cast< int >(val2);
33723   ecode3 = SWIG_AsVal_int(obj2, &val3);
33724   if (!SWIG_IsOK(ecode3)) {
33725     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "3"" of type '" "int""'");
33726   }
33727   arg3 = static_cast< int >(val3);
33728   ecode4 = SWIG_AsVal_int(obj3, &val4);
33729   if (!SWIG_IsOK(ecode4)) {
33730     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "RasterAttributeTable_SetValueAsInt" "', argument " "4"" of type '" "int""'");
33731   }
33732   arg4 = static_cast< int >(val4);
33733   {
33734     if ( bUseExceptions ) {
33735       ClearErrorState();
33736     }
33737     {
33738       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33739       GDALRasterAttributeTableShadow_SetValueAsInt(arg1,arg2,arg3,arg4);
33740       SWIG_PYTHON_THREAD_END_ALLOW;
33741     }
33742 #ifndef SED_HACKS
33743     if ( bUseExceptions ) {
33744       CPLErr eclass = CPLGetLastErrorType();
33745       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33746         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33747       }
33748     }
33749 #endif
33750   }
33751   resultobj = SWIG_Py_Void();
33752   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33753   return resultobj;
33754 fail:
33755   return NULL;
33756 }
33757 
33758 
_wrap_RasterAttributeTable_SetValueAsDouble(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33759 SWIGINTERN PyObject *_wrap_RasterAttributeTable_SetValueAsDouble(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33760   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33761   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33762   int arg2 ;
33763   int arg3 ;
33764   double arg4 ;
33765   void *argp1 = 0 ;
33766   int res1 = 0 ;
33767   int val2 ;
33768   int ecode2 = 0 ;
33769   int val3 ;
33770   int ecode3 = 0 ;
33771   double val4 ;
33772   int ecode4 = 0 ;
33773   PyObject * obj0 = 0 ;
33774   PyObject * obj1 = 0 ;
33775   PyObject * obj2 = 0 ;
33776   PyObject * obj3 = 0 ;
33777 
33778   if (!PyArg_ParseTuple(args,(char *)"OOOO:RasterAttributeTable_SetValueAsDouble",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
33779   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33780   if (!SWIG_IsOK(res1)) {
33781     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33782   }
33783   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33784   ecode2 = SWIG_AsVal_int(obj1, &val2);
33785   if (!SWIG_IsOK(ecode2)) {
33786     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "2"" of type '" "int""'");
33787   }
33788   arg2 = static_cast< int >(val2);
33789   ecode3 = SWIG_AsVal_int(obj2, &val3);
33790   if (!SWIG_IsOK(ecode3)) {
33791     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "3"" of type '" "int""'");
33792   }
33793   arg3 = static_cast< int >(val3);
33794   ecode4 = SWIG_AsVal_double(obj3, &val4);
33795   if (!SWIG_IsOK(ecode4)) {
33796     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "RasterAttributeTable_SetValueAsDouble" "', argument " "4"" of type '" "double""'");
33797   }
33798   arg4 = static_cast< double >(val4);
33799   {
33800     if ( bUseExceptions ) {
33801       ClearErrorState();
33802     }
33803     {
33804       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33805       GDALRasterAttributeTableShadow_SetValueAsDouble(arg1,arg2,arg3,arg4);
33806       SWIG_PYTHON_THREAD_END_ALLOW;
33807     }
33808 #ifndef SED_HACKS
33809     if ( bUseExceptions ) {
33810       CPLErr eclass = CPLGetLastErrorType();
33811       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33812         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33813       }
33814     }
33815 #endif
33816   }
33817   resultobj = SWIG_Py_Void();
33818   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33819   return resultobj;
33820 fail:
33821   return NULL;
33822 }
33823 
33824 
_wrap_RasterAttributeTable_SetRowCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33825 SWIGINTERN PyObject *_wrap_RasterAttributeTable_SetRowCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33826   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33827   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33828   int arg2 ;
33829   void *argp1 = 0 ;
33830   int res1 = 0 ;
33831   int val2 ;
33832   int ecode2 = 0 ;
33833   PyObject * obj0 = 0 ;
33834   PyObject * obj1 = 0 ;
33835 
33836   if (!PyArg_ParseTuple(args,(char *)"OO:RasterAttributeTable_SetRowCount",&obj0,&obj1)) SWIG_fail;
33837   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33838   if (!SWIG_IsOK(res1)) {
33839     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetRowCount" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33840   }
33841   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33842   ecode2 = SWIG_AsVal_int(obj1, &val2);
33843   if (!SWIG_IsOK(ecode2)) {
33844     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetRowCount" "', argument " "2"" of type '" "int""'");
33845   }
33846   arg2 = static_cast< int >(val2);
33847   {
33848     if ( bUseExceptions ) {
33849       ClearErrorState();
33850     }
33851     {
33852       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33853       GDALRasterAttributeTableShadow_SetRowCount(arg1,arg2);
33854       SWIG_PYTHON_THREAD_END_ALLOW;
33855     }
33856 #ifndef SED_HACKS
33857     if ( bUseExceptions ) {
33858       CPLErr eclass = CPLGetLastErrorType();
33859       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33860         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33861       }
33862     }
33863 #endif
33864   }
33865   resultobj = SWIG_Py_Void();
33866   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33867   return resultobj;
33868 fail:
33869   return NULL;
33870 }
33871 
33872 
_wrap_RasterAttributeTable_CreateColumn(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33873 SWIGINTERN PyObject *_wrap_RasterAttributeTable_CreateColumn(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33874   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33875   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33876   char *arg2 = (char *) 0 ;
33877   GDALRATFieldType arg3 ;
33878   GDALRATFieldUsage arg4 ;
33879   void *argp1 = 0 ;
33880   int res1 = 0 ;
33881   int res2 ;
33882   char *buf2 = 0 ;
33883   int alloc2 = 0 ;
33884   int val3 ;
33885   int ecode3 = 0 ;
33886   int val4 ;
33887   int ecode4 = 0 ;
33888   PyObject * obj0 = 0 ;
33889   PyObject * obj1 = 0 ;
33890   PyObject * obj2 = 0 ;
33891   PyObject * obj3 = 0 ;
33892   int result;
33893 
33894   if (!PyArg_ParseTuple(args,(char *)"OOOO:RasterAttributeTable_CreateColumn",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
33895   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33896   if (!SWIG_IsOK(res1)) {
33897     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_CreateColumn" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33898   }
33899   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33900   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
33901   if (!SWIG_IsOK(res2)) {
33902     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RasterAttributeTable_CreateColumn" "', argument " "2"" of type '" "char const *""'");
33903   }
33904   arg2 = reinterpret_cast< char * >(buf2);
33905   ecode3 = SWIG_AsVal_int(obj2, &val3);
33906   if (!SWIG_IsOK(ecode3)) {
33907     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_CreateColumn" "', argument " "3"" of type '" "GDALRATFieldType""'");
33908   }
33909   arg3 = static_cast< GDALRATFieldType >(val3);
33910   ecode4 = SWIG_AsVal_int(obj3, &val4);
33911   if (!SWIG_IsOK(ecode4)) {
33912     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "RasterAttributeTable_CreateColumn" "', argument " "4"" of type '" "GDALRATFieldUsage""'");
33913   }
33914   arg4 = static_cast< GDALRATFieldUsage >(val4);
33915   {
33916     if ( bUseExceptions ) {
33917       ClearErrorState();
33918     }
33919     {
33920       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33921       result = (int)GDALRasterAttributeTableShadow_CreateColumn(arg1,(char const *)arg2,arg3,arg4);
33922       SWIG_PYTHON_THREAD_END_ALLOW;
33923     }
33924 #ifndef SED_HACKS
33925     if ( bUseExceptions ) {
33926       CPLErr eclass = CPLGetLastErrorType();
33927       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33928         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33929       }
33930     }
33931 #endif
33932   }
33933   resultobj = SWIG_From_int(static_cast< int >(result));
33934   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
33935   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33936   return resultobj;
33937 fail:
33938   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
33939   return NULL;
33940 }
33941 
33942 
_wrap_RasterAttributeTable_GetLinearBinning(PyObject * SWIGUNUSEDPARM (self),PyObject * args)33943 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetLinearBinning(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
33944   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
33945   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
33946   double *arg2 = (double *) 0 ;
33947   double *arg3 = (double *) 0 ;
33948   void *argp1 = 0 ;
33949   int res1 = 0 ;
33950   double temp2 ;
33951   int res2 = SWIG_TMPOBJ ;
33952   double temp3 ;
33953   int res3 = SWIG_TMPOBJ ;
33954   PyObject * obj0 = 0 ;
33955   bool result;
33956 
33957   arg2 = &temp2;
33958   arg3 = &temp3;
33959   if (!PyArg_ParseTuple(args,(char *)"O:RasterAttributeTable_GetLinearBinning",&obj0)) SWIG_fail;
33960   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
33961   if (!SWIG_IsOK(res1)) {
33962     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetLinearBinning" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
33963   }
33964   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
33965   {
33966     if ( bUseExceptions ) {
33967       ClearErrorState();
33968     }
33969     {
33970       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
33971       result = (bool)GDALRasterAttributeTableShadow_GetLinearBinning(arg1,arg2,arg3);
33972       SWIG_PYTHON_THREAD_END_ALLOW;
33973     }
33974 #ifndef SED_HACKS
33975     if ( bUseExceptions ) {
33976       CPLErr eclass = CPLGetLastErrorType();
33977       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
33978         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
33979       }
33980     }
33981 #endif
33982   }
33983   resultobj = SWIG_From_bool(static_cast< bool >(result));
33984   if (ReturnSame(SWIG_IsTmpObj(res2))) {
33985     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg2)));
33986   } else {
33987     int new_flags = SWIG_IsNewObj(res2) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
33988     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg2), SWIGTYPE_p_double, new_flags));
33989   }
33990   if (ReturnSame(SWIG_IsTmpObj(res3))) {
33991     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg3)));
33992   } else {
33993     int new_flags = SWIG_IsNewObj(res3) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
33994     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg3), SWIGTYPE_p_double, new_flags));
33995   }
33996   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
33997   return resultobj;
33998 fail:
33999   return NULL;
34000 }
34001 
34002 
_wrap_RasterAttributeTable_SetLinearBinning(PyObject * SWIGUNUSEDPARM (self),PyObject * args)34003 SWIGINTERN PyObject *_wrap_RasterAttributeTable_SetLinearBinning(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
34004   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34005   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
34006   double arg2 ;
34007   double arg3 ;
34008   void *argp1 = 0 ;
34009   int res1 = 0 ;
34010   double val2 ;
34011   int ecode2 = 0 ;
34012   double val3 ;
34013   int ecode3 = 0 ;
34014   PyObject * obj0 = 0 ;
34015   PyObject * obj1 = 0 ;
34016   PyObject * obj2 = 0 ;
34017   int result;
34018 
34019   if (!PyArg_ParseTuple(args,(char *)"OOO:RasterAttributeTable_SetLinearBinning",&obj0,&obj1,&obj2)) SWIG_fail;
34020   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
34021   if (!SWIG_IsOK(res1)) {
34022     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetLinearBinning" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
34023   }
34024   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
34025   ecode2 = SWIG_AsVal_double(obj1, &val2);
34026   if (!SWIG_IsOK(ecode2)) {
34027     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetLinearBinning" "', argument " "2"" of type '" "double""'");
34028   }
34029   arg2 = static_cast< double >(val2);
34030   ecode3 = SWIG_AsVal_double(obj2, &val3);
34031   if (!SWIG_IsOK(ecode3)) {
34032     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "RasterAttributeTable_SetLinearBinning" "', argument " "3"" of type '" "double""'");
34033   }
34034   arg3 = static_cast< double >(val3);
34035   {
34036     if ( bUseExceptions ) {
34037       ClearErrorState();
34038     }
34039     {
34040       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34041       result = (int)GDALRasterAttributeTableShadow_SetLinearBinning(arg1,arg2,arg3);
34042       SWIG_PYTHON_THREAD_END_ALLOW;
34043     }
34044 #ifndef SED_HACKS
34045     if ( bUseExceptions ) {
34046       CPLErr eclass = CPLGetLastErrorType();
34047       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34048         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34049       }
34050     }
34051 #endif
34052   }
34053   resultobj = SWIG_From_int(static_cast< int >(result));
34054   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34055   return resultobj;
34056 fail:
34057   return NULL;
34058 }
34059 
34060 
_wrap_RasterAttributeTable_GetRowOfValue(PyObject * SWIGUNUSEDPARM (self),PyObject * args)34061 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetRowOfValue(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
34062   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34063   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
34064   double arg2 ;
34065   void *argp1 = 0 ;
34066   int res1 = 0 ;
34067   double val2 ;
34068   int ecode2 = 0 ;
34069   PyObject * obj0 = 0 ;
34070   PyObject * obj1 = 0 ;
34071   int result;
34072 
34073   if (!PyArg_ParseTuple(args,(char *)"OO:RasterAttributeTable_GetRowOfValue",&obj0,&obj1)) SWIG_fail;
34074   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
34075   if (!SWIG_IsOK(res1)) {
34076     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetRowOfValue" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
34077   }
34078   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
34079   ecode2 = SWIG_AsVal_double(obj1, &val2);
34080   if (!SWIG_IsOK(ecode2)) {
34081     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_GetRowOfValue" "', argument " "2"" of type '" "double""'");
34082   }
34083   arg2 = static_cast< double >(val2);
34084   {
34085     if ( bUseExceptions ) {
34086       ClearErrorState();
34087     }
34088     {
34089       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34090       result = (int)GDALRasterAttributeTableShadow_GetRowOfValue(arg1,arg2);
34091       SWIG_PYTHON_THREAD_END_ALLOW;
34092     }
34093 #ifndef SED_HACKS
34094     if ( bUseExceptions ) {
34095       CPLErr eclass = CPLGetLastErrorType();
34096       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34097         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34098       }
34099     }
34100 #endif
34101   }
34102   resultobj = SWIG_From_int(static_cast< int >(result));
34103   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34104   return resultobj;
34105 fail:
34106   return NULL;
34107 }
34108 
34109 
_wrap_RasterAttributeTable_ChangesAreWrittenToFile(PyObject * SWIGUNUSEDPARM (self),PyObject * args)34110 SWIGINTERN PyObject *_wrap_RasterAttributeTable_ChangesAreWrittenToFile(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
34111   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34112   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
34113   void *argp1 = 0 ;
34114   int res1 = 0 ;
34115   PyObject * obj0 = 0 ;
34116   int result;
34117 
34118   if (!PyArg_ParseTuple(args,(char *)"O:RasterAttributeTable_ChangesAreWrittenToFile",&obj0)) SWIG_fail;
34119   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
34120   if (!SWIG_IsOK(res1)) {
34121     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_ChangesAreWrittenToFile" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
34122   }
34123   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
34124   {
34125     if ( bUseExceptions ) {
34126       ClearErrorState();
34127     }
34128     {
34129       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34130       result = (int)GDALRasterAttributeTableShadow_ChangesAreWrittenToFile(arg1);
34131       SWIG_PYTHON_THREAD_END_ALLOW;
34132     }
34133 #ifndef SED_HACKS
34134     if ( bUseExceptions ) {
34135       CPLErr eclass = CPLGetLastErrorType();
34136       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34137         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34138       }
34139     }
34140 #endif
34141   }
34142   resultobj = SWIG_From_int(static_cast< int >(result));
34143   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34144   return resultobj;
34145 fail:
34146   return NULL;
34147 }
34148 
34149 
_wrap_RasterAttributeTable_DumpReadable(PyObject * SWIGUNUSEDPARM (self),PyObject * args)34150 SWIGINTERN PyObject *_wrap_RasterAttributeTable_DumpReadable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
34151   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34152   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
34153   void *argp1 = 0 ;
34154   int res1 = 0 ;
34155   PyObject * obj0 = 0 ;
34156 
34157   if (!PyArg_ParseTuple(args,(char *)"O:RasterAttributeTable_DumpReadable",&obj0)) SWIG_fail;
34158   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
34159   if (!SWIG_IsOK(res1)) {
34160     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_DumpReadable" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
34161   }
34162   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
34163   {
34164     if ( bUseExceptions ) {
34165       ClearErrorState();
34166     }
34167     {
34168       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34169       GDALRasterAttributeTableShadow_DumpReadable(arg1);
34170       SWIG_PYTHON_THREAD_END_ALLOW;
34171     }
34172 #ifndef SED_HACKS
34173     if ( bUseExceptions ) {
34174       CPLErr eclass = CPLGetLastErrorType();
34175       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34176         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34177       }
34178     }
34179 #endif
34180   }
34181   resultobj = SWIG_Py_Void();
34182   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34183   return resultobj;
34184 fail:
34185   return NULL;
34186 }
34187 
34188 
_wrap_RasterAttributeTable_SetTableType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)34189 SWIGINTERN PyObject *_wrap_RasterAttributeTable_SetTableType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
34190   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34191   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
34192   GDALRATTableType arg2 ;
34193   void *argp1 = 0 ;
34194   int res1 = 0 ;
34195   int val2 ;
34196   int ecode2 = 0 ;
34197   PyObject * obj0 = 0 ;
34198   PyObject * obj1 = 0 ;
34199 
34200   if (!PyArg_ParseTuple(args,(char *)"OO:RasterAttributeTable_SetTableType",&obj0,&obj1)) SWIG_fail;
34201   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
34202   if (!SWIG_IsOK(res1)) {
34203     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_SetTableType" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
34204   }
34205   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
34206   ecode2 = SWIG_AsVal_int(obj1, &val2);
34207   if (!SWIG_IsOK(ecode2)) {
34208     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RasterAttributeTable_SetTableType" "', argument " "2"" of type '" "GDALRATTableType""'");
34209   }
34210   arg2 = static_cast< GDALRATTableType >(val2);
34211   {
34212     if ( bUseExceptions ) {
34213       ClearErrorState();
34214     }
34215     {
34216       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34217       GDALRasterAttributeTableShadow_SetTableType(arg1,arg2);
34218       SWIG_PYTHON_THREAD_END_ALLOW;
34219     }
34220 #ifndef SED_HACKS
34221     if ( bUseExceptions ) {
34222       CPLErr eclass = CPLGetLastErrorType();
34223       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34224         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34225       }
34226     }
34227 #endif
34228   }
34229   resultobj = SWIG_Py_Void();
34230   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34231   return resultobj;
34232 fail:
34233   return NULL;
34234 }
34235 
34236 
_wrap_RasterAttributeTable_GetTableType(PyObject * SWIGUNUSEDPARM (self),PyObject * args)34237 SWIGINTERN PyObject *_wrap_RasterAttributeTable_GetTableType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
34238   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34239   GDALRasterAttributeTableShadow *arg1 = (GDALRasterAttributeTableShadow *) 0 ;
34240   void *argp1 = 0 ;
34241   int res1 = 0 ;
34242   PyObject * obj0 = 0 ;
34243   GDALRATTableType result;
34244 
34245   if (!PyArg_ParseTuple(args,(char *)"O:RasterAttributeTable_GetTableType",&obj0)) SWIG_fail;
34246   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterAttributeTableShadow, 0 |  0 );
34247   if (!SWIG_IsOK(res1)) {
34248     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterAttributeTable_GetTableType" "', argument " "1"" of type '" "GDALRasterAttributeTableShadow *""'");
34249   }
34250   arg1 = reinterpret_cast< GDALRasterAttributeTableShadow * >(argp1);
34251   {
34252     if ( bUseExceptions ) {
34253       ClearErrorState();
34254     }
34255     {
34256       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34257       result = (GDALRATTableType)GDALRasterAttributeTableShadow_GetTableType(arg1);
34258       SWIG_PYTHON_THREAD_END_ALLOW;
34259     }
34260 #ifndef SED_HACKS
34261     if ( bUseExceptions ) {
34262       CPLErr eclass = CPLGetLastErrorType();
34263       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34264         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34265       }
34266     }
34267 #endif
34268   }
34269   resultobj = SWIG_From_int(static_cast< int >(result));
34270   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34271   return resultobj;
34272 fail:
34273   return NULL;
34274 }
34275 
34276 
RasterAttributeTable_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)34277 SWIGINTERN PyObject *RasterAttributeTable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
34278   PyObject *obj;
34279   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
34280   SWIG_TypeNewClientData(SWIGTYPE_p_GDALRasterAttributeTableShadow, SWIG_NewClientData(obj));
34281   return SWIG_Py_Void();
34282 }
34283 
_wrap_TermProgress_nocb(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)34284 SWIGINTERN PyObject *_wrap_TermProgress_nocb(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
34285   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34286   double arg1 ;
34287   char *arg2 = (char *) NULL ;
34288   void *arg3 = (void *) NULL ;
34289   double val1 ;
34290   int ecode1 = 0 ;
34291   int res2 ;
34292   char *buf2 = 0 ;
34293   int alloc2 = 0 ;
34294   int res3 ;
34295   PyObject * obj0 = 0 ;
34296   PyObject * obj1 = 0 ;
34297   PyObject * obj2 = 0 ;
34298   char *  kwnames[] = {
34299     (char *) "dfProgress",(char *) "pszMessage",(char *) "pData", NULL
34300   };
34301   int result;
34302 
34303   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OO:TermProgress_nocb",kwnames,&obj0,&obj1,&obj2)) SWIG_fail;
34304   ecode1 = SWIG_AsVal_double(obj0, &val1);
34305   if (!SWIG_IsOK(ecode1)) {
34306     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "TermProgress_nocb" "', argument " "1"" of type '" "double""'");
34307   }
34308   arg1 = static_cast< double >(val1);
34309   if (obj1) {
34310     res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
34311     if (!SWIG_IsOK(res2)) {
34312       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TermProgress_nocb" "', argument " "2"" of type '" "char const *""'");
34313     }
34314     arg2 = reinterpret_cast< char * >(buf2);
34315   }
34316   if (obj2) {
34317     res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0);
34318     if (!SWIG_IsOK(res3)) {
34319       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "TermProgress_nocb" "', argument " "3"" of type '" "void *""'");
34320     }
34321   }
34322   {
34323     if ( bUseExceptions ) {
34324       ClearErrorState();
34325     }
34326     {
34327       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34328       result = (int)GDALTermProgress_nocb(arg1,(char const *)arg2,arg3);
34329       SWIG_PYTHON_THREAD_END_ALLOW;
34330     }
34331 #ifndef SED_HACKS
34332     if ( bUseExceptions ) {
34333       CPLErr eclass = CPLGetLastErrorType();
34334       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34335         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34336       }
34337     }
34338 #endif
34339   }
34340   resultobj = SWIG_From_int(static_cast< int >(result));
34341   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
34342   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34343   return resultobj;
34344 fail:
34345   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
34346   return NULL;
34347 }
34348 
34349 
_wrap_ComputeMedianCutPCT(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)34350 SWIGINTERN PyObject *_wrap_ComputeMedianCutPCT(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
34351   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34352   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
34353   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
34354   GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
34355   int arg4 ;
34356   GDALColorTableShadow *arg5 = (GDALColorTableShadow *) 0 ;
34357   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
34358   void *arg7 = (void *) NULL ;
34359   void *argp1 = 0 ;
34360   int res1 = 0 ;
34361   void *argp2 = 0 ;
34362   int res2 = 0 ;
34363   void *argp3 = 0 ;
34364   int res3 = 0 ;
34365   int val4 ;
34366   int ecode4 = 0 ;
34367   void *argp5 = 0 ;
34368   int res5 = 0 ;
34369   PyObject * obj0 = 0 ;
34370   PyObject * obj1 = 0 ;
34371   PyObject * obj2 = 0 ;
34372   PyObject * obj3 = 0 ;
34373   PyObject * obj4 = 0 ;
34374   PyObject * obj5 = 0 ;
34375   PyObject * obj6 = 0 ;
34376   char *  kwnames[] = {
34377     (char *) "red",(char *) "green",(char *) "blue",(char *) "num_colors",(char *) "colors",(char *) "callback",(char *) "callback_data", NULL
34378   };
34379   int result;
34380 
34381   /* %typemap(arginit) ( const char* callback_data=NULL)  */
34382   PyProgressData *psProgressInfo;
34383   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
34384   psProgressInfo->nLastReported = -1;
34385   psProgressInfo->psPyCallback = NULL;
34386   psProgressInfo->psPyCallbackData = NULL;
34387   arg7 = psProgressInfo;
34388   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOO|OO:ComputeMedianCutPCT",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
34389   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34390   if (!SWIG_IsOK(res1)) {
34391     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ComputeMedianCutPCT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
34392   }
34393   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
34394   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34395   if (!SWIG_IsOK(res2)) {
34396     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ComputeMedianCutPCT" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
34397   }
34398   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
34399   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34400   if (!SWIG_IsOK(res3)) {
34401     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ComputeMedianCutPCT" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
34402   }
34403   arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
34404   ecode4 = SWIG_AsVal_int(obj3, &val4);
34405   if (!SWIG_IsOK(ecode4)) {
34406     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ComputeMedianCutPCT" "', argument " "4"" of type '" "int""'");
34407   }
34408   arg4 = static_cast< int >(val4);
34409   res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
34410   if (!SWIG_IsOK(res5)) {
34411     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "ComputeMedianCutPCT" "', argument " "5"" of type '" "GDALColorTableShadow *""'");
34412   }
34413   arg5 = reinterpret_cast< GDALColorTableShadow * >(argp5);
34414   if (obj5) {
34415     {
34416       /* %typemap(in) (GDALProgressFunc callback = NULL) */
34417       /* callback_func typemap */
34418 
34419       /* In some cases 0 is passed instead of None. */
34420       /* See https://github.com/OSGeo/gdal/pull/219 */
34421       if ( PyLong_Check(obj5) || PyInt_Check(obj5) )
34422       {
34423         if( PyLong_AsLong(obj5) == 0 )
34424         {
34425           obj5 = Py_None;
34426         }
34427       }
34428 
34429       if (obj5 && obj5 != Py_None ) {
34430         void* cbfunction = NULL;
34431         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj5,
34432             (void**)&cbfunction,
34433             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
34434             SWIG_POINTER_EXCEPTION | 0 ));
34435 
34436         if ( cbfunction == GDALTermProgress ) {
34437           arg6 = GDALTermProgress;
34438         } else {
34439           if (!PyCallable_Check(obj5)) {
34440             PyErr_SetString( PyExc_RuntimeError,
34441               "Object given is not a Python function" );
34442             SWIG_fail;
34443           }
34444           psProgressInfo->psPyCallback = obj5;
34445           arg6 = PyProgressProxy;
34446         }
34447 
34448       }
34449 
34450     }
34451   }
34452   if (obj6) {
34453     {
34454       /* %typemap(in) ( void* callback_data=NULL)  */
34455       psProgressInfo->psPyCallbackData = obj6 ;
34456     }
34457   }
34458   {
34459     if (!arg1) {
34460       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34461     }
34462   }
34463   {
34464     if (!arg2) {
34465       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34466     }
34467   }
34468   {
34469     if (!arg3) {
34470       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34471     }
34472   }
34473   {
34474     if (!arg5) {
34475       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34476     }
34477   }
34478   {
34479     if ( bUseExceptions ) {
34480       ClearErrorState();
34481     }
34482     {
34483       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34484       result = (int)ComputeMedianCutPCT(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
34485       SWIG_PYTHON_THREAD_END_ALLOW;
34486     }
34487 #ifndef SED_HACKS
34488     if ( bUseExceptions ) {
34489       CPLErr eclass = CPLGetLastErrorType();
34490       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34491         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34492       }
34493     }
34494 #endif
34495   }
34496   resultobj = SWIG_From_int(static_cast< int >(result));
34497   {
34498     /* %typemap(freearg) ( void* callback_data=NULL)  */
34499 
34500     CPLFree(psProgressInfo);
34501 
34502   }
34503   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34504   return resultobj;
34505 fail:
34506   {
34507     /* %typemap(freearg) ( void* callback_data=NULL)  */
34508 
34509     CPLFree(psProgressInfo);
34510 
34511   }
34512   return NULL;
34513 }
34514 
34515 
_wrap_DitherRGB2PCT(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)34516 SWIGINTERN PyObject *_wrap_DitherRGB2PCT(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
34517   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34518   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
34519   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
34520   GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
34521   GDALRasterBandShadow *arg4 = (GDALRasterBandShadow *) 0 ;
34522   GDALColorTableShadow *arg5 = (GDALColorTableShadow *) 0 ;
34523   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
34524   void *arg7 = (void *) NULL ;
34525   void *argp1 = 0 ;
34526   int res1 = 0 ;
34527   void *argp2 = 0 ;
34528   int res2 = 0 ;
34529   void *argp3 = 0 ;
34530   int res3 = 0 ;
34531   void *argp4 = 0 ;
34532   int res4 = 0 ;
34533   void *argp5 = 0 ;
34534   int res5 = 0 ;
34535   PyObject * obj0 = 0 ;
34536   PyObject * obj1 = 0 ;
34537   PyObject * obj2 = 0 ;
34538   PyObject * obj3 = 0 ;
34539   PyObject * obj4 = 0 ;
34540   PyObject * obj5 = 0 ;
34541   PyObject * obj6 = 0 ;
34542   char *  kwnames[] = {
34543     (char *) "red",(char *) "green",(char *) "blue",(char *) "target",(char *) "colors",(char *) "callback",(char *) "callback_data", NULL
34544   };
34545   int result;
34546 
34547   /* %typemap(arginit) ( const char* callback_data=NULL)  */
34548   PyProgressData *psProgressInfo;
34549   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
34550   psProgressInfo->nLastReported = -1;
34551   psProgressInfo->psPyCallback = NULL;
34552   psProgressInfo->psPyCallbackData = NULL;
34553   arg7 = psProgressInfo;
34554   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOO|OO:DitherRGB2PCT",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
34555   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34556   if (!SWIG_IsOK(res1)) {
34557     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DitherRGB2PCT" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
34558   }
34559   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
34560   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34561   if (!SWIG_IsOK(res2)) {
34562     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DitherRGB2PCT" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
34563   }
34564   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
34565   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34566   if (!SWIG_IsOK(res3)) {
34567     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DitherRGB2PCT" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
34568   }
34569   arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
34570   res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34571   if (!SWIG_IsOK(res4)) {
34572     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DitherRGB2PCT" "', argument " "4"" of type '" "GDALRasterBandShadow *""'");
34573   }
34574   arg4 = reinterpret_cast< GDALRasterBandShadow * >(argp4);
34575   res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_GDALColorTableShadow, 0 |  0 );
34576   if (!SWIG_IsOK(res5)) {
34577     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "DitherRGB2PCT" "', argument " "5"" of type '" "GDALColorTableShadow *""'");
34578   }
34579   arg5 = reinterpret_cast< GDALColorTableShadow * >(argp5);
34580   if (obj5) {
34581     {
34582       /* %typemap(in) (GDALProgressFunc callback = NULL) */
34583       /* callback_func typemap */
34584 
34585       /* In some cases 0 is passed instead of None. */
34586       /* See https://github.com/OSGeo/gdal/pull/219 */
34587       if ( PyLong_Check(obj5) || PyInt_Check(obj5) )
34588       {
34589         if( PyLong_AsLong(obj5) == 0 )
34590         {
34591           obj5 = Py_None;
34592         }
34593       }
34594 
34595       if (obj5 && obj5 != Py_None ) {
34596         void* cbfunction = NULL;
34597         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj5,
34598             (void**)&cbfunction,
34599             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
34600             SWIG_POINTER_EXCEPTION | 0 ));
34601 
34602         if ( cbfunction == GDALTermProgress ) {
34603           arg6 = GDALTermProgress;
34604         } else {
34605           if (!PyCallable_Check(obj5)) {
34606             PyErr_SetString( PyExc_RuntimeError,
34607               "Object given is not a Python function" );
34608             SWIG_fail;
34609           }
34610           psProgressInfo->psPyCallback = obj5;
34611           arg6 = PyProgressProxy;
34612         }
34613 
34614       }
34615 
34616     }
34617   }
34618   if (obj6) {
34619     {
34620       /* %typemap(in) ( void* callback_data=NULL)  */
34621       psProgressInfo->psPyCallbackData = obj6 ;
34622     }
34623   }
34624   {
34625     if (!arg1) {
34626       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34627     }
34628   }
34629   {
34630     if (!arg2) {
34631       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34632     }
34633   }
34634   {
34635     if (!arg3) {
34636       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34637     }
34638   }
34639   {
34640     if (!arg4) {
34641       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34642     }
34643   }
34644   {
34645     if (!arg5) {
34646       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34647     }
34648   }
34649   {
34650     if ( bUseExceptions ) {
34651       ClearErrorState();
34652     }
34653     {
34654       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34655       result = (int)DitherRGB2PCT(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
34656       SWIG_PYTHON_THREAD_END_ALLOW;
34657     }
34658 #ifndef SED_HACKS
34659     if ( bUseExceptions ) {
34660       CPLErr eclass = CPLGetLastErrorType();
34661       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34662         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34663       }
34664     }
34665 #endif
34666   }
34667   resultobj = SWIG_From_int(static_cast< int >(result));
34668   {
34669     /* %typemap(freearg) ( void* callback_data=NULL)  */
34670 
34671     CPLFree(psProgressInfo);
34672 
34673   }
34674   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34675   return resultobj;
34676 fail:
34677   {
34678     /* %typemap(freearg) ( void* callback_data=NULL)  */
34679 
34680     CPLFree(psProgressInfo);
34681 
34682   }
34683   return NULL;
34684 }
34685 
34686 
_wrap_ReprojectImage(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)34687 SWIGINTERN PyObject *_wrap_ReprojectImage(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
34688   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34689   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
34690   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
34691   char *arg3 = (char *) NULL ;
34692   char *arg4 = (char *) NULL ;
34693   GDALResampleAlg arg5 = (GDALResampleAlg) GRA_NearestNeighbour ;
34694   double arg6 = (double) 0.0 ;
34695   double arg7 = (double) 0.0 ;
34696   GDALProgressFunc arg8 = (GDALProgressFunc) NULL ;
34697   void *arg9 = (void *) NULL ;
34698   char **arg10 = (char **) NULL ;
34699   void *argp1 = 0 ;
34700   int res1 = 0 ;
34701   void *argp2 = 0 ;
34702   int res2 = 0 ;
34703   int res3 ;
34704   char *buf3 = 0 ;
34705   int alloc3 = 0 ;
34706   int res4 ;
34707   char *buf4 = 0 ;
34708   int alloc4 = 0 ;
34709   int val5 ;
34710   int ecode5 = 0 ;
34711   double val6 ;
34712   int ecode6 = 0 ;
34713   double val7 ;
34714   int ecode7 = 0 ;
34715   PyObject * obj0 = 0 ;
34716   PyObject * obj1 = 0 ;
34717   PyObject * obj2 = 0 ;
34718   PyObject * obj3 = 0 ;
34719   PyObject * obj4 = 0 ;
34720   PyObject * obj5 = 0 ;
34721   PyObject * obj6 = 0 ;
34722   PyObject * obj7 = 0 ;
34723   PyObject * obj8 = 0 ;
34724   PyObject * obj9 = 0 ;
34725   char *  kwnames[] = {
34726     (char *) "src_ds",(char *) "dst_ds",(char *) "src_wkt",(char *) "dst_wkt",(char *) "eResampleAlg",(char *) "WarpMemoryLimit",(char *) "maxerror",(char *) "callback",(char *) "callback_data",(char *) "options", NULL
34727   };
34728   CPLErr result;
34729 
34730   /* %typemap(arginit) ( const char* callback_data=NULL)  */
34731   PyProgressData *psProgressInfo;
34732   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
34733   psProgressInfo->nLastReported = -1;
34734   psProgressInfo->psPyCallback = NULL;
34735   psProgressInfo->psPyCallbackData = NULL;
34736   arg9 = psProgressInfo;
34737   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOOOOO:ReprojectImage",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
34738   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
34739   if (!SWIG_IsOK(res1)) {
34740     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ReprojectImage" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
34741   }
34742   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
34743   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
34744   if (!SWIG_IsOK(res2)) {
34745     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ReprojectImage" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
34746   }
34747   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
34748   if (obj2) {
34749     res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
34750     if (!SWIG_IsOK(res3)) {
34751       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ReprojectImage" "', argument " "3"" of type '" "char const *""'");
34752     }
34753     arg3 = reinterpret_cast< char * >(buf3);
34754   }
34755   if (obj3) {
34756     res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
34757     if (!SWIG_IsOK(res4)) {
34758       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ReprojectImage" "', argument " "4"" of type '" "char const *""'");
34759     }
34760     arg4 = reinterpret_cast< char * >(buf4);
34761   }
34762   if (obj4) {
34763     ecode5 = SWIG_AsVal_int(obj4, &val5);
34764     if (!SWIG_IsOK(ecode5)) {
34765       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ReprojectImage" "', argument " "5"" of type '" "GDALResampleAlg""'");
34766     }
34767     arg5 = static_cast< GDALResampleAlg >(val5);
34768   }
34769   if (obj5) {
34770     ecode6 = SWIG_AsVal_double(obj5, &val6);
34771     if (!SWIG_IsOK(ecode6)) {
34772       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ReprojectImage" "', argument " "6"" of type '" "double""'");
34773     }
34774     arg6 = static_cast< double >(val6);
34775   }
34776   if (obj6) {
34777     ecode7 = SWIG_AsVal_double(obj6, &val7);
34778     if (!SWIG_IsOK(ecode7)) {
34779       SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ReprojectImage" "', argument " "7"" of type '" "double""'");
34780     }
34781     arg7 = static_cast< double >(val7);
34782   }
34783   if (obj7) {
34784     {
34785       /* %typemap(in) (GDALProgressFunc callback = NULL) */
34786       /* callback_func typemap */
34787 
34788       /* In some cases 0 is passed instead of None. */
34789       /* See https://github.com/OSGeo/gdal/pull/219 */
34790       if ( PyLong_Check(obj7) || PyInt_Check(obj7) )
34791       {
34792         if( PyLong_AsLong(obj7) == 0 )
34793         {
34794           obj7 = Py_None;
34795         }
34796       }
34797 
34798       if (obj7 && obj7 != Py_None ) {
34799         void* cbfunction = NULL;
34800         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj7,
34801             (void**)&cbfunction,
34802             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
34803             SWIG_POINTER_EXCEPTION | 0 ));
34804 
34805         if ( cbfunction == GDALTermProgress ) {
34806           arg8 = GDALTermProgress;
34807         } else {
34808           if (!PyCallable_Check(obj7)) {
34809             PyErr_SetString( PyExc_RuntimeError,
34810               "Object given is not a Python function" );
34811             SWIG_fail;
34812           }
34813           psProgressInfo->psPyCallback = obj7;
34814           arg8 = PyProgressProxy;
34815         }
34816 
34817       }
34818 
34819     }
34820   }
34821   if (obj8) {
34822     {
34823       /* %typemap(in) ( void* callback_data=NULL)  */
34824       psProgressInfo->psPyCallbackData = obj8 ;
34825     }
34826   }
34827   if (obj9) {
34828     {
34829       /* %typemap(in) char **options */
34830       int bErr = FALSE;
34831       arg10 = CSLFromPySequence(obj9, &bErr);
34832       if( bErr )
34833       {
34834         SWIG_fail;
34835       }
34836     }
34837   }
34838   {
34839     if (!arg1) {
34840       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34841     }
34842   }
34843   {
34844     if (!arg2) {
34845       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34846     }
34847   }
34848   {
34849     if ( bUseExceptions ) {
34850       ClearErrorState();
34851     }
34852     {
34853       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
34854       CPL_IGNORE_RET_VAL(result = (CPLErr)ReprojectImage(arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7,arg8,arg9,arg10));
34855       SWIG_PYTHON_THREAD_END_ALLOW;
34856     }
34857 #ifndef SED_HACKS
34858     if ( bUseExceptions ) {
34859       CPLErr eclass = CPLGetLastErrorType();
34860       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
34861         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
34862       }
34863     }
34864 #endif
34865   }
34866   resultobj = SWIG_From_int(static_cast< int >(result));
34867   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
34868   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
34869   {
34870     /* %typemap(freearg) ( void* callback_data=NULL)  */
34871 
34872     CPLFree(psProgressInfo);
34873 
34874   }
34875   {
34876     /* %typemap(freearg) char **options */
34877     CSLDestroy( arg10 );
34878   }
34879   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
34880   return resultobj;
34881 fail:
34882   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
34883   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
34884   {
34885     /* %typemap(freearg) ( void* callback_data=NULL)  */
34886 
34887     CPLFree(psProgressInfo);
34888 
34889   }
34890   {
34891     /* %typemap(freearg) char **options */
34892     CSLDestroy( arg10 );
34893   }
34894   return NULL;
34895 }
34896 
34897 
_wrap_ComputeProximity(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)34898 SWIGINTERN PyObject *_wrap_ComputeProximity(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
34899   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
34900   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
34901   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
34902   char **arg3 = (char **) NULL ;
34903   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
34904   void *arg5 = (void *) NULL ;
34905   void *argp1 = 0 ;
34906   int res1 = 0 ;
34907   void *argp2 = 0 ;
34908   int res2 = 0 ;
34909   PyObject * obj0 = 0 ;
34910   PyObject * obj1 = 0 ;
34911   PyObject * obj2 = 0 ;
34912   PyObject * obj3 = 0 ;
34913   PyObject * obj4 = 0 ;
34914   char *  kwnames[] = {
34915     (char *) "srcBand",(char *) "proximityBand",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
34916   };
34917   int result;
34918 
34919   /* %typemap(arginit) ( const char* callback_data=NULL)  */
34920   PyProgressData *psProgressInfo;
34921   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
34922   psProgressInfo->nLastReported = -1;
34923   psProgressInfo->psPyCallback = NULL;
34924   psProgressInfo->psPyCallbackData = NULL;
34925   arg5 = psProgressInfo;
34926   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOO:ComputeProximity",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
34927   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34928   if (!SWIG_IsOK(res1)) {
34929     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ComputeProximity" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
34930   }
34931   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
34932   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
34933   if (!SWIG_IsOK(res2)) {
34934     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ComputeProximity" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
34935   }
34936   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
34937   if (obj2) {
34938     {
34939       /* %typemap(in) char **options */
34940       int bErr = FALSE;
34941       arg3 = CSLFromPySequence(obj2, &bErr);
34942       if( bErr )
34943       {
34944         SWIG_fail;
34945       }
34946     }
34947   }
34948   if (obj3) {
34949     {
34950       /* %typemap(in) (GDALProgressFunc callback = NULL) */
34951       /* callback_func typemap */
34952 
34953       /* In some cases 0 is passed instead of None. */
34954       /* See https://github.com/OSGeo/gdal/pull/219 */
34955       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
34956       {
34957         if( PyLong_AsLong(obj3) == 0 )
34958         {
34959           obj3 = Py_None;
34960         }
34961       }
34962 
34963       if (obj3 && obj3 != Py_None ) {
34964         void* cbfunction = NULL;
34965         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
34966             (void**)&cbfunction,
34967             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
34968             SWIG_POINTER_EXCEPTION | 0 ));
34969 
34970         if ( cbfunction == GDALTermProgress ) {
34971           arg4 = GDALTermProgress;
34972         } else {
34973           if (!PyCallable_Check(obj3)) {
34974             PyErr_SetString( PyExc_RuntimeError,
34975               "Object given is not a Python function" );
34976             SWIG_fail;
34977           }
34978           psProgressInfo->psPyCallback = obj3;
34979           arg4 = PyProgressProxy;
34980         }
34981 
34982       }
34983 
34984     }
34985   }
34986   if (obj4) {
34987     {
34988       /* %typemap(in) ( void* callback_data=NULL)  */
34989       psProgressInfo->psPyCallbackData = obj4 ;
34990     }
34991   }
34992   {
34993     if (!arg1) {
34994       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
34995     }
34996   }
34997   {
34998     if (!arg2) {
34999       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35000     }
35001   }
35002   {
35003     if ( bUseExceptions ) {
35004       ClearErrorState();
35005     }
35006     {
35007       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
35008       result = (int)ComputeProximity(arg1,arg2,arg3,arg4,arg5);
35009       SWIG_PYTHON_THREAD_END_ALLOW;
35010     }
35011 #ifndef SED_HACKS
35012     if ( bUseExceptions ) {
35013       CPLErr eclass = CPLGetLastErrorType();
35014       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35015         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
35016       }
35017     }
35018 #endif
35019   }
35020   resultobj = SWIG_From_int(static_cast< int >(result));
35021   {
35022     /* %typemap(freearg) char **options */
35023     CSLDestroy( arg3 );
35024   }
35025   {
35026     /* %typemap(freearg) ( void* callback_data=NULL)  */
35027 
35028     CPLFree(psProgressInfo);
35029 
35030   }
35031   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
35032   return resultobj;
35033 fail:
35034   {
35035     /* %typemap(freearg) char **options */
35036     CSLDestroy( arg3 );
35037   }
35038   {
35039     /* %typemap(freearg) ( void* callback_data=NULL)  */
35040 
35041     CPLFree(psProgressInfo);
35042 
35043   }
35044   return NULL;
35045 }
35046 
35047 
_wrap_RasterizeLayer(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)35048 SWIGINTERN PyObject *_wrap_RasterizeLayer(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
35049   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
35050   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
35051   int arg2 ;
35052   int *arg3 = (int *) 0 ;
35053   OGRLayerShadow *arg4 = (OGRLayerShadow *) 0 ;
35054   void *arg5 = (void *) NULL ;
35055   void *arg6 = (void *) NULL ;
35056   int arg7 = (int) 0 ;
35057   double *arg8 = (double *) NULL ;
35058   char **arg9 = (char **) NULL ;
35059   GDALProgressFunc arg10 = (GDALProgressFunc) NULL ;
35060   void *arg11 = (void *) NULL ;
35061   void *argp1 = 0 ;
35062   int res1 = 0 ;
35063   void *argp4 = 0 ;
35064   int res4 = 0 ;
35065   int res5 ;
35066   int res6 ;
35067   PyObject * obj0 = 0 ;
35068   PyObject * obj1 = 0 ;
35069   PyObject * obj2 = 0 ;
35070   PyObject * obj3 = 0 ;
35071   PyObject * obj4 = 0 ;
35072   PyObject * obj5 = 0 ;
35073   PyObject * obj6 = 0 ;
35074   PyObject * obj7 = 0 ;
35075   PyObject * obj8 = 0 ;
35076   char *  kwnames[] = {
35077     (char *) "dataset",(char *) "bands",(char *) "layer",(char *) "pfnTransformer",(char *) "pTransformArg",(char *) "burn_values",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
35078   };
35079   int result;
35080 
35081   /* %typemap(arginit) ( const char* callback_data=NULL)  */
35082   PyProgressData *psProgressInfo;
35083   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
35084   psProgressInfo->nLastReported = -1;
35085   psProgressInfo->psPyCallback = NULL;
35086   psProgressInfo->psPyCallbackData = NULL;
35087   arg11 = psProgressInfo;
35088   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|OOOOOO:RasterizeLayer",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail;
35089   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
35090   if (!SWIG_IsOK(res1)) {
35091     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RasterizeLayer" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
35092   }
35093   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
35094   {
35095     /* %typemap(in,numinputs=1) (int nList, int* pList)*/
35096     arg3 = CreateCIntListFromSequence(obj1, &arg2);
35097     if( arg2 < 0 ) {
35098       SWIG_fail;
35099     }
35100   }
35101   res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
35102   if (!SWIG_IsOK(res4)) {
35103     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RasterizeLayer" "', argument " "4"" of type '" "OGRLayerShadow *""'");
35104   }
35105   arg4 = reinterpret_cast< OGRLayerShadow * >(argp4);
35106   if (obj3) {
35107     res5 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg5), 0, 0);
35108     if (!SWIG_IsOK(res5)) {
35109       SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "RasterizeLayer" "', argument " "5"" of type '" "void *""'");
35110     }
35111   }
35112   if (obj4) {
35113     res6 = SWIG_ConvertPtr(obj4,SWIG_as_voidptrptr(&arg6), 0, 0);
35114     if (!SWIG_IsOK(res6)) {
35115       SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "RasterizeLayer" "', argument " "6"" of type '" "void *""'");
35116     }
35117   }
35118   if (obj5) {
35119     {
35120       /* %typemap(in,numinputs=1) (int nList, double* pList)*/
35121       /* check if is List */
35122       if ( !PySequence_Check(obj5) ) {
35123         PyErr_SetString(PyExc_TypeError, "not a sequence");
35124         SWIG_fail;
35125       }
35126       Py_ssize_t size = PySequence_Size(obj5);
35127       if( size != (int)size ) {
35128         PyErr_SetString(PyExc_TypeError, "too big sequence");
35129         SWIG_fail;
35130       }
35131       arg7 = (int)size;
35132       arg8 = (double*) malloc(arg7*sizeof(double));
35133       for( int i = 0; i<arg7; i++ ) {
35134         PyObject *o = PySequence_GetItem(obj5,i);
35135         if ( !PyArg_Parse(o,"d",&arg8[i]) ) {
35136           PyErr_SetString(PyExc_TypeError, "not a number");
35137           Py_DECREF(o);
35138           SWIG_fail;
35139         }
35140         Py_DECREF(o);
35141       }
35142     }
35143   }
35144   if (obj6) {
35145     {
35146       /* %typemap(in) char **options */
35147       int bErr = FALSE;
35148       arg9 = CSLFromPySequence(obj6, &bErr);
35149       if( bErr )
35150       {
35151         SWIG_fail;
35152       }
35153     }
35154   }
35155   if (obj7) {
35156     {
35157       /* %typemap(in) (GDALProgressFunc callback = NULL) */
35158       /* callback_func typemap */
35159 
35160       /* In some cases 0 is passed instead of None. */
35161       /* See https://github.com/OSGeo/gdal/pull/219 */
35162       if ( PyLong_Check(obj7) || PyInt_Check(obj7) )
35163       {
35164         if( PyLong_AsLong(obj7) == 0 )
35165         {
35166           obj7 = Py_None;
35167         }
35168       }
35169 
35170       if (obj7 && obj7 != Py_None ) {
35171         void* cbfunction = NULL;
35172         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj7,
35173             (void**)&cbfunction,
35174             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
35175             SWIG_POINTER_EXCEPTION | 0 ));
35176 
35177         if ( cbfunction == GDALTermProgress ) {
35178           arg10 = GDALTermProgress;
35179         } else {
35180           if (!PyCallable_Check(obj7)) {
35181             PyErr_SetString( PyExc_RuntimeError,
35182               "Object given is not a Python function" );
35183             SWIG_fail;
35184           }
35185           psProgressInfo->psPyCallback = obj7;
35186           arg10 = PyProgressProxy;
35187         }
35188 
35189       }
35190 
35191     }
35192   }
35193   if (obj8) {
35194     {
35195       /* %typemap(in) ( void* callback_data=NULL)  */
35196       psProgressInfo->psPyCallbackData = obj8 ;
35197     }
35198   }
35199   {
35200     if (!arg1) {
35201       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35202     }
35203   }
35204   {
35205     if (!arg4) {
35206       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35207     }
35208   }
35209   {
35210     if ( bUseExceptions ) {
35211       ClearErrorState();
35212     }
35213     {
35214       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
35215       result = (int)RasterizeLayer(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
35216       SWIG_PYTHON_THREAD_END_ALLOW;
35217     }
35218 #ifndef SED_HACKS
35219     if ( bUseExceptions ) {
35220       CPLErr eclass = CPLGetLastErrorType();
35221       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35222         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
35223       }
35224     }
35225 #endif
35226   }
35227   resultobj = SWIG_From_int(static_cast< int >(result));
35228   {
35229     /* %typemap(freearg) (int nList, int* pList) */
35230     free(arg3);
35231   }
35232   {
35233     /* %typemap(freearg) (int nList, double* pList) */
35234     if (arg8) {
35235       free((void*) arg8);
35236     }
35237   }
35238   {
35239     /* %typemap(freearg) char **options */
35240     CSLDestroy( arg9 );
35241   }
35242   {
35243     /* %typemap(freearg) ( void* callback_data=NULL)  */
35244 
35245     CPLFree(psProgressInfo);
35246 
35247   }
35248   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
35249   return resultobj;
35250 fail:
35251   {
35252     /* %typemap(freearg) (int nList, int* pList) */
35253     free(arg3);
35254   }
35255   {
35256     /* %typemap(freearg) (int nList, double* pList) */
35257     if (arg8) {
35258       free((void*) arg8);
35259     }
35260   }
35261   {
35262     /* %typemap(freearg) char **options */
35263     CSLDestroy( arg9 );
35264   }
35265   {
35266     /* %typemap(freearg) ( void* callback_data=NULL)  */
35267 
35268     CPLFree(psProgressInfo);
35269 
35270   }
35271   return NULL;
35272 }
35273 
35274 
_wrap_Polygonize(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)35275 SWIGINTERN PyObject *_wrap_Polygonize(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
35276   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
35277   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
35278   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
35279   OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
35280   int arg4 ;
35281   char **arg5 = (char **) NULL ;
35282   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
35283   void *arg7 = (void *) NULL ;
35284   void *argp1 = 0 ;
35285   int res1 = 0 ;
35286   void *argp2 = 0 ;
35287   int res2 = 0 ;
35288   void *argp3 = 0 ;
35289   int res3 = 0 ;
35290   int val4 ;
35291   int ecode4 = 0 ;
35292   PyObject * obj0 = 0 ;
35293   PyObject * obj1 = 0 ;
35294   PyObject * obj2 = 0 ;
35295   PyObject * obj3 = 0 ;
35296   PyObject * obj4 = 0 ;
35297   PyObject * obj5 = 0 ;
35298   PyObject * obj6 = 0 ;
35299   char *  kwnames[] = {
35300     (char *) "srcBand",(char *) "maskBand",(char *) "outLayer",(char *) "iPixValField",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
35301   };
35302   int result;
35303 
35304   /* %typemap(arginit) ( const char* callback_data=NULL)  */
35305   PyProgressData *psProgressInfo;
35306   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
35307   psProgressInfo->nLastReported = -1;
35308   psProgressInfo->psPyCallback = NULL;
35309   psProgressInfo->psPyCallbackData = NULL;
35310   arg7 = psProgressInfo;
35311   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO|OOO:Polygonize",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
35312   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35313   if (!SWIG_IsOK(res1)) {
35314     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygonize" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
35315   }
35316   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
35317   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35318   if (!SWIG_IsOK(res2)) {
35319     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Polygonize" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
35320   }
35321   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
35322   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
35323   if (!SWIG_IsOK(res3)) {
35324     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Polygonize" "', argument " "3"" of type '" "OGRLayerShadow *""'");
35325   }
35326   arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
35327   ecode4 = SWIG_AsVal_int(obj3, &val4);
35328   if (!SWIG_IsOK(ecode4)) {
35329     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Polygonize" "', argument " "4"" of type '" "int""'");
35330   }
35331   arg4 = static_cast< int >(val4);
35332   if (obj4) {
35333     {
35334       /* %typemap(in) char **options */
35335       int bErr = FALSE;
35336       arg5 = CSLFromPySequence(obj4, &bErr);
35337       if( bErr )
35338       {
35339         SWIG_fail;
35340       }
35341     }
35342   }
35343   if (obj5) {
35344     {
35345       /* %typemap(in) (GDALProgressFunc callback = NULL) */
35346       /* callback_func typemap */
35347 
35348       /* In some cases 0 is passed instead of None. */
35349       /* See https://github.com/OSGeo/gdal/pull/219 */
35350       if ( PyLong_Check(obj5) || PyInt_Check(obj5) )
35351       {
35352         if( PyLong_AsLong(obj5) == 0 )
35353         {
35354           obj5 = Py_None;
35355         }
35356       }
35357 
35358       if (obj5 && obj5 != Py_None ) {
35359         void* cbfunction = NULL;
35360         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj5,
35361             (void**)&cbfunction,
35362             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
35363             SWIG_POINTER_EXCEPTION | 0 ));
35364 
35365         if ( cbfunction == GDALTermProgress ) {
35366           arg6 = GDALTermProgress;
35367         } else {
35368           if (!PyCallable_Check(obj5)) {
35369             PyErr_SetString( PyExc_RuntimeError,
35370               "Object given is not a Python function" );
35371             SWIG_fail;
35372           }
35373           psProgressInfo->psPyCallback = obj5;
35374           arg6 = PyProgressProxy;
35375         }
35376 
35377       }
35378 
35379     }
35380   }
35381   if (obj6) {
35382     {
35383       /* %typemap(in) ( void* callback_data=NULL)  */
35384       psProgressInfo->psPyCallbackData = obj6 ;
35385     }
35386   }
35387   {
35388     if (!arg1) {
35389       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35390     }
35391   }
35392   {
35393     if (!arg3) {
35394       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35395     }
35396   }
35397   {
35398     if ( bUseExceptions ) {
35399       ClearErrorState();
35400     }
35401     {
35402       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
35403       result = (int)Polygonize(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
35404       SWIG_PYTHON_THREAD_END_ALLOW;
35405     }
35406 #ifndef SED_HACKS
35407     if ( bUseExceptions ) {
35408       CPLErr eclass = CPLGetLastErrorType();
35409       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35410         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
35411       }
35412     }
35413 #endif
35414   }
35415   resultobj = SWIG_From_int(static_cast< int >(result));
35416   {
35417     /* %typemap(freearg) char **options */
35418     CSLDestroy( arg5 );
35419   }
35420   {
35421     /* %typemap(freearg) ( void* callback_data=NULL)  */
35422 
35423     CPLFree(psProgressInfo);
35424 
35425   }
35426   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
35427   return resultobj;
35428 fail:
35429   {
35430     /* %typemap(freearg) char **options */
35431     CSLDestroy( arg5 );
35432   }
35433   {
35434     /* %typemap(freearg) ( void* callback_data=NULL)  */
35435 
35436     CPLFree(psProgressInfo);
35437 
35438   }
35439   return NULL;
35440 }
35441 
35442 
_wrap_FPolygonize(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)35443 SWIGINTERN PyObject *_wrap_FPolygonize(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
35444   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
35445   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
35446   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
35447   OGRLayerShadow *arg3 = (OGRLayerShadow *) 0 ;
35448   int arg4 ;
35449   char **arg5 = (char **) NULL ;
35450   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
35451   void *arg7 = (void *) NULL ;
35452   void *argp1 = 0 ;
35453   int res1 = 0 ;
35454   void *argp2 = 0 ;
35455   int res2 = 0 ;
35456   void *argp3 = 0 ;
35457   int res3 = 0 ;
35458   int val4 ;
35459   int ecode4 = 0 ;
35460   PyObject * obj0 = 0 ;
35461   PyObject * obj1 = 0 ;
35462   PyObject * obj2 = 0 ;
35463   PyObject * obj3 = 0 ;
35464   PyObject * obj4 = 0 ;
35465   PyObject * obj5 = 0 ;
35466   PyObject * obj6 = 0 ;
35467   char *  kwnames[] = {
35468     (char *) "srcBand",(char *) "maskBand",(char *) "outLayer",(char *) "iPixValField",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
35469   };
35470   int result;
35471 
35472   /* %typemap(arginit) ( const char* callback_data=NULL)  */
35473   PyProgressData *psProgressInfo;
35474   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
35475   psProgressInfo->nLastReported = -1;
35476   psProgressInfo->psPyCallback = NULL;
35477   psProgressInfo->psPyCallbackData = NULL;
35478   arg7 = psProgressInfo;
35479   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO|OOO:FPolygonize",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
35480   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35481   if (!SWIG_IsOK(res1)) {
35482     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FPolygonize" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
35483   }
35484   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
35485   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35486   if (!SWIG_IsOK(res2)) {
35487     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FPolygonize" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
35488   }
35489   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
35490   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
35491   if (!SWIG_IsOK(res3)) {
35492     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "FPolygonize" "', argument " "3"" of type '" "OGRLayerShadow *""'");
35493   }
35494   arg3 = reinterpret_cast< OGRLayerShadow * >(argp3);
35495   ecode4 = SWIG_AsVal_int(obj3, &val4);
35496   if (!SWIG_IsOK(ecode4)) {
35497     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "FPolygonize" "', argument " "4"" of type '" "int""'");
35498   }
35499   arg4 = static_cast< int >(val4);
35500   if (obj4) {
35501     {
35502       /* %typemap(in) char **options */
35503       int bErr = FALSE;
35504       arg5 = CSLFromPySequence(obj4, &bErr);
35505       if( bErr )
35506       {
35507         SWIG_fail;
35508       }
35509     }
35510   }
35511   if (obj5) {
35512     {
35513       /* %typemap(in) (GDALProgressFunc callback = NULL) */
35514       /* callback_func typemap */
35515 
35516       /* In some cases 0 is passed instead of None. */
35517       /* See https://github.com/OSGeo/gdal/pull/219 */
35518       if ( PyLong_Check(obj5) || PyInt_Check(obj5) )
35519       {
35520         if( PyLong_AsLong(obj5) == 0 )
35521         {
35522           obj5 = Py_None;
35523         }
35524       }
35525 
35526       if (obj5 && obj5 != Py_None ) {
35527         void* cbfunction = NULL;
35528         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj5,
35529             (void**)&cbfunction,
35530             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
35531             SWIG_POINTER_EXCEPTION | 0 ));
35532 
35533         if ( cbfunction == GDALTermProgress ) {
35534           arg6 = GDALTermProgress;
35535         } else {
35536           if (!PyCallable_Check(obj5)) {
35537             PyErr_SetString( PyExc_RuntimeError,
35538               "Object given is not a Python function" );
35539             SWIG_fail;
35540           }
35541           psProgressInfo->psPyCallback = obj5;
35542           arg6 = PyProgressProxy;
35543         }
35544 
35545       }
35546 
35547     }
35548   }
35549   if (obj6) {
35550     {
35551       /* %typemap(in) ( void* callback_data=NULL)  */
35552       psProgressInfo->psPyCallbackData = obj6 ;
35553     }
35554   }
35555   {
35556     if (!arg1) {
35557       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35558     }
35559   }
35560   {
35561     if (!arg3) {
35562       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35563     }
35564   }
35565   {
35566     if ( bUseExceptions ) {
35567       ClearErrorState();
35568     }
35569     {
35570       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
35571       result = (int)FPolygonize(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
35572       SWIG_PYTHON_THREAD_END_ALLOW;
35573     }
35574 #ifndef SED_HACKS
35575     if ( bUseExceptions ) {
35576       CPLErr eclass = CPLGetLastErrorType();
35577       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35578         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
35579       }
35580     }
35581 #endif
35582   }
35583   resultobj = SWIG_From_int(static_cast< int >(result));
35584   {
35585     /* %typemap(freearg) char **options */
35586     CSLDestroy( arg5 );
35587   }
35588   {
35589     /* %typemap(freearg) ( void* callback_data=NULL)  */
35590 
35591     CPLFree(psProgressInfo);
35592 
35593   }
35594   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
35595   return resultobj;
35596 fail:
35597   {
35598     /* %typemap(freearg) char **options */
35599     CSLDestroy( arg5 );
35600   }
35601   {
35602     /* %typemap(freearg) ( void* callback_data=NULL)  */
35603 
35604     CPLFree(psProgressInfo);
35605 
35606   }
35607   return NULL;
35608 }
35609 
35610 
_wrap_FillNodata(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)35611 SWIGINTERN PyObject *_wrap_FillNodata(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
35612   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
35613   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
35614   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
35615   double arg3 ;
35616   int arg4 ;
35617   char **arg5 = (char **) NULL ;
35618   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
35619   void *arg7 = (void *) NULL ;
35620   void *argp1 = 0 ;
35621   int res1 = 0 ;
35622   void *argp2 = 0 ;
35623   int res2 = 0 ;
35624   double val3 ;
35625   int ecode3 = 0 ;
35626   int val4 ;
35627   int ecode4 = 0 ;
35628   PyObject * obj0 = 0 ;
35629   PyObject * obj1 = 0 ;
35630   PyObject * obj2 = 0 ;
35631   PyObject * obj3 = 0 ;
35632   PyObject * obj4 = 0 ;
35633   PyObject * obj5 = 0 ;
35634   PyObject * obj6 = 0 ;
35635   char *  kwnames[] = {
35636     (char *) "targetBand",(char *) "maskBand",(char *) "maxSearchDist",(char *) "smoothingIterations",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
35637   };
35638   int result;
35639 
35640   /* %typemap(arginit) ( const char* callback_data=NULL)  */
35641   PyProgressData *psProgressInfo;
35642   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
35643   psProgressInfo->nLastReported = -1;
35644   psProgressInfo->psPyCallback = NULL;
35645   psProgressInfo->psPyCallbackData = NULL;
35646   arg7 = psProgressInfo;
35647   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO|OOO:FillNodata",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
35648   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35649   if (!SWIG_IsOK(res1)) {
35650     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FillNodata" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
35651   }
35652   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
35653   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35654   if (!SWIG_IsOK(res2)) {
35655     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FillNodata" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
35656   }
35657   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
35658   ecode3 = SWIG_AsVal_double(obj2, &val3);
35659   if (!SWIG_IsOK(ecode3)) {
35660     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "FillNodata" "', argument " "3"" of type '" "double""'");
35661   }
35662   arg3 = static_cast< double >(val3);
35663   ecode4 = SWIG_AsVal_int(obj3, &val4);
35664   if (!SWIG_IsOK(ecode4)) {
35665     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "FillNodata" "', argument " "4"" of type '" "int""'");
35666   }
35667   arg4 = static_cast< int >(val4);
35668   if (obj4) {
35669     {
35670       /* %typemap(in) char **options */
35671       int bErr = FALSE;
35672       arg5 = CSLFromPySequence(obj4, &bErr);
35673       if( bErr )
35674       {
35675         SWIG_fail;
35676       }
35677     }
35678   }
35679   if (obj5) {
35680     {
35681       /* %typemap(in) (GDALProgressFunc callback = NULL) */
35682       /* callback_func typemap */
35683 
35684       /* In some cases 0 is passed instead of None. */
35685       /* See https://github.com/OSGeo/gdal/pull/219 */
35686       if ( PyLong_Check(obj5) || PyInt_Check(obj5) )
35687       {
35688         if( PyLong_AsLong(obj5) == 0 )
35689         {
35690           obj5 = Py_None;
35691         }
35692       }
35693 
35694       if (obj5 && obj5 != Py_None ) {
35695         void* cbfunction = NULL;
35696         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj5,
35697             (void**)&cbfunction,
35698             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
35699             SWIG_POINTER_EXCEPTION | 0 ));
35700 
35701         if ( cbfunction == GDALTermProgress ) {
35702           arg6 = GDALTermProgress;
35703         } else {
35704           if (!PyCallable_Check(obj5)) {
35705             PyErr_SetString( PyExc_RuntimeError,
35706               "Object given is not a Python function" );
35707             SWIG_fail;
35708           }
35709           psProgressInfo->psPyCallback = obj5;
35710           arg6 = PyProgressProxy;
35711         }
35712 
35713       }
35714 
35715     }
35716   }
35717   if (obj6) {
35718     {
35719       /* %typemap(in) ( void* callback_data=NULL)  */
35720       psProgressInfo->psPyCallbackData = obj6 ;
35721     }
35722   }
35723   {
35724     if (!arg1) {
35725       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35726     }
35727   }
35728   {
35729     if ( bUseExceptions ) {
35730       ClearErrorState();
35731     }
35732     {
35733       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
35734       result = (int)FillNodata(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
35735       SWIG_PYTHON_THREAD_END_ALLOW;
35736     }
35737 #ifndef SED_HACKS
35738     if ( bUseExceptions ) {
35739       CPLErr eclass = CPLGetLastErrorType();
35740       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35741         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
35742       }
35743     }
35744 #endif
35745   }
35746   resultobj = SWIG_From_int(static_cast< int >(result));
35747   {
35748     /* %typemap(freearg) char **options */
35749     CSLDestroy( arg5 );
35750   }
35751   {
35752     /* %typemap(freearg) ( void* callback_data=NULL)  */
35753 
35754     CPLFree(psProgressInfo);
35755 
35756   }
35757   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
35758   return resultobj;
35759 fail:
35760   {
35761     /* %typemap(freearg) char **options */
35762     CSLDestroy( arg5 );
35763   }
35764   {
35765     /* %typemap(freearg) ( void* callback_data=NULL)  */
35766 
35767     CPLFree(psProgressInfo);
35768 
35769   }
35770   return NULL;
35771 }
35772 
35773 
_wrap_SieveFilter(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)35774 SWIGINTERN PyObject *_wrap_SieveFilter(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
35775   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
35776   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
35777   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
35778   GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
35779   int arg4 ;
35780   int arg5 = (int) 4 ;
35781   char **arg6 = (char **) NULL ;
35782   GDALProgressFunc arg7 = (GDALProgressFunc) NULL ;
35783   void *arg8 = (void *) NULL ;
35784   void *argp1 = 0 ;
35785   int res1 = 0 ;
35786   void *argp2 = 0 ;
35787   int res2 = 0 ;
35788   void *argp3 = 0 ;
35789   int res3 = 0 ;
35790   int val4 ;
35791   int ecode4 = 0 ;
35792   int val5 ;
35793   int ecode5 = 0 ;
35794   PyObject * obj0 = 0 ;
35795   PyObject * obj1 = 0 ;
35796   PyObject * obj2 = 0 ;
35797   PyObject * obj3 = 0 ;
35798   PyObject * obj4 = 0 ;
35799   PyObject * obj5 = 0 ;
35800   PyObject * obj6 = 0 ;
35801   PyObject * obj7 = 0 ;
35802   char *  kwnames[] = {
35803     (char *) "srcBand",(char *) "maskBand",(char *) "dstBand",(char *) "threshold",(char *) "connectedness",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
35804   };
35805   int result;
35806 
35807   /* %typemap(arginit) ( const char* callback_data=NULL)  */
35808   PyProgressData *psProgressInfo;
35809   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
35810   psProgressInfo->nLastReported = -1;
35811   psProgressInfo->psPyCallback = NULL;
35812   psProgressInfo->psPyCallbackData = NULL;
35813   arg8 = psProgressInfo;
35814   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO|OOOO:SieveFilter",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
35815   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35816   if (!SWIG_IsOK(res1)) {
35817     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SieveFilter" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
35818   }
35819   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
35820   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35821   if (!SWIG_IsOK(res2)) {
35822     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SieveFilter" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
35823   }
35824   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
35825   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35826   if (!SWIG_IsOK(res3)) {
35827     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "SieveFilter" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
35828   }
35829   arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
35830   ecode4 = SWIG_AsVal_int(obj3, &val4);
35831   if (!SWIG_IsOK(ecode4)) {
35832     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "SieveFilter" "', argument " "4"" of type '" "int""'");
35833   }
35834   arg4 = static_cast< int >(val4);
35835   if (obj4) {
35836     ecode5 = SWIG_AsVal_int(obj4, &val5);
35837     if (!SWIG_IsOK(ecode5)) {
35838       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "SieveFilter" "', argument " "5"" of type '" "int""'");
35839     }
35840     arg5 = static_cast< int >(val5);
35841   }
35842   if (obj5) {
35843     {
35844       /* %typemap(in) char **options */
35845       int bErr = FALSE;
35846       arg6 = CSLFromPySequence(obj5, &bErr);
35847       if( bErr )
35848       {
35849         SWIG_fail;
35850       }
35851     }
35852   }
35853   if (obj6) {
35854     {
35855       /* %typemap(in) (GDALProgressFunc callback = NULL) */
35856       /* callback_func typemap */
35857 
35858       /* In some cases 0 is passed instead of None. */
35859       /* See https://github.com/OSGeo/gdal/pull/219 */
35860       if ( PyLong_Check(obj6) || PyInt_Check(obj6) )
35861       {
35862         if( PyLong_AsLong(obj6) == 0 )
35863         {
35864           obj6 = Py_None;
35865         }
35866       }
35867 
35868       if (obj6 && obj6 != Py_None ) {
35869         void* cbfunction = NULL;
35870         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj6,
35871             (void**)&cbfunction,
35872             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
35873             SWIG_POINTER_EXCEPTION | 0 ));
35874 
35875         if ( cbfunction == GDALTermProgress ) {
35876           arg7 = GDALTermProgress;
35877         } else {
35878           if (!PyCallable_Check(obj6)) {
35879             PyErr_SetString( PyExc_RuntimeError,
35880               "Object given is not a Python function" );
35881             SWIG_fail;
35882           }
35883           psProgressInfo->psPyCallback = obj6;
35884           arg7 = PyProgressProxy;
35885         }
35886 
35887       }
35888 
35889     }
35890   }
35891   if (obj7) {
35892     {
35893       /* %typemap(in) ( void* callback_data=NULL)  */
35894       psProgressInfo->psPyCallbackData = obj7 ;
35895     }
35896   }
35897   {
35898     if (!arg1) {
35899       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35900     }
35901   }
35902   {
35903     if (!arg3) {
35904       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
35905     }
35906   }
35907   {
35908     if ( bUseExceptions ) {
35909       ClearErrorState();
35910     }
35911     {
35912       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
35913       result = (int)SieveFilter(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
35914       SWIG_PYTHON_THREAD_END_ALLOW;
35915     }
35916 #ifndef SED_HACKS
35917     if ( bUseExceptions ) {
35918       CPLErr eclass = CPLGetLastErrorType();
35919       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
35920         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
35921       }
35922     }
35923 #endif
35924   }
35925   resultobj = SWIG_From_int(static_cast< int >(result));
35926   {
35927     /* %typemap(freearg) char **options */
35928     CSLDestroy( arg6 );
35929   }
35930   {
35931     /* %typemap(freearg) ( void* callback_data=NULL)  */
35932 
35933     CPLFree(psProgressInfo);
35934 
35935   }
35936   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
35937   return resultobj;
35938 fail:
35939   {
35940     /* %typemap(freearg) char **options */
35941     CSLDestroy( arg6 );
35942   }
35943   {
35944     /* %typemap(freearg) ( void* callback_data=NULL)  */
35945 
35946     CPLFree(psProgressInfo);
35947 
35948   }
35949   return NULL;
35950 }
35951 
35952 
_wrap_RegenerateOverviews(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)35953 SWIGINTERN PyObject *_wrap_RegenerateOverviews(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
35954   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
35955   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
35956   int arg2 ;
35957   GDALRasterBandShadow **arg3 = (GDALRasterBandShadow **) 0 ;
35958   char *arg4 = (char *) "average" ;
35959   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
35960   void *arg6 = (void *) NULL ;
35961   void *argp1 = 0 ;
35962   int res1 = 0 ;
35963   int res4 ;
35964   char *buf4 = 0 ;
35965   int alloc4 = 0 ;
35966   PyObject * obj0 = 0 ;
35967   PyObject * obj1 = 0 ;
35968   PyObject * obj2 = 0 ;
35969   PyObject * obj3 = 0 ;
35970   PyObject * obj4 = 0 ;
35971   char *  kwnames[] = {
35972     (char *) "srcBand",(char *) "overviewBandCount",(char *) "resampling",(char *) "callback",(char *) "callback_data", NULL
35973   };
35974   int result;
35975 
35976   /* %typemap(arginit) ( const char* callback_data=NULL)  */
35977   PyProgressData *psProgressInfo;
35978   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
35979   psProgressInfo->nLastReported = -1;
35980   psProgressInfo->psPyCallback = NULL;
35981   psProgressInfo->psPyCallbackData = NULL;
35982   arg6 = psProgressInfo;
35983   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOO:RegenerateOverviews",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
35984   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
35985   if (!SWIG_IsOK(res1)) {
35986     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RegenerateOverviews" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
35987   }
35988   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
35989   {
35990     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALRasterBandShadow *optional_##GDALRasterBandShadow)*/
35991     if ( !PySequence_Check(obj1) ) {
35992       PyErr_SetString(PyExc_TypeError, "not a sequence");
35993       SWIG_fail;
35994     }
35995     Py_ssize_t size = PySequence_Size(obj1);
35996     if( size != (int)size ) {
35997       PyErr_SetString(PyExc_TypeError, "too big sequence");
35998       SWIG_fail;
35999     }
36000     arg2 = (int)size;
36001     arg3 = (GDALRasterBandShadow**) CPLMalloc(arg2*sizeof(GDALRasterBandShadow*));
36002 
36003     for( int i = 0; i<arg2; i++ ) {
36004       PyObject *o = PySequence_GetItem(obj1,i);
36005       GDALRasterBandShadow* rawobjectpointer = NULL;
36006       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALRasterBandShadow, SWIG_POINTER_EXCEPTION | 0 ));
36007       if (!rawobjectpointer) {
36008         Py_DECREF(o);
36009         PyErr_SetString(PyExc_TypeError, "object of wrong GDALRasterBandShadow");
36010         SWIG_fail;
36011       }
36012       arg3[i] = rawobjectpointer;
36013       Py_DECREF(o);
36014 
36015     }
36016   }
36017   if (obj2) {
36018     res4 = SWIG_AsCharPtrAndSize(obj2, &buf4, NULL, &alloc4);
36019     if (!SWIG_IsOK(res4)) {
36020       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "RegenerateOverviews" "', argument " "4"" of type '" "char const *""'");
36021     }
36022     arg4 = reinterpret_cast< char * >(buf4);
36023   }
36024   if (obj3) {
36025     {
36026       /* %typemap(in) (GDALProgressFunc callback = NULL) */
36027       /* callback_func typemap */
36028 
36029       /* In some cases 0 is passed instead of None. */
36030       /* See https://github.com/OSGeo/gdal/pull/219 */
36031       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
36032       {
36033         if( PyLong_AsLong(obj3) == 0 )
36034         {
36035           obj3 = Py_None;
36036         }
36037       }
36038 
36039       if (obj3 && obj3 != Py_None ) {
36040         void* cbfunction = NULL;
36041         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
36042             (void**)&cbfunction,
36043             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
36044             SWIG_POINTER_EXCEPTION | 0 ));
36045 
36046         if ( cbfunction == GDALTermProgress ) {
36047           arg5 = GDALTermProgress;
36048         } else {
36049           if (!PyCallable_Check(obj3)) {
36050             PyErr_SetString( PyExc_RuntimeError,
36051               "Object given is not a Python function" );
36052             SWIG_fail;
36053           }
36054           psProgressInfo->psPyCallback = obj3;
36055           arg5 = PyProgressProxy;
36056         }
36057 
36058       }
36059 
36060     }
36061   }
36062   if (obj4) {
36063     {
36064       /* %typemap(in) ( void* callback_data=NULL)  */
36065       psProgressInfo->psPyCallbackData = obj4 ;
36066     }
36067   }
36068   {
36069     if (!arg1) {
36070       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36071     }
36072   }
36073   {
36074     if ( bUseExceptions ) {
36075       ClearErrorState();
36076     }
36077     {
36078       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
36079       result = (int)RegenerateOverviews(arg1,arg2,arg3,(char const *)arg4,arg5,arg6);
36080       SWIG_PYTHON_THREAD_END_ALLOW;
36081     }
36082 #ifndef SED_HACKS
36083     if ( bUseExceptions ) {
36084       CPLErr eclass = CPLGetLastErrorType();
36085       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36086         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
36087       }
36088     }
36089 #endif
36090   }
36091   resultobj = SWIG_From_int(static_cast< int >(result));
36092   {
36093     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects)*/
36094     CPLFree( arg3 );
36095   }
36096   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
36097   {
36098     /* %typemap(freearg) ( void* callback_data=NULL)  */
36099 
36100     CPLFree(psProgressInfo);
36101 
36102   }
36103   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
36104   return resultobj;
36105 fail:
36106   {
36107     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects)*/
36108     CPLFree( arg3 );
36109   }
36110   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
36111   {
36112     /* %typemap(freearg) ( void* callback_data=NULL)  */
36113 
36114     CPLFree(psProgressInfo);
36115 
36116   }
36117   return NULL;
36118 }
36119 
36120 
_wrap_RegenerateOverview(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)36121 SWIGINTERN PyObject *_wrap_RegenerateOverview(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
36122   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
36123   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
36124   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
36125   char *arg3 = (char *) "average" ;
36126   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
36127   void *arg5 = (void *) NULL ;
36128   void *argp1 = 0 ;
36129   int res1 = 0 ;
36130   void *argp2 = 0 ;
36131   int res2 = 0 ;
36132   int res3 ;
36133   char *buf3 = 0 ;
36134   int alloc3 = 0 ;
36135   PyObject * obj0 = 0 ;
36136   PyObject * obj1 = 0 ;
36137   PyObject * obj2 = 0 ;
36138   PyObject * obj3 = 0 ;
36139   PyObject * obj4 = 0 ;
36140   char *  kwnames[] = {
36141     (char *) "srcBand",(char *) "overviewBand",(char *) "resampling",(char *) "callback",(char *) "callback_data", NULL
36142   };
36143   int result;
36144 
36145   /* %typemap(arginit) ( const char* callback_data=NULL)  */
36146   PyProgressData *psProgressInfo;
36147   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
36148   psProgressInfo->nLastReported = -1;
36149   psProgressInfo->psPyCallback = NULL;
36150   psProgressInfo->psPyCallbackData = NULL;
36151   arg5 = psProgressInfo;
36152   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOO:RegenerateOverview",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
36153   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
36154   if (!SWIG_IsOK(res1)) {
36155     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RegenerateOverview" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
36156   }
36157   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
36158   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
36159   if (!SWIG_IsOK(res2)) {
36160     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "RegenerateOverview" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
36161   }
36162   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
36163   if (obj2) {
36164     res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
36165     if (!SWIG_IsOK(res3)) {
36166       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "RegenerateOverview" "', argument " "3"" of type '" "char const *""'");
36167     }
36168     arg3 = reinterpret_cast< char * >(buf3);
36169   }
36170   if (obj3) {
36171     {
36172       /* %typemap(in) (GDALProgressFunc callback = NULL) */
36173       /* callback_func typemap */
36174 
36175       /* In some cases 0 is passed instead of None. */
36176       /* See https://github.com/OSGeo/gdal/pull/219 */
36177       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
36178       {
36179         if( PyLong_AsLong(obj3) == 0 )
36180         {
36181           obj3 = Py_None;
36182         }
36183       }
36184 
36185       if (obj3 && obj3 != Py_None ) {
36186         void* cbfunction = NULL;
36187         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
36188             (void**)&cbfunction,
36189             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
36190             SWIG_POINTER_EXCEPTION | 0 ));
36191 
36192         if ( cbfunction == GDALTermProgress ) {
36193           arg4 = GDALTermProgress;
36194         } else {
36195           if (!PyCallable_Check(obj3)) {
36196             PyErr_SetString( PyExc_RuntimeError,
36197               "Object given is not a Python function" );
36198             SWIG_fail;
36199           }
36200           psProgressInfo->psPyCallback = obj3;
36201           arg4 = PyProgressProxy;
36202         }
36203 
36204       }
36205 
36206     }
36207   }
36208   if (obj4) {
36209     {
36210       /* %typemap(in) ( void* callback_data=NULL)  */
36211       psProgressInfo->psPyCallbackData = obj4 ;
36212     }
36213   }
36214   {
36215     if (!arg1) {
36216       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36217     }
36218   }
36219   {
36220     if (!arg2) {
36221       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36222     }
36223   }
36224   {
36225     if ( bUseExceptions ) {
36226       ClearErrorState();
36227     }
36228     {
36229       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
36230       result = (int)RegenerateOverview(arg1,arg2,(char const *)arg3,arg4,arg5);
36231       SWIG_PYTHON_THREAD_END_ALLOW;
36232     }
36233 #ifndef SED_HACKS
36234     if ( bUseExceptions ) {
36235       CPLErr eclass = CPLGetLastErrorType();
36236       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36237         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
36238       }
36239     }
36240 #endif
36241   }
36242   resultobj = SWIG_From_int(static_cast< int >(result));
36243   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
36244   {
36245     /* %typemap(freearg) ( void* callback_data=NULL)  */
36246 
36247     CPLFree(psProgressInfo);
36248 
36249   }
36250   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
36251   return resultobj;
36252 fail:
36253   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
36254   {
36255     /* %typemap(freearg) ( void* callback_data=NULL)  */
36256 
36257     CPLFree(psProgressInfo);
36258 
36259   }
36260   return NULL;
36261 }
36262 
36263 
_wrap_ContourGenerate(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)36264 SWIGINTERN PyObject *_wrap_ContourGenerate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
36265   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
36266   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
36267   double arg2 ;
36268   double arg3 ;
36269   int arg4 ;
36270   double *arg5 = (double *) 0 ;
36271   int arg6 ;
36272   double arg7 ;
36273   OGRLayerShadow *arg8 = (OGRLayerShadow *) 0 ;
36274   int arg9 ;
36275   int arg10 ;
36276   GDALProgressFunc arg11 = (GDALProgressFunc) NULL ;
36277   void *arg12 = (void *) NULL ;
36278   void *argp1 = 0 ;
36279   int res1 = 0 ;
36280   double val2 ;
36281   int ecode2 = 0 ;
36282   double val3 ;
36283   int ecode3 = 0 ;
36284   int val6 ;
36285   int ecode6 = 0 ;
36286   double val7 ;
36287   int ecode7 = 0 ;
36288   void *argp8 = 0 ;
36289   int res8 = 0 ;
36290   int val9 ;
36291   int ecode9 = 0 ;
36292   int val10 ;
36293   int ecode10 = 0 ;
36294   PyObject * obj0 = 0 ;
36295   PyObject * obj1 = 0 ;
36296   PyObject * obj2 = 0 ;
36297   PyObject * obj3 = 0 ;
36298   PyObject * obj4 = 0 ;
36299   PyObject * obj5 = 0 ;
36300   PyObject * obj6 = 0 ;
36301   PyObject * obj7 = 0 ;
36302   PyObject * obj8 = 0 ;
36303   PyObject * obj9 = 0 ;
36304   PyObject * obj10 = 0 ;
36305   char *  kwnames[] = {
36306     (char *) "srcBand",(char *) "contourInterval",(char *) "contourBase",(char *) "fixedLevelCount",(char *) "useNoData",(char *) "noDataValue",(char *) "dstLayer",(char *) "idField",(char *) "elevField",(char *) "callback",(char *) "callback_data", NULL
36307   };
36308   int result;
36309 
36310   /* %typemap(arginit) ( const char* callback_data=NULL)  */
36311   PyProgressData *psProgressInfo;
36312   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
36313   psProgressInfo->nLastReported = -1;
36314   psProgressInfo->psPyCallback = NULL;
36315   psProgressInfo->psPyCallbackData = NULL;
36316   arg12 = psProgressInfo;
36317   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOOOOO|OO:ContourGenerate",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail;
36318   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
36319   if (!SWIG_IsOK(res1)) {
36320     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ContourGenerate" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
36321   }
36322   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
36323   ecode2 = SWIG_AsVal_double(obj1, &val2);
36324   if (!SWIG_IsOK(ecode2)) {
36325     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ContourGenerate" "', argument " "2"" of type '" "double""'");
36326   }
36327   arg2 = static_cast< double >(val2);
36328   ecode3 = SWIG_AsVal_double(obj2, &val3);
36329   if (!SWIG_IsOK(ecode3)) {
36330     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ContourGenerate" "', argument " "3"" of type '" "double""'");
36331   }
36332   arg3 = static_cast< double >(val3);
36333   {
36334     /* %typemap(in,numinputs=1) (int nList, double* pList)*/
36335     /* check if is List */
36336     if ( !PySequence_Check(obj3) ) {
36337       PyErr_SetString(PyExc_TypeError, "not a sequence");
36338       SWIG_fail;
36339     }
36340     Py_ssize_t size = PySequence_Size(obj3);
36341     if( size != (int)size ) {
36342       PyErr_SetString(PyExc_TypeError, "too big sequence");
36343       SWIG_fail;
36344     }
36345     arg4 = (int)size;
36346     arg5 = (double*) malloc(arg4*sizeof(double));
36347     for( int i = 0; i<arg4; i++ ) {
36348       PyObject *o = PySequence_GetItem(obj3,i);
36349       if ( !PyArg_Parse(o,"d",&arg5[i]) ) {
36350         PyErr_SetString(PyExc_TypeError, "not a number");
36351         Py_DECREF(o);
36352         SWIG_fail;
36353       }
36354       Py_DECREF(o);
36355     }
36356   }
36357   ecode6 = SWIG_AsVal_int(obj4, &val6);
36358   if (!SWIG_IsOK(ecode6)) {
36359     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ContourGenerate" "', argument " "6"" of type '" "int""'");
36360   }
36361   arg6 = static_cast< int >(val6);
36362   ecode7 = SWIG_AsVal_double(obj5, &val7);
36363   if (!SWIG_IsOK(ecode7)) {
36364     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ContourGenerate" "', argument " "7"" of type '" "double""'");
36365   }
36366   arg7 = static_cast< double >(val7);
36367   res8 = SWIG_ConvertPtr(obj6, &argp8,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
36368   if (!SWIG_IsOK(res8)) {
36369     SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "ContourGenerate" "', argument " "8"" of type '" "OGRLayerShadow *""'");
36370   }
36371   arg8 = reinterpret_cast< OGRLayerShadow * >(argp8);
36372   ecode9 = SWIG_AsVal_int(obj7, &val9);
36373   if (!SWIG_IsOK(ecode9)) {
36374     SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "ContourGenerate" "', argument " "9"" of type '" "int""'");
36375   }
36376   arg9 = static_cast< int >(val9);
36377   ecode10 = SWIG_AsVal_int(obj8, &val10);
36378   if (!SWIG_IsOK(ecode10)) {
36379     SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "ContourGenerate" "', argument " "10"" of type '" "int""'");
36380   }
36381   arg10 = static_cast< int >(val10);
36382   if (obj9) {
36383     {
36384       /* %typemap(in) (GDALProgressFunc callback = NULL) */
36385       /* callback_func typemap */
36386 
36387       /* In some cases 0 is passed instead of None. */
36388       /* See https://github.com/OSGeo/gdal/pull/219 */
36389       if ( PyLong_Check(obj9) || PyInt_Check(obj9) )
36390       {
36391         if( PyLong_AsLong(obj9) == 0 )
36392         {
36393           obj9 = Py_None;
36394         }
36395       }
36396 
36397       if (obj9 && obj9 != Py_None ) {
36398         void* cbfunction = NULL;
36399         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj9,
36400             (void**)&cbfunction,
36401             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
36402             SWIG_POINTER_EXCEPTION | 0 ));
36403 
36404         if ( cbfunction == GDALTermProgress ) {
36405           arg11 = GDALTermProgress;
36406         } else {
36407           if (!PyCallable_Check(obj9)) {
36408             PyErr_SetString( PyExc_RuntimeError,
36409               "Object given is not a Python function" );
36410             SWIG_fail;
36411           }
36412           psProgressInfo->psPyCallback = obj9;
36413           arg11 = PyProgressProxy;
36414         }
36415 
36416       }
36417 
36418     }
36419   }
36420   if (obj10) {
36421     {
36422       /* %typemap(in) ( void* callback_data=NULL)  */
36423       psProgressInfo->psPyCallbackData = obj10 ;
36424     }
36425   }
36426   {
36427     if (!arg1) {
36428       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36429     }
36430   }
36431   {
36432     if (!arg8) {
36433       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36434     }
36435   }
36436   {
36437     if ( bUseExceptions ) {
36438       ClearErrorState();
36439     }
36440     {
36441       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
36442       result = (int)ContourGenerate(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
36443       SWIG_PYTHON_THREAD_END_ALLOW;
36444     }
36445 #ifndef SED_HACKS
36446     if ( bUseExceptions ) {
36447       CPLErr eclass = CPLGetLastErrorType();
36448       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36449         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
36450       }
36451     }
36452 #endif
36453   }
36454   resultobj = SWIG_From_int(static_cast< int >(result));
36455   {
36456     /* %typemap(freearg) (int nList, double* pList) */
36457     if (arg5) {
36458       free((void*) arg5);
36459     }
36460   }
36461   {
36462     /* %typemap(freearg) ( void* callback_data=NULL)  */
36463 
36464     CPLFree(psProgressInfo);
36465 
36466   }
36467   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
36468   return resultobj;
36469 fail:
36470   {
36471     /* %typemap(freearg) (int nList, double* pList) */
36472     if (arg5) {
36473       free((void*) arg5);
36474     }
36475   }
36476   {
36477     /* %typemap(freearg) ( void* callback_data=NULL)  */
36478 
36479     CPLFree(psProgressInfo);
36480 
36481   }
36482   return NULL;
36483 }
36484 
36485 
_wrap_ContourGenerateEx(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)36486 SWIGINTERN PyObject *_wrap_ContourGenerateEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
36487   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
36488   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
36489   OGRLayerShadow *arg2 = (OGRLayerShadow *) 0 ;
36490   char **arg3 = (char **) NULL ;
36491   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
36492   void *arg5 = (void *) NULL ;
36493   void *argp1 = 0 ;
36494   int res1 = 0 ;
36495   void *argp2 = 0 ;
36496   int res2 = 0 ;
36497   PyObject * obj0 = 0 ;
36498   PyObject * obj1 = 0 ;
36499   PyObject * obj2 = 0 ;
36500   PyObject * obj3 = 0 ;
36501   PyObject * obj4 = 0 ;
36502   char *  kwnames[] = {
36503     (char *) "srcBand",(char *) "dstLayer",(char *) "options",(char *) "callback",(char *) "callback_data", NULL
36504   };
36505   int result;
36506 
36507   /* %typemap(arginit) ( const char* callback_data=NULL)  */
36508   PyProgressData *psProgressInfo;
36509   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
36510   psProgressInfo->nLastReported = -1;
36511   psProgressInfo->psPyCallback = NULL;
36512   psProgressInfo->psPyCallbackData = NULL;
36513   arg5 = psProgressInfo;
36514   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOO:ContourGenerateEx",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
36515   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
36516   if (!SWIG_IsOK(res1)) {
36517     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ContourGenerateEx" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
36518   }
36519   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
36520   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_OGRLayerShadow, 0 |  0 );
36521   if (!SWIG_IsOK(res2)) {
36522     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ContourGenerateEx" "', argument " "2"" of type '" "OGRLayerShadow *""'");
36523   }
36524   arg2 = reinterpret_cast< OGRLayerShadow * >(argp2);
36525   if (obj2) {
36526     {
36527       /* %typemap(in) char **options */
36528       int bErr = FALSE;
36529       arg3 = CSLFromPySequence(obj2, &bErr);
36530       if( bErr )
36531       {
36532         SWIG_fail;
36533       }
36534     }
36535   }
36536   if (obj3) {
36537     {
36538       /* %typemap(in) (GDALProgressFunc callback = NULL) */
36539       /* callback_func typemap */
36540 
36541       /* In some cases 0 is passed instead of None. */
36542       /* See https://github.com/OSGeo/gdal/pull/219 */
36543       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
36544       {
36545         if( PyLong_AsLong(obj3) == 0 )
36546         {
36547           obj3 = Py_None;
36548         }
36549       }
36550 
36551       if (obj3 && obj3 != Py_None ) {
36552         void* cbfunction = NULL;
36553         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
36554             (void**)&cbfunction,
36555             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
36556             SWIG_POINTER_EXCEPTION | 0 ));
36557 
36558         if ( cbfunction == GDALTermProgress ) {
36559           arg4 = GDALTermProgress;
36560         } else {
36561           if (!PyCallable_Check(obj3)) {
36562             PyErr_SetString( PyExc_RuntimeError,
36563               "Object given is not a Python function" );
36564             SWIG_fail;
36565           }
36566           psProgressInfo->psPyCallback = obj3;
36567           arg4 = PyProgressProxy;
36568         }
36569 
36570       }
36571 
36572     }
36573   }
36574   if (obj4) {
36575     {
36576       /* %typemap(in) ( void* callback_data=NULL)  */
36577       psProgressInfo->psPyCallbackData = obj4 ;
36578     }
36579   }
36580   {
36581     if (!arg1) {
36582       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36583     }
36584   }
36585   {
36586     if (!arg2) {
36587       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36588     }
36589   }
36590   {
36591     if ( bUseExceptions ) {
36592       ClearErrorState();
36593     }
36594     {
36595       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
36596       result = (int)ContourGenerateEx(arg1,arg2,arg3,arg4,arg5);
36597       SWIG_PYTHON_THREAD_END_ALLOW;
36598     }
36599 #ifndef SED_HACKS
36600     if ( bUseExceptions ) {
36601       CPLErr eclass = CPLGetLastErrorType();
36602       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36603         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
36604       }
36605     }
36606 #endif
36607   }
36608   resultobj = SWIG_From_int(static_cast< int >(result));
36609   {
36610     /* %typemap(freearg) char **options */
36611     CSLDestroy( arg3 );
36612   }
36613   {
36614     /* %typemap(freearg) ( void* callback_data=NULL)  */
36615 
36616     CPLFree(psProgressInfo);
36617 
36618   }
36619   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
36620   return resultobj;
36621 fail:
36622   {
36623     /* %typemap(freearg) char **options */
36624     CSLDestroy( arg3 );
36625   }
36626   {
36627     /* %typemap(freearg) ( void* callback_data=NULL)  */
36628 
36629     CPLFree(psProgressInfo);
36630 
36631   }
36632   return NULL;
36633 }
36634 
36635 
_wrap_ViewshedGenerate(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)36636 SWIGINTERN PyObject *_wrap_ViewshedGenerate(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
36637   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
36638   GDALRasterBandShadow *arg1 = (GDALRasterBandShadow *) 0 ;
36639   char *arg2 = (char *) 0 ;
36640   char *arg3 = (char *) 0 ;
36641   char **arg4 = (char **) 0 ;
36642   double arg5 ;
36643   double arg6 ;
36644   double arg7 ;
36645   double arg8 ;
36646   double arg9 ;
36647   double arg10 ;
36648   double arg11 ;
36649   double arg12 ;
36650   double arg13 ;
36651   GDALViewshedMode arg14 ;
36652   double arg15 ;
36653   GDALProgressFunc arg16 = (GDALProgressFunc) NULL ;
36654   void *arg17 = (void *) NULL ;
36655   GDALViewshedOutputType arg18 = (GDALViewshedOutputType) GVOT_NORMAL ;
36656   char **arg19 = (char **) NULL ;
36657   void *argp1 = 0 ;
36658   int res1 = 0 ;
36659   int res2 ;
36660   char *buf2 = 0 ;
36661   int alloc2 = 0 ;
36662   int res3 ;
36663   char *buf3 = 0 ;
36664   int alloc3 = 0 ;
36665   void *argp4 = 0 ;
36666   int res4 = 0 ;
36667   double val5 ;
36668   int ecode5 = 0 ;
36669   double val6 ;
36670   int ecode6 = 0 ;
36671   double val7 ;
36672   int ecode7 = 0 ;
36673   double val8 ;
36674   int ecode8 = 0 ;
36675   double val9 ;
36676   int ecode9 = 0 ;
36677   double val10 ;
36678   int ecode10 = 0 ;
36679   double val11 ;
36680   int ecode11 = 0 ;
36681   double val12 ;
36682   int ecode12 = 0 ;
36683   double val13 ;
36684   int ecode13 = 0 ;
36685   int val14 ;
36686   int ecode14 = 0 ;
36687   double val15 ;
36688   int ecode15 = 0 ;
36689   int val18 ;
36690   int ecode18 = 0 ;
36691   void *argp19 = 0 ;
36692   int res19 = 0 ;
36693   PyObject * obj0 = 0 ;
36694   PyObject * obj1 = 0 ;
36695   PyObject * obj2 = 0 ;
36696   PyObject * obj3 = 0 ;
36697   PyObject * obj4 = 0 ;
36698   PyObject * obj5 = 0 ;
36699   PyObject * obj6 = 0 ;
36700   PyObject * obj7 = 0 ;
36701   PyObject * obj8 = 0 ;
36702   PyObject * obj9 = 0 ;
36703   PyObject * obj10 = 0 ;
36704   PyObject * obj11 = 0 ;
36705   PyObject * obj12 = 0 ;
36706   PyObject * obj13 = 0 ;
36707   PyObject * obj14 = 0 ;
36708   PyObject * obj15 = 0 ;
36709   PyObject * obj16 = 0 ;
36710   PyObject * obj17 = 0 ;
36711   PyObject * obj18 = 0 ;
36712   char *  kwnames[] = {
36713     (char *) "srcBand",(char *) "driverName",(char *) "targetRasterName",(char *) "creationOptions",(char *) "observerX",(char *) "observerY",(char *) "observerHeight",(char *) "targetHeight",(char *) "visibleVal",(char *) "invisibleVal",(char *) "outOfRangeVal",(char *) "noDataVal",(char *) "dfCurvCoeff",(char *) "mode",(char *) "maxDistance",(char *) "callback",(char *) "callback_data",(char *) "heightMode",(char *) "papszOptions", NULL
36714   };
36715   GDALDatasetShadow *result = 0 ;
36716 
36717   /* %typemap(arginit) ( const char* callback_data=NULL)  */
36718   PyProgressData *psProgressInfo;
36719   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
36720   psProgressInfo->nLastReported = -1;
36721   psProgressInfo->psPyCallback = NULL;
36722   psProgressInfo->psPyCallbackData = NULL;
36723   arg17 = psProgressInfo;
36724   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOOOOOOOOOOOOO|OOOO:ViewshedGenerate",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11,&obj12,&obj13,&obj14,&obj15,&obj16,&obj17,&obj18)) SWIG_fail;
36725   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
36726   if (!SWIG_IsOK(res1)) {
36727     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ViewshedGenerate" "', argument " "1"" of type '" "GDALRasterBandShadow *""'");
36728   }
36729   arg1 = reinterpret_cast< GDALRasterBandShadow * >(argp1);
36730   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
36731   if (!SWIG_IsOK(res2)) {
36732     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ViewshedGenerate" "', argument " "2"" of type '" "char const *""'");
36733   }
36734   arg2 = reinterpret_cast< char * >(buf2);
36735   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
36736   if (!SWIG_IsOK(res3)) {
36737     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ViewshedGenerate" "', argument " "3"" of type '" "char const *""'");
36738   }
36739   arg3 = reinterpret_cast< char * >(buf3);
36740   res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_p_char, 0 |  0 );
36741   if (!SWIG_IsOK(res4)) {
36742     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "ViewshedGenerate" "', argument " "4"" of type '" "char **""'");
36743   }
36744   arg4 = reinterpret_cast< char ** >(argp4);
36745   ecode5 = SWIG_AsVal_double(obj4, &val5);
36746   if (!SWIG_IsOK(ecode5)) {
36747     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ViewshedGenerate" "', argument " "5"" of type '" "double""'");
36748   }
36749   arg5 = static_cast< double >(val5);
36750   ecode6 = SWIG_AsVal_double(obj5, &val6);
36751   if (!SWIG_IsOK(ecode6)) {
36752     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "ViewshedGenerate" "', argument " "6"" of type '" "double""'");
36753   }
36754   arg6 = static_cast< double >(val6);
36755   ecode7 = SWIG_AsVal_double(obj6, &val7);
36756   if (!SWIG_IsOK(ecode7)) {
36757     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ViewshedGenerate" "', argument " "7"" of type '" "double""'");
36758   }
36759   arg7 = static_cast< double >(val7);
36760   ecode8 = SWIG_AsVal_double(obj7, &val8);
36761   if (!SWIG_IsOK(ecode8)) {
36762     SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "ViewshedGenerate" "', argument " "8"" of type '" "double""'");
36763   }
36764   arg8 = static_cast< double >(val8);
36765   ecode9 = SWIG_AsVal_double(obj8, &val9);
36766   if (!SWIG_IsOK(ecode9)) {
36767     SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "ViewshedGenerate" "', argument " "9"" of type '" "double""'");
36768   }
36769   arg9 = static_cast< double >(val9);
36770   ecode10 = SWIG_AsVal_double(obj9, &val10);
36771   if (!SWIG_IsOK(ecode10)) {
36772     SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "ViewshedGenerate" "', argument " "10"" of type '" "double""'");
36773   }
36774   arg10 = static_cast< double >(val10);
36775   ecode11 = SWIG_AsVal_double(obj10, &val11);
36776   if (!SWIG_IsOK(ecode11)) {
36777     SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "ViewshedGenerate" "', argument " "11"" of type '" "double""'");
36778   }
36779   arg11 = static_cast< double >(val11);
36780   ecode12 = SWIG_AsVal_double(obj11, &val12);
36781   if (!SWIG_IsOK(ecode12)) {
36782     SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "ViewshedGenerate" "', argument " "12"" of type '" "double""'");
36783   }
36784   arg12 = static_cast< double >(val12);
36785   ecode13 = SWIG_AsVal_double(obj12, &val13);
36786   if (!SWIG_IsOK(ecode13)) {
36787     SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "ViewshedGenerate" "', argument " "13"" of type '" "double""'");
36788   }
36789   arg13 = static_cast< double >(val13);
36790   ecode14 = SWIG_AsVal_int(obj13, &val14);
36791   if (!SWIG_IsOK(ecode14)) {
36792     SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "ViewshedGenerate" "', argument " "14"" of type '" "GDALViewshedMode""'");
36793   }
36794   arg14 = static_cast< GDALViewshedMode >(val14);
36795   ecode15 = SWIG_AsVal_double(obj14, &val15);
36796   if (!SWIG_IsOK(ecode15)) {
36797     SWIG_exception_fail(SWIG_ArgError(ecode15), "in method '" "ViewshedGenerate" "', argument " "15"" of type '" "double""'");
36798   }
36799   arg15 = static_cast< double >(val15);
36800   if (obj15) {
36801     {
36802       /* %typemap(in) (GDALProgressFunc callback = NULL) */
36803       /* callback_func typemap */
36804 
36805       /* In some cases 0 is passed instead of None. */
36806       /* See https://github.com/OSGeo/gdal/pull/219 */
36807       if ( PyLong_Check(obj15) || PyInt_Check(obj15) )
36808       {
36809         if( PyLong_AsLong(obj15) == 0 )
36810         {
36811           obj15 = Py_None;
36812         }
36813       }
36814 
36815       if (obj15 && obj15 != Py_None ) {
36816         void* cbfunction = NULL;
36817         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj15,
36818             (void**)&cbfunction,
36819             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
36820             SWIG_POINTER_EXCEPTION | 0 ));
36821 
36822         if ( cbfunction == GDALTermProgress ) {
36823           arg16 = GDALTermProgress;
36824         } else {
36825           if (!PyCallable_Check(obj15)) {
36826             PyErr_SetString( PyExc_RuntimeError,
36827               "Object given is not a Python function" );
36828             SWIG_fail;
36829           }
36830           psProgressInfo->psPyCallback = obj15;
36831           arg16 = PyProgressProxy;
36832         }
36833 
36834       }
36835 
36836     }
36837   }
36838   if (obj16) {
36839     {
36840       /* %typemap(in) ( void* callback_data=NULL)  */
36841       psProgressInfo->psPyCallbackData = obj16 ;
36842     }
36843   }
36844   if (obj17) {
36845     ecode18 = SWIG_AsVal_int(obj17, &val18);
36846     if (!SWIG_IsOK(ecode18)) {
36847       SWIG_exception_fail(SWIG_ArgError(ecode18), "in method '" "ViewshedGenerate" "', argument " "18"" of type '" "GDALViewshedOutputType""'");
36848     }
36849     arg18 = static_cast< GDALViewshedOutputType >(val18);
36850   }
36851   if (obj18) {
36852     res19 = SWIG_ConvertPtr(obj18, &argp19,SWIGTYPE_p_p_char, 0 |  0 );
36853     if (!SWIG_IsOK(res19)) {
36854       SWIG_exception_fail(SWIG_ArgError(res19), "in method '" "ViewshedGenerate" "', argument " "19"" of type '" "char **""'");
36855     }
36856     arg19 = reinterpret_cast< char ** >(argp19);
36857   }
36858   {
36859     if (!arg1) {
36860       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36861     }
36862   }
36863   {
36864     if ( bUseExceptions ) {
36865       ClearErrorState();
36866     }
36867     {
36868       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
36869       result = (GDALDatasetShadow *)ViewshedGenerate(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19);
36870       SWIG_PYTHON_THREAD_END_ALLOW;
36871     }
36872 #ifndef SED_HACKS
36873     if ( bUseExceptions ) {
36874       CPLErr eclass = CPLGetLastErrorType();
36875       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36876         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
36877       }
36878     }
36879 #endif
36880   }
36881   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
36882   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
36883   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
36884   {
36885     /* %typemap(freearg) ( void* callback_data=NULL)  */
36886 
36887     CPLFree(psProgressInfo);
36888 
36889   }
36890   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
36891   return resultobj;
36892 fail:
36893   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
36894   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
36895   {
36896     /* %typemap(freearg) ( void* callback_data=NULL)  */
36897 
36898     CPLFree(psProgressInfo);
36899 
36900   }
36901   return NULL;
36902 }
36903 
36904 
_wrap_AutoCreateWarpedVRT(PyObject * SWIGUNUSEDPARM (self),PyObject * args)36905 SWIGINTERN PyObject *_wrap_AutoCreateWarpedVRT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
36906   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
36907   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
36908   char *arg2 = (char *) 0 ;
36909   char *arg3 = (char *) 0 ;
36910   GDALResampleAlg arg4 = (GDALResampleAlg) GRA_NearestNeighbour ;
36911   double arg5 = (double) 0.0 ;
36912   void *argp1 = 0 ;
36913   int res1 = 0 ;
36914   int res2 ;
36915   char *buf2 = 0 ;
36916   int alloc2 = 0 ;
36917   int res3 ;
36918   char *buf3 = 0 ;
36919   int alloc3 = 0 ;
36920   int val4 ;
36921   int ecode4 = 0 ;
36922   double val5 ;
36923   int ecode5 = 0 ;
36924   PyObject * obj0 = 0 ;
36925   PyObject * obj1 = 0 ;
36926   PyObject * obj2 = 0 ;
36927   PyObject * obj3 = 0 ;
36928   PyObject * obj4 = 0 ;
36929   GDALDatasetShadow *result = 0 ;
36930 
36931   if (!PyArg_ParseTuple(args,(char *)"O|OOOO:AutoCreateWarpedVRT",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
36932   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
36933   if (!SWIG_IsOK(res1)) {
36934     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AutoCreateWarpedVRT" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
36935   }
36936   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
36937   if (obj1) {
36938     res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
36939     if (!SWIG_IsOK(res2)) {
36940       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "AutoCreateWarpedVRT" "', argument " "2"" of type '" "char const *""'");
36941     }
36942     arg2 = reinterpret_cast< char * >(buf2);
36943   }
36944   if (obj2) {
36945     res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
36946     if (!SWIG_IsOK(res3)) {
36947       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "AutoCreateWarpedVRT" "', argument " "3"" of type '" "char const *""'");
36948     }
36949     arg3 = reinterpret_cast< char * >(buf3);
36950   }
36951   if (obj3) {
36952     ecode4 = SWIG_AsVal_int(obj3, &val4);
36953     if (!SWIG_IsOK(ecode4)) {
36954       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "AutoCreateWarpedVRT" "', argument " "4"" of type '" "GDALResampleAlg""'");
36955     }
36956     arg4 = static_cast< GDALResampleAlg >(val4);
36957   }
36958   if (obj4) {
36959     ecode5 = SWIG_AsVal_double(obj4, &val5);
36960     if (!SWIG_IsOK(ecode5)) {
36961       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "AutoCreateWarpedVRT" "', argument " "5"" of type '" "double""'");
36962     }
36963     arg5 = static_cast< double >(val5);
36964   }
36965   {
36966     if (!arg1) {
36967       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
36968     }
36969   }
36970   {
36971     if ( bUseExceptions ) {
36972       ClearErrorState();
36973     }
36974     {
36975       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
36976       result = (GDALDatasetShadow *)AutoCreateWarpedVRT(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
36977       SWIG_PYTHON_THREAD_END_ALLOW;
36978     }
36979 #ifndef SED_HACKS
36980     if ( bUseExceptions ) {
36981       CPLErr eclass = CPLGetLastErrorType();
36982       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
36983         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
36984       }
36985     }
36986 #endif
36987   }
36988   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
36989   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
36990   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
36991   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
36992   return resultobj;
36993 fail:
36994   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
36995   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
36996   return NULL;
36997 }
36998 
36999 
_wrap_CreatePansharpenedVRT(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37000 SWIGINTERN PyObject *_wrap_CreatePansharpenedVRT(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37001   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37002   char *arg1 = (char *) 0 ;
37003   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
37004   int arg3 ;
37005   GDALRasterBandShadow **arg4 = (GDALRasterBandShadow **) 0 ;
37006   int res1 ;
37007   char *buf1 = 0 ;
37008   int alloc1 = 0 ;
37009   void *argp2 = 0 ;
37010   int res2 = 0 ;
37011   PyObject * obj0 = 0 ;
37012   PyObject * obj1 = 0 ;
37013   PyObject * obj2 = 0 ;
37014   GDALDatasetShadow *result = 0 ;
37015 
37016   if (!PyArg_ParseTuple(args,(char *)"OOO:CreatePansharpenedVRT",&obj0,&obj1,&obj2)) SWIG_fail;
37017   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
37018   if (!SWIG_IsOK(res1)) {
37019     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CreatePansharpenedVRT" "', argument " "1"" of type '" "char const *""'");
37020   }
37021   arg1 = reinterpret_cast< char * >(buf1);
37022   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
37023   if (!SWIG_IsOK(res2)) {
37024     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CreatePansharpenedVRT" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
37025   }
37026   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
37027   {
37028     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALRasterBandShadow *optional_##GDALRasterBandShadow)*/
37029     if ( !PySequence_Check(obj2) ) {
37030       PyErr_SetString(PyExc_TypeError, "not a sequence");
37031       SWIG_fail;
37032     }
37033     Py_ssize_t size = PySequence_Size(obj2);
37034     if( size != (int)size ) {
37035       PyErr_SetString(PyExc_TypeError, "too big sequence");
37036       SWIG_fail;
37037     }
37038     arg3 = (int)size;
37039     arg4 = (GDALRasterBandShadow**) CPLMalloc(arg3*sizeof(GDALRasterBandShadow*));
37040 
37041     for( int i = 0; i<arg3; i++ ) {
37042       PyObject *o = PySequence_GetItem(obj2,i);
37043       GDALRasterBandShadow* rawobjectpointer = NULL;
37044       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALRasterBandShadow, SWIG_POINTER_EXCEPTION | 0 ));
37045       if (!rawobjectpointer) {
37046         Py_DECREF(o);
37047         PyErr_SetString(PyExc_TypeError, "object of wrong GDALRasterBandShadow");
37048         SWIG_fail;
37049       }
37050       arg4[i] = rawobjectpointer;
37051       Py_DECREF(o);
37052 
37053     }
37054   }
37055   {
37056     if (!arg2) {
37057       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37058     }
37059   }
37060   {
37061     if ( bUseExceptions ) {
37062       ClearErrorState();
37063     }
37064     {
37065       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37066       result = (GDALDatasetShadow *)CreatePansharpenedVRT((char const *)arg1,arg2,arg3,arg4);
37067       SWIG_PYTHON_THREAD_END_ALLOW;
37068     }
37069 #ifndef SED_HACKS
37070     if ( bUseExceptions ) {
37071       CPLErr eclass = CPLGetLastErrorType();
37072       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37073         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37074       }
37075     }
37076 #endif
37077   }
37078   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
37079   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
37080   {
37081     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects)*/
37082     CPLFree( arg4 );
37083   }
37084   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37085   return resultobj;
37086 fail:
37087   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
37088   {
37089     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALRasterBandShadow **poObjects)*/
37090     CPLFree( arg4 );
37091   }
37092   return NULL;
37093 }
37094 
37095 
_wrap_delete_GDALTransformerInfoShadow(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37096 SWIGINTERN PyObject *_wrap_delete_GDALTransformerInfoShadow(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37097   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37098   GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
37099   void *argp1 = 0 ;
37100   int res1 = 0 ;
37101   PyObject * obj0 = 0 ;
37102 
37103   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALTransformerInfoShadow",&obj0)) SWIG_fail;
37104   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, SWIG_POINTER_DISOWN |  0 );
37105   if (!SWIG_IsOK(res1)) {
37106     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALTransformerInfoShadow" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
37107   }
37108   arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
37109   {
37110     if ( bUseExceptions ) {
37111       ClearErrorState();
37112     }
37113     {
37114       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37115       delete_GDALTransformerInfoShadow(arg1);
37116       SWIG_PYTHON_THREAD_END_ALLOW;
37117     }
37118 #ifndef SED_HACKS
37119     if ( bUseExceptions ) {
37120       CPLErr eclass = CPLGetLastErrorType();
37121       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37122         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37123       }
37124     }
37125 #endif
37126   }
37127   resultobj = SWIG_Py_Void();
37128   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37129   return resultobj;
37130 fail:
37131   return NULL;
37132 }
37133 
37134 
_wrap_GDALTransformerInfoShadow_TransformPoint__SWIG_0(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37135 SWIGINTERN PyObject *_wrap_GDALTransformerInfoShadow_TransformPoint__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37136   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37137   GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
37138   int arg2 ;
37139   double *arg3 ;
37140   void *argp1 = 0 ;
37141   int res1 = 0 ;
37142   int val2 ;
37143   int ecode2 = 0 ;
37144   double argin3[3] ;
37145   PyObject * obj0 = 0 ;
37146   PyObject * obj1 = 0 ;
37147   PyObject * obj2 = 0 ;
37148   int result;
37149 
37150   if (!PyArg_ParseTuple(args,(char *)"OOO:GDALTransformerInfoShadow_TransformPoint",&obj0,&obj1,&obj2)) SWIG_fail;
37151   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
37152   if (!SWIG_IsOK(res1)) {
37153     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDALTransformerInfoShadow_TransformPoint" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
37154   }
37155   arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
37156   ecode2 = SWIG_AsVal_int(obj1, &val2);
37157   if (!SWIG_IsOK(ecode2)) {
37158     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDALTransformerInfoShadow_TransformPoint" "', argument " "2"" of type '" "int""'");
37159   }
37160   arg2 = static_cast< int >(val2);
37161   {
37162     /* %typemap(in) (double argin3[ANY]) */
37163     arg3 = argin3;
37164     if (! PySequence_Check(obj2) ) {
37165       PyErr_SetString(PyExc_TypeError, "not a sequence");
37166       SWIG_fail;
37167     }
37168     Py_ssize_t seq_size = PySequence_Size(obj2);
37169     if ( seq_size != 3 ) {
37170       PyErr_SetString(PyExc_TypeError, "sequence must have length ##size");
37171       SWIG_fail;
37172     }
37173     for (unsigned int i=0; i<3; i++) {
37174       PyObject *o = PySequence_GetItem(obj2,i);
37175       double val;
37176       if ( !PyArg_Parse(o, "d", &val ) ) {
37177         PyErr_SetString(PyExc_TypeError, "not a number");
37178         Py_DECREF(o);
37179         SWIG_fail;
37180       }
37181       arg3[i] =  val;
37182       Py_DECREF(o);
37183     }
37184   }
37185   {
37186     if ( bUseExceptions ) {
37187       ClearErrorState();
37188     }
37189     {
37190       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37191       result = (int)GDALTransformerInfoShadow_TransformPoint__SWIG_0(arg1,arg2,arg3);
37192       SWIG_PYTHON_THREAD_END_ALLOW;
37193     }
37194 #ifndef SED_HACKS
37195     if ( bUseExceptions ) {
37196       CPLErr eclass = CPLGetLastErrorType();
37197       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37198         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37199       }
37200     }
37201 #endif
37202   }
37203   resultobj = SWIG_From_int(static_cast< int >(result));
37204   {
37205     /* %typemap(argout) (double argout[ANY]) */
37206     PyObject *out = CreateTupleFromDoubleArray( arg3, 3 );
37207     resultobj = t_output_helper(resultobj,out);
37208   }
37209   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37210   return resultobj;
37211 fail:
37212   return NULL;
37213 }
37214 
37215 
_wrap_GDALTransformerInfoShadow_TransformPoint__SWIG_1(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37216 SWIGINTERN PyObject *_wrap_GDALTransformerInfoShadow_TransformPoint__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37217   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37218   GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
37219   double *arg2 ;
37220   int arg3 ;
37221   double arg4 ;
37222   double arg5 ;
37223   double arg6 = (double) 0.0 ;
37224   void *argp1 = 0 ;
37225   int res1 = 0 ;
37226   double argout2[3] ;
37227   int val3 ;
37228   int ecode3 = 0 ;
37229   double val4 ;
37230   int ecode4 = 0 ;
37231   double val5 ;
37232   int ecode5 = 0 ;
37233   double val6 ;
37234   int ecode6 = 0 ;
37235   PyObject * obj0 = 0 ;
37236   PyObject * obj1 = 0 ;
37237   PyObject * obj2 = 0 ;
37238   PyObject * obj3 = 0 ;
37239   PyObject * obj4 = 0 ;
37240   int result;
37241 
37242   {
37243     /* %typemap(in,numinputs=0) (double argout2[ANY]) */
37244     memset(argout2, 0, sizeof(argout2));
37245     arg2 = argout2;
37246   }
37247   if (!PyArg_ParseTuple(args,(char *)"OOOO|O:GDALTransformerInfoShadow_TransformPoint",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
37248   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
37249   if (!SWIG_IsOK(res1)) {
37250     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDALTransformerInfoShadow_TransformPoint" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
37251   }
37252   arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
37253   ecode3 = SWIG_AsVal_int(obj1, &val3);
37254   if (!SWIG_IsOK(ecode3)) {
37255     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "GDALTransformerInfoShadow_TransformPoint" "', argument " "3"" of type '" "int""'");
37256   }
37257   arg3 = static_cast< int >(val3);
37258   ecode4 = SWIG_AsVal_double(obj2, &val4);
37259   if (!SWIG_IsOK(ecode4)) {
37260     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "GDALTransformerInfoShadow_TransformPoint" "', argument " "4"" of type '" "double""'");
37261   }
37262   arg4 = static_cast< double >(val4);
37263   ecode5 = SWIG_AsVal_double(obj3, &val5);
37264   if (!SWIG_IsOK(ecode5)) {
37265     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "GDALTransformerInfoShadow_TransformPoint" "', argument " "5"" of type '" "double""'");
37266   }
37267   arg5 = static_cast< double >(val5);
37268   if (obj4) {
37269     ecode6 = SWIG_AsVal_double(obj4, &val6);
37270     if (!SWIG_IsOK(ecode6)) {
37271       SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "GDALTransformerInfoShadow_TransformPoint" "', argument " "6"" of type '" "double""'");
37272     }
37273     arg6 = static_cast< double >(val6);
37274   }
37275   {
37276     if ( bUseExceptions ) {
37277       ClearErrorState();
37278     }
37279     {
37280       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37281       result = (int)GDALTransformerInfoShadow_TransformPoint__SWIG_1(arg1,arg2,arg3,arg4,arg5,arg6);
37282       SWIG_PYTHON_THREAD_END_ALLOW;
37283     }
37284 #ifndef SED_HACKS
37285     if ( bUseExceptions ) {
37286       CPLErr eclass = CPLGetLastErrorType();
37287       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37288         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37289       }
37290     }
37291 #endif
37292   }
37293   resultobj = SWIG_From_int(static_cast< int >(result));
37294   {
37295     /* %typemap(argout) (double argout[ANY]) */
37296     PyObject *out = CreateTupleFromDoubleArray( arg2, 3 );
37297     resultobj = t_output_helper(resultobj,out);
37298   }
37299   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37300   return resultobj;
37301 fail:
37302   return NULL;
37303 }
37304 
37305 
_wrap_GDALTransformerInfoShadow_TransformPoint(PyObject * self,PyObject * args)37306 SWIGINTERN PyObject *_wrap_GDALTransformerInfoShadow_TransformPoint(PyObject *self, PyObject *args) {
37307   Py_ssize_t argc;
37308   PyObject *argv[6] = {
37309     0
37310   };
37311   Py_ssize_t ii;
37312 
37313   if (args == NULL || !PyTuple_Check(args)) SWIG_fail;
37314   argc = args ? PyObject_Length(args) : 0;
37315   for (ii = 0; (ii < 5) && (ii < argc); ii++) {
37316     argv[ii] = PyTuple_GET_ITEM(args,ii);
37317   }
37318   if (argc == 3) {
37319     int _v;
37320     void *vptr = 0;
37321     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_GDALTransformerInfoShadow, 0);
37322     _v = SWIG_CheckState(res);
37323     if (_v) {
37324       {
37325         int res = SWIG_AsVal_int(argv[1], NULL);
37326         _v = SWIG_CheckState(res);
37327       }
37328       if (_v) {
37329         void *vptr = 0;
37330         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_double, 0);
37331         _v = SWIG_CheckState(res);
37332         if (_v) {
37333           return _wrap_GDALTransformerInfoShadow_TransformPoint__SWIG_0(self, args);
37334         }
37335       }
37336     }
37337   }
37338   if ((argc >= 4) && (argc <= 5)) {
37339     int _v;
37340     void *vptr = 0;
37341     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_GDALTransformerInfoShadow, 0);
37342     _v = SWIG_CheckState(res);
37343     if (_v) {
37344       {
37345         int res = SWIG_AsVal_int(argv[1], NULL);
37346         _v = SWIG_CheckState(res);
37347       }
37348       if (_v) {
37349         {
37350           int res = SWIG_AsVal_double(argv[2], NULL);
37351           _v = SWIG_CheckState(res);
37352         }
37353         if (_v) {
37354           {
37355             int res = SWIG_AsVal_double(argv[3], NULL);
37356             _v = SWIG_CheckState(res);
37357           }
37358           if (_v) {
37359             if (argc <= 4) {
37360               return _wrap_GDALTransformerInfoShadow_TransformPoint__SWIG_1(self, args);
37361             }
37362             {
37363               int res = SWIG_AsVal_double(argv[4], NULL);
37364               _v = SWIG_CheckState(res);
37365             }
37366             if (_v) {
37367               return _wrap_GDALTransformerInfoShadow_TransformPoint__SWIG_1(self, args);
37368             }
37369           }
37370         }
37371       }
37372     }
37373   }
37374 
37375 fail:
37376   SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'GDALTransformerInfoShadow_TransformPoint'.\n"
37377     "  Possible C/C++ prototypes are:\n"
37378     "    GDALTransformerInfoShadow::TransformPoint(int,double [3])\n"
37379     "    GDALTransformerInfoShadow::TransformPoint(double [3],int,double,double,double)\n");
37380   return 0;
37381 }
37382 
37383 
_wrap_GDALTransformerInfoShadow_TransformPoints(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37384 SWIGINTERN PyObject *_wrap_GDALTransformerInfoShadow_TransformPoints(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37385   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37386   GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
37387   int arg2 ;
37388   int arg3 ;
37389   double *arg4 = (double *) 0 ;
37390   double *arg5 = (double *) 0 ;
37391   double *arg6 = (double *) 0 ;
37392   int *arg7 = (int *) 0 ;
37393   void *argp1 = 0 ;
37394   int res1 = 0 ;
37395   int val2 ;
37396   int ecode2 = 0 ;
37397   PyObject * obj0 = 0 ;
37398   PyObject * obj1 = 0 ;
37399   PyObject * obj2 = 0 ;
37400   int result;
37401 
37402   if (!PyArg_ParseTuple(args,(char *)"OOO:GDALTransformerInfoShadow_TransformPoints",&obj0,&obj1,&obj2)) SWIG_fail;
37403   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
37404   if (!SWIG_IsOK(res1)) {
37405     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDALTransformerInfoShadow_TransformPoints" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
37406   }
37407   arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
37408   ecode2 = SWIG_AsVal_int(obj1, &val2);
37409   if (!SWIG_IsOK(ecode2)) {
37410     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GDALTransformerInfoShadow_TransformPoints" "', argument " "2"" of type '" "int""'");
37411   }
37412   arg2 = static_cast< int >(val2);
37413   {
37414     /*  typemap(in,numinputs=1) (int nCount, double *x, double *y, double *z, int* panSuccess) */
37415     if ( !PySequence_Check(obj2) ) {
37416       PyErr_SetString(PyExc_TypeError, "not a sequence");
37417       SWIG_fail;
37418     }
37419 
37420     Py_ssize_t size = PySequence_Size(obj2);
37421     if( size != (int)size ) {
37422       PyErr_SetString(PyExc_TypeError, "too big sequence");
37423       SWIG_fail;
37424     }
37425     arg3 = (int)size;
37426     arg4 = (double*) VSIMalloc(arg3*sizeof(double));
37427     arg5 = (double*) VSIMalloc(arg3*sizeof(double));
37428     arg6 = (double*) VSIMalloc(arg3*sizeof(double));
37429     arg7 = (int*) VSIMalloc(arg3*sizeof(int));
37430 
37431     if (arg4 == NULL || arg5 == NULL || arg6 == NULL || arg7 == NULL)
37432     {
37433       PyErr_SetString( PyExc_RuntimeError, "Out of memory" );
37434       SWIG_fail;
37435     }
37436 
37437     if (!DecomposeSequenceOfCoordinates(obj2,arg3,arg4,arg5,arg6)) {
37438       SWIG_fail;
37439     }
37440   }
37441   {
37442     if ( bUseExceptions ) {
37443       ClearErrorState();
37444     }
37445     {
37446       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37447       result = (int)GDALTransformerInfoShadow_TransformPoints(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
37448       SWIG_PYTHON_THREAD_END_ALLOW;
37449     }
37450 #ifndef SED_HACKS
37451     if ( bUseExceptions ) {
37452       CPLErr eclass = CPLGetLastErrorType();
37453       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37454         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37455       }
37456     }
37457 #endif
37458   }
37459   resultobj = SWIG_From_int(static_cast< int >(result));
37460   {
37461     /* %typemap(argout)  (int nCount, double *x, double *y, double *z, int* panSuccess) */
37462     Py_DECREF(resultobj);
37463     PyObject *xyz = PyList_New( arg3 );
37464     PyObject *success = PyList_New( arg3 );
37465     for( int i=0; i< arg3; i++ ) {
37466       PyObject *tuple = PyTuple_New( 3 );
37467       PyTuple_SetItem( tuple, 0, PyFloat_FromDouble( (arg4)[i] ) );
37468       PyTuple_SetItem( tuple, 1, PyFloat_FromDouble( (arg5)[i] ) );
37469       PyTuple_SetItem( tuple, 2, PyFloat_FromDouble( (arg6)[i] ) );
37470       PyList_SetItem( xyz, i, tuple );
37471       PyList_SetItem( success, i, Py_BuildValue( "i",  (arg7)[i]) );
37472     }
37473     resultobj = PyTuple_New( 2 );
37474     PyTuple_SetItem( resultobj, 0, xyz );
37475     PyTuple_SetItem( resultobj, 1, success );
37476   }
37477   {
37478     /* %typemap(freearg)  (int nCount, double *x, double *y, double *z, int* panSuccess) */
37479     VSIFree(arg4);
37480     VSIFree(arg5);
37481     VSIFree(arg6);
37482     VSIFree(arg7);
37483   }
37484   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37485   return resultobj;
37486 fail:
37487   {
37488     /* %typemap(freearg)  (int nCount, double *x, double *y, double *z, int* panSuccess) */
37489     VSIFree(arg4);
37490     VSIFree(arg5);
37491     VSIFree(arg6);
37492     VSIFree(arg7);
37493   }
37494   return NULL;
37495 }
37496 
37497 
_wrap_GDALTransformerInfoShadow_TransformGeolocations(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)37498 SWIGINTERN PyObject *_wrap_GDALTransformerInfoShadow_TransformGeolocations(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
37499   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37500   GDALTransformerInfoShadow *arg1 = (GDALTransformerInfoShadow *) 0 ;
37501   GDALRasterBandShadow *arg2 = (GDALRasterBandShadow *) 0 ;
37502   GDALRasterBandShadow *arg3 = (GDALRasterBandShadow *) 0 ;
37503   GDALRasterBandShadow *arg4 = (GDALRasterBandShadow *) 0 ;
37504   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
37505   void *arg6 = (void *) NULL ;
37506   char **arg7 = (char **) NULL ;
37507   void *argp1 = 0 ;
37508   int res1 = 0 ;
37509   void *argp2 = 0 ;
37510   int res2 = 0 ;
37511   void *argp3 = 0 ;
37512   int res3 = 0 ;
37513   void *argp4 = 0 ;
37514   int res4 = 0 ;
37515   PyObject * obj0 = 0 ;
37516   PyObject * obj1 = 0 ;
37517   PyObject * obj2 = 0 ;
37518   PyObject * obj3 = 0 ;
37519   PyObject * obj4 = 0 ;
37520   PyObject * obj5 = 0 ;
37521   PyObject * obj6 = 0 ;
37522   char *  kwnames[] = {
37523     (char *) "self",(char *) "xBand",(char *) "yBand",(char *) "zBand",(char *) "callback",(char *) "callback_data",(char *) "options", NULL
37524   };
37525   int result;
37526 
37527   /* %typemap(arginit) ( const char* callback_data=NULL)  */
37528   PyProgressData *psProgressInfo;
37529   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
37530   psProgressInfo->nLastReported = -1;
37531   psProgressInfo->psPyCallback = NULL;
37532   psProgressInfo->psPyCallbackData = NULL;
37533   arg6 = psProgressInfo;
37534   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOOO|OOO:GDALTransformerInfoShadow_TransformGeolocations",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
37535   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALTransformerInfoShadow, 0 |  0 );
37536   if (!SWIG_IsOK(res1)) {
37537     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GDALTransformerInfoShadow_TransformGeolocations" "', argument " "1"" of type '" "GDALTransformerInfoShadow *""'");
37538   }
37539   arg1 = reinterpret_cast< GDALTransformerInfoShadow * >(argp1);
37540   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
37541   if (!SWIG_IsOK(res2)) {
37542     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GDALTransformerInfoShadow_TransformGeolocations" "', argument " "2"" of type '" "GDALRasterBandShadow *""'");
37543   }
37544   arg2 = reinterpret_cast< GDALRasterBandShadow * >(argp2);
37545   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
37546   if (!SWIG_IsOK(res3)) {
37547     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GDALTransformerInfoShadow_TransformGeolocations" "', argument " "3"" of type '" "GDALRasterBandShadow *""'");
37548   }
37549   arg3 = reinterpret_cast< GDALRasterBandShadow * >(argp3);
37550   res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_GDALRasterBandShadow, 0 |  0 );
37551   if (!SWIG_IsOK(res4)) {
37552     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "GDALTransformerInfoShadow_TransformGeolocations" "', argument " "4"" of type '" "GDALRasterBandShadow *""'");
37553   }
37554   arg4 = reinterpret_cast< GDALRasterBandShadow * >(argp4);
37555   if (obj4) {
37556     {
37557       /* %typemap(in) (GDALProgressFunc callback = NULL) */
37558       /* callback_func typemap */
37559 
37560       /* In some cases 0 is passed instead of None. */
37561       /* See https://github.com/OSGeo/gdal/pull/219 */
37562       if ( PyLong_Check(obj4) || PyInt_Check(obj4) )
37563       {
37564         if( PyLong_AsLong(obj4) == 0 )
37565         {
37566           obj4 = Py_None;
37567         }
37568       }
37569 
37570       if (obj4 && obj4 != Py_None ) {
37571         void* cbfunction = NULL;
37572         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj4,
37573             (void**)&cbfunction,
37574             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
37575             SWIG_POINTER_EXCEPTION | 0 ));
37576 
37577         if ( cbfunction == GDALTermProgress ) {
37578           arg5 = GDALTermProgress;
37579         } else {
37580           if (!PyCallable_Check(obj4)) {
37581             PyErr_SetString( PyExc_RuntimeError,
37582               "Object given is not a Python function" );
37583             SWIG_fail;
37584           }
37585           psProgressInfo->psPyCallback = obj4;
37586           arg5 = PyProgressProxy;
37587         }
37588 
37589       }
37590 
37591     }
37592   }
37593   if (obj5) {
37594     {
37595       /* %typemap(in) ( void* callback_data=NULL)  */
37596       psProgressInfo->psPyCallbackData = obj5 ;
37597     }
37598   }
37599   if (obj6) {
37600     {
37601       /* %typemap(in) char **options */
37602       int bErr = FALSE;
37603       arg7 = CSLFromPySequence(obj6, &bErr);
37604       if( bErr )
37605       {
37606         SWIG_fail;
37607       }
37608     }
37609   }
37610   {
37611     if (!arg2) {
37612       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37613     }
37614   }
37615   {
37616     if (!arg3) {
37617       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37618     }
37619   }
37620   {
37621     if (!arg4) {
37622       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37623     }
37624   }
37625   {
37626     if ( bUseExceptions ) {
37627       ClearErrorState();
37628     }
37629     {
37630       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37631       result = (int)GDALTransformerInfoShadow_TransformGeolocations(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
37632       SWIG_PYTHON_THREAD_END_ALLOW;
37633     }
37634 #ifndef SED_HACKS
37635     if ( bUseExceptions ) {
37636       CPLErr eclass = CPLGetLastErrorType();
37637       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37638         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37639       }
37640     }
37641 #endif
37642   }
37643   resultobj = SWIG_From_int(static_cast< int >(result));
37644   {
37645     /* %typemap(freearg) ( void* callback_data=NULL)  */
37646 
37647     CPLFree(psProgressInfo);
37648 
37649   }
37650   {
37651     /* %typemap(freearg) char **options */
37652     CSLDestroy( arg7 );
37653   }
37654   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37655   return resultobj;
37656 fail:
37657   {
37658     /* %typemap(freearg) ( void* callback_data=NULL)  */
37659 
37660     CPLFree(psProgressInfo);
37661 
37662   }
37663   {
37664     /* %typemap(freearg) char **options */
37665     CSLDestroy( arg7 );
37666   }
37667   return NULL;
37668 }
37669 
37670 
GDALTransformerInfoShadow_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37671 SWIGINTERN PyObject *GDALTransformerInfoShadow_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37672   PyObject *obj;
37673   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
37674   SWIG_TypeNewClientData(SWIGTYPE_p_GDALTransformerInfoShadow, SWIG_NewClientData(obj));
37675   return SWIG_Py_Void();
37676 }
37677 
_wrap_Transformer(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37678 SWIGINTERN PyObject *_wrap_Transformer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37679   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37680   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
37681   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
37682   char **arg3 = (char **) 0 ;
37683   void *argp1 = 0 ;
37684   int res1 = 0 ;
37685   void *argp2 = 0 ;
37686   int res2 = 0 ;
37687   PyObject * obj0 = 0 ;
37688   PyObject * obj1 = 0 ;
37689   PyObject * obj2 = 0 ;
37690   GDALTransformerInfoShadow *result = 0 ;
37691 
37692   if (!PyArg_ParseTuple(args,(char *)"OOO:Transformer",&obj0,&obj1,&obj2)) SWIG_fail;
37693   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
37694   if (!SWIG_IsOK(res1)) {
37695     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Transformer" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
37696   }
37697   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
37698   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
37699   if (!SWIG_IsOK(res2)) {
37700     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Transformer" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
37701   }
37702   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
37703   {
37704     /* %typemap(in) char **options */
37705     int bErr = FALSE;
37706     arg3 = CSLFromPySequence(obj2, &bErr);
37707     if( bErr )
37708     {
37709       SWIG_fail;
37710     }
37711   }
37712   {
37713     if ( bUseExceptions ) {
37714       ClearErrorState();
37715     }
37716     {
37717       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37718       result = (GDALTransformerInfoShadow *)Transformer(arg1,arg2,arg3);
37719       SWIG_PYTHON_THREAD_END_ALLOW;
37720     }
37721 #ifndef SED_HACKS
37722     if ( bUseExceptions ) {
37723       CPLErr eclass = CPLGetLastErrorType();
37724       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37725         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37726       }
37727     }
37728 #endif
37729   }
37730   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALTransformerInfoShadow, SWIG_POINTER_OWN |  0 );
37731   {
37732     /* %typemap(freearg) char **options */
37733     CSLDestroy( arg3 );
37734   }
37735   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37736   return resultobj;
37737 fail:
37738   {
37739     /* %typemap(freearg) char **options */
37740     CSLDestroy( arg3 );
37741   }
37742   return NULL;
37743 }
37744 
37745 
_wrap_ApplyVerticalShiftGrid(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)37746 SWIGINTERN PyObject *_wrap_ApplyVerticalShiftGrid(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
37747   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37748   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
37749   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
37750   bool arg3 = (bool) false ;
37751   double arg4 = (double) 1.0 ;
37752   double arg5 = (double) 1.0 ;
37753   char **arg6 = (char **) NULL ;
37754   void *argp1 = 0 ;
37755   int res1 = 0 ;
37756   void *argp2 = 0 ;
37757   int res2 = 0 ;
37758   bool val3 ;
37759   int ecode3 = 0 ;
37760   double val4 ;
37761   int ecode4 = 0 ;
37762   double val5 ;
37763   int ecode5 = 0 ;
37764   PyObject * obj0 = 0 ;
37765   PyObject * obj1 = 0 ;
37766   PyObject * obj2 = 0 ;
37767   PyObject * obj3 = 0 ;
37768   PyObject * obj4 = 0 ;
37769   PyObject * obj5 = 0 ;
37770   char *  kwnames[] = {
37771     (char *) "src_ds",(char *) "grid_ds",(char *) "inverse",(char *) "srcUnitToMeter",(char *) "dstUnitToMeter",(char *) "options", NULL
37772   };
37773   GDALDatasetShadow *result = 0 ;
37774 
37775   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOO:ApplyVerticalShiftGrid",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
37776   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
37777   if (!SWIG_IsOK(res1)) {
37778     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ApplyVerticalShiftGrid" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
37779   }
37780   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
37781   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
37782   if (!SWIG_IsOK(res2)) {
37783     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ApplyVerticalShiftGrid" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
37784   }
37785   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
37786   if (obj2) {
37787     ecode3 = SWIG_AsVal_bool(obj2, &val3);
37788     if (!SWIG_IsOK(ecode3)) {
37789       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ApplyVerticalShiftGrid" "', argument " "3"" of type '" "bool""'");
37790     }
37791     arg3 = static_cast< bool >(val3);
37792   }
37793   if (obj3) {
37794     ecode4 = SWIG_AsVal_double(obj3, &val4);
37795     if (!SWIG_IsOK(ecode4)) {
37796       SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "ApplyVerticalShiftGrid" "', argument " "4"" of type '" "double""'");
37797     }
37798     arg4 = static_cast< double >(val4);
37799   }
37800   if (obj4) {
37801     ecode5 = SWIG_AsVal_double(obj4, &val5);
37802     if (!SWIG_IsOK(ecode5)) {
37803       SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ApplyVerticalShiftGrid" "', argument " "5"" of type '" "double""'");
37804     }
37805     arg5 = static_cast< double >(val5);
37806   }
37807   if (obj5) {
37808     {
37809       /* %typemap(in) char **options */
37810       int bErr = FALSE;
37811       arg6 = CSLFromPySequence(obj5, &bErr);
37812       if( bErr )
37813       {
37814         SWIG_fail;
37815       }
37816     }
37817   }
37818   {
37819     if (!arg1) {
37820       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37821     }
37822   }
37823   {
37824     if (!arg2) {
37825       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
37826     }
37827   }
37828   {
37829     if ( bUseExceptions ) {
37830       ClearErrorState();
37831     }
37832     {
37833       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37834       result = (GDALDatasetShadow *)ApplyVerticalShiftGrid(arg1,arg2,arg3,arg4,arg5,arg6);
37835       SWIG_PYTHON_THREAD_END_ALLOW;
37836     }
37837 #ifndef SED_HACKS
37838     if ( bUseExceptions ) {
37839       CPLErr eclass = CPLGetLastErrorType();
37840       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37841         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37842       }
37843     }
37844 #endif
37845   }
37846   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
37847   {
37848     /* %typemap(freearg) char **options */
37849     CSLDestroy( arg6 );
37850   }
37851   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37852   return resultobj;
37853 fail:
37854   {
37855     /* %typemap(freearg) char **options */
37856     CSLDestroy( arg6 );
37857   }
37858   return NULL;
37859 }
37860 
37861 
_wrap_ApplyGeoTransform(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37862 SWIGINTERN PyObject *_wrap_ApplyGeoTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37863   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37864   double *arg1 ;
37865   double arg2 ;
37866   double arg3 ;
37867   double *arg4 = (double *) 0 ;
37868   double *arg5 = (double *) 0 ;
37869   double argin1[6] ;
37870   double val2 ;
37871   int ecode2 = 0 ;
37872   double val3 ;
37873   int ecode3 = 0 ;
37874   double temp4 ;
37875   int res4 = SWIG_TMPOBJ ;
37876   double temp5 ;
37877   int res5 = SWIG_TMPOBJ ;
37878   PyObject * obj0 = 0 ;
37879   PyObject * obj1 = 0 ;
37880   PyObject * obj2 = 0 ;
37881 
37882   arg4 = &temp4;
37883   arg5 = &temp5;
37884   if (!PyArg_ParseTuple(args,(char *)"OOO:ApplyGeoTransform",&obj0,&obj1,&obj2)) SWIG_fail;
37885   {
37886     /* %typemap(in) (double argin1[ANY]) */
37887     arg1 = argin1;
37888     if (! PySequence_Check(obj0) ) {
37889       PyErr_SetString(PyExc_TypeError, "not a sequence");
37890       SWIG_fail;
37891     }
37892     Py_ssize_t seq_size = PySequence_Size(obj0);
37893     if ( seq_size != 6 ) {
37894       PyErr_SetString(PyExc_TypeError, "sequence must have length ##size");
37895       SWIG_fail;
37896     }
37897     for (unsigned int i=0; i<6; i++) {
37898       PyObject *o = PySequence_GetItem(obj0,i);
37899       double val;
37900       if ( !PyArg_Parse(o, "d", &val ) ) {
37901         PyErr_SetString(PyExc_TypeError, "not a number");
37902         Py_DECREF(o);
37903         SWIG_fail;
37904       }
37905       arg1[i] =  val;
37906       Py_DECREF(o);
37907     }
37908   }
37909   ecode2 = SWIG_AsVal_double(obj1, &val2);
37910   if (!SWIG_IsOK(ecode2)) {
37911     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ApplyGeoTransform" "', argument " "2"" of type '" "double""'");
37912   }
37913   arg2 = static_cast< double >(val2);
37914   ecode3 = SWIG_AsVal_double(obj2, &val3);
37915   if (!SWIG_IsOK(ecode3)) {
37916     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ApplyGeoTransform" "', argument " "3"" of type '" "double""'");
37917   }
37918   arg3 = static_cast< double >(val3);
37919   {
37920     if ( bUseExceptions ) {
37921       ClearErrorState();
37922     }
37923     {
37924       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
37925       GDALApplyGeoTransform(arg1,arg2,arg3,arg4,arg5);
37926       SWIG_PYTHON_THREAD_END_ALLOW;
37927     }
37928 #ifndef SED_HACKS
37929     if ( bUseExceptions ) {
37930       CPLErr eclass = CPLGetLastErrorType();
37931       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
37932         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
37933       }
37934     }
37935 #endif
37936   }
37937   resultobj = SWIG_Py_Void();
37938   if (ReturnSame(SWIG_IsTmpObj(res4))) {
37939     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg4)));
37940   } else {
37941     int new_flags = SWIG_IsNewObj(res4) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
37942     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg4), SWIGTYPE_p_double, new_flags));
37943   }
37944   if (ReturnSame(SWIG_IsTmpObj(res5))) {
37945     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_From_double((*arg5)));
37946   } else {
37947     int new_flags = SWIG_IsNewObj(res5) ? (SWIG_POINTER_OWN |  0 ) :  0 ;
37948     resultobj = SWIG_Python_AppendOutput(resultobj, SWIG_NewPointerObj((void*)(arg5), SWIGTYPE_p_double, new_flags));
37949   }
37950   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
37951   return resultobj;
37952 fail:
37953   return NULL;
37954 }
37955 
37956 
_wrap_InvGeoTransform(PyObject * SWIGUNUSEDPARM (self),PyObject * args)37957 SWIGINTERN PyObject *_wrap_InvGeoTransform(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
37958   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
37959   double *arg1 ;
37960   double *arg2 ;
37961   double argin1[6] ;
37962   double argout2[6] ;
37963   PyObject * obj0 = 0 ;
37964   RETURN_NONE result;
37965 
37966   {
37967     /* %typemap(in,numinputs=0) (double argout2[ANY]) */
37968     memset(argout2, 0, sizeof(argout2));
37969     arg2 = argout2;
37970   }
37971   if (!PyArg_ParseTuple(args,(char *)"O:InvGeoTransform",&obj0)) SWIG_fail;
37972   {
37973     /* %typemap(in) (double argin1[ANY]) */
37974     arg1 = argin1;
37975     if (! PySequence_Check(obj0) ) {
37976       PyErr_SetString(PyExc_TypeError, "not a sequence");
37977       SWIG_fail;
37978     }
37979     Py_ssize_t seq_size = PySequence_Size(obj0);
37980     if ( seq_size != 6 ) {
37981       PyErr_SetString(PyExc_TypeError, "sequence must have length ##size");
37982       SWIG_fail;
37983     }
37984     for (unsigned int i=0; i<6; i++) {
37985       PyObject *o = PySequence_GetItem(obj0,i);
37986       double val;
37987       if ( !PyArg_Parse(o, "d", &val ) ) {
37988         PyErr_SetString(PyExc_TypeError, "not a number");
37989         Py_DECREF(o);
37990         SWIG_fail;
37991       }
37992       arg1[i] =  val;
37993       Py_DECREF(o);
37994     }
37995   }
37996   {
37997     if ( bUseExceptions ) {
37998       ClearErrorState();
37999     }
38000     {
38001       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38002       result = (RETURN_NONE)GDALInvGeoTransform(arg1,arg2);
38003       SWIG_PYTHON_THREAD_END_ALLOW;
38004     }
38005 #ifndef SED_HACKS
38006     if ( bUseExceptions ) {
38007       CPLErr eclass = CPLGetLastErrorType();
38008       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38009         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38010       }
38011     }
38012 #endif
38013   }
38014   /*%typemap(out) IF_FALSE_RETURN_NONE */
38015   {
38016     /* %typemap(argout) (double argout[ANY]) */
38017     PyObject *out = CreateTupleFromDoubleArray( arg2, 6 );
38018     resultobj = t_output_helper(resultobj,out);
38019   }
38020   {
38021     /* %typemap(ret) IF_FALSE_RETURN_NONE */
38022     if (result == 0 ) {
38023       Py_XDECREF( resultobj );
38024       resultobj = Py_None;
38025       Py_INCREF(resultobj);
38026     }
38027     if (resultobj == 0) {
38028       resultobj = Py_None;
38029       Py_INCREF(resultobj);
38030     }
38031   }
38032   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38033   return resultobj;
38034 fail:
38035   return NULL;
38036 }
38037 
38038 
_wrap_VersionInfo(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38039 SWIGINTERN PyObject *_wrap_VersionInfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38040   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38041   char *arg1 = (char *) "VERSION_NUM" ;
38042   int res1 ;
38043   char *buf1 = 0 ;
38044   int alloc1 = 0 ;
38045   PyObject * obj0 = 0 ;
38046   char *result = 0 ;
38047 
38048   if (!PyArg_ParseTuple(args,(char *)"|O:VersionInfo",&obj0)) SWIG_fail;
38049   if (obj0) {
38050     res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
38051     if (!SWIG_IsOK(res1)) {
38052       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VersionInfo" "', argument " "1"" of type '" "char const *""'");
38053     }
38054     arg1 = reinterpret_cast< char * >(buf1);
38055   }
38056   {
38057     if ( bUseExceptions ) {
38058       ClearErrorState();
38059     }
38060     {
38061       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38062       result = (char *)GDALVersionInfo((char const *)arg1);
38063       SWIG_PYTHON_THREAD_END_ALLOW;
38064     }
38065 #ifndef SED_HACKS
38066     if ( bUseExceptions ) {
38067       CPLErr eclass = CPLGetLastErrorType();
38068       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38069         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38070       }
38071     }
38072 #endif
38073   }
38074   resultobj = SWIG_FromCharPtr((const char *)result);
38075   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38076   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38077   return resultobj;
38078 fail:
38079   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38080   return NULL;
38081 }
38082 
38083 
_wrap_AllRegister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38084 SWIGINTERN PyObject *_wrap_AllRegister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38085   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38086 
38087   if (!PyArg_ParseTuple(args,(char *)":AllRegister")) SWIG_fail;
38088   {
38089     if ( bUseExceptions ) {
38090       ClearErrorState();
38091     }
38092     {
38093       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38094       GDALAllRegister();
38095       SWIG_PYTHON_THREAD_END_ALLOW;
38096     }
38097 #ifndef SED_HACKS
38098     if ( bUseExceptions ) {
38099       CPLErr eclass = CPLGetLastErrorType();
38100       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38101         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38102       }
38103     }
38104 #endif
38105   }
38106   resultobj = SWIG_Py_Void();
38107   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38108   return resultobj;
38109 fail:
38110   return NULL;
38111 }
38112 
38113 
_wrap_GDALDestroyDriverManager(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38114 SWIGINTERN PyObject *_wrap_GDALDestroyDriverManager(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38115   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38116 
38117   if (!PyArg_ParseTuple(args,(char *)":GDALDestroyDriverManager")) SWIG_fail;
38118   {
38119     if ( bUseExceptions ) {
38120       ClearErrorState();
38121     }
38122     {
38123       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38124       GDALDestroyDriverManager();
38125       SWIG_PYTHON_THREAD_END_ALLOW;
38126     }
38127 #ifndef SED_HACKS
38128     if ( bUseExceptions ) {
38129       CPLErr eclass = CPLGetLastErrorType();
38130       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38131         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38132       }
38133     }
38134 #endif
38135   }
38136   resultobj = SWIG_Py_Void();
38137   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38138   return resultobj;
38139 fail:
38140   return NULL;
38141 }
38142 
38143 
_wrap_GetCacheMax(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38144 SWIGINTERN PyObject *_wrap_GetCacheMax(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38145   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38146   GIntBig result;
38147 
38148   if (!PyArg_ParseTuple(args,(char *)":GetCacheMax")) SWIG_fail;
38149   {
38150     if ( bUseExceptions ) {
38151       ClearErrorState();
38152     }
38153     {
38154       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38155       result = wrapper_GDALGetCacheMax();
38156       SWIG_PYTHON_THREAD_END_ALLOW;
38157     }
38158 #ifndef SED_HACKS
38159     if ( bUseExceptions ) {
38160       CPLErr eclass = CPLGetLastErrorType();
38161       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38162         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38163       }
38164     }
38165 #endif
38166   }
38167   {
38168     char szTmp[32];
38169     sprintf(szTmp, CPL_FRMT_GIB, result);
38170     resultobj = PyLong_FromString(szTmp, NULL, 10);
38171   }
38172   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38173   return resultobj;
38174 fail:
38175   return NULL;
38176 }
38177 
38178 
_wrap_GetCacheUsed(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38179 SWIGINTERN PyObject *_wrap_GetCacheUsed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38180   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38181   GIntBig result;
38182 
38183   if (!PyArg_ParseTuple(args,(char *)":GetCacheUsed")) SWIG_fail;
38184   {
38185     if ( bUseExceptions ) {
38186       ClearErrorState();
38187     }
38188     {
38189       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38190       result = wrapper_GDALGetCacheUsed();
38191       SWIG_PYTHON_THREAD_END_ALLOW;
38192     }
38193 #ifndef SED_HACKS
38194     if ( bUseExceptions ) {
38195       CPLErr eclass = CPLGetLastErrorType();
38196       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38197         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38198       }
38199     }
38200 #endif
38201   }
38202   {
38203     char szTmp[32];
38204     sprintf(szTmp, CPL_FRMT_GIB, result);
38205     resultobj = PyLong_FromString(szTmp, NULL, 10);
38206   }
38207   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38208   return resultobj;
38209 fail:
38210   return NULL;
38211 }
38212 
38213 
_wrap_SetCacheMax(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38214 SWIGINTERN PyObject *_wrap_SetCacheMax(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38215   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38216   GIntBig arg1 ;
38217   PyObject * obj0 = 0 ;
38218 
38219   if (!PyArg_ParseTuple(args,(char *)"O:SetCacheMax",&obj0)) SWIG_fail;
38220   {
38221     PY_LONG_LONG val;
38222     if ( !PyArg_Parse(obj0,"L",&val) ) {
38223       PyErr_SetString(PyExc_TypeError, "not an integer");
38224       SWIG_fail;
38225     }
38226     arg1 = (GIntBig)val;
38227   }
38228   {
38229     if ( bUseExceptions ) {
38230       ClearErrorState();
38231     }
38232     {
38233       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38234       wrapper_GDALSetCacheMax(arg1);
38235       SWIG_PYTHON_THREAD_END_ALLOW;
38236     }
38237 #ifndef SED_HACKS
38238     if ( bUseExceptions ) {
38239       CPLErr eclass = CPLGetLastErrorType();
38240       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38241         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38242       }
38243     }
38244 #endif
38245   }
38246   resultobj = SWIG_Py_Void();
38247   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38248   return resultobj;
38249 fail:
38250   return NULL;
38251 }
38252 
38253 
_wrap_GetDataTypeSize(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38254 SWIGINTERN PyObject *_wrap_GetDataTypeSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38255   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38256   GDALDataType arg1 ;
38257   PyObject * obj0 = 0 ;
38258   int result;
38259 
38260   if (!PyArg_ParseTuple(args,(char *)"O:GetDataTypeSize",&obj0)) SWIG_fail;
38261   {
38262     // %typemap(in) GDALDataType
38263     int val = 0;
38264     int ecode = SWIG_AsVal_int(obj0, &val);
38265     if (!SWIG_IsOK(ecode)) {
38266       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
38267     }
38268     if( val < GDT_Unknown || val >= GDT_TypeCount )
38269     {
38270       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
38271     }
38272     arg1 = static_cast<GDALDataType>(val);
38273   }
38274   {
38275     if ( bUseExceptions ) {
38276       ClearErrorState();
38277     }
38278     {
38279       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38280       result = (int)GDALGetDataTypeSize(arg1);
38281       SWIG_PYTHON_THREAD_END_ALLOW;
38282     }
38283 #ifndef SED_HACKS
38284     if ( bUseExceptions ) {
38285       CPLErr eclass = CPLGetLastErrorType();
38286       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38287         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38288       }
38289     }
38290 #endif
38291   }
38292   resultobj = SWIG_From_int(static_cast< int >(result));
38293   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38294   return resultobj;
38295 fail:
38296   return NULL;
38297 }
38298 
38299 
_wrap_DataTypeIsComplex(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38300 SWIGINTERN PyObject *_wrap_DataTypeIsComplex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38301   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38302   GDALDataType arg1 ;
38303   PyObject * obj0 = 0 ;
38304   int result;
38305 
38306   if (!PyArg_ParseTuple(args,(char *)"O:DataTypeIsComplex",&obj0)) SWIG_fail;
38307   {
38308     // %typemap(in) GDALDataType
38309     int val = 0;
38310     int ecode = SWIG_AsVal_int(obj0, &val);
38311     if (!SWIG_IsOK(ecode)) {
38312       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
38313     }
38314     if( val < GDT_Unknown || val >= GDT_TypeCount )
38315     {
38316       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
38317     }
38318     arg1 = static_cast<GDALDataType>(val);
38319   }
38320   {
38321     if ( bUseExceptions ) {
38322       ClearErrorState();
38323     }
38324     {
38325       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38326       result = (int)GDALDataTypeIsComplex(arg1);
38327       SWIG_PYTHON_THREAD_END_ALLOW;
38328     }
38329 #ifndef SED_HACKS
38330     if ( bUseExceptions ) {
38331       CPLErr eclass = CPLGetLastErrorType();
38332       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38333         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38334       }
38335     }
38336 #endif
38337   }
38338   resultobj = SWIG_From_int(static_cast< int >(result));
38339   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38340   return resultobj;
38341 fail:
38342   return NULL;
38343 }
38344 
38345 
_wrap_GetDataTypeName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38346 SWIGINTERN PyObject *_wrap_GetDataTypeName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38347   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38348   GDALDataType arg1 ;
38349   PyObject * obj0 = 0 ;
38350   char *result = 0 ;
38351 
38352   if (!PyArg_ParseTuple(args,(char *)"O:GetDataTypeName",&obj0)) SWIG_fail;
38353   {
38354     // %typemap(in) GDALDataType
38355     int val = 0;
38356     int ecode = SWIG_AsVal_int(obj0, &val);
38357     if (!SWIG_IsOK(ecode)) {
38358       SWIG_exception_fail(SWIG_ArgError(ecode), "invalid value for GDALDataType");
38359     }
38360     if( val < GDT_Unknown || val >= GDT_TypeCount )
38361     {
38362       SWIG_exception_fail(SWIG_ValueError, "Invalid value for GDALDataType");
38363     }
38364     arg1 = static_cast<GDALDataType>(val);
38365   }
38366   {
38367     if ( bUseExceptions ) {
38368       ClearErrorState();
38369     }
38370     {
38371       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38372       result = (char *)GDALGetDataTypeName(arg1);
38373       SWIG_PYTHON_THREAD_END_ALLOW;
38374     }
38375 #ifndef SED_HACKS
38376     if ( bUseExceptions ) {
38377       CPLErr eclass = CPLGetLastErrorType();
38378       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38379         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38380       }
38381     }
38382 #endif
38383   }
38384   resultobj = SWIG_FromCharPtr((const char *)result);
38385   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38386   return resultobj;
38387 fail:
38388   return NULL;
38389 }
38390 
38391 
_wrap_GetDataTypeByName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38392 SWIGINTERN PyObject *_wrap_GetDataTypeByName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38393   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38394   char *arg1 = (char *) 0 ;
38395   int res1 ;
38396   char *buf1 = 0 ;
38397   int alloc1 = 0 ;
38398   PyObject * obj0 = 0 ;
38399   GDALDataType result;
38400 
38401   if (!PyArg_ParseTuple(args,(char *)"O:GetDataTypeByName",&obj0)) SWIG_fail;
38402   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
38403   if (!SWIG_IsOK(res1)) {
38404     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetDataTypeByName" "', argument " "1"" of type '" "char const *""'");
38405   }
38406   arg1 = reinterpret_cast< char * >(buf1);
38407   {
38408     if ( bUseExceptions ) {
38409       ClearErrorState();
38410     }
38411     {
38412       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38413       result = (GDALDataType)GDALGetDataTypeByName((char const *)arg1);
38414       SWIG_PYTHON_THREAD_END_ALLOW;
38415     }
38416 #ifndef SED_HACKS
38417     if ( bUseExceptions ) {
38418       CPLErr eclass = CPLGetLastErrorType();
38419       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38420         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38421       }
38422     }
38423 #endif
38424   }
38425   resultobj = SWIG_From_int(static_cast< int >(result));
38426   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38427   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38428   return resultobj;
38429 fail:
38430   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38431   return NULL;
38432 }
38433 
38434 
_wrap_GetColorInterpretationName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38435 SWIGINTERN PyObject *_wrap_GetColorInterpretationName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38436   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38437   GDALColorInterp arg1 ;
38438   int val1 ;
38439   int ecode1 = 0 ;
38440   PyObject * obj0 = 0 ;
38441   char *result = 0 ;
38442 
38443   if (!PyArg_ParseTuple(args,(char *)"O:GetColorInterpretationName",&obj0)) SWIG_fail;
38444   ecode1 = SWIG_AsVal_int(obj0, &val1);
38445   if (!SWIG_IsOK(ecode1)) {
38446     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetColorInterpretationName" "', argument " "1"" of type '" "GDALColorInterp""'");
38447   }
38448   arg1 = static_cast< GDALColorInterp >(val1);
38449   {
38450     if ( bUseExceptions ) {
38451       ClearErrorState();
38452     }
38453     {
38454       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38455       result = (char *)GDALGetColorInterpretationName(arg1);
38456       SWIG_PYTHON_THREAD_END_ALLOW;
38457     }
38458 #ifndef SED_HACKS
38459     if ( bUseExceptions ) {
38460       CPLErr eclass = CPLGetLastErrorType();
38461       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38462         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38463       }
38464     }
38465 #endif
38466   }
38467   resultobj = SWIG_FromCharPtr((const char *)result);
38468   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38469   return resultobj;
38470 fail:
38471   return NULL;
38472 }
38473 
38474 
_wrap_GetPaletteInterpretationName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38475 SWIGINTERN PyObject *_wrap_GetPaletteInterpretationName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38476   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38477   GDALPaletteInterp arg1 ;
38478   int val1 ;
38479   int ecode1 = 0 ;
38480   PyObject * obj0 = 0 ;
38481   char *result = 0 ;
38482 
38483   if (!PyArg_ParseTuple(args,(char *)"O:GetPaletteInterpretationName",&obj0)) SWIG_fail;
38484   ecode1 = SWIG_AsVal_int(obj0, &val1);
38485   if (!SWIG_IsOK(ecode1)) {
38486     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetPaletteInterpretationName" "', argument " "1"" of type '" "GDALPaletteInterp""'");
38487   }
38488   arg1 = static_cast< GDALPaletteInterp >(val1);
38489   {
38490     if ( bUseExceptions ) {
38491       ClearErrorState();
38492     }
38493     {
38494       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38495       result = (char *)GDALGetPaletteInterpretationName(arg1);
38496       SWIG_PYTHON_THREAD_END_ALLOW;
38497     }
38498 #ifndef SED_HACKS
38499     if ( bUseExceptions ) {
38500       CPLErr eclass = CPLGetLastErrorType();
38501       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38502         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38503       }
38504     }
38505 #endif
38506   }
38507   resultobj = SWIG_FromCharPtr((const char *)result);
38508   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38509   return resultobj;
38510 fail:
38511   return NULL;
38512 }
38513 
38514 
_wrap_DecToDMS(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38515 SWIGINTERN PyObject *_wrap_DecToDMS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38516   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38517   double arg1 ;
38518   char *arg2 = (char *) 0 ;
38519   int arg3 = (int) 2 ;
38520   double val1 ;
38521   int ecode1 = 0 ;
38522   int res2 ;
38523   char *buf2 = 0 ;
38524   int alloc2 = 0 ;
38525   int val3 ;
38526   int ecode3 = 0 ;
38527   PyObject * obj0 = 0 ;
38528   PyObject * obj1 = 0 ;
38529   PyObject * obj2 = 0 ;
38530   char *result = 0 ;
38531 
38532   if (!PyArg_ParseTuple(args,(char *)"OO|O:DecToDMS",&obj0,&obj1,&obj2)) SWIG_fail;
38533   ecode1 = SWIG_AsVal_double(obj0, &val1);
38534   if (!SWIG_IsOK(ecode1)) {
38535     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DecToDMS" "', argument " "1"" of type '" "double""'");
38536   }
38537   arg1 = static_cast< double >(val1);
38538   res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
38539   if (!SWIG_IsOK(res2)) {
38540     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DecToDMS" "', argument " "2"" of type '" "char const *""'");
38541   }
38542   arg2 = reinterpret_cast< char * >(buf2);
38543   if (obj2) {
38544     ecode3 = SWIG_AsVal_int(obj2, &val3);
38545     if (!SWIG_IsOK(ecode3)) {
38546       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DecToDMS" "', argument " "3"" of type '" "int""'");
38547     }
38548     arg3 = static_cast< int >(val3);
38549   }
38550   {
38551     if ( bUseExceptions ) {
38552       ClearErrorState();
38553     }
38554     {
38555       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38556       result = (char *)GDALDecToDMS(arg1,(char const *)arg2,arg3);
38557       SWIG_PYTHON_THREAD_END_ALLOW;
38558     }
38559 #ifndef SED_HACKS
38560     if ( bUseExceptions ) {
38561       CPLErr eclass = CPLGetLastErrorType();
38562       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38563         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38564       }
38565     }
38566 #endif
38567   }
38568   resultobj = SWIG_FromCharPtr((const char *)result);
38569   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
38570   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38571   return resultobj;
38572 fail:
38573   if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
38574   return NULL;
38575 }
38576 
38577 
_wrap_PackedDMSToDec(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38578 SWIGINTERN PyObject *_wrap_PackedDMSToDec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38579   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38580   double arg1 ;
38581   double val1 ;
38582   int ecode1 = 0 ;
38583   PyObject * obj0 = 0 ;
38584   double result;
38585 
38586   if (!PyArg_ParseTuple(args,(char *)"O:PackedDMSToDec",&obj0)) SWIG_fail;
38587   ecode1 = SWIG_AsVal_double(obj0, &val1);
38588   if (!SWIG_IsOK(ecode1)) {
38589     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "PackedDMSToDec" "', argument " "1"" of type '" "double""'");
38590   }
38591   arg1 = static_cast< double >(val1);
38592   {
38593     if ( bUseExceptions ) {
38594       ClearErrorState();
38595     }
38596     {
38597       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38598       result = (double)GDALPackedDMSToDec(arg1);
38599       SWIG_PYTHON_THREAD_END_ALLOW;
38600     }
38601 #ifndef SED_HACKS
38602     if ( bUseExceptions ) {
38603       CPLErr eclass = CPLGetLastErrorType();
38604       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38605         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38606       }
38607     }
38608 #endif
38609   }
38610   resultobj = SWIG_From_double(static_cast< double >(result));
38611   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38612   return resultobj;
38613 fail:
38614   return NULL;
38615 }
38616 
38617 
_wrap_DecToPackedDMS(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38618 SWIGINTERN PyObject *_wrap_DecToPackedDMS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38619   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38620   double arg1 ;
38621   double val1 ;
38622   int ecode1 = 0 ;
38623   PyObject * obj0 = 0 ;
38624   double result;
38625 
38626   if (!PyArg_ParseTuple(args,(char *)"O:DecToPackedDMS",&obj0)) SWIG_fail;
38627   ecode1 = SWIG_AsVal_double(obj0, &val1);
38628   if (!SWIG_IsOK(ecode1)) {
38629     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "DecToPackedDMS" "', argument " "1"" of type '" "double""'");
38630   }
38631   arg1 = static_cast< double >(val1);
38632   {
38633     if ( bUseExceptions ) {
38634       ClearErrorState();
38635     }
38636     {
38637       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38638       result = (double)GDALDecToPackedDMS(arg1);
38639       SWIG_PYTHON_THREAD_END_ALLOW;
38640     }
38641 #ifndef SED_HACKS
38642     if ( bUseExceptions ) {
38643       CPLErr eclass = CPLGetLastErrorType();
38644       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38645         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38646       }
38647     }
38648 #endif
38649   }
38650   resultobj = SWIG_From_double(static_cast< double >(result));
38651   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38652   return resultobj;
38653 fail:
38654   return NULL;
38655 }
38656 
38657 
_wrap_ParseXMLString(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38658 SWIGINTERN PyObject *_wrap_ParseXMLString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38659   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38660   char *arg1 = (char *) 0 ;
38661   int res1 ;
38662   char *buf1 = 0 ;
38663   int alloc1 = 0 ;
38664   PyObject * obj0 = 0 ;
38665   CPLXMLNode *result = 0 ;
38666 
38667   if (!PyArg_ParseTuple(args,(char *)"O:ParseXMLString",&obj0)) SWIG_fail;
38668   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
38669   if (!SWIG_IsOK(res1)) {
38670     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ParseXMLString" "', argument " "1"" of type '" "char *""'");
38671   }
38672   arg1 = reinterpret_cast< char * >(buf1);
38673   {
38674     if ( bUseExceptions ) {
38675       ClearErrorState();
38676     }
38677     {
38678       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38679       result = (CPLXMLNode *)CPLParseXMLString(arg1);
38680       SWIG_PYTHON_THREAD_END_ALLOW;
38681     }
38682 #ifndef SED_HACKS
38683     if ( bUseExceptions ) {
38684       CPLErr eclass = CPLGetLastErrorType();
38685       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38686         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38687       }
38688     }
38689 #endif
38690   }
38691   {
38692     /* %typemap(out) (CPLXMLNode*) */
38693 
38694     CPLXMLNode *psXMLTree = result;
38695     int         bFakeRoot = FALSE;
38696 
38697     if( psXMLTree != NULL && psXMLTree->psNext != NULL )
38698     {
38699       CPLXMLNode *psFirst = psXMLTree;
38700 
38701       /* create a "pseudo" root if we have multiple elements */
38702       psXMLTree = CPLCreateXMLNode( NULL, CXT_Element, "" );
38703       psXMLTree->psChild = psFirst;
38704       bFakeRoot = TRUE;
38705     }
38706 
38707     resultobj = XMLTreeToPyList( psXMLTree );
38708 
38709     if( bFakeRoot )
38710     {
38711       psXMLTree->psChild = NULL;
38712       CPLDestroyXMLNode( psXMLTree );
38713     }
38714   }
38715   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38716   {
38717     /* %typemap(ret) (CPLXMLNode*) */
38718     if ( result ) CPLDestroyXMLNode( result );
38719   }
38720   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38721   return resultobj;
38722 fail:
38723   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38724   return NULL;
38725 }
38726 
38727 
_wrap_SerializeXMLTree(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38728 SWIGINTERN PyObject *_wrap_SerializeXMLTree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38729   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38730   CPLXMLNode *arg1 = (CPLXMLNode *) 0 ;
38731   PyObject * obj0 = 0 ;
38732   retStringAndCPLFree *result = 0 ;
38733 
38734   if (!PyArg_ParseTuple(args,(char *)"O:SerializeXMLTree",&obj0)) SWIG_fail;
38735   {
38736     /* %typemap(python,in) (CPLXMLNode* xmlnode ) */
38737     arg1 = PyListToXMLTree( obj0 );
38738     if ( !arg1 ) SWIG_fail;
38739   }
38740   {
38741     if ( bUseExceptions ) {
38742       ClearErrorState();
38743     }
38744     {
38745       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38746       result = (retStringAndCPLFree *)CPLSerializeXMLTree(arg1);
38747       SWIG_PYTHON_THREAD_END_ALLOW;
38748     }
38749 #ifndef SED_HACKS
38750     if ( bUseExceptions ) {
38751       CPLErr eclass = CPLGetLastErrorType();
38752       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38753         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38754       }
38755     }
38756 #endif
38757   }
38758   {
38759     /* %typemap(out) (retStringAndCPLFree*) */
38760     Py_XDECREF(resultobj);
38761     if(result)
38762     {
38763       resultobj = GDALPythonObjectFromCStr( (const char *)result);
38764       CPLFree(result);
38765     }
38766     else
38767     {
38768       resultobj = Py_None;
38769       Py_INCREF(resultobj);
38770     }
38771   }
38772   {
38773     /* %typemap(freearg) (CPLXMLNode *xmlnode) */
38774     CPLDestroyXMLNode( arg1 );
38775   }
38776   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38777   return resultobj;
38778 fail:
38779   {
38780     /* %typemap(freearg) (CPLXMLNode *xmlnode) */
38781     CPLDestroyXMLNode( arg1 );
38782   }
38783   return NULL;
38784 }
38785 
38786 
_wrap_GetJPEG2000Structure(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38787 SWIGINTERN PyObject *_wrap_GetJPEG2000Structure(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38788   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38789   char *arg1 = (char *) 0 ;
38790   char **arg2 = (char **) NULL ;
38791   int res1 ;
38792   char *buf1 = 0 ;
38793   int alloc1 = 0 ;
38794   PyObject * obj0 = 0 ;
38795   PyObject * obj1 = 0 ;
38796   CPLXMLNode *result = 0 ;
38797 
38798   if (!PyArg_ParseTuple(args,(char *)"O|O:GetJPEG2000Structure",&obj0,&obj1)) SWIG_fail;
38799   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
38800   if (!SWIG_IsOK(res1)) {
38801     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetJPEG2000Structure" "', argument " "1"" of type '" "char const *""'");
38802   }
38803   arg1 = reinterpret_cast< char * >(buf1);
38804   if (obj1) {
38805     {
38806       /* %typemap(in) char **options */
38807       int bErr = FALSE;
38808       arg2 = CSLFromPySequence(obj1, &bErr);
38809       if( bErr )
38810       {
38811         SWIG_fail;
38812       }
38813     }
38814   }
38815   {
38816     if (!arg1) {
38817       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
38818     }
38819   }
38820   {
38821     if ( bUseExceptions ) {
38822       ClearErrorState();
38823     }
38824     {
38825       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38826       result = (CPLXMLNode *)GDALGetJPEG2000Structure((char const *)arg1,arg2);
38827       SWIG_PYTHON_THREAD_END_ALLOW;
38828     }
38829 #ifndef SED_HACKS
38830     if ( bUseExceptions ) {
38831       CPLErr eclass = CPLGetLastErrorType();
38832       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38833         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38834       }
38835     }
38836 #endif
38837   }
38838   {
38839     /* %typemap(out) (CPLXMLNode*) */
38840 
38841     CPLXMLNode *psXMLTree = result;
38842     int         bFakeRoot = FALSE;
38843 
38844     if( psXMLTree != NULL && psXMLTree->psNext != NULL )
38845     {
38846       CPLXMLNode *psFirst = psXMLTree;
38847 
38848       /* create a "pseudo" root if we have multiple elements */
38849       psXMLTree = CPLCreateXMLNode( NULL, CXT_Element, "" );
38850       psXMLTree->psChild = psFirst;
38851       bFakeRoot = TRUE;
38852     }
38853 
38854     resultobj = XMLTreeToPyList( psXMLTree );
38855 
38856     if( bFakeRoot )
38857     {
38858       psXMLTree->psChild = NULL;
38859       CPLDestroyXMLNode( psXMLTree );
38860     }
38861   }
38862   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38863   {
38864     /* %typemap(freearg) char **options */
38865     CSLDestroy( arg2 );
38866   }
38867   {
38868     /* %typemap(ret) (CPLXMLNode*) */
38869     if ( result ) CPLDestroyXMLNode( result );
38870   }
38871   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38872   return resultobj;
38873 fail:
38874   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38875   {
38876     /* %typemap(freearg) char **options */
38877     CSLDestroy( arg2 );
38878   }
38879   return NULL;
38880 }
38881 
38882 
_wrap_GetJPEG2000StructureAsString(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38883 SWIGINTERN PyObject *_wrap_GetJPEG2000StructureAsString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38884   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38885   char *arg1 = (char *) 0 ;
38886   char **arg2 = (char **) NULL ;
38887   int res1 ;
38888   char *buf1 = 0 ;
38889   int alloc1 = 0 ;
38890   PyObject * obj0 = 0 ;
38891   PyObject * obj1 = 0 ;
38892   retStringAndCPLFree *result = 0 ;
38893 
38894   if (!PyArg_ParseTuple(args,(char *)"O|O:GetJPEG2000StructureAsString",&obj0,&obj1)) SWIG_fail;
38895   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
38896   if (!SWIG_IsOK(res1)) {
38897     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetJPEG2000StructureAsString" "', argument " "1"" of type '" "char const *""'");
38898   }
38899   arg1 = reinterpret_cast< char * >(buf1);
38900   if (obj1) {
38901     {
38902       /* %typemap(in) char **options */
38903       int bErr = FALSE;
38904       arg2 = CSLFromPySequence(obj1, &bErr);
38905       if( bErr )
38906       {
38907         SWIG_fail;
38908       }
38909     }
38910   }
38911   {
38912     if (!arg1) {
38913       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
38914     }
38915   }
38916   {
38917     if ( bUseExceptions ) {
38918       ClearErrorState();
38919     }
38920     {
38921       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38922       result = (retStringAndCPLFree *)GetJPEG2000StructureAsString((char const *)arg1,arg2);
38923       SWIG_PYTHON_THREAD_END_ALLOW;
38924     }
38925 #ifndef SED_HACKS
38926     if ( bUseExceptions ) {
38927       CPLErr eclass = CPLGetLastErrorType();
38928       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38929         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38930       }
38931     }
38932 #endif
38933   }
38934   {
38935     /* %typemap(out) (retStringAndCPLFree*) */
38936     Py_XDECREF(resultobj);
38937     if(result)
38938     {
38939       resultobj = GDALPythonObjectFromCStr( (const char *)result);
38940       CPLFree(result);
38941     }
38942     else
38943     {
38944       resultobj = Py_None;
38945       Py_INCREF(resultobj);
38946     }
38947   }
38948   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38949   {
38950     /* %typemap(freearg) char **options */
38951     CSLDestroy( arg2 );
38952   }
38953   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38954   return resultobj;
38955 fail:
38956   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
38957   {
38958     /* %typemap(freearg) char **options */
38959     CSLDestroy( arg2 );
38960   }
38961   return NULL;
38962 }
38963 
38964 
_wrap_GetDriverCount(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38965 SWIGINTERN PyObject *_wrap_GetDriverCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38966   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38967   int result;
38968 
38969   if (!PyArg_ParseTuple(args,(char *)":GetDriverCount")) SWIG_fail;
38970   {
38971     if ( bUseExceptions ) {
38972       ClearErrorState();
38973     }
38974     {
38975       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
38976       result = (int)GetDriverCount();
38977       SWIG_PYTHON_THREAD_END_ALLOW;
38978     }
38979 #ifndef SED_HACKS
38980     if ( bUseExceptions ) {
38981       CPLErr eclass = CPLGetLastErrorType();
38982       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
38983         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
38984       }
38985     }
38986 #endif
38987   }
38988   resultobj = SWIG_From_int(static_cast< int >(result));
38989   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
38990   return resultobj;
38991 fail:
38992   return NULL;
38993 }
38994 
38995 
_wrap_GetDriverByName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)38996 SWIGINTERN PyObject *_wrap_GetDriverByName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
38997   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
38998   char *arg1 = (char *) 0 ;
38999   int res1 ;
39000   char *buf1 = 0 ;
39001   int alloc1 = 0 ;
39002   PyObject * obj0 = 0 ;
39003   GDALDriverShadow *result = 0 ;
39004 
39005   if (!PyArg_ParseTuple(args,(char *)"O:GetDriverByName",&obj0)) SWIG_fail;
39006   res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
39007   if (!SWIG_IsOK(res1)) {
39008     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GetDriverByName" "', argument " "1"" of type '" "char const *""'");
39009   }
39010   arg1 = reinterpret_cast< char * >(buf1);
39011   {
39012     if (!arg1) {
39013       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39014     }
39015   }
39016   {
39017     if ( bUseExceptions ) {
39018       ClearErrorState();
39019     }
39020     {
39021       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39022       result = (GDALDriverShadow *)GetDriverByName((char const *)arg1);
39023       SWIG_PYTHON_THREAD_END_ALLOW;
39024     }
39025 #ifndef SED_HACKS
39026     if ( bUseExceptions ) {
39027       CPLErr eclass = CPLGetLastErrorType();
39028       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39029         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39030       }
39031     }
39032 #endif
39033   }
39034   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
39035   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
39036   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39037   return resultobj;
39038 fail:
39039   if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
39040   return NULL;
39041 }
39042 
39043 
_wrap_GetDriver(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39044 SWIGINTERN PyObject *_wrap_GetDriver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39045   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39046   int arg1 ;
39047   int val1 ;
39048   int ecode1 = 0 ;
39049   PyObject * obj0 = 0 ;
39050   GDALDriverShadow *result = 0 ;
39051 
39052   if (!PyArg_ParseTuple(args,(char *)"O:GetDriver",&obj0)) SWIG_fail;
39053   ecode1 = SWIG_AsVal_int(obj0, &val1);
39054   if (!SWIG_IsOK(ecode1)) {
39055     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "GetDriver" "', argument " "1"" of type '" "int""'");
39056   }
39057   arg1 = static_cast< int >(val1);
39058   {
39059     if ( bUseExceptions ) {
39060       ClearErrorState();
39061     }
39062     {
39063       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39064       result = (GDALDriverShadow *)GetDriver(arg1);
39065       SWIG_PYTHON_THREAD_END_ALLOW;
39066     }
39067 #ifndef SED_HACKS
39068     if ( bUseExceptions ) {
39069       CPLErr eclass = CPLGetLastErrorType();
39070       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39071         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39072       }
39073     }
39074 #endif
39075   }
39076   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
39077   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39078   return resultobj;
39079 fail:
39080   return NULL;
39081 }
39082 
39083 
_wrap_Open(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39084 SWIGINTERN PyObject *_wrap_Open(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39085   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39086   char *arg1 = (char *) 0 ;
39087   GDALAccess arg2 = (GDALAccess) GA_ReadOnly ;
39088   int bToFree1 = 0 ;
39089   int val2 ;
39090   int ecode2 = 0 ;
39091   PyObject * obj0 = 0 ;
39092   PyObject * obj1 = 0 ;
39093   GDALDatasetShadow *result = 0 ;
39094 
39095   if (!PyArg_ParseTuple(args,(char *)"O|O:Open",&obj0,&obj1)) SWIG_fail;
39096   {
39097     /* %typemap(in) (const char *utf8_path) */
39098     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
39099     if (arg1 == NULL)
39100     {
39101       PyErr_SetString( PyExc_RuntimeError, "not a string" );
39102       SWIG_fail;
39103     }
39104   }
39105   if (obj1) {
39106     ecode2 = SWIG_AsVal_int(obj1, &val2);
39107     if (!SWIG_IsOK(ecode2)) {
39108       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Open" "', argument " "2"" of type '" "GDALAccess""'");
39109     }
39110     arg2 = static_cast< GDALAccess >(val2);
39111   }
39112   {
39113     if (!arg1) {
39114       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39115     }
39116   }
39117   {
39118     if ( bUseExceptions ) {
39119       ClearErrorState();
39120     }
39121     {
39122       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39123       result = (GDALDatasetShadow *)Open((char const *)arg1,arg2);
39124       SWIG_PYTHON_THREAD_END_ALLOW;
39125     }
39126 #ifndef SED_HACKS
39127     if( result == NULL && bUseExceptions ) {
39128       CPLErr eclass = CPLGetLastErrorType();
39129       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39130         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39131       }
39132     }
39133 #endif
39134     if( result != NULL && bUseExceptions ) {
39135       StoreLastException();
39136 #ifdef SED_HACKS
39137       bLocalUseExceptionsCode = FALSE;
39138 #endif
39139     }
39140   }
39141   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
39142   {
39143     /* %typemap(freearg) (const char *utf8_path) */
39144     GDALPythonFreeCStr(arg1, bToFree1);
39145   }
39146   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39147   return resultobj;
39148 fail:
39149   {
39150     /* %typemap(freearg) (const char *utf8_path) */
39151     GDALPythonFreeCStr(arg1, bToFree1);
39152   }
39153   return NULL;
39154 }
39155 
39156 
_wrap_OpenEx(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)39157 SWIGINTERN PyObject *_wrap_OpenEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
39158   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39159   char *arg1 = (char *) 0 ;
39160   unsigned int arg2 = (unsigned int) 0 ;
39161   char **arg3 = (char **) NULL ;
39162   char **arg4 = (char **) NULL ;
39163   char **arg5 = (char **) NULL ;
39164   int bToFree1 = 0 ;
39165   unsigned int val2 ;
39166   int ecode2 = 0 ;
39167   PyObject * obj0 = 0 ;
39168   PyObject * obj1 = 0 ;
39169   PyObject * obj2 = 0 ;
39170   PyObject * obj3 = 0 ;
39171   PyObject * obj4 = 0 ;
39172   char *  kwnames[] = {
39173     (char *) "utf8_path",(char *) "nOpenFlags",(char *) "allowed_drivers",(char *) "open_options",(char *) "sibling_files", NULL
39174   };
39175   GDALDatasetShadow *result = 0 ;
39176 
39177   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOOO:OpenEx",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
39178   {
39179     /* %typemap(in) (const char *utf8_path) */
39180     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
39181     if (arg1 == NULL)
39182     {
39183       PyErr_SetString( PyExc_RuntimeError, "not a string" );
39184       SWIG_fail;
39185     }
39186   }
39187   if (obj1) {
39188     ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
39189     if (!SWIG_IsOK(ecode2)) {
39190       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OpenEx" "', argument " "2"" of type '" "unsigned int""'");
39191     }
39192     arg2 = static_cast< unsigned int >(val2);
39193   }
39194   if (obj2) {
39195     {
39196       /* %typemap(in) char **options */
39197       int bErr = FALSE;
39198       arg3 = CSLFromPySequence(obj2, &bErr);
39199       if( bErr )
39200       {
39201         SWIG_fail;
39202       }
39203     }
39204   }
39205   if (obj3) {
39206     {
39207       /* %typemap(in) char **options */
39208       int bErr = FALSE;
39209       arg4 = CSLFromPySequence(obj3, &bErr);
39210       if( bErr )
39211       {
39212         SWIG_fail;
39213       }
39214     }
39215   }
39216   if (obj4) {
39217     {
39218       /* %typemap(in) char **options */
39219       int bErr = FALSE;
39220       arg5 = CSLFromPySequence(obj4, &bErr);
39221       if( bErr )
39222       {
39223         SWIG_fail;
39224       }
39225     }
39226   }
39227   {
39228     if (!arg1) {
39229       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39230     }
39231   }
39232   {
39233     if ( bUseExceptions ) {
39234       ClearErrorState();
39235     }
39236     {
39237       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39238       result = (GDALDatasetShadow *)OpenEx((char const *)arg1,arg2,arg3,arg4,arg5);
39239       SWIG_PYTHON_THREAD_END_ALLOW;
39240     }
39241 #ifndef SED_HACKS
39242     if( result == NULL && bUseExceptions ) {
39243       CPLErr eclass = CPLGetLastErrorType();
39244       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39245         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39246       }
39247     }
39248 #endif
39249     if( result != NULL && bUseExceptions ) {
39250       StoreLastException();
39251 #ifdef SED_HACKS
39252       bLocalUseExceptionsCode = FALSE;
39253 #endif
39254     }
39255   }
39256   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
39257   {
39258     /* %typemap(freearg) (const char *utf8_path) */
39259     GDALPythonFreeCStr(arg1, bToFree1);
39260   }
39261   {
39262     /* %typemap(freearg) char **options */
39263     CSLDestroy( arg3 );
39264   }
39265   {
39266     /* %typemap(freearg) char **options */
39267     CSLDestroy( arg4 );
39268   }
39269   {
39270     /* %typemap(freearg) char **options */
39271     CSLDestroy( arg5 );
39272   }
39273   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39274   return resultobj;
39275 fail:
39276   {
39277     /* %typemap(freearg) (const char *utf8_path) */
39278     GDALPythonFreeCStr(arg1, bToFree1);
39279   }
39280   {
39281     /* %typemap(freearg) char **options */
39282     CSLDestroy( arg3 );
39283   }
39284   {
39285     /* %typemap(freearg) char **options */
39286     CSLDestroy( arg4 );
39287   }
39288   {
39289     /* %typemap(freearg) char **options */
39290     CSLDestroy( arg5 );
39291   }
39292   return NULL;
39293 }
39294 
39295 
_wrap_OpenShared(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39296 SWIGINTERN PyObject *_wrap_OpenShared(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39297   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39298   char *arg1 = (char *) 0 ;
39299   GDALAccess arg2 = (GDALAccess) GA_ReadOnly ;
39300   int bToFree1 = 0 ;
39301   int val2 ;
39302   int ecode2 = 0 ;
39303   PyObject * obj0 = 0 ;
39304   PyObject * obj1 = 0 ;
39305   GDALDatasetShadow *result = 0 ;
39306 
39307   if (!PyArg_ParseTuple(args,(char *)"O|O:OpenShared",&obj0,&obj1)) SWIG_fail;
39308   {
39309     /* %typemap(in) (const char *utf8_path) */
39310     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
39311     if (arg1 == NULL)
39312     {
39313       PyErr_SetString( PyExc_RuntimeError, "not a string" );
39314       SWIG_fail;
39315     }
39316   }
39317   if (obj1) {
39318     ecode2 = SWIG_AsVal_int(obj1, &val2);
39319     if (!SWIG_IsOK(ecode2)) {
39320       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OpenShared" "', argument " "2"" of type '" "GDALAccess""'");
39321     }
39322     arg2 = static_cast< GDALAccess >(val2);
39323   }
39324   {
39325     if (!arg1) {
39326       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39327     }
39328   }
39329   {
39330     if ( bUseExceptions ) {
39331       ClearErrorState();
39332     }
39333     {
39334       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39335       result = (GDALDatasetShadow *)OpenShared((char const *)arg1,arg2);
39336       SWIG_PYTHON_THREAD_END_ALLOW;
39337     }
39338 #ifndef SED_HACKS
39339     if( result == NULL && bUseExceptions ) {
39340       CPLErr eclass = CPLGetLastErrorType();
39341       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39342         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39343       }
39344     }
39345 #endif
39346     if( result != NULL && bUseExceptions ) {
39347       StoreLastException();
39348 #ifdef SED_HACKS
39349       bLocalUseExceptionsCode = FALSE;
39350 #endif
39351     }
39352   }
39353   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
39354   {
39355     /* %typemap(freearg) (const char *utf8_path) */
39356     GDALPythonFreeCStr(arg1, bToFree1);
39357   }
39358   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39359   return resultobj;
39360 fail:
39361   {
39362     /* %typemap(freearg) (const char *utf8_path) */
39363     GDALPythonFreeCStr(arg1, bToFree1);
39364   }
39365   return NULL;
39366 }
39367 
39368 
_wrap_IdentifyDriver(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39369 SWIGINTERN PyObject *_wrap_IdentifyDriver(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39370   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39371   char *arg1 = (char *) 0 ;
39372   char **arg2 = (char **) NULL ;
39373   int bToFree1 = 0 ;
39374   PyObject * obj0 = 0 ;
39375   PyObject * obj1 = 0 ;
39376   GDALDriverShadow *result = 0 ;
39377 
39378   if (!PyArg_ParseTuple(args,(char *)"O|O:IdentifyDriver",&obj0,&obj1)) SWIG_fail;
39379   {
39380     /* %typemap(in) (const char *utf8_path) */
39381     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
39382     if (arg1 == NULL)
39383     {
39384       PyErr_SetString( PyExc_RuntimeError, "not a string" );
39385       SWIG_fail;
39386     }
39387   }
39388   if (obj1) {
39389     {
39390       /* %typemap(in) char **options */
39391       int bErr = FALSE;
39392       arg2 = CSLFromPySequence(obj1, &bErr);
39393       if( bErr )
39394       {
39395         SWIG_fail;
39396       }
39397     }
39398   }
39399   {
39400     if (!arg1) {
39401       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39402     }
39403   }
39404   {
39405     if ( bUseExceptions ) {
39406       ClearErrorState();
39407     }
39408     {
39409       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39410       result = (GDALDriverShadow *)IdentifyDriver((char const *)arg1,arg2);
39411       SWIG_PYTHON_THREAD_END_ALLOW;
39412     }
39413 #ifndef SED_HACKS
39414     if ( bUseExceptions ) {
39415       CPLErr eclass = CPLGetLastErrorType();
39416       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39417         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39418       }
39419     }
39420 #endif
39421   }
39422   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
39423   {
39424     /* %typemap(freearg) (const char *utf8_path) */
39425     GDALPythonFreeCStr(arg1, bToFree1);
39426   }
39427   {
39428     /* %typemap(freearg) char **options */
39429     CSLDestroy( arg2 );
39430   }
39431   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39432   return resultobj;
39433 fail:
39434   {
39435     /* %typemap(freearg) (const char *utf8_path) */
39436     GDALPythonFreeCStr(arg1, bToFree1);
39437   }
39438   {
39439     /* %typemap(freearg) char **options */
39440     CSLDestroy( arg2 );
39441   }
39442   return NULL;
39443 }
39444 
39445 
_wrap_IdentifyDriverEx(PyObject * SWIGUNUSEDPARM (self),PyObject * args,PyObject * kwargs)39446 SWIGINTERN PyObject *_wrap_IdentifyDriverEx(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
39447   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39448   char *arg1 = (char *) 0 ;
39449   unsigned int arg2 = (unsigned int) 0 ;
39450   char **arg3 = (char **) NULL ;
39451   char **arg4 = (char **) NULL ;
39452   int bToFree1 = 0 ;
39453   unsigned int val2 ;
39454   int ecode2 = 0 ;
39455   PyObject * obj0 = 0 ;
39456   PyObject * obj1 = 0 ;
39457   PyObject * obj2 = 0 ;
39458   PyObject * obj3 = 0 ;
39459   char *  kwnames[] = {
39460     (char *) "utf8_path",(char *) "nIdentifyFlags",(char *) "allowed_drivers",(char *) "sibling_files", NULL
39461   };
39462   GDALDriverShadow *result = 0 ;
39463 
39464   if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O|OOO:IdentifyDriverEx",kwnames,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
39465   {
39466     /* %typemap(in) (const char *utf8_path) */
39467     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
39468     if (arg1 == NULL)
39469     {
39470       PyErr_SetString( PyExc_RuntimeError, "not a string" );
39471       SWIG_fail;
39472     }
39473   }
39474   if (obj1) {
39475     ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
39476     if (!SWIG_IsOK(ecode2)) {
39477       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IdentifyDriverEx" "', argument " "2"" of type '" "unsigned int""'");
39478     }
39479     arg2 = static_cast< unsigned int >(val2);
39480   }
39481   if (obj2) {
39482     {
39483       /* %typemap(in) char **options */
39484       int bErr = FALSE;
39485       arg3 = CSLFromPySequence(obj2, &bErr);
39486       if( bErr )
39487       {
39488         SWIG_fail;
39489       }
39490     }
39491   }
39492   if (obj3) {
39493     {
39494       /* %typemap(in) char **options */
39495       int bErr = FALSE;
39496       arg4 = CSLFromPySequence(obj3, &bErr);
39497       if( bErr )
39498       {
39499         SWIG_fail;
39500       }
39501     }
39502   }
39503   {
39504     if (!arg1) {
39505       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
39506     }
39507   }
39508   {
39509     if ( bUseExceptions ) {
39510       ClearErrorState();
39511     }
39512     {
39513       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39514       result = (GDALDriverShadow *)IdentifyDriverEx((char const *)arg1,arg2,arg3,arg4);
39515       SWIG_PYTHON_THREAD_END_ALLOW;
39516     }
39517 #ifndef SED_HACKS
39518     if ( bUseExceptions ) {
39519       CPLErr eclass = CPLGetLastErrorType();
39520       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39521         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39522       }
39523     }
39524 #endif
39525   }
39526   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDriverShadow, 0 |  0 );
39527   {
39528     /* %typemap(freearg) (const char *utf8_path) */
39529     GDALPythonFreeCStr(arg1, bToFree1);
39530   }
39531   {
39532     /* %typemap(freearg) char **options */
39533     CSLDestroy( arg3 );
39534   }
39535   {
39536     /* %typemap(freearg) char **options */
39537     CSLDestroy( arg4 );
39538   }
39539   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39540   return resultobj;
39541 fail:
39542   {
39543     /* %typemap(freearg) (const char *utf8_path) */
39544     GDALPythonFreeCStr(arg1, bToFree1);
39545   }
39546   {
39547     /* %typemap(freearg) char **options */
39548     CSLDestroy( arg3 );
39549   }
39550   {
39551     /* %typemap(freearg) char **options */
39552     CSLDestroy( arg4 );
39553   }
39554   return NULL;
39555 }
39556 
39557 
_wrap_GeneralCmdLineProcessor(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39558 SWIGINTERN PyObject *_wrap_GeneralCmdLineProcessor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39559   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39560   char **arg1 = (char **) 0 ;
39561   int arg2 = (int) 0 ;
39562   int val2 ;
39563   int ecode2 = 0 ;
39564   PyObject * obj0 = 0 ;
39565   PyObject * obj1 = 0 ;
39566   char **result = 0 ;
39567 
39568   if (!PyArg_ParseTuple(args,(char *)"O|O:GeneralCmdLineProcessor",&obj0,&obj1)) SWIG_fail;
39569   {
39570     /* %typemap(in) char **options */
39571     int bErr = FALSE;
39572     arg1 = CSLFromPySequence(obj0, &bErr);
39573     if( bErr )
39574     {
39575       SWIG_fail;
39576     }
39577   }
39578   if (obj1) {
39579     ecode2 = SWIG_AsVal_int(obj1, &val2);
39580     if (!SWIG_IsOK(ecode2)) {
39581       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeneralCmdLineProcessor" "', argument " "2"" of type '" "int""'");
39582     }
39583     arg2 = static_cast< int >(val2);
39584   }
39585   {
39586     if ( bUseExceptions ) {
39587       ClearErrorState();
39588     }
39589     {
39590       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39591       result = (char **)GeneralCmdLineProcessor(arg1,arg2);
39592       SWIG_PYTHON_THREAD_END_ALLOW;
39593     }
39594 #ifndef SED_HACKS
39595     if ( bUseExceptions ) {
39596       CPLErr eclass = CPLGetLastErrorType();
39597       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39598         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39599       }
39600     }
39601 #endif
39602   }
39603   {
39604     /* %typemap(out) char **CSL -> ( string ) */
39605     char **stringarray = result;
39606     if ( stringarray == NULL ) {
39607       resultobj = Py_None;
39608       Py_INCREF( resultobj );
39609     }
39610     else {
39611       int len = CSLCount( stringarray );
39612       resultobj = PyList_New( len );
39613       for ( int i = 0; i < len; ++i ) {
39614         PyObject *o = GDALPythonObjectFromCStr( stringarray[i] );
39615         PyList_SetItem(resultobj, i, o );
39616       }
39617     }
39618     CSLDestroy(result);
39619   }
39620   {
39621     /* %typemap(freearg) char **options */
39622     CSLDestroy( arg1 );
39623   }
39624   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39625   return resultobj;
39626 fail:
39627   {
39628     /* %typemap(freearg) char **options */
39629     CSLDestroy( arg1 );
39630   }
39631   return NULL;
39632 }
39633 
39634 
_wrap_new_GDALInfoOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39635 SWIGINTERN PyObject *_wrap_new_GDALInfoOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39636   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39637   char **arg1 = (char **) 0 ;
39638   PyObject * obj0 = 0 ;
39639   GDALInfoOptions *result = 0 ;
39640 
39641   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALInfoOptions",&obj0)) SWIG_fail;
39642   {
39643     /* %typemap(in) char **options */
39644     int bErr = FALSE;
39645     arg1 = CSLFromPySequence(obj0, &bErr);
39646     if( bErr )
39647     {
39648       SWIG_fail;
39649     }
39650   }
39651   {
39652     if ( bUseExceptions ) {
39653       ClearErrorState();
39654     }
39655     {
39656       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39657       result = (GDALInfoOptions *)new_GDALInfoOptions(arg1);
39658       SWIG_PYTHON_THREAD_END_ALLOW;
39659     }
39660 #ifndef SED_HACKS
39661     if ( bUseExceptions ) {
39662       CPLErr eclass = CPLGetLastErrorType();
39663       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39664         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39665       }
39666     }
39667 #endif
39668   }
39669   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALInfoOptions, SWIG_POINTER_NEW |  0 );
39670   {
39671     /* %typemap(freearg) char **options */
39672     CSLDestroy( arg1 );
39673   }
39674   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39675   return resultobj;
39676 fail:
39677   {
39678     /* %typemap(freearg) char **options */
39679     CSLDestroy( arg1 );
39680   }
39681   return NULL;
39682 }
39683 
39684 
_wrap_delete_GDALInfoOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39685 SWIGINTERN PyObject *_wrap_delete_GDALInfoOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39686   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39687   GDALInfoOptions *arg1 = (GDALInfoOptions *) 0 ;
39688   void *argp1 = 0 ;
39689   int res1 = 0 ;
39690   PyObject * obj0 = 0 ;
39691 
39692   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALInfoOptions",&obj0)) SWIG_fail;
39693   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALInfoOptions, SWIG_POINTER_DISOWN |  0 );
39694   if (!SWIG_IsOK(res1)) {
39695     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALInfoOptions" "', argument " "1"" of type '" "GDALInfoOptions *""'");
39696   }
39697   arg1 = reinterpret_cast< GDALInfoOptions * >(argp1);
39698   {
39699     if ( bUseExceptions ) {
39700       ClearErrorState();
39701     }
39702     {
39703       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39704       delete_GDALInfoOptions(arg1);
39705       SWIG_PYTHON_THREAD_END_ALLOW;
39706     }
39707 #ifndef SED_HACKS
39708     if ( bUseExceptions ) {
39709       CPLErr eclass = CPLGetLastErrorType();
39710       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39711         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39712       }
39713     }
39714 #endif
39715   }
39716   resultobj = SWIG_Py_Void();
39717   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39718   return resultobj;
39719 fail:
39720   return NULL;
39721 }
39722 
39723 
GDALInfoOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39724 SWIGINTERN PyObject *GDALInfoOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39725   PyObject *obj;
39726   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
39727   SWIG_TypeNewClientData(SWIGTYPE_p_GDALInfoOptions, SWIG_NewClientData(obj));
39728   return SWIG_Py_Void();
39729 }
39730 
_wrap_InfoInternal(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39731 SWIGINTERN PyObject *_wrap_InfoInternal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39732   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39733   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
39734   GDALInfoOptions *arg2 = (GDALInfoOptions *) 0 ;
39735   void *argp1 = 0 ;
39736   int res1 = 0 ;
39737   void *argp2 = 0 ;
39738   int res2 = 0 ;
39739   PyObject * obj0 = 0 ;
39740   PyObject * obj1 = 0 ;
39741   retStringAndCPLFree *result = 0 ;
39742 
39743   if (!PyArg_ParseTuple(args,(char *)"OO:InfoInternal",&obj0,&obj1)) SWIG_fail;
39744   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
39745   if (!SWIG_IsOK(res1)) {
39746     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "InfoInternal" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
39747   }
39748   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
39749   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALInfoOptions, 0 |  0 );
39750   if (!SWIG_IsOK(res2)) {
39751     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "InfoInternal" "', argument " "2"" of type '" "GDALInfoOptions *""'");
39752   }
39753   arg2 = reinterpret_cast< GDALInfoOptions * >(argp2);
39754   {
39755     if ( bUseExceptions ) {
39756       ClearErrorState();
39757     }
39758     {
39759       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39760       result = (retStringAndCPLFree *)GDALInfo(arg1,arg2);
39761       SWIG_PYTHON_THREAD_END_ALLOW;
39762     }
39763 #ifndef SED_HACKS
39764     if ( bUseExceptions ) {
39765       CPLErr eclass = CPLGetLastErrorType();
39766       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39767         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39768       }
39769     }
39770 #endif
39771   }
39772   {
39773     /* %typemap(out) (retStringAndCPLFree*) */
39774     Py_XDECREF(resultobj);
39775     if(result)
39776     {
39777       resultobj = GDALPythonObjectFromCStr( (const char *)result);
39778       CPLFree(result);
39779     }
39780     else
39781     {
39782       resultobj = Py_None;
39783       Py_INCREF(resultobj);
39784     }
39785   }
39786   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39787   return resultobj;
39788 fail:
39789   return NULL;
39790 }
39791 
39792 
_wrap_new_GDALMultiDimInfoOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39793 SWIGINTERN PyObject *_wrap_new_GDALMultiDimInfoOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39794   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39795   char **arg1 = (char **) 0 ;
39796   PyObject * obj0 = 0 ;
39797   GDALMultiDimInfoOptions *result = 0 ;
39798 
39799   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALMultiDimInfoOptions",&obj0)) SWIG_fail;
39800   {
39801     /* %typemap(in) char **options */
39802     int bErr = FALSE;
39803     arg1 = CSLFromPySequence(obj0, &bErr);
39804     if( bErr )
39805     {
39806       SWIG_fail;
39807     }
39808   }
39809   {
39810     if ( bUseExceptions ) {
39811       ClearErrorState();
39812     }
39813     {
39814       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39815       result = (GDALMultiDimInfoOptions *)new_GDALMultiDimInfoOptions(arg1);
39816       SWIG_PYTHON_THREAD_END_ALLOW;
39817     }
39818 #ifndef SED_HACKS
39819     if ( bUseExceptions ) {
39820       CPLErr eclass = CPLGetLastErrorType();
39821       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39822         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39823       }
39824     }
39825 #endif
39826   }
39827   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMultiDimInfoOptions, SWIG_POINTER_NEW |  0 );
39828   {
39829     /* %typemap(freearg) char **options */
39830     CSLDestroy( arg1 );
39831   }
39832   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39833   return resultobj;
39834 fail:
39835   {
39836     /* %typemap(freearg) char **options */
39837     CSLDestroy( arg1 );
39838   }
39839   return NULL;
39840 }
39841 
39842 
_wrap_delete_GDALMultiDimInfoOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39843 SWIGINTERN PyObject *_wrap_delete_GDALMultiDimInfoOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39844   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39845   GDALMultiDimInfoOptions *arg1 = (GDALMultiDimInfoOptions *) 0 ;
39846   void *argp1 = 0 ;
39847   int res1 = 0 ;
39848   PyObject * obj0 = 0 ;
39849 
39850   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALMultiDimInfoOptions",&obj0)) SWIG_fail;
39851   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMultiDimInfoOptions, SWIG_POINTER_DISOWN |  0 );
39852   if (!SWIG_IsOK(res1)) {
39853     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALMultiDimInfoOptions" "', argument " "1"" of type '" "GDALMultiDimInfoOptions *""'");
39854   }
39855   arg1 = reinterpret_cast< GDALMultiDimInfoOptions * >(argp1);
39856   {
39857     if ( bUseExceptions ) {
39858       ClearErrorState();
39859     }
39860     {
39861       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39862       delete_GDALMultiDimInfoOptions(arg1);
39863       SWIG_PYTHON_THREAD_END_ALLOW;
39864     }
39865 #ifndef SED_HACKS
39866     if ( bUseExceptions ) {
39867       CPLErr eclass = CPLGetLastErrorType();
39868       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39869         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39870       }
39871     }
39872 #endif
39873   }
39874   resultobj = SWIG_Py_Void();
39875   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39876   return resultobj;
39877 fail:
39878   return NULL;
39879 }
39880 
39881 
GDALMultiDimInfoOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39882 SWIGINTERN PyObject *GDALMultiDimInfoOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39883   PyObject *obj;
39884   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
39885   SWIG_TypeNewClientData(SWIGTYPE_p_GDALMultiDimInfoOptions, SWIG_NewClientData(obj));
39886   return SWIG_Py_Void();
39887 }
39888 
_wrap_MultiDimInfoInternal(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39889 SWIGINTERN PyObject *_wrap_MultiDimInfoInternal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39890   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39891   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
39892   GDALMultiDimInfoOptions *arg2 = (GDALMultiDimInfoOptions *) 0 ;
39893   void *argp1 = 0 ;
39894   int res1 = 0 ;
39895   void *argp2 = 0 ;
39896   int res2 = 0 ;
39897   PyObject * obj0 = 0 ;
39898   PyObject * obj1 = 0 ;
39899   retStringAndCPLFree *result = 0 ;
39900 
39901   if (!PyArg_ParseTuple(args,(char *)"OO:MultiDimInfoInternal",&obj0,&obj1)) SWIG_fail;
39902   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
39903   if (!SWIG_IsOK(res1)) {
39904     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "MultiDimInfoInternal" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
39905   }
39906   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
39907   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALMultiDimInfoOptions, 0 |  0 );
39908   if (!SWIG_IsOK(res2)) {
39909     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "MultiDimInfoInternal" "', argument " "2"" of type '" "GDALMultiDimInfoOptions *""'");
39910   }
39911   arg2 = reinterpret_cast< GDALMultiDimInfoOptions * >(argp2);
39912   {
39913     if ( bUseExceptions ) {
39914       ClearErrorState();
39915     }
39916     {
39917       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39918       result = (retStringAndCPLFree *)GDALMultiDimInfo(arg1,arg2);
39919       SWIG_PYTHON_THREAD_END_ALLOW;
39920     }
39921 #ifndef SED_HACKS
39922     if ( bUseExceptions ) {
39923       CPLErr eclass = CPLGetLastErrorType();
39924       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39925         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39926       }
39927     }
39928 #endif
39929   }
39930   {
39931     /* %typemap(out) (retStringAndCPLFree*) */
39932     Py_XDECREF(resultobj);
39933     if(result)
39934     {
39935       resultobj = GDALPythonObjectFromCStr( (const char *)result);
39936       CPLFree(result);
39937     }
39938     else
39939     {
39940       resultobj = Py_None;
39941       Py_INCREF(resultobj);
39942     }
39943   }
39944   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39945   return resultobj;
39946 fail:
39947   return NULL;
39948 }
39949 
39950 
_wrap_new_GDALTranslateOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)39951 SWIGINTERN PyObject *_wrap_new_GDALTranslateOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
39952   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
39953   char **arg1 = (char **) 0 ;
39954   PyObject * obj0 = 0 ;
39955   GDALTranslateOptions *result = 0 ;
39956 
39957   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALTranslateOptions",&obj0)) SWIG_fail;
39958   {
39959     /* %typemap(in) char **options */
39960     int bErr = FALSE;
39961     arg1 = CSLFromPySequence(obj0, &bErr);
39962     if( bErr )
39963     {
39964       SWIG_fail;
39965     }
39966   }
39967   {
39968     if ( bUseExceptions ) {
39969       ClearErrorState();
39970     }
39971     {
39972       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
39973       result = (GDALTranslateOptions *)new_GDALTranslateOptions(arg1);
39974       SWIG_PYTHON_THREAD_END_ALLOW;
39975     }
39976 #ifndef SED_HACKS
39977     if ( bUseExceptions ) {
39978       CPLErr eclass = CPLGetLastErrorType();
39979       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
39980         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
39981       }
39982     }
39983 #endif
39984   }
39985   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALTranslateOptions, SWIG_POINTER_NEW |  0 );
39986   {
39987     /* %typemap(freearg) char **options */
39988     CSLDestroy( arg1 );
39989   }
39990   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
39991   return resultobj;
39992 fail:
39993   {
39994     /* %typemap(freearg) char **options */
39995     CSLDestroy( arg1 );
39996   }
39997   return NULL;
39998 }
39999 
40000 
_wrap_delete_GDALTranslateOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40001 SWIGINTERN PyObject *_wrap_delete_GDALTranslateOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40002   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40003   GDALTranslateOptions *arg1 = (GDALTranslateOptions *) 0 ;
40004   void *argp1 = 0 ;
40005   int res1 = 0 ;
40006   PyObject * obj0 = 0 ;
40007 
40008   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALTranslateOptions",&obj0)) SWIG_fail;
40009   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALTranslateOptions, SWIG_POINTER_DISOWN |  0 );
40010   if (!SWIG_IsOK(res1)) {
40011     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALTranslateOptions" "', argument " "1"" of type '" "GDALTranslateOptions *""'");
40012   }
40013   arg1 = reinterpret_cast< GDALTranslateOptions * >(argp1);
40014   {
40015     if ( bUseExceptions ) {
40016       ClearErrorState();
40017     }
40018     {
40019       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40020       delete_GDALTranslateOptions(arg1);
40021       SWIG_PYTHON_THREAD_END_ALLOW;
40022     }
40023 #ifndef SED_HACKS
40024     if ( bUseExceptions ) {
40025       CPLErr eclass = CPLGetLastErrorType();
40026       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40027         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40028       }
40029     }
40030 #endif
40031   }
40032   resultobj = SWIG_Py_Void();
40033   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40034   return resultobj;
40035 fail:
40036   return NULL;
40037 }
40038 
40039 
GDALTranslateOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40040 SWIGINTERN PyObject *GDALTranslateOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40041   PyObject *obj;
40042   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
40043   SWIG_TypeNewClientData(SWIGTYPE_p_GDALTranslateOptions, SWIG_NewClientData(obj));
40044   return SWIG_Py_Void();
40045 }
40046 
_wrap_TranslateInternal(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40047 SWIGINTERN PyObject *_wrap_TranslateInternal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40048   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40049   char *arg1 = (char *) 0 ;
40050   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
40051   GDALTranslateOptions *arg3 = (GDALTranslateOptions *) 0 ;
40052   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
40053   void *arg5 = (void *) NULL ;
40054   int bToFree1 = 0 ;
40055   void *argp2 = 0 ;
40056   int res2 = 0 ;
40057   void *argp3 = 0 ;
40058   int res3 = 0 ;
40059   PyObject * obj0 = 0 ;
40060   PyObject * obj1 = 0 ;
40061   PyObject * obj2 = 0 ;
40062   PyObject * obj3 = 0 ;
40063   PyObject * obj4 = 0 ;
40064   GDALDatasetShadow *result = 0 ;
40065 
40066   /* %typemap(arginit) ( const char* callback_data=NULL)  */
40067   PyProgressData *psProgressInfo;
40068   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
40069   psProgressInfo->nLastReported = -1;
40070   psProgressInfo->psPyCallback = NULL;
40071   psProgressInfo->psPyCallbackData = NULL;
40072   arg5 = psProgressInfo;
40073   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:TranslateInternal",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
40074   {
40075     /* %typemap(in) (const char *utf8_path) */
40076     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
40077     if (arg1 == NULL)
40078     {
40079       PyErr_SetString( PyExc_RuntimeError, "not a string" );
40080       SWIG_fail;
40081     }
40082   }
40083   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
40084   if (!SWIG_IsOK(res2)) {
40085     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TranslateInternal" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
40086   }
40087   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
40088   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALTranslateOptions, 0 |  0 );
40089   if (!SWIG_IsOK(res3)) {
40090     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "TranslateInternal" "', argument " "3"" of type '" "GDALTranslateOptions *""'");
40091   }
40092   arg3 = reinterpret_cast< GDALTranslateOptions * >(argp3);
40093   if (obj3) {
40094     {
40095       /* %typemap(in) (GDALProgressFunc callback = NULL) */
40096       /* callback_func typemap */
40097 
40098       /* In some cases 0 is passed instead of None. */
40099       /* See https://github.com/OSGeo/gdal/pull/219 */
40100       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
40101       {
40102         if( PyLong_AsLong(obj3) == 0 )
40103         {
40104           obj3 = Py_None;
40105         }
40106       }
40107 
40108       if (obj3 && obj3 != Py_None ) {
40109         void* cbfunction = NULL;
40110         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
40111             (void**)&cbfunction,
40112             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
40113             SWIG_POINTER_EXCEPTION | 0 ));
40114 
40115         if ( cbfunction == GDALTermProgress ) {
40116           arg4 = GDALTermProgress;
40117         } else {
40118           if (!PyCallable_Check(obj3)) {
40119             PyErr_SetString( PyExc_RuntimeError,
40120               "Object given is not a Python function" );
40121             SWIG_fail;
40122           }
40123           psProgressInfo->psPyCallback = obj3;
40124           arg4 = PyProgressProxy;
40125         }
40126 
40127       }
40128 
40129     }
40130   }
40131   if (obj4) {
40132     {
40133       /* %typemap(in) ( void* callback_data=NULL)  */
40134       psProgressInfo->psPyCallbackData = obj4 ;
40135     }
40136   }
40137   {
40138     if (!arg1) {
40139       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
40140     }
40141   }
40142   {
40143     if (!arg2) {
40144       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
40145     }
40146   }
40147   {
40148     if ( bUseExceptions ) {
40149       ClearErrorState();
40150     }
40151     {
40152       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40153       result = (GDALDatasetShadow *)wrapper_GDALTranslate((char const *)arg1,arg2,arg3,arg4,arg5);
40154       SWIG_PYTHON_THREAD_END_ALLOW;
40155     }
40156 #ifndef SED_HACKS
40157     if ( bUseExceptions ) {
40158       CPLErr eclass = CPLGetLastErrorType();
40159       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40160         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40161       }
40162     }
40163 #endif
40164   }
40165   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
40166   {
40167     /* %typemap(freearg) (const char *utf8_path) */
40168     GDALPythonFreeCStr(arg1, bToFree1);
40169   }
40170   {
40171     /* %typemap(freearg) ( void* callback_data=NULL)  */
40172 
40173     CPLFree(psProgressInfo);
40174 
40175   }
40176   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40177   return resultobj;
40178 fail:
40179   {
40180     /* %typemap(freearg) (const char *utf8_path) */
40181     GDALPythonFreeCStr(arg1, bToFree1);
40182   }
40183   {
40184     /* %typemap(freearg) ( void* callback_data=NULL)  */
40185 
40186     CPLFree(psProgressInfo);
40187 
40188   }
40189   return NULL;
40190 }
40191 
40192 
_wrap_new_GDALWarpAppOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40193 SWIGINTERN PyObject *_wrap_new_GDALWarpAppOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40194   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40195   char **arg1 = (char **) 0 ;
40196   PyObject * obj0 = 0 ;
40197   GDALWarpAppOptions *result = 0 ;
40198 
40199   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALWarpAppOptions",&obj0)) SWIG_fail;
40200   {
40201     /* %typemap(in) char **options */
40202     int bErr = FALSE;
40203     arg1 = CSLFromPySequence(obj0, &bErr);
40204     if( bErr )
40205     {
40206       SWIG_fail;
40207     }
40208   }
40209   {
40210     if ( bUseExceptions ) {
40211       ClearErrorState();
40212     }
40213     {
40214       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40215       result = (GDALWarpAppOptions *)new_GDALWarpAppOptions(arg1);
40216       SWIG_PYTHON_THREAD_END_ALLOW;
40217     }
40218 #ifndef SED_HACKS
40219     if ( bUseExceptions ) {
40220       CPLErr eclass = CPLGetLastErrorType();
40221       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40222         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40223       }
40224     }
40225 #endif
40226   }
40227   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALWarpAppOptions, SWIG_POINTER_NEW |  0 );
40228   {
40229     /* %typemap(freearg) char **options */
40230     CSLDestroy( arg1 );
40231   }
40232   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40233   return resultobj;
40234 fail:
40235   {
40236     /* %typemap(freearg) char **options */
40237     CSLDestroy( arg1 );
40238   }
40239   return NULL;
40240 }
40241 
40242 
_wrap_delete_GDALWarpAppOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40243 SWIGINTERN PyObject *_wrap_delete_GDALWarpAppOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40244   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40245   GDALWarpAppOptions *arg1 = (GDALWarpAppOptions *) 0 ;
40246   void *argp1 = 0 ;
40247   int res1 = 0 ;
40248   PyObject * obj0 = 0 ;
40249 
40250   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALWarpAppOptions",&obj0)) SWIG_fail;
40251   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALWarpAppOptions, SWIG_POINTER_DISOWN |  0 );
40252   if (!SWIG_IsOK(res1)) {
40253     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALWarpAppOptions" "', argument " "1"" of type '" "GDALWarpAppOptions *""'");
40254   }
40255   arg1 = reinterpret_cast< GDALWarpAppOptions * >(argp1);
40256   {
40257     if ( bUseExceptions ) {
40258       ClearErrorState();
40259     }
40260     {
40261       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40262       delete_GDALWarpAppOptions(arg1);
40263       SWIG_PYTHON_THREAD_END_ALLOW;
40264     }
40265 #ifndef SED_HACKS
40266     if ( bUseExceptions ) {
40267       CPLErr eclass = CPLGetLastErrorType();
40268       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40269         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40270       }
40271     }
40272 #endif
40273   }
40274   resultobj = SWIG_Py_Void();
40275   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40276   return resultobj;
40277 fail:
40278   return NULL;
40279 }
40280 
40281 
GDALWarpAppOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40282 SWIGINTERN PyObject *GDALWarpAppOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40283   PyObject *obj;
40284   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
40285   SWIG_TypeNewClientData(SWIGTYPE_p_GDALWarpAppOptions, SWIG_NewClientData(obj));
40286   return SWIG_Py_Void();
40287 }
40288 
_wrap_wrapper_GDALWarpDestDS(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40289 SWIGINTERN PyObject *_wrap_wrapper_GDALWarpDestDS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40290   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40291   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
40292   int arg2 ;
40293   GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
40294   GDALWarpAppOptions *arg4 = (GDALWarpAppOptions *) 0 ;
40295   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
40296   void *arg6 = (void *) NULL ;
40297   void *argp1 = 0 ;
40298   int res1 = 0 ;
40299   void *argp4 = 0 ;
40300   int res4 = 0 ;
40301   PyObject * obj0 = 0 ;
40302   PyObject * obj1 = 0 ;
40303   PyObject * obj2 = 0 ;
40304   PyObject * obj3 = 0 ;
40305   PyObject * obj4 = 0 ;
40306   int result;
40307 
40308   /* %typemap(arginit) ( const char* callback_data=NULL)  */
40309   PyProgressData *psProgressInfo;
40310   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
40311   psProgressInfo->nLastReported = -1;
40312   psProgressInfo->psPyCallback = NULL;
40313   psProgressInfo->psPyCallbackData = NULL;
40314   arg6 = psProgressInfo;
40315   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALWarpDestDS",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
40316   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
40317   if (!SWIG_IsOK(res1)) {
40318     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrapper_GDALWarpDestDS" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
40319   }
40320   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
40321   {
40322     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALDatasetShadow *optional_##GDALDatasetShadow)*/
40323     if ( !PySequence_Check(obj1) ) {
40324       PyErr_SetString(PyExc_TypeError, "not a sequence");
40325       SWIG_fail;
40326     }
40327     Py_ssize_t size = PySequence_Size(obj1);
40328     if( size != (int)size ) {
40329       PyErr_SetString(PyExc_TypeError, "too big sequence");
40330       SWIG_fail;
40331     }
40332     arg2 = (int)size;
40333     arg3 = (GDALDatasetShadow**) CPLMalloc(arg2*sizeof(GDALDatasetShadow*));
40334 
40335     for( int i = 0; i<arg2; i++ ) {
40336       PyObject *o = PySequence_GetItem(obj1,i);
40337       GDALDatasetShadow* rawobjectpointer = NULL;
40338       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_EXCEPTION | 0 ));
40339       if (!rawobjectpointer) {
40340         Py_DECREF(o);
40341         PyErr_SetString(PyExc_TypeError, "object of wrong GDALDatasetShadow");
40342         SWIG_fail;
40343       }
40344       arg3[i] = rawobjectpointer;
40345       Py_DECREF(o);
40346 
40347     }
40348   }
40349   res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_GDALWarpAppOptions, 0 |  0 );
40350   if (!SWIG_IsOK(res4)) {
40351     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALWarpDestDS" "', argument " "4"" of type '" "GDALWarpAppOptions *""'");
40352   }
40353   arg4 = reinterpret_cast< GDALWarpAppOptions * >(argp4);
40354   if (obj3) {
40355     {
40356       /* %typemap(in) (GDALProgressFunc callback = NULL) */
40357       /* callback_func typemap */
40358 
40359       /* In some cases 0 is passed instead of None. */
40360       /* See https://github.com/OSGeo/gdal/pull/219 */
40361       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
40362       {
40363         if( PyLong_AsLong(obj3) == 0 )
40364         {
40365           obj3 = Py_None;
40366         }
40367       }
40368 
40369       if (obj3 && obj3 != Py_None ) {
40370         void* cbfunction = NULL;
40371         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
40372             (void**)&cbfunction,
40373             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
40374             SWIG_POINTER_EXCEPTION | 0 ));
40375 
40376         if ( cbfunction == GDALTermProgress ) {
40377           arg5 = GDALTermProgress;
40378         } else {
40379           if (!PyCallable_Check(obj3)) {
40380             PyErr_SetString( PyExc_RuntimeError,
40381               "Object given is not a Python function" );
40382             SWIG_fail;
40383           }
40384           psProgressInfo->psPyCallback = obj3;
40385           arg5 = PyProgressProxy;
40386         }
40387 
40388       }
40389 
40390     }
40391   }
40392   if (obj4) {
40393     {
40394       /* %typemap(in) ( void* callback_data=NULL)  */
40395       psProgressInfo->psPyCallbackData = obj4 ;
40396     }
40397   }
40398   {
40399     if ( bUseExceptions ) {
40400       ClearErrorState();
40401     }
40402     {
40403       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40404       result = (int)wrapper_GDALWarpDestDS(arg1,arg2,arg3,arg4,arg5,arg6);
40405       SWIG_PYTHON_THREAD_END_ALLOW;
40406     }
40407 #ifndef SED_HACKS
40408     if ( bUseExceptions ) {
40409       CPLErr eclass = CPLGetLastErrorType();
40410       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40411         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40412       }
40413     }
40414 #endif
40415   }
40416   resultobj = SWIG_From_int(static_cast< int >(result));
40417   {
40418     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
40419     CPLFree( arg3 );
40420   }
40421   {
40422     /* %typemap(freearg) ( void* callback_data=NULL)  */
40423 
40424     CPLFree(psProgressInfo);
40425 
40426   }
40427   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40428   return resultobj;
40429 fail:
40430   {
40431     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
40432     CPLFree( arg3 );
40433   }
40434   {
40435     /* %typemap(freearg) ( void* callback_data=NULL)  */
40436 
40437     CPLFree(psProgressInfo);
40438 
40439   }
40440   return NULL;
40441 }
40442 
40443 
_wrap_wrapper_GDALWarpDestName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40444 SWIGINTERN PyObject *_wrap_wrapper_GDALWarpDestName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40445   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40446   char *arg1 = (char *) 0 ;
40447   int arg2 ;
40448   GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
40449   GDALWarpAppOptions *arg4 = (GDALWarpAppOptions *) 0 ;
40450   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
40451   void *arg6 = (void *) NULL ;
40452   int bToFree1 = 0 ;
40453   void *argp4 = 0 ;
40454   int res4 = 0 ;
40455   PyObject * obj0 = 0 ;
40456   PyObject * obj1 = 0 ;
40457   PyObject * obj2 = 0 ;
40458   PyObject * obj3 = 0 ;
40459   PyObject * obj4 = 0 ;
40460   GDALDatasetShadow *result = 0 ;
40461 
40462   /* %typemap(arginit) ( const char* callback_data=NULL)  */
40463   PyProgressData *psProgressInfo;
40464   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
40465   psProgressInfo->nLastReported = -1;
40466   psProgressInfo->psPyCallback = NULL;
40467   psProgressInfo->psPyCallbackData = NULL;
40468   arg6 = psProgressInfo;
40469   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALWarpDestName",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
40470   {
40471     /* %typemap(in) (const char *utf8_path) */
40472     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
40473     if (arg1 == NULL)
40474     {
40475       PyErr_SetString( PyExc_RuntimeError, "not a string" );
40476       SWIG_fail;
40477     }
40478   }
40479   {
40480     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALDatasetShadow *optional_##GDALDatasetShadow)*/
40481     if ( !PySequence_Check(obj1) ) {
40482       PyErr_SetString(PyExc_TypeError, "not a sequence");
40483       SWIG_fail;
40484     }
40485     Py_ssize_t size = PySequence_Size(obj1);
40486     if( size != (int)size ) {
40487       PyErr_SetString(PyExc_TypeError, "too big sequence");
40488       SWIG_fail;
40489     }
40490     arg2 = (int)size;
40491     arg3 = (GDALDatasetShadow**) CPLMalloc(arg2*sizeof(GDALDatasetShadow*));
40492 
40493     for( int i = 0; i<arg2; i++ ) {
40494       PyObject *o = PySequence_GetItem(obj1,i);
40495       GDALDatasetShadow* rawobjectpointer = NULL;
40496       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_EXCEPTION | 0 ));
40497       if (!rawobjectpointer) {
40498         Py_DECREF(o);
40499         PyErr_SetString(PyExc_TypeError, "object of wrong GDALDatasetShadow");
40500         SWIG_fail;
40501       }
40502       arg3[i] = rawobjectpointer;
40503       Py_DECREF(o);
40504 
40505     }
40506   }
40507   res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_GDALWarpAppOptions, 0 |  0 );
40508   if (!SWIG_IsOK(res4)) {
40509     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALWarpDestName" "', argument " "4"" of type '" "GDALWarpAppOptions *""'");
40510   }
40511   arg4 = reinterpret_cast< GDALWarpAppOptions * >(argp4);
40512   if (obj3) {
40513     {
40514       /* %typemap(in) (GDALProgressFunc callback = NULL) */
40515       /* callback_func typemap */
40516 
40517       /* In some cases 0 is passed instead of None. */
40518       /* See https://github.com/OSGeo/gdal/pull/219 */
40519       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
40520       {
40521         if( PyLong_AsLong(obj3) == 0 )
40522         {
40523           obj3 = Py_None;
40524         }
40525       }
40526 
40527       if (obj3 && obj3 != Py_None ) {
40528         void* cbfunction = NULL;
40529         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
40530             (void**)&cbfunction,
40531             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
40532             SWIG_POINTER_EXCEPTION | 0 ));
40533 
40534         if ( cbfunction == GDALTermProgress ) {
40535           arg5 = GDALTermProgress;
40536         } else {
40537           if (!PyCallable_Check(obj3)) {
40538             PyErr_SetString( PyExc_RuntimeError,
40539               "Object given is not a Python function" );
40540             SWIG_fail;
40541           }
40542           psProgressInfo->psPyCallback = obj3;
40543           arg5 = PyProgressProxy;
40544         }
40545 
40546       }
40547 
40548     }
40549   }
40550   if (obj4) {
40551     {
40552       /* %typemap(in) ( void* callback_data=NULL)  */
40553       psProgressInfo->psPyCallbackData = obj4 ;
40554     }
40555   }
40556   {
40557     if (!arg1) {
40558       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
40559     }
40560   }
40561   {
40562     if ( bUseExceptions ) {
40563       ClearErrorState();
40564     }
40565     {
40566       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40567       result = (GDALDatasetShadow *)wrapper_GDALWarpDestName((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
40568       SWIG_PYTHON_THREAD_END_ALLOW;
40569     }
40570 #ifndef SED_HACKS
40571     if ( bUseExceptions ) {
40572       CPLErr eclass = CPLGetLastErrorType();
40573       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40574         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40575       }
40576     }
40577 #endif
40578   }
40579   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
40580   {
40581     /* %typemap(freearg) (const char *utf8_path) */
40582     GDALPythonFreeCStr(arg1, bToFree1);
40583   }
40584   {
40585     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
40586     CPLFree( arg3 );
40587   }
40588   {
40589     /* %typemap(freearg) ( void* callback_data=NULL)  */
40590 
40591     CPLFree(psProgressInfo);
40592 
40593   }
40594   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40595   return resultobj;
40596 fail:
40597   {
40598     /* %typemap(freearg) (const char *utf8_path) */
40599     GDALPythonFreeCStr(arg1, bToFree1);
40600   }
40601   {
40602     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
40603     CPLFree( arg3 );
40604   }
40605   {
40606     /* %typemap(freearg) ( void* callback_data=NULL)  */
40607 
40608     CPLFree(psProgressInfo);
40609 
40610   }
40611   return NULL;
40612 }
40613 
40614 
_wrap_new_GDALVectorTranslateOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40615 SWIGINTERN PyObject *_wrap_new_GDALVectorTranslateOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40616   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40617   char **arg1 = (char **) 0 ;
40618   PyObject * obj0 = 0 ;
40619   GDALVectorTranslateOptions *result = 0 ;
40620 
40621   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALVectorTranslateOptions",&obj0)) SWIG_fail;
40622   {
40623     /* %typemap(in) char **options */
40624     int bErr = FALSE;
40625     arg1 = CSLFromPySequence(obj0, &bErr);
40626     if( bErr )
40627     {
40628       SWIG_fail;
40629     }
40630   }
40631   {
40632     if ( bUseExceptions ) {
40633       ClearErrorState();
40634     }
40635     {
40636       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40637       result = (GDALVectorTranslateOptions *)new_GDALVectorTranslateOptions(arg1);
40638       SWIG_PYTHON_THREAD_END_ALLOW;
40639     }
40640 #ifndef SED_HACKS
40641     if ( bUseExceptions ) {
40642       CPLErr eclass = CPLGetLastErrorType();
40643       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40644         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40645       }
40646     }
40647 #endif
40648   }
40649   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALVectorTranslateOptions, SWIG_POINTER_NEW |  0 );
40650   {
40651     /* %typemap(freearg) char **options */
40652     CSLDestroy( arg1 );
40653   }
40654   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40655   return resultobj;
40656 fail:
40657   {
40658     /* %typemap(freearg) char **options */
40659     CSLDestroy( arg1 );
40660   }
40661   return NULL;
40662 }
40663 
40664 
_wrap_delete_GDALVectorTranslateOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40665 SWIGINTERN PyObject *_wrap_delete_GDALVectorTranslateOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40666   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40667   GDALVectorTranslateOptions *arg1 = (GDALVectorTranslateOptions *) 0 ;
40668   void *argp1 = 0 ;
40669   int res1 = 0 ;
40670   PyObject * obj0 = 0 ;
40671 
40672   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALVectorTranslateOptions",&obj0)) SWIG_fail;
40673   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALVectorTranslateOptions, SWIG_POINTER_DISOWN |  0 );
40674   if (!SWIG_IsOK(res1)) {
40675     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALVectorTranslateOptions" "', argument " "1"" of type '" "GDALVectorTranslateOptions *""'");
40676   }
40677   arg1 = reinterpret_cast< GDALVectorTranslateOptions * >(argp1);
40678   {
40679     if ( bUseExceptions ) {
40680       ClearErrorState();
40681     }
40682     {
40683       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40684       delete_GDALVectorTranslateOptions(arg1);
40685       SWIG_PYTHON_THREAD_END_ALLOW;
40686     }
40687 #ifndef SED_HACKS
40688     if ( bUseExceptions ) {
40689       CPLErr eclass = CPLGetLastErrorType();
40690       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40691         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40692       }
40693     }
40694 #endif
40695   }
40696   resultobj = SWIG_Py_Void();
40697   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40698   return resultobj;
40699 fail:
40700   return NULL;
40701 }
40702 
40703 
GDALVectorTranslateOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40704 SWIGINTERN PyObject *GDALVectorTranslateOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40705   PyObject *obj;
40706   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
40707   SWIG_TypeNewClientData(SWIGTYPE_p_GDALVectorTranslateOptions, SWIG_NewClientData(obj));
40708   return SWIG_Py_Void();
40709 }
40710 
_wrap_wrapper_GDALVectorTranslateDestDS(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40711 SWIGINTERN PyObject *_wrap_wrapper_GDALVectorTranslateDestDS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40712   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40713   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
40714   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
40715   GDALVectorTranslateOptions *arg3 = (GDALVectorTranslateOptions *) 0 ;
40716   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
40717   void *arg5 = (void *) NULL ;
40718   void *argp1 = 0 ;
40719   int res1 = 0 ;
40720   void *argp2 = 0 ;
40721   int res2 = 0 ;
40722   void *argp3 = 0 ;
40723   int res3 = 0 ;
40724   PyObject * obj0 = 0 ;
40725   PyObject * obj1 = 0 ;
40726   PyObject * obj2 = 0 ;
40727   PyObject * obj3 = 0 ;
40728   PyObject * obj4 = 0 ;
40729   int result;
40730 
40731   /* %typemap(arginit) ( const char* callback_data=NULL)  */
40732   PyProgressData *psProgressInfo;
40733   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
40734   psProgressInfo->nLastReported = -1;
40735   psProgressInfo->psPyCallback = NULL;
40736   psProgressInfo->psPyCallbackData = NULL;
40737   arg5 = psProgressInfo;
40738   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALVectorTranslateDestDS",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
40739   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
40740   if (!SWIG_IsOK(res1)) {
40741     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrapper_GDALVectorTranslateDestDS" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
40742   }
40743   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
40744   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
40745   if (!SWIG_IsOK(res2)) {
40746     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "wrapper_GDALVectorTranslateDestDS" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
40747   }
40748   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
40749   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALVectorTranslateOptions, 0 |  0 );
40750   if (!SWIG_IsOK(res3)) {
40751     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALVectorTranslateDestDS" "', argument " "3"" of type '" "GDALVectorTranslateOptions *""'");
40752   }
40753   arg3 = reinterpret_cast< GDALVectorTranslateOptions * >(argp3);
40754   if (obj3) {
40755     {
40756       /* %typemap(in) (GDALProgressFunc callback = NULL) */
40757       /* callback_func typemap */
40758 
40759       /* In some cases 0 is passed instead of None. */
40760       /* See https://github.com/OSGeo/gdal/pull/219 */
40761       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
40762       {
40763         if( PyLong_AsLong(obj3) == 0 )
40764         {
40765           obj3 = Py_None;
40766         }
40767       }
40768 
40769       if (obj3 && obj3 != Py_None ) {
40770         void* cbfunction = NULL;
40771         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
40772             (void**)&cbfunction,
40773             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
40774             SWIG_POINTER_EXCEPTION | 0 ));
40775 
40776         if ( cbfunction == GDALTermProgress ) {
40777           arg4 = GDALTermProgress;
40778         } else {
40779           if (!PyCallable_Check(obj3)) {
40780             PyErr_SetString( PyExc_RuntimeError,
40781               "Object given is not a Python function" );
40782             SWIG_fail;
40783           }
40784           psProgressInfo->psPyCallback = obj3;
40785           arg4 = PyProgressProxy;
40786         }
40787 
40788       }
40789 
40790     }
40791   }
40792   if (obj4) {
40793     {
40794       /* %typemap(in) ( void* callback_data=NULL)  */
40795       psProgressInfo->psPyCallbackData = obj4 ;
40796     }
40797   }
40798   {
40799     if ( bUseExceptions ) {
40800       ClearErrorState();
40801     }
40802     {
40803       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40804       result = (int)wrapper_GDALVectorTranslateDestDS(arg1,arg2,arg3,arg4,arg5);
40805       SWIG_PYTHON_THREAD_END_ALLOW;
40806     }
40807 #ifndef SED_HACKS
40808     if ( bUseExceptions ) {
40809       CPLErr eclass = CPLGetLastErrorType();
40810       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40811         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40812       }
40813     }
40814 #endif
40815   }
40816   resultobj = SWIG_From_int(static_cast< int >(result));
40817   {
40818     /* %typemap(freearg) ( void* callback_data=NULL)  */
40819 
40820     CPLFree(psProgressInfo);
40821 
40822   }
40823   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40824   return resultobj;
40825 fail:
40826   {
40827     /* %typemap(freearg) ( void* callback_data=NULL)  */
40828 
40829     CPLFree(psProgressInfo);
40830 
40831   }
40832   return NULL;
40833 }
40834 
40835 
_wrap_wrapper_GDALVectorTranslateDestName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40836 SWIGINTERN PyObject *_wrap_wrapper_GDALVectorTranslateDestName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40837   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40838   char *arg1 = (char *) 0 ;
40839   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
40840   GDALVectorTranslateOptions *arg3 = (GDALVectorTranslateOptions *) 0 ;
40841   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
40842   void *arg5 = (void *) NULL ;
40843   int bToFree1 = 0 ;
40844   void *argp2 = 0 ;
40845   int res2 = 0 ;
40846   void *argp3 = 0 ;
40847   int res3 = 0 ;
40848   PyObject * obj0 = 0 ;
40849   PyObject * obj1 = 0 ;
40850   PyObject * obj2 = 0 ;
40851   PyObject * obj3 = 0 ;
40852   PyObject * obj4 = 0 ;
40853   GDALDatasetShadow *result = 0 ;
40854 
40855   /* %typemap(arginit) ( const char* callback_data=NULL)  */
40856   PyProgressData *psProgressInfo;
40857   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
40858   psProgressInfo->nLastReported = -1;
40859   psProgressInfo->psPyCallback = NULL;
40860   psProgressInfo->psPyCallbackData = NULL;
40861   arg5 = psProgressInfo;
40862   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALVectorTranslateDestName",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
40863   {
40864     /* %typemap(in) (const char *utf8_path) */
40865     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
40866     if (arg1 == NULL)
40867     {
40868       PyErr_SetString( PyExc_RuntimeError, "not a string" );
40869       SWIG_fail;
40870     }
40871   }
40872   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
40873   if (!SWIG_IsOK(res2)) {
40874     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "wrapper_GDALVectorTranslateDestName" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
40875   }
40876   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
40877   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALVectorTranslateOptions, 0 |  0 );
40878   if (!SWIG_IsOK(res3)) {
40879     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALVectorTranslateDestName" "', argument " "3"" of type '" "GDALVectorTranslateOptions *""'");
40880   }
40881   arg3 = reinterpret_cast< GDALVectorTranslateOptions * >(argp3);
40882   if (obj3) {
40883     {
40884       /* %typemap(in) (GDALProgressFunc callback = NULL) */
40885       /* callback_func typemap */
40886 
40887       /* In some cases 0 is passed instead of None. */
40888       /* See https://github.com/OSGeo/gdal/pull/219 */
40889       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
40890       {
40891         if( PyLong_AsLong(obj3) == 0 )
40892         {
40893           obj3 = Py_None;
40894         }
40895       }
40896 
40897       if (obj3 && obj3 != Py_None ) {
40898         void* cbfunction = NULL;
40899         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
40900             (void**)&cbfunction,
40901             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
40902             SWIG_POINTER_EXCEPTION | 0 ));
40903 
40904         if ( cbfunction == GDALTermProgress ) {
40905           arg4 = GDALTermProgress;
40906         } else {
40907           if (!PyCallable_Check(obj3)) {
40908             PyErr_SetString( PyExc_RuntimeError,
40909               "Object given is not a Python function" );
40910             SWIG_fail;
40911           }
40912           psProgressInfo->psPyCallback = obj3;
40913           arg4 = PyProgressProxy;
40914         }
40915 
40916       }
40917 
40918     }
40919   }
40920   if (obj4) {
40921     {
40922       /* %typemap(in) ( void* callback_data=NULL)  */
40923       psProgressInfo->psPyCallbackData = obj4 ;
40924     }
40925   }
40926   {
40927     if (!arg1) {
40928       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
40929     }
40930   }
40931   {
40932     if ( bUseExceptions ) {
40933       ClearErrorState();
40934     }
40935     {
40936       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40937       result = (GDALDatasetShadow *)wrapper_GDALVectorTranslateDestName((char const *)arg1,arg2,arg3,arg4,arg5);
40938       SWIG_PYTHON_THREAD_END_ALLOW;
40939     }
40940 #ifndef SED_HACKS
40941     if ( bUseExceptions ) {
40942       CPLErr eclass = CPLGetLastErrorType();
40943       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
40944         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
40945       }
40946     }
40947 #endif
40948   }
40949   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
40950   {
40951     /* %typemap(freearg) (const char *utf8_path) */
40952     GDALPythonFreeCStr(arg1, bToFree1);
40953   }
40954   {
40955     /* %typemap(freearg) ( void* callback_data=NULL)  */
40956 
40957     CPLFree(psProgressInfo);
40958 
40959   }
40960   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
40961   return resultobj;
40962 fail:
40963   {
40964     /* %typemap(freearg) (const char *utf8_path) */
40965     GDALPythonFreeCStr(arg1, bToFree1);
40966   }
40967   {
40968     /* %typemap(freearg) ( void* callback_data=NULL)  */
40969 
40970     CPLFree(psProgressInfo);
40971 
40972   }
40973   return NULL;
40974 }
40975 
40976 
_wrap_new_GDALDEMProcessingOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)40977 SWIGINTERN PyObject *_wrap_new_GDALDEMProcessingOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
40978   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
40979   char **arg1 = (char **) 0 ;
40980   PyObject * obj0 = 0 ;
40981   GDALDEMProcessingOptions *result = 0 ;
40982 
40983   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALDEMProcessingOptions",&obj0)) SWIG_fail;
40984   {
40985     /* %typemap(in) char **options */
40986     int bErr = FALSE;
40987     arg1 = CSLFromPySequence(obj0, &bErr);
40988     if( bErr )
40989     {
40990       SWIG_fail;
40991     }
40992   }
40993   {
40994     if ( bUseExceptions ) {
40995       ClearErrorState();
40996     }
40997     {
40998       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
40999       result = (GDALDEMProcessingOptions *)new_GDALDEMProcessingOptions(arg1);
41000       SWIG_PYTHON_THREAD_END_ALLOW;
41001     }
41002 #ifndef SED_HACKS
41003     if ( bUseExceptions ) {
41004       CPLErr eclass = CPLGetLastErrorType();
41005       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41006         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41007       }
41008     }
41009 #endif
41010   }
41011   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDEMProcessingOptions, SWIG_POINTER_NEW |  0 );
41012   {
41013     /* %typemap(freearg) char **options */
41014     CSLDestroy( arg1 );
41015   }
41016   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41017   return resultobj;
41018 fail:
41019   {
41020     /* %typemap(freearg) char **options */
41021     CSLDestroy( arg1 );
41022   }
41023   return NULL;
41024 }
41025 
41026 
_wrap_delete_GDALDEMProcessingOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41027 SWIGINTERN PyObject *_wrap_delete_GDALDEMProcessingOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41028   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41029   GDALDEMProcessingOptions *arg1 = (GDALDEMProcessingOptions *) 0 ;
41030   void *argp1 = 0 ;
41031   int res1 = 0 ;
41032   PyObject * obj0 = 0 ;
41033 
41034   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALDEMProcessingOptions",&obj0)) SWIG_fail;
41035   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDEMProcessingOptions, SWIG_POINTER_DISOWN |  0 );
41036   if (!SWIG_IsOK(res1)) {
41037     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALDEMProcessingOptions" "', argument " "1"" of type '" "GDALDEMProcessingOptions *""'");
41038   }
41039   arg1 = reinterpret_cast< GDALDEMProcessingOptions * >(argp1);
41040   {
41041     if ( bUseExceptions ) {
41042       ClearErrorState();
41043     }
41044     {
41045       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41046       delete_GDALDEMProcessingOptions(arg1);
41047       SWIG_PYTHON_THREAD_END_ALLOW;
41048     }
41049 #ifndef SED_HACKS
41050     if ( bUseExceptions ) {
41051       CPLErr eclass = CPLGetLastErrorType();
41052       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41053         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41054       }
41055     }
41056 #endif
41057   }
41058   resultobj = SWIG_Py_Void();
41059   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41060   return resultobj;
41061 fail:
41062   return NULL;
41063 }
41064 
41065 
GDALDEMProcessingOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41066 SWIGINTERN PyObject *GDALDEMProcessingOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41067   PyObject *obj;
41068   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
41069   SWIG_TypeNewClientData(SWIGTYPE_p_GDALDEMProcessingOptions, SWIG_NewClientData(obj));
41070   return SWIG_Py_Void();
41071 }
41072 
_wrap_DEMProcessingInternal(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41073 SWIGINTERN PyObject *_wrap_DEMProcessingInternal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41074   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41075   char *arg1 = (char *) 0 ;
41076   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
41077   char *arg3 = (char *) 0 ;
41078   char *arg4 = (char *) 0 ;
41079   GDALDEMProcessingOptions *arg5 = (GDALDEMProcessingOptions *) 0 ;
41080   GDALProgressFunc arg6 = (GDALProgressFunc) NULL ;
41081   void *arg7 = (void *) NULL ;
41082   int bToFree1 = 0 ;
41083   void *argp2 = 0 ;
41084   int res2 = 0 ;
41085   int res3 ;
41086   char *buf3 = 0 ;
41087   int alloc3 = 0 ;
41088   int res4 ;
41089   char *buf4 = 0 ;
41090   int alloc4 = 0 ;
41091   void *argp5 = 0 ;
41092   int res5 = 0 ;
41093   PyObject * obj0 = 0 ;
41094   PyObject * obj1 = 0 ;
41095   PyObject * obj2 = 0 ;
41096   PyObject * obj3 = 0 ;
41097   PyObject * obj4 = 0 ;
41098   PyObject * obj5 = 0 ;
41099   PyObject * obj6 = 0 ;
41100   GDALDatasetShadow *result = 0 ;
41101 
41102   /* %typemap(arginit) ( const char* callback_data=NULL)  */
41103   PyProgressData *psProgressInfo;
41104   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
41105   psProgressInfo->nLastReported = -1;
41106   psProgressInfo->psPyCallback = NULL;
41107   psProgressInfo->psPyCallbackData = NULL;
41108   arg7 = psProgressInfo;
41109   if (!PyArg_ParseTuple(args,(char *)"OOOOO|OO:DEMProcessingInternal",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
41110   {
41111     /* %typemap(in) (const char *utf8_path) */
41112     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
41113     if (arg1 == NULL)
41114     {
41115       PyErr_SetString( PyExc_RuntimeError, "not a string" );
41116       SWIG_fail;
41117     }
41118   }
41119   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
41120   if (!SWIG_IsOK(res2)) {
41121     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DEMProcessingInternal" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
41122   }
41123   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
41124   res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
41125   if (!SWIG_IsOK(res3)) {
41126     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DEMProcessingInternal" "', argument " "3"" of type '" "char const *""'");
41127   }
41128   arg3 = reinterpret_cast< char * >(buf3);
41129   res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
41130   if (!SWIG_IsOK(res4)) {
41131     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DEMProcessingInternal" "', argument " "4"" of type '" "char const *""'");
41132   }
41133   arg4 = reinterpret_cast< char * >(buf4);
41134   res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_GDALDEMProcessingOptions, 0 |  0 );
41135   if (!SWIG_IsOK(res5)) {
41136     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "DEMProcessingInternal" "', argument " "5"" of type '" "GDALDEMProcessingOptions *""'");
41137   }
41138   arg5 = reinterpret_cast< GDALDEMProcessingOptions * >(argp5);
41139   if (obj5) {
41140     {
41141       /* %typemap(in) (GDALProgressFunc callback = NULL) */
41142       /* callback_func typemap */
41143 
41144       /* In some cases 0 is passed instead of None. */
41145       /* See https://github.com/OSGeo/gdal/pull/219 */
41146       if ( PyLong_Check(obj5) || PyInt_Check(obj5) )
41147       {
41148         if( PyLong_AsLong(obj5) == 0 )
41149         {
41150           obj5 = Py_None;
41151         }
41152       }
41153 
41154       if (obj5 && obj5 != Py_None ) {
41155         void* cbfunction = NULL;
41156         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj5,
41157             (void**)&cbfunction,
41158             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
41159             SWIG_POINTER_EXCEPTION | 0 ));
41160 
41161         if ( cbfunction == GDALTermProgress ) {
41162           arg6 = GDALTermProgress;
41163         } else {
41164           if (!PyCallable_Check(obj5)) {
41165             PyErr_SetString( PyExc_RuntimeError,
41166               "Object given is not a Python function" );
41167             SWIG_fail;
41168           }
41169           psProgressInfo->psPyCallback = obj5;
41170           arg6 = PyProgressProxy;
41171         }
41172 
41173       }
41174 
41175     }
41176   }
41177   if (obj6) {
41178     {
41179       /* %typemap(in) ( void* callback_data=NULL)  */
41180       psProgressInfo->psPyCallbackData = obj6 ;
41181     }
41182   }
41183   {
41184     if (!arg1) {
41185       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
41186     }
41187   }
41188   {
41189     if (!arg2) {
41190       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
41191     }
41192   }
41193   {
41194     if (!arg3) {
41195       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
41196     }
41197   }
41198   {
41199     if ( bUseExceptions ) {
41200       ClearErrorState();
41201     }
41202     {
41203       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41204       result = (GDALDatasetShadow *)wrapper_GDALDEMProcessing((char const *)arg1,arg2,(char const *)arg3,(char const *)arg4,arg5,arg6,arg7);
41205       SWIG_PYTHON_THREAD_END_ALLOW;
41206     }
41207 #ifndef SED_HACKS
41208     if ( bUseExceptions ) {
41209       CPLErr eclass = CPLGetLastErrorType();
41210       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41211         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41212       }
41213     }
41214 #endif
41215   }
41216   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
41217   {
41218     /* %typemap(freearg) (const char *utf8_path) */
41219     GDALPythonFreeCStr(arg1, bToFree1);
41220   }
41221   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
41222   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
41223   {
41224     /* %typemap(freearg) ( void* callback_data=NULL)  */
41225 
41226     CPLFree(psProgressInfo);
41227 
41228   }
41229   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41230   return resultobj;
41231 fail:
41232   {
41233     /* %typemap(freearg) (const char *utf8_path) */
41234     GDALPythonFreeCStr(arg1, bToFree1);
41235   }
41236   if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
41237   if (alloc4 == SWIG_NEWOBJ) delete[] buf4;
41238   {
41239     /* %typemap(freearg) ( void* callback_data=NULL)  */
41240 
41241     CPLFree(psProgressInfo);
41242 
41243   }
41244   return NULL;
41245 }
41246 
41247 
_wrap_new_GDALNearblackOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41248 SWIGINTERN PyObject *_wrap_new_GDALNearblackOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41249   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41250   char **arg1 = (char **) 0 ;
41251   PyObject * obj0 = 0 ;
41252   GDALNearblackOptions *result = 0 ;
41253 
41254   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALNearblackOptions",&obj0)) SWIG_fail;
41255   {
41256     /* %typemap(in) char **options */
41257     int bErr = FALSE;
41258     arg1 = CSLFromPySequence(obj0, &bErr);
41259     if( bErr )
41260     {
41261       SWIG_fail;
41262     }
41263   }
41264   {
41265     if ( bUseExceptions ) {
41266       ClearErrorState();
41267     }
41268     {
41269       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41270       result = (GDALNearblackOptions *)new_GDALNearblackOptions(arg1);
41271       SWIG_PYTHON_THREAD_END_ALLOW;
41272     }
41273 #ifndef SED_HACKS
41274     if ( bUseExceptions ) {
41275       CPLErr eclass = CPLGetLastErrorType();
41276       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41277         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41278       }
41279     }
41280 #endif
41281   }
41282   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALNearblackOptions, SWIG_POINTER_NEW |  0 );
41283   {
41284     /* %typemap(freearg) char **options */
41285     CSLDestroy( arg1 );
41286   }
41287   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41288   return resultobj;
41289 fail:
41290   {
41291     /* %typemap(freearg) char **options */
41292     CSLDestroy( arg1 );
41293   }
41294   return NULL;
41295 }
41296 
41297 
_wrap_delete_GDALNearblackOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41298 SWIGINTERN PyObject *_wrap_delete_GDALNearblackOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41299   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41300   GDALNearblackOptions *arg1 = (GDALNearblackOptions *) 0 ;
41301   void *argp1 = 0 ;
41302   int res1 = 0 ;
41303   PyObject * obj0 = 0 ;
41304 
41305   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALNearblackOptions",&obj0)) SWIG_fail;
41306   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALNearblackOptions, SWIG_POINTER_DISOWN |  0 );
41307   if (!SWIG_IsOK(res1)) {
41308     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALNearblackOptions" "', argument " "1"" of type '" "GDALNearblackOptions *""'");
41309   }
41310   arg1 = reinterpret_cast< GDALNearblackOptions * >(argp1);
41311   {
41312     if ( bUseExceptions ) {
41313       ClearErrorState();
41314     }
41315     {
41316       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41317       delete_GDALNearblackOptions(arg1);
41318       SWIG_PYTHON_THREAD_END_ALLOW;
41319     }
41320 #ifndef SED_HACKS
41321     if ( bUseExceptions ) {
41322       CPLErr eclass = CPLGetLastErrorType();
41323       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41324         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41325       }
41326     }
41327 #endif
41328   }
41329   resultobj = SWIG_Py_Void();
41330   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41331   return resultobj;
41332 fail:
41333   return NULL;
41334 }
41335 
41336 
GDALNearblackOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41337 SWIGINTERN PyObject *GDALNearblackOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41338   PyObject *obj;
41339   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
41340   SWIG_TypeNewClientData(SWIGTYPE_p_GDALNearblackOptions, SWIG_NewClientData(obj));
41341   return SWIG_Py_Void();
41342 }
41343 
_wrap_wrapper_GDALNearblackDestDS(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41344 SWIGINTERN PyObject *_wrap_wrapper_GDALNearblackDestDS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41345   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41346   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
41347   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
41348   GDALNearblackOptions *arg3 = (GDALNearblackOptions *) 0 ;
41349   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
41350   void *arg5 = (void *) NULL ;
41351   void *argp1 = 0 ;
41352   int res1 = 0 ;
41353   void *argp2 = 0 ;
41354   int res2 = 0 ;
41355   void *argp3 = 0 ;
41356   int res3 = 0 ;
41357   PyObject * obj0 = 0 ;
41358   PyObject * obj1 = 0 ;
41359   PyObject * obj2 = 0 ;
41360   PyObject * obj3 = 0 ;
41361   PyObject * obj4 = 0 ;
41362   int result;
41363 
41364   /* %typemap(arginit) ( const char* callback_data=NULL)  */
41365   PyProgressData *psProgressInfo;
41366   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
41367   psProgressInfo->nLastReported = -1;
41368   psProgressInfo->psPyCallback = NULL;
41369   psProgressInfo->psPyCallbackData = NULL;
41370   arg5 = psProgressInfo;
41371   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALNearblackDestDS",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
41372   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
41373   if (!SWIG_IsOK(res1)) {
41374     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrapper_GDALNearblackDestDS" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
41375   }
41376   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
41377   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
41378   if (!SWIG_IsOK(res2)) {
41379     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "wrapper_GDALNearblackDestDS" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
41380   }
41381   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
41382   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALNearblackOptions, 0 |  0 );
41383   if (!SWIG_IsOK(res3)) {
41384     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALNearblackDestDS" "', argument " "3"" of type '" "GDALNearblackOptions *""'");
41385   }
41386   arg3 = reinterpret_cast< GDALNearblackOptions * >(argp3);
41387   if (obj3) {
41388     {
41389       /* %typemap(in) (GDALProgressFunc callback = NULL) */
41390       /* callback_func typemap */
41391 
41392       /* In some cases 0 is passed instead of None. */
41393       /* See https://github.com/OSGeo/gdal/pull/219 */
41394       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
41395       {
41396         if( PyLong_AsLong(obj3) == 0 )
41397         {
41398           obj3 = Py_None;
41399         }
41400       }
41401 
41402       if (obj3 && obj3 != Py_None ) {
41403         void* cbfunction = NULL;
41404         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
41405             (void**)&cbfunction,
41406             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
41407             SWIG_POINTER_EXCEPTION | 0 ));
41408 
41409         if ( cbfunction == GDALTermProgress ) {
41410           arg4 = GDALTermProgress;
41411         } else {
41412           if (!PyCallable_Check(obj3)) {
41413             PyErr_SetString( PyExc_RuntimeError,
41414               "Object given is not a Python function" );
41415             SWIG_fail;
41416           }
41417           psProgressInfo->psPyCallback = obj3;
41418           arg4 = PyProgressProxy;
41419         }
41420 
41421       }
41422 
41423     }
41424   }
41425   if (obj4) {
41426     {
41427       /* %typemap(in) ( void* callback_data=NULL)  */
41428       psProgressInfo->psPyCallbackData = obj4 ;
41429     }
41430   }
41431   {
41432     if ( bUseExceptions ) {
41433       ClearErrorState();
41434     }
41435     {
41436       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41437       result = (int)wrapper_GDALNearblackDestDS(arg1,arg2,arg3,arg4,arg5);
41438       SWIG_PYTHON_THREAD_END_ALLOW;
41439     }
41440 #ifndef SED_HACKS
41441     if ( bUseExceptions ) {
41442       CPLErr eclass = CPLGetLastErrorType();
41443       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41444         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41445       }
41446     }
41447 #endif
41448   }
41449   resultobj = SWIG_From_int(static_cast< int >(result));
41450   {
41451     /* %typemap(freearg) ( void* callback_data=NULL)  */
41452 
41453     CPLFree(psProgressInfo);
41454 
41455   }
41456   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41457   return resultobj;
41458 fail:
41459   {
41460     /* %typemap(freearg) ( void* callback_data=NULL)  */
41461 
41462     CPLFree(psProgressInfo);
41463 
41464   }
41465   return NULL;
41466 }
41467 
41468 
_wrap_wrapper_GDALNearblackDestName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41469 SWIGINTERN PyObject *_wrap_wrapper_GDALNearblackDestName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41470   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41471   char *arg1 = (char *) 0 ;
41472   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
41473   GDALNearblackOptions *arg3 = (GDALNearblackOptions *) 0 ;
41474   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
41475   void *arg5 = (void *) NULL ;
41476   int bToFree1 = 0 ;
41477   void *argp2 = 0 ;
41478   int res2 = 0 ;
41479   void *argp3 = 0 ;
41480   int res3 = 0 ;
41481   PyObject * obj0 = 0 ;
41482   PyObject * obj1 = 0 ;
41483   PyObject * obj2 = 0 ;
41484   PyObject * obj3 = 0 ;
41485   PyObject * obj4 = 0 ;
41486   GDALDatasetShadow *result = 0 ;
41487 
41488   /* %typemap(arginit) ( const char* callback_data=NULL)  */
41489   PyProgressData *psProgressInfo;
41490   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
41491   psProgressInfo->nLastReported = -1;
41492   psProgressInfo->psPyCallback = NULL;
41493   psProgressInfo->psPyCallbackData = NULL;
41494   arg5 = psProgressInfo;
41495   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALNearblackDestName",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
41496   {
41497     /* %typemap(in) (const char *utf8_path) */
41498     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
41499     if (arg1 == NULL)
41500     {
41501       PyErr_SetString( PyExc_RuntimeError, "not a string" );
41502       SWIG_fail;
41503     }
41504   }
41505   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
41506   if (!SWIG_IsOK(res2)) {
41507     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "wrapper_GDALNearblackDestName" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
41508   }
41509   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
41510   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALNearblackOptions, 0 |  0 );
41511   if (!SWIG_IsOK(res3)) {
41512     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALNearblackDestName" "', argument " "3"" of type '" "GDALNearblackOptions *""'");
41513   }
41514   arg3 = reinterpret_cast< GDALNearblackOptions * >(argp3);
41515   if (obj3) {
41516     {
41517       /* %typemap(in) (GDALProgressFunc callback = NULL) */
41518       /* callback_func typemap */
41519 
41520       /* In some cases 0 is passed instead of None. */
41521       /* See https://github.com/OSGeo/gdal/pull/219 */
41522       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
41523       {
41524         if( PyLong_AsLong(obj3) == 0 )
41525         {
41526           obj3 = Py_None;
41527         }
41528       }
41529 
41530       if (obj3 && obj3 != Py_None ) {
41531         void* cbfunction = NULL;
41532         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
41533             (void**)&cbfunction,
41534             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
41535             SWIG_POINTER_EXCEPTION | 0 ));
41536 
41537         if ( cbfunction == GDALTermProgress ) {
41538           arg4 = GDALTermProgress;
41539         } else {
41540           if (!PyCallable_Check(obj3)) {
41541             PyErr_SetString( PyExc_RuntimeError,
41542               "Object given is not a Python function" );
41543             SWIG_fail;
41544           }
41545           psProgressInfo->psPyCallback = obj3;
41546           arg4 = PyProgressProxy;
41547         }
41548 
41549       }
41550 
41551     }
41552   }
41553   if (obj4) {
41554     {
41555       /* %typemap(in) ( void* callback_data=NULL)  */
41556       psProgressInfo->psPyCallbackData = obj4 ;
41557     }
41558   }
41559   {
41560     if (!arg1) {
41561       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
41562     }
41563   }
41564   {
41565     if ( bUseExceptions ) {
41566       ClearErrorState();
41567     }
41568     {
41569       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41570       result = (GDALDatasetShadow *)wrapper_GDALNearblackDestName((char const *)arg1,arg2,arg3,arg4,arg5);
41571       SWIG_PYTHON_THREAD_END_ALLOW;
41572     }
41573 #ifndef SED_HACKS
41574     if ( bUseExceptions ) {
41575       CPLErr eclass = CPLGetLastErrorType();
41576       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41577         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41578       }
41579     }
41580 #endif
41581   }
41582   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
41583   {
41584     /* %typemap(freearg) (const char *utf8_path) */
41585     GDALPythonFreeCStr(arg1, bToFree1);
41586   }
41587   {
41588     /* %typemap(freearg) ( void* callback_data=NULL)  */
41589 
41590     CPLFree(psProgressInfo);
41591 
41592   }
41593   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41594   return resultobj;
41595 fail:
41596   {
41597     /* %typemap(freearg) (const char *utf8_path) */
41598     GDALPythonFreeCStr(arg1, bToFree1);
41599   }
41600   {
41601     /* %typemap(freearg) ( void* callback_data=NULL)  */
41602 
41603     CPLFree(psProgressInfo);
41604 
41605   }
41606   return NULL;
41607 }
41608 
41609 
_wrap_new_GDALGridOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41610 SWIGINTERN PyObject *_wrap_new_GDALGridOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41611   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41612   char **arg1 = (char **) 0 ;
41613   PyObject * obj0 = 0 ;
41614   GDALGridOptions *result = 0 ;
41615 
41616   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALGridOptions",&obj0)) SWIG_fail;
41617   {
41618     /* %typemap(in) char **options */
41619     int bErr = FALSE;
41620     arg1 = CSLFromPySequence(obj0, &bErr);
41621     if( bErr )
41622     {
41623       SWIG_fail;
41624     }
41625   }
41626   {
41627     if ( bUseExceptions ) {
41628       ClearErrorState();
41629     }
41630     {
41631       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41632       result = (GDALGridOptions *)new_GDALGridOptions(arg1);
41633       SWIG_PYTHON_THREAD_END_ALLOW;
41634     }
41635 #ifndef SED_HACKS
41636     if ( bUseExceptions ) {
41637       CPLErr eclass = CPLGetLastErrorType();
41638       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41639         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41640       }
41641     }
41642 #endif
41643   }
41644   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALGridOptions, SWIG_POINTER_NEW |  0 );
41645   {
41646     /* %typemap(freearg) char **options */
41647     CSLDestroy( arg1 );
41648   }
41649   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41650   return resultobj;
41651 fail:
41652   {
41653     /* %typemap(freearg) char **options */
41654     CSLDestroy( arg1 );
41655   }
41656   return NULL;
41657 }
41658 
41659 
_wrap_delete_GDALGridOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41660 SWIGINTERN PyObject *_wrap_delete_GDALGridOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41661   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41662   GDALGridOptions *arg1 = (GDALGridOptions *) 0 ;
41663   void *argp1 = 0 ;
41664   int res1 = 0 ;
41665   PyObject * obj0 = 0 ;
41666 
41667   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALGridOptions",&obj0)) SWIG_fail;
41668   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALGridOptions, SWIG_POINTER_DISOWN |  0 );
41669   if (!SWIG_IsOK(res1)) {
41670     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALGridOptions" "', argument " "1"" of type '" "GDALGridOptions *""'");
41671   }
41672   arg1 = reinterpret_cast< GDALGridOptions * >(argp1);
41673   {
41674     if ( bUseExceptions ) {
41675       ClearErrorState();
41676     }
41677     {
41678       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41679       delete_GDALGridOptions(arg1);
41680       SWIG_PYTHON_THREAD_END_ALLOW;
41681     }
41682 #ifndef SED_HACKS
41683     if ( bUseExceptions ) {
41684       CPLErr eclass = CPLGetLastErrorType();
41685       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41686         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41687       }
41688     }
41689 #endif
41690   }
41691   resultobj = SWIG_Py_Void();
41692   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41693   return resultobj;
41694 fail:
41695   return NULL;
41696 }
41697 
41698 
GDALGridOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41699 SWIGINTERN PyObject *GDALGridOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41700   PyObject *obj;
41701   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
41702   SWIG_TypeNewClientData(SWIGTYPE_p_GDALGridOptions, SWIG_NewClientData(obj));
41703   return SWIG_Py_Void();
41704 }
41705 
_wrap_GridInternal(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41706 SWIGINTERN PyObject *_wrap_GridInternal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41707   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41708   char *arg1 = (char *) 0 ;
41709   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
41710   GDALGridOptions *arg3 = (GDALGridOptions *) 0 ;
41711   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
41712   void *arg5 = (void *) NULL ;
41713   int bToFree1 = 0 ;
41714   void *argp2 = 0 ;
41715   int res2 = 0 ;
41716   void *argp3 = 0 ;
41717   int res3 = 0 ;
41718   PyObject * obj0 = 0 ;
41719   PyObject * obj1 = 0 ;
41720   PyObject * obj2 = 0 ;
41721   PyObject * obj3 = 0 ;
41722   PyObject * obj4 = 0 ;
41723   GDALDatasetShadow *result = 0 ;
41724 
41725   /* %typemap(arginit) ( const char* callback_data=NULL)  */
41726   PyProgressData *psProgressInfo;
41727   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
41728   psProgressInfo->nLastReported = -1;
41729   psProgressInfo->psPyCallback = NULL;
41730   psProgressInfo->psPyCallbackData = NULL;
41731   arg5 = psProgressInfo;
41732   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:GridInternal",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
41733   {
41734     /* %typemap(in) (const char *utf8_path) */
41735     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
41736     if (arg1 == NULL)
41737     {
41738       PyErr_SetString( PyExc_RuntimeError, "not a string" );
41739       SWIG_fail;
41740     }
41741   }
41742   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
41743   if (!SWIG_IsOK(res2)) {
41744     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GridInternal" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
41745   }
41746   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
41747   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALGridOptions, 0 |  0 );
41748   if (!SWIG_IsOK(res3)) {
41749     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GridInternal" "', argument " "3"" of type '" "GDALGridOptions *""'");
41750   }
41751   arg3 = reinterpret_cast< GDALGridOptions * >(argp3);
41752   if (obj3) {
41753     {
41754       /* %typemap(in) (GDALProgressFunc callback = NULL) */
41755       /* callback_func typemap */
41756 
41757       /* In some cases 0 is passed instead of None. */
41758       /* See https://github.com/OSGeo/gdal/pull/219 */
41759       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
41760       {
41761         if( PyLong_AsLong(obj3) == 0 )
41762         {
41763           obj3 = Py_None;
41764         }
41765       }
41766 
41767       if (obj3 && obj3 != Py_None ) {
41768         void* cbfunction = NULL;
41769         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
41770             (void**)&cbfunction,
41771             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
41772             SWIG_POINTER_EXCEPTION | 0 ));
41773 
41774         if ( cbfunction == GDALTermProgress ) {
41775           arg4 = GDALTermProgress;
41776         } else {
41777           if (!PyCallable_Check(obj3)) {
41778             PyErr_SetString( PyExc_RuntimeError,
41779               "Object given is not a Python function" );
41780             SWIG_fail;
41781           }
41782           psProgressInfo->psPyCallback = obj3;
41783           arg4 = PyProgressProxy;
41784         }
41785 
41786       }
41787 
41788     }
41789   }
41790   if (obj4) {
41791     {
41792       /* %typemap(in) ( void* callback_data=NULL)  */
41793       psProgressInfo->psPyCallbackData = obj4 ;
41794     }
41795   }
41796   {
41797     if (!arg1) {
41798       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
41799     }
41800   }
41801   {
41802     if (!arg2) {
41803       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
41804     }
41805   }
41806   {
41807     if ( bUseExceptions ) {
41808       ClearErrorState();
41809     }
41810     {
41811       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41812       result = (GDALDatasetShadow *)wrapper_GDALGrid((char const *)arg1,arg2,arg3,arg4,arg5);
41813       SWIG_PYTHON_THREAD_END_ALLOW;
41814     }
41815 #ifndef SED_HACKS
41816     if ( bUseExceptions ) {
41817       CPLErr eclass = CPLGetLastErrorType();
41818       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41819         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41820       }
41821     }
41822 #endif
41823   }
41824   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
41825   {
41826     /* %typemap(freearg) (const char *utf8_path) */
41827     GDALPythonFreeCStr(arg1, bToFree1);
41828   }
41829   {
41830     /* %typemap(freearg) ( void* callback_data=NULL)  */
41831 
41832     CPLFree(psProgressInfo);
41833 
41834   }
41835   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41836   return resultobj;
41837 fail:
41838   {
41839     /* %typemap(freearg) (const char *utf8_path) */
41840     GDALPythonFreeCStr(arg1, bToFree1);
41841   }
41842   {
41843     /* %typemap(freearg) ( void* callback_data=NULL)  */
41844 
41845     CPLFree(psProgressInfo);
41846 
41847   }
41848   return NULL;
41849 }
41850 
41851 
_wrap_new_GDALRasterizeOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41852 SWIGINTERN PyObject *_wrap_new_GDALRasterizeOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41853   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41854   char **arg1 = (char **) 0 ;
41855   PyObject * obj0 = 0 ;
41856   GDALRasterizeOptions *result = 0 ;
41857 
41858   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALRasterizeOptions",&obj0)) SWIG_fail;
41859   {
41860     /* %typemap(in) char **options */
41861     int bErr = FALSE;
41862     arg1 = CSLFromPySequence(obj0, &bErr);
41863     if( bErr )
41864     {
41865       SWIG_fail;
41866     }
41867   }
41868   {
41869     if ( bUseExceptions ) {
41870       ClearErrorState();
41871     }
41872     {
41873       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41874       result = (GDALRasterizeOptions *)new_GDALRasterizeOptions(arg1);
41875       SWIG_PYTHON_THREAD_END_ALLOW;
41876     }
41877 #ifndef SED_HACKS
41878     if ( bUseExceptions ) {
41879       CPLErr eclass = CPLGetLastErrorType();
41880       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41881         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41882       }
41883     }
41884 #endif
41885   }
41886   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALRasterizeOptions, SWIG_POINTER_NEW |  0 );
41887   {
41888     /* %typemap(freearg) char **options */
41889     CSLDestroy( arg1 );
41890   }
41891   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41892   return resultobj;
41893 fail:
41894   {
41895     /* %typemap(freearg) char **options */
41896     CSLDestroy( arg1 );
41897   }
41898   return NULL;
41899 }
41900 
41901 
_wrap_delete_GDALRasterizeOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41902 SWIGINTERN PyObject *_wrap_delete_GDALRasterizeOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41903   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41904   GDALRasterizeOptions *arg1 = (GDALRasterizeOptions *) 0 ;
41905   void *argp1 = 0 ;
41906   int res1 = 0 ;
41907   PyObject * obj0 = 0 ;
41908 
41909   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALRasterizeOptions",&obj0)) SWIG_fail;
41910   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALRasterizeOptions, SWIG_POINTER_DISOWN |  0 );
41911   if (!SWIG_IsOK(res1)) {
41912     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALRasterizeOptions" "', argument " "1"" of type '" "GDALRasterizeOptions *""'");
41913   }
41914   arg1 = reinterpret_cast< GDALRasterizeOptions * >(argp1);
41915   {
41916     if ( bUseExceptions ) {
41917       ClearErrorState();
41918     }
41919     {
41920       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
41921       delete_GDALRasterizeOptions(arg1);
41922       SWIG_PYTHON_THREAD_END_ALLOW;
41923     }
41924 #ifndef SED_HACKS
41925     if ( bUseExceptions ) {
41926       CPLErr eclass = CPLGetLastErrorType();
41927       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
41928         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
41929       }
41930     }
41931 #endif
41932   }
41933   resultobj = SWIG_Py_Void();
41934   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
41935   return resultobj;
41936 fail:
41937   return NULL;
41938 }
41939 
41940 
GDALRasterizeOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41941 SWIGINTERN PyObject *GDALRasterizeOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41942   PyObject *obj;
41943   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
41944   SWIG_TypeNewClientData(SWIGTYPE_p_GDALRasterizeOptions, SWIG_NewClientData(obj));
41945   return SWIG_Py_Void();
41946 }
41947 
_wrap_wrapper_GDALRasterizeDestDS(PyObject * SWIGUNUSEDPARM (self),PyObject * args)41948 SWIGINTERN PyObject *_wrap_wrapper_GDALRasterizeDestDS(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
41949   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
41950   GDALDatasetShadow *arg1 = (GDALDatasetShadow *) 0 ;
41951   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
41952   GDALRasterizeOptions *arg3 = (GDALRasterizeOptions *) 0 ;
41953   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
41954   void *arg5 = (void *) NULL ;
41955   void *argp1 = 0 ;
41956   int res1 = 0 ;
41957   void *argp2 = 0 ;
41958   int res2 = 0 ;
41959   void *argp3 = 0 ;
41960   int res3 = 0 ;
41961   PyObject * obj0 = 0 ;
41962   PyObject * obj1 = 0 ;
41963   PyObject * obj2 = 0 ;
41964   PyObject * obj3 = 0 ;
41965   PyObject * obj4 = 0 ;
41966   int result;
41967 
41968   /* %typemap(arginit) ( const char* callback_data=NULL)  */
41969   PyProgressData *psProgressInfo;
41970   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
41971   psProgressInfo->nLastReported = -1;
41972   psProgressInfo->psPyCallback = NULL;
41973   psProgressInfo->psPyCallbackData = NULL;
41974   arg5 = psProgressInfo;
41975   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALRasterizeDestDS",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
41976   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
41977   if (!SWIG_IsOK(res1)) {
41978     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wrapper_GDALRasterizeDestDS" "', argument " "1"" of type '" "GDALDatasetShadow *""'");
41979   }
41980   arg1 = reinterpret_cast< GDALDatasetShadow * >(argp1);
41981   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
41982   if (!SWIG_IsOK(res2)) {
41983     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "wrapper_GDALRasterizeDestDS" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
41984   }
41985   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
41986   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALRasterizeOptions, 0 |  0 );
41987   if (!SWIG_IsOK(res3)) {
41988     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALRasterizeDestDS" "', argument " "3"" of type '" "GDALRasterizeOptions *""'");
41989   }
41990   arg3 = reinterpret_cast< GDALRasterizeOptions * >(argp3);
41991   if (obj3) {
41992     {
41993       /* %typemap(in) (GDALProgressFunc callback = NULL) */
41994       /* callback_func typemap */
41995 
41996       /* In some cases 0 is passed instead of None. */
41997       /* See https://github.com/OSGeo/gdal/pull/219 */
41998       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
41999       {
42000         if( PyLong_AsLong(obj3) == 0 )
42001         {
42002           obj3 = Py_None;
42003         }
42004       }
42005 
42006       if (obj3 && obj3 != Py_None ) {
42007         void* cbfunction = NULL;
42008         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
42009             (void**)&cbfunction,
42010             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
42011             SWIG_POINTER_EXCEPTION | 0 ));
42012 
42013         if ( cbfunction == GDALTermProgress ) {
42014           arg4 = GDALTermProgress;
42015         } else {
42016           if (!PyCallable_Check(obj3)) {
42017             PyErr_SetString( PyExc_RuntimeError,
42018               "Object given is not a Python function" );
42019             SWIG_fail;
42020           }
42021           psProgressInfo->psPyCallback = obj3;
42022           arg4 = PyProgressProxy;
42023         }
42024 
42025       }
42026 
42027     }
42028   }
42029   if (obj4) {
42030     {
42031       /* %typemap(in) ( void* callback_data=NULL)  */
42032       psProgressInfo->psPyCallbackData = obj4 ;
42033     }
42034   }
42035   {
42036     if ( bUseExceptions ) {
42037       ClearErrorState();
42038     }
42039     {
42040       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42041       result = (int)wrapper_GDALRasterizeDestDS(arg1,arg2,arg3,arg4,arg5);
42042       SWIG_PYTHON_THREAD_END_ALLOW;
42043     }
42044 #ifndef SED_HACKS
42045     if ( bUseExceptions ) {
42046       CPLErr eclass = CPLGetLastErrorType();
42047       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42048         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42049       }
42050     }
42051 #endif
42052   }
42053   resultobj = SWIG_From_int(static_cast< int >(result));
42054   {
42055     /* %typemap(freearg) ( void* callback_data=NULL)  */
42056 
42057     CPLFree(psProgressInfo);
42058 
42059   }
42060   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42061   return resultobj;
42062 fail:
42063   {
42064     /* %typemap(freearg) ( void* callback_data=NULL)  */
42065 
42066     CPLFree(psProgressInfo);
42067 
42068   }
42069   return NULL;
42070 }
42071 
42072 
_wrap_wrapper_GDALRasterizeDestName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42073 SWIGINTERN PyObject *_wrap_wrapper_GDALRasterizeDestName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42074   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42075   char *arg1 = (char *) 0 ;
42076   GDALDatasetShadow *arg2 = (GDALDatasetShadow *) 0 ;
42077   GDALRasterizeOptions *arg3 = (GDALRasterizeOptions *) 0 ;
42078   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
42079   void *arg5 = (void *) NULL ;
42080   int bToFree1 = 0 ;
42081   void *argp2 = 0 ;
42082   int res2 = 0 ;
42083   void *argp3 = 0 ;
42084   int res3 = 0 ;
42085   PyObject * obj0 = 0 ;
42086   PyObject * obj1 = 0 ;
42087   PyObject * obj2 = 0 ;
42088   PyObject * obj3 = 0 ;
42089   PyObject * obj4 = 0 ;
42090   GDALDatasetShadow *result = 0 ;
42091 
42092   /* %typemap(arginit) ( const char* callback_data=NULL)  */
42093   PyProgressData *psProgressInfo;
42094   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
42095   psProgressInfo->nLastReported = -1;
42096   psProgressInfo->psPyCallback = NULL;
42097   psProgressInfo->psPyCallbackData = NULL;
42098   arg5 = psProgressInfo;
42099   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALRasterizeDestName",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
42100   {
42101     /* %typemap(in) (const char *utf8_path) */
42102     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
42103     if (arg1 == NULL)
42104     {
42105       PyErr_SetString( PyExc_RuntimeError, "not a string" );
42106       SWIG_fail;
42107     }
42108   }
42109   res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GDALDatasetShadow, 0 |  0 );
42110   if (!SWIG_IsOK(res2)) {
42111     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "wrapper_GDALRasterizeDestName" "', argument " "2"" of type '" "GDALDatasetShadow *""'");
42112   }
42113   arg2 = reinterpret_cast< GDALDatasetShadow * >(argp2);
42114   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALRasterizeOptions, 0 |  0 );
42115   if (!SWIG_IsOK(res3)) {
42116     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "wrapper_GDALRasterizeDestName" "', argument " "3"" of type '" "GDALRasterizeOptions *""'");
42117   }
42118   arg3 = reinterpret_cast< GDALRasterizeOptions * >(argp3);
42119   if (obj3) {
42120     {
42121       /* %typemap(in) (GDALProgressFunc callback = NULL) */
42122       /* callback_func typemap */
42123 
42124       /* In some cases 0 is passed instead of None. */
42125       /* See https://github.com/OSGeo/gdal/pull/219 */
42126       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
42127       {
42128         if( PyLong_AsLong(obj3) == 0 )
42129         {
42130           obj3 = Py_None;
42131         }
42132       }
42133 
42134       if (obj3 && obj3 != Py_None ) {
42135         void* cbfunction = NULL;
42136         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
42137             (void**)&cbfunction,
42138             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
42139             SWIG_POINTER_EXCEPTION | 0 ));
42140 
42141         if ( cbfunction == GDALTermProgress ) {
42142           arg4 = GDALTermProgress;
42143         } else {
42144           if (!PyCallable_Check(obj3)) {
42145             PyErr_SetString( PyExc_RuntimeError,
42146               "Object given is not a Python function" );
42147             SWIG_fail;
42148           }
42149           psProgressInfo->psPyCallback = obj3;
42150           arg4 = PyProgressProxy;
42151         }
42152 
42153       }
42154 
42155     }
42156   }
42157   if (obj4) {
42158     {
42159       /* %typemap(in) ( void* callback_data=NULL)  */
42160       psProgressInfo->psPyCallbackData = obj4 ;
42161     }
42162   }
42163   {
42164     if (!arg1) {
42165       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
42166     }
42167   }
42168   {
42169     if ( bUseExceptions ) {
42170       ClearErrorState();
42171     }
42172     {
42173       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42174       result = (GDALDatasetShadow *)wrapper_GDALRasterizeDestName((char const *)arg1,arg2,arg3,arg4,arg5);
42175       SWIG_PYTHON_THREAD_END_ALLOW;
42176     }
42177 #ifndef SED_HACKS
42178     if ( bUseExceptions ) {
42179       CPLErr eclass = CPLGetLastErrorType();
42180       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42181         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42182       }
42183     }
42184 #endif
42185   }
42186   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
42187   {
42188     /* %typemap(freearg) (const char *utf8_path) */
42189     GDALPythonFreeCStr(arg1, bToFree1);
42190   }
42191   {
42192     /* %typemap(freearg) ( void* callback_data=NULL)  */
42193 
42194     CPLFree(psProgressInfo);
42195 
42196   }
42197   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42198   return resultobj;
42199 fail:
42200   {
42201     /* %typemap(freearg) (const char *utf8_path) */
42202     GDALPythonFreeCStr(arg1, bToFree1);
42203   }
42204   {
42205     /* %typemap(freearg) ( void* callback_data=NULL)  */
42206 
42207     CPLFree(psProgressInfo);
42208 
42209   }
42210   return NULL;
42211 }
42212 
42213 
_wrap_new_GDALBuildVRTOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42214 SWIGINTERN PyObject *_wrap_new_GDALBuildVRTOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42215   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42216   char **arg1 = (char **) 0 ;
42217   PyObject * obj0 = 0 ;
42218   GDALBuildVRTOptions *result = 0 ;
42219 
42220   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALBuildVRTOptions",&obj0)) SWIG_fail;
42221   {
42222     /* %typemap(in) char **options */
42223     int bErr = FALSE;
42224     arg1 = CSLFromPySequence(obj0, &bErr);
42225     if( bErr )
42226     {
42227       SWIG_fail;
42228     }
42229   }
42230   {
42231     if ( bUseExceptions ) {
42232       ClearErrorState();
42233     }
42234     {
42235       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42236       result = (GDALBuildVRTOptions *)new_GDALBuildVRTOptions(arg1);
42237       SWIG_PYTHON_THREAD_END_ALLOW;
42238     }
42239 #ifndef SED_HACKS
42240     if ( bUseExceptions ) {
42241       CPLErr eclass = CPLGetLastErrorType();
42242       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42243         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42244       }
42245     }
42246 #endif
42247   }
42248   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALBuildVRTOptions, SWIG_POINTER_NEW |  0 );
42249   {
42250     /* %typemap(freearg) char **options */
42251     CSLDestroy( arg1 );
42252   }
42253   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42254   return resultobj;
42255 fail:
42256   {
42257     /* %typemap(freearg) char **options */
42258     CSLDestroy( arg1 );
42259   }
42260   return NULL;
42261 }
42262 
42263 
_wrap_delete_GDALBuildVRTOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42264 SWIGINTERN PyObject *_wrap_delete_GDALBuildVRTOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42265   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42266   GDALBuildVRTOptions *arg1 = (GDALBuildVRTOptions *) 0 ;
42267   void *argp1 = 0 ;
42268   int res1 = 0 ;
42269   PyObject * obj0 = 0 ;
42270 
42271   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALBuildVRTOptions",&obj0)) SWIG_fail;
42272   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALBuildVRTOptions, SWIG_POINTER_DISOWN |  0 );
42273   if (!SWIG_IsOK(res1)) {
42274     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALBuildVRTOptions" "', argument " "1"" of type '" "GDALBuildVRTOptions *""'");
42275   }
42276   arg1 = reinterpret_cast< GDALBuildVRTOptions * >(argp1);
42277   {
42278     if ( bUseExceptions ) {
42279       ClearErrorState();
42280     }
42281     {
42282       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42283       delete_GDALBuildVRTOptions(arg1);
42284       SWIG_PYTHON_THREAD_END_ALLOW;
42285     }
42286 #ifndef SED_HACKS
42287     if ( bUseExceptions ) {
42288       CPLErr eclass = CPLGetLastErrorType();
42289       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42290         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42291       }
42292     }
42293 #endif
42294   }
42295   resultobj = SWIG_Py_Void();
42296   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42297   return resultobj;
42298 fail:
42299   return NULL;
42300 }
42301 
42302 
GDALBuildVRTOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42303 SWIGINTERN PyObject *GDALBuildVRTOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42304   PyObject *obj;
42305   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
42306   SWIG_TypeNewClientData(SWIGTYPE_p_GDALBuildVRTOptions, SWIG_NewClientData(obj));
42307   return SWIG_Py_Void();
42308 }
42309 
_wrap_BuildVRTInternalObjects(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42310 SWIGINTERN PyObject *_wrap_BuildVRTInternalObjects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42311   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42312   char *arg1 = (char *) 0 ;
42313   int arg2 ;
42314   GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
42315   GDALBuildVRTOptions *arg4 = (GDALBuildVRTOptions *) 0 ;
42316   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
42317   void *arg6 = (void *) NULL ;
42318   int bToFree1 = 0 ;
42319   void *argp4 = 0 ;
42320   int res4 = 0 ;
42321   PyObject * obj0 = 0 ;
42322   PyObject * obj1 = 0 ;
42323   PyObject * obj2 = 0 ;
42324   PyObject * obj3 = 0 ;
42325   PyObject * obj4 = 0 ;
42326   GDALDatasetShadow *result = 0 ;
42327 
42328   /* %typemap(arginit) ( const char* callback_data=NULL)  */
42329   PyProgressData *psProgressInfo;
42330   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
42331   psProgressInfo->nLastReported = -1;
42332   psProgressInfo->psPyCallback = NULL;
42333   psProgressInfo->psPyCallbackData = NULL;
42334   arg6 = psProgressInfo;
42335   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:BuildVRTInternalObjects",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
42336   {
42337     /* %typemap(in) (const char *utf8_path) */
42338     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
42339     if (arg1 == NULL)
42340     {
42341       PyErr_SetString( PyExc_RuntimeError, "not a string" );
42342       SWIG_fail;
42343     }
42344   }
42345   {
42346     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALDatasetShadow *optional_##GDALDatasetShadow)*/
42347     if ( !PySequence_Check(obj1) ) {
42348       PyErr_SetString(PyExc_TypeError, "not a sequence");
42349       SWIG_fail;
42350     }
42351     Py_ssize_t size = PySequence_Size(obj1);
42352     if( size != (int)size ) {
42353       PyErr_SetString(PyExc_TypeError, "too big sequence");
42354       SWIG_fail;
42355     }
42356     arg2 = (int)size;
42357     arg3 = (GDALDatasetShadow**) CPLMalloc(arg2*sizeof(GDALDatasetShadow*));
42358 
42359     for( int i = 0; i<arg2; i++ ) {
42360       PyObject *o = PySequence_GetItem(obj1,i);
42361       GDALDatasetShadow* rawobjectpointer = NULL;
42362       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_EXCEPTION | 0 ));
42363       if (!rawobjectpointer) {
42364         Py_DECREF(o);
42365         PyErr_SetString(PyExc_TypeError, "object of wrong GDALDatasetShadow");
42366         SWIG_fail;
42367       }
42368       arg3[i] = rawobjectpointer;
42369       Py_DECREF(o);
42370 
42371     }
42372   }
42373   res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_GDALBuildVRTOptions, 0 |  0 );
42374   if (!SWIG_IsOK(res4)) {
42375     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "BuildVRTInternalObjects" "', argument " "4"" of type '" "GDALBuildVRTOptions *""'");
42376   }
42377   arg4 = reinterpret_cast< GDALBuildVRTOptions * >(argp4);
42378   if (obj3) {
42379     {
42380       /* %typemap(in) (GDALProgressFunc callback = NULL) */
42381       /* callback_func typemap */
42382 
42383       /* In some cases 0 is passed instead of None. */
42384       /* See https://github.com/OSGeo/gdal/pull/219 */
42385       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
42386       {
42387         if( PyLong_AsLong(obj3) == 0 )
42388         {
42389           obj3 = Py_None;
42390         }
42391       }
42392 
42393       if (obj3 && obj3 != Py_None ) {
42394         void* cbfunction = NULL;
42395         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
42396             (void**)&cbfunction,
42397             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
42398             SWIG_POINTER_EXCEPTION | 0 ));
42399 
42400         if ( cbfunction == GDALTermProgress ) {
42401           arg5 = GDALTermProgress;
42402         } else {
42403           if (!PyCallable_Check(obj3)) {
42404             PyErr_SetString( PyExc_RuntimeError,
42405               "Object given is not a Python function" );
42406             SWIG_fail;
42407           }
42408           psProgressInfo->psPyCallback = obj3;
42409           arg5 = PyProgressProxy;
42410         }
42411 
42412       }
42413 
42414     }
42415   }
42416   if (obj4) {
42417     {
42418       /* %typemap(in) ( void* callback_data=NULL)  */
42419       psProgressInfo->psPyCallbackData = obj4 ;
42420     }
42421   }
42422   {
42423     if (!arg1) {
42424       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
42425     }
42426   }
42427   {
42428     if ( bUseExceptions ) {
42429       ClearErrorState();
42430     }
42431     {
42432       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42433       result = (GDALDatasetShadow *)wrapper_GDALBuildVRT_objects((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
42434       SWIG_PYTHON_THREAD_END_ALLOW;
42435     }
42436 #ifndef SED_HACKS
42437     if ( bUseExceptions ) {
42438       CPLErr eclass = CPLGetLastErrorType();
42439       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42440         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42441       }
42442     }
42443 #endif
42444   }
42445   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
42446   {
42447     /* %typemap(freearg) (const char *utf8_path) */
42448     GDALPythonFreeCStr(arg1, bToFree1);
42449   }
42450   {
42451     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
42452     CPLFree( arg3 );
42453   }
42454   {
42455     /* %typemap(freearg) ( void* callback_data=NULL)  */
42456 
42457     CPLFree(psProgressInfo);
42458 
42459   }
42460   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42461   return resultobj;
42462 fail:
42463   {
42464     /* %typemap(freearg) (const char *utf8_path) */
42465     GDALPythonFreeCStr(arg1, bToFree1);
42466   }
42467   {
42468     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
42469     CPLFree( arg3 );
42470   }
42471   {
42472     /* %typemap(freearg) ( void* callback_data=NULL)  */
42473 
42474     CPLFree(psProgressInfo);
42475 
42476   }
42477   return NULL;
42478 }
42479 
42480 
_wrap_BuildVRTInternalNames(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42481 SWIGINTERN PyObject *_wrap_BuildVRTInternalNames(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42482   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42483   char *arg1 = (char *) 0 ;
42484   char **arg2 = (char **) 0 ;
42485   GDALBuildVRTOptions *arg3 = (GDALBuildVRTOptions *) 0 ;
42486   GDALProgressFunc arg4 = (GDALProgressFunc) NULL ;
42487   void *arg5 = (void *) NULL ;
42488   int bToFree1 = 0 ;
42489   void *argp3 = 0 ;
42490   int res3 = 0 ;
42491   PyObject * obj0 = 0 ;
42492   PyObject * obj1 = 0 ;
42493   PyObject * obj2 = 0 ;
42494   PyObject * obj3 = 0 ;
42495   PyObject * obj4 = 0 ;
42496   GDALDatasetShadow *result = 0 ;
42497 
42498   /* %typemap(arginit) ( const char* callback_data=NULL)  */
42499   PyProgressData *psProgressInfo;
42500   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
42501   psProgressInfo->nLastReported = -1;
42502   psProgressInfo->psPyCallback = NULL;
42503   psProgressInfo->psPyCallbackData = NULL;
42504   arg5 = psProgressInfo;
42505   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:BuildVRTInternalNames",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
42506   {
42507     /* %typemap(in) (const char *utf8_path) */
42508     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
42509     if (arg1 == NULL)
42510     {
42511       PyErr_SetString( PyExc_RuntimeError, "not a string" );
42512       SWIG_fail;
42513     }
42514   }
42515   {
42516     /* %typemap(in) char **options */
42517     int bErr = FALSE;
42518     arg2 = CSLFromPySequence(obj1, &bErr);
42519     if( bErr )
42520     {
42521       SWIG_fail;
42522     }
42523   }
42524   res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_GDALBuildVRTOptions, 0 |  0 );
42525   if (!SWIG_IsOK(res3)) {
42526     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "BuildVRTInternalNames" "', argument " "3"" of type '" "GDALBuildVRTOptions *""'");
42527   }
42528   arg3 = reinterpret_cast< GDALBuildVRTOptions * >(argp3);
42529   if (obj3) {
42530     {
42531       /* %typemap(in) (GDALProgressFunc callback = NULL) */
42532       /* callback_func typemap */
42533 
42534       /* In some cases 0 is passed instead of None. */
42535       /* See https://github.com/OSGeo/gdal/pull/219 */
42536       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
42537       {
42538         if( PyLong_AsLong(obj3) == 0 )
42539         {
42540           obj3 = Py_None;
42541         }
42542       }
42543 
42544       if (obj3 && obj3 != Py_None ) {
42545         void* cbfunction = NULL;
42546         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
42547             (void**)&cbfunction,
42548             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
42549             SWIG_POINTER_EXCEPTION | 0 ));
42550 
42551         if ( cbfunction == GDALTermProgress ) {
42552           arg4 = GDALTermProgress;
42553         } else {
42554           if (!PyCallable_Check(obj3)) {
42555             PyErr_SetString( PyExc_RuntimeError,
42556               "Object given is not a Python function" );
42557             SWIG_fail;
42558           }
42559           psProgressInfo->psPyCallback = obj3;
42560           arg4 = PyProgressProxy;
42561         }
42562 
42563       }
42564 
42565     }
42566   }
42567   if (obj4) {
42568     {
42569       /* %typemap(in) ( void* callback_data=NULL)  */
42570       psProgressInfo->psPyCallbackData = obj4 ;
42571     }
42572   }
42573   {
42574     if (!arg1) {
42575       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
42576     }
42577   }
42578   {
42579     if ( bUseExceptions ) {
42580       ClearErrorState();
42581     }
42582     {
42583       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42584       result = (GDALDatasetShadow *)wrapper_GDALBuildVRT_names((char const *)arg1,arg2,arg3,arg4,arg5);
42585       SWIG_PYTHON_THREAD_END_ALLOW;
42586     }
42587 #ifndef SED_HACKS
42588     if ( bUseExceptions ) {
42589       CPLErr eclass = CPLGetLastErrorType();
42590       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42591         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42592       }
42593     }
42594 #endif
42595   }
42596   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
42597   {
42598     /* %typemap(freearg) (const char *utf8_path) */
42599     GDALPythonFreeCStr(arg1, bToFree1);
42600   }
42601   {
42602     /* %typemap(freearg) char **options */
42603     CSLDestroy( arg2 );
42604   }
42605   {
42606     /* %typemap(freearg) ( void* callback_data=NULL)  */
42607 
42608     CPLFree(psProgressInfo);
42609 
42610   }
42611   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42612   return resultobj;
42613 fail:
42614   {
42615     /* %typemap(freearg) (const char *utf8_path) */
42616     GDALPythonFreeCStr(arg1, bToFree1);
42617   }
42618   {
42619     /* %typemap(freearg) char **options */
42620     CSLDestroy( arg2 );
42621   }
42622   {
42623     /* %typemap(freearg) ( void* callback_data=NULL)  */
42624 
42625     CPLFree(psProgressInfo);
42626 
42627   }
42628   return NULL;
42629 }
42630 
42631 
_wrap_new_GDALMultiDimTranslateOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42632 SWIGINTERN PyObject *_wrap_new_GDALMultiDimTranslateOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42633   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42634   char **arg1 = (char **) 0 ;
42635   PyObject * obj0 = 0 ;
42636   GDALMultiDimTranslateOptions *result = 0 ;
42637 
42638   if (!PyArg_ParseTuple(args,(char *)"O:new_GDALMultiDimTranslateOptions",&obj0)) SWIG_fail;
42639   {
42640     /* %typemap(in) char **options */
42641     int bErr = FALSE;
42642     arg1 = CSLFromPySequence(obj0, &bErr);
42643     if( bErr )
42644     {
42645       SWIG_fail;
42646     }
42647   }
42648   {
42649     if ( bUseExceptions ) {
42650       ClearErrorState();
42651     }
42652     {
42653       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42654       result = (GDALMultiDimTranslateOptions *)new_GDALMultiDimTranslateOptions(arg1);
42655       SWIG_PYTHON_THREAD_END_ALLOW;
42656     }
42657 #ifndef SED_HACKS
42658     if ( bUseExceptions ) {
42659       CPLErr eclass = CPLGetLastErrorType();
42660       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42661         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42662       }
42663     }
42664 #endif
42665   }
42666   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALMultiDimTranslateOptions, SWIG_POINTER_NEW |  0 );
42667   {
42668     /* %typemap(freearg) char **options */
42669     CSLDestroy( arg1 );
42670   }
42671   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42672   return resultobj;
42673 fail:
42674   {
42675     /* %typemap(freearg) char **options */
42676     CSLDestroy( arg1 );
42677   }
42678   return NULL;
42679 }
42680 
42681 
_wrap_delete_GDALMultiDimTranslateOptions(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42682 SWIGINTERN PyObject *_wrap_delete_GDALMultiDimTranslateOptions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42683   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42684   GDALMultiDimTranslateOptions *arg1 = (GDALMultiDimTranslateOptions *) 0 ;
42685   void *argp1 = 0 ;
42686   int res1 = 0 ;
42687   PyObject * obj0 = 0 ;
42688 
42689   if (!PyArg_ParseTuple(args,(char *)"O:delete_GDALMultiDimTranslateOptions",&obj0)) SWIG_fail;
42690   res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GDALMultiDimTranslateOptions, SWIG_POINTER_DISOWN |  0 );
42691   if (!SWIG_IsOK(res1)) {
42692     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GDALMultiDimTranslateOptions" "', argument " "1"" of type '" "GDALMultiDimTranslateOptions *""'");
42693   }
42694   arg1 = reinterpret_cast< GDALMultiDimTranslateOptions * >(argp1);
42695   {
42696     if ( bUseExceptions ) {
42697       ClearErrorState();
42698     }
42699     {
42700       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42701       delete_GDALMultiDimTranslateOptions(arg1);
42702       SWIG_PYTHON_THREAD_END_ALLOW;
42703     }
42704 #ifndef SED_HACKS
42705     if ( bUseExceptions ) {
42706       CPLErr eclass = CPLGetLastErrorType();
42707       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42708         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42709       }
42710     }
42711 #endif
42712   }
42713   resultobj = SWIG_Py_Void();
42714   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42715   return resultobj;
42716 fail:
42717   return NULL;
42718 }
42719 
42720 
GDALMultiDimTranslateOptions_swigregister(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42721 SWIGINTERN PyObject *GDALMultiDimTranslateOptions_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42722   PyObject *obj;
42723   if (!PyArg_ParseTuple(args,(char *)"O:swigregister", &obj)) return NULL;
42724   SWIG_TypeNewClientData(SWIGTYPE_p_GDALMultiDimTranslateOptions, SWIG_NewClientData(obj));
42725   return SWIG_Py_Void();
42726 }
42727 
_wrap_wrapper_GDALMultiDimTranslateDestName(PyObject * SWIGUNUSEDPARM (self),PyObject * args)42728 SWIGINTERN PyObject *_wrap_wrapper_GDALMultiDimTranslateDestName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
42729   PyObject *resultobj = 0; int bLocalUseExceptionsCode = bUseExceptions;
42730   char *arg1 = (char *) 0 ;
42731   int arg2 ;
42732   GDALDatasetShadow **arg3 = (GDALDatasetShadow **) 0 ;
42733   GDALMultiDimTranslateOptions *arg4 = (GDALMultiDimTranslateOptions *) 0 ;
42734   GDALProgressFunc arg5 = (GDALProgressFunc) NULL ;
42735   void *arg6 = (void *) NULL ;
42736   int bToFree1 = 0 ;
42737   void *argp4 = 0 ;
42738   int res4 = 0 ;
42739   PyObject * obj0 = 0 ;
42740   PyObject * obj1 = 0 ;
42741   PyObject * obj2 = 0 ;
42742   PyObject * obj3 = 0 ;
42743   PyObject * obj4 = 0 ;
42744   GDALDatasetShadow *result = 0 ;
42745 
42746   /* %typemap(arginit) ( const char* callback_data=NULL)  */
42747   PyProgressData *psProgressInfo;
42748   psProgressInfo = (PyProgressData *) CPLCalloc(1,sizeof(PyProgressData));
42749   psProgressInfo->nLastReported = -1;
42750   psProgressInfo->psPyCallback = NULL;
42751   psProgressInfo->psPyCallbackData = NULL;
42752   arg6 = psProgressInfo;
42753   if (!PyArg_ParseTuple(args,(char *)"OOO|OO:wrapper_GDALMultiDimTranslateDestName",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
42754   {
42755     /* %typemap(in) (const char *utf8_path) */
42756     arg1 = GDALPythonObjectToCStr( obj0, &bToFree1 );
42757     if (arg1 == NULL)
42758     {
42759       PyErr_SetString( PyExc_RuntimeError, "not a string" );
42760       SWIG_fail;
42761     }
42762   }
42763   {
42764     /*  OBJECT_LIST_INPUT %typemap(in) (int itemcount, GDALDatasetShadow *optional_##GDALDatasetShadow)*/
42765     if ( !PySequence_Check(obj1) ) {
42766       PyErr_SetString(PyExc_TypeError, "not a sequence");
42767       SWIG_fail;
42768     }
42769     Py_ssize_t size = PySequence_Size(obj1);
42770     if( size != (int)size ) {
42771       PyErr_SetString(PyExc_TypeError, "too big sequence");
42772       SWIG_fail;
42773     }
42774     arg2 = (int)size;
42775     arg3 = (GDALDatasetShadow**) CPLMalloc(arg2*sizeof(GDALDatasetShadow*));
42776 
42777     for( int i = 0; i<arg2; i++ ) {
42778       PyObject *o = PySequence_GetItem(obj1,i);
42779       GDALDatasetShadow* rawobjectpointer = NULL;
42780       CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( o, (void**)&rawobjectpointer, SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_EXCEPTION | 0 ));
42781       if (!rawobjectpointer) {
42782         Py_DECREF(o);
42783         PyErr_SetString(PyExc_TypeError, "object of wrong GDALDatasetShadow");
42784         SWIG_fail;
42785       }
42786       arg3[i] = rawobjectpointer;
42787       Py_DECREF(o);
42788 
42789     }
42790   }
42791   res4 = SWIG_ConvertPtr(obj2, &argp4,SWIGTYPE_p_GDALMultiDimTranslateOptions, 0 |  0 );
42792   if (!SWIG_IsOK(res4)) {
42793     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "wrapper_GDALMultiDimTranslateDestName" "', argument " "4"" of type '" "GDALMultiDimTranslateOptions *""'");
42794   }
42795   arg4 = reinterpret_cast< GDALMultiDimTranslateOptions * >(argp4);
42796   if (obj3) {
42797     {
42798       /* %typemap(in) (GDALProgressFunc callback = NULL) */
42799       /* callback_func typemap */
42800 
42801       /* In some cases 0 is passed instead of None. */
42802       /* See https://github.com/OSGeo/gdal/pull/219 */
42803       if ( PyLong_Check(obj3) || PyInt_Check(obj3) )
42804       {
42805         if( PyLong_AsLong(obj3) == 0 )
42806         {
42807           obj3 = Py_None;
42808         }
42809       }
42810 
42811       if (obj3 && obj3 != Py_None ) {
42812         void* cbfunction = NULL;
42813         CPL_IGNORE_RET_VAL(SWIG_ConvertPtr( obj3,
42814             (void**)&cbfunction,
42815             SWIGTYPE_p_f_double_p_q_const__char_p_void__int,
42816             SWIG_POINTER_EXCEPTION | 0 ));
42817 
42818         if ( cbfunction == GDALTermProgress ) {
42819           arg5 = GDALTermProgress;
42820         } else {
42821           if (!PyCallable_Check(obj3)) {
42822             PyErr_SetString( PyExc_RuntimeError,
42823               "Object given is not a Python function" );
42824             SWIG_fail;
42825           }
42826           psProgressInfo->psPyCallback = obj3;
42827           arg5 = PyProgressProxy;
42828         }
42829 
42830       }
42831 
42832     }
42833   }
42834   if (obj4) {
42835     {
42836       /* %typemap(in) ( void* callback_data=NULL)  */
42837       psProgressInfo->psPyCallbackData = obj4 ;
42838     }
42839   }
42840   {
42841     if (!arg1) {
42842       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
42843     }
42844   }
42845   {
42846     if ( bUseExceptions ) {
42847       ClearErrorState();
42848     }
42849     {
42850       SWIG_PYTHON_THREAD_BEGIN_ALLOW;
42851       result = (GDALDatasetShadow *)wrapper_GDALMultiDimTranslateDestName((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
42852       SWIG_PYTHON_THREAD_END_ALLOW;
42853     }
42854 #ifndef SED_HACKS
42855     if ( bUseExceptions ) {
42856       CPLErr eclass = CPLGetLastErrorType();
42857       if ( eclass == CE_Failure || eclass == CE_Fatal ) {
42858         SWIG_exception( SWIG_RuntimeError, CPLGetLastErrorMsg() );
42859       }
42860     }
42861 #endif
42862   }
42863   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GDALDatasetShadow, SWIG_POINTER_OWN |  0 );
42864   {
42865     /* %typemap(freearg) (const char *utf8_path) */
42866     GDALPythonFreeCStr(arg1, bToFree1);
42867   }
42868   {
42869     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
42870     CPLFree( arg3 );
42871   }
42872   {
42873     /* %typemap(freearg) ( void* callback_data=NULL)  */
42874 
42875     CPLFree(psProgressInfo);
42876 
42877   }
42878   if ( ReturnSame(bLocalUseExceptionsCode) ) { CPLErr eclass = CPLGetLastErrorType(); if ( eclass == CE_Failure || eclass == CE_Fatal ) { Py_XDECREF(resultobj); SWIG_Error( SWIG_RuntimeError, CPLGetLastErrorMsg() ); return NULL; } }
42879   return resultobj;
42880 fail:
42881   {
42882     /* %typemap(freearg) (const char *utf8_path) */
42883     GDALPythonFreeCStr(arg1, bToFree1);
42884   }
42885   {
42886     /* OBJECT_LIST_INPUT %typemap(freearg) (int object_list_count, GDALDatasetShadow **poObjects)*/
42887     CPLFree( arg3 );
42888   }
42889   {
42890     /* %typemap(freearg) ( void* callback_data=NULL)  */
42891 
42892     CPLFree(psProgressInfo);
42893 
42894   }
42895   return NULL;
42896 }
42897 
42898 
42899 static PyMethodDef SwigMethods[] = {
42900 	 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
42901 	 { (char *)"GetUseExceptions", _wrap_GetUseExceptions, METH_VARARGS, (char *)"GetUseExceptions() -> int"},
42902 	 { (char *)"UseExceptions", _wrap_UseExceptions, METH_VARARGS, (char *)"UseExceptions()"},
42903 	 { (char *)"DontUseExceptions", _wrap_DontUseExceptions, METH_VARARGS, (char *)"DontUseExceptions()"},
42904 	 { (char *)"VSIFReadL", _wrap_VSIFReadL, METH_VARARGS, (char *)"VSIFReadL(unsigned int nMembSize, unsigned int nMembCount, VSILFILE fp) -> unsigned int"},
42905 	 { (char *)"VSIGetMemFileBuffer_unsafe", _wrap_VSIGetMemFileBuffer_unsafe, METH_VARARGS, (char *)"VSIGetMemFileBuffer_unsafe(char const * utf8_path)"},
42906 	 { (char *)"Debug", _wrap_Debug, METH_VARARGS, (char *)"Debug(char const * msg_class, char const * message)"},
42907 	 { (char *)"SetErrorHandler", _wrap_SetErrorHandler, METH_VARARGS, (char *)"SetErrorHandler(CPLErrorHandler pfnErrorHandler=0) -> CPLErr"},
42908 	 { (char *)"SetCurrentErrorHandlerCatchDebug", _wrap_SetCurrentErrorHandlerCatchDebug, METH_VARARGS, (char *)"SetCurrentErrorHandlerCatchDebug(int bCatchDebug)"},
42909 	 { (char *)"PushErrorHandler", _wrap_PushErrorHandler, METH_VARARGS, (char *)"PushErrorHandler(CPLErrorHandler pfnErrorHandler=0) -> CPLErr"},
42910 	 { (char *)"PopErrorHandler", _wrap_PopErrorHandler, METH_VARARGS, (char *)"PopErrorHandler()"},
42911 	 { (char *)"Error", _wrap_Error, METH_VARARGS, (char *)"Error(CPLErr msg_class, int err_code=0, char const * msg)"},
42912 	 { (char *)"GOA2GetAuthorizationURL", _wrap_GOA2GetAuthorizationURL, METH_VARARGS, (char *)"GOA2GetAuthorizationURL(char const * pszScope) -> retStringAndCPLFree *"},
42913 	 { (char *)"GOA2GetRefreshToken", _wrap_GOA2GetRefreshToken, METH_VARARGS, (char *)"GOA2GetRefreshToken(char const * pszAuthToken, char const * pszScope) -> retStringAndCPLFree *"},
42914 	 { (char *)"GOA2GetAccessToken", _wrap_GOA2GetAccessToken, METH_VARARGS, (char *)"GOA2GetAccessToken(char const * pszRefreshToken, char const * pszScope) -> retStringAndCPLFree *"},
42915 	 { (char *)"ErrorReset", _wrap_ErrorReset, METH_VARARGS, (char *)"ErrorReset()"},
42916 	 { (char *)"EscapeString", (PyCFunction) _wrap_EscapeString, METH_VARARGS | METH_KEYWORDS, (char *)"EscapeString(int len, int scheme) -> retStringAndCPLFree *"},
42917 	 { (char *)"GetLastErrorNo", _wrap_GetLastErrorNo, METH_VARARGS, (char *)"GetLastErrorNo() -> int"},
42918 	 { (char *)"GetLastErrorType", _wrap_GetLastErrorType, METH_VARARGS, (char *)"GetLastErrorType() -> int"},
42919 	 { (char *)"GetLastErrorMsg", _wrap_GetLastErrorMsg, METH_VARARGS, (char *)"GetLastErrorMsg() -> char const *"},
42920 	 { (char *)"GetErrorCounter", _wrap_GetErrorCounter, METH_VARARGS, (char *)"GetErrorCounter() -> unsigned int"},
42921 	 { (char *)"VSIGetLastErrorNo", _wrap_VSIGetLastErrorNo, METH_VARARGS, (char *)"VSIGetLastErrorNo() -> int"},
42922 	 { (char *)"VSIGetLastErrorMsg", _wrap_VSIGetLastErrorMsg, METH_VARARGS, (char *)"VSIGetLastErrorMsg() -> char const *"},
42923 	 { (char *)"VSIErrorReset", _wrap_VSIErrorReset, METH_VARARGS, (char *)"VSIErrorReset()"},
42924 	 { (char *)"PushFinderLocation", _wrap_PushFinderLocation, METH_VARARGS, (char *)"PushFinderLocation(char const * utf8_path)"},
42925 	 { (char *)"PopFinderLocation", _wrap_PopFinderLocation, METH_VARARGS, (char *)"PopFinderLocation()"},
42926 	 { (char *)"FinderClean", _wrap_FinderClean, METH_VARARGS, (char *)"FinderClean()"},
42927 	 { (char *)"FindFile", _wrap_FindFile, METH_VARARGS, (char *)"FindFile(char const * pszClass, char const * utf8_path) -> char const *"},
42928 	 { (char *)"ReadDir", _wrap_ReadDir, METH_VARARGS, (char *)"ReadDir(char const * utf8_path, int nMaxFiles=0) -> char **"},
42929 	 { (char *)"ReadDirRecursive", _wrap_ReadDirRecursive, METH_VARARGS, (char *)"ReadDirRecursive(char const * utf8_path) -> char **"},
42930 	 { (char *)"OpenDir", _wrap_OpenDir, METH_VARARGS, (char *)"OpenDir(char const * utf8_path, int nRecurseDepth=-1, char ** options=None) -> VSIDIR *"},
42931 	 { (char *)"DirEntry_name_get", _wrap_DirEntry_name_get, METH_VARARGS, (char *)"DirEntry_name_get(DirEntry self) -> char *"},
42932 	 { (char *)"DirEntry_mode_get", _wrap_DirEntry_mode_get, METH_VARARGS, (char *)"DirEntry_mode_get(DirEntry self) -> int"},
42933 	 { (char *)"DirEntry_size_get", _wrap_DirEntry_size_get, METH_VARARGS, (char *)"DirEntry_size_get(DirEntry self) -> GIntBig"},
42934 	 { (char *)"DirEntry_mtime_get", _wrap_DirEntry_mtime_get, METH_VARARGS, (char *)"DirEntry_mtime_get(DirEntry self) -> GIntBig"},
42935 	 { (char *)"DirEntry_modeKnown_get", _wrap_DirEntry_modeKnown_get, METH_VARARGS, (char *)"DirEntry_modeKnown_get(DirEntry self) -> bool"},
42936 	 { (char *)"DirEntry_sizeKnown_get", _wrap_DirEntry_sizeKnown_get, METH_VARARGS, (char *)"DirEntry_sizeKnown_get(DirEntry self) -> bool"},
42937 	 { (char *)"DirEntry_mtimeKnown_get", _wrap_DirEntry_mtimeKnown_get, METH_VARARGS, (char *)"DirEntry_mtimeKnown_get(DirEntry self) -> bool"},
42938 	 { (char *)"DirEntry_extra_get", _wrap_DirEntry_extra_get, METH_VARARGS, (char *)"DirEntry_extra_get(DirEntry self) -> char **"},
42939 	 { (char *)"new_DirEntry", _wrap_new_DirEntry, METH_VARARGS, (char *)"new_DirEntry(DirEntry entryIn) -> DirEntry"},
42940 	 { (char *)"delete_DirEntry", _wrap_delete_DirEntry, METH_VARARGS, (char *)"delete_DirEntry(DirEntry self)"},
42941 	 { (char *)"DirEntry_IsDirectory", _wrap_DirEntry_IsDirectory, METH_VARARGS, (char *)"DirEntry_IsDirectory(DirEntry self) -> bool"},
42942 	 { (char *)"DirEntry_swigregister", DirEntry_swigregister, METH_VARARGS, NULL},
42943 	 { (char *)"GetNextDirEntry", _wrap_GetNextDirEntry, METH_VARARGS, (char *)"GetNextDirEntry(VSIDIR * dir) -> DirEntry"},
42944 	 { (char *)"CloseDir", _wrap_CloseDir, METH_VARARGS, (char *)"CloseDir(VSIDIR * dir)"},
42945 	 { (char *)"SetConfigOption", _wrap_SetConfigOption, METH_VARARGS, (char *)"SetConfigOption(char const * pszKey, char const * pszValue)"},
42946 	 { (char *)"GetConfigOption", _wrap_GetConfigOption, METH_VARARGS, (char *)"GetConfigOption(char const * pszKey, char const * pszDefault=None) -> char const *"},
42947 	 { (char *)"CPLBinaryToHex", _wrap_CPLBinaryToHex, METH_VARARGS, (char *)"CPLBinaryToHex(int nBytes) -> retStringAndCPLFree *"},
42948 	 { (char *)"CPLHexToBinary", _wrap_CPLHexToBinary, METH_VARARGS, (char *)"CPLHexToBinary(char const * pszHex, int * pnBytes) -> GByte *"},
42949 	 { (char *)"FileFromMemBuffer", _wrap_FileFromMemBuffer, METH_VARARGS, (char *)"FileFromMemBuffer(char const * utf8_path, GIntBig nBytes)"},
42950 	 { (char *)"Unlink", _wrap_Unlink, METH_VARARGS, (char *)"Unlink(char const * utf8_path) -> VSI_RETVAL"},
42951 	 { (char *)"UnlinkBatch", _wrap_UnlinkBatch, METH_VARARGS, (char *)"UnlinkBatch(char ** files) -> bool"},
42952 	 { (char *)"HasThreadSupport", _wrap_HasThreadSupport, METH_VARARGS, (char *)"HasThreadSupport() -> int"},
42953 	 { (char *)"Mkdir", _wrap_Mkdir, METH_VARARGS, (char *)"Mkdir(char const * utf8_path, int mode) -> VSI_RETVAL"},
42954 	 { (char *)"Rmdir", _wrap_Rmdir, METH_VARARGS, (char *)"Rmdir(char const * utf8_path) -> VSI_RETVAL"},
42955 	 { (char *)"MkdirRecursive", _wrap_MkdirRecursive, METH_VARARGS, (char *)"MkdirRecursive(char const * utf8_path, int mode) -> VSI_RETVAL"},
42956 	 { (char *)"RmdirRecursive", _wrap_RmdirRecursive, METH_VARARGS, (char *)"RmdirRecursive(char const * utf8_path) -> VSI_RETVAL"},
42957 	 { (char *)"Rename", _wrap_Rename, METH_VARARGS, (char *)"Rename(char const * pszOld, char const * pszNew) -> VSI_RETVAL"},
42958 	 { (char *)"Sync", (PyCFunction) _wrap_Sync, METH_VARARGS | METH_KEYWORDS, (char *)"Sync(char const * pszSource, char const * pszTarget, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> bool"},
42959 	 { (char *)"GetActualURL", _wrap_GetActualURL, METH_VARARGS, (char *)"GetActualURL(char const * utf8_path) -> char const *"},
42960 	 { (char *)"GetSignedURL", _wrap_GetSignedURL, METH_VARARGS, (char *)"GetSignedURL(char const * utf8_path, char ** options=None) -> retStringAndCPLFree *"},
42961 	 { (char *)"GetFileSystemsPrefixes", _wrap_GetFileSystemsPrefixes, METH_VARARGS, (char *)"GetFileSystemsPrefixes() -> char **"},
42962 	 { (char *)"GetFileSystemOptions", _wrap_GetFileSystemOptions, METH_VARARGS, (char *)"GetFileSystemOptions(char const * utf8_path) -> char const *"},
42963 	 { (char *)"VSILFILE_swigregister", VSILFILE_swigregister, METH_VARARGS, NULL},
42964 	 { (char *)"StatBuf_mode_get", _wrap_StatBuf_mode_get, METH_VARARGS, (char *)"StatBuf_mode_get(StatBuf self) -> int"},
42965 	 { (char *)"StatBuf_size_get", _wrap_StatBuf_size_get, METH_VARARGS, (char *)"StatBuf_size_get(StatBuf self) -> GIntBig"},
42966 	 { (char *)"StatBuf_mtime_get", _wrap_StatBuf_mtime_get, METH_VARARGS, (char *)"StatBuf_mtime_get(StatBuf self) -> GIntBig"},
42967 	 { (char *)"new_StatBuf", _wrap_new_StatBuf, METH_VARARGS, (char *)"new_StatBuf(StatBuf psStatBuf) -> StatBuf"},
42968 	 { (char *)"delete_StatBuf", _wrap_delete_StatBuf, METH_VARARGS, (char *)"delete_StatBuf(StatBuf self)"},
42969 	 { (char *)"StatBuf_IsDirectory", _wrap_StatBuf_IsDirectory, METH_VARARGS, (char *)"StatBuf_IsDirectory(StatBuf self) -> int"},
42970 	 { (char *)"StatBuf_swigregister", StatBuf_swigregister, METH_VARARGS, NULL},
42971 	 { (char *)"VSIStatL", _wrap_VSIStatL, METH_VARARGS, (char *)"VSIStatL(char const * utf8_path, int nFlags=0) -> int"},
42972 	 { (char *)"GetFileMetadata", _wrap_GetFileMetadata, METH_VARARGS, (char *)"GetFileMetadata(char const * utf8_path, char const * domain, char ** options=None) -> char **"},
42973 	 { (char *)"SetFileMetadata", _wrap_SetFileMetadata, METH_VARARGS, (char *)"SetFileMetadata(char const * utf8_path, char ** metadata, char const * domain, char ** options=None) -> bool"},
42974 	 { (char *)"VSIFOpenL", _wrap_VSIFOpenL, METH_VARARGS, (char *)"VSIFOpenL(char const * utf8_path, char const * pszMode) -> VSILFILE"},
42975 	 { (char *)"VSIFOpenExL", _wrap_VSIFOpenExL, METH_VARARGS, (char *)"VSIFOpenExL(char const * utf8_path, char const * pszMode, int bSetError=False, char ** options=None) -> VSILFILE"},
42976 	 { (char *)"VSIFEofL", _wrap_VSIFEofL, METH_VARARGS, (char *)"VSIFEofL(VSILFILE fp) -> int"},
42977 	 { (char *)"VSIFFlushL", _wrap_VSIFFlushL, METH_VARARGS, (char *)"VSIFFlushL(VSILFILE fp) -> int"},
42978 	 { (char *)"VSIFCloseL", _wrap_VSIFCloseL, METH_VARARGS, (char *)"VSIFCloseL(VSILFILE fp) -> VSI_RETVAL"},
42979 	 { (char *)"VSIFSeekL", _wrap_VSIFSeekL, METH_VARARGS, (char *)"VSIFSeekL(VSILFILE fp, GIntBig offset, int whence) -> int"},
42980 	 { (char *)"VSIFTellL", _wrap_VSIFTellL, METH_VARARGS, (char *)"VSIFTellL(VSILFILE fp) -> GIntBig"},
42981 	 { (char *)"VSIFTruncateL", _wrap_VSIFTruncateL, METH_VARARGS, (char *)"VSIFTruncateL(VSILFILE fp, GIntBig length) -> int"},
42982 	 { (char *)"VSISupportsSparseFiles", _wrap_VSISupportsSparseFiles, METH_VARARGS, (char *)"VSISupportsSparseFiles(char const * utf8_path) -> int"},
42983 	 { (char *)"VSIFGetRangeStatusL", _wrap_VSIFGetRangeStatusL, METH_VARARGS, (char *)"VSIFGetRangeStatusL(VSILFILE fp, GIntBig offset, GIntBig length) -> int"},
42984 	 { (char *)"VSIFWriteL", _wrap_VSIFWriteL, METH_VARARGS, (char *)"VSIFWriteL(int nLen, int size, int memb, VSILFILE fp) -> int"},
42985 	 { (char *)"VSICurlClearCache", _wrap_VSICurlClearCache, METH_VARARGS, (char *)"VSICurlClearCache()"},
42986 	 { (char *)"VSICurlPartialClearCache", _wrap_VSICurlPartialClearCache, METH_VARARGS, (char *)"VSICurlPartialClearCache(char const * utf8_path)"},
42987 	 { (char *)"NetworkStatsReset", _wrap_NetworkStatsReset, METH_VARARGS, (char *)"NetworkStatsReset()"},
42988 	 { (char *)"NetworkStatsGetAsSerializedJSON", _wrap_NetworkStatsGetAsSerializedJSON, METH_VARARGS, (char *)"NetworkStatsGetAsSerializedJSON(char ** options=None) -> retStringAndCPLFree *"},
42989 	 { (char *)"ParseCommandLine", _wrap_ParseCommandLine, METH_VARARGS, (char *)"ParseCommandLine(char const * utf8_path) -> char **"},
42990 	 { (char *)"MajorObject_GetDescription", _wrap_MajorObject_GetDescription, METH_VARARGS, (char *)"MajorObject_GetDescription(MajorObject self) -> char const *"},
42991 	 { (char *)"MajorObject_SetDescription", _wrap_MajorObject_SetDescription, METH_VARARGS, (char *)"MajorObject_SetDescription(MajorObject self, char const * pszNewDesc)"},
42992 	 { (char *)"MajorObject_GetMetadataDomainList", _wrap_MajorObject_GetMetadataDomainList, METH_VARARGS, (char *)"MajorObject_GetMetadataDomainList(MajorObject self) -> char **"},
42993 	 { (char *)"MajorObject_GetMetadata_Dict", _wrap_MajorObject_GetMetadata_Dict, METH_VARARGS, (char *)"MajorObject_GetMetadata_Dict(MajorObject self, char const * pszDomain) -> char **"},
42994 	 { (char *)"MajorObject_GetMetadata_List", _wrap_MajorObject_GetMetadata_List, METH_VARARGS, (char *)"MajorObject_GetMetadata_List(MajorObject self, char const * pszDomain) -> char **"},
42995 	 { (char *)"MajorObject_SetMetadata", _wrap_MajorObject_SetMetadata, METH_VARARGS, (char *)"\n"
42996 		"SetMetadata(char ** papszMetadata, char const * pszDomain) -> CPLErr\n"
42997 		"MajorObject_SetMetadata(MajorObject self, char * pszMetadataString, char const * pszDomain) -> CPLErr\n"
42998 		""},
42999 	 { (char *)"MajorObject_GetMetadataItem", _wrap_MajorObject_GetMetadataItem, METH_VARARGS, (char *)"MajorObject_GetMetadataItem(MajorObject self, char const * pszName, char const * pszDomain) -> char const *"},
43000 	 { (char *)"MajorObject_SetMetadataItem", _wrap_MajorObject_SetMetadataItem, METH_VARARGS, (char *)"MajorObject_SetMetadataItem(MajorObject self, char const * pszName, char const * pszValue, char const * pszDomain) -> CPLErr"},
43001 	 { (char *)"MajorObject_swigregister", MajorObject_swigregister, METH_VARARGS, NULL},
43002 	 { (char *)"Driver_ShortName_get", _wrap_Driver_ShortName_get, METH_VARARGS, (char *)"Driver_ShortName_get(Driver self) -> char const *"},
43003 	 { (char *)"Driver_LongName_get", _wrap_Driver_LongName_get, METH_VARARGS, (char *)"Driver_LongName_get(Driver self) -> char const *"},
43004 	 { (char *)"Driver_HelpTopic_get", _wrap_Driver_HelpTopic_get, METH_VARARGS, (char *)"Driver_HelpTopic_get(Driver self) -> char const *"},
43005 	 { (char *)"Driver_Create", (PyCFunction) _wrap_Driver_Create, METH_VARARGS | METH_KEYWORDS, (char *)"Driver_Create(Driver self, char const * utf8_path, int xsize, int ysize, int bands=1, GDALDataType eType, char ** options=None) -> Dataset"},
43006 	 { (char *)"Driver_CreateMultiDimensional", (PyCFunction) _wrap_Driver_CreateMultiDimensional, METH_VARARGS | METH_KEYWORDS, (char *)"Driver_CreateMultiDimensional(Driver self, char const * utf8_path, char ** root_group_options=None, char ** options=None) -> Dataset"},
43007 	 { (char *)"Driver_CreateCopy", (PyCFunction) _wrap_Driver_CreateCopy, METH_VARARGS | METH_KEYWORDS, (char *)"Driver_CreateCopy(Driver self, char const * utf8_path, Dataset src, int strict=1, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43008 	 { (char *)"Driver_Delete", _wrap_Driver_Delete, METH_VARARGS, (char *)"Driver_Delete(Driver self, char const * utf8_path) -> CPLErr"},
43009 	 { (char *)"Driver_Rename", _wrap_Driver_Rename, METH_VARARGS, (char *)"Driver_Rename(Driver self, char const * newName, char const * oldName) -> CPLErr"},
43010 	 { (char *)"Driver_CopyFiles", _wrap_Driver_CopyFiles, METH_VARARGS, (char *)"Driver_CopyFiles(Driver self, char const * newName, char const * oldName) -> CPLErr"},
43011 	 { (char *)"Driver_Register", _wrap_Driver_Register, METH_VARARGS, (char *)"Driver_Register(Driver self) -> int"},
43012 	 { (char *)"Driver_Deregister", _wrap_Driver_Deregister, METH_VARARGS, (char *)"Driver_Deregister(Driver self)"},
43013 	 { (char *)"Driver_swigregister", Driver_swigregister, METH_VARARGS, NULL},
43014 	 { (char *)"ColorEntry_c1_set", _wrap_ColorEntry_c1_set, METH_VARARGS, (char *)"ColorEntry_c1_set(ColorEntry self, short c1)"},
43015 	 { (char *)"ColorEntry_c1_get", _wrap_ColorEntry_c1_get, METH_VARARGS, (char *)"ColorEntry_c1_get(ColorEntry self) -> short"},
43016 	 { (char *)"ColorEntry_c2_set", _wrap_ColorEntry_c2_set, METH_VARARGS, (char *)"ColorEntry_c2_set(ColorEntry self, short c2)"},
43017 	 { (char *)"ColorEntry_c2_get", _wrap_ColorEntry_c2_get, METH_VARARGS, (char *)"ColorEntry_c2_get(ColorEntry self) -> short"},
43018 	 { (char *)"ColorEntry_c3_set", _wrap_ColorEntry_c3_set, METH_VARARGS, (char *)"ColorEntry_c3_set(ColorEntry self, short c3)"},
43019 	 { (char *)"ColorEntry_c3_get", _wrap_ColorEntry_c3_get, METH_VARARGS, (char *)"ColorEntry_c3_get(ColorEntry self) -> short"},
43020 	 { (char *)"ColorEntry_c4_set", _wrap_ColorEntry_c4_set, METH_VARARGS, (char *)"ColorEntry_c4_set(ColorEntry self, short c4)"},
43021 	 { (char *)"ColorEntry_c4_get", _wrap_ColorEntry_c4_get, METH_VARARGS, (char *)"ColorEntry_c4_get(ColorEntry self) -> short"},
43022 	 { (char *)"ColorEntry_swigregister", ColorEntry_swigregister, METH_VARARGS, NULL},
43023 	 { (char *)"GCP_GCPX_set", _wrap_GCP_GCPX_set, METH_VARARGS, (char *)"GCP_GCPX_set(GCP self, double GCPX)"},
43024 	 { (char *)"GCP_GCPX_get", _wrap_GCP_GCPX_get, METH_VARARGS, (char *)"GCP_GCPX_get(GCP self) -> double"},
43025 	 { (char *)"GCP_GCPY_set", _wrap_GCP_GCPY_set, METH_VARARGS, (char *)"GCP_GCPY_set(GCP self, double GCPY)"},
43026 	 { (char *)"GCP_GCPY_get", _wrap_GCP_GCPY_get, METH_VARARGS, (char *)"GCP_GCPY_get(GCP self) -> double"},
43027 	 { (char *)"GCP_GCPZ_set", _wrap_GCP_GCPZ_set, METH_VARARGS, (char *)"GCP_GCPZ_set(GCP self, double GCPZ)"},
43028 	 { (char *)"GCP_GCPZ_get", _wrap_GCP_GCPZ_get, METH_VARARGS, (char *)"GCP_GCPZ_get(GCP self) -> double"},
43029 	 { (char *)"GCP_GCPPixel_set", _wrap_GCP_GCPPixel_set, METH_VARARGS, (char *)"GCP_GCPPixel_set(GCP self, double GCPPixel)"},
43030 	 { (char *)"GCP_GCPPixel_get", _wrap_GCP_GCPPixel_get, METH_VARARGS, (char *)"GCP_GCPPixel_get(GCP self) -> double"},
43031 	 { (char *)"GCP_GCPLine_set", _wrap_GCP_GCPLine_set, METH_VARARGS, (char *)"GCP_GCPLine_set(GCP self, double GCPLine)"},
43032 	 { (char *)"GCP_GCPLine_get", _wrap_GCP_GCPLine_get, METH_VARARGS, (char *)"GCP_GCPLine_get(GCP self) -> double"},
43033 	 { (char *)"GCP_Info_set", _wrap_GCP_Info_set, METH_VARARGS, (char *)"GCP_Info_set(GCP self, char * Info)"},
43034 	 { (char *)"GCP_Info_get", _wrap_GCP_Info_get, METH_VARARGS, (char *)"GCP_Info_get(GCP self) -> char *"},
43035 	 { (char *)"GCP_Id_set", _wrap_GCP_Id_set, METH_VARARGS, (char *)"GCP_Id_set(GCP self, char * Id)"},
43036 	 { (char *)"GCP_Id_get", _wrap_GCP_Id_get, METH_VARARGS, (char *)"GCP_Id_get(GCP self) -> char *"},
43037 	 { (char *)"new_GCP", _wrap_new_GCP, METH_VARARGS, (char *)"new_GCP(double x=0.0, double y=0.0, double z=0.0, double pixel=0.0, double line=0.0, char const * info, char const * id) -> GCP"},
43038 	 { (char *)"delete_GCP", _wrap_delete_GCP, METH_VARARGS, (char *)"delete_GCP(GCP self)"},
43039 	 { (char *)"GCP_swigregister", GCP_swigregister, METH_VARARGS, NULL},
43040 	 { (char *)"GDAL_GCP_GCPX_get", _wrap_GDAL_GCP_GCPX_get, METH_VARARGS, (char *)"GDAL_GCP_GCPX_get(GCP gcp) -> double"},
43041 	 { (char *)"GDAL_GCP_GCPX_set", _wrap_GDAL_GCP_GCPX_set, METH_VARARGS, (char *)"GDAL_GCP_GCPX_set(GCP gcp, double dfGCPX)"},
43042 	 { (char *)"GDAL_GCP_GCPY_get", _wrap_GDAL_GCP_GCPY_get, METH_VARARGS, (char *)"GDAL_GCP_GCPY_get(GCP gcp) -> double"},
43043 	 { (char *)"GDAL_GCP_GCPY_set", _wrap_GDAL_GCP_GCPY_set, METH_VARARGS, (char *)"GDAL_GCP_GCPY_set(GCP gcp, double dfGCPY)"},
43044 	 { (char *)"GDAL_GCP_GCPZ_get", _wrap_GDAL_GCP_GCPZ_get, METH_VARARGS, (char *)"GDAL_GCP_GCPZ_get(GCP gcp) -> double"},
43045 	 { (char *)"GDAL_GCP_GCPZ_set", _wrap_GDAL_GCP_GCPZ_set, METH_VARARGS, (char *)"GDAL_GCP_GCPZ_set(GCP gcp, double dfGCPZ)"},
43046 	 { (char *)"GDAL_GCP_GCPPixel_get", _wrap_GDAL_GCP_GCPPixel_get, METH_VARARGS, (char *)"GDAL_GCP_GCPPixel_get(GCP gcp) -> double"},
43047 	 { (char *)"GDAL_GCP_GCPPixel_set", _wrap_GDAL_GCP_GCPPixel_set, METH_VARARGS, (char *)"GDAL_GCP_GCPPixel_set(GCP gcp, double dfGCPPixel)"},
43048 	 { (char *)"GDAL_GCP_GCPLine_get", _wrap_GDAL_GCP_GCPLine_get, METH_VARARGS, (char *)"GDAL_GCP_GCPLine_get(GCP gcp) -> double"},
43049 	 { (char *)"GDAL_GCP_GCPLine_set", _wrap_GDAL_GCP_GCPLine_set, METH_VARARGS, (char *)"GDAL_GCP_GCPLine_set(GCP gcp, double dfGCPLine)"},
43050 	 { (char *)"GDAL_GCP_Info_get", _wrap_GDAL_GCP_Info_get, METH_VARARGS, (char *)"GDAL_GCP_Info_get(GCP gcp) -> char const *"},
43051 	 { (char *)"GDAL_GCP_Info_set", _wrap_GDAL_GCP_Info_set, METH_VARARGS, (char *)"GDAL_GCP_Info_set(GCP gcp, char const * pszInfo)"},
43052 	 { (char *)"GDAL_GCP_Id_get", _wrap_GDAL_GCP_Id_get, METH_VARARGS, (char *)"GDAL_GCP_Id_get(GCP gcp) -> char const *"},
43053 	 { (char *)"GDAL_GCP_Id_set", _wrap_GDAL_GCP_Id_set, METH_VARARGS, (char *)"GDAL_GCP_Id_set(GCP gcp, char const * pszId)"},
43054 	 { (char *)"GCPsToGeoTransform", _wrap_GCPsToGeoTransform, METH_VARARGS, (char *)"GCPsToGeoTransform(int nGCPs, int bApproxOK=1) -> RETURN_NONE"},
43055 	 { (char *)"delete_VirtualMem", _wrap_delete_VirtualMem, METH_VARARGS, (char *)"delete_VirtualMem(VirtualMem self)"},
43056 	 { (char *)"VirtualMem_GetAddr", _wrap_VirtualMem_GetAddr, METH_VARARGS, (char *)"VirtualMem_GetAddr(VirtualMem self)"},
43057 	 { (char *)"VirtualMem_Pin", _wrap_VirtualMem_Pin, METH_VARARGS, (char *)"VirtualMem_Pin(VirtualMem self, size_t start_offset=0, size_t nsize=0, int bWriteOp=0)"},
43058 	 { (char *)"VirtualMem_swigregister", VirtualMem_swigregister, METH_VARARGS, NULL},
43059 	 { (char *)"delete_AsyncReader", _wrap_delete_AsyncReader, METH_VARARGS, (char *)"delete_AsyncReader(AsyncReader self)"},
43060 	 { (char *)"AsyncReader_GetNextUpdatedRegion", _wrap_AsyncReader_GetNextUpdatedRegion, METH_VARARGS, (char *)"AsyncReader_GetNextUpdatedRegion(AsyncReader self, double timeout) -> GDALAsyncStatusType"},
43061 	 { (char *)"AsyncReader_GetBuffer", _wrap_AsyncReader_GetBuffer, METH_VARARGS, (char *)"AsyncReader_GetBuffer(AsyncReader self)"},
43062 	 { (char *)"AsyncReader_LockBuffer", _wrap_AsyncReader_LockBuffer, METH_VARARGS, (char *)"AsyncReader_LockBuffer(AsyncReader self, double timeout) -> int"},
43063 	 { (char *)"AsyncReader_UnlockBuffer", _wrap_AsyncReader_UnlockBuffer, METH_VARARGS, (char *)"AsyncReader_UnlockBuffer(AsyncReader self)"},
43064 	 { (char *)"AsyncReader_swigregister", AsyncReader_swigregister, METH_VARARGS, NULL},
43065 	 { (char *)"Dataset_RasterXSize_get", _wrap_Dataset_RasterXSize_get, METH_VARARGS, (char *)"Dataset_RasterXSize_get(Dataset self) -> int"},
43066 	 { (char *)"Dataset_RasterYSize_get", _wrap_Dataset_RasterYSize_get, METH_VARARGS, (char *)"Dataset_RasterYSize_get(Dataset self) -> int"},
43067 	 { (char *)"Dataset_RasterCount_get", _wrap_Dataset_RasterCount_get, METH_VARARGS, (char *)"Dataset_RasterCount_get(Dataset self) -> int"},
43068 	 { (char *)"delete_Dataset", _wrap_delete_Dataset, METH_VARARGS, (char *)"delete_Dataset(Dataset self)"},
43069 	 { (char *)"Dataset_GetDriver", _wrap_Dataset_GetDriver, METH_VARARGS, (char *)"Dataset_GetDriver(Dataset self) -> Driver"},
43070 	 { (char *)"Dataset_GetRasterBand", _wrap_Dataset_GetRasterBand, METH_VARARGS, (char *)"Dataset_GetRasterBand(Dataset self, int nBand) -> Band"},
43071 	 { (char *)"Dataset_GetRootGroup", _wrap_Dataset_GetRootGroup, METH_VARARGS, (char *)"Dataset_GetRootGroup(Dataset self) -> Group"},
43072 	 { (char *)"Dataset_GetProjection", _wrap_Dataset_GetProjection, METH_VARARGS, (char *)"Dataset_GetProjection(Dataset self) -> char const *"},
43073 	 { (char *)"Dataset_GetProjectionRef", _wrap_Dataset_GetProjectionRef, METH_VARARGS, (char *)"Dataset_GetProjectionRef(Dataset self) -> char const *"},
43074 	 { (char *)"Dataset_GetSpatialRef", _wrap_Dataset_GetSpatialRef, METH_VARARGS, (char *)"Dataset_GetSpatialRef(Dataset self) -> SpatialReference"},
43075 	 { (char *)"Dataset_SetProjection", _wrap_Dataset_SetProjection, METH_VARARGS, (char *)"Dataset_SetProjection(Dataset self, char const * prj) -> CPLErr"},
43076 	 { (char *)"Dataset_SetSpatialRef", _wrap_Dataset_SetSpatialRef, METH_VARARGS, (char *)"Dataset_SetSpatialRef(Dataset self, SpatialReference srs) -> CPLErr"},
43077 	 { (char *)"Dataset_GetGeoTransform", (PyCFunction) _wrap_Dataset_GetGeoTransform, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_GetGeoTransform(Dataset self, int * can_return_null=None)"},
43078 	 { (char *)"Dataset_SetGeoTransform", _wrap_Dataset_SetGeoTransform, METH_VARARGS, (char *)"Dataset_SetGeoTransform(Dataset self, double [6] argin) -> CPLErr"},
43079 	 { (char *)"Dataset_BuildOverviews", (PyCFunction) _wrap_Dataset_BuildOverviews, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_BuildOverviews(Dataset self, char const * resampling, int overviewlist=0, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43080 	 { (char *)"Dataset_GetGCPCount", _wrap_Dataset_GetGCPCount, METH_VARARGS, (char *)"Dataset_GetGCPCount(Dataset self) -> int"},
43081 	 { (char *)"Dataset_GetGCPProjection", _wrap_Dataset_GetGCPProjection, METH_VARARGS, (char *)"Dataset_GetGCPProjection(Dataset self) -> char const *"},
43082 	 { (char *)"Dataset_GetGCPSpatialRef", _wrap_Dataset_GetGCPSpatialRef, METH_VARARGS, (char *)"Dataset_GetGCPSpatialRef(Dataset self) -> SpatialReference"},
43083 	 { (char *)"Dataset_GetGCPs", _wrap_Dataset_GetGCPs, METH_VARARGS, (char *)"Dataset_GetGCPs(Dataset self)"},
43084 	 { (char *)"Dataset__SetGCPs", _wrap_Dataset__SetGCPs, METH_VARARGS, (char *)"Dataset__SetGCPs(Dataset self, int nGCPs, char const * pszGCPProjection) -> CPLErr"},
43085 	 { (char *)"Dataset__SetGCPs2", _wrap_Dataset__SetGCPs2, METH_VARARGS, (char *)"Dataset__SetGCPs2(Dataset self, int nGCPs, SpatialReference hSRS) -> CPLErr"},
43086 	 { (char *)"Dataset_FlushCache", _wrap_Dataset_FlushCache, METH_VARARGS, (char *)"Dataset_FlushCache(Dataset self)"},
43087 	 { (char *)"Dataset_AddBand", (PyCFunction) _wrap_Dataset_AddBand, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_AddBand(Dataset self, GDALDataType datatype, char ** options=None) -> CPLErr"},
43088 	 { (char *)"Dataset_CreateMaskBand", _wrap_Dataset_CreateMaskBand, METH_VARARGS, (char *)"Dataset_CreateMaskBand(Dataset self, int nFlags) -> CPLErr"},
43089 	 { (char *)"Dataset_GetFileList", _wrap_Dataset_GetFileList, METH_VARARGS, (char *)"Dataset_GetFileList(Dataset self) -> char **"},
43090 	 { (char *)"Dataset_WriteRaster", (PyCFunction) _wrap_Dataset_WriteRaster, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_WriteRaster(Dataset self, int xoff, int yoff, int xsize, int ysize, GIntBig buf_len, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, int band_list=0, GIntBig * buf_pixel_space=None, GIntBig * buf_line_space=None, GIntBig * buf_band_space=None) -> CPLErr"},
43091 	 { (char *)"Dataset_AdviseRead", _wrap_Dataset_AdviseRead, METH_VARARGS, (char *)"Dataset_AdviseRead(Dataset self, int xoff, int yoff, int xsize, int ysize, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, int band_list=0, char ** options=None) -> CPLErr"},
43092 	 { (char *)"Dataset_BeginAsyncReader", (PyCFunction) _wrap_Dataset_BeginAsyncReader, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_BeginAsyncReader(Dataset self, int xOff, int yOff, int xSize, int ySize, int buf_len, int buf_xsize, int buf_ysize, GDALDataType bufType, int band_list=0, int nPixelSpace=0, int nLineSpace=0, int nBandSpace=0, char ** options=None) -> AsyncReader"},
43093 	 { (char *)"Dataset_EndAsyncReader", _wrap_Dataset_EndAsyncReader, METH_VARARGS, (char *)"Dataset_EndAsyncReader(Dataset self, AsyncReader ario)"},
43094 	 { (char *)"Dataset_GetVirtualMem", (PyCFunction) _wrap_Dataset_GetVirtualMem, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_GetVirtualMem(Dataset self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, int band_list, int bIsBandSequential, size_t nCacheSize, size_t nPageSizeHint, char ** options=None) -> VirtualMem"},
43095 	 { (char *)"Dataset_GetTiledVirtualMem", (PyCFunction) _wrap_Dataset_GetTiledVirtualMem, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_GetTiledVirtualMem(Dataset self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nTileXSize, int nTileYSize, GDALDataType eBufType, int band_list, GDALTileOrganization eTileOrganization, size_t nCacheSize, char ** options=None) -> VirtualMem"},
43096 	 { (char *)"Dataset_CreateLayer", (PyCFunction) _wrap_Dataset_CreateLayer, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_CreateLayer(Dataset self, char const * name, SpatialReference srs=None, OGRwkbGeometryType geom_type, char ** options=None) -> Layer"},
43097 	 { (char *)"Dataset_CopyLayer", (PyCFunction) _wrap_Dataset_CopyLayer, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_CopyLayer(Dataset self, Layer src_layer, char const * new_name, char ** options=None) -> Layer"},
43098 	 { (char *)"Dataset_DeleteLayer", _wrap_Dataset_DeleteLayer, METH_VARARGS, (char *)"Dataset_DeleteLayer(Dataset self, int index) -> OGRErr"},
43099 	 { (char *)"Dataset_GetLayerCount", _wrap_Dataset_GetLayerCount, METH_VARARGS, (char *)"Dataset_GetLayerCount(Dataset self) -> int"},
43100 	 { (char *)"Dataset_GetLayerByIndex", _wrap_Dataset_GetLayerByIndex, METH_VARARGS, (char *)"Dataset_GetLayerByIndex(Dataset self, int index=0) -> Layer"},
43101 	 { (char *)"Dataset_GetLayerByName", _wrap_Dataset_GetLayerByName, METH_VARARGS, (char *)"Dataset_GetLayerByName(Dataset self, char const * layer_name) -> Layer"},
43102 	 { (char *)"Dataset_ResetReading", _wrap_Dataset_ResetReading, METH_VARARGS, (char *)"Dataset_ResetReading(Dataset self)"},
43103 	 { (char *)"Dataset_GetNextFeature", (PyCFunction) _wrap_Dataset_GetNextFeature, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_GetNextFeature(Dataset self, bool include_layer=True, bool include_pct=False, GDALProgressFunc callback=0, void * callback_data=None) -> Feature"},
43104 	 { (char *)"Dataset_TestCapability", _wrap_Dataset_TestCapability, METH_VARARGS, (char *)"Dataset_TestCapability(Dataset self, char const * cap) -> bool"},
43105 	 { (char *)"Dataset_ExecuteSQL", (PyCFunction) _wrap_Dataset_ExecuteSQL, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_ExecuteSQL(Dataset self, char const * statement, Geometry spatialFilter=None, char const * dialect) -> Layer"},
43106 	 { (char *)"Dataset_ReleaseResultSet", _wrap_Dataset_ReleaseResultSet, METH_VARARGS, (char *)"Dataset_ReleaseResultSet(Dataset self, Layer layer)"},
43107 	 { (char *)"Dataset_GetStyleTable", _wrap_Dataset_GetStyleTable, METH_VARARGS, (char *)"Dataset_GetStyleTable(Dataset self) -> StyleTable"},
43108 	 { (char *)"Dataset_SetStyleTable", _wrap_Dataset_SetStyleTable, METH_VARARGS, (char *)"Dataset_SetStyleTable(Dataset self, StyleTable table)"},
43109 	 { (char *)"Dataset_AbortSQL", _wrap_Dataset_AbortSQL, METH_VARARGS, (char *)"Dataset_AbortSQL(Dataset self) -> OGRErr"},
43110 	 { (char *)"Dataset_StartTransaction", (PyCFunction) _wrap_Dataset_StartTransaction, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_StartTransaction(Dataset self, int force=False) -> OGRErr"},
43111 	 { (char *)"Dataset_CommitTransaction", _wrap_Dataset_CommitTransaction, METH_VARARGS, (char *)"Dataset_CommitTransaction(Dataset self) -> OGRErr"},
43112 	 { (char *)"Dataset_RollbackTransaction", _wrap_Dataset_RollbackTransaction, METH_VARARGS, (char *)"Dataset_RollbackTransaction(Dataset self) -> OGRErr"},
43113 	 { (char *)"Dataset_ClearStatistics", _wrap_Dataset_ClearStatistics, METH_VARARGS, (char *)"Dataset_ClearStatistics(Dataset self)"},
43114 	 { (char *)"Dataset_GetFieldDomain", _wrap_Dataset_GetFieldDomain, METH_VARARGS, (char *)"Dataset_GetFieldDomain(Dataset self, char const * name) -> FieldDomain"},
43115 	 { (char *)"Dataset_AddFieldDomain", _wrap_Dataset_AddFieldDomain, METH_VARARGS, (char *)"Dataset_AddFieldDomain(Dataset self, FieldDomain fieldDomain) -> bool"},
43116 	 { (char *)"Dataset_ReadRaster1", (PyCFunction) _wrap_Dataset_ReadRaster1, METH_VARARGS | METH_KEYWORDS, (char *)"Dataset_ReadRaster1(Dataset self, double xoff, double yoff, double xsize, double ysize, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, int band_list=0, GIntBig * buf_pixel_space=None, GIntBig * buf_line_space=None, GIntBig * buf_band_space=None, GDALRIOResampleAlg resample_alg, GDALProgressFunc callback=0, void * callback_data=None, void * inputOutputBuf=None) -> CPLErr"},
43117 	 { (char *)"Dataset_swigregister", Dataset_swigregister, METH_VARARGS, NULL},
43118 	 { (char *)"delete_Group", _wrap_delete_Group, METH_VARARGS, (char *)"delete_Group(Group self)"},
43119 	 { (char *)"Group_GetName", _wrap_Group_GetName, METH_VARARGS, (char *)"Group_GetName(Group self) -> char const *"},
43120 	 { (char *)"Group_GetFullName", _wrap_Group_GetFullName, METH_VARARGS, (char *)"Group_GetFullName(Group self) -> char const *"},
43121 	 { (char *)"Group_GetMDArrayNames", _wrap_Group_GetMDArrayNames, METH_VARARGS, (char *)"Group_GetMDArrayNames(Group self, char ** options=None) -> char **"},
43122 	 { (char *)"Group_OpenMDArray", _wrap_Group_OpenMDArray, METH_VARARGS, (char *)"Group_OpenMDArray(Group self, char const * name, char ** options=None) -> MDArray"},
43123 	 { (char *)"Group_OpenMDArrayFromFullname", _wrap_Group_OpenMDArrayFromFullname, METH_VARARGS, (char *)"Group_OpenMDArrayFromFullname(Group self, char const * name, char ** options=None) -> MDArray"},
43124 	 { (char *)"Group_ResolveMDArray", _wrap_Group_ResolveMDArray, METH_VARARGS, (char *)"Group_ResolveMDArray(Group self, char const * name, char const * starting_point, char ** options=None) -> MDArray"},
43125 	 { (char *)"Group_GetGroupNames", _wrap_Group_GetGroupNames, METH_VARARGS, (char *)"Group_GetGroupNames(Group self, char ** options=None) -> char **"},
43126 	 { (char *)"Group_OpenGroup", _wrap_Group_OpenGroup, METH_VARARGS, (char *)"Group_OpenGroup(Group self, char const * name, char ** options=None) -> Group"},
43127 	 { (char *)"Group_OpenGroupFromFullname", _wrap_Group_OpenGroupFromFullname, METH_VARARGS, (char *)"Group_OpenGroupFromFullname(Group self, char const * name, char ** options=None) -> Group"},
43128 	 { (char *)"Group_GetDimensions", _wrap_Group_GetDimensions, METH_VARARGS, (char *)"Group_GetDimensions(Group self, char ** options=None)"},
43129 	 { (char *)"Group_GetAttribute", _wrap_Group_GetAttribute, METH_VARARGS, (char *)"Group_GetAttribute(Group self, char const * name) -> Attribute"},
43130 	 { (char *)"Group_GetAttributes", _wrap_Group_GetAttributes, METH_VARARGS, (char *)"Group_GetAttributes(Group self, char ** options=None)"},
43131 	 { (char *)"Group_GetStructuralInfo", _wrap_Group_GetStructuralInfo, METH_VARARGS, (char *)"Group_GetStructuralInfo(Group self) -> char **"},
43132 	 { (char *)"Group_CreateGroup", _wrap_Group_CreateGroup, METH_VARARGS, (char *)"Group_CreateGroup(Group self, char const * name, char ** options=None) -> Group"},
43133 	 { (char *)"Group_CreateDimension", _wrap_Group_CreateDimension, METH_VARARGS, (char *)"Group_CreateDimension(Group self, char const * name, char const * type, char const * direction, unsigned long long size, char ** options=None) -> Dimension"},
43134 	 { (char *)"Group_CreateMDArray", _wrap_Group_CreateMDArray, METH_VARARGS, (char *)"Group_CreateMDArray(Group self, char const * name, int nDimensions, ExtendedDataType data_type, char ** options=None) -> MDArray"},
43135 	 { (char *)"Group_CreateAttribute", _wrap_Group_CreateAttribute, METH_VARARGS, (char *)"Group_CreateAttribute(Group self, char const * name, int nDimensions, ExtendedDataType data_type, char ** options=None) -> Attribute"},
43136 	 { (char *)"Group_swigregister", Group_swigregister, METH_VARARGS, NULL},
43137 	 { (char *)"Statistics_min_get", _wrap_Statistics_min_get, METH_VARARGS, (char *)"Statistics_min_get(Statistics self) -> double"},
43138 	 { (char *)"Statistics_max_get", _wrap_Statistics_max_get, METH_VARARGS, (char *)"Statistics_max_get(Statistics self) -> double"},
43139 	 { (char *)"Statistics_mean_get", _wrap_Statistics_mean_get, METH_VARARGS, (char *)"Statistics_mean_get(Statistics self) -> double"},
43140 	 { (char *)"Statistics_std_dev_get", _wrap_Statistics_std_dev_get, METH_VARARGS, (char *)"Statistics_std_dev_get(Statistics self) -> double"},
43141 	 { (char *)"Statistics_valid_count_get", _wrap_Statistics_valid_count_get, METH_VARARGS, (char *)"Statistics_valid_count_get(Statistics self) -> GIntBig"},
43142 	 { (char *)"delete_Statistics", _wrap_delete_Statistics, METH_VARARGS, (char *)"delete_Statistics(Statistics self)"},
43143 	 { (char *)"new_Statistics", _wrap_new_Statistics, METH_VARARGS, (char *)"new_Statistics() -> Statistics"},
43144 	 { (char *)"Statistics_swigregister", Statistics_swigregister, METH_VARARGS, NULL},
43145 	 { (char *)"delete_MDArray", _wrap_delete_MDArray, METH_VARARGS, (char *)"delete_MDArray(MDArray self)"},
43146 	 { (char *)"MDArray_GetName", _wrap_MDArray_GetName, METH_VARARGS, (char *)"MDArray_GetName(MDArray self) -> char const *"},
43147 	 { (char *)"MDArray_GetFullName", _wrap_MDArray_GetFullName, METH_VARARGS, (char *)"MDArray_GetFullName(MDArray self) -> char const *"},
43148 	 { (char *)"MDArray_GetTotalElementsCount", _wrap_MDArray_GetTotalElementsCount, METH_VARARGS, (char *)"MDArray_GetTotalElementsCount(MDArray self) -> unsigned long long"},
43149 	 { (char *)"MDArray_GetDimensionCount", _wrap_MDArray_GetDimensionCount, METH_VARARGS, (char *)"MDArray_GetDimensionCount(MDArray self) -> size_t"},
43150 	 { (char *)"MDArray_GetDimensions", _wrap_MDArray_GetDimensions, METH_VARARGS, (char *)"MDArray_GetDimensions(MDArray self)"},
43151 	 { (char *)"MDArray_GetBlockSize", _wrap_MDArray_GetBlockSize, METH_VARARGS, (char *)"MDArray_GetBlockSize(MDArray self)"},
43152 	 { (char *)"MDArray_GetProcessingChunkSize", _wrap_MDArray_GetProcessingChunkSize, METH_VARARGS, (char *)"MDArray_GetProcessingChunkSize(MDArray self, size_t nMaxChunkMemory)"},
43153 	 { (char *)"MDArray_GetDataType", _wrap_MDArray_GetDataType, METH_VARARGS, (char *)"MDArray_GetDataType(MDArray self) -> ExtendedDataType"},
43154 	 { (char *)"MDArray_GetStructuralInfo", _wrap_MDArray_GetStructuralInfo, METH_VARARGS, (char *)"MDArray_GetStructuralInfo(MDArray self) -> char **"},
43155 	 { (char *)"MDArray_Read", _wrap_MDArray_Read, METH_VARARGS, (char *)"MDArray_Read(MDArray self, int nDims1, int nDims2, int nDims3, int nDims4, ExtendedDataType buffer_datatype) -> CPLErr"},
43156 	 { (char *)"MDArray_WriteStringArray", _wrap_MDArray_WriteStringArray, METH_VARARGS, (char *)"MDArray_WriteStringArray(MDArray self, int nDims1, int nDims2, int nDims3, ExtendedDataType buffer_datatype, char ** options) -> CPLErr"},
43157 	 { (char *)"MDArray_Write", _wrap_MDArray_Write, METH_VARARGS, (char *)"MDArray_Write(MDArray self, int nDims1, int nDims2, int nDims3, int nDims4, ExtendedDataType buffer_datatype, GIntBig buf_len) -> CPLErr"},
43158 	 { (char *)"MDArray_AdviseRead", _wrap_MDArray_AdviseRead, METH_VARARGS, (char *)"MDArray_AdviseRead(MDArray self, int nDims1, int nDims2) -> CPLErr"},
43159 	 { (char *)"MDArray_GetAttribute", _wrap_MDArray_GetAttribute, METH_VARARGS, (char *)"MDArray_GetAttribute(MDArray self, char const * name) -> Attribute"},
43160 	 { (char *)"MDArray_GetAttributes", _wrap_MDArray_GetAttributes, METH_VARARGS, (char *)"MDArray_GetAttributes(MDArray self, char ** options=None)"},
43161 	 { (char *)"MDArray_CreateAttribute", _wrap_MDArray_CreateAttribute, METH_VARARGS, (char *)"MDArray_CreateAttribute(MDArray self, char const * name, int nDimensions, ExtendedDataType data_type, char ** options=None) -> Attribute"},
43162 	 { (char *)"MDArray_GetNoDataValueAsRaw", _wrap_MDArray_GetNoDataValueAsRaw, METH_VARARGS, (char *)"MDArray_GetNoDataValueAsRaw(MDArray self) -> CPLErr"},
43163 	 { (char *)"MDArray_GetNoDataValueAsDouble", _wrap_MDArray_GetNoDataValueAsDouble, METH_VARARGS, (char *)"MDArray_GetNoDataValueAsDouble(MDArray self)"},
43164 	 { (char *)"MDArray_SetNoDataValueDouble", _wrap_MDArray_SetNoDataValueDouble, METH_VARARGS, (char *)"MDArray_SetNoDataValueDouble(MDArray self, double d) -> CPLErr"},
43165 	 { (char *)"MDArray_SetNoDataValueRaw", _wrap_MDArray_SetNoDataValueRaw, METH_VARARGS, (char *)"MDArray_SetNoDataValueRaw(MDArray self, GIntBig nLen) -> CPLErr"},
43166 	 { (char *)"MDArray_DeleteNoDataValue", _wrap_MDArray_DeleteNoDataValue, METH_VARARGS, (char *)"MDArray_DeleteNoDataValue(MDArray self) -> CPLErr"},
43167 	 { (char *)"MDArray_GetOffset", _wrap_MDArray_GetOffset, METH_VARARGS, (char *)"MDArray_GetOffset(MDArray self)"},
43168 	 { (char *)"MDArray_GetOffsetStorageType", _wrap_MDArray_GetOffsetStorageType, METH_VARARGS, (char *)"MDArray_GetOffsetStorageType(MDArray self) -> GDALDataType"},
43169 	 { (char *)"MDArray_GetScale", _wrap_MDArray_GetScale, METH_VARARGS, (char *)"MDArray_GetScale(MDArray self)"},
43170 	 { (char *)"MDArray_GetScaleStorageType", _wrap_MDArray_GetScaleStorageType, METH_VARARGS, (char *)"MDArray_GetScaleStorageType(MDArray self) -> GDALDataType"},
43171 	 { (char *)"MDArray_SetOffset", (PyCFunction) _wrap_MDArray_SetOffset, METH_VARARGS | METH_KEYWORDS, (char *)"MDArray_SetOffset(MDArray self, double val, GDALDataType storageType) -> CPLErr"},
43172 	 { (char *)"MDArray_SetScale", (PyCFunction) _wrap_MDArray_SetScale, METH_VARARGS | METH_KEYWORDS, (char *)"MDArray_SetScale(MDArray self, double val, GDALDataType storageType) -> CPLErr"},
43173 	 { (char *)"MDArray_SetUnit", _wrap_MDArray_SetUnit, METH_VARARGS, (char *)"MDArray_SetUnit(MDArray self, char const * unit) -> CPLErr"},
43174 	 { (char *)"MDArray_GetUnit", _wrap_MDArray_GetUnit, METH_VARARGS, (char *)"MDArray_GetUnit(MDArray self) -> char const *"},
43175 	 { (char *)"MDArray_SetSpatialRef", _wrap_MDArray_SetSpatialRef, METH_VARARGS, (char *)"MDArray_SetSpatialRef(MDArray self, SpatialReference srs) -> OGRErr"},
43176 	 { (char *)"MDArray_GetSpatialRef", _wrap_MDArray_GetSpatialRef, METH_VARARGS, (char *)"MDArray_GetSpatialRef(MDArray self) -> SpatialReference"},
43177 	 { (char *)"MDArray_GetView", _wrap_MDArray_GetView, METH_VARARGS, (char *)"MDArray_GetView(MDArray self, char const * viewExpr) -> MDArray"},
43178 	 { (char *)"MDArray_Transpose", _wrap_MDArray_Transpose, METH_VARARGS, (char *)"MDArray_Transpose(MDArray self, int nList) -> MDArray"},
43179 	 { (char *)"MDArray_GetUnscaled", _wrap_MDArray_GetUnscaled, METH_VARARGS, (char *)"MDArray_GetUnscaled(MDArray self) -> MDArray"},
43180 	 { (char *)"MDArray_GetMask", _wrap_MDArray_GetMask, METH_VARARGS, (char *)"MDArray_GetMask(MDArray self, char ** options=None) -> MDArray"},
43181 	 { (char *)"MDArray_AsClassicDataset", _wrap_MDArray_AsClassicDataset, METH_VARARGS, (char *)"MDArray_AsClassicDataset(MDArray self, size_t iXDim, size_t iYDim) -> Dataset"},
43182 	 { (char *)"MDArray_GetStatistics", (PyCFunction) _wrap_MDArray_GetStatistics, METH_VARARGS | METH_KEYWORDS, (char *)"MDArray_GetStatistics(MDArray self, Dataset ds=None, bool approx_ok=False, bool force=True, GDALProgressFunc callback=0, void * callback_data=None) -> Statistics"},
43183 	 { (char *)"MDArray_ComputeStatistics", (PyCFunction) _wrap_MDArray_ComputeStatistics, METH_VARARGS | METH_KEYWORDS, (char *)"MDArray_ComputeStatistics(MDArray self, Dataset ds=None, bool approx_ok=False, GDALProgressFunc callback=0, void * callback_data=None) -> Statistics"},
43184 	 { (char *)"MDArray_swigregister", MDArray_swigregister, METH_VARARGS, NULL},
43185 	 { (char *)"delete_Attribute", _wrap_delete_Attribute, METH_VARARGS, (char *)"delete_Attribute(Attribute self)"},
43186 	 { (char *)"Attribute_GetName", _wrap_Attribute_GetName, METH_VARARGS, (char *)"Attribute_GetName(Attribute self) -> char const *"},
43187 	 { (char *)"Attribute_GetFullName", _wrap_Attribute_GetFullName, METH_VARARGS, (char *)"Attribute_GetFullName(Attribute self) -> char const *"},
43188 	 { (char *)"Attribute_GetTotalElementsCount", _wrap_Attribute_GetTotalElementsCount, METH_VARARGS, (char *)"Attribute_GetTotalElementsCount(Attribute self) -> unsigned long long"},
43189 	 { (char *)"Attribute_GetDimensionCount", _wrap_Attribute_GetDimensionCount, METH_VARARGS, (char *)"Attribute_GetDimensionCount(Attribute self) -> size_t"},
43190 	 { (char *)"Attribute_GetDimensionsSize", _wrap_Attribute_GetDimensionsSize, METH_VARARGS, (char *)"Attribute_GetDimensionsSize(Attribute self)"},
43191 	 { (char *)"Attribute_GetDataType", _wrap_Attribute_GetDataType, METH_VARARGS, (char *)"Attribute_GetDataType(Attribute self) -> ExtendedDataType"},
43192 	 { (char *)"Attribute_ReadAsRaw", _wrap_Attribute_ReadAsRaw, METH_VARARGS, (char *)"Attribute_ReadAsRaw(Attribute self) -> CPLErr"},
43193 	 { (char *)"Attribute_ReadAsString", _wrap_Attribute_ReadAsString, METH_VARARGS, (char *)"Attribute_ReadAsString(Attribute self) -> char const *"},
43194 	 { (char *)"Attribute_ReadAsInt", _wrap_Attribute_ReadAsInt, METH_VARARGS, (char *)"Attribute_ReadAsInt(Attribute self) -> int"},
43195 	 { (char *)"Attribute_ReadAsDouble", _wrap_Attribute_ReadAsDouble, METH_VARARGS, (char *)"Attribute_ReadAsDouble(Attribute self) -> double"},
43196 	 { (char *)"Attribute_ReadAsStringArray", _wrap_Attribute_ReadAsStringArray, METH_VARARGS, (char *)"Attribute_ReadAsStringArray(Attribute self) -> char **"},
43197 	 { (char *)"Attribute_ReadAsIntArray", _wrap_Attribute_ReadAsIntArray, METH_VARARGS, (char *)"Attribute_ReadAsIntArray(Attribute self)"},
43198 	 { (char *)"Attribute_ReadAsDoubleArray", _wrap_Attribute_ReadAsDoubleArray, METH_VARARGS, (char *)"Attribute_ReadAsDoubleArray(Attribute self)"},
43199 	 { (char *)"Attribute_WriteRaw", _wrap_Attribute_WriteRaw, METH_VARARGS, (char *)"Attribute_WriteRaw(Attribute self, GIntBig nLen) -> CPLErr"},
43200 	 { (char *)"Attribute_WriteString", _wrap_Attribute_WriteString, METH_VARARGS, (char *)"Attribute_WriteString(Attribute self, char const * val) -> CPLErr"},
43201 	 { (char *)"Attribute_WriteStringArray", _wrap_Attribute_WriteStringArray, METH_VARARGS, (char *)"Attribute_WriteStringArray(Attribute self, char ** vals) -> CPLErr"},
43202 	 { (char *)"Attribute_WriteInt", _wrap_Attribute_WriteInt, METH_VARARGS, (char *)"Attribute_WriteInt(Attribute self, int val) -> CPLErr"},
43203 	 { (char *)"Attribute_WriteDouble", _wrap_Attribute_WriteDouble, METH_VARARGS, (char *)"Attribute_WriteDouble(Attribute self, double val) -> CPLErr"},
43204 	 { (char *)"Attribute_WriteDoubleArray", _wrap_Attribute_WriteDoubleArray, METH_VARARGS, (char *)"Attribute_WriteDoubleArray(Attribute self, int nList) -> CPLErr"},
43205 	 { (char *)"Attribute_swigregister", Attribute_swigregister, METH_VARARGS, NULL},
43206 	 { (char *)"delete_Dimension", _wrap_delete_Dimension, METH_VARARGS, (char *)"delete_Dimension(Dimension self)"},
43207 	 { (char *)"Dimension_GetName", _wrap_Dimension_GetName, METH_VARARGS, (char *)"Dimension_GetName(Dimension self) -> char const *"},
43208 	 { (char *)"Dimension_GetFullName", _wrap_Dimension_GetFullName, METH_VARARGS, (char *)"Dimension_GetFullName(Dimension self) -> char const *"},
43209 	 { (char *)"Dimension_GetType", _wrap_Dimension_GetType, METH_VARARGS, (char *)"Dimension_GetType(Dimension self) -> char const *"},
43210 	 { (char *)"Dimension_GetDirection", _wrap_Dimension_GetDirection, METH_VARARGS, (char *)"Dimension_GetDirection(Dimension self) -> char const *"},
43211 	 { (char *)"Dimension_GetSize", _wrap_Dimension_GetSize, METH_VARARGS, (char *)"Dimension_GetSize(Dimension self) -> unsigned long long"},
43212 	 { (char *)"Dimension_GetIndexingVariable", _wrap_Dimension_GetIndexingVariable, METH_VARARGS, (char *)"Dimension_GetIndexingVariable(Dimension self) -> MDArray"},
43213 	 { (char *)"Dimension_SetIndexingVariable", _wrap_Dimension_SetIndexingVariable, METH_VARARGS, (char *)"Dimension_SetIndexingVariable(Dimension self, MDArray array) -> bool"},
43214 	 { (char *)"Dimension_swigregister", Dimension_swigregister, METH_VARARGS, NULL},
43215 	 { (char *)"delete_ExtendedDataType", _wrap_delete_ExtendedDataType, METH_VARARGS, (char *)"delete_ExtendedDataType(ExtendedDataType self)"},
43216 	 { (char *)"ExtendedDataType_Create", _wrap_ExtendedDataType_Create, METH_VARARGS, (char *)"ExtendedDataType_Create(GDALDataType dt) -> ExtendedDataType"},
43217 	 { (char *)"ExtendedDataType_CreateString", _wrap_ExtendedDataType_CreateString, METH_VARARGS, (char *)"ExtendedDataType_CreateString(size_t nMaxStringLength=0) -> ExtendedDataType"},
43218 	 { (char *)"ExtendedDataType_CreateCompound", _wrap_ExtendedDataType_CreateCompound, METH_VARARGS, (char *)"ExtendedDataType_CreateCompound(char const * name, size_t nTotalSize, int nComps) -> ExtendedDataType"},
43219 	 { (char *)"ExtendedDataType_GetName", _wrap_ExtendedDataType_GetName, METH_VARARGS, (char *)"ExtendedDataType_GetName(ExtendedDataType self) -> char const *"},
43220 	 { (char *)"ExtendedDataType_GetClass", _wrap_ExtendedDataType_GetClass, METH_VARARGS, (char *)"ExtendedDataType_GetClass(ExtendedDataType self) -> GDALExtendedDataTypeClass"},
43221 	 { (char *)"ExtendedDataType_GetNumericDataType", _wrap_ExtendedDataType_GetNumericDataType, METH_VARARGS, (char *)"ExtendedDataType_GetNumericDataType(ExtendedDataType self) -> GDALDataType"},
43222 	 { (char *)"ExtendedDataType_GetSize", _wrap_ExtendedDataType_GetSize, METH_VARARGS, (char *)"ExtendedDataType_GetSize(ExtendedDataType self) -> size_t"},
43223 	 { (char *)"ExtendedDataType_GetMaxStringLength", _wrap_ExtendedDataType_GetMaxStringLength, METH_VARARGS, (char *)"ExtendedDataType_GetMaxStringLength(ExtendedDataType self) -> size_t"},
43224 	 { (char *)"ExtendedDataType_GetComponents", _wrap_ExtendedDataType_GetComponents, METH_VARARGS, (char *)"ExtendedDataType_GetComponents(ExtendedDataType self)"},
43225 	 { (char *)"ExtendedDataType_CanConvertTo", _wrap_ExtendedDataType_CanConvertTo, METH_VARARGS, (char *)"ExtendedDataType_CanConvertTo(ExtendedDataType self, ExtendedDataType other) -> bool"},
43226 	 { (char *)"ExtendedDataType_Equals", _wrap_ExtendedDataType_Equals, METH_VARARGS, (char *)"ExtendedDataType_Equals(ExtendedDataType self, ExtendedDataType other) -> bool"},
43227 	 { (char *)"ExtendedDataType_swigregister", ExtendedDataType_swigregister, METH_VARARGS, NULL},
43228 	 { (char *)"delete_EDTComponent", _wrap_delete_EDTComponent, METH_VARARGS, (char *)"delete_EDTComponent(EDTComponent self)"},
43229 	 { (char *)"EDTComponent_Create", _wrap_EDTComponent_Create, METH_VARARGS, (char *)"EDTComponent_Create(char const * name, size_t offset, ExtendedDataType type) -> EDTComponent"},
43230 	 { (char *)"EDTComponent_GetName", _wrap_EDTComponent_GetName, METH_VARARGS, (char *)"EDTComponent_GetName(EDTComponent self) -> char const *"},
43231 	 { (char *)"EDTComponent_GetOffset", _wrap_EDTComponent_GetOffset, METH_VARARGS, (char *)"EDTComponent_GetOffset(EDTComponent self) -> size_t"},
43232 	 { (char *)"EDTComponent_GetType", _wrap_EDTComponent_GetType, METH_VARARGS, (char *)"EDTComponent_GetType(EDTComponent self) -> ExtendedDataType"},
43233 	 { (char *)"EDTComponent_swigregister", EDTComponent_swigregister, METH_VARARGS, NULL},
43234 	 { (char *)"Band_XSize_get", _wrap_Band_XSize_get, METH_VARARGS, (char *)"Band_XSize_get(Band self) -> int"},
43235 	 { (char *)"Band_YSize_get", _wrap_Band_YSize_get, METH_VARARGS, (char *)"Band_YSize_get(Band self) -> int"},
43236 	 { (char *)"Band_DataType_get", _wrap_Band_DataType_get, METH_VARARGS, (char *)"Band_DataType_get(Band self) -> GDALDataType"},
43237 	 { (char *)"Band_GetDataset", _wrap_Band_GetDataset, METH_VARARGS, (char *)"Band_GetDataset(Band self) -> Dataset"},
43238 	 { (char *)"Band_GetBand", _wrap_Band_GetBand, METH_VARARGS, (char *)"Band_GetBand(Band self) -> int"},
43239 	 { (char *)"Band_GetBlockSize", _wrap_Band_GetBlockSize, METH_VARARGS, (char *)"Band_GetBlockSize(Band self)"},
43240 	 { (char *)"Band_GetActualBlockSize", _wrap_Band_GetActualBlockSize, METH_VARARGS, (char *)"Band_GetActualBlockSize(Band self, int nXBlockOff, int nYBlockOff)"},
43241 	 { (char *)"Band_GetColorInterpretation", _wrap_Band_GetColorInterpretation, METH_VARARGS, (char *)"Band_GetColorInterpretation(Band self) -> GDALColorInterp"},
43242 	 { (char *)"Band_GetRasterColorInterpretation", _wrap_Band_GetRasterColorInterpretation, METH_VARARGS, (char *)"Band_GetRasterColorInterpretation(Band self) -> GDALColorInterp"},
43243 	 { (char *)"Band_SetColorInterpretation", _wrap_Band_SetColorInterpretation, METH_VARARGS, (char *)"Band_SetColorInterpretation(Band self, GDALColorInterp val) -> CPLErr"},
43244 	 { (char *)"Band_SetRasterColorInterpretation", _wrap_Band_SetRasterColorInterpretation, METH_VARARGS, (char *)"Band_SetRasterColorInterpretation(Band self, GDALColorInterp val) -> CPLErr"},
43245 	 { (char *)"Band_GetNoDataValue", _wrap_Band_GetNoDataValue, METH_VARARGS, (char *)"Band_GetNoDataValue(Band self)"},
43246 	 { (char *)"Band_SetNoDataValue", _wrap_Band_SetNoDataValue, METH_VARARGS, (char *)"Band_SetNoDataValue(Band self, double d) -> CPLErr"},
43247 	 { (char *)"Band_DeleteNoDataValue", _wrap_Band_DeleteNoDataValue, METH_VARARGS, (char *)"Band_DeleteNoDataValue(Band self) -> CPLErr"},
43248 	 { (char *)"Band_GetUnitType", _wrap_Band_GetUnitType, METH_VARARGS, (char *)"Band_GetUnitType(Band self) -> char const *"},
43249 	 { (char *)"Band_SetUnitType", _wrap_Band_SetUnitType, METH_VARARGS, (char *)"Band_SetUnitType(Band self, char const * val) -> CPLErr"},
43250 	 { (char *)"Band_GetRasterCategoryNames", _wrap_Band_GetRasterCategoryNames, METH_VARARGS, (char *)"Band_GetRasterCategoryNames(Band self) -> char **"},
43251 	 { (char *)"Band_SetRasterCategoryNames", _wrap_Band_SetRasterCategoryNames, METH_VARARGS, (char *)"Band_SetRasterCategoryNames(Band self, char ** names) -> CPLErr"},
43252 	 { (char *)"Band_GetMinimum", _wrap_Band_GetMinimum, METH_VARARGS, (char *)"Band_GetMinimum(Band self)"},
43253 	 { (char *)"Band_GetMaximum", _wrap_Band_GetMaximum, METH_VARARGS, (char *)"Band_GetMaximum(Band self)"},
43254 	 { (char *)"Band_GetOffset", _wrap_Band_GetOffset, METH_VARARGS, (char *)"Band_GetOffset(Band self)"},
43255 	 { (char *)"Band_GetScale", _wrap_Band_GetScale, METH_VARARGS, (char *)"Band_GetScale(Band self)"},
43256 	 { (char *)"Band_SetOffset", _wrap_Band_SetOffset, METH_VARARGS, (char *)"Band_SetOffset(Band self, double val) -> CPLErr"},
43257 	 { (char *)"Band_SetScale", _wrap_Band_SetScale, METH_VARARGS, (char *)"Band_SetScale(Band self, double val) -> CPLErr"},
43258 	 { (char *)"Band_GetStatistics", _wrap_Band_GetStatistics, METH_VARARGS, (char *)"Band_GetStatistics(Band self, int approx_ok, int force) -> CPLErr"},
43259 	 { (char *)"Band_ComputeStatistics", _wrap_Band_ComputeStatistics, METH_VARARGS, (char *)"Band_ComputeStatistics(Band self, bool approx_ok, GDALProgressFunc callback=0, void * callback_data=None) -> CPLErr"},
43260 	 { (char *)"Band_SetStatistics", _wrap_Band_SetStatistics, METH_VARARGS, (char *)"Band_SetStatistics(Band self, double min, double max, double mean, double stddev) -> CPLErr"},
43261 	 { (char *)"Band_GetOverviewCount", _wrap_Band_GetOverviewCount, METH_VARARGS, (char *)"Band_GetOverviewCount(Band self) -> int"},
43262 	 { (char *)"Band_GetOverview", _wrap_Band_GetOverview, METH_VARARGS, (char *)"Band_GetOverview(Band self, int i) -> Band"},
43263 	 { (char *)"Band_Checksum", (PyCFunction) _wrap_Band_Checksum, METH_VARARGS | METH_KEYWORDS, (char *)"Band_Checksum(Band self, int xoff=0, int yoff=0, int * xsize=None, int * ysize=None) -> int"},
43264 	 { (char *)"Band_ComputeRasterMinMax", _wrap_Band_ComputeRasterMinMax, METH_VARARGS, (char *)"Band_ComputeRasterMinMax(Band self, int approx_ok=0)"},
43265 	 { (char *)"Band_ComputeBandStats", _wrap_Band_ComputeBandStats, METH_VARARGS, (char *)"Band_ComputeBandStats(Band self, int samplestep=1)"},
43266 	 { (char *)"Band_Fill", _wrap_Band_Fill, METH_VARARGS, (char *)"Band_Fill(Band self, double real_fill, double imag_fill=0.0) -> CPLErr"},
43267 	 { (char *)"Band_WriteRaster", (PyCFunction) _wrap_Band_WriteRaster, METH_VARARGS | METH_KEYWORDS, (char *)"Band_WriteRaster(Band self, int xoff, int yoff, int xsize, int ysize, GIntBig buf_len, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, GIntBig * buf_pixel_space=None, GIntBig * buf_line_space=None) -> CPLErr"},
43268 	 { (char *)"Band_FlushCache", _wrap_Band_FlushCache, METH_VARARGS, (char *)"Band_FlushCache(Band self)"},
43269 	 { (char *)"Band_GetRasterColorTable", _wrap_Band_GetRasterColorTable, METH_VARARGS, (char *)"Band_GetRasterColorTable(Band self) -> ColorTable"},
43270 	 { (char *)"Band_GetColorTable", _wrap_Band_GetColorTable, METH_VARARGS, (char *)"Band_GetColorTable(Band self) -> ColorTable"},
43271 	 { (char *)"Band_SetRasterColorTable", _wrap_Band_SetRasterColorTable, METH_VARARGS, (char *)"Band_SetRasterColorTable(Band self, ColorTable arg) -> int"},
43272 	 { (char *)"Band_SetColorTable", _wrap_Band_SetColorTable, METH_VARARGS, (char *)"Band_SetColorTable(Band self, ColorTable arg) -> int"},
43273 	 { (char *)"Band_GetDefaultRAT", _wrap_Band_GetDefaultRAT, METH_VARARGS, (char *)"Band_GetDefaultRAT(Band self) -> RasterAttributeTable"},
43274 	 { (char *)"Band_SetDefaultRAT", _wrap_Band_SetDefaultRAT, METH_VARARGS, (char *)"Band_SetDefaultRAT(Band self, RasterAttributeTable table) -> int"},
43275 	 { (char *)"Band_GetMaskBand", _wrap_Band_GetMaskBand, METH_VARARGS, (char *)"Band_GetMaskBand(Band self) -> Band"},
43276 	 { (char *)"Band_GetMaskFlags", _wrap_Band_GetMaskFlags, METH_VARARGS, (char *)"Band_GetMaskFlags(Band self) -> int"},
43277 	 { (char *)"Band_CreateMaskBand", _wrap_Band_CreateMaskBand, METH_VARARGS, (char *)"Band_CreateMaskBand(Band self, int nFlags) -> CPLErr"},
43278 	 { (char *)"Band_GetHistogram", (PyCFunction) _wrap_Band_GetHistogram, METH_VARARGS | METH_KEYWORDS, (char *)"Band_GetHistogram(Band self, double min=-0.5, double max=255.5, int buckets=256, int include_out_of_range=0, int approx_ok=1, GDALProgressFunc callback=0, void * callback_data=None) -> CPLErr"},
43279 	 { (char *)"Band_GetDefaultHistogram", (PyCFunction) _wrap_Band_GetDefaultHistogram, METH_VARARGS | METH_KEYWORDS, (char *)"Band_GetDefaultHistogram(Band self, double * min_ret=None, double * max_ret=None, int * buckets_ret=None, GUIntBig ** ppanHistogram=None, int force=1, GDALProgressFunc callback=0, void * callback_data=None) -> CPLErr"},
43280 	 { (char *)"Band_SetDefaultHistogram", _wrap_Band_SetDefaultHistogram, METH_VARARGS, (char *)"Band_SetDefaultHistogram(Band self, double min, double max, int buckets_in) -> CPLErr"},
43281 	 { (char *)"Band_HasArbitraryOverviews", _wrap_Band_HasArbitraryOverviews, METH_VARARGS, (char *)"Band_HasArbitraryOverviews(Band self) -> bool"},
43282 	 { (char *)"Band_GetCategoryNames", _wrap_Band_GetCategoryNames, METH_VARARGS, (char *)"Band_GetCategoryNames(Band self) -> char **"},
43283 	 { (char *)"Band_SetCategoryNames", _wrap_Band_SetCategoryNames, METH_VARARGS, (char *)"Band_SetCategoryNames(Band self, char ** papszCategoryNames) -> CPLErr"},
43284 	 { (char *)"Band_GetVirtualMem", (PyCFunction) _wrap_Band_GetVirtualMem, METH_VARARGS | METH_KEYWORDS, (char *)"Band_GetVirtualMem(Band self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nBufXSize, int nBufYSize, GDALDataType eBufType, size_t nCacheSize, size_t nPageSizeHint, char ** options=None) -> VirtualMem"},
43285 	 { (char *)"Band_GetVirtualMemAuto", (PyCFunction) _wrap_Band_GetVirtualMemAuto, METH_VARARGS | METH_KEYWORDS, (char *)"Band_GetVirtualMemAuto(Band self, GDALRWFlag eRWFlag, char ** options=None) -> VirtualMem"},
43286 	 { (char *)"Band_GetTiledVirtualMem", (PyCFunction) _wrap_Band_GetTiledVirtualMem, METH_VARARGS | METH_KEYWORDS, (char *)"Band_GetTiledVirtualMem(Band self, GDALRWFlag eRWFlag, int nXOff, int nYOff, int nXSize, int nYSize, int nTileXSize, int nTileYSize, GDALDataType eBufType, size_t nCacheSize, char ** options=None) -> VirtualMem"},
43287 	 { (char *)"Band_GetDataCoverageStatus", _wrap_Band_GetDataCoverageStatus, METH_VARARGS, (char *)"Band_GetDataCoverageStatus(Band self, int nXOff, int nYOff, int nXSize, int nYSize, int nMaskFlagStop=0) -> int"},
43288 	 { (char *)"Band_AdviseRead", _wrap_Band_AdviseRead, METH_VARARGS, (char *)"Band_AdviseRead(Band self, int xoff, int yoff, int xsize, int ysize, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, char ** options=None) -> CPLErr"},
43289 	 { (char *)"Band_AsMDArray", _wrap_Band_AsMDArray, METH_VARARGS, (char *)"Band_AsMDArray(Band self) -> MDArray"},
43290 	 { (char *)"Band_ReadRaster1", (PyCFunction) _wrap_Band_ReadRaster1, METH_VARARGS | METH_KEYWORDS, (char *)"Band_ReadRaster1(Band self, double xoff, double yoff, double xsize, double ysize, int * buf_xsize=None, int * buf_ysize=None, GDALDataType * buf_type=None, GIntBig * buf_pixel_space=None, GIntBig * buf_line_space=None, GDALRIOResampleAlg resample_alg, GDALProgressFunc callback=0, void * callback_data=None, void * inputOutputBuf=None) -> CPLErr"},
43291 	 { (char *)"Band_ReadBlock", (PyCFunction) _wrap_Band_ReadBlock, METH_VARARGS | METH_KEYWORDS, (char *)"Band_ReadBlock(Band self, int xoff, int yoff, void * buf_obj=None) -> CPLErr"},
43292 	 { (char *)"Band_swigregister", Band_swigregister, METH_VARARGS, NULL},
43293 	 { (char *)"new_ColorTable", (PyCFunction) _wrap_new_ColorTable, METH_VARARGS | METH_KEYWORDS, (char *)"new_ColorTable(GDALPaletteInterp palette) -> ColorTable"},
43294 	 { (char *)"delete_ColorTable", _wrap_delete_ColorTable, METH_VARARGS, (char *)"delete_ColorTable(ColorTable self)"},
43295 	 { (char *)"ColorTable_Clone", _wrap_ColorTable_Clone, METH_VARARGS, (char *)"ColorTable_Clone(ColorTable self) -> ColorTable"},
43296 	 { (char *)"ColorTable_GetPaletteInterpretation", _wrap_ColorTable_GetPaletteInterpretation, METH_VARARGS, (char *)"ColorTable_GetPaletteInterpretation(ColorTable self) -> GDALPaletteInterp"},
43297 	 { (char *)"ColorTable_GetCount", _wrap_ColorTable_GetCount, METH_VARARGS, (char *)"ColorTable_GetCount(ColorTable self) -> int"},
43298 	 { (char *)"ColorTable_GetColorEntry", _wrap_ColorTable_GetColorEntry, METH_VARARGS, (char *)"ColorTable_GetColorEntry(ColorTable self, int entry) -> ColorEntry"},
43299 	 { (char *)"ColorTable_GetColorEntryAsRGB", _wrap_ColorTable_GetColorEntryAsRGB, METH_VARARGS, (char *)"ColorTable_GetColorEntryAsRGB(ColorTable self, int entry, ColorEntry centry) -> int"},
43300 	 { (char *)"ColorTable_SetColorEntry", _wrap_ColorTable_SetColorEntry, METH_VARARGS, (char *)"ColorTable_SetColorEntry(ColorTable self, int entry, ColorEntry centry)"},
43301 	 { (char *)"ColorTable_CreateColorRamp", _wrap_ColorTable_CreateColorRamp, METH_VARARGS, (char *)"ColorTable_CreateColorRamp(ColorTable self, int nStartIndex, ColorEntry startcolor, int nEndIndex, ColorEntry endcolor)"},
43302 	 { (char *)"ColorTable_swigregister", ColorTable_swigregister, METH_VARARGS, NULL},
43303 	 { (char *)"new_RasterAttributeTable", _wrap_new_RasterAttributeTable, METH_VARARGS, (char *)"new_RasterAttributeTable() -> RasterAttributeTable"},
43304 	 { (char *)"delete_RasterAttributeTable", _wrap_delete_RasterAttributeTable, METH_VARARGS, (char *)"delete_RasterAttributeTable(RasterAttributeTable self)"},
43305 	 { (char *)"RasterAttributeTable_Clone", _wrap_RasterAttributeTable_Clone, METH_VARARGS, (char *)"RasterAttributeTable_Clone(RasterAttributeTable self) -> RasterAttributeTable"},
43306 	 { (char *)"RasterAttributeTable_GetColumnCount", _wrap_RasterAttributeTable_GetColumnCount, METH_VARARGS, (char *)"RasterAttributeTable_GetColumnCount(RasterAttributeTable self) -> int"},
43307 	 { (char *)"RasterAttributeTable_GetNameOfCol", _wrap_RasterAttributeTable_GetNameOfCol, METH_VARARGS, (char *)"RasterAttributeTable_GetNameOfCol(RasterAttributeTable self, int iCol) -> char const *"},
43308 	 { (char *)"RasterAttributeTable_GetUsageOfCol", _wrap_RasterAttributeTable_GetUsageOfCol, METH_VARARGS, (char *)"RasterAttributeTable_GetUsageOfCol(RasterAttributeTable self, int iCol) -> GDALRATFieldUsage"},
43309 	 { (char *)"RasterAttributeTable_GetTypeOfCol", _wrap_RasterAttributeTable_GetTypeOfCol, METH_VARARGS, (char *)"RasterAttributeTable_GetTypeOfCol(RasterAttributeTable self, int iCol) -> GDALRATFieldType"},
43310 	 { (char *)"RasterAttributeTable_GetColOfUsage", _wrap_RasterAttributeTable_GetColOfUsage, METH_VARARGS, (char *)"RasterAttributeTable_GetColOfUsage(RasterAttributeTable self, GDALRATFieldUsage eUsage) -> int"},
43311 	 { (char *)"RasterAttributeTable_GetRowCount", _wrap_RasterAttributeTable_GetRowCount, METH_VARARGS, (char *)"RasterAttributeTable_GetRowCount(RasterAttributeTable self) -> int"},
43312 	 { (char *)"RasterAttributeTable_GetValueAsString", _wrap_RasterAttributeTable_GetValueAsString, METH_VARARGS, (char *)"RasterAttributeTable_GetValueAsString(RasterAttributeTable self, int iRow, int iCol) -> char const *"},
43313 	 { (char *)"RasterAttributeTable_GetValueAsInt", _wrap_RasterAttributeTable_GetValueAsInt, METH_VARARGS, (char *)"RasterAttributeTable_GetValueAsInt(RasterAttributeTable self, int iRow, int iCol) -> int"},
43314 	 { (char *)"RasterAttributeTable_GetValueAsDouble", _wrap_RasterAttributeTable_GetValueAsDouble, METH_VARARGS, (char *)"RasterAttributeTable_GetValueAsDouble(RasterAttributeTable self, int iRow, int iCol) -> double"},
43315 	 { (char *)"RasterAttributeTable_SetValueAsString", _wrap_RasterAttributeTable_SetValueAsString, METH_VARARGS, (char *)"RasterAttributeTable_SetValueAsString(RasterAttributeTable self, int iRow, int iCol, char const * pszValue)"},
43316 	 { (char *)"RasterAttributeTable_SetValueAsInt", _wrap_RasterAttributeTable_SetValueAsInt, METH_VARARGS, (char *)"RasterAttributeTable_SetValueAsInt(RasterAttributeTable self, int iRow, int iCol, int nValue)"},
43317 	 { (char *)"RasterAttributeTable_SetValueAsDouble", _wrap_RasterAttributeTable_SetValueAsDouble, METH_VARARGS, (char *)"RasterAttributeTable_SetValueAsDouble(RasterAttributeTable self, int iRow, int iCol, double dfValue)"},
43318 	 { (char *)"RasterAttributeTable_SetRowCount", _wrap_RasterAttributeTable_SetRowCount, METH_VARARGS, (char *)"RasterAttributeTable_SetRowCount(RasterAttributeTable self, int nCount)"},
43319 	 { (char *)"RasterAttributeTable_CreateColumn", _wrap_RasterAttributeTable_CreateColumn, METH_VARARGS, (char *)"RasterAttributeTable_CreateColumn(RasterAttributeTable self, char const * pszName, GDALRATFieldType eType, GDALRATFieldUsage eUsage) -> int"},
43320 	 { (char *)"RasterAttributeTable_GetLinearBinning", _wrap_RasterAttributeTable_GetLinearBinning, METH_VARARGS, (char *)"RasterAttributeTable_GetLinearBinning(RasterAttributeTable self) -> bool"},
43321 	 { (char *)"RasterAttributeTable_SetLinearBinning", _wrap_RasterAttributeTable_SetLinearBinning, METH_VARARGS, (char *)"RasterAttributeTable_SetLinearBinning(RasterAttributeTable self, double dfRow0Min, double dfBinSize) -> int"},
43322 	 { (char *)"RasterAttributeTable_GetRowOfValue", _wrap_RasterAttributeTable_GetRowOfValue, METH_VARARGS, (char *)"RasterAttributeTable_GetRowOfValue(RasterAttributeTable self, double dfValue) -> int"},
43323 	 { (char *)"RasterAttributeTable_ChangesAreWrittenToFile", _wrap_RasterAttributeTable_ChangesAreWrittenToFile, METH_VARARGS, (char *)"RasterAttributeTable_ChangesAreWrittenToFile(RasterAttributeTable self) -> int"},
43324 	 { (char *)"RasterAttributeTable_DumpReadable", _wrap_RasterAttributeTable_DumpReadable, METH_VARARGS, (char *)"RasterAttributeTable_DumpReadable(RasterAttributeTable self)"},
43325 	 { (char *)"RasterAttributeTable_SetTableType", _wrap_RasterAttributeTable_SetTableType, METH_VARARGS, (char *)"RasterAttributeTable_SetTableType(RasterAttributeTable self, GDALRATTableType eTableType)"},
43326 	 { (char *)"RasterAttributeTable_GetTableType", _wrap_RasterAttributeTable_GetTableType, METH_VARARGS, (char *)"RasterAttributeTable_GetTableType(RasterAttributeTable self) -> GDALRATTableType"},
43327 	 { (char *)"RasterAttributeTable_swigregister", RasterAttributeTable_swigregister, METH_VARARGS, NULL},
43328 	 { (char *)"TermProgress_nocb", (PyCFunction) _wrap_TermProgress_nocb, METH_VARARGS | METH_KEYWORDS, (char *)"TermProgress_nocb(double dfProgress, char const * pszMessage=None, void * pData=None) -> int"},
43329 	 { (char *)"ComputeMedianCutPCT", (PyCFunction) _wrap_ComputeMedianCutPCT, METH_VARARGS | METH_KEYWORDS, (char *)"ComputeMedianCutPCT(Band red, Band green, Band blue, int num_colors, ColorTable colors, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43330 	 { (char *)"DitherRGB2PCT", (PyCFunction) _wrap_DitherRGB2PCT, METH_VARARGS | METH_KEYWORDS, (char *)"DitherRGB2PCT(Band red, Band green, Band blue, Band target, ColorTable colors, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43331 	 { (char *)"ReprojectImage", (PyCFunction) _wrap_ReprojectImage, METH_VARARGS | METH_KEYWORDS, (char *)"ReprojectImage(Dataset src_ds, Dataset dst_ds, char const * src_wkt=None, char const * dst_wkt=None, GDALResampleAlg eResampleAlg, double WarpMemoryLimit=0.0, double maxerror=0.0, GDALProgressFunc callback=0, void * callback_data=None, char ** options=None) -> CPLErr"},
43332 	 { (char *)"ComputeProximity", (PyCFunction) _wrap_ComputeProximity, METH_VARARGS | METH_KEYWORDS, (char *)"ComputeProximity(Band srcBand, Band proximityBand, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43333 	 { (char *)"RasterizeLayer", (PyCFunction) _wrap_RasterizeLayer, METH_VARARGS | METH_KEYWORDS, (char *)"RasterizeLayer(Dataset dataset, int bands, Layer layer, void * pfnTransformer=None, void * pTransformArg=None, int burn_values=0, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43334 	 { (char *)"Polygonize", (PyCFunction) _wrap_Polygonize, METH_VARARGS | METH_KEYWORDS, (char *)"Polygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43335 	 { (char *)"FPolygonize", (PyCFunction) _wrap_FPolygonize, METH_VARARGS | METH_KEYWORDS, (char *)"FPolygonize(Band srcBand, Band maskBand, Layer outLayer, int iPixValField, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43336 	 { (char *)"FillNodata", (PyCFunction) _wrap_FillNodata, METH_VARARGS | METH_KEYWORDS, (char *)"FillNodata(Band targetBand, Band maskBand, double maxSearchDist, int smoothingIterations, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43337 	 { (char *)"SieveFilter", (PyCFunction) _wrap_SieveFilter, METH_VARARGS | METH_KEYWORDS, (char *)"SieveFilter(Band srcBand, Band maskBand, Band dstBand, int threshold, int connectedness=4, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43338 	 { (char *)"RegenerateOverviews", (PyCFunction) _wrap_RegenerateOverviews, METH_VARARGS | METH_KEYWORDS, (char *)"RegenerateOverviews(Band srcBand, int overviewBandCount, char const * resampling, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43339 	 { (char *)"RegenerateOverview", (PyCFunction) _wrap_RegenerateOverview, METH_VARARGS | METH_KEYWORDS, (char *)"RegenerateOverview(Band srcBand, Band overviewBand, char const * resampling, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43340 	 { (char *)"ContourGenerate", (PyCFunction) _wrap_ContourGenerate, METH_VARARGS | METH_KEYWORDS, (char *)"ContourGenerate(Band srcBand, double contourInterval, double contourBase, int fixedLevelCount, int useNoData, double noDataValue, Layer dstLayer, int idField, int elevField, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43341 	 { (char *)"ContourGenerateEx", (PyCFunction) _wrap_ContourGenerateEx, METH_VARARGS | METH_KEYWORDS, (char *)"ContourGenerateEx(Band srcBand, Layer dstLayer, char ** options=None, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43342 	 { (char *)"ViewshedGenerate", (PyCFunction) _wrap_ViewshedGenerate, METH_VARARGS | METH_KEYWORDS, (char *)"ViewshedGenerate(Band srcBand, char const * driverName, char const * targetRasterName, char ** creationOptions, double observerX, double observerY, double observerHeight, double targetHeight, double visibleVal, double invisibleVal, double outOfRangeVal, double noDataVal, double dfCurvCoeff, GDALViewshedMode mode, double maxDistance, GDALProgressFunc callback=0, void * callback_data=None, GDALViewshedOutputType heightMode=GVOT_NORMAL, char ** papszOptions=None) -> Dataset"},
43343 	 { (char *)"AutoCreateWarpedVRT", _wrap_AutoCreateWarpedVRT, METH_VARARGS, (char *)"AutoCreateWarpedVRT(Dataset src_ds, char const * src_wkt=None, char const * dst_wkt=None, GDALResampleAlg eResampleAlg, double maxerror=0.0) -> Dataset"},
43344 	 { (char *)"CreatePansharpenedVRT", _wrap_CreatePansharpenedVRT, METH_VARARGS, (char *)"CreatePansharpenedVRT(char const * pszXML, Band panchroBand, int nInputSpectralBands) -> Dataset"},
43345 	 { (char *)"delete_GDALTransformerInfoShadow", _wrap_delete_GDALTransformerInfoShadow, METH_VARARGS, (char *)"delete_GDALTransformerInfoShadow(GDALTransformerInfoShadow self)"},
43346 	 { (char *)"GDALTransformerInfoShadow_TransformPoint", _wrap_GDALTransformerInfoShadow_TransformPoint, METH_VARARGS, (char *)"\n"
43347 		"TransformPoint(int bDstToSrc, double [3] inout) -> int\n"
43348 		"GDALTransformerInfoShadow_TransformPoint(GDALTransformerInfoShadow self, int bDstToSrc, double x, double y, double z=0.0) -> int\n"
43349 		""},
43350 	 { (char *)"GDALTransformerInfoShadow_TransformPoints", _wrap_GDALTransformerInfoShadow_TransformPoints, METH_VARARGS, (char *)"GDALTransformerInfoShadow_TransformPoints(GDALTransformerInfoShadow self, int bDstToSrc, int nCount) -> int"},
43351 	 { (char *)"GDALTransformerInfoShadow_TransformGeolocations", (PyCFunction) _wrap_GDALTransformerInfoShadow_TransformGeolocations, METH_VARARGS | METH_KEYWORDS, (char *)"GDALTransformerInfoShadow_TransformGeolocations(GDALTransformerInfoShadow self, Band xBand, Band yBand, Band zBand, GDALProgressFunc callback=0, void * callback_data=None, char ** options=None) -> int"},
43352 	 { (char *)"GDALTransformerInfoShadow_swigregister", GDALTransformerInfoShadow_swigregister, METH_VARARGS, NULL},
43353 	 { (char *)"Transformer", _wrap_Transformer, METH_VARARGS, (char *)"Transformer(Dataset src, Dataset dst, char ** options) -> GDALTransformerInfoShadow"},
43354 	 { (char *)"ApplyVerticalShiftGrid", (PyCFunction) _wrap_ApplyVerticalShiftGrid, METH_VARARGS | METH_KEYWORDS, (char *)"ApplyVerticalShiftGrid(Dataset src_ds, Dataset grid_ds, bool inverse=False, double srcUnitToMeter=1.0, double dstUnitToMeter=1.0, char ** options=None) -> Dataset"},
43355 	 { (char *)"ApplyGeoTransform", _wrap_ApplyGeoTransform, METH_VARARGS, (char *)"ApplyGeoTransform(double [6] padfGeoTransform, double dfPixel, double dfLine)"},
43356 	 { (char *)"InvGeoTransform", _wrap_InvGeoTransform, METH_VARARGS, (char *)"InvGeoTransform(double [6] gt_in) -> RETURN_NONE"},
43357 	 { (char *)"VersionInfo", _wrap_VersionInfo, METH_VARARGS, (char *)"VersionInfo(char const * request) -> char const *"},
43358 	 { (char *)"AllRegister", _wrap_AllRegister, METH_VARARGS, (char *)"AllRegister()"},
43359 	 { (char *)"GDALDestroyDriverManager", _wrap_GDALDestroyDriverManager, METH_VARARGS, (char *)"GDALDestroyDriverManager()"},
43360 	 { (char *)"GetCacheMax", _wrap_GetCacheMax, METH_VARARGS, (char *)"GetCacheMax() -> GIntBig"},
43361 	 { (char *)"GetCacheUsed", _wrap_GetCacheUsed, METH_VARARGS, (char *)"GetCacheUsed() -> GIntBig"},
43362 	 { (char *)"SetCacheMax", _wrap_SetCacheMax, METH_VARARGS, (char *)"SetCacheMax(GIntBig nBytes)"},
43363 	 { (char *)"GetDataTypeSize", _wrap_GetDataTypeSize, METH_VARARGS, (char *)"GetDataTypeSize(GDALDataType eDataType) -> int"},
43364 	 { (char *)"DataTypeIsComplex", _wrap_DataTypeIsComplex, METH_VARARGS, (char *)"DataTypeIsComplex(GDALDataType eDataType) -> int"},
43365 	 { (char *)"GetDataTypeName", _wrap_GetDataTypeName, METH_VARARGS, (char *)"GetDataTypeName(GDALDataType eDataType) -> char const *"},
43366 	 { (char *)"GetDataTypeByName", _wrap_GetDataTypeByName, METH_VARARGS, (char *)"GetDataTypeByName(char const * pszDataTypeName) -> GDALDataType"},
43367 	 { (char *)"GetColorInterpretationName", _wrap_GetColorInterpretationName, METH_VARARGS, (char *)"GetColorInterpretationName(GDALColorInterp eColorInterp) -> char const *"},
43368 	 { (char *)"GetPaletteInterpretationName", _wrap_GetPaletteInterpretationName, METH_VARARGS, (char *)"GetPaletteInterpretationName(GDALPaletteInterp ePaletteInterp) -> char const *"},
43369 	 { (char *)"DecToDMS", _wrap_DecToDMS, METH_VARARGS, (char *)"DecToDMS(double arg1, char const * arg2, int arg3=2) -> char const *"},
43370 	 { (char *)"PackedDMSToDec", _wrap_PackedDMSToDec, METH_VARARGS, (char *)"PackedDMSToDec(double dfPacked) -> double"},
43371 	 { (char *)"DecToPackedDMS", _wrap_DecToPackedDMS, METH_VARARGS, (char *)"DecToPackedDMS(double dfDec) -> double"},
43372 	 { (char *)"ParseXMLString", _wrap_ParseXMLString, METH_VARARGS, (char *)"ParseXMLString(char * pszXMLString) -> CPLXMLNode *"},
43373 	 { (char *)"SerializeXMLTree", _wrap_SerializeXMLTree, METH_VARARGS, (char *)"SerializeXMLTree(CPLXMLNode * xmlnode) -> retStringAndCPLFree *"},
43374 	 { (char *)"GetJPEG2000Structure", _wrap_GetJPEG2000Structure, METH_VARARGS, (char *)"GetJPEG2000Structure(char const * pszFilename, char ** options=None) -> CPLXMLNode *"},
43375 	 { (char *)"GetJPEG2000StructureAsString", _wrap_GetJPEG2000StructureAsString, METH_VARARGS, (char *)"GetJPEG2000StructureAsString(char const * pszFilename, char ** options=None) -> retStringAndCPLFree *"},
43376 	 { (char *)"GetDriverCount", _wrap_GetDriverCount, METH_VARARGS, (char *)"GetDriverCount() -> int"},
43377 	 { (char *)"GetDriverByName", _wrap_GetDriverByName, METH_VARARGS, (char *)"GetDriverByName(char const * name) -> Driver"},
43378 	 { (char *)"GetDriver", _wrap_GetDriver, METH_VARARGS, (char *)"GetDriver(int i) -> Driver"},
43379 	 { (char *)"Open", _wrap_Open, METH_VARARGS, (char *)"Open(char const * utf8_path, GDALAccess eAccess) -> Dataset"},
43380 	 { (char *)"OpenEx", (PyCFunction) _wrap_OpenEx, METH_VARARGS | METH_KEYWORDS, (char *)"OpenEx(char const * utf8_path, unsigned int nOpenFlags=0, char ** allowed_drivers=None, char ** open_options=None, char ** sibling_files=None) -> Dataset"},
43381 	 { (char *)"OpenShared", _wrap_OpenShared, METH_VARARGS, (char *)"OpenShared(char const * utf8_path, GDALAccess eAccess) -> Dataset"},
43382 	 { (char *)"IdentifyDriver", _wrap_IdentifyDriver, METH_VARARGS, (char *)"IdentifyDriver(char const * utf8_path, char ** papszSiblings=None) -> Driver"},
43383 	 { (char *)"IdentifyDriverEx", (PyCFunction) _wrap_IdentifyDriverEx, METH_VARARGS | METH_KEYWORDS, (char *)"IdentifyDriverEx(char const * utf8_path, unsigned int nIdentifyFlags=0, char ** allowed_drivers=None, char ** sibling_files=None) -> Driver"},
43384 	 { (char *)"GeneralCmdLineProcessor", _wrap_GeneralCmdLineProcessor, METH_VARARGS, (char *)"GeneralCmdLineProcessor(char ** papszArgv, int nOptions=0) -> char **"},
43385 	 { (char *)"new_GDALInfoOptions", _wrap_new_GDALInfoOptions, METH_VARARGS, (char *)"new_GDALInfoOptions(char ** options) -> GDALInfoOptions"},
43386 	 { (char *)"delete_GDALInfoOptions", _wrap_delete_GDALInfoOptions, METH_VARARGS, (char *)"delete_GDALInfoOptions(GDALInfoOptions self)"},
43387 	 { (char *)"GDALInfoOptions_swigregister", GDALInfoOptions_swigregister, METH_VARARGS, NULL},
43388 	 { (char *)"InfoInternal", _wrap_InfoInternal, METH_VARARGS, (char *)"InfoInternal(Dataset hDataset, GDALInfoOptions infoOptions) -> retStringAndCPLFree *"},
43389 	 { (char *)"new_GDALMultiDimInfoOptions", _wrap_new_GDALMultiDimInfoOptions, METH_VARARGS, (char *)"new_GDALMultiDimInfoOptions(char ** options) -> GDALMultiDimInfoOptions"},
43390 	 { (char *)"delete_GDALMultiDimInfoOptions", _wrap_delete_GDALMultiDimInfoOptions, METH_VARARGS, (char *)"delete_GDALMultiDimInfoOptions(GDALMultiDimInfoOptions self)"},
43391 	 { (char *)"GDALMultiDimInfoOptions_swigregister", GDALMultiDimInfoOptions_swigregister, METH_VARARGS, NULL},
43392 	 { (char *)"MultiDimInfoInternal", _wrap_MultiDimInfoInternal, METH_VARARGS, (char *)"MultiDimInfoInternal(Dataset hDataset, GDALMultiDimInfoOptions infoOptions) -> retStringAndCPLFree *"},
43393 	 { (char *)"new_GDALTranslateOptions", _wrap_new_GDALTranslateOptions, METH_VARARGS, (char *)"new_GDALTranslateOptions(char ** options) -> GDALTranslateOptions"},
43394 	 { (char *)"delete_GDALTranslateOptions", _wrap_delete_GDALTranslateOptions, METH_VARARGS, (char *)"delete_GDALTranslateOptions(GDALTranslateOptions self)"},
43395 	 { (char *)"GDALTranslateOptions_swigregister", GDALTranslateOptions_swigregister, METH_VARARGS, NULL},
43396 	 { (char *)"TranslateInternal", _wrap_TranslateInternal, METH_VARARGS, (char *)"TranslateInternal(char const * dest, Dataset dataset, GDALTranslateOptions translateOptions, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43397 	 { (char *)"new_GDALWarpAppOptions", _wrap_new_GDALWarpAppOptions, METH_VARARGS, (char *)"new_GDALWarpAppOptions(char ** options) -> GDALWarpAppOptions"},
43398 	 { (char *)"delete_GDALWarpAppOptions", _wrap_delete_GDALWarpAppOptions, METH_VARARGS, (char *)"delete_GDALWarpAppOptions(GDALWarpAppOptions self)"},
43399 	 { (char *)"GDALWarpAppOptions_swigregister", GDALWarpAppOptions_swigregister, METH_VARARGS, NULL},
43400 	 { (char *)"wrapper_GDALWarpDestDS", _wrap_wrapper_GDALWarpDestDS, METH_VARARGS, (char *)"wrapper_GDALWarpDestDS(Dataset dstDS, int object_list_count, GDALWarpAppOptions warpAppOptions, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43401 	 { (char *)"wrapper_GDALWarpDestName", _wrap_wrapper_GDALWarpDestName, METH_VARARGS, (char *)"wrapper_GDALWarpDestName(char const * dest, int object_list_count, GDALWarpAppOptions warpAppOptions, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43402 	 { (char *)"new_GDALVectorTranslateOptions", _wrap_new_GDALVectorTranslateOptions, METH_VARARGS, (char *)"new_GDALVectorTranslateOptions(char ** options) -> GDALVectorTranslateOptions"},
43403 	 { (char *)"delete_GDALVectorTranslateOptions", _wrap_delete_GDALVectorTranslateOptions, METH_VARARGS, (char *)"delete_GDALVectorTranslateOptions(GDALVectorTranslateOptions self)"},
43404 	 { (char *)"GDALVectorTranslateOptions_swigregister", GDALVectorTranslateOptions_swigregister, METH_VARARGS, NULL},
43405 	 { (char *)"wrapper_GDALVectorTranslateDestDS", _wrap_wrapper_GDALVectorTranslateDestDS, METH_VARARGS, (char *)"wrapper_GDALVectorTranslateDestDS(Dataset dstDS, Dataset srcDS, GDALVectorTranslateOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43406 	 { (char *)"wrapper_GDALVectorTranslateDestName", _wrap_wrapper_GDALVectorTranslateDestName, METH_VARARGS, (char *)"wrapper_GDALVectorTranslateDestName(char const * dest, Dataset srcDS, GDALVectorTranslateOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43407 	 { (char *)"new_GDALDEMProcessingOptions", _wrap_new_GDALDEMProcessingOptions, METH_VARARGS, (char *)"new_GDALDEMProcessingOptions(char ** options) -> GDALDEMProcessingOptions"},
43408 	 { (char *)"delete_GDALDEMProcessingOptions", _wrap_delete_GDALDEMProcessingOptions, METH_VARARGS, (char *)"delete_GDALDEMProcessingOptions(GDALDEMProcessingOptions self)"},
43409 	 { (char *)"GDALDEMProcessingOptions_swigregister", GDALDEMProcessingOptions_swigregister, METH_VARARGS, NULL},
43410 	 { (char *)"DEMProcessingInternal", _wrap_DEMProcessingInternal, METH_VARARGS, (char *)"DEMProcessingInternal(char const * dest, Dataset dataset, char const * pszProcessing, char const * pszColorFilename, GDALDEMProcessingOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43411 	 { (char *)"new_GDALNearblackOptions", _wrap_new_GDALNearblackOptions, METH_VARARGS, (char *)"new_GDALNearblackOptions(char ** options) -> GDALNearblackOptions"},
43412 	 { (char *)"delete_GDALNearblackOptions", _wrap_delete_GDALNearblackOptions, METH_VARARGS, (char *)"delete_GDALNearblackOptions(GDALNearblackOptions self)"},
43413 	 { (char *)"GDALNearblackOptions_swigregister", GDALNearblackOptions_swigregister, METH_VARARGS, NULL},
43414 	 { (char *)"wrapper_GDALNearblackDestDS", _wrap_wrapper_GDALNearblackDestDS, METH_VARARGS, (char *)"wrapper_GDALNearblackDestDS(Dataset dstDS, Dataset srcDS, GDALNearblackOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43415 	 { (char *)"wrapper_GDALNearblackDestName", _wrap_wrapper_GDALNearblackDestName, METH_VARARGS, (char *)"wrapper_GDALNearblackDestName(char const * dest, Dataset srcDS, GDALNearblackOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43416 	 { (char *)"new_GDALGridOptions", _wrap_new_GDALGridOptions, METH_VARARGS, (char *)"new_GDALGridOptions(char ** options) -> GDALGridOptions"},
43417 	 { (char *)"delete_GDALGridOptions", _wrap_delete_GDALGridOptions, METH_VARARGS, (char *)"delete_GDALGridOptions(GDALGridOptions self)"},
43418 	 { (char *)"GDALGridOptions_swigregister", GDALGridOptions_swigregister, METH_VARARGS, NULL},
43419 	 { (char *)"GridInternal", _wrap_GridInternal, METH_VARARGS, (char *)"GridInternal(char const * dest, Dataset dataset, GDALGridOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43420 	 { (char *)"new_GDALRasterizeOptions", _wrap_new_GDALRasterizeOptions, METH_VARARGS, (char *)"new_GDALRasterizeOptions(char ** options) -> GDALRasterizeOptions"},
43421 	 { (char *)"delete_GDALRasterizeOptions", _wrap_delete_GDALRasterizeOptions, METH_VARARGS, (char *)"delete_GDALRasterizeOptions(GDALRasterizeOptions self)"},
43422 	 { (char *)"GDALRasterizeOptions_swigregister", GDALRasterizeOptions_swigregister, METH_VARARGS, NULL},
43423 	 { (char *)"wrapper_GDALRasterizeDestDS", _wrap_wrapper_GDALRasterizeDestDS, METH_VARARGS, (char *)"wrapper_GDALRasterizeDestDS(Dataset dstDS, Dataset srcDS, GDALRasterizeOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> int"},
43424 	 { (char *)"wrapper_GDALRasterizeDestName", _wrap_wrapper_GDALRasterizeDestName, METH_VARARGS, (char *)"wrapper_GDALRasterizeDestName(char const * dest, Dataset srcDS, GDALRasterizeOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43425 	 { (char *)"new_GDALBuildVRTOptions", _wrap_new_GDALBuildVRTOptions, METH_VARARGS, (char *)"new_GDALBuildVRTOptions(char ** options) -> GDALBuildVRTOptions"},
43426 	 { (char *)"delete_GDALBuildVRTOptions", _wrap_delete_GDALBuildVRTOptions, METH_VARARGS, (char *)"delete_GDALBuildVRTOptions(GDALBuildVRTOptions self)"},
43427 	 { (char *)"GDALBuildVRTOptions_swigregister", GDALBuildVRTOptions_swigregister, METH_VARARGS, NULL},
43428 	 { (char *)"BuildVRTInternalObjects", _wrap_BuildVRTInternalObjects, METH_VARARGS, (char *)"BuildVRTInternalObjects(char const * dest, int object_list_count, GDALBuildVRTOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43429 	 { (char *)"BuildVRTInternalNames", _wrap_BuildVRTInternalNames, METH_VARARGS, (char *)"BuildVRTInternalNames(char const * dest, char ** source_filenames, GDALBuildVRTOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43430 	 { (char *)"new_GDALMultiDimTranslateOptions", _wrap_new_GDALMultiDimTranslateOptions, METH_VARARGS, (char *)"new_GDALMultiDimTranslateOptions(char ** options) -> GDALMultiDimTranslateOptions"},
43431 	 { (char *)"delete_GDALMultiDimTranslateOptions", _wrap_delete_GDALMultiDimTranslateOptions, METH_VARARGS, (char *)"delete_GDALMultiDimTranslateOptions(GDALMultiDimTranslateOptions self)"},
43432 	 { (char *)"GDALMultiDimTranslateOptions_swigregister", GDALMultiDimTranslateOptions_swigregister, METH_VARARGS, NULL},
43433 	 { (char *)"wrapper_GDALMultiDimTranslateDestName", _wrap_wrapper_GDALMultiDimTranslateDestName, METH_VARARGS, (char *)"wrapper_GDALMultiDimTranslateDestName(char const * dest, int object_list_count, GDALMultiDimTranslateOptions multiDimTranslateOptions, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"},
43434 	 { NULL, NULL, 0, NULL }
43435 };
43436 
43437 
43438 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
43439 
_p_GDALDriverShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))43440 static void *_p_GDALDriverShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
43441     return (void *)((GDALMajorObjectShadow *)  ((GDALDriverShadow *) x));
43442 }
_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))43443 static void *_p_OGRLayerShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
43444     return (void *)((GDALMajorObjectShadow *)  ((OGRLayerShadow *) x));
43445 }
_p_GDALDatasetShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))43446 static void *_p_GDALDatasetShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
43447     return (void *)((GDALMajorObjectShadow *)  ((GDALDatasetShadow *) x));
43448 }
_p_GDALRasterBandShadowTo_p_GDALMajorObjectShadow(void * x,int * SWIGUNUSEDPARM (newmemory))43449 static void *_p_GDALRasterBandShadowTo_p_GDALMajorObjectShadow(void *x, int *SWIGUNUSEDPARM(newmemory)) {
43450     return (void *)((GDALMajorObjectShadow *)  ((GDALRasterBandShadow *) x));
43451 }
43452 static swig_type_info _swigt__p_CPLErrorHandler = {"_p_CPLErrorHandler", "CPLErrorHandler *", 0, 0, (void*)0, 0};
43453 static swig_type_info _swigt__p_CPLVirtualMemShadow = {"_p_CPLVirtualMemShadow", "CPLVirtualMemShadow *", 0, 0, (void*)0, 0};
43454 static swig_type_info _swigt__p_CPLXMLNode = {"_p_CPLXMLNode", "CPLXMLNode *", 0, 0, (void*)0, 0};
43455 static swig_type_info _swigt__p_DirEntry = {"_p_DirEntry", "DirEntry *", 0, 0, (void*)0, 0};
43456 static swig_type_info _swigt__p_GByte = {"_p_GByte", "GByte *", 0, 0, (void*)0, 0};
43457 static swig_type_info _swigt__p_GDALAsyncReaderShadow = {"_p_GDALAsyncReaderShadow", "GDALAsyncReaderShadow *", 0, 0, (void*)0, 0};
43458 static swig_type_info _swigt__p_GDALAttributeHS = {"_p_GDALAttributeHS", "GDALAttributeHS *", 0, 0, (void*)0, 0};
43459 static swig_type_info _swigt__p_GDALBuildVRTOptions = {"_p_GDALBuildVRTOptions", "GDALBuildVRTOptions *", 0, 0, (void*)0, 0};
43460 static swig_type_info _swigt__p_GDALColorEntry = {"_p_GDALColorEntry", "GDALColorEntry *", 0, 0, (void*)0, 0};
43461 static swig_type_info _swigt__p_GDALColorTableShadow = {"_p_GDALColorTableShadow", "GDALColorTableShadow *", 0, 0, (void*)0, 0};
43462 static swig_type_info _swigt__p_GDALDEMProcessingOptions = {"_p_GDALDEMProcessingOptions", "GDALDEMProcessingOptions *", 0, 0, (void*)0, 0};
43463 static swig_type_info _swigt__p_GDALDatasetShadow = {"_p_GDALDatasetShadow", "GDALDatasetShadow *", 0, 0, (void*)0, 0};
43464 static swig_type_info _swigt__p_GDALDimensionHS = {"_p_GDALDimensionHS", "GDALDimensionHS *", 0, 0, (void*)0, 0};
43465 static swig_type_info _swigt__p_GDALDriverShadow = {"_p_GDALDriverShadow", "GDALDriverShadow *", 0, 0, (void*)0, 0};
43466 static swig_type_info _swigt__p_GDALEDTComponentHS = {"_p_GDALEDTComponentHS", "GDALEDTComponentHS *", 0, 0, (void*)0, 0};
43467 static swig_type_info _swigt__p_GDALExtendedDataTypeClass = {"_p_GDALExtendedDataTypeClass", "enum GDALExtendedDataTypeClass *|GDALExtendedDataTypeClass *", 0, 0, (void*)0, 0};
43468 static swig_type_info _swigt__p_GDALExtendedDataTypeHS = {"_p_GDALExtendedDataTypeHS", "GDALExtendedDataTypeHS *", 0, 0, (void*)0, 0};
43469 static swig_type_info _swigt__p_GDALGridOptions = {"_p_GDALGridOptions", "GDALGridOptions *", 0, 0, (void*)0, 0};
43470 static swig_type_info _swigt__p_GDALGroupHS = {"_p_GDALGroupHS", "GDALGroupHS *", 0, 0, (void*)0, 0};
43471 static swig_type_info _swigt__p_GDALInfoOptions = {"_p_GDALInfoOptions", "GDALInfoOptions *", 0, 0, (void*)0, 0};
43472 static swig_type_info _swigt__p_GDALMDArrayHS = {"_p_GDALMDArrayHS", "GDALMDArrayHS *", 0, 0, (void*)0, 0};
43473 static swig_type_info _swigt__p_GDALMajorObjectShadow = {"_p_GDALMajorObjectShadow", "GDALMajorObjectShadow *", 0, 0, (void*)0, 0};
43474 static swig_type_info _swigt__p_GDALMultiDimInfoOptions = {"_p_GDALMultiDimInfoOptions", "GDALMultiDimInfoOptions *", 0, 0, (void*)0, 0};
43475 static swig_type_info _swigt__p_GDALMultiDimTranslateOptions = {"_p_GDALMultiDimTranslateOptions", "GDALMultiDimTranslateOptions *", 0, 0, (void*)0, 0};
43476 static swig_type_info _swigt__p_GDALNearblackOptions = {"_p_GDALNearblackOptions", "GDALNearblackOptions *", 0, 0, (void*)0, 0};
43477 static swig_type_info _swigt__p_GDALProgressFunc = {"_p_GDALProgressFunc", "GDALProgressFunc *", 0, 0, (void*)0, 0};
43478 static swig_type_info _swigt__p_GDALRasterAttributeTableShadow = {"_p_GDALRasterAttributeTableShadow", "GDALRasterAttributeTableShadow *", 0, 0, (void*)0, 0};
43479 static swig_type_info _swigt__p_GDALRasterBandShadow = {"_p_GDALRasterBandShadow", "GDALRasterBandShadow *", 0, 0, (void*)0, 0};
43480 static swig_type_info _swigt__p_GDALRasterizeOptions = {"_p_GDALRasterizeOptions", "GDALRasterizeOptions *", 0, 0, (void*)0, 0};
43481 static swig_type_info _swigt__p_GDALTransformerInfoShadow = {"_p_GDALTransformerInfoShadow", "GDALTransformerInfoShadow *", 0, 0, (void*)0, 0};
43482 static swig_type_info _swigt__p_GDALTranslateOptions = {"_p_GDALTranslateOptions", "GDALTranslateOptions *", 0, 0, (void*)0, 0};
43483 static swig_type_info _swigt__p_GDALVectorTranslateOptions = {"_p_GDALVectorTranslateOptions", "GDALVectorTranslateOptions *", 0, 0, (void*)0, 0};
43484 static swig_type_info _swigt__p_GDALViewshedMode = {"_p_GDALViewshedMode", "enum GDALViewshedMode *|GDALViewshedMode *", 0, 0, (void*)0, 0};
43485 static swig_type_info _swigt__p_GDALViewshedOutputType = {"_p_GDALViewshedOutputType", "enum GDALViewshedOutputType *|GDALViewshedOutputType *", 0, 0, (void*)0, 0};
43486 static swig_type_info _swigt__p_GDALWarpAppOptions = {"_p_GDALWarpAppOptions", "GDALWarpAppOptions *", 0, 0, (void*)0, 0};
43487 static swig_type_info _swigt__p_GDAL_GCP = {"_p_GDAL_GCP", "GDAL_GCP *", 0, 0, (void*)0, 0};
43488 static swig_type_info _swigt__p_GIntBig = {"_p_GIntBig", "GIntBig *", 0, 0, (void*)0, 0};
43489 static swig_type_info _swigt__p_GUIntBig = {"_p_GUIntBig", "GUIntBig *", 0, 0, (void*)0, 0};
43490 static swig_type_info _swigt__p_OGRFeatureShadow = {"_p_OGRFeatureShadow", "OGRFeatureShadow *", 0, 0, (void*)0, 0};
43491 static swig_type_info _swigt__p_OGRFieldDomainShadow = {"_p_OGRFieldDomainShadow", "OGRFieldDomainShadow *", 0, 0, (void*)0, 0};
43492 static swig_type_info _swigt__p_OGRGeometryShadow = {"_p_OGRGeometryShadow", "OGRGeometryShadow *", 0, 0, (void*)0, 0};
43493 static swig_type_info _swigt__p_OGRLayerShadow = {"_p_OGRLayerShadow", "OGRLayerShadow *", 0, 0, (void*)0, 0};
43494 static swig_type_info _swigt__p_OGRStyleTableShadow = {"_p_OGRStyleTableShadow", "OGRStyleTableShadow *", 0, 0, (void*)0, 0};
43495 static swig_type_info _swigt__p_OSRSpatialReferenceShadow = {"_p_OSRSpatialReferenceShadow", "OSRSpatialReferenceShadow *", 0, 0, (void*)0, 0};
43496 static swig_type_info _swigt__p_StatBuf = {"_p_StatBuf", "StatBuf *", 0, 0, (void*)0, 0};
43497 static swig_type_info _swigt__p_Statistics = {"_p_Statistics", "Statistics *", 0, 0, (void*)0, 0};
43498 static swig_type_info _swigt__p_VSIDIR = {"_p_VSIDIR", "VSIDIR *", 0, 0, (void*)0, 0};
43499 static swig_type_info _swigt__p_VSILFILE = {"_p_VSILFILE", "VSILFILE *", 0, 0, (void*)0, 0};
43500 static swig_type_info _swigt__p_char = {"_p_char", "char *|retStringAndCPLFree *", 0, 0, (void*)0, 0};
43501 static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
43502 static swig_type_info _swigt__p_f_double_p_q_const__char_p_void__int = {"_p_f_double_p_q_const__char_p_void__int", "int (*)(double,char const *,void *)", 0, 0, (void*)0, 0};
43503 static swig_type_info _swigt__p_int = {"_p_int", "OGRFieldSubType *|OGRFieldDomainType *|GDALRATFieldType *|OGRFieldType *|RETURN_NONE *|int *|GDALAccess *|OSRAxisMappingStrategy *|OGRwkbByteOrder *|CPLErr *|GDALRWFlag *|OGRJustification *|GDALRATFieldUsage *|GDALTileOrganization *|OGRAxisOrientation *|GDALPaletteInterp *|GDALColorInterp *|GDALRIOResampleAlg *|GDALResampleAlg *|OGRErr *|OGRwkbGeometryType *|GDALDataType *|GDALAsyncStatusType *|GDALRATTableType *|OGRFieldDomainMergePolicy *|OGRFieldDomainSplitPolicy *", 0, 0, (void*)0, 0};
43504 static swig_type_info _swigt__p_p_GByte = {"_p_p_GByte", "GByte **", 0, 0, (void*)0, 0};
43505 static swig_type_info _swigt__p_p_GDALDatasetShadow = {"_p_p_GDALDatasetShadow", "GDALDatasetShadow **", 0, 0, (void*)0, 0};
43506 static swig_type_info _swigt__p_p_GDALDimensionHS = {"_p_p_GDALDimensionHS", "GDALDimensionHS **", 0, 0, (void*)0, 0};
43507 static swig_type_info _swigt__p_p_GDALEDTComponentHS = {"_p_p_GDALEDTComponentHS", "GDALEDTComponentHS **", 0, 0, (void*)0, 0};
43508 static swig_type_info _swigt__p_p_GDALRasterBandShadow = {"_p_p_GDALRasterBandShadow", "GDALRasterBandShadow **", 0, 0, (void*)0, 0};
43509 static swig_type_info _swigt__p_p_GDAL_GCP = {"_p_p_GDAL_GCP", "GDAL_GCP **", 0, 0, (void*)0, 0};
43510 static swig_type_info _swigt__p_p_GUIntBig = {"_p_p_GUIntBig", "GUIntBig **", 0, 0, (void*)0, 0};
43511 static swig_type_info _swigt__p_p_OGRLayerShadow = {"_p_p_OGRLayerShadow", "OGRLayerShadow **", 0, 0, (void*)0, 0};
43512 static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
43513 static swig_type_info _swigt__p_p_double = {"_p_p_double", "double **", 0, 0, (void*)0, 0};
43514 static swig_type_info _swigt__p_p_int = {"_p_p_int", "int **", 0, 0, (void*)0, 0};
43515 static swig_type_info _swigt__p_p_p_GDALAttributeHS = {"_p_p_p_GDALAttributeHS", "GDALAttributeHS ***", 0, 0, (void*)0, 0};
43516 static swig_type_info _swigt__p_p_p_GDALDimensionHS = {"_p_p_p_GDALDimensionHS", "GDALDimensionHS ***", 0, 0, (void*)0, 0};
43517 static swig_type_info _swigt__p_p_p_GDALEDTComponentHS = {"_p_p_p_GDALEDTComponentHS", "GDALEDTComponentHS ***", 0, 0, (void*)0, 0};
43518 static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **", 0, 0, (void*)0, 0};
43519 static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
43520 static swig_type_info _swigt__p_vsi_l_offset = {"_p_vsi_l_offset", "vsi_l_offset *", 0, 0, (void*)0, 0};
43521 
43522 static swig_type_info *swig_type_initial[] = {
43523   &_swigt__p_CPLErrorHandler,
43524   &_swigt__p_CPLVirtualMemShadow,
43525   &_swigt__p_CPLXMLNode,
43526   &_swigt__p_DirEntry,
43527   &_swigt__p_GByte,
43528   &_swigt__p_GDALAsyncReaderShadow,
43529   &_swigt__p_GDALAttributeHS,
43530   &_swigt__p_GDALBuildVRTOptions,
43531   &_swigt__p_GDALColorEntry,
43532   &_swigt__p_GDALColorTableShadow,
43533   &_swigt__p_GDALDEMProcessingOptions,
43534   &_swigt__p_GDALDatasetShadow,
43535   &_swigt__p_GDALDimensionHS,
43536   &_swigt__p_GDALDriverShadow,
43537   &_swigt__p_GDALEDTComponentHS,
43538   &_swigt__p_GDALExtendedDataTypeClass,
43539   &_swigt__p_GDALExtendedDataTypeHS,
43540   &_swigt__p_GDALGridOptions,
43541   &_swigt__p_GDALGroupHS,
43542   &_swigt__p_GDALInfoOptions,
43543   &_swigt__p_GDALMDArrayHS,
43544   &_swigt__p_GDALMajorObjectShadow,
43545   &_swigt__p_GDALMultiDimInfoOptions,
43546   &_swigt__p_GDALMultiDimTranslateOptions,
43547   &_swigt__p_GDALNearblackOptions,
43548   &_swigt__p_GDALProgressFunc,
43549   &_swigt__p_GDALRasterAttributeTableShadow,
43550   &_swigt__p_GDALRasterBandShadow,
43551   &_swigt__p_GDALRasterizeOptions,
43552   &_swigt__p_GDALTransformerInfoShadow,
43553   &_swigt__p_GDALTranslateOptions,
43554   &_swigt__p_GDALVectorTranslateOptions,
43555   &_swigt__p_GDALViewshedMode,
43556   &_swigt__p_GDALViewshedOutputType,
43557   &_swigt__p_GDALWarpAppOptions,
43558   &_swigt__p_GDAL_GCP,
43559   &_swigt__p_GIntBig,
43560   &_swigt__p_GUIntBig,
43561   &_swigt__p_OGRFeatureShadow,
43562   &_swigt__p_OGRFieldDomainShadow,
43563   &_swigt__p_OGRGeometryShadow,
43564   &_swigt__p_OGRLayerShadow,
43565   &_swigt__p_OGRStyleTableShadow,
43566   &_swigt__p_OSRSpatialReferenceShadow,
43567   &_swigt__p_StatBuf,
43568   &_swigt__p_Statistics,
43569   &_swigt__p_VSIDIR,
43570   &_swigt__p_VSILFILE,
43571   &_swigt__p_char,
43572   &_swigt__p_double,
43573   &_swigt__p_f_double_p_q_const__char_p_void__int,
43574   &_swigt__p_int,
43575   &_swigt__p_p_GByte,
43576   &_swigt__p_p_GDALDatasetShadow,
43577   &_swigt__p_p_GDALDimensionHS,
43578   &_swigt__p_p_GDALEDTComponentHS,
43579   &_swigt__p_p_GDALRasterBandShadow,
43580   &_swigt__p_p_GDAL_GCP,
43581   &_swigt__p_p_GUIntBig,
43582   &_swigt__p_p_OGRLayerShadow,
43583   &_swigt__p_p_char,
43584   &_swigt__p_p_double,
43585   &_swigt__p_p_int,
43586   &_swigt__p_p_p_GDALAttributeHS,
43587   &_swigt__p_p_p_GDALDimensionHS,
43588   &_swigt__p_p_p_GDALEDTComponentHS,
43589   &_swigt__p_p_void,
43590   &_swigt__p_size_t,
43591   &_swigt__p_vsi_l_offset,
43592 };
43593 
43594 static swig_cast_info _swigc__p_CPLErrorHandler[] = {  {&_swigt__p_CPLErrorHandler, 0, 0, 0},{0, 0, 0, 0}};
43595 static swig_cast_info _swigc__p_CPLVirtualMemShadow[] = {  {&_swigt__p_CPLVirtualMemShadow, 0, 0, 0},{0, 0, 0, 0}};
43596 static swig_cast_info _swigc__p_CPLXMLNode[] = {  {&_swigt__p_CPLXMLNode, 0, 0, 0},{0, 0, 0, 0}};
43597 static swig_cast_info _swigc__p_DirEntry[] = {  {&_swigt__p_DirEntry, 0, 0, 0},{0, 0, 0, 0}};
43598 static swig_cast_info _swigc__p_GByte[] = {  {&_swigt__p_GByte, 0, 0, 0},{0, 0, 0, 0}};
43599 static swig_cast_info _swigc__p_GDALAsyncReaderShadow[] = {  {&_swigt__p_GDALAsyncReaderShadow, 0, 0, 0},{0, 0, 0, 0}};
43600 static swig_cast_info _swigc__p_GDALAttributeHS[] = {  {&_swigt__p_GDALAttributeHS, 0, 0, 0},{0, 0, 0, 0}};
43601 static swig_cast_info _swigc__p_GDALBuildVRTOptions[] = {  {&_swigt__p_GDALBuildVRTOptions, 0, 0, 0},{0, 0, 0, 0}};
43602 static swig_cast_info _swigc__p_GDALColorEntry[] = {  {&_swigt__p_GDALColorEntry, 0, 0, 0},{0, 0, 0, 0}};
43603 static swig_cast_info _swigc__p_GDALColorTableShadow[] = {  {&_swigt__p_GDALColorTableShadow, 0, 0, 0},{0, 0, 0, 0}};
43604 static swig_cast_info _swigc__p_GDALDEMProcessingOptions[] = {  {&_swigt__p_GDALDEMProcessingOptions, 0, 0, 0},{0, 0, 0, 0}};
43605 static swig_cast_info _swigc__p_GDALDatasetShadow[] = {  {&_swigt__p_GDALDatasetShadow, 0, 0, 0},{0, 0, 0, 0}};
43606 static swig_cast_info _swigc__p_GDALDimensionHS[] = {  {&_swigt__p_GDALDimensionHS, 0, 0, 0},{0, 0, 0, 0}};
43607 static swig_cast_info _swigc__p_GDALDriverShadow[] = {  {&_swigt__p_GDALDriverShadow, 0, 0, 0},{0, 0, 0, 0}};
43608 static swig_cast_info _swigc__p_GDALEDTComponentHS[] = {  {&_swigt__p_GDALEDTComponentHS, 0, 0, 0},{0, 0, 0, 0}};
43609 static swig_cast_info _swigc__p_GDALExtendedDataTypeClass[] = {  {&_swigt__p_GDALExtendedDataTypeClass, 0, 0, 0},{0, 0, 0, 0}};
43610 static swig_cast_info _swigc__p_GDALExtendedDataTypeHS[] = {  {&_swigt__p_GDALExtendedDataTypeHS, 0, 0, 0},{0, 0, 0, 0}};
43611 static swig_cast_info _swigc__p_GDALGridOptions[] = {  {&_swigt__p_GDALGridOptions, 0, 0, 0},{0, 0, 0, 0}};
43612 static swig_cast_info _swigc__p_GDALGroupHS[] = {  {&_swigt__p_GDALGroupHS, 0, 0, 0},{0, 0, 0, 0}};
43613 static swig_cast_info _swigc__p_GDALInfoOptions[] = {  {&_swigt__p_GDALInfoOptions, 0, 0, 0},{0, 0, 0, 0}};
43614 static swig_cast_info _swigc__p_GDALMDArrayHS[] = {  {&_swigt__p_GDALMDArrayHS, 0, 0, 0},{0, 0, 0, 0}};
43615 static swig_cast_info _swigc__p_GDALMajorObjectShadow[] = {  {&_swigt__p_GDALMajorObjectShadow, 0, 0, 0},  {&_swigt__p_GDALDriverShadow, _p_GDALDriverShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_OGRLayerShadow, _p_OGRLayerShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_GDALDatasetShadow, _p_GDALDatasetShadowTo_p_GDALMajorObjectShadow, 0, 0},  {&_swigt__p_GDALRasterBandShadow, _p_GDALRasterBandShadowTo_p_GDALMajorObjectShadow, 0, 0},{0, 0, 0, 0}};
43616 static swig_cast_info _swigc__p_GDALMultiDimInfoOptions[] = {  {&_swigt__p_GDALMultiDimInfoOptions, 0, 0, 0},{0, 0, 0, 0}};
43617 static swig_cast_info _swigc__p_GDALMultiDimTranslateOptions[] = {  {&_swigt__p_GDALMultiDimTranslateOptions, 0, 0, 0},{0, 0, 0, 0}};
43618 static swig_cast_info _swigc__p_GDALNearblackOptions[] = {  {&_swigt__p_GDALNearblackOptions, 0, 0, 0},{0, 0, 0, 0}};
43619 static swig_cast_info _swigc__p_GDALProgressFunc[] = {  {&_swigt__p_GDALProgressFunc, 0, 0, 0},{0, 0, 0, 0}};
43620 static swig_cast_info _swigc__p_GDALRasterAttributeTableShadow[] = {  {&_swigt__p_GDALRasterAttributeTableShadow, 0, 0, 0},{0, 0, 0, 0}};
43621 static swig_cast_info _swigc__p_GDALRasterBandShadow[] = {  {&_swigt__p_GDALRasterBandShadow, 0, 0, 0},{0, 0, 0, 0}};
43622 static swig_cast_info _swigc__p_GDALRasterizeOptions[] = {  {&_swigt__p_GDALRasterizeOptions, 0, 0, 0},{0, 0, 0, 0}};
43623 static swig_cast_info _swigc__p_GDALTransformerInfoShadow[] = {  {&_swigt__p_GDALTransformerInfoShadow, 0, 0, 0},{0, 0, 0, 0}};
43624 static swig_cast_info _swigc__p_GDALTranslateOptions[] = {  {&_swigt__p_GDALTranslateOptions, 0, 0, 0},{0, 0, 0, 0}};
43625 static swig_cast_info _swigc__p_GDALVectorTranslateOptions[] = {  {&_swigt__p_GDALVectorTranslateOptions, 0, 0, 0},{0, 0, 0, 0}};
43626 static swig_cast_info _swigc__p_GDALViewshedMode[] = {  {&_swigt__p_GDALViewshedMode, 0, 0, 0},{0, 0, 0, 0}};
43627 static swig_cast_info _swigc__p_GDALViewshedOutputType[] = {  {&_swigt__p_GDALViewshedOutputType, 0, 0, 0},{0, 0, 0, 0}};
43628 static swig_cast_info _swigc__p_GDALWarpAppOptions[] = {  {&_swigt__p_GDALWarpAppOptions, 0, 0, 0},{0, 0, 0, 0}};
43629 static swig_cast_info _swigc__p_GDAL_GCP[] = {  {&_swigt__p_GDAL_GCP, 0, 0, 0},{0, 0, 0, 0}};
43630 static swig_cast_info _swigc__p_GIntBig[] = {  {&_swigt__p_GIntBig, 0, 0, 0},{0, 0, 0, 0}};
43631 static swig_cast_info _swigc__p_GUIntBig[] = {  {&_swigt__p_GUIntBig, 0, 0, 0},{0, 0, 0, 0}};
43632 static swig_cast_info _swigc__p_OGRFeatureShadow[] = {  {&_swigt__p_OGRFeatureShadow, 0, 0, 0},{0, 0, 0, 0}};
43633 static swig_cast_info _swigc__p_OGRFieldDomainShadow[] = {  {&_swigt__p_OGRFieldDomainShadow, 0, 0, 0},{0, 0, 0, 0}};
43634 static swig_cast_info _swigc__p_OGRGeometryShadow[] = {  {&_swigt__p_OGRGeometryShadow, 0, 0, 0},{0, 0, 0, 0}};
43635 static swig_cast_info _swigc__p_OGRLayerShadow[] = {  {&_swigt__p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
43636 static swig_cast_info _swigc__p_OGRStyleTableShadow[] = {  {&_swigt__p_OGRStyleTableShadow, 0, 0, 0},{0, 0, 0, 0}};
43637 static swig_cast_info _swigc__p_OSRSpatialReferenceShadow[] = {  {&_swigt__p_OSRSpatialReferenceShadow, 0, 0, 0},{0, 0, 0, 0}};
43638 static swig_cast_info _swigc__p_StatBuf[] = {  {&_swigt__p_StatBuf, 0, 0, 0},{0, 0, 0, 0}};
43639 static swig_cast_info _swigc__p_Statistics[] = {  {&_swigt__p_Statistics, 0, 0, 0},{0, 0, 0, 0}};
43640 static swig_cast_info _swigc__p_VSIDIR[] = {  {&_swigt__p_VSIDIR, 0, 0, 0},{0, 0, 0, 0}};
43641 static swig_cast_info _swigc__p_VSILFILE[] = {  {&_swigt__p_VSILFILE, 0, 0, 0},{0, 0, 0, 0}};
43642 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
43643 static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
43644 static swig_cast_info _swigc__p_f_double_p_q_const__char_p_void__int[] = {  {&_swigt__p_f_double_p_q_const__char_p_void__int, 0, 0, 0},{0, 0, 0, 0}};
43645 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
43646 static swig_cast_info _swigc__p_p_GByte[] = {  {&_swigt__p_p_GByte, 0, 0, 0},{0, 0, 0, 0}};
43647 static swig_cast_info _swigc__p_p_GDALDatasetShadow[] = {  {&_swigt__p_p_GDALDatasetShadow, 0, 0, 0},{0, 0, 0, 0}};
43648 static swig_cast_info _swigc__p_p_GDALDimensionHS[] = {  {&_swigt__p_p_GDALDimensionHS, 0, 0, 0},{0, 0, 0, 0}};
43649 static swig_cast_info _swigc__p_p_GDALEDTComponentHS[] = {  {&_swigt__p_p_GDALEDTComponentHS, 0, 0, 0},{0, 0, 0, 0}};
43650 static swig_cast_info _swigc__p_p_GDALRasterBandShadow[] = {  {&_swigt__p_p_GDALRasterBandShadow, 0, 0, 0},{0, 0, 0, 0}};
43651 static swig_cast_info _swigc__p_p_GDAL_GCP[] = {  {&_swigt__p_p_GDAL_GCP, 0, 0, 0},{0, 0, 0, 0}};
43652 static swig_cast_info _swigc__p_p_GUIntBig[] = {  {&_swigt__p_p_GUIntBig, 0, 0, 0},{0, 0, 0, 0}};
43653 static swig_cast_info _swigc__p_p_OGRLayerShadow[] = {  {&_swigt__p_p_OGRLayerShadow, 0, 0, 0},{0, 0, 0, 0}};
43654 static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
43655 static swig_cast_info _swigc__p_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
43656 static swig_cast_info _swigc__p_p_int[] = {  {&_swigt__p_p_int, 0, 0, 0},{0, 0, 0, 0}};
43657 static swig_cast_info _swigc__p_p_p_GDALAttributeHS[] = {  {&_swigt__p_p_p_GDALAttributeHS, 0, 0, 0},{0, 0, 0, 0}};
43658 static swig_cast_info _swigc__p_p_p_GDALDimensionHS[] = {  {&_swigt__p_p_p_GDALDimensionHS, 0, 0, 0},{0, 0, 0, 0}};
43659 static swig_cast_info _swigc__p_p_p_GDALEDTComponentHS[] = {  {&_swigt__p_p_p_GDALEDTComponentHS, 0, 0, 0},{0, 0, 0, 0}};
43660 static swig_cast_info _swigc__p_p_void[] = {  {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
43661 static swig_cast_info _swigc__p_size_t[] = {  {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
43662 static swig_cast_info _swigc__p_vsi_l_offset[] = {  {&_swigt__p_vsi_l_offset, 0, 0, 0},{0, 0, 0, 0}};
43663 
43664 static swig_cast_info *swig_cast_initial[] = {
43665   _swigc__p_CPLErrorHandler,
43666   _swigc__p_CPLVirtualMemShadow,
43667   _swigc__p_CPLXMLNode,
43668   _swigc__p_DirEntry,
43669   _swigc__p_GByte,
43670   _swigc__p_GDALAsyncReaderShadow,
43671   _swigc__p_GDALAttributeHS,
43672   _swigc__p_GDALBuildVRTOptions,
43673   _swigc__p_GDALColorEntry,
43674   _swigc__p_GDALColorTableShadow,
43675   _swigc__p_GDALDEMProcessingOptions,
43676   _swigc__p_GDALDatasetShadow,
43677   _swigc__p_GDALDimensionHS,
43678   _swigc__p_GDALDriverShadow,
43679   _swigc__p_GDALEDTComponentHS,
43680   _swigc__p_GDALExtendedDataTypeClass,
43681   _swigc__p_GDALExtendedDataTypeHS,
43682   _swigc__p_GDALGridOptions,
43683   _swigc__p_GDALGroupHS,
43684   _swigc__p_GDALInfoOptions,
43685   _swigc__p_GDALMDArrayHS,
43686   _swigc__p_GDALMajorObjectShadow,
43687   _swigc__p_GDALMultiDimInfoOptions,
43688   _swigc__p_GDALMultiDimTranslateOptions,
43689   _swigc__p_GDALNearblackOptions,
43690   _swigc__p_GDALProgressFunc,
43691   _swigc__p_GDALRasterAttributeTableShadow,
43692   _swigc__p_GDALRasterBandShadow,
43693   _swigc__p_GDALRasterizeOptions,
43694   _swigc__p_GDALTransformerInfoShadow,
43695   _swigc__p_GDALTranslateOptions,
43696   _swigc__p_GDALVectorTranslateOptions,
43697   _swigc__p_GDALViewshedMode,
43698   _swigc__p_GDALViewshedOutputType,
43699   _swigc__p_GDALWarpAppOptions,
43700   _swigc__p_GDAL_GCP,
43701   _swigc__p_GIntBig,
43702   _swigc__p_GUIntBig,
43703   _swigc__p_OGRFeatureShadow,
43704   _swigc__p_OGRFieldDomainShadow,
43705   _swigc__p_OGRGeometryShadow,
43706   _swigc__p_OGRLayerShadow,
43707   _swigc__p_OGRStyleTableShadow,
43708   _swigc__p_OSRSpatialReferenceShadow,
43709   _swigc__p_StatBuf,
43710   _swigc__p_Statistics,
43711   _swigc__p_VSIDIR,
43712   _swigc__p_VSILFILE,
43713   _swigc__p_char,
43714   _swigc__p_double,
43715   _swigc__p_f_double_p_q_const__char_p_void__int,
43716   _swigc__p_int,
43717   _swigc__p_p_GByte,
43718   _swigc__p_p_GDALDatasetShadow,
43719   _swigc__p_p_GDALDimensionHS,
43720   _swigc__p_p_GDALEDTComponentHS,
43721   _swigc__p_p_GDALRasterBandShadow,
43722   _swigc__p_p_GDAL_GCP,
43723   _swigc__p_p_GUIntBig,
43724   _swigc__p_p_OGRLayerShadow,
43725   _swigc__p_p_char,
43726   _swigc__p_p_double,
43727   _swigc__p_p_int,
43728   _swigc__p_p_p_GDALAttributeHS,
43729   _swigc__p_p_p_GDALDimensionHS,
43730   _swigc__p_p_p_GDALEDTComponentHS,
43731   _swigc__p_p_void,
43732   _swigc__p_size_t,
43733   _swigc__p_vsi_l_offset,
43734 };
43735 
43736 
43737 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
43738 
43739 static swig_const_info swig_const_table[] = {
43740 { SWIG_PY_POINTER, (char*)"TermProgress", 0, 0, (void *)((int (*)(double,char const *,void *))(GDALTermProgress)), &SWIGTYPE_p_f_double_p_q_const__char_p_void__int },
43741 {0, 0, 0, 0.0, 0, 0}};
43742 
43743 #ifdef __cplusplus
43744 }
43745 #endif
43746 /* -----------------------------------------------------------------------------
43747  * Type initialization:
43748  * This problem is tough by the requirement that no dynamic
43749  * memory is used. Also, since swig_type_info structures store pointers to
43750  * swig_cast_info structures and swig_cast_info structures store pointers back
43751  * to swig_type_info structures, we need some lookup code at initialization.
43752  * The idea is that swig generates all the structures that are needed.
43753  * The runtime then collects these partially filled structures.
43754  * The SWIG_InitializeModule function takes these initial arrays out of
43755  * swig_module, and does all the lookup, filling in the swig_module.types
43756  * array with the correct data and linking the correct swig_cast_info
43757  * structures together.
43758  *
43759  * The generated swig_type_info structures are assigned statically to an initial
43760  * array. We just loop through that array, and handle each type individually.
43761  * First we lookup if this type has been already loaded, and if so, use the
43762  * loaded structure instead of the generated one. Then we have to fill in the
43763  * cast linked list. The cast data is initially stored in something like a
43764  * two-dimensional array. Each row corresponds to a type (there are the same
43765  * number of rows as there are in the swig_type_initial array). Each entry in
43766  * a column is one of the swig_cast_info structures for that type.
43767  * The cast_initial array is actually an array of arrays, because each row has
43768  * a variable number of columns. So to actually build the cast linked list,
43769  * we find the array of casts associated with the type, and loop through it
43770  * adding the casts to the list. The one last trick we need to do is making
43771  * sure the type pointer in the swig_cast_info struct is correct.
43772  *
43773  * First off, we lookup the cast->type name to see if it is already loaded.
43774  * There are three cases to handle:
43775  *  1) If the cast->type has already been loaded AND the type we are adding
43776  *     casting info to has not been loaded (it is in this module), THEN we
43777  *     replace the cast->type pointer with the type pointer that has already
43778  *     been loaded.
43779  *  2) If BOTH types (the one we are adding casting info to, and the
43780  *     cast->type) are loaded, THEN the cast info has already been loaded by
43781  *     the previous module so we just ignore it.
43782  *  3) Finally, if cast->type has not already been loaded, then we add that
43783  *     swig_cast_info to the linked list (because the cast->type) pointer will
43784  *     be correct.
43785  * ----------------------------------------------------------------------------- */
43786 
43787 #ifdef __cplusplus
43788 extern "C" {
43789 #if 0
43790 } /* c-mode */
43791 #endif
43792 #endif
43793 
43794 #if 0
43795 #define SWIGRUNTIME_DEBUG
43796 #endif
43797 
43798 
43799 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)43800 SWIG_InitializeModule(void *clientdata) {
43801   size_t i;
43802   swig_module_info *module_head, *iter;
43803   int init;
43804 
43805   /* check to see if the circular list has been setup, if not, set it up */
43806   if (swig_module.next==0) {
43807     /* Initialize the swig_module */
43808     swig_module.type_initial = swig_type_initial;
43809     swig_module.cast_initial = swig_cast_initial;
43810     swig_module.next = &swig_module;
43811     init = 1;
43812   } else {
43813     init = 0;
43814   }
43815 
43816   /* Try and load any already created modules */
43817   module_head = SWIG_GetModule(clientdata);
43818   if (!module_head) {
43819     /* This is the first module loaded for this interpreter */
43820     /* so set the swig module into the interpreter */
43821     SWIG_SetModule(clientdata, &swig_module);
43822   } else {
43823     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
43824     iter=module_head;
43825     do {
43826       if (iter==&swig_module) {
43827         /* Our module is already in the list, so there's nothing more to do. */
43828         return;
43829       }
43830       iter=iter->next;
43831     } while (iter!= module_head);
43832 
43833     /* otherwise we must add our module into the list */
43834     swig_module.next = module_head->next;
43835     module_head->next = &swig_module;
43836   }
43837 
43838   /* When multiple interpreters are used, a module could have already been initialized in
43839        a different interpreter, but not yet have a pointer in this interpreter.
43840        In this case, we do not want to continue adding types... everything should be
43841        set up already */
43842   if (init == 0) return;
43843 
43844   /* Now work on filling in swig_module.types */
43845 #ifdef SWIGRUNTIME_DEBUG
43846   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
43847 #endif
43848   for (i = 0; i < swig_module.size; ++i) {
43849     swig_type_info *type = 0;
43850     swig_type_info *ret;
43851     swig_cast_info *cast;
43852 
43853 #ifdef SWIGRUNTIME_DEBUG
43854     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
43855 #endif
43856 
43857     /* if there is another module already loaded */
43858     if (swig_module.next != &swig_module) {
43859       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
43860     }
43861     if (type) {
43862       /* Overwrite clientdata field */
43863 #ifdef SWIGRUNTIME_DEBUG
43864       printf("SWIG_InitializeModule: found type %s\n", type->name);
43865 #endif
43866       if (swig_module.type_initial[i]->clientdata) {
43867         type->clientdata = swig_module.type_initial[i]->clientdata;
43868 #ifdef SWIGRUNTIME_DEBUG
43869         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
43870 #endif
43871       }
43872     } else {
43873       type = swig_module.type_initial[i];
43874     }
43875 
43876     /* Insert casting types */
43877     cast = swig_module.cast_initial[i];
43878     while (cast->type) {
43879       /* Don't need to add information already in the list */
43880       ret = 0;
43881 #ifdef SWIGRUNTIME_DEBUG
43882       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
43883 #endif
43884       if (swig_module.next != &swig_module) {
43885         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
43886 #ifdef SWIGRUNTIME_DEBUG
43887         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
43888 #endif
43889       }
43890       if (ret) {
43891         if (type == swig_module.type_initial[i]) {
43892 #ifdef SWIGRUNTIME_DEBUG
43893           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
43894 #endif
43895           cast->type = ret;
43896           ret = 0;
43897         } else {
43898           /* Check for casting already in the list */
43899           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
43900 #ifdef SWIGRUNTIME_DEBUG
43901           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
43902 #endif
43903           if (!ocast) ret = 0;
43904         }
43905       }
43906 
43907       if (!ret) {
43908 #ifdef SWIGRUNTIME_DEBUG
43909         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
43910 #endif
43911         if (type->cast) {
43912           type->cast->prev = cast;
43913           cast->next = type->cast;
43914         }
43915         type->cast = cast;
43916       }
43917       cast++;
43918     }
43919     /* Set entry in modules->types array equal to the type */
43920     swig_module.types[i] = type;
43921   }
43922   swig_module.types[i] = 0;
43923 
43924 #ifdef SWIGRUNTIME_DEBUG
43925   printf("**** SWIG_InitializeModule: Cast List ******\n");
43926   for (i = 0; i < swig_module.size; ++i) {
43927     int j = 0;
43928     swig_cast_info *cast = swig_module.cast_initial[i];
43929     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
43930     while (cast->type) {
43931       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
43932       cast++;
43933       ++j;
43934     }
43935     printf("---- Total casts: %d\n",j);
43936   }
43937   printf("**** SWIG_InitializeModule: Cast List ******\n");
43938 #endif
43939 }
43940 
43941 /* This function will propagate the clientdata field of type to
43942 * any new swig_type_info structures that have been added into the list
43943 * of equivalent types.  It is like calling
43944 * SWIG_TypeClientData(type, clientdata) a second time.
43945 */
43946 SWIGRUNTIME void
SWIG_PropagateClientData(void)43947 SWIG_PropagateClientData(void) {
43948   size_t i;
43949   swig_cast_info *equiv;
43950   static int init_run = 0;
43951 
43952   if (init_run) return;
43953   init_run = 1;
43954 
43955   for (i = 0; i < swig_module.size; i++) {
43956     if (swig_module.types[i]->clientdata) {
43957       equiv = swig_module.types[i]->cast;
43958       while (equiv) {
43959         if (!equiv->converter) {
43960           if (equiv->type && !equiv->type->clientdata)
43961           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
43962         }
43963         equiv = equiv->next;
43964       }
43965     }
43966   }
43967 }
43968 
43969 #ifdef __cplusplus
43970 #if 0
43971 {
43972   /* c-mode */
43973 #endif
43974 }
43975 #endif
43976 
43977 
43978 
43979 #ifdef __cplusplus
43980 extern "C" {
43981 #endif
43982 
43983   /* Python-specific SWIG API */
43984 #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
43985 #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
43986 #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
43987 
43988   /* -----------------------------------------------------------------------------
43989    * global variable support code.
43990    * ----------------------------------------------------------------------------- */
43991 
43992   typedef struct swig_globalvar {
43993     char       *name;                  /* Name of global variable */
43994     PyObject *(*get_attr)(void);       /* Return the current value */
43995     int       (*set_attr)(PyObject *); /* Set the value */
43996     struct swig_globalvar *next;
43997   } swig_globalvar;
43998 
43999   typedef struct swig_varlinkobject {
44000     PyObject_HEAD
44001     swig_globalvar *vars;
44002   } swig_varlinkobject;
44003 
44004   SWIGINTERN PyObject *
swig_varlink_repr(swig_varlinkobject * SWIGUNUSEDPARM (v))44005   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
44006 #if PY_VERSION_HEX >= 0x03000000
44007     return PyUnicode_InternFromString("<Swig global variables>");
44008 #else
44009     return PyString_FromString("<Swig global variables>");
44010 #endif
44011   }
44012 
44013   SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject * v)44014   swig_varlink_str(swig_varlinkobject *v) {
44015 #if PY_VERSION_HEX >= 0x03000000
44016     PyObject *str = PyUnicode_InternFromString("(");
44017     PyObject *tail;
44018     PyObject *joined;
44019     swig_globalvar *var;
44020     for (var = v->vars; var; var=var->next) {
44021       tail = PyUnicode_FromString(var->name);
44022       joined = PyUnicode_Concat(str, tail);
44023       Py_DecRef(str);
44024       Py_DecRef(tail);
44025       str = joined;
44026       if (var->next) {
44027         tail = PyUnicode_InternFromString(", ");
44028         joined = PyUnicode_Concat(str, tail);
44029         Py_DecRef(str);
44030         Py_DecRef(tail);
44031         str = joined;
44032       }
44033     }
44034     tail = PyUnicode_InternFromString(")");
44035     joined = PyUnicode_Concat(str, tail);
44036     Py_DecRef(str);
44037     Py_DecRef(tail);
44038     str = joined;
44039 #else
44040     PyObject *str = PyString_FromString("(");
44041     swig_globalvar *var;
44042     for (var = v->vars; var; var=var->next) {
44043       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
44044       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
44045     }
44046     PyString_ConcatAndDel(&str,PyString_FromString(")"));
44047 #endif
44048     return str;
44049   }
44050 
44051   SWIGINTERN int
swig_varlink_print(swig_varlinkobject * v,FILE * fp,int SWIGUNUSEDPARM (flags))44052   swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
44053     char *tmp;
44054     PyObject *str = swig_varlink_str(v);
44055     fprintf(fp,"Swig global variables ");
44056     fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
44057     SWIG_Python_str_DelForPy3(tmp);
44058     Py_DECREF(str);
44059     return 0;
44060   }
44061 
44062   SWIGINTERN void
swig_varlink_dealloc(swig_varlinkobject * v)44063   swig_varlink_dealloc(swig_varlinkobject *v) {
44064     swig_globalvar *var = v->vars;
44065     while (var) {
44066       swig_globalvar *n = var->next;
44067       free(var->name);
44068       free(var);
44069       var = n;
44070     }
44071   }
44072 
44073   SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject * v,char * n)44074   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
44075     PyObject *res = NULL;
44076     swig_globalvar *var = v->vars;
44077     while (var) {
44078       if (strcmp(var->name,n) == 0) {
44079         res = (*var->get_attr)();
44080         break;
44081       }
44082       var = var->next;
44083     }
44084     if (res == NULL && !PyErr_Occurred()) {
44085       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
44086     }
44087     return res;
44088   }
44089 
44090   SWIGINTERN int
swig_varlink_setattr(swig_varlinkobject * v,char * n,PyObject * p)44091   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
44092     int res = 1;
44093     swig_globalvar *var = v->vars;
44094     while (var) {
44095       if (strcmp(var->name,n) == 0) {
44096         res = (*var->set_attr)(p);
44097         break;
44098       }
44099       var = var->next;
44100     }
44101     if (res == 1 && !PyErr_Occurred()) {
44102       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
44103     }
44104     return res;
44105   }
44106 
44107   SWIGINTERN PyTypeObject*
swig_varlink_type(void)44108   swig_varlink_type(void) {
44109     static char varlink__doc__[] = "Swig var link object";
44110     static PyTypeObject varlink_type;
44111     static int type_init = 0;
44112     if (!type_init) {
44113       const PyTypeObject tmp = {
44114 #if PY_VERSION_HEX >= 0x03000000
44115         PyVarObject_HEAD_INIT(NULL, 0)
44116 #else
44117         PyObject_HEAD_INIT(NULL)
44118         0,                                  /* ob_size */
44119 #endif
44120         (char *)"swigvarlink",              /* tp_name */
44121         sizeof(swig_varlinkobject),         /* tp_basicsize */
44122         0,                                  /* tp_itemsize */
44123         (destructor) swig_varlink_dealloc,  /* tp_dealloc */
44124         (printfunc) swig_varlink_print,     /* tp_print */
44125         (getattrfunc) swig_varlink_getattr, /* tp_getattr */
44126         (setattrfunc) swig_varlink_setattr, /* tp_setattr */
44127         0,                                  /* tp_compare */
44128         (reprfunc) swig_varlink_repr,       /* tp_repr */
44129         0,                                  /* tp_as_number */
44130         0,                                  /* tp_as_sequence */
44131         0,                                  /* tp_as_mapping */
44132         0,                                  /* tp_hash */
44133         0,                                  /* tp_call */
44134         (reprfunc) swig_varlink_str,        /* tp_str */
44135         0,                                  /* tp_getattro */
44136         0,                                  /* tp_setattro */
44137         0,                                  /* tp_as_buffer */
44138         0,                                  /* tp_flags */
44139         varlink__doc__,                     /* tp_doc */
44140         0,                                  /* tp_traverse */
44141         0,                                  /* tp_clear */
44142         0,                                  /* tp_richcompare */
44143         0,                                  /* tp_weaklistoffset */
44144 #if PY_VERSION_HEX >= 0x02020000
44145         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
44146 #endif
44147 #if PY_VERSION_HEX >= 0x02030000
44148         0,                                  /* tp_del */
44149 #endif
44150 #if PY_VERSION_HEX >= 0x02060000
44151         0,                                  /* tp_version_tag */
44152 #endif
44153 #if PY_VERSION_HEX >= 0x03040000
44154         0,                                  /* tp_finalize */
44155 #endif
44156 #ifdef COUNT_ALLOCS
44157         0,                                  /* tp_allocs */
44158         0,                                  /* tp_frees */
44159         0,                                  /* tp_maxalloc */
44160 #if PY_VERSION_HEX >= 0x02050000
44161         0,                                  /* tp_prev */
44162 #endif
44163         0                                   /* tp_next */
44164 #endif
44165       };
44166       varlink_type = tmp;
44167       type_init = 1;
44168 #if PY_VERSION_HEX < 0x02020000
44169       varlink_type.ob_type = &PyType_Type;
44170 #else
44171       if (PyType_Ready(&varlink_type) < 0)
44172       return NULL;
44173 #endif
44174     }
44175     return &varlink_type;
44176   }
44177 
44178   /* Create a variable linking object for use later */
44179   SWIGINTERN PyObject *
SWIG_Python_newvarlink(void)44180   SWIG_Python_newvarlink(void) {
44181     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
44182     if (result) {
44183       result->vars = 0;
44184     }
44185     return ((PyObject*) result);
44186   }
44187 
44188   SWIGINTERN void
SWIG_Python_addvarlink(PyObject * p,char * name,PyObject * (* get_attr)(void),int (* set_attr)(PyObject * p))44189   SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
44190     swig_varlinkobject *v = (swig_varlinkobject *) p;
44191     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
44192     if (gv) {
44193       size_t size = strlen(name)+1;
44194       gv->name = (char *)malloc(size);
44195       if (gv->name) {
44196         strncpy(gv->name,name,size);
44197         gv->get_attr = get_attr;
44198         gv->set_attr = set_attr;
44199         gv->next = v->vars;
44200       }
44201     }
44202     v->vars = gv;
44203   }
44204 
44205   SWIGINTERN PyObject *
SWIG_globals(void)44206   SWIG_globals(void) {
44207     static PyObject *_SWIG_globals = 0;
44208     if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
44209     return _SWIG_globals;
44210   }
44211 
44212   /* -----------------------------------------------------------------------------
44213    * constants/methods manipulation
44214    * ----------------------------------------------------------------------------- */
44215 
44216   /* Install Constants */
44217   SWIGINTERN void
SWIG_Python_InstallConstants(PyObject * d,swig_const_info constants[])44218   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
44219     PyObject *obj = 0;
44220     size_t i;
44221     for (i = 0; constants[i].type; ++i) {
44222       switch(constants[i].type) {
44223       case SWIG_PY_POINTER:
44224         obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
44225         break;
44226       case SWIG_PY_BINARY:
44227         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
44228         break;
44229       default:
44230         obj = 0;
44231         break;
44232       }
44233       if (obj) {
44234         PyDict_SetItemString(d, constants[i].name, obj);
44235         Py_DECREF(obj);
44236       }
44237     }
44238   }
44239 
44240   /* -----------------------------------------------------------------------------*/
44241   /* Fix SwigMethods to carry the callback ptrs when needed */
44242   /* -----------------------------------------------------------------------------*/
44243 
44244   SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef * methods,swig_const_info * const_table,swig_type_info ** types,swig_type_info ** types_initial)44245   SWIG_Python_FixMethods(PyMethodDef *methods,
44246     swig_const_info *const_table,
44247     swig_type_info **types,
44248     swig_type_info **types_initial) {
44249     size_t i;
44250     for (i = 0; methods[i].ml_name; ++i) {
44251       const char *c = methods[i].ml_doc;
44252       if (!c) continue;
44253       c = strstr(c, "swig_ptr: ");
44254       if (c) {
44255         int j;
44256         swig_const_info *ci = 0;
44257         const char *name = c + 10;
44258         for (j = 0; const_table[j].type; ++j) {
44259           if (strncmp(const_table[j].name, name,
44260               strlen(const_table[j].name)) == 0) {
44261             ci = &(const_table[j]);
44262             break;
44263           }
44264         }
44265         if (ci) {
44266           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
44267           if (ptr) {
44268             size_t shift = (ci->ptype) - types;
44269             swig_type_info *ty = types_initial[shift];
44270             size_t ldoc = (c - methods[i].ml_doc);
44271             size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
44272             char *ndoc = (char*)malloc(ldoc + lptr + 10);
44273             if (ndoc) {
44274               char *buff = ndoc;
44275               strncpy(buff, methods[i].ml_doc, ldoc);
44276               buff += ldoc;
44277               memcpy(buff, "swig_ptr: ", 10);
44278               buff += 10;
44279               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
44280               methods[i].ml_doc = ndoc;
44281             }
44282           }
44283         }
44284       }
44285     }
44286   }
44287 
44288 #ifdef __cplusplus
44289 }
44290 #endif
44291 
44292 /* -----------------------------------------------------------------------------*
44293  *  Partial Init method
44294  * -----------------------------------------------------------------------------*/
44295 
44296 #ifdef __cplusplus
44297 extern "C"
44298 #endif
44299 
44300 SWIGEXPORT
44301 #if PY_VERSION_HEX >= 0x03000000
44302 PyObject*
44303 #else
44304 void
44305 #endif
SWIG_init(void)44306 SWIG_init(void) {
44307   PyObject *m, *d, *md;
44308 #if PY_VERSION_HEX >= 0x03000000
44309   static struct PyModuleDef SWIG_module = {
44310 # if PY_VERSION_HEX >= 0x03020000
44311     PyModuleDef_HEAD_INIT,
44312 # else
44313     {
44314       PyObject_HEAD_INIT(NULL)
44315       NULL, /* m_init */
44316       0,    /* m_index */
44317       NULL, /* m_copy */
44318     },
44319 # endif
44320     (char *) SWIG_name,
44321     NULL,
44322     -1,
44323     SwigMethods,
44324     NULL,
44325     NULL,
44326     NULL,
44327     NULL
44328   };
44329 #endif
44330 
44331 #if defined(SWIGPYTHON_BUILTIN)
44332   static SwigPyClientData SwigPyObject_clientdata = {
44333     0, 0, 0, 0, 0, 0, 0
44334   };
44335   static PyGetSetDef this_getset_def = {
44336     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
44337   };
44338   static SwigPyGetSet thisown_getset_closure = {
44339     (PyCFunction) SwigPyObject_own,
44340     (PyCFunction) SwigPyObject_own
44341   };
44342   static PyGetSetDef thisown_getset_def = {
44343     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
44344   };
44345   PyTypeObject *builtin_pytype;
44346   int builtin_base_count;
44347   swig_type_info *builtin_basetype;
44348   PyObject *tuple;
44349   PyGetSetDescrObject *static_getset;
44350   PyTypeObject *metatype;
44351   PyTypeObject *swigpyobject;
44352   SwigPyClientData *cd;
44353   PyObject *public_interface, *public_symbol;
44354   PyObject *this_descr;
44355   PyObject *thisown_descr;
44356   PyObject *self = 0;
44357   int i;
44358 
44359   (void)builtin_pytype;
44360   (void)builtin_base_count;
44361   (void)builtin_basetype;
44362   (void)tuple;
44363   (void)static_getset;
44364   (void)self;
44365 
44366   /* Metaclass is used to implement static member variables */
44367   metatype = SwigPyObjectType();
44368   assert(metatype);
44369 #endif
44370 
44371   /* Fix SwigMethods to carry the callback ptrs when needed */
44372   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
44373 
44374 #if PY_VERSION_HEX >= 0x03000000
44375   m = PyModule_Create(&SWIG_module);
44376 #else
44377   m = Py_InitModule((char *) SWIG_name, SwigMethods);
44378 #endif
44379 
44380   md = d = PyModule_GetDict(m);
44381   (void)md;
44382 
44383   SWIG_InitializeModule(0);
44384 
44385 #ifdef SWIGPYTHON_BUILTIN
44386   swigpyobject = SwigPyObject_TypeOnce();
44387 
44388   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
44389   assert(SwigPyObject_stype);
44390   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
44391   if (!cd) {
44392     SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
44393     SwigPyObject_clientdata.pytype = swigpyobject;
44394   } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
44395     PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
44396 # if PY_VERSION_HEX >= 0x03000000
44397     return NULL;
44398 # else
44399     return;
44400 # endif
44401   }
44402 
44403   /* All objects have a 'this' attribute */
44404   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
44405   (void)this_descr;
44406 
44407   /* All objects have a 'thisown' attribute */
44408   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
44409   (void)thisown_descr;
44410 
44411   public_interface = PyList_New(0);
44412   public_symbol = 0;
44413   (void)public_symbol;
44414 
44415   PyDict_SetItemString(md, "__all__", public_interface);
44416   Py_DECREF(public_interface);
44417   for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
44418   SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
44419   for (i = 0; swig_const_table[i].name != 0; ++i)
44420   SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
44421 #endif
44422 
44423   SWIG_InstallConstants(d,swig_const_table);
44424 
44425 
44426   /* gdal_python.i %init code */
44427   if ( GDALGetDriverCount() == 0 ) {
44428     GDALAllRegister();
44429   }
44430 
44431   SWIG_Python_SetConstant(d, "VSI_STAT_EXISTS_FLAG",SWIG_From_int(static_cast< int >(0x1)));
44432   SWIG_Python_SetConstant(d, "VSI_STAT_NATURE_FLAG",SWIG_From_int(static_cast< int >(0x2)));
44433   SWIG_Python_SetConstant(d, "VSI_STAT_SIZE_FLAG",SWIG_From_int(static_cast< int >(0x4)));
44434   SWIG_Python_SetConstant(d, "VSI_RANGE_STATUS_UNKNOWN",SWIG_From_int(static_cast< int >(0)));
44435   SWIG_Python_SetConstant(d, "VSI_RANGE_STATUS_DATA",SWIG_From_int(static_cast< int >(1)));
44436   SWIG_Python_SetConstant(d, "VSI_RANGE_STATUS_HOLE",SWIG_From_int(static_cast< int >(2)));
44437   SWIG_Python_SetConstant(d, "GEDTC_NUMERIC",SWIG_From_int(static_cast< int >(GEDTC_NUMERIC)));
44438   SWIG_Python_SetConstant(d, "GEDTC_STRING",SWIG_From_int(static_cast< int >(GEDTC_STRING)));
44439   SWIG_Python_SetConstant(d, "GEDTC_COMPOUND",SWIG_From_int(static_cast< int >(GEDTC_COMPOUND)));
44440 
44441   SWIG_Python_SetConstant(d, "GVM_Diagonal",SWIG_From_int(static_cast< int >(GVM_Diagonal)));
44442   SWIG_Python_SetConstant(d, "GVM_Edge",SWIG_From_int(static_cast< int >(GVM_Edge)));
44443   SWIG_Python_SetConstant(d, "GVM_Max",SWIG_From_int(static_cast< int >(GVM_Max)));
44444   SWIG_Python_SetConstant(d, "GVM_Min",SWIG_From_int(static_cast< int >(GVM_Min)));
44445   SWIG_Python_SetConstant(d, "GVOT_NORMAL",SWIG_From_int(static_cast< int >(GVOT_NORMAL)));
44446   SWIG_Python_SetConstant(d, "GVOT_MIN_TARGET_HEIGHT_FROM_DEM",SWIG_From_int(static_cast< int >(GVOT_MIN_TARGET_HEIGHT_FROM_DEM)));
44447   SWIG_Python_SetConstant(d, "GVOT_MIN_TARGET_HEIGHT_FROM_GROUND",SWIG_From_int(static_cast< int >(GVOT_MIN_TARGET_HEIGHT_FROM_GROUND)));
44448 
44449   /* Initialize threading */
44450   SWIG_PYTHON_INITIALIZE_THREADS;
44451 #if PY_VERSION_HEX >= 0x03000000
44452   return m;
44453 #else
44454   return;
44455 #endif
44456 }
44457 
44458 #define POST_PROCESSING_APPLIED
44459