Use spaces under tests/unit
[geos.git] / swig / python / geos_wrap.cxx
blobc3cd1a0abc26343911be00ba0086d1fdc41cc43a
1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 2.0.10
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 * ----------------------------------------------------------------------------- */
11 #define SWIGPYTHON
12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
15 #ifdef __cplusplus
16 /* SwigValueWrapper is described in swig.swg */
17 template<typename T> class SwigValueWrapper {
18 struct SwigMovePointer {
19 T *ptr;
20 SwigMovePointer(T *p) : ptr(p) { }
21 ~SwigMovePointer() { delete ptr; }
22 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
23 } pointer;
24 SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
25 SwigValueWrapper(const SwigValueWrapper<T>& rhs);
26 public:
27 SwigValueWrapper() : pointer(0) { }
28 SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
29 operator T&() const { return *pointer.ptr; }
30 T *operator&() { return pointer.ptr; }
33 template <typename T> T SwigValueInit() {
34 return T();
36 #endif
38 /* -----------------------------------------------------------------------------
39 * This section contains generic SWIG labels for method/variable
40 * declarations/attributes, and other compiler dependent labels.
41 * ----------------------------------------------------------------------------- */
43 /* template workaround for compilers that cannot correctly implement the C++ standard */
44 #ifndef SWIGTEMPLATEDISAMBIGUATOR
45 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
46 # define SWIGTEMPLATEDISAMBIGUATOR template
47 # elif defined(__HP_aCC)
48 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
49 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
50 # define SWIGTEMPLATEDISAMBIGUATOR template
51 # else
52 # define SWIGTEMPLATEDISAMBIGUATOR
53 # endif
54 #endif
56 /* inline attribute */
57 #ifndef SWIGINLINE
58 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
59 # define SWIGINLINE inline
60 # else
61 # define SWIGINLINE
62 # endif
63 #endif
65 /* attribute recognised by some compilers to avoid 'unused' warnings */
66 #ifndef SWIGUNUSED
67 # if defined(__GNUC__)
68 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69 # define SWIGUNUSED __attribute__ ((__unused__))
70 # else
71 # define SWIGUNUSED
72 # endif
73 # elif defined(__ICC)
74 # define SWIGUNUSED __attribute__ ((__unused__))
75 # else
76 # define SWIGUNUSED
77 # endif
78 #endif
80 #ifndef SWIG_MSC_UNSUPPRESS_4505
81 # if defined(_MSC_VER)
82 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
83 # endif
84 #endif
86 #ifndef SWIGUNUSEDPARM
87 # ifdef __cplusplus
88 # define SWIGUNUSEDPARM(p)
89 # else
90 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
91 # endif
92 #endif
94 /* internal SWIG method */
95 #ifndef SWIGINTERN
96 # define SWIGINTERN static SWIGUNUSED
97 #endif
99 /* internal inline SWIG method */
100 #ifndef SWIGINTERNINLINE
101 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
102 #endif
104 /* exporting methods */
105 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106 # ifndef GCC_HASCLASSVISIBILITY
107 # define GCC_HASCLASSVISIBILITY
108 # endif
109 #endif
111 #ifndef SWIGEXPORT
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 # if defined(STATIC_LINKED)
114 # define SWIGEXPORT
115 # else
116 # define SWIGEXPORT __declspec(dllexport)
117 # endif
118 # else
119 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120 # define SWIGEXPORT __attribute__ ((visibility("default")))
121 # else
122 # define SWIGEXPORT
123 # endif
124 # endif
125 #endif
127 /* calling conventions for Windows */
128 #ifndef SWIGSTDCALL
129 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130 # define SWIGSTDCALL __stdcall
131 # else
132 # define SWIGSTDCALL
133 # endif
134 #endif
136 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
137 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
138 # define _CRT_SECURE_NO_DEPRECATE
139 #endif
141 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
142 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
143 # define _SCL_SECURE_NO_DEPRECATE
144 #endif
148 /* Python.h has to appear first */
149 #include <Python.h>
151 /* -----------------------------------------------------------------------------
152 * swigrun.swg
154 * This file contains generic C API SWIG runtime support for pointer
155 * type checking.
156 * ----------------------------------------------------------------------------- */
158 /* This should only be incremented when either the layout of swig_type_info changes,
159 or for whatever reason, the runtime changes incompatibly */
160 #define SWIG_RUNTIME_VERSION "4"
162 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
163 #ifdef SWIG_TYPE_TABLE
164 # define SWIG_QUOTE_STRING(x) #x
165 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
166 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
167 #else
168 # define SWIG_TYPE_TABLE_NAME
169 #endif
172 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
173 creating a static or dynamic library from the SWIG runtime code.
174 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
176 But only do this if strictly necessary, ie, if you have problems
177 with your compiler or suchlike.
180 #ifndef SWIGRUNTIME
181 # define SWIGRUNTIME SWIGINTERN
182 #endif
184 #ifndef SWIGRUNTIMEINLINE
185 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
186 #endif
188 /* Generic buffer size */
189 #ifndef SWIG_BUFFER_SIZE
190 # define SWIG_BUFFER_SIZE 1024
191 #endif
193 /* Flags for pointer conversions */
194 #define SWIG_POINTER_DISOWN 0x1
195 #define SWIG_CAST_NEW_MEMORY 0x2
197 /* Flags for new pointer objects */
198 #define SWIG_POINTER_OWN 0x1
202 Flags/methods for returning states.
204 The SWIG conversion methods, as ConvertPtr, return an integer
205 that tells if the conversion was successful or not. And if not,
206 an error code can be returned (see swigerrors.swg for the codes).
208 Use the following macros/flags to set or process the returning
209 states.
211 In old versions of SWIG, code such as the following was usually written:
213 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
214 // success code
215 } else {
216 //fail code
219 Now you can be more explicit:
221 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
222 if (SWIG_IsOK(res)) {
223 // success code
224 } else {
225 // fail code
228 which is the same really, but now you can also do
230 Type *ptr;
231 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
232 if (SWIG_IsOK(res)) {
233 // success code
234 if (SWIG_IsNewObj(res) {
236 delete *ptr;
237 } else {
240 } else {
241 // fail code
244 I.e., now SWIG_ConvertPtr can return new objects and you can
245 identify the case and take care of the deallocation. Of course that
246 also requires SWIG_ConvertPtr to return new result values, such as
248 int SWIG_ConvertPtr(obj, ptr,...) {
249 if (<obj is ok>) {
250 if (<need new object>) {
251 *ptr = <ptr to new allocated object>;
252 return SWIG_NEWOBJ;
253 } else {
254 *ptr = <ptr to old object>;
255 return SWIG_OLDOBJ;
257 } else {
258 return SWIG_BADOBJ;
262 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
263 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
264 SWIG errors code.
266 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
267 allows to return the 'cast rank', for example, if you have this
269 int food(double)
270 int fooi(int);
272 and you call
274 food(1) // cast rank '1' (1 -> 1.0)
275 fooi(1) // cast rank '0'
277 just use the SWIG_AddCast()/SWIG_CheckState()
280 #define SWIG_OK (0)
281 #define SWIG_ERROR (-1)
282 #define SWIG_IsOK(r) (r >= 0)
283 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
285 /* The CastRankLimit says how many bits are used for the cast rank */
286 #define SWIG_CASTRANKLIMIT (1 << 8)
287 /* The NewMask denotes the object was created (using new/malloc) */
288 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
289 /* The TmpMask is for in/out typemaps that use temporal objects */
290 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
291 /* Simple returning values */
292 #define SWIG_BADOBJ (SWIG_ERROR)
293 #define SWIG_OLDOBJ (SWIG_OK)
294 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
295 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
296 /* Check, add and del mask methods */
297 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
298 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
299 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
300 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
301 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
302 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
304 /* Cast-Rank Mode */
305 #if defined(SWIG_CASTRANK_MODE)
306 # ifndef SWIG_TypeRank
307 # define SWIG_TypeRank unsigned long
308 # endif
309 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
310 # define SWIG_MAXCASTRANK (2)
311 # endif
312 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
313 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
314 SWIGINTERNINLINE int SWIG_AddCast(int r) {
315 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
317 SWIGINTERNINLINE int SWIG_CheckState(int r) {
318 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
320 #else /* no cast-rank mode */
321 # define SWIG_AddCast(r) (r)
322 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
323 #endif
326 #include <string.h>
328 #ifdef __cplusplus
329 extern "C" {
330 #endif
332 typedef void *(*swig_converter_func)(void *, int *);
333 typedef struct swig_type_info *(*swig_dycast_func)(void **);
335 /* Structure to store information on one type */
336 typedef struct swig_type_info {
337 const char *name; /* mangled name of this type */
338 const char *str; /* human readable name of this type */
339 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
340 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
341 void *clientdata; /* language specific type data */
342 int owndata; /* flag if the structure owns the clientdata */
343 } swig_type_info;
345 /* Structure to store a type and conversion function used for casting */
346 typedef struct swig_cast_info {
347 swig_type_info *type; /* pointer to type that is equivalent to this type */
348 swig_converter_func converter; /* function to cast the void pointers */
349 struct swig_cast_info *next; /* pointer to next cast in linked list */
350 struct swig_cast_info *prev; /* pointer to the previous cast */
351 } swig_cast_info;
353 /* Structure used to store module information
354 * Each module generates one structure like this, and the runtime collects
355 * all of these structures and stores them in a circularly linked list.*/
356 typedef struct swig_module_info {
357 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
358 size_t size; /* Number of types in this module */
359 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
360 swig_type_info **type_initial; /* Array of initially generated type structures */
361 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
362 void *clientdata; /* Language specific module data */
363 } swig_module_info;
366 Compare two type names skipping the space characters, therefore
367 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
369 Return 0 when the two name types are equivalent, as in
370 strncmp, but skipping ' '.
372 SWIGRUNTIME int
373 SWIG_TypeNameComp(const char *f1, const char *l1,
374 const char *f2, const char *l2) {
375 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
376 while ((*f1 == ' ') && (f1 != l1)) ++f1;
377 while ((*f2 == ' ') && (f2 != l2)) ++f2;
378 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
380 return (int)((l1 - f1) - (l2 - f2));
384 Check type equivalence in a name list like <name1>|<name2>|...
385 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
387 SWIGRUNTIME int
388 SWIG_TypeCmp(const char *nb, const char *tb) {
389 int equiv = 1;
390 const char* te = tb + strlen(tb);
391 const char* ne = nb;
392 while (equiv != 0 && *ne) {
393 for (nb = ne; *ne; ++ne) {
394 if (*ne == '|') break;
396 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
397 if (*ne) ++ne;
399 return equiv;
403 Check type equivalence in a name list like <name1>|<name2>|...
404 Return 0 if not equal, 1 if equal
406 SWIGRUNTIME int
407 SWIG_TypeEquiv(const char *nb, const char *tb) {
408 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
412 Check the typename
414 SWIGRUNTIME swig_cast_info *
415 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
416 if (ty) {
417 swig_cast_info *iter = ty->cast;
418 while (iter) {
419 if (strcmp(iter->type->name, c) == 0) {
420 if (iter == ty->cast)
421 return iter;
422 /* Move iter to the top of the linked list */
423 iter->prev->next = iter->next;
424 if (iter->next)
425 iter->next->prev = iter->prev;
426 iter->next = ty->cast;
427 iter->prev = 0;
428 if (ty->cast) ty->cast->prev = iter;
429 ty->cast = iter;
430 return iter;
432 iter = iter->next;
435 return 0;
439 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
441 SWIGRUNTIME swig_cast_info *
442 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
443 if (ty) {
444 swig_cast_info *iter = ty->cast;
445 while (iter) {
446 if (iter->type == from) {
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;
459 iter = iter->next;
462 return 0;
466 Cast a pointer up an inheritance hierarchy
468 SWIGRUNTIMEINLINE void *
469 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
470 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
474 Dynamic pointer casting. Down an inheritance hierarchy
476 SWIGRUNTIME swig_type_info *
477 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
478 swig_type_info *lastty = ty;
479 if (!ty || !ty->dcast) return ty;
480 while (ty && (ty->dcast)) {
481 ty = (*ty->dcast)(ptr);
482 if (ty) lastty = ty;
484 return lastty;
488 Return the name associated with this type
490 SWIGRUNTIMEINLINE const char *
491 SWIG_TypeName(const swig_type_info *ty) {
492 return ty->name;
496 Return the pretty name associated with this type,
497 that is an unmangled type name in a form presentable to the user.
499 SWIGRUNTIME const char *
500 SWIG_TypePrettyName(const swig_type_info *type) {
501 /* The "str" field contains the equivalent pretty names of the
502 type, separated by vertical-bar characters. We choose
503 to print the last name, as it is often (?) the most
504 specific. */
505 if (!type) return NULL;
506 if (type->str != NULL) {
507 const char *last_name = type->str;
508 const char *s;
509 for (s = type->str; *s; s++)
510 if (*s == '|') last_name = s+1;
511 return last_name;
513 else
514 return type->name;
518 Set the clientdata field for a type
520 SWIGRUNTIME void
521 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
522 swig_cast_info *cast = ti->cast;
523 /* if (ti->clientdata == clientdata) return; */
524 ti->clientdata = clientdata;
526 while (cast) {
527 if (!cast->converter) {
528 swig_type_info *tc = cast->type;
529 if (!tc->clientdata) {
530 SWIG_TypeClientData(tc, clientdata);
533 cast = cast->next;
536 SWIGRUNTIME void
537 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
538 SWIG_TypeClientData(ti, clientdata);
539 ti->owndata = 1;
543 Search for a swig_type_info structure only by mangled name
544 Search is a O(log #types)
546 We start searching at module start, and finish searching when start == end.
547 Note: if start == end at the beginning of the function, we go all the way around
548 the circular list.
550 SWIGRUNTIME swig_type_info *
551 SWIG_MangledTypeQueryModule(swig_module_info *start,
552 swig_module_info *end,
553 const char *name) {
554 swig_module_info *iter = start;
555 do {
556 if (iter->size) {
557 register size_t l = 0;
558 register size_t r = iter->size - 1;
559 do {
560 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
561 register size_t i = (l + r) >> 1;
562 const char *iname = iter->types[i]->name;
563 if (iname) {
564 register int compare = strcmp(name, iname);
565 if (compare == 0) {
566 return iter->types[i];
567 } else if (compare < 0) {
568 if (i) {
569 r = i - 1;
570 } else {
571 break;
573 } else if (compare > 0) {
574 l = i + 1;
576 } else {
577 break; /* should never happen */
579 } while (l <= r);
581 iter = iter->next;
582 } while (iter != end);
583 return 0;
587 Search for a swig_type_info structure for either a mangled name or a human readable name.
588 It first searches the mangled names of the types, which is a O(log #types)
589 If a type is not found it then searches the human readable names, which is O(#types).
591 We start searching at module start, and finish searching when start == end.
592 Note: if start == end at the beginning of the function, we go all the way around
593 the circular list.
595 SWIGRUNTIME swig_type_info *
596 SWIG_TypeQueryModule(swig_module_info *start,
597 swig_module_info *end,
598 const char *name) {
599 /* STEP 1: Search the name field using binary search */
600 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
601 if (ret) {
602 return ret;
603 } else {
604 /* STEP 2: If the type hasn't been found, do a complete search
605 of the str field (the human readable name) */
606 swig_module_info *iter = start;
607 do {
608 register size_t i = 0;
609 for (; i < iter->size; ++i) {
610 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
611 return iter->types[i];
613 iter = iter->next;
614 } while (iter != end);
617 /* neither found a match */
618 return 0;
622 Pack binary data into a string
624 SWIGRUNTIME char *
625 SWIG_PackData(char *c, void *ptr, size_t sz) {
626 static const char hex[17] = "0123456789abcdef";
627 register const unsigned char *u = (unsigned char *) ptr;
628 register const unsigned char *eu = u + sz;
629 for (; u != eu; ++u) {
630 register unsigned char uu = *u;
631 *(c++) = hex[(uu & 0xf0) >> 4];
632 *(c++) = hex[uu & 0xf];
634 return c;
638 Unpack binary data from a string
640 SWIGRUNTIME const char *
641 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
642 register unsigned char *u = (unsigned char *) ptr;
643 register const unsigned char *eu = u + sz;
644 for (; u != eu; ++u) {
645 register char d = *(c++);
646 register unsigned char uu;
647 if ((d >= '0') && (d <= '9'))
648 uu = ((d - '0') << 4);
649 else if ((d >= 'a') && (d <= 'f'))
650 uu = ((d - ('a'-10)) << 4);
651 else
652 return (char *) 0;
653 d = *(c++);
654 if ((d >= '0') && (d <= '9'))
655 uu |= (d - '0');
656 else if ((d >= 'a') && (d <= 'f'))
657 uu |= (d - ('a'-10));
658 else
659 return (char *) 0;
660 *u = uu;
662 return c;
666 Pack 'void *' into a string buffer.
668 SWIGRUNTIME char *
669 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
670 char *r = buff;
671 if ((2*sizeof(void *) + 2) > bsz) return 0;
672 *(r++) = '_';
673 r = SWIG_PackData(r,&ptr,sizeof(void *));
674 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
675 strcpy(r,name);
676 return buff;
679 SWIGRUNTIME const char *
680 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
681 if (*c != '_') {
682 if (strcmp(c,"NULL") == 0) {
683 *ptr = (void *) 0;
684 return name;
685 } else {
686 return 0;
689 return SWIG_UnpackData(++c,ptr,sizeof(void *));
692 SWIGRUNTIME char *
693 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
694 char *r = buff;
695 size_t lname = (name ? strlen(name) : 0);
696 if ((2*sz + 2 + lname) > bsz) return 0;
697 *(r++) = '_';
698 r = SWIG_PackData(r,ptr,sz);
699 if (lname) {
700 strncpy(r,name,lname+1);
701 } else {
702 *r = 0;
704 return buff;
707 SWIGRUNTIME const char *
708 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
709 if (*c != '_') {
710 if (strcmp(c,"NULL") == 0) {
711 memset(ptr,0,sz);
712 return name;
713 } else {
714 return 0;
717 return SWIG_UnpackData(++c,ptr,sz);
720 #ifdef __cplusplus
722 #endif
724 /* Errors in SWIG */
725 #define SWIG_UnknownError -1
726 #define SWIG_IOError -2
727 #define SWIG_RuntimeError -3
728 #define SWIG_IndexError -4
729 #define SWIG_TypeError -5
730 #define SWIG_DivisionByZero -6
731 #define SWIG_OverflowError -7
732 #define SWIG_SyntaxError -8
733 #define SWIG_ValueError -9
734 #define SWIG_SystemError -10
735 #define SWIG_AttributeError -11
736 #define SWIG_MemoryError -12
737 #define SWIG_NullReferenceError -13
741 /* Compatibility macros for Python 3 */
742 #if PY_VERSION_HEX >= 0x03000000
744 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
745 #define PyInt_Check(x) PyLong_Check(x)
746 #define PyInt_AsLong(x) PyLong_AsLong(x)
747 #define PyInt_FromLong(x) PyLong_FromLong(x)
748 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
749 #define PyString_Check(name) PyBytes_Check(name)
750 #define PyString_FromString(x) PyUnicode_FromString(x)
751 #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args)
752 #define PyString_AsString(str) PyBytes_AsString(str)
753 #define PyString_Size(str) PyBytes_Size(str)
754 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
755 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
756 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
757 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
759 #endif
761 #ifndef Py_TYPE
762 # define Py_TYPE(op) ((op)->ob_type)
763 #endif
765 /* SWIG APIs for compatibility of both Python 2 & 3 */
767 #if PY_VERSION_HEX >= 0x03000000
768 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat
769 #else
770 # define SWIG_Python_str_FromFormat PyString_FromFormat
771 #endif
774 /* Warning: This function will allocate a new string in Python 3,
775 * so please call SWIG_Python_str_DelForPy3(x) to free the space.
777 SWIGINTERN char*
778 SWIG_Python_str_AsChar(PyObject *str)
780 #if PY_VERSION_HEX >= 0x03000000
781 char *cstr;
782 char *newstr;
783 Py_ssize_t len;
784 str = PyUnicode_AsUTF8String(str);
785 PyBytes_AsStringAndSize(str, &cstr, &len);
786 newstr = (char *) malloc(len+1);
787 memcpy(newstr, cstr, len+1);
788 Py_XDECREF(str);
789 return newstr;
790 #else
791 return PyString_AsString(str);
792 #endif
795 #if PY_VERSION_HEX >= 0x03000000
796 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
797 #else
798 # define SWIG_Python_str_DelForPy3(x)
799 #endif
802 SWIGINTERN PyObject*
803 SWIG_Python_str_FromChar(const char *c)
805 #if PY_VERSION_HEX >= 0x03000000
806 return PyUnicode_FromString(c);
807 #else
808 return PyString_FromString(c);
809 #endif
812 /* Add PyOS_snprintf for old Pythons */
813 #if PY_VERSION_HEX < 0x02020000
814 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
815 # define PyOS_snprintf _snprintf
816 # else
817 # define PyOS_snprintf snprintf
818 # endif
819 #endif
821 /* A crude PyString_FromFormat implementation for old Pythons */
822 #if PY_VERSION_HEX < 0x02020000
824 #ifndef SWIG_PYBUFFER_SIZE
825 # define SWIG_PYBUFFER_SIZE 1024
826 #endif
828 static PyObject *
829 PyString_FromFormat(const char *fmt, ...) {
830 va_list ap;
831 char buf[SWIG_PYBUFFER_SIZE * 2];
832 int res;
833 va_start(ap, fmt);
834 res = vsnprintf(buf, sizeof(buf), fmt, ap);
835 va_end(ap);
836 return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
838 #endif
840 /* Add PyObject_Del for old Pythons */
841 #if PY_VERSION_HEX < 0x01060000
842 # define PyObject_Del(op) PyMem_DEL((op))
843 #endif
844 #ifndef PyObject_DEL
845 # define PyObject_DEL PyObject_Del
846 #endif
848 /* A crude PyExc_StopIteration exception for old Pythons */
849 #if PY_VERSION_HEX < 0x02020000
850 # ifndef PyExc_StopIteration
851 # define PyExc_StopIteration PyExc_RuntimeError
852 # endif
853 # ifndef PyObject_GenericGetAttr
854 # define PyObject_GenericGetAttr 0
855 # endif
856 #endif
858 /* Py_NotImplemented is defined in 2.1 and up. */
859 #if PY_VERSION_HEX < 0x02010000
860 # ifndef Py_NotImplemented
861 # define Py_NotImplemented PyExc_RuntimeError
862 # endif
863 #endif
865 /* A crude PyString_AsStringAndSize implementation for old Pythons */
866 #if PY_VERSION_HEX < 0x02010000
867 # ifndef PyString_AsStringAndSize
868 # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
869 # endif
870 #endif
872 /* PySequence_Size for old Pythons */
873 #if PY_VERSION_HEX < 0x02000000
874 # ifndef PySequence_Size
875 # define PySequence_Size PySequence_Length
876 # endif
877 #endif
879 /* PyBool_FromLong for old Pythons */
880 #if PY_VERSION_HEX < 0x02030000
881 static
882 PyObject *PyBool_FromLong(long ok)
884 PyObject *result = ok ? Py_True : Py_False;
885 Py_INCREF(result);
886 return result;
888 #endif
890 /* Py_ssize_t for old Pythons */
891 /* This code is as recommended by: */
892 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
893 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
894 typedef int Py_ssize_t;
895 # define PY_SSIZE_T_MAX INT_MAX
896 # define PY_SSIZE_T_MIN INT_MIN
897 typedef inquiry lenfunc;
898 typedef intargfunc ssizeargfunc;
899 typedef intintargfunc ssizessizeargfunc;
900 typedef intobjargproc ssizeobjargproc;
901 typedef intintobjargproc ssizessizeobjargproc;
902 typedef getreadbufferproc readbufferproc;
903 typedef getwritebufferproc writebufferproc;
904 typedef getsegcountproc segcountproc;
905 typedef getcharbufferproc charbufferproc;
906 static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
908 long result = 0;
909 PyObject *i = PyNumber_Int(x);
910 if (i) {
911 result = PyInt_AsLong(i);
912 Py_DECREF(i);
914 return result;
916 #endif
918 #if PY_VERSION_HEX < 0x02050000
919 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x)
920 #endif
922 #if PY_VERSION_HEX < 0x02040000
923 #define Py_VISIT(op) \
924 do { \
925 if (op) { \
926 int vret = visit((op), arg); \
927 if (vret) \
928 return vret; \
930 } while (0)
931 #endif
933 #if PY_VERSION_HEX < 0x02030000
934 typedef struct {
935 PyTypeObject type;
936 PyNumberMethods as_number;
937 PyMappingMethods as_mapping;
938 PySequenceMethods as_sequence;
939 PyBufferProcs as_buffer;
940 PyObject *name, *slots;
941 } PyHeapTypeObject;
942 #endif
944 #if PY_VERSION_HEX < 0x02030000
945 typedef destructor freefunc;
946 #endif
948 #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
949 (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
950 (PY_MAJOR_VERSION > 3))
951 # define SWIGPY_USE_CAPSULE
952 # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
953 #endif
955 #if PY_VERSION_HEX < 0x03020000
956 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
957 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
958 #endif
960 /* -----------------------------------------------------------------------------
961 * error manipulation
962 * ----------------------------------------------------------------------------- */
964 SWIGRUNTIME PyObject*
965 SWIG_Python_ErrorType(int code) {
966 PyObject* type = 0;
967 switch(code) {
968 case SWIG_MemoryError:
969 type = PyExc_MemoryError;
970 break;
971 case SWIG_IOError:
972 type = PyExc_IOError;
973 break;
974 case SWIG_RuntimeError:
975 type = PyExc_RuntimeError;
976 break;
977 case SWIG_IndexError:
978 type = PyExc_IndexError;
979 break;
980 case SWIG_TypeError:
981 type = PyExc_TypeError;
982 break;
983 case SWIG_DivisionByZero:
984 type = PyExc_ZeroDivisionError;
985 break;
986 case SWIG_OverflowError:
987 type = PyExc_OverflowError;
988 break;
989 case SWIG_SyntaxError:
990 type = PyExc_SyntaxError;
991 break;
992 case SWIG_ValueError:
993 type = PyExc_ValueError;
994 break;
995 case SWIG_SystemError:
996 type = PyExc_SystemError;
997 break;
998 case SWIG_AttributeError:
999 type = PyExc_AttributeError;
1000 break;
1001 default:
1002 type = PyExc_RuntimeError;
1004 return type;
1008 SWIGRUNTIME void
1009 SWIG_Python_AddErrorMsg(const char* mesg)
1011 PyObject *type = 0;
1012 PyObject *value = 0;
1013 PyObject *traceback = 0;
1015 if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
1016 if (value) {
1017 char *tmp;
1018 PyObject *old_str = PyObject_Str(value);
1019 PyErr_Clear();
1020 Py_XINCREF(type);
1022 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
1023 SWIG_Python_str_DelForPy3(tmp);
1024 Py_DECREF(old_str);
1025 Py_DECREF(value);
1026 } else {
1027 PyErr_SetString(PyExc_RuntimeError, mesg);
1031 #if defined(SWIG_PYTHON_NO_THREADS)
1032 # if defined(SWIG_PYTHON_THREADS)
1033 # undef SWIG_PYTHON_THREADS
1034 # endif
1035 #endif
1036 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
1037 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
1038 # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
1039 # define SWIG_PYTHON_USE_GIL
1040 # endif
1041 # endif
1042 # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
1043 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
1044 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
1045 # endif
1046 # ifdef __cplusplus /* C++ code */
1047 class SWIG_Python_Thread_Block {
1048 bool status;
1049 PyGILState_STATE state;
1050 public:
1051 void end() { if (status) { PyGILState_Release(state); status = false;} }
1052 SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
1053 ~SWIG_Python_Thread_Block() { end(); }
1055 class SWIG_Python_Thread_Allow {
1056 bool status;
1057 PyThreadState *save;
1058 public:
1059 void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
1060 SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
1061 ~SWIG_Python_Thread_Allow() { end(); }
1063 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
1064 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
1065 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
1066 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
1067 # else /* C code */
1068 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
1069 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
1070 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
1071 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
1072 # endif
1073 # else /* Old thread way, not implemented, user must provide it */
1074 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
1075 # define SWIG_PYTHON_INITIALIZE_THREADS
1076 # endif
1077 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
1078 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1079 # endif
1080 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
1081 # define SWIG_PYTHON_THREAD_END_BLOCK
1082 # endif
1083 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
1084 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1085 # endif
1086 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1087 # define SWIG_PYTHON_THREAD_END_ALLOW
1088 # endif
1089 # endif
1090 #else /* No thread support */
1091 # define SWIG_PYTHON_INITIALIZE_THREADS
1092 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1093 # define SWIG_PYTHON_THREAD_END_BLOCK
1094 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1095 # define SWIG_PYTHON_THREAD_END_ALLOW
1096 #endif
1098 /* -----------------------------------------------------------------------------
1099 * Python API portion that goes into the runtime
1100 * ----------------------------------------------------------------------------- */
1102 #ifdef __cplusplus
1103 extern "C" {
1104 #endif
1106 /* -----------------------------------------------------------------------------
1107 * Constant declarations
1108 * ----------------------------------------------------------------------------- */
1110 /* Constant Types */
1111 #define SWIG_PY_POINTER 4
1112 #define SWIG_PY_BINARY 5
1114 /* Constant information structure */
1115 typedef struct swig_const_info {
1116 int type;
1117 char *name;
1118 long lvalue;
1119 double dvalue;
1120 void *pvalue;
1121 swig_type_info **ptype;
1122 } swig_const_info;
1125 /* -----------------------------------------------------------------------------
1126 * Wrapper of PyInstanceMethod_New() used in Python 3
1127 * It is exported to the generated module, used for -fastproxy
1128 * ----------------------------------------------------------------------------- */
1129 #if PY_VERSION_HEX >= 0x03000000
1130 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
1132 return PyInstanceMethod_New(func);
1134 #else
1135 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
1137 return NULL;
1139 #endif
1141 #ifdef __cplusplus
1143 #endif
1146 /* -----------------------------------------------------------------------------
1147 * pyrun.swg
1149 * This file contains the runtime support for Python modules
1150 * and includes code for managing global variables and pointer
1151 * type checking.
1153 * ----------------------------------------------------------------------------- */
1155 /* Common SWIG API */
1157 /* for raw pointers */
1158 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1159 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1160 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1162 #ifdef SWIGPYTHON_BUILTIN
1163 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags)
1164 #else
1165 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1166 #endif
1168 #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1170 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
1171 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
1172 #define swig_owntype int
1174 /* for raw packed data */
1175 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1176 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1178 /* for class or struct pointers */
1179 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1180 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1182 /* for C or C++ function pointers */
1183 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1184 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1186 /* for C++ member pointers, ie, member methods */
1187 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1188 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1191 /* Runtime API */
1193 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata)
1194 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1195 #define SWIG_NewClientData(obj) SwigPyClientData_New(obj)
1197 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1198 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1199 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1200 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1201 #define SWIG_fail goto fail
1204 /* Runtime API implementation */
1206 /* Error manipulation */
1208 SWIGINTERN void
1209 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1210 SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1211 PyErr_SetObject(errtype, obj);
1212 Py_DECREF(obj);
1213 SWIG_PYTHON_THREAD_END_BLOCK;
1216 SWIGINTERN void
1217 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1218 SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1219 PyErr_SetString(errtype, msg);
1220 SWIG_PYTHON_THREAD_END_BLOCK;
1223 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1225 /* Set a constant value */
1227 #if defined(SWIGPYTHON_BUILTIN)
1229 SWIGINTERN void
1230 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1231 PyObject *s = PyString_InternFromString(key);
1232 PyList_Append(seq, s);
1233 Py_DECREF(s);
1236 SWIGINTERN void
1237 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1238 #if PY_VERSION_HEX < 0x02030000
1239 PyDict_SetItemString(d, (char *)name, obj);
1240 #else
1241 PyDict_SetItemString(d, name, obj);
1242 #endif
1243 Py_DECREF(obj);
1244 if (public_interface)
1245 SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1248 #else
1250 SWIGINTERN void
1251 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1252 #if PY_VERSION_HEX < 0x02030000
1253 PyDict_SetItemString(d, (char *)name, obj);
1254 #else
1255 PyDict_SetItemString(d, name, obj);
1256 #endif
1257 Py_DECREF(obj);
1260 #endif
1262 /* Append a value to the result obj */
1264 SWIGINTERN PyObject*
1265 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1266 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1267 if (!result) {
1268 result = obj;
1269 } else if (result == Py_None) {
1270 Py_DECREF(result);
1271 result = obj;
1272 } else {
1273 if (!PyList_Check(result)) {
1274 PyObject *o2 = result;
1275 result = PyList_New(1);
1276 PyList_SetItem(result, 0, o2);
1278 PyList_Append(result,obj);
1279 Py_DECREF(obj);
1281 return result;
1282 #else
1283 PyObject* o2;
1284 PyObject* o3;
1285 if (!result) {
1286 result = obj;
1287 } else if (result == Py_None) {
1288 Py_DECREF(result);
1289 result = obj;
1290 } else {
1291 if (!PyTuple_Check(result)) {
1292 o2 = result;
1293 result = PyTuple_New(1);
1294 PyTuple_SET_ITEM(result, 0, o2);
1296 o3 = PyTuple_New(1);
1297 PyTuple_SET_ITEM(o3, 0, obj);
1298 o2 = result;
1299 result = PySequence_Concat(o2, o3);
1300 Py_DECREF(o2);
1301 Py_DECREF(o3);
1303 return result;
1304 #endif
1307 /* Unpack the argument tuple */
1309 SWIGINTERN int
1310 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1312 if (!args) {
1313 if (!min && !max) {
1314 return 1;
1315 } else {
1316 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1317 name, (min == max ? "" : "at least "), (int)min);
1318 return 0;
1321 if (!PyTuple_Check(args)) {
1322 if (min <= 1 && max >= 1) {
1323 register int i;
1324 objs[0] = args;
1325 for (i = 1; i < max; ++i) {
1326 objs[i] = 0;
1328 return 2;
1330 PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1331 return 0;
1332 } else {
1333 register Py_ssize_t l = PyTuple_GET_SIZE(args);
1334 if (l < min) {
1335 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1336 name, (min == max ? "" : "at least "), (int)min, (int)l);
1337 return 0;
1338 } else if (l > max) {
1339 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1340 name, (min == max ? "" : "at most "), (int)max, (int)l);
1341 return 0;
1342 } else {
1343 register int i;
1344 for (i = 0; i < l; ++i) {
1345 objs[i] = PyTuple_GET_ITEM(args, i);
1347 for (; l < max; ++l) {
1348 objs[l] = 0;
1350 return i + 1;
1355 /* A functor is a function object with one single object argument */
1356 #if PY_VERSION_HEX >= 0x02020000
1357 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1358 #else
1359 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
1360 #endif
1363 Helper for static pointer initialization for both C and C++ code, for example
1364 static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1366 #ifdef __cplusplus
1367 #define SWIG_STATIC_POINTER(var) var
1368 #else
1369 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1370 #endif
1372 /* -----------------------------------------------------------------------------
1373 * Pointer declarations
1374 * ----------------------------------------------------------------------------- */
1376 /* Flags for new pointer objects */
1377 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1378 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1380 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1382 #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2)
1383 #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1385 #ifdef __cplusplus
1386 extern "C" {
1387 #endif
1389 /* How to access Py_None */
1390 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1391 # ifndef SWIG_PYTHON_NO_BUILD_NONE
1392 # ifndef SWIG_PYTHON_BUILD_NONE
1393 # define SWIG_PYTHON_BUILD_NONE
1394 # endif
1395 # endif
1396 #endif
1398 #ifdef SWIG_PYTHON_BUILD_NONE
1399 # ifdef Py_None
1400 # undef Py_None
1401 # define Py_None SWIG_Py_None()
1402 # endif
1403 SWIGRUNTIMEINLINE PyObject *
1404 _SWIG_Py_None(void)
1406 PyObject *none = Py_BuildValue((char*)"");
1407 Py_DECREF(none);
1408 return none;
1410 SWIGRUNTIME PyObject *
1411 SWIG_Py_None(void)
1413 static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1414 return none;
1416 #endif
1418 /* The python void return value */
1420 SWIGRUNTIMEINLINE PyObject *
1421 SWIG_Py_Void(void)
1423 PyObject *none = Py_None;
1424 Py_INCREF(none);
1425 return none;
1428 /* SwigPyClientData */
1430 typedef struct {
1431 PyObject *klass;
1432 PyObject *newraw;
1433 PyObject *newargs;
1434 PyObject *destroy;
1435 int delargs;
1436 int implicitconv;
1437 PyTypeObject *pytype;
1438 } SwigPyClientData;
1440 SWIGRUNTIMEINLINE int
1441 SWIG_Python_CheckImplicit(swig_type_info *ty)
1443 SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1444 return data ? data->implicitconv : 0;
1447 SWIGRUNTIMEINLINE PyObject *
1448 SWIG_Python_ExceptionType(swig_type_info *desc) {
1449 SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1450 PyObject *klass = data ? data->klass : 0;
1451 return (klass ? klass : PyExc_RuntimeError);
1455 SWIGRUNTIME SwigPyClientData *
1456 SwigPyClientData_New(PyObject* obj)
1458 if (!obj) {
1459 return 0;
1460 } else {
1461 SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1462 /* the klass element */
1463 data->klass = obj;
1464 Py_INCREF(data->klass);
1465 /* the newraw method and newargs arguments used to create a new raw instance */
1466 if (PyClass_Check(obj)) {
1467 data->newraw = 0;
1468 data->newargs = obj;
1469 Py_INCREF(obj);
1470 } else {
1471 #if (PY_VERSION_HEX < 0x02020000)
1472 data->newraw = 0;
1473 #else
1474 data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1475 #endif
1476 if (data->newraw) {
1477 Py_INCREF(data->newraw);
1478 data->newargs = PyTuple_New(1);
1479 PyTuple_SetItem(data->newargs, 0, obj);
1480 } else {
1481 data->newargs = obj;
1483 Py_INCREF(data->newargs);
1485 /* the destroy method, aka as the C++ delete method */
1486 data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1487 if (PyErr_Occurred()) {
1488 PyErr_Clear();
1489 data->destroy = 0;
1491 if (data->destroy) {
1492 int flags;
1493 Py_INCREF(data->destroy);
1494 flags = PyCFunction_GET_FLAGS(data->destroy);
1495 #ifdef METH_O
1496 data->delargs = !(flags & (METH_O));
1497 #else
1498 data->delargs = 0;
1499 #endif
1500 } else {
1501 data->delargs = 0;
1503 data->implicitconv = 0;
1504 data->pytype = 0;
1505 return data;
1509 SWIGRUNTIME void
1510 SwigPyClientData_Del(SwigPyClientData *data) {
1511 Py_XDECREF(data->newraw);
1512 Py_XDECREF(data->newargs);
1513 Py_XDECREF(data->destroy);
1516 /* =============== SwigPyObject =====================*/
1518 typedef struct {
1519 PyObject_HEAD
1520 void *ptr;
1521 swig_type_info *ty;
1522 int own;
1523 PyObject *next;
1524 #ifdef SWIGPYTHON_BUILTIN
1525 PyObject *dict;
1526 #endif
1527 } SwigPyObject;
1529 SWIGRUNTIME PyObject *
1530 SwigPyObject_long(SwigPyObject *v)
1532 return PyLong_FromVoidPtr(v->ptr);
1535 SWIGRUNTIME PyObject *
1536 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1538 PyObject *res = NULL;
1539 PyObject *args = PyTuple_New(1);
1540 if (args) {
1541 if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1542 PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1543 if (ofmt) {
1544 #if PY_VERSION_HEX >= 0x03000000
1545 res = PyUnicode_Format(ofmt,args);
1546 #else
1547 res = PyString_Format(ofmt,args);
1548 #endif
1549 Py_DECREF(ofmt);
1551 Py_DECREF(args);
1554 return res;
1557 SWIGRUNTIME PyObject *
1558 SwigPyObject_oct(SwigPyObject *v)
1560 return SwigPyObject_format("%o",v);
1563 SWIGRUNTIME PyObject *
1564 SwigPyObject_hex(SwigPyObject *v)
1566 return SwigPyObject_format("%x",v);
1569 SWIGRUNTIME PyObject *
1570 #ifdef METH_NOARGS
1571 SwigPyObject_repr(SwigPyObject *v)
1572 #else
1573 SwigPyObject_repr(SwigPyObject *v, PyObject *args)
1574 #endif
1576 const char *name = SWIG_TypePrettyName(v->ty);
1577 PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1578 if (v->next) {
1579 # ifdef METH_NOARGS
1580 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1581 # else
1582 PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
1583 # endif
1584 # if PY_VERSION_HEX >= 0x03000000
1585 PyObject *joined = PyUnicode_Concat(repr, nrep);
1586 Py_DecRef(repr);
1587 Py_DecRef(nrep);
1588 repr = joined;
1589 # else
1590 PyString_ConcatAndDel(&repr,nrep);
1591 # endif
1593 return repr;
1596 SWIGRUNTIME int
1597 SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1599 char *str;
1600 #ifdef METH_NOARGS
1601 PyObject *repr = SwigPyObject_repr(v);
1602 #else
1603 PyObject *repr = SwigPyObject_repr(v, NULL);
1604 #endif
1605 if (repr) {
1606 str = SWIG_Python_str_AsChar(repr);
1607 fputs(str, fp);
1608 SWIG_Python_str_DelForPy3(str);
1609 Py_DECREF(repr);
1610 return 0;
1611 } else {
1612 return 1;
1616 SWIGRUNTIME PyObject *
1617 SwigPyObject_str(SwigPyObject *v)
1619 char result[SWIG_BUFFER_SIZE];
1620 return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
1621 SWIG_Python_str_FromChar(result) : 0;
1624 SWIGRUNTIME int
1625 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1627 void *i = v->ptr;
1628 void *j = w->ptr;
1629 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1632 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1633 SWIGRUNTIME PyObject*
1634 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1636 PyObject* res;
1637 if( op != Py_EQ && op != Py_NE ) {
1638 Py_INCREF(Py_NotImplemented);
1639 return Py_NotImplemented;
1641 res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1642 return res;
1646 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1648 #ifdef SWIGPYTHON_BUILTIN
1649 static swig_type_info *SwigPyObject_stype = 0;
1650 SWIGRUNTIME PyTypeObject*
1651 SwigPyObject_type(void) {
1652 SwigPyClientData *cd;
1653 assert(SwigPyObject_stype);
1654 cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1655 assert(cd);
1656 assert(cd->pytype);
1657 return cd->pytype;
1659 #else
1660 SWIGRUNTIME PyTypeObject*
1661 SwigPyObject_type(void) {
1662 static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1663 return type;
1665 #endif
1667 SWIGRUNTIMEINLINE int
1668 SwigPyObject_Check(PyObject *op) {
1669 #ifdef SWIGPYTHON_BUILTIN
1670 PyTypeObject *target_tp = SwigPyObject_type();
1671 if (PyType_IsSubtype(op->ob_type, target_tp))
1672 return 1;
1673 return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1674 #else
1675 return (Py_TYPE(op) == SwigPyObject_type())
1676 || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1677 #endif
1680 SWIGRUNTIME PyObject *
1681 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1683 SWIGRUNTIME void
1684 SwigPyObject_dealloc(PyObject *v)
1686 SwigPyObject *sobj = (SwigPyObject *) v;
1687 PyObject *next = sobj->next;
1688 if (sobj->own == SWIG_POINTER_OWN) {
1689 swig_type_info *ty = sobj->ty;
1690 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1691 PyObject *destroy = data ? data->destroy : 0;
1692 if (destroy) {
1693 /* destroy is always a VARARGS method */
1694 PyObject *res;
1695 if (data->delargs) {
1696 /* we need to create a temporary object to carry the destroy operation */
1697 PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1698 res = SWIG_Python_CallFunctor(destroy, tmp);
1699 Py_DECREF(tmp);
1700 } else {
1701 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1702 PyObject *mself = PyCFunction_GET_SELF(destroy);
1703 res = ((*meth)(mself, v));
1705 Py_XDECREF(res);
1707 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1708 else {
1709 const char *name = SWIG_TypePrettyName(ty);
1710 printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1712 #endif
1714 Py_XDECREF(next);
1715 PyObject_DEL(v);
1718 SWIGRUNTIME PyObject*
1719 SwigPyObject_append(PyObject* v, PyObject* next)
1721 SwigPyObject *sobj = (SwigPyObject *) v;
1722 #ifndef METH_O
1723 PyObject *tmp = 0;
1724 if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1725 next = tmp;
1726 #endif
1727 if (!SwigPyObject_Check(next)) {
1728 return NULL;
1730 sobj->next = next;
1731 Py_INCREF(next);
1732 return SWIG_Py_Void();
1735 SWIGRUNTIME PyObject*
1736 #ifdef METH_NOARGS
1737 SwigPyObject_next(PyObject* v)
1738 #else
1739 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1740 #endif
1742 SwigPyObject *sobj = (SwigPyObject *) v;
1743 if (sobj->next) {
1744 Py_INCREF(sobj->next);
1745 return sobj->next;
1746 } else {
1747 return SWIG_Py_Void();
1751 SWIGINTERN PyObject*
1752 #ifdef METH_NOARGS
1753 SwigPyObject_disown(PyObject *v)
1754 #else
1755 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1756 #endif
1758 SwigPyObject *sobj = (SwigPyObject *)v;
1759 sobj->own = 0;
1760 return SWIG_Py_Void();
1763 SWIGINTERN PyObject*
1764 #ifdef METH_NOARGS
1765 SwigPyObject_acquire(PyObject *v)
1766 #else
1767 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1768 #endif
1770 SwigPyObject *sobj = (SwigPyObject *)v;
1771 sobj->own = SWIG_POINTER_OWN;
1772 return SWIG_Py_Void();
1775 SWIGINTERN PyObject*
1776 SwigPyObject_own(PyObject *v, PyObject *args)
1778 PyObject *val = 0;
1779 #if (PY_VERSION_HEX < 0x02020000)
1780 if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1781 #elif (PY_VERSION_HEX < 0x02050000)
1782 if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1783 #else
1784 if (!PyArg_UnpackTuple(args, "own", 0, 1, &val))
1785 #endif
1787 return NULL;
1789 else
1791 SwigPyObject *sobj = (SwigPyObject *)v;
1792 PyObject *obj = PyBool_FromLong(sobj->own);
1793 if (val) {
1794 #ifdef METH_NOARGS
1795 if (PyObject_IsTrue(val)) {
1796 SwigPyObject_acquire(v);
1797 } else {
1798 SwigPyObject_disown(v);
1800 #else
1801 if (PyObject_IsTrue(val)) {
1802 SwigPyObject_acquire(v,args);
1803 } else {
1804 SwigPyObject_disown(v,args);
1806 #endif
1808 return obj;
1812 #ifdef METH_O
1813 static PyMethodDef
1814 swigobject_methods[] = {
1815 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1816 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"},
1817 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1818 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"},
1819 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1820 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"},
1821 {0, 0, 0, 0}
1823 #else
1824 static PyMethodDef
1825 swigobject_methods[] = {
1826 {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1827 {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
1828 {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1829 {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1830 {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1831 {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
1832 {0, 0, 0, 0}
1834 #endif
1836 #if PY_VERSION_HEX < 0x02020000
1837 SWIGINTERN PyObject *
1838 SwigPyObject_getattr(SwigPyObject *sobj,char *name)
1840 return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1842 #endif
1844 SWIGRUNTIME PyTypeObject*
1845 SwigPyObject_TypeOnce(void) {
1846 static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1848 static PyNumberMethods SwigPyObject_as_number = {
1849 (binaryfunc)0, /*nb_add*/
1850 (binaryfunc)0, /*nb_subtract*/
1851 (binaryfunc)0, /*nb_multiply*/
1852 /* nb_divide removed in Python 3 */
1853 #if PY_VERSION_HEX < 0x03000000
1854 (binaryfunc)0, /*nb_divide*/
1855 #endif
1856 (binaryfunc)0, /*nb_remainder*/
1857 (binaryfunc)0, /*nb_divmod*/
1858 (ternaryfunc)0,/*nb_power*/
1859 (unaryfunc)0, /*nb_negative*/
1860 (unaryfunc)0, /*nb_positive*/
1861 (unaryfunc)0, /*nb_absolute*/
1862 (inquiry)0, /*nb_nonzero*/
1863 0, /*nb_invert*/
1864 0, /*nb_lshift*/
1865 0, /*nb_rshift*/
1866 0, /*nb_and*/
1867 0, /*nb_xor*/
1868 0, /*nb_or*/
1869 #if PY_VERSION_HEX < 0x03000000
1870 0, /*nb_coerce*/
1871 #endif
1872 (unaryfunc)SwigPyObject_long, /*nb_int*/
1873 #if PY_VERSION_HEX < 0x03000000
1874 (unaryfunc)SwigPyObject_long, /*nb_long*/
1875 #else
1876 0, /*nb_reserved*/
1877 #endif
1878 (unaryfunc)0, /*nb_float*/
1879 #if PY_VERSION_HEX < 0x03000000
1880 (unaryfunc)SwigPyObject_oct, /*nb_oct*/
1881 (unaryfunc)SwigPyObject_hex, /*nb_hex*/
1882 #endif
1883 #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1884 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1885 #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
1886 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1887 #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
1888 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1889 #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
1890 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1891 #endif
1894 static PyTypeObject swigpyobject_type;
1895 static int type_init = 0;
1896 if (!type_init) {
1897 const PyTypeObject tmp = {
1898 /* PyObject header changed in Python 3 */
1899 #if PY_VERSION_HEX >= 0x03000000
1900 PyVarObject_HEAD_INIT(NULL, 0)
1901 #else
1902 PyObject_HEAD_INIT(NULL)
1903 0, /* ob_size */
1904 #endif
1905 (char *)"SwigPyObject", /* tp_name */
1906 sizeof(SwigPyObject), /* tp_basicsize */
1907 0, /* tp_itemsize */
1908 (destructor)SwigPyObject_dealloc, /* tp_dealloc */
1909 (printfunc)SwigPyObject_print, /* tp_print */
1910 #if PY_VERSION_HEX < 0x02020000
1911 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */
1912 #else
1913 (getattrfunc)0, /* tp_getattr */
1914 #endif
1915 (setattrfunc)0, /* tp_setattr */
1916 #if PY_VERSION_HEX >= 0x03000000
1917 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1918 #else
1919 (cmpfunc)SwigPyObject_compare, /* tp_compare */
1920 #endif
1921 (reprfunc)SwigPyObject_repr, /* tp_repr */
1922 &SwigPyObject_as_number, /* tp_as_number */
1923 0, /* tp_as_sequence */
1924 0, /* tp_as_mapping */
1925 (hashfunc)0, /* tp_hash */
1926 (ternaryfunc)0, /* tp_call */
1927 (reprfunc)SwigPyObject_str, /* tp_str */
1928 PyObject_GenericGetAttr, /* tp_getattro */
1929 0, /* tp_setattro */
1930 0, /* tp_as_buffer */
1931 Py_TPFLAGS_DEFAULT, /* tp_flags */
1932 swigobject_doc, /* tp_doc */
1933 0, /* tp_traverse */
1934 0, /* tp_clear */
1935 (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1936 0, /* tp_weaklistoffset */
1937 #if PY_VERSION_HEX >= 0x02020000
1938 0, /* tp_iter */
1939 0, /* tp_iternext */
1940 swigobject_methods, /* tp_methods */
1941 0, /* tp_members */
1942 0, /* tp_getset */
1943 0, /* tp_base */
1944 0, /* tp_dict */
1945 0, /* tp_descr_get */
1946 0, /* tp_descr_set */
1947 0, /* tp_dictoffset */
1948 0, /* tp_init */
1949 0, /* tp_alloc */
1950 0, /* tp_new */
1951 0, /* tp_free */
1952 0, /* tp_is_gc */
1953 0, /* tp_bases */
1954 0, /* tp_mro */
1955 0, /* tp_cache */
1956 0, /* tp_subclasses */
1957 0, /* tp_weaklist */
1958 #endif
1959 #if PY_VERSION_HEX >= 0x02030000
1960 0, /* tp_del */
1961 #endif
1962 #if PY_VERSION_HEX >= 0x02060000
1963 0, /* tp_version */
1964 #endif
1965 #ifdef COUNT_ALLOCS
1966 0,0,0,0 /* tp_alloc -> tp_next */
1967 #endif
1969 swigpyobject_type = tmp;
1970 type_init = 1;
1971 #if PY_VERSION_HEX < 0x02020000
1972 swigpyobject_type.ob_type = &PyType_Type;
1973 #else
1974 if (PyType_Ready(&swigpyobject_type) < 0)
1975 return NULL;
1976 #endif
1978 return &swigpyobject_type;
1981 SWIGRUNTIME PyObject *
1982 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1984 SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1985 if (sobj) {
1986 sobj->ptr = ptr;
1987 sobj->ty = ty;
1988 sobj->own = own;
1989 sobj->next = 0;
1991 return (PyObject *)sobj;
1994 /* -----------------------------------------------------------------------------
1995 * Implements a simple Swig Packed type, and use it instead of string
1996 * ----------------------------------------------------------------------------- */
1998 typedef struct {
1999 PyObject_HEAD
2000 void *pack;
2001 swig_type_info *ty;
2002 size_t size;
2003 } SwigPyPacked;
2005 SWIGRUNTIME int
2006 SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
2008 char result[SWIG_BUFFER_SIZE];
2009 fputs("<Swig Packed ", fp);
2010 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2011 fputs("at ", fp);
2012 fputs(result, fp);
2014 fputs(v->ty->name,fp);
2015 fputs(">", fp);
2016 return 0;
2019 SWIGRUNTIME PyObject *
2020 SwigPyPacked_repr(SwigPyPacked *v)
2022 char result[SWIG_BUFFER_SIZE];
2023 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
2024 return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
2025 } else {
2026 return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
2030 SWIGRUNTIME PyObject *
2031 SwigPyPacked_str(SwigPyPacked *v)
2033 char result[SWIG_BUFFER_SIZE];
2034 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
2035 return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
2036 } else {
2037 return SWIG_Python_str_FromChar(v->ty->name);
2041 SWIGRUNTIME int
2042 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
2044 size_t i = v->size;
2045 size_t j = w->size;
2046 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
2047 return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
2050 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
2052 SWIGRUNTIME PyTypeObject*
2053 SwigPyPacked_type(void) {
2054 static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
2055 return type;
2058 SWIGRUNTIMEINLINE int
2059 SwigPyPacked_Check(PyObject *op) {
2060 return ((op)->ob_type == SwigPyPacked_TypeOnce())
2061 || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
2064 SWIGRUNTIME void
2065 SwigPyPacked_dealloc(PyObject *v)
2067 if (SwigPyPacked_Check(v)) {
2068 SwigPyPacked *sobj = (SwigPyPacked *) v;
2069 free(sobj->pack);
2071 PyObject_DEL(v);
2074 SWIGRUNTIME PyTypeObject*
2075 SwigPyPacked_TypeOnce(void) {
2076 static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
2077 static PyTypeObject swigpypacked_type;
2078 static int type_init = 0;
2079 if (!type_init) {
2080 const PyTypeObject tmp = {
2081 /* PyObject header changed in Python 3 */
2082 #if PY_VERSION_HEX>=0x03000000
2083 PyVarObject_HEAD_INIT(NULL, 0)
2084 #else
2085 PyObject_HEAD_INIT(NULL)
2086 0, /* ob_size */
2087 #endif
2088 (char *)"SwigPyPacked", /* tp_name */
2089 sizeof(SwigPyPacked), /* tp_basicsize */
2090 0, /* tp_itemsize */
2091 (destructor)SwigPyPacked_dealloc, /* tp_dealloc */
2092 (printfunc)SwigPyPacked_print, /* tp_print */
2093 (getattrfunc)0, /* tp_getattr */
2094 (setattrfunc)0, /* tp_setattr */
2095 #if PY_VERSION_HEX>=0x03000000
2096 0, /* tp_reserved in 3.0.1 */
2097 #else
2098 (cmpfunc)SwigPyPacked_compare, /* tp_compare */
2099 #endif
2100 (reprfunc)SwigPyPacked_repr, /* tp_repr */
2101 0, /* tp_as_number */
2102 0, /* tp_as_sequence */
2103 0, /* tp_as_mapping */
2104 (hashfunc)0, /* tp_hash */
2105 (ternaryfunc)0, /* tp_call */
2106 (reprfunc)SwigPyPacked_str, /* tp_str */
2107 PyObject_GenericGetAttr, /* tp_getattro */
2108 0, /* tp_setattro */
2109 0, /* tp_as_buffer */
2110 Py_TPFLAGS_DEFAULT, /* tp_flags */
2111 swigpacked_doc, /* tp_doc */
2112 0, /* tp_traverse */
2113 0, /* tp_clear */
2114 0, /* tp_richcompare */
2115 0, /* tp_weaklistoffset */
2116 #if PY_VERSION_HEX >= 0x02020000
2117 0, /* tp_iter */
2118 0, /* tp_iternext */
2119 0, /* tp_methods */
2120 0, /* tp_members */
2121 0, /* tp_getset */
2122 0, /* tp_base */
2123 0, /* tp_dict */
2124 0, /* tp_descr_get */
2125 0, /* tp_descr_set */
2126 0, /* tp_dictoffset */
2127 0, /* tp_init */
2128 0, /* tp_alloc */
2129 0, /* tp_new */
2130 0, /* tp_free */
2131 0, /* tp_is_gc */
2132 0, /* tp_bases */
2133 0, /* tp_mro */
2134 0, /* tp_cache */
2135 0, /* tp_subclasses */
2136 0, /* tp_weaklist */
2137 #endif
2138 #if PY_VERSION_HEX >= 0x02030000
2139 0, /* tp_del */
2140 #endif
2141 #if PY_VERSION_HEX >= 0x02060000
2142 0, /* tp_version */
2143 #endif
2144 #ifdef COUNT_ALLOCS
2145 0,0,0,0 /* tp_alloc -> tp_next */
2146 #endif
2148 swigpypacked_type = tmp;
2149 type_init = 1;
2150 #if PY_VERSION_HEX < 0x02020000
2151 swigpypacked_type.ob_type = &PyType_Type;
2152 #else
2153 if (PyType_Ready(&swigpypacked_type) < 0)
2154 return NULL;
2155 #endif
2157 return &swigpypacked_type;
2160 SWIGRUNTIME PyObject *
2161 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
2163 SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
2164 if (sobj) {
2165 void *pack = malloc(size);
2166 if (pack) {
2167 memcpy(pack, ptr, size);
2168 sobj->pack = pack;
2169 sobj->ty = ty;
2170 sobj->size = size;
2171 } else {
2172 PyObject_DEL((PyObject *) sobj);
2173 sobj = 0;
2176 return (PyObject *) sobj;
2179 SWIGRUNTIME swig_type_info *
2180 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
2182 if (SwigPyPacked_Check(obj)) {
2183 SwigPyPacked *sobj = (SwigPyPacked *)obj;
2184 if (sobj->size != size) return 0;
2185 memcpy(ptr, sobj->pack, size);
2186 return sobj->ty;
2187 } else {
2188 return 0;
2192 /* -----------------------------------------------------------------------------
2193 * pointers/data manipulation
2194 * ----------------------------------------------------------------------------- */
2196 SWIGRUNTIMEINLINE PyObject *
2197 _SWIG_This(void)
2199 return SWIG_Python_str_FromChar("this");
2202 static PyObject *swig_this = NULL;
2204 SWIGRUNTIME PyObject *
2205 SWIG_This(void)
2207 if (swig_this == NULL)
2208 swig_this = _SWIG_This();
2209 return swig_this;
2212 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
2214 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
2215 #if PY_VERSION_HEX>=0x03000000
2216 #define SWIG_PYTHON_SLOW_GETSET_THIS
2217 #endif
2219 SWIGRUNTIME SwigPyObject *
2220 SWIG_Python_GetSwigThis(PyObject *pyobj)
2222 PyObject *obj;
2224 if (SwigPyObject_Check(pyobj))
2225 return (SwigPyObject *) pyobj;
2227 #ifdef SWIGPYTHON_BUILTIN
2228 (void)obj;
2229 # ifdef PyWeakref_CheckProxy
2230 if (PyWeakref_CheckProxy(pyobj)) {
2231 pyobj = PyWeakref_GET_OBJECT(pyobj);
2232 if (pyobj && SwigPyObject_Check(pyobj))
2233 return (SwigPyObject*) pyobj;
2235 # endif
2236 return NULL;
2237 #else
2239 obj = 0;
2241 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
2242 if (PyInstance_Check(pyobj)) {
2243 obj = _PyInstance_Lookup(pyobj, SWIG_This());
2244 } else {
2245 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2246 if (dictptr != NULL) {
2247 PyObject *dict = *dictptr;
2248 obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2249 } else {
2250 #ifdef PyWeakref_CheckProxy
2251 if (PyWeakref_CheckProxy(pyobj)) {
2252 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2253 return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2255 #endif
2256 obj = PyObject_GetAttr(pyobj,SWIG_This());
2257 if (obj) {
2258 Py_DECREF(obj);
2259 } else {
2260 if (PyErr_Occurred()) PyErr_Clear();
2261 return 0;
2265 #else
2266 obj = PyObject_GetAttr(pyobj,SWIG_This());
2267 if (obj) {
2268 Py_DECREF(obj);
2269 } else {
2270 if (PyErr_Occurred()) PyErr_Clear();
2271 return 0;
2273 #endif
2274 if (obj && !SwigPyObject_Check(obj)) {
2275 /* a PyObject is called 'this', try to get the 'real this'
2276 SwigPyObject from it */
2277 return SWIG_Python_GetSwigThis(obj);
2279 return (SwigPyObject *)obj;
2280 #endif
2283 /* Acquire a pointer value */
2285 SWIGRUNTIME int
2286 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2287 if (own == SWIG_POINTER_OWN) {
2288 SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2289 if (sobj) {
2290 int oldown = sobj->own;
2291 sobj->own = own;
2292 return oldown;
2295 return 0;
2298 /* Convert a pointer value */
2300 SWIGRUNTIME int
2301 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2302 int res;
2303 SwigPyObject *sobj;
2305 if (!obj)
2306 return SWIG_ERROR;
2307 if (obj == Py_None) {
2308 if (ptr)
2309 *ptr = 0;
2310 return SWIG_OK;
2313 res = SWIG_ERROR;
2315 sobj = SWIG_Python_GetSwigThis(obj);
2316 if (own)
2317 *own = 0;
2318 while (sobj) {
2319 void *vptr = sobj->ptr;
2320 if (ty) {
2321 swig_type_info *to = sobj->ty;
2322 if (to == ty) {
2323 /* no type cast needed */
2324 if (ptr) *ptr = vptr;
2325 break;
2326 } else {
2327 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2328 if (!tc) {
2329 sobj = (SwigPyObject *)sobj->next;
2330 } else {
2331 if (ptr) {
2332 int newmemory = 0;
2333 *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2334 if (newmemory == SWIG_CAST_NEW_MEMORY) {
2335 assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2336 if (own)
2337 *own = *own | SWIG_CAST_NEW_MEMORY;
2340 break;
2343 } else {
2344 if (ptr) *ptr = vptr;
2345 break;
2348 if (sobj) {
2349 if (own)
2350 *own = *own | sobj->own;
2351 if (flags & SWIG_POINTER_DISOWN) {
2352 sobj->own = 0;
2354 res = SWIG_OK;
2355 } else {
2356 if (flags & SWIG_POINTER_IMPLICIT_CONV) {
2357 SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2358 if (data && !data->implicitconv) {
2359 PyObject *klass = data->klass;
2360 if (klass) {
2361 PyObject *impconv;
2362 data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2363 impconv = SWIG_Python_CallFunctor(klass, obj);
2364 data->implicitconv = 0;
2365 if (PyErr_Occurred()) {
2366 PyErr_Clear();
2367 impconv = 0;
2369 if (impconv) {
2370 SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2371 if (iobj) {
2372 void *vptr;
2373 res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2374 if (SWIG_IsOK(res)) {
2375 if (ptr) {
2376 *ptr = vptr;
2377 /* transfer the ownership to 'ptr' */
2378 iobj->own = 0;
2379 res = SWIG_AddCast(res);
2380 res = SWIG_AddNewMask(res);
2381 } else {
2382 res = SWIG_AddCast(res);
2386 Py_DECREF(impconv);
2392 return res;
2395 /* Convert a function ptr value */
2397 SWIGRUNTIME int
2398 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2399 if (!PyCFunction_Check(obj)) {
2400 return SWIG_ConvertPtr(obj, ptr, ty, 0);
2401 } else {
2402 void *vptr = 0;
2404 /* here we get the method pointer for callbacks */
2405 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2406 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2407 if (desc)
2408 desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2409 if (!desc)
2410 return SWIG_ERROR;
2411 if (ty) {
2412 swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2413 if (tc) {
2414 int newmemory = 0;
2415 *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2416 assert(!newmemory); /* newmemory handling not yet implemented */
2417 } else {
2418 return SWIG_ERROR;
2420 } else {
2421 *ptr = vptr;
2423 return SWIG_OK;
2427 /* Convert a packed value value */
2429 SWIGRUNTIME int
2430 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2431 swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2432 if (!to) return SWIG_ERROR;
2433 if (ty) {
2434 if (to != ty) {
2435 /* check type cast? */
2436 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2437 if (!tc) return SWIG_ERROR;
2440 return SWIG_OK;
2443 /* -----------------------------------------------------------------------------
2444 * Create a new pointer object
2445 * ----------------------------------------------------------------------------- */
2448 Create a new instance object, without calling __init__, and set the
2449 'this' attribute.
2452 SWIGRUNTIME PyObject*
2453 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2455 #if (PY_VERSION_HEX >= 0x02020000)
2456 PyObject *inst = 0;
2457 PyObject *newraw = data->newraw;
2458 if (newraw) {
2459 inst = PyObject_Call(newraw, data->newargs, NULL);
2460 if (inst) {
2461 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2462 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2463 if (dictptr != NULL) {
2464 PyObject *dict = *dictptr;
2465 if (dict == NULL) {
2466 dict = PyDict_New();
2467 *dictptr = dict;
2468 PyDict_SetItem(dict, SWIG_This(), swig_this);
2471 #else
2472 PyObject *key = SWIG_This();
2473 PyObject_SetAttr(inst, key, swig_this);
2474 #endif
2476 } else {
2477 #if PY_VERSION_HEX >= 0x03000000
2478 inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
2479 if (inst) {
2480 PyObject_SetAttr(inst, SWIG_This(), swig_this);
2481 Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2483 #else
2484 PyObject *dict = PyDict_New();
2485 if (dict) {
2486 PyDict_SetItem(dict, SWIG_This(), swig_this);
2487 inst = PyInstance_NewRaw(data->newargs, dict);
2488 Py_DECREF(dict);
2490 #endif
2492 return inst;
2493 #else
2494 #if (PY_VERSION_HEX >= 0x02010000)
2495 PyObject *inst = 0;
2496 PyObject *dict = PyDict_New();
2497 if (dict) {
2498 PyDict_SetItem(dict, SWIG_This(), swig_this);
2499 inst = PyInstance_NewRaw(data->newargs, dict);
2500 Py_DECREF(dict);
2502 return (PyObject *) inst;
2503 #else
2504 PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2505 if (inst == NULL) {
2506 return NULL;
2508 inst->in_class = (PyClassObject *)data->newargs;
2509 Py_INCREF(inst->in_class);
2510 inst->in_dict = PyDict_New();
2511 if (inst->in_dict == NULL) {
2512 Py_DECREF(inst);
2513 return NULL;
2515 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2516 inst->in_weakreflist = NULL;
2517 #endif
2518 #ifdef Py_TPFLAGS_GC
2519 PyObject_GC_Init(inst);
2520 #endif
2521 PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2522 return (PyObject *) inst;
2523 #endif
2524 #endif
2527 SWIGRUNTIME void
2528 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2530 PyObject *dict;
2531 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2532 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2533 if (dictptr != NULL) {
2534 dict = *dictptr;
2535 if (dict == NULL) {
2536 dict = PyDict_New();
2537 *dictptr = dict;
2539 PyDict_SetItem(dict, SWIG_This(), swig_this);
2540 return;
2542 #endif
2543 dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2544 PyDict_SetItem(dict, SWIG_This(), swig_this);
2545 Py_DECREF(dict);
2549 SWIGINTERN PyObject *
2550 SWIG_Python_InitShadowInstance(PyObject *args) {
2551 PyObject *obj[2];
2552 if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2553 return NULL;
2554 } else {
2555 SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2556 if (sthis) {
2557 SwigPyObject_append((PyObject*) sthis, obj[1]);
2558 } else {
2559 SWIG_Python_SetSwigThis(obj[0], obj[1]);
2561 return SWIG_Py_Void();
2565 /* Create a new pointer object */
2567 SWIGRUNTIME PyObject *
2568 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2569 SwigPyClientData *clientdata;
2570 PyObject * robj;
2571 int own;
2573 if (!ptr)
2574 return SWIG_Py_Void();
2576 clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2577 own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2578 if (clientdata && clientdata->pytype) {
2579 SwigPyObject *newobj;
2580 if (flags & SWIG_BUILTIN_TP_INIT) {
2581 newobj = (SwigPyObject*) self;
2582 if (newobj->ptr) {
2583 PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2584 while (newobj->next)
2585 newobj = (SwigPyObject *) newobj->next;
2586 newobj->next = next_self;
2587 newobj = (SwigPyObject *)next_self;
2589 } else {
2590 newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2592 if (newobj) {
2593 newobj->ptr = ptr;
2594 newobj->ty = type;
2595 newobj->own = own;
2596 newobj->next = 0;
2597 #ifdef SWIGPYTHON_BUILTIN
2598 newobj->dict = 0;
2599 #endif
2600 return (PyObject*) newobj;
2602 return SWIG_Py_Void();
2605 assert(!(flags & SWIG_BUILTIN_TP_INIT));
2607 robj = SwigPyObject_New(ptr, type, own);
2608 if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2609 PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2610 Py_DECREF(robj);
2611 robj = inst;
2613 return robj;
2616 /* Create a new packed object */
2618 SWIGRUNTIMEINLINE PyObject *
2619 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2620 return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2623 /* -----------------------------------------------------------------------------*
2624 * Get type list
2625 * -----------------------------------------------------------------------------*/
2627 #ifdef SWIG_LINK_RUNTIME
2628 void *SWIG_ReturnGlobalTypeList(void *);
2629 #endif
2631 SWIGRUNTIME swig_module_info *
2632 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2633 static void *type_pointer = (void *)0;
2634 /* first check if module already created */
2635 if (!type_pointer) {
2636 #ifdef SWIG_LINK_RUNTIME
2637 type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2638 #else
2639 # ifdef SWIGPY_USE_CAPSULE
2640 type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2641 # else
2642 type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2643 (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2644 # endif
2645 if (PyErr_Occurred()) {
2646 PyErr_Clear();
2647 type_pointer = (void *)0;
2649 #endif
2651 return (swig_module_info *) type_pointer;
2654 #if PY_MAJOR_VERSION < 2
2655 /* PyModule_AddObject function was introduced in Python 2.0. The following function
2656 is copied out of Python/modsupport.c in python version 2.3.4 */
2657 SWIGINTERN int
2658 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2660 PyObject *dict;
2661 if (!PyModule_Check(m)) {
2662 PyErr_SetString(PyExc_TypeError,
2663 "PyModule_AddObject() needs module as first arg");
2664 return SWIG_ERROR;
2666 if (!o) {
2667 PyErr_SetString(PyExc_TypeError,
2668 "PyModule_AddObject() needs non-NULL value");
2669 return SWIG_ERROR;
2672 dict = PyModule_GetDict(m);
2673 if (dict == NULL) {
2674 /* Internal error -- modules must have a dict! */
2675 PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2676 PyModule_GetName(m));
2677 return SWIG_ERROR;
2679 if (PyDict_SetItemString(dict, name, o))
2680 return SWIG_ERROR;
2681 Py_DECREF(o);
2682 return SWIG_OK;
2684 #endif
2686 SWIGRUNTIME void
2687 #ifdef SWIGPY_USE_CAPSULE
2688 SWIG_Python_DestroyModule(PyObject *obj)
2689 #else
2690 SWIG_Python_DestroyModule(void *vptr)
2691 #endif
2693 #ifdef SWIGPY_USE_CAPSULE
2694 swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2695 #else
2696 swig_module_info *swig_module = (swig_module_info *) vptr;
2697 #endif
2698 swig_type_info **types = swig_module->types;
2699 size_t i;
2700 for (i =0; i < swig_module->size; ++i) {
2701 swig_type_info *ty = types[i];
2702 if (ty->owndata) {
2703 SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2704 if (data) SwigPyClientData_Del(data);
2707 Py_DECREF(SWIG_This());
2708 swig_this = NULL;
2711 SWIGRUNTIME void
2712 SWIG_Python_SetModule(swig_module_info *swig_module) {
2713 #if PY_VERSION_HEX >= 0x03000000
2714 /* Add a dummy module object into sys.modules */
2715 PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
2716 #else
2717 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2718 PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2719 #endif
2720 #ifdef SWIGPY_USE_CAPSULE
2721 PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2722 if (pointer && module) {
2723 PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2724 } else {
2725 Py_XDECREF(pointer);
2727 #else
2728 PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2729 if (pointer && module) {
2730 PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2731 } else {
2732 Py_XDECREF(pointer);
2734 #endif
2737 /* The python cached type query */
2738 SWIGRUNTIME PyObject *
2739 SWIG_Python_TypeCache(void) {
2740 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2741 return cache;
2744 SWIGRUNTIME swig_type_info *
2745 SWIG_Python_TypeQuery(const char *type)
2747 PyObject *cache = SWIG_Python_TypeCache();
2748 PyObject *key = SWIG_Python_str_FromChar(type);
2749 PyObject *obj = PyDict_GetItem(cache, key);
2750 swig_type_info *descriptor;
2751 if (obj) {
2752 #ifdef SWIGPY_USE_CAPSULE
2753 descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2754 #else
2755 descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2756 #endif
2757 } else {
2758 swig_module_info *swig_module = SWIG_GetModule(0);
2759 descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2760 if (descriptor) {
2761 #ifdef SWIGPY_USE_CAPSULE
2762 obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2763 #else
2764 obj = PyCObject_FromVoidPtr(descriptor, NULL);
2765 #endif
2766 PyDict_SetItem(cache, key, obj);
2767 Py_DECREF(obj);
2770 Py_DECREF(key);
2771 return descriptor;
2775 For backward compatibility only
2777 #define SWIG_POINTER_EXCEPTION 0
2778 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2779 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2781 SWIGRUNTIME int
2782 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2784 if (PyErr_Occurred()) {
2785 PyObject *type = 0;
2786 PyObject *value = 0;
2787 PyObject *traceback = 0;
2788 PyErr_Fetch(&type, &value, &traceback);
2789 if (value) {
2790 char *tmp;
2791 PyObject *old_str = PyObject_Str(value);
2792 Py_XINCREF(type);
2793 PyErr_Clear();
2794 if (infront) {
2795 PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
2796 } else {
2797 PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
2799 SWIG_Python_str_DelForPy3(tmp);
2800 Py_DECREF(old_str);
2802 return 1;
2803 } else {
2804 return 0;
2808 SWIGRUNTIME int
2809 SWIG_Python_ArgFail(int argnum)
2811 if (PyErr_Occurred()) {
2812 /* add information about failing argument */
2813 char mesg[256];
2814 PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2815 return SWIG_Python_AddErrMesg(mesg, 1);
2816 } else {
2817 return 0;
2821 SWIGRUNTIMEINLINE const char *
2822 SwigPyObject_GetDesc(PyObject *self)
2824 SwigPyObject *v = (SwigPyObject *)self;
2825 swig_type_info *ty = v ? v->ty : 0;
2826 return ty ? ty->str : "";
2829 SWIGRUNTIME void
2830 SWIG_Python_TypeError(const char *type, PyObject *obj)
2832 if (type) {
2833 #if defined(SWIG_COBJECT_TYPES)
2834 if (obj && SwigPyObject_Check(obj)) {
2835 const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2836 if (otype) {
2837 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2838 type, otype);
2839 return;
2841 } else
2842 #endif
2844 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2845 if (otype) {
2846 PyObject *str = PyObject_Str(obj);
2847 const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2848 if (cstr) {
2849 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2850 type, otype, cstr);
2851 SWIG_Python_str_DelForPy3(cstr);
2852 } else {
2853 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2854 type, otype);
2856 Py_XDECREF(str);
2857 return;
2860 PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2861 } else {
2862 PyErr_Format(PyExc_TypeError, "unexpected type is received");
2867 /* Convert a pointer value, signal an exception on a type mismatch */
2868 SWIGRUNTIME void *
2869 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2870 void *result;
2871 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2872 PyErr_Clear();
2873 #if SWIG_POINTER_EXCEPTION
2874 if (flags) {
2875 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2876 SWIG_Python_ArgFail(argnum);
2878 #endif
2880 return result;
2883 #ifdef SWIGPYTHON_BUILTIN
2884 SWIGRUNTIME int
2885 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2886 PyTypeObject *tp = obj->ob_type;
2887 PyObject *descr;
2888 PyObject *encoded_name;
2889 descrsetfunc f;
2890 int res;
2892 # ifdef Py_USING_UNICODE
2893 if (PyString_Check(name)) {
2894 name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2895 if (!name)
2896 return -1;
2897 } else if (!PyUnicode_Check(name))
2898 # else
2899 if (!PyString_Check(name))
2900 # endif
2902 PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2903 return -1;
2904 } else {
2905 Py_INCREF(name);
2908 if (!tp->tp_dict) {
2909 if (PyType_Ready(tp) < 0)
2910 goto done;
2913 res = -1;
2914 descr = _PyType_Lookup(tp, name);
2915 f = NULL;
2916 if (descr != NULL)
2917 f = descr->ob_type->tp_descr_set;
2918 if (!f) {
2919 if (PyString_Check(name)) {
2920 encoded_name = name;
2921 Py_INCREF(name);
2922 } else {
2923 encoded_name = PyUnicode_AsUTF8String(name);
2925 PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2926 Py_DECREF(encoded_name);
2927 } else {
2928 res = f(descr, obj, value);
2931 done:
2932 Py_DECREF(name);
2933 return res;
2935 #endif
2938 #ifdef __cplusplus
2940 #endif
2944 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2946 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2950 #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
2953 /* -------- TYPES TABLE (BEGIN) -------- */
2955 #define SWIGTYPE_p_GeosCoordinateSequence swig_types[0]
2956 #define SWIGTYPE_p_GeosGeometry swig_types[1]
2957 #define SWIGTYPE_p_GeosGeometryCollection swig_types[2]
2958 #define SWIGTYPE_p_GeosIndexItem swig_types[3]
2959 #define SWIGTYPE_p_GeosLineString swig_types[4]
2960 #define SWIGTYPE_p_GeosLinearRing swig_types[5]
2961 #define SWIGTYPE_p_GeosMultiLineString swig_types[6]
2962 #define SWIGTYPE_p_GeosMultiLinearRing swig_types[7]
2963 #define SWIGTYPE_p_GeosMultiPoint swig_types[8]
2964 #define SWIGTYPE_p_GeosMultiPolygon swig_types[9]
2965 #define SWIGTYPE_p_GeosPoint swig_types[10]
2966 #define SWIGTYPE_p_GeosPolygon swig_types[11]
2967 #define SWIGTYPE_p_GeosPreparedGeometry swig_types[12]
2968 #define SWIGTYPE_p_GeosQueryCallback swig_types[13]
2969 #define SWIGTYPE_p_GeosSTRtree swig_types[14]
2970 #define SWIGTYPE_p_GeosWkbReader swig_types[15]
2971 #define SWIGTYPE_p_GeosWkbWriter swig_types[16]
2972 #define SWIGTYPE_p_GeosWktReader swig_types[17]
2973 #define SWIGTYPE_p_GeosWktWriter swig_types[18]
2974 #define SWIGTYPE_p_char swig_types[19]
2975 #define SWIGTYPE_p_p_GeosLinearRing swig_types[20]
2976 #define SWIGTYPE_p_size_t swig_types[21]
2977 #define SWIGTYPE_p_std__invalid_argument swig_types[22]
2978 #define SWIGTYPE_p_swig__SwigPyIterator swig_types[23]
2979 #define SWIGTYPE_p_unsigned_char swig_types[24]
2980 static swig_type_info *swig_types[26];
2981 static swig_module_info swig_module = {swig_types, 25, 0, 0, 0, 0};
2982 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2983 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2985 /* -------- TYPES TABLE (END) -------- */
2987 #if (PY_VERSION_HEX <= 0x02000000)
2988 # if !defined(SWIG_PYTHON_CLASSIC)
2989 # error "This python version requires swig to be run with the '-classic' option"
2990 # endif
2991 #endif
2992 #if (PY_VERSION_HEX <= 0x02020000)
2993 # error "This python version requires swig to be run with the '-nomodern' option"
2994 #endif
2995 #if (PY_VERSION_HEX <= 0x02020000)
2996 # error "This python version requires swig to be run with the '-nomodernargs' option"
2997 #endif
2999 /*-----------------------------------------------
3000 @(target):= _geos.so
3001 ------------------------------------------------*/
3002 #if PY_VERSION_HEX >= 0x03000000
3003 # define SWIG_init PyInit__geos
3005 #else
3006 # define SWIG_init init_geos
3008 #endif
3009 #define SWIG_name "_geos"
3011 #define SWIGVERSION 0x020010
3012 #define SWIG_VERSION SWIGVERSION
3015 #define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
3016 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a))
3019 #include <stdexcept>
3022 namespace swig {
3023 class SwigPtr_PyObject {
3024 protected:
3025 PyObject *_obj;
3027 public:
3028 SwigPtr_PyObject() :_obj(0)
3032 SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
3034 Py_XINCREF(_obj);
3037 SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
3039 if (initial_ref) {
3040 Py_XINCREF(_obj);
3044 SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item)
3046 Py_XINCREF(item._obj);
3047 Py_XDECREF(_obj);
3048 _obj = item._obj;
3049 return *this;
3052 ~SwigPtr_PyObject()
3054 Py_XDECREF(_obj);
3057 operator PyObject *() const
3059 return _obj;
3062 PyObject *operator->() const
3064 return _obj;
3070 namespace swig {
3071 struct SwigVar_PyObject : SwigPtr_PyObject {
3072 SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
3074 SwigVar_PyObject & operator = (PyObject* obj)
3076 Py_XDECREF(_obj);
3077 _obj = obj;
3078 return *this;
3084 #include <string>
3087 #include <iostream>
3089 #if PY_VERSION_HEX >= 0x03020000
3090 # define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
3091 #else
3092 # define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
3093 #endif
3096 #include <stdexcept>
3099 #if defined(__GNUC__)
3100 # if __GNUC__ == 2 && __GNUC_MINOR <= 96
3101 # define SWIG_STD_NOMODERN_STL
3102 # endif
3103 #endif
3106 #include <string>
3107 #include <stdexcept>
3108 #include <stddef.h>
3111 #include <stddef.h>
3114 namespace swig {
3115 struct stop_iteration {
3118 struct SwigPyIterator {
3119 private:
3120 SwigPtr_PyObject _seq;
3122 protected:
3123 SwigPyIterator(PyObject *seq) : _seq(seq)
3127 public:
3128 virtual ~SwigPyIterator() {}
3130 // Access iterator method, required by Python
3131 virtual PyObject *value() const = 0;
3133 // Forward iterator method, required by Python
3134 virtual SwigPyIterator *incr(size_t n = 1) = 0;
3136 // Backward iterator method, very common in C++, but not required in Python
3137 virtual SwigPyIterator *decr(size_t /*n*/ = 1)
3139 throw stop_iteration();
3142 // Random access iterator methods, but not required in Python
3143 virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
3145 throw std::invalid_argument("operation not supported");
3148 virtual bool equal (const SwigPyIterator &/*x*/) const
3150 throw std::invalid_argument("operation not supported");
3153 // C++ common/needed methods
3154 virtual SwigPyIterator *copy() const = 0;
3156 PyObject *next()
3158 SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads
3159 PyObject *obj = value();
3160 incr();
3161 SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
3162 return obj;
3165 /* Make an alias for Python 3.x */
3166 PyObject *__next__()
3168 return next();
3171 PyObject *previous()
3173 SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads
3174 decr();
3175 PyObject *obj = value();
3176 SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
3177 return obj;
3180 SwigPyIterator *advance(ptrdiff_t n)
3182 return (n > 0) ? incr(n) : decr(-n);
3185 bool operator == (const SwigPyIterator& x) const
3187 return equal(x);
3190 bool operator != (const SwigPyIterator& x) const
3192 return ! operator==(x);
3195 SwigPyIterator& operator += (ptrdiff_t n)
3197 return *advance(n);
3200 SwigPyIterator& operator -= (ptrdiff_t n)
3202 return *advance(-n);
3205 SwigPyIterator* operator + (ptrdiff_t n) const
3207 return copy()->advance(n);
3210 SwigPyIterator* operator - (ptrdiff_t n) const
3212 return copy()->advance(-n);
3215 ptrdiff_t operator - (const SwigPyIterator& x) const
3217 return x.distance(*this);
3220 static swig_type_info* descriptor() {
3221 static int init = 0;
3222 static swig_type_info* desc = 0;
3223 if (!init) {
3224 desc = SWIG_TypeQuery("swig::SwigPyIterator *");
3225 init = 1;
3227 return desc;
3231 #if defined(SWIGPYTHON_BUILTIN)
3232 inline PyObject* make_output_iterator_builtin (PyObject *pyself)
3234 Py_INCREF(pyself);
3235 return pyself;
3237 #endif
3241 SWIGINTERN int
3242 SWIG_AsVal_double (PyObject *obj, double *val)
3244 int res = SWIG_TypeError;
3245 if (PyFloat_Check(obj)) {
3246 if (val) *val = PyFloat_AsDouble(obj);
3247 return SWIG_OK;
3248 } else if (PyInt_Check(obj)) {
3249 if (val) *val = PyInt_AsLong(obj);
3250 return SWIG_OK;
3251 } else if (PyLong_Check(obj)) {
3252 double v = PyLong_AsDouble(obj);
3253 if (!PyErr_Occurred()) {
3254 if (val) *val = v;
3255 return SWIG_OK;
3256 } else {
3257 PyErr_Clear();
3260 #ifdef SWIG_PYTHON_CAST_MODE
3262 int dispatch = 0;
3263 double d = PyFloat_AsDouble(obj);
3264 if (!PyErr_Occurred()) {
3265 if (val) *val = d;
3266 return SWIG_AddCast(SWIG_OK);
3267 } else {
3268 PyErr_Clear();
3270 if (!dispatch) {
3271 long v = PyLong_AsLong(obj);
3272 if (!PyErr_Occurred()) {
3273 if (val) *val = v;
3274 return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3275 } else {
3276 PyErr_Clear();
3280 #endif
3281 return res;
3285 #include <float.h>
3288 #include <math.h>
3291 SWIGINTERNINLINE int
3292 SWIG_CanCastAsInteger(double *d, double min, double max) {
3293 double x = *d;
3294 if ((min <= x && x <= max)) {
3295 double fx = floor(x);
3296 double cx = ceil(x);
3297 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3298 if ((errno == EDOM) || (errno == ERANGE)) {
3299 errno = 0;
3300 } else {
3301 double summ, reps, diff;
3302 if (rd < x) {
3303 diff = x - rd;
3304 } else if (rd > x) {
3305 diff = rd - x;
3306 } else {
3307 return 1;
3309 summ = rd + x;
3310 reps = diff/summ;
3311 if (reps < 8*DBL_EPSILON) {
3312 *d = rd;
3313 return 1;
3317 return 0;
3321 SWIGINTERN int
3322 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
3324 #if PY_VERSION_HEX < 0x03000000
3325 if (PyInt_Check(obj)) {
3326 long v = PyInt_AsLong(obj);
3327 if (v >= 0) {
3328 if (val) *val = v;
3329 return SWIG_OK;
3330 } else {
3331 return SWIG_OverflowError;
3333 } else
3334 #endif
3335 if (PyLong_Check(obj)) {
3336 unsigned long v = PyLong_AsUnsignedLong(obj);
3337 if (!PyErr_Occurred()) {
3338 if (val) *val = v;
3339 return SWIG_OK;
3340 } else {
3341 PyErr_Clear();
3342 #if PY_VERSION_HEX >= 0x03000000
3344 long v = PyLong_AsLong(obj);
3345 if (!PyErr_Occurred()) {
3346 if (v < 0) {
3347 return SWIG_OverflowError;
3349 } else {
3350 PyErr_Clear();
3353 #endif
3356 #ifdef SWIG_PYTHON_CAST_MODE
3358 int dispatch = 0;
3359 unsigned long v = PyLong_AsUnsignedLong(obj);
3360 if (!PyErr_Occurred()) {
3361 if (val) *val = v;
3362 return SWIG_AddCast(SWIG_OK);
3363 } else {
3364 PyErr_Clear();
3366 if (!dispatch) {
3367 double d;
3368 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3369 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
3370 if (val) *val = (unsigned long)(d);
3371 return res;
3375 #endif
3376 return SWIG_TypeError;
3380 SWIGINTERNINLINE int
3381 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
3383 unsigned long v;
3384 int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
3385 if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
3386 return res;
3390 #define SWIG_From_long PyLong_FromLong
3393 SWIGINTERNINLINE PyObject *
3394 SWIG_From_ptrdiff_t (ptrdiff_t value)
3396 return SWIG_From_long (static_cast< long >(value));
3400 SWIGINTERNINLINE PyObject*
3401 SWIG_From_bool (bool value)
3403 return PyBool_FromLong(value ? 1 : 0);
3407 SWIGINTERN int
3408 SWIG_AsVal_long (PyObject *obj, long* val)
3410 if (PyInt_Check(obj)) {
3411 if (val) *val = PyInt_AsLong(obj);
3412 return SWIG_OK;
3413 } else if (PyLong_Check(obj)) {
3414 long v = PyLong_AsLong(obj);
3415 if (!PyErr_Occurred()) {
3416 if (val) *val = v;
3417 return SWIG_OK;
3418 } else {
3419 PyErr_Clear();
3422 #ifdef SWIG_PYTHON_CAST_MODE
3424 int dispatch = 0;
3425 long v = PyInt_AsLong(obj);
3426 if (!PyErr_Occurred()) {
3427 if (val) *val = v;
3428 return SWIG_AddCast(SWIG_OK);
3429 } else {
3430 PyErr_Clear();
3432 if (!dispatch) {
3433 double d;
3434 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3435 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3436 if (val) *val = (long)(d);
3437 return res;
3441 #endif
3442 return SWIG_TypeError;
3446 SWIGINTERNINLINE int
3447 SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
3449 long v;
3450 int res = SWIG_AsVal_long (obj, val ? &v : 0);
3451 if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
3452 return res;
3456 #include <stdexcept>
3459 #include <algorithm>
3462 #include <vector>
3465 #include "geos_c.h"
3466 /* Needed for va_start, etc. */
3467 #include <stdarg.h>
3470 SWIGINTERNINLINE PyObject*
3471 SWIG_From_int (int value)
3473 return PyInt_FromLong((long) value);
3477 SWIGINTERN swig_type_info*
3478 SWIG_pchar_descriptor(void)
3480 static int init = 0;
3481 static swig_type_info* info = 0;
3482 if (!init) {
3483 info = SWIG_TypeQuery("_p_char");
3484 init = 1;
3486 return info;
3490 SWIGINTERNINLINE PyObject *
3491 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3493 if (carray) {
3494 if (size > INT_MAX) {
3495 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3496 return pchar_descriptor ?
3497 SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3498 } else {
3499 #if PY_VERSION_HEX >= 0x03000000
3500 return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
3501 #else
3502 return PyString_FromStringAndSize(carray, static_cast< int >(size));
3503 #endif
3505 } else {
3506 return SWIG_Py_Void();
3511 SWIGINTERNINLINE PyObject *
3512 SWIG_FromCharPtr(const char *cptr)
3514 return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
3518 static const int DEFAULT_QUADRANT_SEGMENTS=8;
3522 /* This is not thread safe ! */
3523 static const int MESSAGE_SIZE = 1000;
3524 static char message[MESSAGE_SIZE];
3526 void noticeHandler(const char *fmt, ...)
3528 va_list args;
3529 va_start(args, fmt);
3530 vsnprintf(message, sizeof(message) - 1, fmt, args);
3531 va_end(args);
3534 void errorHandler(const char *fmt, ...)
3536 va_list args;
3537 va_start(args, fmt);
3538 vsnprintf(message, sizeof(message) - 1, fmt, args);
3539 va_end(args);
3543 typedef void GeosCoordinateSequence;
3545 void checkCoordSeqBounds(const GEOSCoordSeq coordSeq, const size_t index)
3547 unsigned int size = 0;
3548 GEOSCoordSeq_getSize(coordSeq, &size);
3550 if (index < 0 || index >= size)
3551 throw std::runtime_error("Index out of bounds");
3554 SWIGINTERN GeosCoordinateSequence *new_GeosCoordinateSequence(size_t size,size_t dims){
3555 return (GeosCoordinateSequence*) GEOSCoordSeq_create(size, dims);
3557 SWIGINTERN void delete_GeosCoordinateSequence(GeosCoordinateSequence *self){
3558 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3559 return GEOSCoordSeq_destroy(coords);
3561 SWIGINTERN GeosCoordinateSequence *GeosCoordinateSequence_clone(GeosCoordinateSequence *self){
3562 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3563 return (GeosCoordinateSequence*) GEOSCoordSeq_clone(coords);
3565 SWIGINTERN int GeosCoordinateSequence_setX(GeosCoordinateSequence *self,size_t idx,double val){
3566 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3567 checkCoordSeqBounds(coords, idx);
3568 return GEOSCoordSeq_setX(coords, idx, val);
3570 SWIGINTERN int GeosCoordinateSequence_setY(GeosCoordinateSequence *self,size_t idx,double val){
3571 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3572 checkCoordSeqBounds(coords, idx);
3573 return GEOSCoordSeq_setY(coords, idx, val);
3575 SWIGINTERN int GeosCoordinateSequence_setZ(GeosCoordinateSequence *self,size_t idx,double val){
3576 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3577 checkCoordSeqBounds(coords, idx);
3578 return GEOSCoordSeq_setZ(coords, idx, val);
3580 SWIGINTERN int GeosCoordinateSequence_setOrdinate(GeosCoordinateSequence *self,size_t idx,size_t dim,double val){
3581 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3582 checkCoordSeqBounds(coords, idx);
3583 return GEOSCoordSeq_setOrdinate(coords, idx, dim, val);
3585 SWIGINTERN double GeosCoordinateSequence_getX(GeosCoordinateSequence *self,size_t idx){
3586 double result;
3587 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3588 checkCoordSeqBounds(coords, idx);
3589 GEOSCoordSeq_getX(coords, idx, &result);
3590 return result;
3593 #define SWIG_From_double PyFloat_FromDouble
3595 SWIGINTERN double GeosCoordinateSequence_getY(GeosCoordinateSequence *self,size_t idx){
3596 double result;
3597 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3598 checkCoordSeqBounds(coords, idx);
3599 GEOSCoordSeq_getY(coords, idx, &result);
3600 return result;
3602 SWIGINTERN double GeosCoordinateSequence_getZ(GeosCoordinateSequence *self,size_t idx){
3603 double result;
3604 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3605 checkCoordSeqBounds(coords, idx);
3606 GEOSCoordSeq_getZ(coords, idx, &result);
3607 return result;
3609 SWIGINTERN double GeosCoordinateSequence_getOrdinate(GeosCoordinateSequence *self,size_t idx,size_t dim){
3610 double result;
3611 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3612 checkCoordSeqBounds(coords, idx);
3613 GEOSCoordSeq_getOrdinate(coords, idx, dim, &result);
3614 return result;
3616 SWIGINTERN unsigned int GeosCoordinateSequence_getSize(GeosCoordinateSequence *self){
3617 unsigned int result;
3618 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3619 GEOSCoordSeq_getSize(coords, &result);
3620 return result;
3623 SWIGINTERNINLINE PyObject*
3624 SWIG_From_unsigned_SS_int (unsigned int value)
3626 return PyInt_FromSize_t((size_t) value);
3629 SWIGINTERN unsigned int GeosCoordinateSequence_getDimensions(GeosCoordinateSequence *self){
3630 unsigned int result;
3631 GEOSCoordSeq coords = (GEOSCoordSeq) self;
3632 GEOSCoordSeq_getDimensions(coords, &result);
3633 return result;
3636 typedef void GeosGeometry;
3637 typedef void GeosPoint;
3638 typedef void GeosLineString;
3639 typedef void GeosLinearRing;
3640 typedef void GeosPolygon;
3641 typedef void GeosGeometryCollection;
3642 typedef void GeosMultiPoint;
3643 typedef void GeosMultiLineString;
3644 typedef void GeosMultiLinearRing;
3645 typedef void GeosMultiPolygon;
3647 typedef void GeosWktReader;
3648 typedef void GeosWktWriter;
3649 typedef void GeosWkbReader;
3650 typedef void GeosWkbWriter;
3653 bool checkBoolResult(char result)
3655 int intResult = (int) result;
3657 if (intResult == 1)
3658 return true;
3659 else if (intResult == 0)
3660 return false;
3661 else
3662 throw std::runtime_error(message);
3665 SWIGINTERN void delete_GeosGeometry(GeosGeometry *self){
3666 GEOSGeom geom = (GEOSGeom) self;
3667 GEOSGeom_destroy(geom);
3669 SWIGINTERN GeosGeometry *GeosGeometry_clone(GeosGeometry *self){
3670 GEOSGeom geom = (GEOSGeom) self;
3671 return GEOSGeom_clone(geom);
3673 SWIGINTERN char *GeosGeometry_geomType(GeosGeometry *self){
3674 GEOSGeom geom = (GEOSGeom) self;
3675 return GEOSGeomType(geom);
3677 SWIGINTERN int GeosGeometry_typeId(GeosGeometry *self){
3678 GEOSGeom geom = (GEOSGeom) self;
3679 return GEOSGeomTypeId(geom);
3681 SWIGINTERN void GeosGeometry_normalize(GeosGeometry *self){
3682 GEOSGeom geom = (GEOSGeom) self;
3683 int result = GEOSNormalize(geom);
3685 if (result == -1)
3686 throw std::runtime_error(message);
3688 SWIGINTERN int GeosGeometry_getSRID(GeosGeometry *self){
3689 GEOSGeom geom = (GEOSGeom) self;
3690 return GEOSGetSRID(geom);
3693 #include <limits.h>
3694 #if !defined(SWIG_NO_LLONG_MAX)
3695 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3696 # define LLONG_MAX __LONG_LONG_MAX__
3697 # define LLONG_MIN (-LLONG_MAX - 1LL)
3698 # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3699 # endif
3700 #endif
3703 SWIGINTERN int
3704 SWIG_AsVal_int (PyObject * obj, int *val)
3706 long v;
3707 int res = SWIG_AsVal_long (obj, &v);
3708 if (SWIG_IsOK(res)) {
3709 if ((v < INT_MIN || v > INT_MAX)) {
3710 return SWIG_OverflowError;
3711 } else {
3712 if (val) *val = static_cast< int >(v);
3715 return res;
3718 SWIGINTERN void GeosGeometry_setSRID(GeosGeometry *self,int SRID){
3719 GEOSGeom geom = (GEOSGeom) self;
3720 return GEOSSetSRID(geom, SRID);
3722 SWIGINTERN size_t GeosGeometry_getDimensions(GeosGeometry *self){
3723 GEOSGeom geom = (GEOSGeom) self;
3724 return GEOSGeom_getDimensions(geom);
3727 SWIGINTERNINLINE PyObject*
3728 SWIG_From_unsigned_SS_long (unsigned long value)
3730 return (value > LONG_MAX) ?
3731 PyLong_FromUnsignedLong(value) : PyLong_FromLong(static_cast< long >(value));
3735 SWIGINTERNINLINE PyObject *
3736 SWIG_From_size_t (size_t value)
3738 return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
3741 SWIGINTERN size_t GeosGeometry_getNumGeometries(GeosGeometry *self){
3742 GEOSGeom geom = (GEOSGeom) self;
3743 size_t result = GEOSGetNumGeometries(geom);
3745 if ((int)result == -1)
3746 throw std::runtime_error(message);
3748 return result;
3750 SWIGINTERN GeosGeometry *GeosGeometry_intersection(GeosGeometry *self,GeosGeometry *other){
3751 GEOSGeom geom = (GEOSGeom) self;
3752 GEOSGeom otherGeom = (GEOSGeom) other;
3753 return (GeosGeometry*) GEOSIntersection(geom, otherGeom);
3755 SWIGINTERN GeosGeometry *GeosGeometry_buffer(GeosGeometry *self,double width,int quadsegs){
3756 GEOSGeom geom = (GEOSGeom) self;
3757 return (GeosGeometry*) GEOSBuffer(geom, width, quadsegs);
3759 SWIGINTERN GeosGeometry *GeosGeometry_convexHull(GeosGeometry *self){
3760 GEOSGeom geom = (GEOSGeom) self;
3761 return (GeosGeometry*) GEOSConvexHull(geom);
3763 SWIGINTERN GeosGeometry *GeosGeometry_difference(GeosGeometry *self,GeosGeometry *other){
3764 GEOSGeom geom = (GEOSGeom) self;
3765 GEOSGeom otherGeom = (GEOSGeom) other;
3766 return (GeosGeometry*) GEOSDifference(geom, otherGeom);
3768 SWIGINTERN GeosGeometry *GeosGeometry_symDifference(GeosGeometry *self,GeosGeometry *other){
3769 GEOSGeom geom = (GEOSGeom) self;
3770 GEOSGeom otherGeom = (GEOSGeom) other;
3771 return (GeosGeometry*) GEOSSymDifference(geom, otherGeom);
3773 SWIGINTERN GeosGeometry *GeosGeometry_boundary(GeosGeometry *self){
3774 GEOSGeom geom = (GEOSGeom) self;
3775 return (GeosGeometry*) GEOSBoundary(geom);
3777 SWIGINTERN GeosGeometry *GeosGeometry_geomUnion(GeosGeometry *self,GeosGeometry *other){
3778 GEOSGeom geom = (GEOSGeom) self;
3779 GEOSGeom otherGeom = (GEOSGeom) other;
3780 return (GeosGeometry*) GEOSUnion(geom, otherGeom);
3782 SWIGINTERN GeosGeometry *GeosGeometry_pointOnSurface(GeosGeometry *self){
3783 GEOSGeom geom = (GEOSGeom) self;
3784 return (GeosGeometry*) GEOSPointOnSurface(geom);
3786 SWIGINTERN GeosGeometry *GeosGeometry_getCentroid(GeosGeometry *self){
3787 GEOSGeom geom = (GEOSGeom) self;
3788 return (GeosGeometry*) GEOSGetCentroid(geom);
3790 SWIGINTERN GeosGeometry *GeosGeometry_getEnvelope(GeosGeometry *self){
3791 GEOSGeom geom = (GEOSGeom) self;
3792 return (GeosGeometry*) GEOSEnvelope(geom);
3794 SWIGINTERN char *GeosGeometry_relate(GeosGeometry *self,GeosGeometry *other){
3795 GEOSGeom geom = (GEOSGeom) self;
3796 GEOSGeom otherGeom = (GEOSGeom) other;
3797 return GEOSRelate(geom, otherGeom);
3799 SWIGINTERN GeosGeometry *GeosGeometry_lineMerge(GeosGeometry *self){
3800 GEOSGeom geom = (GEOSGeom) self;
3801 return GEOSLineMerge(geom);
3803 SWIGINTERN GeosGeometry *GeosGeometry_simplify(GeosGeometry *self,double tolerance){
3804 GEOSGeom geom = (GEOSGeom) self;
3805 return (GeosGeometry*) GEOSSimplify(geom, tolerance);
3807 SWIGINTERN GeosGeometry *GeosGeometry_topologyPreserveSimplify(GeosGeometry *self,double tolerance){
3808 GEOSGeom geom = (GEOSGeom) self;
3809 return (GeosGeometry*) GEOSTopologyPreserveSimplify(geom, tolerance);
3812 SWIGINTERN int
3813 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3815 #if PY_VERSION_HEX>=0x03000000
3816 if (PyUnicode_Check(obj))
3817 #else
3818 if (PyString_Check(obj))
3819 #endif
3821 char *cstr; Py_ssize_t len;
3822 #if PY_VERSION_HEX>=0x03000000
3823 if (!alloc && cptr) {
3824 /* We can't allow converting without allocation, since the internal
3825 representation of string in Python 3 is UCS-2/UCS-4 but we require
3826 a UTF-8 representation.
3827 TODO(bhy) More detailed explanation */
3828 return SWIG_RuntimeError;
3830 obj = PyUnicode_AsUTF8String(obj);
3831 PyBytes_AsStringAndSize(obj, &cstr, &len);
3832 if(alloc) *alloc = SWIG_NEWOBJ;
3833 #else
3834 PyString_AsStringAndSize(obj, &cstr, &len);
3835 #endif
3836 if (cptr) {
3837 if (alloc) {
3839 In python the user should not be able to modify the inner
3840 string representation. To warranty that, if you define
3841 SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
3842 buffer is always returned.
3844 The default behavior is just to return the pointer value,
3845 so, be careful.
3847 #if defined(SWIG_PYTHON_SAFE_CSTRINGS)
3848 if (*alloc != SWIG_OLDOBJ)
3849 #else
3850 if (*alloc == SWIG_NEWOBJ)
3851 #endif
3853 *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
3854 *alloc = SWIG_NEWOBJ;
3856 else {
3857 *cptr = cstr;
3858 *alloc = SWIG_OLDOBJ;
3860 } else {
3861 #if PY_VERSION_HEX>=0x03000000
3862 assert(0); /* Should never reach here in Python 3 */
3863 #endif
3864 *cptr = SWIG_Python_str_AsChar(obj);
3867 if (psize) *psize = len + 1;
3868 #if PY_VERSION_HEX>=0x03000000
3869 Py_XDECREF(obj);
3870 #endif
3871 return SWIG_OK;
3872 } else {
3873 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3874 if (pchar_descriptor) {
3875 void* vptr = 0;
3876 if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3877 if (cptr) *cptr = (char *) vptr;
3878 if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3879 if (alloc) *alloc = SWIG_OLDOBJ;
3880 return SWIG_OK;
3884 return SWIG_TypeError;
3890 SWIGINTERN bool GeosGeometry_relatePattern(GeosGeometry *self,GeosGeometry const *other,char const *pat){
3891 GEOSGeom geom = (GEOSGeom) self;
3892 GEOSGeom otherGeom = (GEOSGeom) other;
3893 return checkBoolResult(GEOSRelatePattern(geom, otherGeom, pat));
3895 SWIGINTERN bool GeosGeometry_disjoint(GeosGeometry *self,GeosGeometry const *other){
3896 GEOSGeom geom = (GEOSGeom) self;
3897 GEOSGeom otherGeom = (GEOSGeom) other;
3898 return checkBoolResult(GEOSDisjoint(geom, otherGeom));
3900 SWIGINTERN bool GeosGeometry_touches(GeosGeometry *self,GeosGeometry const *other){
3901 GEOSGeom geom = (GEOSGeom) self;
3902 GEOSGeom otherGeom = (GEOSGeom) other;
3903 return checkBoolResult(GEOSTouches(geom, otherGeom));
3905 SWIGINTERN bool GeosGeometry_intersects(GeosGeometry *self,GeosGeometry const *other){
3906 GEOSGeom geom = (GEOSGeom) self;
3907 GEOSGeom otherGeom = (GEOSGeom) other;
3908 return checkBoolResult(GEOSIntersects(geom, otherGeom));
3910 SWIGINTERN bool GeosGeometry_crosses(GeosGeometry *self,GeosGeometry const *other){
3911 GEOSGeom geom = (GEOSGeom) self;
3912 GEOSGeom otherGeom = (GEOSGeom) other;
3913 return checkBoolResult(GEOSCrosses(geom, otherGeom));
3915 SWIGINTERN bool GeosGeometry_within(GeosGeometry *self,GeosGeometry const *other){
3916 GEOSGeom geom = (GEOSGeom) self;
3917 GEOSGeom otherGeom = (GEOSGeom) other;
3918 return checkBoolResult(GEOSWithin(geom, otherGeom));
3920 SWIGINTERN bool GeosGeometry_contains(GeosGeometry *self,GeosGeometry const *other){
3921 GEOSGeom geom = (GEOSGeom) self;
3922 GEOSGeom otherGeom = (GEOSGeom) other;
3923 return checkBoolResult(GEOSContains(geom, otherGeom));
3925 SWIGINTERN bool GeosGeometry_overlaps(GeosGeometry *self,GeosGeometry const *other){
3926 GEOSGeom geom = (GEOSGeom) self;
3927 GEOSGeom otherGeom = (GEOSGeom) other;
3928 return checkBoolResult(GEOSOverlaps(geom, otherGeom));
3930 SWIGINTERN bool GeosGeometry_equals(GeosGeometry *self,GeosGeometry const *other){
3931 GEOSGeom geom = (GEOSGeom) self;
3932 GEOSGeom otherGeom = (GEOSGeom) other;
3933 return checkBoolResult(GEOSEquals(geom, otherGeom));
3935 SWIGINTERN bool GeosGeometry_equalsExact(GeosGeometry *self,GeosGeometry const *other,double tolerance){
3936 GEOSGeom geom = (GEOSGeom) self;
3937 GEOSGeom otherGeom = (GEOSGeom) other;
3938 return checkBoolResult(GEOSEqualsExact(geom, otherGeom, tolerance));
3940 SWIGINTERN bool GeosGeometry_isEmpty(GeosGeometry *self){
3941 GEOSGeom geom = (GEOSGeom) self;
3942 return checkBoolResult(GEOSisEmpty(geom));
3944 SWIGINTERN bool GeosGeometry_isValid(GeosGeometry *self){
3945 GEOSGeom geom = (GEOSGeom) self;
3946 return checkBoolResult(GEOSisValid(geom));
3948 SWIGINTERN bool GeosGeometry_isSimple(GeosGeometry *self){
3949 GEOSGeom geom = (GEOSGeom) self;
3950 return checkBoolResult(GEOSisSimple(geom));
3952 SWIGINTERN bool GeosGeometry_isRing(GeosGeometry *self){
3953 GEOSGeom geom = (GEOSGeom) self;
3954 return checkBoolResult(GEOSisRing(geom));
3956 SWIGINTERN bool GeosGeometry_hasZ(GeosGeometry *self){
3957 GEOSGeom geom = (GEOSGeom) self;
3958 return checkBoolResult(GEOSHasZ(geom));
3960 SWIGINTERN double GeosGeometry_area(GeosGeometry *self){
3961 GEOSGeom geom = (GEOSGeom) self;
3962 double result;
3964 int code = GEOSArea(geom, &result);
3966 if (code == 0)
3967 throw std::runtime_error(message);
3969 return result;
3971 SWIGINTERN double GeosGeometry_length(GeosGeometry *self){
3972 GEOSGeom geom = (GEOSGeom) self;
3973 double result;
3975 int code = GEOSLength(geom, &result);
3977 if (code == 0)
3978 throw std::runtime_error(message);
3980 return result;
3982 SWIGINTERN double GeosGeometry_distance(GeosGeometry *self,GeosGeometry const *other){
3983 GEOSGeom geom = (GEOSGeom) self;
3984 GEOSGeom otherGeom = (GEOSGeom) other;
3985 double result;
3987 int code = GEOSDistance(geom, otherGeom, &result);
3989 if (code == 0)
3990 throw std::runtime_error(message);
3992 return result;
3994 SWIGINTERN void delete_GeosPoint(GeosPoint *self){
3995 GEOSGeom geom = (GEOSGeom) self;
3996 GEOSGeom_destroy(geom);
3998 SWIGINTERN GeosCoordinateSequence const *GeosPoint_getCoordSeq(GeosPoint *self){
3999 GEOSGeom geom = (GEOSGeom) self;
4000 const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
4002 if (result == NULL)
4003 throw std::runtime_error(message);
4005 return (const GeosCoordinateSequence*) result;
4007 SWIGINTERN void delete_GeosLineString(GeosLineString *self){
4008 GEOSGeom geom = (GEOSGeom) self;
4009 GEOSGeom_destroy(geom);
4011 SWIGINTERN GeosCoordinateSequence const *GeosLineString_getCoordSeq(GeosLineString *self){
4012 GEOSGeom geom = (GEOSGeom) self;
4013 const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
4015 if (result == NULL)
4016 throw std::runtime_error(message);
4018 return (const GeosCoordinateSequence*) result;
4020 SWIGINTERN void delete_GeosLinearRing(GeosLinearRing *self){
4021 GEOSGeom geom = (GEOSGeom) self;
4022 GEOSGeom_destroy(geom);
4024 SWIGINTERN GeosCoordinateSequence const *GeosLinearRing_getCoordSeq(GeosLinearRing *self){
4025 GEOSGeom geom = (GEOSGeom) self;
4026 const GEOSCoordSeq result = (const GEOSCoordSeq) GEOSGeom_getCoordSeq(geom);
4028 if (result == NULL)
4029 throw std::runtime_error(message);
4031 return (const GeosCoordinateSequence*) result;
4033 SWIGINTERN void delete_GeosPolygon(GeosPolygon *self){
4034 GEOSGeom geom = (GEOSGeom) self;
4035 GEOSGeom_destroy(geom);
4037 SWIGINTERN GeosGeometry const *GeosPolygon_getExteriorRing(GeosPolygon *self){
4038 GEOSGeom geom = (GEOSGeom) self;
4039 const GEOSGeom result = (const GEOSGeom) GEOSGetExteriorRing(geom);
4041 if (result == NULL)
4042 throw std::runtime_error(message);
4044 return (const GeosGeometry*) result;
4046 SWIGINTERN size_t GeosPolygon_getNumInteriorRings(GeosPolygon *self){
4047 GEOSGeom geom = (GEOSGeom) self;
4048 size_t result = GEOSGetNumInteriorRings(geom);
4050 if ((int)result == -1)
4051 throw std::runtime_error(message);
4053 return result;
4055 SWIGINTERN GeosGeometry const *GeosPolygon_getInteriorRingN(GeosPolygon *self,size_t n){
4056 GEOSGeom geom = (GEOSGeom) self;
4058 size_t size = GEOSGetNumInteriorRings(geom);
4060 if (n < 0 || n >= size)
4061 throw std::runtime_error("Index out of bounds");
4063 const GEOSGeom result = (const GEOSGeom) GEOSGetInteriorRingN(geom, n);
4065 if (result == NULL)
4066 throw std::runtime_error(message);
4068 return (const GeosGeometry*) result;
4070 SWIGINTERN void delete_GeosGeometryCollection(GeosGeometryCollection *self){
4071 GEOSGeom geom = (GEOSGeom) self;
4072 GEOSGeom_destroy(geom);
4074 SWIGINTERN GeosGeometry const *GeosGeometryCollection_getGeometryN(GeosGeometryCollection *self,size_t n){
4075 GEOSGeom geom = (GEOSGeom) self;
4076 const GEOSGeom result = (const GEOSGeom) GEOSGetGeometryN(geom, n);
4078 if (result == NULL)
4079 throw std::runtime_error(message);
4081 return (const GeosGeometry*) result;
4083 SWIGINTERN void delete_GeosMultiPoint(GeosMultiPoint *self){
4084 GEOSGeom geom = (GEOSGeom) self;
4085 GEOSGeom_destroy(geom);
4087 SWIGINTERN void delete_GeosMultiLineString(GeosMultiLineString *self){
4088 GEOSGeom geom = (GEOSGeom) self;
4089 GEOSGeom_destroy(geom);
4091 SWIGINTERN void delete_GeosMultiLinearRing(GeosMultiLinearRing *self){
4092 GEOSGeom geom = (GEOSGeom) self;
4093 GEOSGeom_destroy(geom);
4095 SWIGINTERN void delete_GeosMultiPolygon(GeosMultiPolygon *self){
4096 GEOSGeom geom = (GEOSGeom) self;
4097 GEOSGeom_destroy(geom);
4100 GeosGeometry *createPoint(GeosCoordinateSequence *s)
4102 GEOSCoordSeq coords = (GEOSCoordSeq) s;
4103 GEOSGeom geom = GEOSGeom_createPoint(coords);
4105 if(geom == NULL)
4106 throw std::runtime_error(message);
4108 return (GeosGeometry*) geom;
4111 GeosGeometry *createLineString(GeosCoordinateSequence *s)
4113 GEOSCoordSeq coords = (GEOSCoordSeq) s;
4114 GEOSGeom geom = GEOSGeom_createLineString(coords);
4116 if(geom == NULL)
4117 throw std::runtime_error(message);
4119 return (GeosGeometry*) geom;
4122 GeosGeometry *createLinearRing(GeosCoordinateSequence *s)
4124 GEOSCoordSeq coords = (GEOSCoordSeq) s;
4125 GEOSGeom geom = GEOSGeom_createLinearRing(coords);
4127 if(geom == NULL)
4128 throw std::runtime_error(message);
4130 return (GeosGeometry*) geom;
4133 GeosGeometry *createPolygon(GeosLinearRing *shell, GeosLinearRing **holes, size_t nholes)
4135 GEOSGeom shellGeom = (GEOSGeom) shell;
4136 GEOSGeom* holeGeoms = (GEOSGeom*) holes;
4137 GEOSGeom geom = GEOSGeom_createPolygon(shellGeom, holeGeoms, nholes);
4139 if(geom == NULL)
4140 throw std::runtime_error(message);
4142 return (GeosGeometry*) geom;
4147 typedef void GeosPreparedGeometry;
4149 SWIGINTERN GeosPreparedGeometry *new_GeosPreparedGeometry(GeosGeometry const *source){
4150 const GEOSPreparedGeometry *prep = GEOSPrepare((const GEOSGeometry *)source);
4151 if(prep == NULL)
4152 throw std::runtime_error(message);
4153 return (GeosPreparedGeometry *) prep;
4155 SWIGINTERN void delete_GeosPreparedGeometry(GeosPreparedGeometry *self){
4156 GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
4157 return GEOSPreparedGeom_destroy(prep);
4159 SWIGINTERN bool GeosPreparedGeometry_contains(GeosPreparedGeometry *self,GeosGeometry const *other){
4160 GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
4161 GEOSGeom otherGeom = (GEOSGeom) other;
4162 return checkBoolResult(GEOSPreparedContains(prep, otherGeom));
4164 SWIGINTERN bool GeosPreparedGeometry_containsProperly(GeosPreparedGeometry *self,GeosGeometry const *other){
4165 GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
4166 GEOSGeom otherGeom = (GEOSGeom) other;
4167 return checkBoolResult(GEOSPreparedContainsProperly(prep, otherGeom));
4169 SWIGINTERN bool GeosPreparedGeometry_covers(GeosPreparedGeometry *self,GeosGeometry const *other){
4170 GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
4171 GEOSGeom otherGeom = (GEOSGeom) other;
4172 return checkBoolResult(GEOSPreparedCovers(prep, otherGeom));
4174 SWIGINTERN bool GeosPreparedGeometry_intersects(GeosPreparedGeometry *self,GeosGeometry const *other){
4175 GEOSPreparedGeometry *prep = (GEOSPreparedGeometry *) self;
4176 GEOSGeom otherGeom = (GEOSGeom) other;
4177 return checkBoolResult(GEOSPreparedIntersects(prep, otherGeom));
4180 typedef void GeosSTRtree;
4181 /* GeosIndexItem typedef'd here so it can be %typemap(typecheck)'d
4182 as a native object by each language specially */
4183 typedef void *GeosIndexItem;
4184 typedef GEOSQueryCallback GeosQueryCallback;
4186 SWIGINTERN GeosSTRtree *new_GeosSTRtree(int nodeCapacity){
4187 GEOSSTRtree *tree = GEOSSTRtree_create(nodeCapacity);
4188 if(tree == NULL)
4189 throw std::runtime_error(message);
4190 return (GeosSTRtree *) tree;
4192 SWIGINTERN void delete_GeosSTRtree(GeosSTRtree *self){
4193 GEOSSTRtree *tree = (GEOSSTRtree *) self;
4194 return GEOSSTRtree_destroy(tree);
4196 SWIGINTERN void GeosSTRtree_insert(GeosSTRtree *self,GeosGeometry const *g,GeosIndexItem item){
4197 GEOSSTRtree *tree = (GEOSSTRtree *) self;
4198 const GEOSGeometry *geom = (const GEOSGeometry *) g;
4199 GEOSSTRtree_insert(tree, geom, item);
4201 SWIGINTERN void GeosSTRtree_remove(GeosSTRtree *self,GeosGeometry const *g,GeosIndexItem item){
4202 GEOSSTRtree *tree = (GEOSSTRtree *) self;
4203 const GEOSGeometry *geom = (const GEOSGeometry *) g;
4204 GEOSSTRtree_remove(tree, geom, item);
4206 SWIGINTERN void GeosSTRtree_query(GeosSTRtree *self,GeosGeometry const *g,GeosQueryCallback callback,GeosIndexItem accumulator){
4207 GEOSSTRtree *tree = (GEOSSTRtree *) self;
4208 const GEOSGeometry *geom = (const GEOSGeometry *) g;
4209 GEOSSTRtree_query(tree, geom, callback, accumulator);
4211 SWIGINTERN void GeosSTRtree_iterate(GeosSTRtree *self,GeosQueryCallback callback,GeosIndexItem accumulator){
4212 GEOSSTRtree *tree = (GEOSSTRtree *) self;
4213 GEOSSTRtree_iterate(tree, callback, accumulator);
4215 SWIGINTERN GeosWktReader *new_GeosWktReader(){
4216 return GEOSWKTReader_create();
4218 SWIGINTERN void delete_GeosWktReader(GeosWktReader *self){
4219 GEOSWKTReader *reader = (GEOSWKTReader*) self;
4220 GEOSWKTReader_destroy(reader);
4222 SWIGINTERN GeosGeometry *GeosWktReader_read(GeosWktReader *self,char const *wkt){
4223 if(wkt == NULL)
4224 throw std::runtime_error("Trying to create geometry from a NULL string");
4226 GEOSWKTReader *reader = (GEOSWKTReader*) self;
4227 GEOSGeometry *geom = GEOSWKTReader_read(reader, wkt);
4229 if(geom == NULL)
4230 throw std::runtime_error(message);
4232 return (GeosGeometry*) geom;
4234 SWIGINTERN GeosWktWriter *new_GeosWktWriter(){
4235 return GEOSWKTWriter_create();
4237 SWIGINTERN void delete_GeosWktWriter(GeosWktWriter *self){
4238 GEOSWKTWriter *writer = (GEOSWKTWriter*) self;
4239 GEOSWKTWriter_destroy(writer);
4241 SWIGINTERN char *GeosWktWriter_write(GeosWktWriter *self,GeosGeometry const *g){
4242 GEOSWKTWriter *writer = (GEOSWKTWriter*) self;
4243 GEOSGeom geom = (GEOSGeom) g;
4244 return GEOSWKTWriter_write(writer, geom);
4246 SWIGINTERN GeosWkbReader *new_GeosWkbReader(){
4247 return GEOSWKBReader_create();
4249 SWIGINTERN void delete_GeosWkbReader(GeosWkbReader *self){
4250 GEOSWKBReader *reader = (GEOSWKBReader*) self;
4251 GEOSWKBReader_destroy(reader);
4253 SWIGINTERN GeosGeometry *GeosWkbReader_read(GeosWkbReader *self,unsigned char const *wkb,size_t size){
4254 if(wkb == NULL)
4255 throw std::runtime_error("Trying to create geometry from a NULL string");
4257 GEOSWKBReader *reader = (GEOSWKBReader*) self;
4258 GEOSGeometry *geom = GEOSWKBReader_read(reader, wkb, size);
4260 if(geom == NULL)
4261 throw std::runtime_error(message);
4263 return (GeosGeometry*) geom;
4265 SWIGINTERN GeosGeometry *GeosWkbReader_readHEX(GeosWkbReader *self,unsigned char const *wkb,size_t size){
4266 if(wkb == NULL)
4267 throw std::runtime_error("Trying to create geometry from a NULL string");
4269 GEOSWKBReader *reader = (GEOSWKBReader*) self;
4270 GEOSGeometry *geom = GEOSWKBReader_readHEX(reader, wkb, size);
4272 if(geom == NULL)
4273 throw std::runtime_error(message);
4275 return (GeosGeometry*) geom;
4277 SWIGINTERN GeosWkbWriter *new_GeosWkbWriter(){
4278 return GEOSWKBWriter_create();
4280 SWIGINTERN void delete_GeosWkbWriter(GeosWkbWriter *self){
4281 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4282 GEOSWKBWriter_destroy(writer);
4284 SWIGINTERN int GeosWkbWriter_getOutputDimension(GeosWkbWriter *self){
4285 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4286 return GEOSWKBWriter_getOutputDimension(writer);
4288 SWIGINTERN void GeosWkbWriter_setOutputDimension(GeosWkbWriter *self,int newDimension){
4289 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4290 GEOSWKBWriter_setOutputDimension(writer, newDimension);
4292 SWIGINTERN int GeosWkbWriter_getByteOrder(GeosWkbWriter *self){
4293 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4294 return GEOSWKBWriter_getByteOrder(writer);
4296 SWIGINTERN void GeosWkbWriter_setByteOrder(GeosWkbWriter *self,int newByteOrder){
4297 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4298 return GEOSWKBWriter_setByteOrder(writer, newByteOrder);
4300 SWIGINTERN bool GeosWkbWriter_getIncludeSRID(GeosWkbWriter *self){
4301 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4302 return GEOSWKBWriter_getIncludeSRID(writer);
4305 SWIGINTERN int
4306 SWIG_AsVal_bool (PyObject *obj, bool *val)
4308 int r = PyObject_IsTrue(obj);
4309 if (r == -1)
4310 return SWIG_ERROR;
4311 if (val) *val = r ? true : false;
4312 return SWIG_OK;
4315 SWIGINTERN void GeosWkbWriter_setIncludeSRID(GeosWkbWriter *self,bool newIncludeSRID){
4316 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4317 return GEOSWKBWriter_setIncludeSRID(writer, newIncludeSRID);
4319 SWIGINTERN unsigned char *GeosWkbWriter_write(GeosWkbWriter *self,GeosGeometry const *g,size_t *size){
4320 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4321 GEOSGeom geom = (GEOSGeom) g;
4322 return GEOSWKBWriter_write(writer, geom, size);
4324 SWIGINTERN unsigned char *GeosWkbWriter_writeHEX(GeosWkbWriter *self,GeosGeometry const *g,size_t *size){
4325 GEOSWKBWriter *writer = (GEOSWKBWriter*) self;
4326 GEOSGeom geom = (GEOSGeom) g;
4327 return GEOSWKBWriter_writeHEX(writer, geom, size);
4329 #ifdef __cplusplus
4330 extern "C" {
4331 #endif
4332 SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4333 PyObject *resultobj = 0;
4334 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4335 void *argp1 = 0 ;
4336 int res1 = 0 ;
4337 PyObject * obj0 = 0 ;
4339 if(!PyArg_UnpackTuple(args,(char *)"delete_SwigPyIterator",1,1,&obj0)) SWIG_fail;
4340 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
4341 if (!SWIG_IsOK(res1)) {
4342 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4344 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4345 delete arg1;
4346 resultobj = SWIG_Py_Void();
4347 return resultobj;
4348 fail:
4349 return NULL;
4353 SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4354 PyObject *resultobj = 0;
4355 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4356 void *argp1 = 0 ;
4357 int res1 = 0 ;
4358 PyObject * obj0 = 0 ;
4359 PyObject *result = 0 ;
4361 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_value",1,1,&obj0)) SWIG_fail;
4362 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4363 if (!SWIG_IsOK(res1)) {
4364 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
4366 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4367 try {
4368 result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value();
4370 catch(swig::stop_iteration &_e) {
4372 (void)_e;
4373 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4374 SWIG_fail;
4378 resultobj = result;
4379 return resultobj;
4380 fail:
4381 return NULL;
4385 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4386 PyObject *resultobj = 0;
4387 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4388 size_t arg2 ;
4389 void *argp1 = 0 ;
4390 int res1 = 0 ;
4391 size_t val2 ;
4392 int ecode2 = 0 ;
4393 PyObject * obj0 = 0 ;
4394 PyObject * obj1 = 0 ;
4395 swig::SwigPyIterator *result = 0 ;
4397 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_incr",2,2,&obj0,&obj1)) SWIG_fail;
4398 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4399 if (!SWIG_IsOK(res1)) {
4400 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4402 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4403 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4404 if (!SWIG_IsOK(ecode2)) {
4405 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_incr" "', argument " "2"" of type '" "size_t""'");
4407 arg2 = static_cast< size_t >(val2);
4408 try {
4409 result = (swig::SwigPyIterator *)(arg1)->incr(arg2);
4411 catch(swig::stop_iteration &_e) {
4413 (void)_e;
4414 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4415 SWIG_fail;
4419 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4420 return resultobj;
4421 fail:
4422 return NULL;
4426 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4427 PyObject *resultobj = 0;
4428 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4429 void *argp1 = 0 ;
4430 int res1 = 0 ;
4431 PyObject * obj0 = 0 ;
4432 swig::SwigPyIterator *result = 0 ;
4434 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_incr",1,1,&obj0)) SWIG_fail;
4435 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4436 if (!SWIG_IsOK(res1)) {
4437 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4439 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4440 try {
4441 result = (swig::SwigPyIterator *)(arg1)->incr();
4443 catch(swig::stop_iteration &_e) {
4445 (void)_e;
4446 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4447 SWIG_fail;
4451 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4452 return resultobj;
4453 fail:
4454 return NULL;
4458 SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) {
4459 int argc;
4460 PyObject *argv[3];
4461 int ii;
4463 if (!PyTuple_Check(args)) SWIG_fail;
4464 argc = args ? (int)PyObject_Length(args) : 0;
4465 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
4466 argv[ii] = PyTuple_GET_ITEM(args,ii);
4468 if (argc == 1) {
4469 int _v;
4470 void *vptr = 0;
4471 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
4472 _v = SWIG_CheckState(res);
4473 if (_v) {
4474 return _wrap_SwigPyIterator_incr__SWIG_1(self, args);
4477 if (argc == 2) {
4478 int _v;
4479 void *vptr = 0;
4480 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
4481 _v = SWIG_CheckState(res);
4482 if (_v) {
4484 int res = SWIG_AsVal_size_t(argv[1], NULL);
4485 _v = SWIG_CheckState(res);
4487 if (_v) {
4488 return _wrap_SwigPyIterator_incr__SWIG_0(self, args);
4493 fail:
4494 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_incr'.\n"
4495 " Possible C/C++ prototypes are:\n"
4496 " swig::SwigPyIterator::incr(size_t)\n"
4497 " swig::SwigPyIterator::incr()\n");
4498 return 0;
4502 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4503 PyObject *resultobj = 0;
4504 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4505 size_t arg2 ;
4506 void *argp1 = 0 ;
4507 int res1 = 0 ;
4508 size_t val2 ;
4509 int ecode2 = 0 ;
4510 PyObject * obj0 = 0 ;
4511 PyObject * obj1 = 0 ;
4512 swig::SwigPyIterator *result = 0 ;
4514 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_decr",2,2,&obj0,&obj1)) SWIG_fail;
4515 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4516 if (!SWIG_IsOK(res1)) {
4517 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4519 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4520 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
4521 if (!SWIG_IsOK(ecode2)) {
4522 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_decr" "', argument " "2"" of type '" "size_t""'");
4524 arg2 = static_cast< size_t >(val2);
4525 try {
4526 result = (swig::SwigPyIterator *)(arg1)->decr(arg2);
4528 catch(swig::stop_iteration &_e) {
4530 (void)_e;
4531 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4532 SWIG_fail;
4536 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4537 return resultobj;
4538 fail:
4539 return NULL;
4543 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4544 PyObject *resultobj = 0;
4545 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4546 void *argp1 = 0 ;
4547 int res1 = 0 ;
4548 PyObject * obj0 = 0 ;
4549 swig::SwigPyIterator *result = 0 ;
4551 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_decr",1,1,&obj0)) SWIG_fail;
4552 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4553 if (!SWIG_IsOK(res1)) {
4554 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4556 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4557 try {
4558 result = (swig::SwigPyIterator *)(arg1)->decr();
4560 catch(swig::stop_iteration &_e) {
4562 (void)_e;
4563 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4564 SWIG_fail;
4568 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4569 return resultobj;
4570 fail:
4571 return NULL;
4575 SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) {
4576 int argc;
4577 PyObject *argv[3];
4578 int ii;
4580 if (!PyTuple_Check(args)) SWIG_fail;
4581 argc = args ? (int)PyObject_Length(args) : 0;
4582 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
4583 argv[ii] = PyTuple_GET_ITEM(args,ii);
4585 if (argc == 1) {
4586 int _v;
4587 void *vptr = 0;
4588 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
4589 _v = SWIG_CheckState(res);
4590 if (_v) {
4591 return _wrap_SwigPyIterator_decr__SWIG_1(self, args);
4594 if (argc == 2) {
4595 int _v;
4596 void *vptr = 0;
4597 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
4598 _v = SWIG_CheckState(res);
4599 if (_v) {
4601 int res = SWIG_AsVal_size_t(argv[1], NULL);
4602 _v = SWIG_CheckState(res);
4604 if (_v) {
4605 return _wrap_SwigPyIterator_decr__SWIG_0(self, args);
4610 fail:
4611 SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_decr'.\n"
4612 " Possible C/C++ prototypes are:\n"
4613 " swig::SwigPyIterator::decr(size_t)\n"
4614 " swig::SwigPyIterator::decr()\n");
4615 return 0;
4619 SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4620 PyObject *resultobj = 0;
4621 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4622 swig::SwigPyIterator *arg2 = 0 ;
4623 void *argp1 = 0 ;
4624 int res1 = 0 ;
4625 void *argp2 = 0 ;
4626 int res2 = 0 ;
4627 PyObject * obj0 = 0 ;
4628 PyObject * obj1 = 0 ;
4629 ptrdiff_t result;
4631 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_distance",2,2,&obj0,&obj1)) SWIG_fail;
4632 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4633 if (!SWIG_IsOK(res1)) {
4634 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_distance" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
4636 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4637 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
4638 if (!SWIG_IsOK(res2)) {
4639 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4641 if (!argp2) {
4642 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4644 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
4645 try {
4646 result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2);
4648 catch(std::invalid_argument &_e) {
4649 SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
4652 resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
4653 return resultobj;
4654 fail:
4655 return NULL;
4659 SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4660 PyObject *resultobj = 0;
4661 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4662 swig::SwigPyIterator *arg2 = 0 ;
4663 void *argp1 = 0 ;
4664 int res1 = 0 ;
4665 void *argp2 = 0 ;
4666 int res2 = 0 ;
4667 PyObject * obj0 = 0 ;
4668 PyObject * obj1 = 0 ;
4669 bool result;
4671 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_equal",2,2,&obj0,&obj1)) SWIG_fail;
4672 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4673 if (!SWIG_IsOK(res1)) {
4674 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_equal" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
4676 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4677 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
4678 if (!SWIG_IsOK(res2)) {
4679 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4681 if (!argp2) {
4682 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4684 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
4685 try {
4686 result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2);
4688 catch(std::invalid_argument &_e) {
4689 SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
4692 resultobj = SWIG_From_bool(static_cast< bool >(result));
4693 return resultobj;
4694 fail:
4695 return NULL;
4699 SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4700 PyObject *resultobj = 0;
4701 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4702 void *argp1 = 0 ;
4703 int res1 = 0 ;
4704 PyObject * obj0 = 0 ;
4705 swig::SwigPyIterator *result = 0 ;
4707 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_copy",1,1,&obj0)) SWIG_fail;
4708 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4709 if (!SWIG_IsOK(res1)) {
4710 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
4712 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4713 result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy();
4714 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
4715 return resultobj;
4716 fail:
4717 return NULL;
4721 SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4722 PyObject *resultobj = 0;
4723 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4724 void *argp1 = 0 ;
4725 int res1 = 0 ;
4726 PyObject * obj0 = 0 ;
4727 PyObject *result = 0 ;
4729 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_next",1,1,&obj0)) SWIG_fail;
4730 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4731 if (!SWIG_IsOK(res1)) {
4732 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4734 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4735 try {
4736 result = (PyObject *)(arg1)->next();
4738 catch(swig::stop_iteration &_e) {
4740 (void)_e;
4741 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4742 SWIG_fail;
4746 resultobj = result;
4747 return resultobj;
4748 fail:
4749 return NULL;
4753 SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4754 PyObject *resultobj = 0;
4755 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4756 void *argp1 = 0 ;
4757 int res1 = 0 ;
4758 PyObject * obj0 = 0 ;
4759 PyObject *result = 0 ;
4761 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___next__",1,1,&obj0)) SWIG_fail;
4762 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4763 if (!SWIG_IsOK(res1)) {
4764 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4766 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4767 try {
4768 result = (PyObject *)(arg1)->__next__();
4770 catch(swig::stop_iteration &_e) {
4772 (void)_e;
4773 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4774 SWIG_fail;
4778 resultobj = result;
4779 return resultobj;
4780 fail:
4781 return NULL;
4785 SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4786 PyObject *resultobj = 0;
4787 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4788 void *argp1 = 0 ;
4789 int res1 = 0 ;
4790 PyObject * obj0 = 0 ;
4791 PyObject *result = 0 ;
4793 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_previous",1,1,&obj0)) SWIG_fail;
4794 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4795 if (!SWIG_IsOK(res1)) {
4796 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4798 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4799 try {
4800 result = (PyObject *)(arg1)->previous();
4802 catch(swig::stop_iteration &_e) {
4804 (void)_e;
4805 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4806 SWIG_fail;
4810 resultobj = result;
4811 return resultobj;
4812 fail:
4813 return NULL;
4817 SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4818 PyObject *resultobj = 0;
4819 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4820 ptrdiff_t arg2 ;
4821 void *argp1 = 0 ;
4822 int res1 = 0 ;
4823 ptrdiff_t val2 ;
4824 int ecode2 = 0 ;
4825 PyObject * obj0 = 0 ;
4826 PyObject * obj1 = 0 ;
4827 swig::SwigPyIterator *result = 0 ;
4829 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator_advance",2,2,&obj0,&obj1)) SWIG_fail;
4830 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4831 if (!SWIG_IsOK(res1)) {
4832 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_advance" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4834 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4835 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
4836 if (!SWIG_IsOK(ecode2)) {
4837 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'");
4839 arg2 = static_cast< ptrdiff_t >(val2);
4840 try {
4841 result = (swig::SwigPyIterator *)(arg1)->advance(arg2);
4843 catch(swig::stop_iteration &_e) {
4845 (void)_e;
4846 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4847 SWIG_fail;
4851 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4852 return resultobj;
4853 fail:
4854 return NULL;
4858 SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4859 PyObject *resultobj = 0;
4860 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4861 swig::SwigPyIterator *arg2 = 0 ;
4862 void *argp1 = 0 ;
4863 int res1 = 0 ;
4864 void *argp2 = 0 ;
4865 int res2 = 0 ;
4866 PyObject * obj0 = 0 ;
4867 PyObject * obj1 = 0 ;
4868 bool result;
4870 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___eq__",2,2,&obj0,&obj1)) SWIG_fail;
4871 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4872 if (!SWIG_IsOK(res1)) {
4873 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___eq__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
4875 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4876 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
4877 if (!SWIG_IsOK(res2)) {
4878 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4880 if (!argp2) {
4881 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4883 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
4884 result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2);
4885 resultobj = SWIG_From_bool(static_cast< bool >(result));
4886 return resultobj;
4887 fail:
4888 return NULL;
4892 SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4893 PyObject *resultobj = 0;
4894 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4895 swig::SwigPyIterator *arg2 = 0 ;
4896 void *argp1 = 0 ;
4897 int res1 = 0 ;
4898 void *argp2 = 0 ;
4899 int res2 = 0 ;
4900 PyObject * obj0 = 0 ;
4901 PyObject * obj1 = 0 ;
4902 bool result;
4904 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___ne__",2,2,&obj0,&obj1)) SWIG_fail;
4905 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
4906 if (!SWIG_IsOK(res1)) {
4907 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___ne__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
4909 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4910 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
4911 if (!SWIG_IsOK(res2)) {
4912 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4914 if (!argp2) {
4915 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
4917 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
4918 result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2);
4919 resultobj = SWIG_From_bool(static_cast< bool >(result));
4920 return resultobj;
4921 fail:
4922 return NULL;
4926 SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4927 PyObject *resultobj = 0;
4928 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4929 ptrdiff_t arg2 ;
4930 void *argp1 = 0 ;
4931 int res1 = 0 ;
4932 ptrdiff_t val2 ;
4933 int ecode2 = 0 ;
4934 PyObject * obj0 = 0 ;
4935 PyObject * obj1 = 0 ;
4936 swig::SwigPyIterator *result = 0 ;
4938 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___iadd__",2,2,&obj0,&obj1)) SWIG_fail;
4939 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
4940 if (!SWIG_IsOK(res1)) {
4941 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___iadd__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4943 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4944 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
4945 if (!SWIG_IsOK(ecode2)) {
4946 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'");
4948 arg2 = static_cast< ptrdiff_t >(val2);
4949 try {
4950 result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2);
4952 catch(swig::stop_iteration &_e) {
4954 (void)_e;
4955 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4956 SWIG_fail;
4960 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
4961 return resultobj;
4962 fail:
4963 return NULL;
4967 SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4968 PyObject *resultobj = 0;
4969 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
4970 ptrdiff_t arg2 ;
4971 void *argp1 = 0 ;
4972 int res1 = 0 ;
4973 ptrdiff_t val2 ;
4974 int ecode2 = 0 ;
4975 PyObject * obj0 = 0 ;
4976 PyObject * obj1 = 0 ;
4977 swig::SwigPyIterator *result = 0 ;
4979 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___isub__",2,2,&obj0,&obj1)) SWIG_fail;
4980 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN | 0 );
4981 if (!SWIG_IsOK(res1)) {
4982 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___isub__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'");
4984 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
4985 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
4986 if (!SWIG_IsOK(ecode2)) {
4987 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'");
4989 arg2 = static_cast< ptrdiff_t >(val2);
4990 try {
4991 result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2);
4993 catch(swig::stop_iteration &_e) {
4995 (void)_e;
4996 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
4997 SWIG_fail;
5001 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
5002 return resultobj;
5003 fail:
5004 return NULL;
5008 SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5009 PyObject *resultobj = 0;
5010 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5011 ptrdiff_t arg2 ;
5012 void *argp1 = 0 ;
5013 int res1 = 0 ;
5014 ptrdiff_t val2 ;
5015 int ecode2 = 0 ;
5016 PyObject * obj0 = 0 ;
5017 PyObject * obj1 = 0 ;
5018 swig::SwigPyIterator *result = 0 ;
5020 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___add__",2,2,&obj0,&obj1)) SWIG_fail;
5021 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5022 if (!SWIG_IsOK(res1)) {
5023 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___add__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5025 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5026 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
5027 if (!SWIG_IsOK(ecode2)) {
5028 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'");
5030 arg2 = static_cast< ptrdiff_t >(val2);
5031 try {
5032 result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2);
5034 catch(swig::stop_iteration &_e) {
5036 (void)_e;
5037 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5038 SWIG_fail;
5042 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
5043 return resultobj;
5044 fail:
5045 return NULL;
5049 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5050 PyObject *resultobj = 0;
5051 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5052 ptrdiff_t arg2 ;
5053 void *argp1 = 0 ;
5054 int res1 = 0 ;
5055 ptrdiff_t val2 ;
5056 int ecode2 = 0 ;
5057 PyObject * obj0 = 0 ;
5058 PyObject * obj1 = 0 ;
5059 swig::SwigPyIterator *result = 0 ;
5061 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___sub__",2,2,&obj0,&obj1)) SWIG_fail;
5062 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5063 if (!SWIG_IsOK(res1)) {
5064 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5066 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5067 ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
5068 if (!SWIG_IsOK(ecode2)) {
5069 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'");
5071 arg2 = static_cast< ptrdiff_t >(val2);
5072 try {
5073 result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2);
5075 catch(swig::stop_iteration &_e) {
5077 (void)_e;
5078 SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
5079 SWIG_fail;
5083 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN | 0 );
5084 return resultobj;
5085 fail:
5086 return NULL;
5090 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5091 PyObject *resultobj = 0;
5092 swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
5093 swig::SwigPyIterator *arg2 = 0 ;
5094 void *argp1 = 0 ;
5095 int res1 = 0 ;
5096 void *argp2 = 0 ;
5097 int res2 = 0 ;
5098 PyObject * obj0 = 0 ;
5099 PyObject * obj1 = 0 ;
5100 ptrdiff_t result;
5102 if(!PyArg_UnpackTuple(args,(char *)"SwigPyIterator___sub__",2,2,&obj0,&obj1)) SWIG_fail;
5103 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 | 0 );
5104 if (!SWIG_IsOK(res1)) {
5105 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'");
5107 arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
5108 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator, 0 | 0);
5109 if (!SWIG_IsOK(res2)) {
5110 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5112 if (!argp2) {
5113 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'");
5115 arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
5116 result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2);
5117 resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
5118 return resultobj;
5119 fail:
5120 return NULL;
5124 SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) {
5125 int argc;
5126 PyObject *argv[3];
5127 int ii;
5129 if (!PyTuple_Check(args)) SWIG_fail;
5130 argc = args ? (int)PyObject_Length(args) : 0;
5131 for (ii = 0; (ii < 2) && (ii < argc); ii++) {
5132 argv[ii] = PyTuple_GET_ITEM(args,ii);
5134 if (argc == 2) {
5135 int _v;
5136 void *vptr = 0;
5137 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5138 _v = SWIG_CheckState(res);
5139 if (_v) {
5140 int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0);
5141 _v = SWIG_CheckState(res);
5142 if (_v) {
5143 return _wrap_SwigPyIterator___sub____SWIG_1(self, args);
5147 if (argc == 2) {
5148 int _v;
5149 void *vptr = 0;
5150 int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
5151 _v = SWIG_CheckState(res);
5152 if (_v) {
5154 int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
5155 _v = SWIG_CheckState(res);
5157 if (_v) {
5158 return _wrap_SwigPyIterator___sub____SWIG_0(self, args);
5163 fail:
5164 Py_INCREF(Py_NotImplemented);
5165 return Py_NotImplemented;
5169 SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5170 PyObject *obj;
5171 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
5172 SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj));
5173 return SWIG_Py_Void();
5176 SWIGINTERN PyObject *_wrap_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5177 PyObject *resultobj = 0;
5178 char *result = 0 ;
5180 result = (char *)GEOSversion();
5181 resultobj = SWIG_FromCharPtr((const char *)result);
5182 return resultobj;
5183 fail:
5184 return NULL;
5188 SWIGINTERN PyObject *_wrap_new_CoordinateSequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5189 PyObject *resultobj = 0;
5190 size_t arg1 ;
5191 size_t arg2 ;
5192 size_t val1 ;
5193 int ecode1 = 0 ;
5194 size_t val2 ;
5195 int ecode2 = 0 ;
5196 PyObject * obj0 = 0 ;
5197 PyObject * obj1 = 0 ;
5198 GeosCoordinateSequence *result = 0 ;
5200 if(!PyArg_UnpackTuple(args,(char *)"new_CoordinateSequence",2,2,&obj0,&obj1)) SWIG_fail;
5201 ecode1 = SWIG_AsVal_size_t(obj0, &val1);
5202 if (!SWIG_IsOK(ecode1)) {
5203 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CoordinateSequence" "', argument " "1"" of type '" "size_t""'");
5205 arg1 = static_cast< size_t >(val1);
5206 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5207 if (!SWIG_IsOK(ecode2)) {
5208 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CoordinateSequence" "', argument " "2"" of type '" "size_t""'");
5210 arg2 = static_cast< size_t >(val2);
5214 result = (GeosCoordinateSequence *)new_GeosCoordinateSequence(arg1,arg2);
5216 catch (const std::exception& e)
5218 SWIG_exception(SWIG_RuntimeError, e.what());
5221 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_NEW | 0 );
5222 return resultobj;
5223 fail:
5224 return NULL;
5228 SWIGINTERN PyObject *_wrap_delete_CoordinateSequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5229 PyObject *resultobj = 0;
5230 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5231 void *argp1 = 0 ;
5232 int res1 = 0 ;
5233 PyObject * obj0 = 0 ;
5235 if(!PyArg_UnpackTuple(args,(char *)"delete_CoordinateSequence",1,1,&obj0)) SWIG_fail;
5236 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN | 0 );
5237 if (!SWIG_IsOK(res1)) {
5238 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CoordinateSequence" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5240 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5244 delete_GeosCoordinateSequence(arg1);
5246 catch (const std::exception& e)
5248 SWIG_exception(SWIG_RuntimeError, e.what());
5251 resultobj = SWIG_Py_Void();
5252 return resultobj;
5253 fail:
5254 return NULL;
5258 SWIGINTERN PyObject *_wrap_CoordinateSequence_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5259 PyObject *resultobj = 0;
5260 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5261 void *argp1 = 0 ;
5262 int res1 = 0 ;
5263 PyObject * obj0 = 0 ;
5264 GeosCoordinateSequence *result = 0 ;
5266 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_clone",1,1,&obj0)) SWIG_fail;
5267 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5268 if (!SWIG_IsOK(res1)) {
5269 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_clone" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5271 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5275 result = (GeosCoordinateSequence *)GeosCoordinateSequence_clone(arg1);
5277 catch (const std::exception& e)
5279 SWIG_exception(SWIG_RuntimeError, e.what());
5282 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_OWN | 0 );
5283 return resultobj;
5284 fail:
5285 return NULL;
5289 SWIGINTERN PyObject *_wrap_CoordinateSequence_setX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5290 PyObject *resultobj = 0;
5291 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5292 size_t arg2 ;
5293 double arg3 ;
5294 void *argp1 = 0 ;
5295 int res1 = 0 ;
5296 size_t val2 ;
5297 int ecode2 = 0 ;
5298 double val3 ;
5299 int ecode3 = 0 ;
5300 PyObject * obj0 = 0 ;
5301 PyObject * obj1 = 0 ;
5302 PyObject * obj2 = 0 ;
5303 int result;
5305 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setX",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
5306 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5307 if (!SWIG_IsOK(res1)) {
5308 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setX" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5310 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5311 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5312 if (!SWIG_IsOK(ecode2)) {
5313 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setX" "', argument " "2"" of type '" "size_t""'");
5315 arg2 = static_cast< size_t >(val2);
5316 ecode3 = SWIG_AsVal_double(obj2, &val3);
5317 if (!SWIG_IsOK(ecode3)) {
5318 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setX" "', argument " "3"" of type '" "double""'");
5320 arg3 = static_cast< double >(val3);
5324 result = (int)GeosCoordinateSequence_setX(arg1,arg2,arg3);
5326 catch (const std::exception& e)
5328 SWIG_exception(SWIG_RuntimeError, e.what());
5331 resultobj = SWIG_From_int(static_cast< int >(result));
5332 return resultobj;
5333 fail:
5334 return NULL;
5338 SWIGINTERN PyObject *_wrap_CoordinateSequence_setY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5339 PyObject *resultobj = 0;
5340 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5341 size_t arg2 ;
5342 double arg3 ;
5343 void *argp1 = 0 ;
5344 int res1 = 0 ;
5345 size_t val2 ;
5346 int ecode2 = 0 ;
5347 double val3 ;
5348 int ecode3 = 0 ;
5349 PyObject * obj0 = 0 ;
5350 PyObject * obj1 = 0 ;
5351 PyObject * obj2 = 0 ;
5352 int result;
5354 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setY",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
5355 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5356 if (!SWIG_IsOK(res1)) {
5357 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setY" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5359 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5360 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5361 if (!SWIG_IsOK(ecode2)) {
5362 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setY" "', argument " "2"" of type '" "size_t""'");
5364 arg2 = static_cast< size_t >(val2);
5365 ecode3 = SWIG_AsVal_double(obj2, &val3);
5366 if (!SWIG_IsOK(ecode3)) {
5367 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setY" "', argument " "3"" of type '" "double""'");
5369 arg3 = static_cast< double >(val3);
5373 result = (int)GeosCoordinateSequence_setY(arg1,arg2,arg3);
5375 catch (const std::exception& e)
5377 SWIG_exception(SWIG_RuntimeError, e.what());
5380 resultobj = SWIG_From_int(static_cast< int >(result));
5381 return resultobj;
5382 fail:
5383 return NULL;
5387 SWIGINTERN PyObject *_wrap_CoordinateSequence_setZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5388 PyObject *resultobj = 0;
5389 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5390 size_t arg2 ;
5391 double arg3 ;
5392 void *argp1 = 0 ;
5393 int res1 = 0 ;
5394 size_t val2 ;
5395 int ecode2 = 0 ;
5396 double val3 ;
5397 int ecode3 = 0 ;
5398 PyObject * obj0 = 0 ;
5399 PyObject * obj1 = 0 ;
5400 PyObject * obj2 = 0 ;
5401 int result;
5403 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setZ",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
5404 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5405 if (!SWIG_IsOK(res1)) {
5406 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setZ" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5408 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5409 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5410 if (!SWIG_IsOK(ecode2)) {
5411 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setZ" "', argument " "2"" of type '" "size_t""'");
5413 arg2 = static_cast< size_t >(val2);
5414 ecode3 = SWIG_AsVal_double(obj2, &val3);
5415 if (!SWIG_IsOK(ecode3)) {
5416 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setZ" "', argument " "3"" of type '" "double""'");
5418 arg3 = static_cast< double >(val3);
5422 result = (int)GeosCoordinateSequence_setZ(arg1,arg2,arg3);
5424 catch (const std::exception& e)
5426 SWIG_exception(SWIG_RuntimeError, e.what());
5429 resultobj = SWIG_From_int(static_cast< int >(result));
5430 return resultobj;
5431 fail:
5432 return NULL;
5436 SWIGINTERN PyObject *_wrap_CoordinateSequence_setOrdinate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5437 PyObject *resultobj = 0;
5438 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5439 size_t arg2 ;
5440 size_t arg3 ;
5441 double arg4 ;
5442 void *argp1 = 0 ;
5443 int res1 = 0 ;
5444 size_t val2 ;
5445 int ecode2 = 0 ;
5446 size_t val3 ;
5447 int ecode3 = 0 ;
5448 double val4 ;
5449 int ecode4 = 0 ;
5450 PyObject * obj0 = 0 ;
5451 PyObject * obj1 = 0 ;
5452 PyObject * obj2 = 0 ;
5453 PyObject * obj3 = 0 ;
5454 int result;
5456 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_setOrdinate",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
5457 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5458 if (!SWIG_IsOK(res1)) {
5459 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_setOrdinate" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5461 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5462 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5463 if (!SWIG_IsOK(ecode2)) {
5464 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_setOrdinate" "', argument " "2"" of type '" "size_t""'");
5466 arg2 = static_cast< size_t >(val2);
5467 ecode3 = SWIG_AsVal_size_t(obj2, &val3);
5468 if (!SWIG_IsOK(ecode3)) {
5469 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_setOrdinate" "', argument " "3"" of type '" "size_t""'");
5471 arg3 = static_cast< size_t >(val3);
5472 ecode4 = SWIG_AsVal_double(obj3, &val4);
5473 if (!SWIG_IsOK(ecode4)) {
5474 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CoordinateSequence_setOrdinate" "', argument " "4"" of type '" "double""'");
5476 arg4 = static_cast< double >(val4);
5480 result = (int)GeosCoordinateSequence_setOrdinate(arg1,arg2,arg3,arg4);
5482 catch (const std::exception& e)
5484 SWIG_exception(SWIG_RuntimeError, e.what());
5487 resultobj = SWIG_From_int(static_cast< int >(result));
5488 return resultobj;
5489 fail:
5490 return NULL;
5494 SWIGINTERN PyObject *_wrap_CoordinateSequence_getX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5495 PyObject *resultobj = 0;
5496 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5497 size_t arg2 ;
5498 void *argp1 = 0 ;
5499 int res1 = 0 ;
5500 size_t val2 ;
5501 int ecode2 = 0 ;
5502 PyObject * obj0 = 0 ;
5503 PyObject * obj1 = 0 ;
5504 double result;
5506 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getX",2,2,&obj0,&obj1)) SWIG_fail;
5507 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5508 if (!SWIG_IsOK(res1)) {
5509 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getX" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5511 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5512 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5513 if (!SWIG_IsOK(ecode2)) {
5514 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getX" "', argument " "2"" of type '" "size_t""'");
5516 arg2 = static_cast< size_t >(val2);
5520 result = (double)GeosCoordinateSequence_getX(arg1,arg2);
5522 catch (const std::exception& e)
5524 SWIG_exception(SWIG_RuntimeError, e.what());
5527 resultobj = SWIG_From_double(static_cast< double >(result));
5528 return resultobj;
5529 fail:
5530 return NULL;
5534 SWIGINTERN PyObject *_wrap_CoordinateSequence_getY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5535 PyObject *resultobj = 0;
5536 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5537 size_t arg2 ;
5538 void *argp1 = 0 ;
5539 int res1 = 0 ;
5540 size_t val2 ;
5541 int ecode2 = 0 ;
5542 PyObject * obj0 = 0 ;
5543 PyObject * obj1 = 0 ;
5544 double result;
5546 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getY",2,2,&obj0,&obj1)) SWIG_fail;
5547 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5548 if (!SWIG_IsOK(res1)) {
5549 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getY" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5551 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5552 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5553 if (!SWIG_IsOK(ecode2)) {
5554 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getY" "', argument " "2"" of type '" "size_t""'");
5556 arg2 = static_cast< size_t >(val2);
5560 result = (double)GeosCoordinateSequence_getY(arg1,arg2);
5562 catch (const std::exception& e)
5564 SWIG_exception(SWIG_RuntimeError, e.what());
5567 resultobj = SWIG_From_double(static_cast< double >(result));
5568 return resultobj;
5569 fail:
5570 return NULL;
5574 SWIGINTERN PyObject *_wrap_CoordinateSequence_getZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5575 PyObject *resultobj = 0;
5576 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5577 size_t arg2 ;
5578 void *argp1 = 0 ;
5579 int res1 = 0 ;
5580 size_t val2 ;
5581 int ecode2 = 0 ;
5582 PyObject * obj0 = 0 ;
5583 PyObject * obj1 = 0 ;
5584 double result;
5586 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getZ",2,2,&obj0,&obj1)) SWIG_fail;
5587 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5588 if (!SWIG_IsOK(res1)) {
5589 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getZ" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5591 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5592 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5593 if (!SWIG_IsOK(ecode2)) {
5594 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getZ" "', argument " "2"" of type '" "size_t""'");
5596 arg2 = static_cast< size_t >(val2);
5600 result = (double)GeosCoordinateSequence_getZ(arg1,arg2);
5602 catch (const std::exception& e)
5604 SWIG_exception(SWIG_RuntimeError, e.what());
5607 resultobj = SWIG_From_double(static_cast< double >(result));
5608 return resultobj;
5609 fail:
5610 return NULL;
5614 SWIGINTERN PyObject *_wrap_CoordinateSequence_getOrdinate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5615 PyObject *resultobj = 0;
5616 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5617 size_t arg2 ;
5618 size_t arg3 ;
5619 void *argp1 = 0 ;
5620 int res1 = 0 ;
5621 size_t val2 ;
5622 int ecode2 = 0 ;
5623 size_t val3 ;
5624 int ecode3 = 0 ;
5625 PyObject * obj0 = 0 ;
5626 PyObject * obj1 = 0 ;
5627 PyObject * obj2 = 0 ;
5628 double result;
5630 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getOrdinate",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
5631 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5632 if (!SWIG_IsOK(res1)) {
5633 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getOrdinate" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5635 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5636 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
5637 if (!SWIG_IsOK(ecode2)) {
5638 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CoordinateSequence_getOrdinate" "', argument " "2"" of type '" "size_t""'");
5640 arg2 = static_cast< size_t >(val2);
5641 ecode3 = SWIG_AsVal_size_t(obj2, &val3);
5642 if (!SWIG_IsOK(ecode3)) {
5643 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CoordinateSequence_getOrdinate" "', argument " "3"" of type '" "size_t""'");
5645 arg3 = static_cast< size_t >(val3);
5649 result = (double)GeosCoordinateSequence_getOrdinate(arg1,arg2,arg3);
5651 catch (const std::exception& e)
5653 SWIG_exception(SWIG_RuntimeError, e.what());
5656 resultobj = SWIG_From_double(static_cast< double >(result));
5657 return resultobj;
5658 fail:
5659 return NULL;
5663 SWIGINTERN PyObject *_wrap_CoordinateSequence_getSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5664 PyObject *resultobj = 0;
5665 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5666 void *argp1 = 0 ;
5667 int res1 = 0 ;
5668 PyObject * obj0 = 0 ;
5669 unsigned int result;
5671 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getSize",1,1,&obj0)) SWIG_fail;
5672 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5673 if (!SWIG_IsOK(res1)) {
5674 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getSize" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5676 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5680 result = (unsigned int)GeosCoordinateSequence_getSize(arg1);
5682 catch (const std::exception& e)
5684 SWIG_exception(SWIG_RuntimeError, e.what());
5687 resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
5688 return resultobj;
5689 fail:
5690 return NULL;
5694 SWIGINTERN PyObject *_wrap_CoordinateSequence_getDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5695 PyObject *resultobj = 0;
5696 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
5697 void *argp1 = 0 ;
5698 int res1 = 0 ;
5699 PyObject * obj0 = 0 ;
5700 unsigned int result;
5702 if(!PyArg_UnpackTuple(args,(char *)"CoordinateSequence_getDimensions",1,1,&obj0)) SWIG_fail;
5703 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
5704 if (!SWIG_IsOK(res1)) {
5705 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CoordinateSequence_getDimensions" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
5707 arg1 = reinterpret_cast< GeosCoordinateSequence * >(argp1);
5711 result = (unsigned int)GeosCoordinateSequence_getDimensions(arg1);
5713 catch (const std::exception& e)
5715 SWIG_exception(SWIG_RuntimeError, e.what());
5718 resultobj = SWIG_From_unsigned_SS_int(static_cast< unsigned int >(result));
5719 return resultobj;
5720 fail:
5721 return NULL;
5725 SWIGINTERN PyObject *CoordinateSequence_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5726 PyObject *obj;
5727 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
5728 SWIG_TypeNewClientData(SWIGTYPE_p_GeosCoordinateSequence, SWIG_NewClientData(obj));
5729 return SWIG_Py_Void();
5732 SWIGINTERN PyObject *_wrap_delete_Geometry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5733 PyObject *resultobj = 0;
5734 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5735 void *argp1 = 0 ;
5736 int res1 = 0 ;
5737 PyObject * obj0 = 0 ;
5739 if(!PyArg_UnpackTuple(args,(char *)"delete_Geometry",1,1,&obj0)) SWIG_fail;
5740 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, SWIG_POINTER_DISOWN | 0 );
5741 if (!SWIG_IsOK(res1)) {
5742 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Geometry" "', argument " "1"" of type '" "GeosGeometry *""'");
5744 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
5748 delete_GeosGeometry(arg1);
5750 catch (const std::exception& e)
5752 SWIG_exception(SWIG_RuntimeError, e.what());
5755 resultobj = SWIG_Py_Void();
5756 return resultobj;
5757 fail:
5758 return NULL;
5762 SWIGINTERN PyObject *_wrap_Geometry_clone(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5763 PyObject *resultobj = 0;
5764 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5765 void *argp1 = 0 ;
5766 int res1 = 0 ;
5767 PyObject * obj0 = 0 ;
5768 GeosGeometry *result = 0 ;
5770 if(!PyArg_UnpackTuple(args,(char *)"Geometry_clone",1,1,&obj0)) SWIG_fail;
5771 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
5772 if (!SWIG_IsOK(res1)) {
5773 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_clone" "', argument " "1"" of type '" "GeosGeometry *""'");
5775 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
5779 result = (GeosGeometry *)GeosGeometry_clone(arg1);
5781 catch (const std::exception& e)
5783 SWIG_exception(SWIG_RuntimeError, e.what());
5787 /* %typemap(out) GeosGeometry */
5789 if (result == NULL)
5790 SWIG_exception(SWIG_RuntimeError, message);
5792 GeosGeometry *geom = result;
5793 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
5795 switch (geomId)
5797 case GEOS_POINT:
5798 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
5799 break;
5800 case GEOS_LINESTRING:
5801 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
5802 break;
5803 case GEOS_LINEARRING:
5804 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
5805 break;
5806 case GEOS_POLYGON:
5807 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
5808 break;
5809 case GEOS_MULTIPOINT:
5810 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
5811 break;
5812 case GEOS_MULTILINESTRING:
5813 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
5814 break;
5815 case GEOS_MULTIPOLYGON:
5816 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
5817 break;
5818 case GEOS_GEOMETRYCOLLECTION:
5819 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
5820 break;
5823 return resultobj;
5824 fail:
5825 return NULL;
5829 SWIGINTERN PyObject *_wrap_Geometry_geomType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5830 PyObject *resultobj = 0;
5831 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5832 void *argp1 = 0 ;
5833 int res1 = 0 ;
5834 PyObject * obj0 = 0 ;
5835 char *result = 0 ;
5837 if(!PyArg_UnpackTuple(args,(char *)"Geometry_geomType",1,1,&obj0)) SWIG_fail;
5838 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
5839 if (!SWIG_IsOK(res1)) {
5840 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_geomType" "', argument " "1"" of type '" "GeosGeometry *""'");
5842 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
5846 result = (char *)GeosGeometry_geomType(arg1);
5848 catch (const std::exception& e)
5850 SWIG_exception(SWIG_RuntimeError, e.what());
5853 resultobj = SWIG_FromCharPtr((const char *)result);
5854 return resultobj;
5855 fail:
5856 return NULL;
5860 SWIGINTERN PyObject *_wrap_Geometry_typeId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5861 PyObject *resultobj = 0;
5862 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5863 void *argp1 = 0 ;
5864 int res1 = 0 ;
5865 PyObject * obj0 = 0 ;
5866 int result;
5868 if(!PyArg_UnpackTuple(args,(char *)"Geometry_typeId",1,1,&obj0)) SWIG_fail;
5869 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
5870 if (!SWIG_IsOK(res1)) {
5871 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_typeId" "', argument " "1"" of type '" "GeosGeometry *""'");
5873 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
5877 result = (int)GeosGeometry_typeId(arg1);
5879 catch (const std::exception& e)
5881 SWIG_exception(SWIG_RuntimeError, e.what());
5884 resultobj = SWIG_From_int(static_cast< int >(result));
5885 return resultobj;
5886 fail:
5887 return NULL;
5891 SWIGINTERN PyObject *_wrap_Geometry_normalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5892 PyObject *resultobj = 0;
5893 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5894 void *argp1 = 0 ;
5895 int res1 = 0 ;
5896 PyObject * obj0 = 0 ;
5898 if(!PyArg_UnpackTuple(args,(char *)"Geometry_normalize",1,1,&obj0)) SWIG_fail;
5899 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
5900 if (!SWIG_IsOK(res1)) {
5901 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_normalize" "', argument " "1"" of type '" "GeosGeometry *""'");
5903 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
5907 GeosGeometry_normalize(arg1);
5909 catch (const std::exception& e)
5911 SWIG_exception(SWIG_RuntimeError, e.what());
5914 resultobj = SWIG_Py_Void();
5915 return resultobj;
5916 fail:
5917 return NULL;
5921 SWIGINTERN PyObject *_wrap_Geometry_getSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5922 PyObject *resultobj = 0;
5923 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5924 void *argp1 = 0 ;
5925 int res1 = 0 ;
5926 PyObject * obj0 = 0 ;
5927 int result;
5929 if(!PyArg_UnpackTuple(args,(char *)"Geometry_getSRID",1,1,&obj0)) SWIG_fail;
5930 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
5931 if (!SWIG_IsOK(res1)) {
5932 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getSRID" "', argument " "1"" of type '" "GeosGeometry *""'");
5934 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
5938 result = (int)GeosGeometry_getSRID(arg1);
5940 catch (const std::exception& e)
5942 SWIG_exception(SWIG_RuntimeError, e.what());
5945 resultobj = SWIG_From_int(static_cast< int >(result));
5946 return resultobj;
5947 fail:
5948 return NULL;
5952 SWIGINTERN PyObject *_wrap_Geometry_setSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5953 PyObject *resultobj = 0;
5954 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5955 int arg2 ;
5956 void *argp1 = 0 ;
5957 int res1 = 0 ;
5958 int val2 ;
5959 int ecode2 = 0 ;
5960 PyObject * obj0 = 0 ;
5961 PyObject * obj1 = 0 ;
5963 if(!PyArg_UnpackTuple(args,(char *)"Geometry_setSRID",2,2,&obj0,&obj1)) SWIG_fail;
5964 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
5965 if (!SWIG_IsOK(res1)) {
5966 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_setSRID" "', argument " "1"" of type '" "GeosGeometry *""'");
5968 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
5969 ecode2 = SWIG_AsVal_int(obj1, &val2);
5970 if (!SWIG_IsOK(ecode2)) {
5971 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_setSRID" "', argument " "2"" of type '" "int""'");
5973 arg2 = static_cast< int >(val2);
5977 GeosGeometry_setSRID(arg1,arg2);
5979 catch (const std::exception& e)
5981 SWIG_exception(SWIG_RuntimeError, e.what());
5984 resultobj = SWIG_Py_Void();
5985 return resultobj;
5986 fail:
5987 return NULL;
5991 SWIGINTERN PyObject *_wrap_Geometry_getDimensions(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
5992 PyObject *resultobj = 0;
5993 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
5994 void *argp1 = 0 ;
5995 int res1 = 0 ;
5996 PyObject * obj0 = 0 ;
5997 size_t result;
5999 if(!PyArg_UnpackTuple(args,(char *)"Geometry_getDimensions",1,1,&obj0)) SWIG_fail;
6000 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6001 if (!SWIG_IsOK(res1)) {
6002 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getDimensions" "', argument " "1"" of type '" "GeosGeometry *""'");
6004 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6008 result = GeosGeometry_getDimensions(arg1);
6010 catch (const std::exception& e)
6012 SWIG_exception(SWIG_RuntimeError, e.what());
6015 resultobj = SWIG_From_size_t(static_cast< size_t >(result));
6016 return resultobj;
6017 fail:
6018 return NULL;
6022 SWIGINTERN PyObject *_wrap_Geometry_getNumGeometries(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6023 PyObject *resultobj = 0;
6024 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6025 void *argp1 = 0 ;
6026 int res1 = 0 ;
6027 PyObject * obj0 = 0 ;
6028 size_t result;
6030 if(!PyArg_UnpackTuple(args,(char *)"Geometry_getNumGeometries",1,1,&obj0)) SWIG_fail;
6031 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6032 if (!SWIG_IsOK(res1)) {
6033 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getNumGeometries" "', argument " "1"" of type '" "GeosGeometry *""'");
6035 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6039 result = GeosGeometry_getNumGeometries(arg1);
6041 catch (const std::exception& e)
6043 SWIG_exception(SWIG_RuntimeError, e.what());
6046 resultobj = SWIG_From_size_t(static_cast< size_t >(result));
6047 return resultobj;
6048 fail:
6049 return NULL;
6053 SWIGINTERN PyObject *_wrap_Geometry_intersection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6054 PyObject *resultobj = 0;
6055 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6056 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
6057 void *argp1 = 0 ;
6058 int res1 = 0 ;
6059 void *argp2 = 0 ;
6060 int res2 = 0 ;
6061 PyObject * obj0 = 0 ;
6062 PyObject * obj1 = 0 ;
6063 GeosGeometry *result = 0 ;
6065 if(!PyArg_UnpackTuple(args,(char *)"Geometry_intersection",2,2,&obj0,&obj1)) SWIG_fail;
6066 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6067 if (!SWIG_IsOK(res1)) {
6068 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_intersection" "', argument " "1"" of type '" "GeosGeometry *""'");
6070 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6071 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6072 if (!SWIG_IsOK(res2)) {
6073 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_intersection" "', argument " "2"" of type '" "GeosGeometry *""'");
6075 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
6079 result = (GeosGeometry *)GeosGeometry_intersection(arg1,arg2);
6081 catch (const std::exception& e)
6083 SWIG_exception(SWIG_RuntimeError, e.what());
6087 /* %typemap(out) GeosGeometry */
6089 if (result == NULL)
6090 SWIG_exception(SWIG_RuntimeError, message);
6092 GeosGeometry *geom = result;
6093 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6095 switch (geomId)
6097 case GEOS_POINT:
6098 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6099 break;
6100 case GEOS_LINESTRING:
6101 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6102 break;
6103 case GEOS_LINEARRING:
6104 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6105 break;
6106 case GEOS_POLYGON:
6107 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6108 break;
6109 case GEOS_MULTIPOINT:
6110 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6111 break;
6112 case GEOS_MULTILINESTRING:
6113 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6114 break;
6115 case GEOS_MULTIPOLYGON:
6116 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6117 break;
6118 case GEOS_GEOMETRYCOLLECTION:
6119 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6120 break;
6123 return resultobj;
6124 fail:
6125 return NULL;
6129 SWIGINTERN PyObject *_wrap_Geometry_buffer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6130 PyObject *resultobj = 0;
6131 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6132 double arg2 ;
6133 int arg3 ;
6134 void *argp1 = 0 ;
6135 int res1 = 0 ;
6136 double val2 ;
6137 int ecode2 = 0 ;
6138 int val3 ;
6139 int ecode3 = 0 ;
6140 PyObject * obj0 = 0 ;
6141 PyObject * obj1 = 0 ;
6142 PyObject * obj2 = 0 ;
6143 GeosGeometry *result = 0 ;
6146 arg3 = DEFAULT_QUADRANT_SEGMENTS;
6148 if(!PyArg_UnpackTuple(args,(char *)"Geometry_buffer",2,3,&obj0,&obj1,&obj2)) SWIG_fail;
6149 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6150 if (!SWIG_IsOK(res1)) {
6151 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_buffer" "', argument " "1"" of type '" "GeosGeometry *""'");
6153 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6154 ecode2 = SWIG_AsVal_double(obj1, &val2);
6155 if (!SWIG_IsOK(ecode2)) {
6156 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_buffer" "', argument " "2"" of type '" "double""'");
6158 arg2 = static_cast< double >(val2);
6159 if (obj2) {
6160 ecode3 = SWIG_AsVal_int(obj2, &val3);
6161 if (!SWIG_IsOK(ecode3)) {
6162 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_buffer" "', argument " "3"" of type '" "int""'");
6164 arg3 = static_cast< int >(val3);
6169 result = (GeosGeometry *)GeosGeometry_buffer(arg1,arg2,arg3);
6171 catch (const std::exception& e)
6173 SWIG_exception(SWIG_RuntimeError, e.what());
6177 /* %typemap(out) GeosGeometry */
6179 if (result == NULL)
6180 SWIG_exception(SWIG_RuntimeError, message);
6182 GeosGeometry *geom = result;
6183 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6185 switch (geomId)
6187 case GEOS_POINT:
6188 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6189 break;
6190 case GEOS_LINESTRING:
6191 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6192 break;
6193 case GEOS_LINEARRING:
6194 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6195 break;
6196 case GEOS_POLYGON:
6197 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6198 break;
6199 case GEOS_MULTIPOINT:
6200 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6201 break;
6202 case GEOS_MULTILINESTRING:
6203 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6204 break;
6205 case GEOS_MULTIPOLYGON:
6206 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6207 break;
6208 case GEOS_GEOMETRYCOLLECTION:
6209 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6210 break;
6213 return resultobj;
6214 fail:
6215 return NULL;
6219 SWIGINTERN PyObject *_wrap_Geometry_convexHull(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6220 PyObject *resultobj = 0;
6221 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6222 void *argp1 = 0 ;
6223 int res1 = 0 ;
6224 PyObject * obj0 = 0 ;
6225 GeosGeometry *result = 0 ;
6227 if(!PyArg_UnpackTuple(args,(char *)"Geometry_convexHull",1,1,&obj0)) SWIG_fail;
6228 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6229 if (!SWIG_IsOK(res1)) {
6230 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_convexHull" "', argument " "1"" of type '" "GeosGeometry *""'");
6232 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6236 result = (GeosGeometry *)GeosGeometry_convexHull(arg1);
6238 catch (const std::exception& e)
6240 SWIG_exception(SWIG_RuntimeError, e.what());
6244 /* %typemap(out) GeosGeometry */
6246 if (result == NULL)
6247 SWIG_exception(SWIG_RuntimeError, message);
6249 GeosGeometry *geom = result;
6250 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6252 switch (geomId)
6254 case GEOS_POINT:
6255 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6256 break;
6257 case GEOS_LINESTRING:
6258 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6259 break;
6260 case GEOS_LINEARRING:
6261 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6262 break;
6263 case GEOS_POLYGON:
6264 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6265 break;
6266 case GEOS_MULTIPOINT:
6267 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6268 break;
6269 case GEOS_MULTILINESTRING:
6270 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6271 break;
6272 case GEOS_MULTIPOLYGON:
6273 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6274 break;
6275 case GEOS_GEOMETRYCOLLECTION:
6276 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6277 break;
6280 return resultobj;
6281 fail:
6282 return NULL;
6286 SWIGINTERN PyObject *_wrap_Geometry_difference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6287 PyObject *resultobj = 0;
6288 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6289 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
6290 void *argp1 = 0 ;
6291 int res1 = 0 ;
6292 void *argp2 = 0 ;
6293 int res2 = 0 ;
6294 PyObject * obj0 = 0 ;
6295 PyObject * obj1 = 0 ;
6296 GeosGeometry *result = 0 ;
6298 if(!PyArg_UnpackTuple(args,(char *)"Geometry_difference",2,2,&obj0,&obj1)) SWIG_fail;
6299 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6300 if (!SWIG_IsOK(res1)) {
6301 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_difference" "', argument " "1"" of type '" "GeosGeometry *""'");
6303 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6304 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6305 if (!SWIG_IsOK(res2)) {
6306 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_difference" "', argument " "2"" of type '" "GeosGeometry *""'");
6308 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
6312 result = (GeosGeometry *)GeosGeometry_difference(arg1,arg2);
6314 catch (const std::exception& e)
6316 SWIG_exception(SWIG_RuntimeError, e.what());
6320 /* %typemap(out) GeosGeometry */
6322 if (result == NULL)
6323 SWIG_exception(SWIG_RuntimeError, message);
6325 GeosGeometry *geom = result;
6326 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6328 switch (geomId)
6330 case GEOS_POINT:
6331 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6332 break;
6333 case GEOS_LINESTRING:
6334 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6335 break;
6336 case GEOS_LINEARRING:
6337 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6338 break;
6339 case GEOS_POLYGON:
6340 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6341 break;
6342 case GEOS_MULTIPOINT:
6343 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6344 break;
6345 case GEOS_MULTILINESTRING:
6346 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6347 break;
6348 case GEOS_MULTIPOLYGON:
6349 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6350 break;
6351 case GEOS_GEOMETRYCOLLECTION:
6352 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6353 break;
6356 return resultobj;
6357 fail:
6358 return NULL;
6362 SWIGINTERN PyObject *_wrap_Geometry_symDifference(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6363 PyObject *resultobj = 0;
6364 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6365 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
6366 void *argp1 = 0 ;
6367 int res1 = 0 ;
6368 void *argp2 = 0 ;
6369 int res2 = 0 ;
6370 PyObject * obj0 = 0 ;
6371 PyObject * obj1 = 0 ;
6372 GeosGeometry *result = 0 ;
6374 if(!PyArg_UnpackTuple(args,(char *)"Geometry_symDifference",2,2,&obj0,&obj1)) SWIG_fail;
6375 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6376 if (!SWIG_IsOK(res1)) {
6377 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_symDifference" "', argument " "1"" of type '" "GeosGeometry *""'");
6379 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6380 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6381 if (!SWIG_IsOK(res2)) {
6382 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_symDifference" "', argument " "2"" of type '" "GeosGeometry *""'");
6384 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
6388 result = (GeosGeometry *)GeosGeometry_symDifference(arg1,arg2);
6390 catch (const std::exception& e)
6392 SWIG_exception(SWIG_RuntimeError, e.what());
6396 /* %typemap(out) GeosGeometry */
6398 if (result == NULL)
6399 SWIG_exception(SWIG_RuntimeError, message);
6401 GeosGeometry *geom = result;
6402 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6404 switch (geomId)
6406 case GEOS_POINT:
6407 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6408 break;
6409 case GEOS_LINESTRING:
6410 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6411 break;
6412 case GEOS_LINEARRING:
6413 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6414 break;
6415 case GEOS_POLYGON:
6416 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6417 break;
6418 case GEOS_MULTIPOINT:
6419 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6420 break;
6421 case GEOS_MULTILINESTRING:
6422 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6423 break;
6424 case GEOS_MULTIPOLYGON:
6425 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6426 break;
6427 case GEOS_GEOMETRYCOLLECTION:
6428 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6429 break;
6432 return resultobj;
6433 fail:
6434 return NULL;
6438 SWIGINTERN PyObject *_wrap_Geometry_boundary(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6439 PyObject *resultobj = 0;
6440 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6441 void *argp1 = 0 ;
6442 int res1 = 0 ;
6443 PyObject * obj0 = 0 ;
6444 GeosGeometry *result = 0 ;
6446 if(!PyArg_UnpackTuple(args,(char *)"Geometry_boundary",1,1,&obj0)) SWIG_fail;
6447 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6448 if (!SWIG_IsOK(res1)) {
6449 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_boundary" "', argument " "1"" of type '" "GeosGeometry *""'");
6451 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6455 result = (GeosGeometry *)GeosGeometry_boundary(arg1);
6457 catch (const std::exception& e)
6459 SWIG_exception(SWIG_RuntimeError, e.what());
6463 /* %typemap(out) GeosGeometry */
6465 if (result == NULL)
6466 SWIG_exception(SWIG_RuntimeError, message);
6468 GeosGeometry *geom = result;
6469 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6471 switch (geomId)
6473 case GEOS_POINT:
6474 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6475 break;
6476 case GEOS_LINESTRING:
6477 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6478 break;
6479 case GEOS_LINEARRING:
6480 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6481 break;
6482 case GEOS_POLYGON:
6483 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6484 break;
6485 case GEOS_MULTIPOINT:
6486 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6487 break;
6488 case GEOS_MULTILINESTRING:
6489 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6490 break;
6491 case GEOS_MULTIPOLYGON:
6492 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6493 break;
6494 case GEOS_GEOMETRYCOLLECTION:
6495 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6496 break;
6499 return resultobj;
6500 fail:
6501 return NULL;
6505 SWIGINTERN PyObject *_wrap_Geometry_union(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6506 PyObject *resultobj = 0;
6507 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6508 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
6509 void *argp1 = 0 ;
6510 int res1 = 0 ;
6511 void *argp2 = 0 ;
6512 int res2 = 0 ;
6513 PyObject * obj0 = 0 ;
6514 PyObject * obj1 = 0 ;
6515 GeosGeometry *result = 0 ;
6517 if(!PyArg_UnpackTuple(args,(char *)"Geometry_union",2,2,&obj0,&obj1)) SWIG_fail;
6518 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6519 if (!SWIG_IsOK(res1)) {
6520 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_union" "', argument " "1"" of type '" "GeosGeometry *""'");
6522 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6523 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6524 if (!SWIG_IsOK(res2)) {
6525 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_union" "', argument " "2"" of type '" "GeosGeometry *""'");
6527 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
6531 result = (GeosGeometry *)GeosGeometry_geomUnion(arg1,arg2);
6533 catch (const std::exception& e)
6535 SWIG_exception(SWIG_RuntimeError, e.what());
6539 /* %typemap(out) GeosGeometry */
6541 if (result == NULL)
6542 SWIG_exception(SWIG_RuntimeError, message);
6544 GeosGeometry *geom = result;
6545 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6547 switch (geomId)
6549 case GEOS_POINT:
6550 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6551 break;
6552 case GEOS_LINESTRING:
6553 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6554 break;
6555 case GEOS_LINEARRING:
6556 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6557 break;
6558 case GEOS_POLYGON:
6559 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6560 break;
6561 case GEOS_MULTIPOINT:
6562 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6563 break;
6564 case GEOS_MULTILINESTRING:
6565 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6566 break;
6567 case GEOS_MULTIPOLYGON:
6568 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6569 break;
6570 case GEOS_GEOMETRYCOLLECTION:
6571 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6572 break;
6575 return resultobj;
6576 fail:
6577 return NULL;
6581 SWIGINTERN PyObject *_wrap_Geometry_pointOnSurface(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6582 PyObject *resultobj = 0;
6583 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6584 void *argp1 = 0 ;
6585 int res1 = 0 ;
6586 PyObject * obj0 = 0 ;
6587 GeosGeometry *result = 0 ;
6589 if(!PyArg_UnpackTuple(args,(char *)"Geometry_pointOnSurface",1,1,&obj0)) SWIG_fail;
6590 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6591 if (!SWIG_IsOK(res1)) {
6592 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_pointOnSurface" "', argument " "1"" of type '" "GeosGeometry *""'");
6594 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6598 result = (GeosGeometry *)GeosGeometry_pointOnSurface(arg1);
6600 catch (const std::exception& e)
6602 SWIG_exception(SWIG_RuntimeError, e.what());
6606 /* %typemap(out) GeosGeometry */
6608 if (result == NULL)
6609 SWIG_exception(SWIG_RuntimeError, message);
6611 GeosGeometry *geom = result;
6612 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6614 switch (geomId)
6616 case GEOS_POINT:
6617 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6618 break;
6619 case GEOS_LINESTRING:
6620 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6621 break;
6622 case GEOS_LINEARRING:
6623 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6624 break;
6625 case GEOS_POLYGON:
6626 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6627 break;
6628 case GEOS_MULTIPOINT:
6629 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6630 break;
6631 case GEOS_MULTILINESTRING:
6632 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6633 break;
6634 case GEOS_MULTIPOLYGON:
6635 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6636 break;
6637 case GEOS_GEOMETRYCOLLECTION:
6638 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6639 break;
6642 return resultobj;
6643 fail:
6644 return NULL;
6648 SWIGINTERN PyObject *_wrap_Geometry_getCentroid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6649 PyObject *resultobj = 0;
6650 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6651 void *argp1 = 0 ;
6652 int res1 = 0 ;
6653 PyObject * obj0 = 0 ;
6654 GeosGeometry *result = 0 ;
6656 if(!PyArg_UnpackTuple(args,(char *)"Geometry_getCentroid",1,1,&obj0)) SWIG_fail;
6657 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6658 if (!SWIG_IsOK(res1)) {
6659 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getCentroid" "', argument " "1"" of type '" "GeosGeometry *""'");
6661 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6665 result = (GeosGeometry *)GeosGeometry_getCentroid(arg1);
6667 catch (const std::exception& e)
6669 SWIG_exception(SWIG_RuntimeError, e.what());
6673 /* %typemap(out) GeosGeometry */
6675 if (result == NULL)
6676 SWIG_exception(SWIG_RuntimeError, message);
6678 GeosGeometry *geom = result;
6679 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6681 switch (geomId)
6683 case GEOS_POINT:
6684 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6685 break;
6686 case GEOS_LINESTRING:
6687 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6688 break;
6689 case GEOS_LINEARRING:
6690 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6691 break;
6692 case GEOS_POLYGON:
6693 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6694 break;
6695 case GEOS_MULTIPOINT:
6696 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6697 break;
6698 case GEOS_MULTILINESTRING:
6699 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6700 break;
6701 case GEOS_MULTIPOLYGON:
6702 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6703 break;
6704 case GEOS_GEOMETRYCOLLECTION:
6705 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6706 break;
6709 return resultobj;
6710 fail:
6711 return NULL;
6715 SWIGINTERN PyObject *_wrap_Geometry_getEnvelope(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6716 PyObject *resultobj = 0;
6717 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6718 void *argp1 = 0 ;
6719 int res1 = 0 ;
6720 PyObject * obj0 = 0 ;
6721 GeosGeometry *result = 0 ;
6723 if(!PyArg_UnpackTuple(args,(char *)"Geometry_getEnvelope",1,1,&obj0)) SWIG_fail;
6724 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6725 if (!SWIG_IsOK(res1)) {
6726 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_getEnvelope" "', argument " "1"" of type '" "GeosGeometry *""'");
6728 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6732 result = (GeosGeometry *)GeosGeometry_getEnvelope(arg1);
6734 catch (const std::exception& e)
6736 SWIG_exception(SWIG_RuntimeError, e.what());
6740 /* %typemap(out) GeosGeometry */
6742 if (result == NULL)
6743 SWIG_exception(SWIG_RuntimeError, message);
6745 GeosGeometry *geom = result;
6746 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6748 switch (geomId)
6750 case GEOS_POINT:
6751 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
6752 break;
6753 case GEOS_LINESTRING:
6754 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
6755 break;
6756 case GEOS_LINEARRING:
6757 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
6758 break;
6759 case GEOS_POLYGON:
6760 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
6761 break;
6762 case GEOS_MULTIPOINT:
6763 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
6764 break;
6765 case GEOS_MULTILINESTRING:
6766 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
6767 break;
6768 case GEOS_MULTIPOLYGON:
6769 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
6770 break;
6771 case GEOS_GEOMETRYCOLLECTION:
6772 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
6773 break;
6776 return resultobj;
6777 fail:
6778 return NULL;
6782 SWIGINTERN PyObject *_wrap_Geometry_relate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6783 PyObject *resultobj = 0;
6784 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6785 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
6786 void *argp1 = 0 ;
6787 int res1 = 0 ;
6788 void *argp2 = 0 ;
6789 int res2 = 0 ;
6790 PyObject * obj0 = 0 ;
6791 PyObject * obj1 = 0 ;
6792 char *result = 0 ;
6794 if(!PyArg_UnpackTuple(args,(char *)"Geometry_relate",2,2,&obj0,&obj1)) SWIG_fail;
6795 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6796 if (!SWIG_IsOK(res1)) {
6797 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_relate" "', argument " "1"" of type '" "GeosGeometry *""'");
6799 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6800 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6801 if (!SWIG_IsOK(res2)) {
6802 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_relate" "', argument " "2"" of type '" "GeosGeometry *""'");
6804 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
6808 result = (char *)GeosGeometry_relate(arg1,arg2);
6810 catch (const std::exception& e)
6812 SWIG_exception(SWIG_RuntimeError, e.what());
6815 resultobj = SWIG_FromCharPtr((const char *)result);
6816 delete[] result;
6817 return resultobj;
6818 fail:
6819 return NULL;
6823 SWIGINTERN PyObject *_wrap_Geometry_lineMerge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6824 PyObject *resultobj = 0;
6825 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6826 void *argp1 = 0 ;
6827 int res1 = 0 ;
6828 PyObject * obj0 = 0 ;
6829 GeosGeometry *result = 0 ;
6831 if(!PyArg_UnpackTuple(args,(char *)"Geometry_lineMerge",1,1,&obj0)) SWIG_fail;
6832 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6833 if (!SWIG_IsOK(res1)) {
6834 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_lineMerge" "', argument " "1"" of type '" "GeosGeometry *""'");
6836 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6840 result = (GeosGeometry *)GeosGeometry_lineMerge(arg1);
6842 catch (const std::exception& e)
6844 SWIG_exception(SWIG_RuntimeError, e.what());
6848 /* %typemap(out) GeosGeometry */
6850 if (result == NULL)
6851 SWIG_exception(SWIG_RuntimeError, message);
6853 GeosGeometry *geom = result;
6854 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6856 switch (geomId)
6858 case GEOS_POINT:
6859 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6860 break;
6861 case GEOS_LINESTRING:
6862 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6863 break;
6864 case GEOS_LINEARRING:
6865 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6866 break;
6867 case GEOS_POLYGON:
6868 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6869 break;
6870 case GEOS_MULTIPOINT:
6871 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6872 break;
6873 case GEOS_MULTILINESTRING:
6874 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6875 break;
6876 case GEOS_MULTIPOLYGON:
6877 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6878 break;
6879 case GEOS_GEOMETRYCOLLECTION:
6880 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6881 break;
6884 return resultobj;
6885 fail:
6886 return NULL;
6890 SWIGINTERN PyObject *_wrap_Geometry_simplify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6891 PyObject *resultobj = 0;
6892 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6893 double arg2 ;
6894 void *argp1 = 0 ;
6895 int res1 = 0 ;
6896 double val2 ;
6897 int ecode2 = 0 ;
6898 PyObject * obj0 = 0 ;
6899 PyObject * obj1 = 0 ;
6900 GeosGeometry *result = 0 ;
6902 if(!PyArg_UnpackTuple(args,(char *)"Geometry_simplify",2,2,&obj0,&obj1)) SWIG_fail;
6903 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6904 if (!SWIG_IsOK(res1)) {
6905 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_simplify" "', argument " "1"" of type '" "GeosGeometry *""'");
6907 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6908 ecode2 = SWIG_AsVal_double(obj1, &val2);
6909 if (!SWIG_IsOK(ecode2)) {
6910 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_simplify" "', argument " "2"" of type '" "double""'");
6912 arg2 = static_cast< double >(val2);
6916 result = (GeosGeometry *)GeosGeometry_simplify(arg1,arg2);
6918 catch (const std::exception& e)
6920 SWIG_exception(SWIG_RuntimeError, e.what());
6924 /* %typemap(out) GeosGeometry */
6926 if (result == NULL)
6927 SWIG_exception(SWIG_RuntimeError, message);
6929 GeosGeometry *geom = result;
6930 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
6932 switch (geomId)
6934 case GEOS_POINT:
6935 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
6936 break;
6937 case GEOS_LINESTRING:
6938 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
6939 break;
6940 case GEOS_LINEARRING:
6941 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
6942 break;
6943 case GEOS_POLYGON:
6944 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
6945 break;
6946 case GEOS_MULTIPOINT:
6947 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
6948 break;
6949 case GEOS_MULTILINESTRING:
6950 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
6951 break;
6952 case GEOS_MULTIPOLYGON:
6953 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
6954 break;
6955 case GEOS_GEOMETRYCOLLECTION:
6956 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
6957 break;
6960 return resultobj;
6961 fail:
6962 return NULL;
6966 SWIGINTERN PyObject *_wrap_Geometry_topologyPreserveSimplify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
6967 PyObject *resultobj = 0;
6968 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
6969 double arg2 ;
6970 void *argp1 = 0 ;
6971 int res1 = 0 ;
6972 double val2 ;
6973 int ecode2 = 0 ;
6974 PyObject * obj0 = 0 ;
6975 PyObject * obj1 = 0 ;
6976 GeosGeometry *result = 0 ;
6978 if(!PyArg_UnpackTuple(args,(char *)"Geometry_topologyPreserveSimplify",2,2,&obj0,&obj1)) SWIG_fail;
6979 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
6980 if (!SWIG_IsOK(res1)) {
6981 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_topologyPreserveSimplify" "', argument " "1"" of type '" "GeosGeometry *""'");
6983 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
6984 ecode2 = SWIG_AsVal_double(obj1, &val2);
6985 if (!SWIG_IsOK(ecode2)) {
6986 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Geometry_topologyPreserveSimplify" "', argument " "2"" of type '" "double""'");
6988 arg2 = static_cast< double >(val2);
6992 result = (GeosGeometry *)GeosGeometry_topologyPreserveSimplify(arg1,arg2);
6994 catch (const std::exception& e)
6996 SWIG_exception(SWIG_RuntimeError, e.what());
7000 /* %typemap(out) GeosGeometry */
7002 if (result == NULL)
7003 SWIG_exception(SWIG_RuntimeError, message);
7005 GeosGeometry *geom = result;
7006 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
7008 switch (geomId)
7010 case GEOS_POINT:
7011 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
7012 break;
7013 case GEOS_LINESTRING:
7014 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
7015 break;
7016 case GEOS_LINEARRING:
7017 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
7018 break;
7019 case GEOS_POLYGON:
7020 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
7021 break;
7022 case GEOS_MULTIPOINT:
7023 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
7024 break;
7025 case GEOS_MULTILINESTRING:
7026 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
7027 break;
7028 case GEOS_MULTIPOLYGON:
7029 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
7030 break;
7031 case GEOS_GEOMETRYCOLLECTION:
7032 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
7033 break;
7036 return resultobj;
7037 fail:
7038 return NULL;
7042 SWIGINTERN PyObject *_wrap_Geometry_relatePattern(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7043 PyObject *resultobj = 0;
7044 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7045 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7046 char *arg3 = (char *) 0 ;
7047 void *argp1 = 0 ;
7048 int res1 = 0 ;
7049 void *argp2 = 0 ;
7050 int res2 = 0 ;
7051 int res3 ;
7052 char *buf3 = 0 ;
7053 int alloc3 = 0 ;
7054 PyObject * obj0 = 0 ;
7055 PyObject * obj1 = 0 ;
7056 PyObject * obj2 = 0 ;
7057 bool result;
7059 if(!PyArg_UnpackTuple(args,(char *)"Geometry_relatePattern",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
7060 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7061 if (!SWIG_IsOK(res1)) {
7062 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_relatePattern" "', argument " "1"" of type '" "GeosGeometry *""'");
7064 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7065 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7066 if (!SWIG_IsOK(res2)) {
7067 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_relatePattern" "', argument " "2"" of type '" "GeosGeometry const *""'");
7069 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7070 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
7071 if (!SWIG_IsOK(res3)) {
7072 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Geometry_relatePattern" "', argument " "3"" of type '" "char const *""'");
7074 arg3 = reinterpret_cast< char * >(buf3);
7078 result = (bool)GeosGeometry_relatePattern(arg1,(GeosGeometry const *)arg2,(char const *)arg3);
7080 catch (const std::exception& e)
7082 SWIG_exception(SWIG_RuntimeError, e.what());
7085 resultobj = SWIG_From_bool(static_cast< bool >(result));
7086 if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
7087 return resultobj;
7088 fail:
7089 if (alloc3 == SWIG_NEWOBJ) delete[] buf3;
7090 return NULL;
7094 SWIGINTERN PyObject *_wrap_Geometry_disjoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7095 PyObject *resultobj = 0;
7096 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7097 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7098 void *argp1 = 0 ;
7099 int res1 = 0 ;
7100 void *argp2 = 0 ;
7101 int res2 = 0 ;
7102 PyObject * obj0 = 0 ;
7103 PyObject * obj1 = 0 ;
7104 bool result;
7106 if(!PyArg_UnpackTuple(args,(char *)"Geometry_disjoint",2,2,&obj0,&obj1)) SWIG_fail;
7107 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7108 if (!SWIG_IsOK(res1)) {
7109 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_disjoint" "', argument " "1"" of type '" "GeosGeometry *""'");
7111 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7112 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7113 if (!SWIG_IsOK(res2)) {
7114 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_disjoint" "', argument " "2"" of type '" "GeosGeometry const *""'");
7116 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7120 result = (bool)GeosGeometry_disjoint(arg1,(GeosGeometry const *)arg2);
7122 catch (const std::exception& e)
7124 SWIG_exception(SWIG_RuntimeError, e.what());
7127 resultobj = SWIG_From_bool(static_cast< bool >(result));
7128 return resultobj;
7129 fail:
7130 return NULL;
7134 SWIGINTERN PyObject *_wrap_Geometry_touches(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7135 PyObject *resultobj = 0;
7136 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7137 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7138 void *argp1 = 0 ;
7139 int res1 = 0 ;
7140 void *argp2 = 0 ;
7141 int res2 = 0 ;
7142 PyObject * obj0 = 0 ;
7143 PyObject * obj1 = 0 ;
7144 bool result;
7146 if(!PyArg_UnpackTuple(args,(char *)"Geometry_touches",2,2,&obj0,&obj1)) SWIG_fail;
7147 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7148 if (!SWIG_IsOK(res1)) {
7149 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_touches" "', argument " "1"" of type '" "GeosGeometry *""'");
7151 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7152 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7153 if (!SWIG_IsOK(res2)) {
7154 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_touches" "', argument " "2"" of type '" "GeosGeometry const *""'");
7156 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7160 result = (bool)GeosGeometry_touches(arg1,(GeosGeometry const *)arg2);
7162 catch (const std::exception& e)
7164 SWIG_exception(SWIG_RuntimeError, e.what());
7167 resultobj = SWIG_From_bool(static_cast< bool >(result));
7168 return resultobj;
7169 fail:
7170 return NULL;
7174 SWIGINTERN PyObject *_wrap_Geometry_intersects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7175 PyObject *resultobj = 0;
7176 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7177 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7178 void *argp1 = 0 ;
7179 int res1 = 0 ;
7180 void *argp2 = 0 ;
7181 int res2 = 0 ;
7182 PyObject * obj0 = 0 ;
7183 PyObject * obj1 = 0 ;
7184 bool result;
7186 if(!PyArg_UnpackTuple(args,(char *)"Geometry_intersects",2,2,&obj0,&obj1)) SWIG_fail;
7187 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7188 if (!SWIG_IsOK(res1)) {
7189 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_intersects" "', argument " "1"" of type '" "GeosGeometry *""'");
7191 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7192 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7193 if (!SWIG_IsOK(res2)) {
7194 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_intersects" "', argument " "2"" of type '" "GeosGeometry const *""'");
7196 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7200 result = (bool)GeosGeometry_intersects(arg1,(GeosGeometry const *)arg2);
7202 catch (const std::exception& e)
7204 SWIG_exception(SWIG_RuntimeError, e.what());
7207 resultobj = SWIG_From_bool(static_cast< bool >(result));
7208 return resultobj;
7209 fail:
7210 return NULL;
7214 SWIGINTERN PyObject *_wrap_Geometry_crosses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7215 PyObject *resultobj = 0;
7216 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7217 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7218 void *argp1 = 0 ;
7219 int res1 = 0 ;
7220 void *argp2 = 0 ;
7221 int res2 = 0 ;
7222 PyObject * obj0 = 0 ;
7223 PyObject * obj1 = 0 ;
7224 bool result;
7226 if(!PyArg_UnpackTuple(args,(char *)"Geometry_crosses",2,2,&obj0,&obj1)) SWIG_fail;
7227 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7228 if (!SWIG_IsOK(res1)) {
7229 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_crosses" "', argument " "1"" of type '" "GeosGeometry *""'");
7231 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7232 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7233 if (!SWIG_IsOK(res2)) {
7234 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_crosses" "', argument " "2"" of type '" "GeosGeometry const *""'");
7236 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7240 result = (bool)GeosGeometry_crosses(arg1,(GeosGeometry const *)arg2);
7242 catch (const std::exception& e)
7244 SWIG_exception(SWIG_RuntimeError, e.what());
7247 resultobj = SWIG_From_bool(static_cast< bool >(result));
7248 return resultobj;
7249 fail:
7250 return NULL;
7254 SWIGINTERN PyObject *_wrap_Geometry_within(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7255 PyObject *resultobj = 0;
7256 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7257 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7258 void *argp1 = 0 ;
7259 int res1 = 0 ;
7260 void *argp2 = 0 ;
7261 int res2 = 0 ;
7262 PyObject * obj0 = 0 ;
7263 PyObject * obj1 = 0 ;
7264 bool result;
7266 if(!PyArg_UnpackTuple(args,(char *)"Geometry_within",2,2,&obj0,&obj1)) SWIG_fail;
7267 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7268 if (!SWIG_IsOK(res1)) {
7269 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_within" "', argument " "1"" of type '" "GeosGeometry *""'");
7271 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7272 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7273 if (!SWIG_IsOK(res2)) {
7274 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_within" "', argument " "2"" of type '" "GeosGeometry const *""'");
7276 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7280 result = (bool)GeosGeometry_within(arg1,(GeosGeometry const *)arg2);
7282 catch (const std::exception& e)
7284 SWIG_exception(SWIG_RuntimeError, e.what());
7287 resultobj = SWIG_From_bool(static_cast< bool >(result));
7288 return resultobj;
7289 fail:
7290 return NULL;
7294 SWIGINTERN PyObject *_wrap_Geometry_contains(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7295 PyObject *resultobj = 0;
7296 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7297 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7298 void *argp1 = 0 ;
7299 int res1 = 0 ;
7300 void *argp2 = 0 ;
7301 int res2 = 0 ;
7302 PyObject * obj0 = 0 ;
7303 PyObject * obj1 = 0 ;
7304 bool result;
7306 if(!PyArg_UnpackTuple(args,(char *)"Geometry_contains",2,2,&obj0,&obj1)) SWIG_fail;
7307 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7308 if (!SWIG_IsOK(res1)) {
7309 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_contains" "', argument " "1"" of type '" "GeosGeometry *""'");
7311 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7312 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7313 if (!SWIG_IsOK(res2)) {
7314 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_contains" "', argument " "2"" of type '" "GeosGeometry const *""'");
7316 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7320 result = (bool)GeosGeometry_contains(arg1,(GeosGeometry const *)arg2);
7322 catch (const std::exception& e)
7324 SWIG_exception(SWIG_RuntimeError, e.what());
7327 resultobj = SWIG_From_bool(static_cast< bool >(result));
7328 return resultobj;
7329 fail:
7330 return NULL;
7334 SWIGINTERN PyObject *_wrap_Geometry_overlaps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7335 PyObject *resultobj = 0;
7336 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7337 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7338 void *argp1 = 0 ;
7339 int res1 = 0 ;
7340 void *argp2 = 0 ;
7341 int res2 = 0 ;
7342 PyObject * obj0 = 0 ;
7343 PyObject * obj1 = 0 ;
7344 bool result;
7346 if(!PyArg_UnpackTuple(args,(char *)"Geometry_overlaps",2,2,&obj0,&obj1)) SWIG_fail;
7347 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7348 if (!SWIG_IsOK(res1)) {
7349 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_overlaps" "', argument " "1"" of type '" "GeosGeometry *""'");
7351 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7352 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7353 if (!SWIG_IsOK(res2)) {
7354 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_overlaps" "', argument " "2"" of type '" "GeosGeometry const *""'");
7356 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7360 result = (bool)GeosGeometry_overlaps(arg1,(GeosGeometry const *)arg2);
7362 catch (const std::exception& e)
7364 SWIG_exception(SWIG_RuntimeError, e.what());
7367 resultobj = SWIG_From_bool(static_cast< bool >(result));
7368 return resultobj;
7369 fail:
7370 return NULL;
7374 SWIGINTERN PyObject *_wrap_Geometry_equals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7375 PyObject *resultobj = 0;
7376 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7377 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7378 void *argp1 = 0 ;
7379 int res1 = 0 ;
7380 void *argp2 = 0 ;
7381 int res2 = 0 ;
7382 PyObject * obj0 = 0 ;
7383 PyObject * obj1 = 0 ;
7384 bool result;
7386 if(!PyArg_UnpackTuple(args,(char *)"Geometry_equals",2,2,&obj0,&obj1)) SWIG_fail;
7387 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7388 if (!SWIG_IsOK(res1)) {
7389 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_equals" "', argument " "1"" of type '" "GeosGeometry *""'");
7391 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7392 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7393 if (!SWIG_IsOK(res2)) {
7394 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_equals" "', argument " "2"" of type '" "GeosGeometry const *""'");
7396 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7400 result = (bool)GeosGeometry_equals(arg1,(GeosGeometry const *)arg2);
7402 catch (const std::exception& e)
7404 SWIG_exception(SWIG_RuntimeError, e.what());
7407 resultobj = SWIG_From_bool(static_cast< bool >(result));
7408 return resultobj;
7409 fail:
7410 return NULL;
7414 SWIGINTERN PyObject *_wrap_Geometry_equalsExact(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7415 PyObject *resultobj = 0;
7416 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7417 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7418 double arg3 ;
7419 void *argp1 = 0 ;
7420 int res1 = 0 ;
7421 void *argp2 = 0 ;
7422 int res2 = 0 ;
7423 double val3 ;
7424 int ecode3 = 0 ;
7425 PyObject * obj0 = 0 ;
7426 PyObject * obj1 = 0 ;
7427 PyObject * obj2 = 0 ;
7428 bool result;
7430 if(!PyArg_UnpackTuple(args,(char *)"Geometry_equalsExact",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
7431 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7432 if (!SWIG_IsOK(res1)) {
7433 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_equalsExact" "', argument " "1"" of type '" "GeosGeometry *""'");
7435 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7436 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7437 if (!SWIG_IsOK(res2)) {
7438 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_equalsExact" "', argument " "2"" of type '" "GeosGeometry const *""'");
7440 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7441 ecode3 = SWIG_AsVal_double(obj2, &val3);
7442 if (!SWIG_IsOK(ecode3)) {
7443 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Geometry_equalsExact" "', argument " "3"" of type '" "double""'");
7445 arg3 = static_cast< double >(val3);
7449 result = (bool)GeosGeometry_equalsExact(arg1,(GeosGeometry const *)arg2,arg3);
7451 catch (const std::exception& e)
7453 SWIG_exception(SWIG_RuntimeError, e.what());
7456 resultobj = SWIG_From_bool(static_cast< bool >(result));
7457 return resultobj;
7458 fail:
7459 return NULL;
7463 SWIGINTERN PyObject *_wrap_Geometry_isEmpty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7464 PyObject *resultobj = 0;
7465 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7466 void *argp1 = 0 ;
7467 int res1 = 0 ;
7468 PyObject * obj0 = 0 ;
7469 bool result;
7471 if(!PyArg_UnpackTuple(args,(char *)"Geometry_isEmpty",1,1,&obj0)) SWIG_fail;
7472 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7473 if (!SWIG_IsOK(res1)) {
7474 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isEmpty" "', argument " "1"" of type '" "GeosGeometry *""'");
7476 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7480 result = (bool)GeosGeometry_isEmpty(arg1);
7482 catch (const std::exception& e)
7484 SWIG_exception(SWIG_RuntimeError, e.what());
7487 resultobj = SWIG_From_bool(static_cast< bool >(result));
7488 return resultobj;
7489 fail:
7490 return NULL;
7494 SWIGINTERN PyObject *_wrap_Geometry_isValid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7495 PyObject *resultobj = 0;
7496 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7497 void *argp1 = 0 ;
7498 int res1 = 0 ;
7499 PyObject * obj0 = 0 ;
7500 bool result;
7502 if(!PyArg_UnpackTuple(args,(char *)"Geometry_isValid",1,1,&obj0)) SWIG_fail;
7503 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7504 if (!SWIG_IsOK(res1)) {
7505 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isValid" "', argument " "1"" of type '" "GeosGeometry *""'");
7507 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7511 result = (bool)GeosGeometry_isValid(arg1);
7513 catch (const std::exception& e)
7515 SWIG_exception(SWIG_RuntimeError, e.what());
7518 resultobj = SWIG_From_bool(static_cast< bool >(result));
7519 return resultobj;
7520 fail:
7521 return NULL;
7525 SWIGINTERN PyObject *_wrap_Geometry_isSimple(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7526 PyObject *resultobj = 0;
7527 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7528 void *argp1 = 0 ;
7529 int res1 = 0 ;
7530 PyObject * obj0 = 0 ;
7531 bool result;
7533 if(!PyArg_UnpackTuple(args,(char *)"Geometry_isSimple",1,1,&obj0)) SWIG_fail;
7534 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7535 if (!SWIG_IsOK(res1)) {
7536 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isSimple" "', argument " "1"" of type '" "GeosGeometry *""'");
7538 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7542 result = (bool)GeosGeometry_isSimple(arg1);
7544 catch (const std::exception& e)
7546 SWIG_exception(SWIG_RuntimeError, e.what());
7549 resultobj = SWIG_From_bool(static_cast< bool >(result));
7550 return resultobj;
7551 fail:
7552 return NULL;
7556 SWIGINTERN PyObject *_wrap_Geometry_isRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7557 PyObject *resultobj = 0;
7558 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7559 void *argp1 = 0 ;
7560 int res1 = 0 ;
7561 PyObject * obj0 = 0 ;
7562 bool result;
7564 if(!PyArg_UnpackTuple(args,(char *)"Geometry_isRing",1,1,&obj0)) SWIG_fail;
7565 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7566 if (!SWIG_IsOK(res1)) {
7567 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_isRing" "', argument " "1"" of type '" "GeosGeometry *""'");
7569 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7573 result = (bool)GeosGeometry_isRing(arg1);
7575 catch (const std::exception& e)
7577 SWIG_exception(SWIG_RuntimeError, e.what());
7580 resultobj = SWIG_From_bool(static_cast< bool >(result));
7581 return resultobj;
7582 fail:
7583 return NULL;
7587 SWIGINTERN PyObject *_wrap_Geometry_hasZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7588 PyObject *resultobj = 0;
7589 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7590 void *argp1 = 0 ;
7591 int res1 = 0 ;
7592 PyObject * obj0 = 0 ;
7593 bool result;
7595 if(!PyArg_UnpackTuple(args,(char *)"Geometry_hasZ",1,1,&obj0)) SWIG_fail;
7596 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7597 if (!SWIG_IsOK(res1)) {
7598 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_hasZ" "', argument " "1"" of type '" "GeosGeometry *""'");
7600 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7604 result = (bool)GeosGeometry_hasZ(arg1);
7606 catch (const std::exception& e)
7608 SWIG_exception(SWIG_RuntimeError, e.what());
7611 resultobj = SWIG_From_bool(static_cast< bool >(result));
7612 return resultobj;
7613 fail:
7614 return NULL;
7618 SWIGINTERN PyObject *_wrap_Geometry_area(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7619 PyObject *resultobj = 0;
7620 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7621 void *argp1 = 0 ;
7622 int res1 = 0 ;
7623 PyObject * obj0 = 0 ;
7624 double result;
7626 if(!PyArg_UnpackTuple(args,(char *)"Geometry_area",1,1,&obj0)) SWIG_fail;
7627 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7628 if (!SWIG_IsOK(res1)) {
7629 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_area" "', argument " "1"" of type '" "GeosGeometry *""'");
7631 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7635 result = (double)GeosGeometry_area(arg1);
7637 catch (const std::exception& e)
7639 SWIG_exception(SWIG_RuntimeError, e.what());
7642 resultobj = SWIG_From_double(static_cast< double >(result));
7643 return resultobj;
7644 fail:
7645 return NULL;
7649 SWIGINTERN PyObject *_wrap_Geometry_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7650 PyObject *resultobj = 0;
7651 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7652 void *argp1 = 0 ;
7653 int res1 = 0 ;
7654 PyObject * obj0 = 0 ;
7655 double result;
7657 if(!PyArg_UnpackTuple(args,(char *)"Geometry_length",1,1,&obj0)) SWIG_fail;
7658 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7659 if (!SWIG_IsOK(res1)) {
7660 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_length" "', argument " "1"" of type '" "GeosGeometry *""'");
7662 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7666 result = (double)GeosGeometry_length(arg1);
7668 catch (const std::exception& e)
7670 SWIG_exception(SWIG_RuntimeError, e.what());
7673 resultobj = SWIG_From_double(static_cast< double >(result));
7674 return resultobj;
7675 fail:
7676 return NULL;
7680 SWIGINTERN PyObject *_wrap_Geometry_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7681 PyObject *resultobj = 0;
7682 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
7683 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
7684 void *argp1 = 0 ;
7685 int res1 = 0 ;
7686 void *argp2 = 0 ;
7687 int res2 = 0 ;
7688 PyObject * obj0 = 0 ;
7689 PyObject * obj1 = 0 ;
7690 double result;
7692 if(!PyArg_UnpackTuple(args,(char *)"Geometry_distance",2,2,&obj0,&obj1)) SWIG_fail;
7693 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7694 if (!SWIG_IsOK(res1)) {
7695 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Geometry_distance" "', argument " "1"" of type '" "GeosGeometry *""'");
7697 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
7698 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
7699 if (!SWIG_IsOK(res2)) {
7700 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Geometry_distance" "', argument " "2"" of type '" "GeosGeometry const *""'");
7702 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
7706 result = (double)GeosGeometry_distance(arg1,(GeosGeometry const *)arg2);
7708 catch (const std::exception& e)
7710 SWIG_exception(SWIG_RuntimeError, e.what());
7713 resultobj = SWIG_From_double(static_cast< double >(result));
7714 return resultobj;
7715 fail:
7716 return NULL;
7720 SWIGINTERN PyObject *Geometry_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7721 PyObject *obj;
7722 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
7723 SWIG_TypeNewClientData(SWIGTYPE_p_GeosGeometry, SWIG_NewClientData(obj));
7724 return SWIG_Py_Void();
7727 SWIGINTERN PyObject *_wrap_delete_Point(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7728 PyObject *resultobj = 0;
7729 GeosPoint *arg1 = (GeosPoint *) 0 ;
7730 void *argp1 = 0 ;
7731 int res1 = 0 ;
7732 PyObject * obj0 = 0 ;
7734 if(!PyArg_UnpackTuple(args,(char *)"delete_Point",1,1,&obj0)) SWIG_fail;
7735 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPoint, SWIG_POINTER_DISOWN | 0 );
7736 if (!SWIG_IsOK(res1)) {
7737 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Point" "', argument " "1"" of type '" "GeosPoint *""'");
7739 arg1 = reinterpret_cast< GeosPoint * >(argp1);
7743 delete_GeosPoint(arg1);
7745 catch (const std::exception& e)
7747 SWIG_exception(SWIG_RuntimeError, e.what());
7750 resultobj = SWIG_Py_Void();
7751 return resultobj;
7752 fail:
7753 return NULL;
7757 SWIGINTERN PyObject *_wrap_Point_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7758 PyObject *resultobj = 0;
7759 GeosPoint *arg1 = (GeosPoint *) 0 ;
7760 void *argp1 = 0 ;
7761 int res1 = 0 ;
7762 PyObject * obj0 = 0 ;
7763 GeosCoordinateSequence *result = 0 ;
7765 if(!PyArg_UnpackTuple(args,(char *)"Point_getCoordSeq",1,1,&obj0)) SWIG_fail;
7766 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPoint, 0 | 0 );
7767 if (!SWIG_IsOK(res1)) {
7768 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Point_getCoordSeq" "', argument " "1"" of type '" "GeosPoint *""'");
7770 arg1 = reinterpret_cast< GeosPoint * >(argp1);
7774 result = (GeosCoordinateSequence *)GeosPoint_getCoordSeq(arg1);
7776 catch (const std::exception& e)
7778 SWIG_exception(SWIG_RuntimeError, e.what());
7781 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
7782 return resultobj;
7783 fail:
7784 return NULL;
7788 SWIGINTERN PyObject *Point_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7789 PyObject *obj;
7790 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
7791 SWIG_TypeNewClientData(SWIGTYPE_p_GeosPoint, SWIG_NewClientData(obj));
7792 return SWIG_Py_Void();
7795 SWIGINTERN PyObject *_wrap_delete_LineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7796 PyObject *resultobj = 0;
7797 GeosLineString *arg1 = (GeosLineString *) 0 ;
7798 void *argp1 = 0 ;
7799 int res1 = 0 ;
7800 PyObject * obj0 = 0 ;
7802 if(!PyArg_UnpackTuple(args,(char *)"delete_LineString",1,1,&obj0)) SWIG_fail;
7803 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLineString, SWIG_POINTER_DISOWN | 0 );
7804 if (!SWIG_IsOK(res1)) {
7805 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LineString" "', argument " "1"" of type '" "GeosLineString *""'");
7807 arg1 = reinterpret_cast< GeosLineString * >(argp1);
7811 delete_GeosLineString(arg1);
7813 catch (const std::exception& e)
7815 SWIG_exception(SWIG_RuntimeError, e.what());
7818 resultobj = SWIG_Py_Void();
7819 return resultobj;
7820 fail:
7821 return NULL;
7825 SWIGINTERN PyObject *_wrap_LineString_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7826 PyObject *resultobj = 0;
7827 GeosLineString *arg1 = (GeosLineString *) 0 ;
7828 void *argp1 = 0 ;
7829 int res1 = 0 ;
7830 PyObject * obj0 = 0 ;
7831 GeosCoordinateSequence *result = 0 ;
7833 if(!PyArg_UnpackTuple(args,(char *)"LineString_getCoordSeq",1,1,&obj0)) SWIG_fail;
7834 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLineString, 0 | 0 );
7835 if (!SWIG_IsOK(res1)) {
7836 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LineString_getCoordSeq" "', argument " "1"" of type '" "GeosLineString *""'");
7838 arg1 = reinterpret_cast< GeosLineString * >(argp1);
7842 result = (GeosCoordinateSequence *)GeosLineString_getCoordSeq(arg1);
7844 catch (const std::exception& e)
7846 SWIG_exception(SWIG_RuntimeError, e.what());
7849 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
7850 return resultobj;
7851 fail:
7852 return NULL;
7856 SWIGINTERN PyObject *LineString_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7857 PyObject *obj;
7858 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
7859 SWIG_TypeNewClientData(SWIGTYPE_p_GeosLineString, SWIG_NewClientData(obj));
7860 return SWIG_Py_Void();
7863 SWIGINTERN PyObject *_wrap_delete_LinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7864 PyObject *resultobj = 0;
7865 GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
7866 void *argp1 = 0 ;
7867 int res1 = 0 ;
7868 PyObject * obj0 = 0 ;
7870 if(!PyArg_UnpackTuple(args,(char *)"delete_LinearRing",1,1,&obj0)) SWIG_fail;
7871 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN | 0 );
7872 if (!SWIG_IsOK(res1)) {
7873 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_LinearRing" "', argument " "1"" of type '" "GeosLinearRing *""'");
7875 arg1 = reinterpret_cast< GeosLinearRing * >(argp1);
7879 delete_GeosLinearRing(arg1);
7881 catch (const std::exception& e)
7883 SWIG_exception(SWIG_RuntimeError, e.what());
7886 resultobj = SWIG_Py_Void();
7887 return resultobj;
7888 fail:
7889 return NULL;
7893 SWIGINTERN PyObject *_wrap_LinearRing_getCoordSeq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7894 PyObject *resultobj = 0;
7895 GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
7896 void *argp1 = 0 ;
7897 int res1 = 0 ;
7898 PyObject * obj0 = 0 ;
7899 GeosCoordinateSequence *result = 0 ;
7901 if(!PyArg_UnpackTuple(args,(char *)"LinearRing_getCoordSeq",1,1,&obj0)) SWIG_fail;
7902 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosLinearRing, 0 | 0 );
7903 if (!SWIG_IsOK(res1)) {
7904 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "LinearRing_getCoordSeq" "', argument " "1"" of type '" "GeosLinearRing *""'");
7906 arg1 = reinterpret_cast< GeosLinearRing * >(argp1);
7910 result = (GeosCoordinateSequence *)GeosLinearRing_getCoordSeq(arg1);
7912 catch (const std::exception& e)
7914 SWIG_exception(SWIG_RuntimeError, e.what());
7917 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosCoordinateSequence, 0 | 0 );
7918 return resultobj;
7919 fail:
7920 return NULL;
7924 SWIGINTERN PyObject *LinearRing_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7925 PyObject *obj;
7926 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
7927 SWIG_TypeNewClientData(SWIGTYPE_p_GeosLinearRing, SWIG_NewClientData(obj));
7928 return SWIG_Py_Void();
7931 SWIGINTERN PyObject *_wrap_delete_Polygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7932 PyObject *resultobj = 0;
7933 GeosPolygon *arg1 = (GeosPolygon *) 0 ;
7934 void *argp1 = 0 ;
7935 int res1 = 0 ;
7936 PyObject * obj0 = 0 ;
7938 if(!PyArg_UnpackTuple(args,(char *)"delete_Polygon",1,1,&obj0)) SWIG_fail;
7939 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, SWIG_POINTER_DISOWN | 0 );
7940 if (!SWIG_IsOK(res1)) {
7941 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Polygon" "', argument " "1"" of type '" "GeosPolygon *""'");
7943 arg1 = reinterpret_cast< GeosPolygon * >(argp1);
7947 delete_GeosPolygon(arg1);
7949 catch (const std::exception& e)
7951 SWIG_exception(SWIG_RuntimeError, e.what());
7954 resultobj = SWIG_Py_Void();
7955 return resultobj;
7956 fail:
7957 return NULL;
7961 SWIGINTERN PyObject *_wrap_Polygon_getExteriorRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
7962 PyObject *resultobj = 0;
7963 GeosPolygon *arg1 = (GeosPolygon *) 0 ;
7964 void *argp1 = 0 ;
7965 int res1 = 0 ;
7966 PyObject * obj0 = 0 ;
7967 GeosGeometry *result = 0 ;
7969 if(!PyArg_UnpackTuple(args,(char *)"Polygon_getExteriorRing",1,1,&obj0)) SWIG_fail;
7970 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 | 0 );
7971 if (!SWIG_IsOK(res1)) {
7972 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getExteriorRing" "', argument " "1"" of type '" "GeosPolygon *""'");
7974 arg1 = reinterpret_cast< GeosPolygon * >(argp1);
7978 result = (GeosGeometry *)GeosPolygon_getExteriorRing(arg1);
7980 catch (const std::exception& e)
7982 SWIG_exception(SWIG_RuntimeError, e.what());
7986 /* %typemap(out) GeosGeometry */
7988 if (result == NULL)
7989 SWIG_exception(SWIG_RuntimeError, message);
7991 GeosGeometry *geom = result;
7992 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
7994 switch (geomId)
7996 case GEOS_POINT:
7997 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
7998 break;
7999 case GEOS_LINESTRING:
8000 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
8001 break;
8002 case GEOS_LINEARRING:
8003 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
8004 break;
8005 case GEOS_POLYGON:
8006 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
8007 break;
8008 case GEOS_MULTIPOINT:
8009 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
8010 break;
8011 case GEOS_MULTILINESTRING:
8012 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
8013 break;
8014 case GEOS_MULTIPOLYGON:
8015 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
8016 break;
8017 case GEOS_GEOMETRYCOLLECTION:
8018 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
8019 break;
8022 return resultobj;
8023 fail:
8024 return NULL;
8028 SWIGINTERN PyObject *_wrap_Polygon_getNumInteriorRings(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8029 PyObject *resultobj = 0;
8030 GeosPolygon *arg1 = (GeosPolygon *) 0 ;
8031 void *argp1 = 0 ;
8032 int res1 = 0 ;
8033 PyObject * obj0 = 0 ;
8034 size_t result;
8036 if(!PyArg_UnpackTuple(args,(char *)"Polygon_getNumInteriorRings",1,1,&obj0)) SWIG_fail;
8037 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 | 0 );
8038 if (!SWIG_IsOK(res1)) {
8039 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getNumInteriorRings" "', argument " "1"" of type '" "GeosPolygon *""'");
8041 arg1 = reinterpret_cast< GeosPolygon * >(argp1);
8045 result = GeosPolygon_getNumInteriorRings(arg1);
8047 catch (const std::exception& e)
8049 SWIG_exception(SWIG_RuntimeError, e.what());
8052 resultobj = SWIG_From_size_t(static_cast< size_t >(result));
8053 return resultobj;
8054 fail:
8055 return NULL;
8059 SWIGINTERN PyObject *_wrap_Polygon_getInteriorRingN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8060 PyObject *resultobj = 0;
8061 GeosPolygon *arg1 = (GeosPolygon *) 0 ;
8062 size_t arg2 ;
8063 void *argp1 = 0 ;
8064 int res1 = 0 ;
8065 size_t val2 ;
8066 int ecode2 = 0 ;
8067 PyObject * obj0 = 0 ;
8068 PyObject * obj1 = 0 ;
8069 GeosGeometry *result = 0 ;
8071 if(!PyArg_UnpackTuple(args,(char *)"Polygon_getInteriorRingN",2,2,&obj0,&obj1)) SWIG_fail;
8072 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPolygon, 0 | 0 );
8073 if (!SWIG_IsOK(res1)) {
8074 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Polygon_getInteriorRingN" "', argument " "1"" of type '" "GeosPolygon *""'");
8076 arg1 = reinterpret_cast< GeosPolygon * >(argp1);
8077 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
8078 if (!SWIG_IsOK(ecode2)) {
8079 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Polygon_getInteriorRingN" "', argument " "2"" of type '" "size_t""'");
8081 arg2 = static_cast< size_t >(val2);
8085 result = (GeosGeometry *)GeosPolygon_getInteriorRingN(arg1,arg2);
8087 catch (const std::exception& e)
8089 SWIG_exception(SWIG_RuntimeError, e.what());
8093 /* %typemap(out) GeosGeometry */
8095 if (result == NULL)
8096 SWIG_exception(SWIG_RuntimeError, message);
8098 GeosGeometry *geom = result;
8099 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
8101 switch (geomId)
8103 case GEOS_POINT:
8104 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
8105 break;
8106 case GEOS_LINESTRING:
8107 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
8108 break;
8109 case GEOS_LINEARRING:
8110 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
8111 break;
8112 case GEOS_POLYGON:
8113 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
8114 break;
8115 case GEOS_MULTIPOINT:
8116 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
8117 break;
8118 case GEOS_MULTILINESTRING:
8119 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
8120 break;
8121 case GEOS_MULTIPOLYGON:
8122 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
8123 break;
8124 case GEOS_GEOMETRYCOLLECTION:
8125 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
8126 break;
8129 return resultobj;
8130 fail:
8131 return NULL;
8135 SWIGINTERN PyObject *Polygon_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8136 PyObject *obj;
8137 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
8138 SWIG_TypeNewClientData(SWIGTYPE_p_GeosPolygon, SWIG_NewClientData(obj));
8139 return SWIG_Py_Void();
8142 SWIGINTERN PyObject *_wrap_delete_GeometryCollection(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8143 PyObject *resultobj = 0;
8144 GeosGeometryCollection *arg1 = (GeosGeometryCollection *) 0 ;
8145 void *argp1 = 0 ;
8146 int res1 = 0 ;
8147 PyObject * obj0 = 0 ;
8149 if(!PyArg_UnpackTuple(args,(char *)"delete_GeometryCollection",1,1,&obj0)) SWIG_fail;
8150 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometryCollection, SWIG_POINTER_DISOWN | 0 );
8151 if (!SWIG_IsOK(res1)) {
8152 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GeometryCollection" "', argument " "1"" of type '" "GeosGeometryCollection *""'");
8154 arg1 = reinterpret_cast< GeosGeometryCollection * >(argp1);
8158 delete_GeosGeometryCollection(arg1);
8160 catch (const std::exception& e)
8162 SWIG_exception(SWIG_RuntimeError, e.what());
8165 resultobj = SWIG_Py_Void();
8166 return resultobj;
8167 fail:
8168 return NULL;
8172 SWIGINTERN PyObject *_wrap_GeometryCollection_getGeometryN(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8173 PyObject *resultobj = 0;
8174 GeosGeometryCollection *arg1 = (GeosGeometryCollection *) 0 ;
8175 size_t arg2 ;
8176 void *argp1 = 0 ;
8177 int res1 = 0 ;
8178 size_t val2 ;
8179 int ecode2 = 0 ;
8180 PyObject * obj0 = 0 ;
8181 PyObject * obj1 = 0 ;
8182 GeosGeometry *result = 0 ;
8184 if(!PyArg_UnpackTuple(args,(char *)"GeometryCollection_getGeometryN",2,2,&obj0,&obj1)) SWIG_fail;
8185 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometryCollection, 0 | 0 );
8186 if (!SWIG_IsOK(res1)) {
8187 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GeometryCollection_getGeometryN" "', argument " "1"" of type '" "GeosGeometryCollection *""'");
8189 arg1 = reinterpret_cast< GeosGeometryCollection * >(argp1);
8190 ecode2 = SWIG_AsVal_size_t(obj1, &val2);
8191 if (!SWIG_IsOK(ecode2)) {
8192 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GeometryCollection_getGeometryN" "', argument " "2"" of type '" "size_t""'");
8194 arg2 = static_cast< size_t >(val2);
8198 result = (GeosGeometry *)GeosGeometryCollection_getGeometryN(arg1,arg2);
8200 catch (const std::exception& e)
8202 SWIG_exception(SWIG_RuntimeError, e.what());
8206 /* %typemap(out) GeosGeometry */
8208 if (result == NULL)
8209 SWIG_exception(SWIG_RuntimeError, message);
8211 GeosGeometry *geom = result;
8212 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
8214 switch (geomId)
8216 case GEOS_POINT:
8217 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | 0);
8218 break;
8219 case GEOS_LINESTRING:
8220 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | 0);
8221 break;
8222 case GEOS_LINEARRING:
8223 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | 0);
8224 break;
8225 case GEOS_POLYGON:
8226 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | 0);
8227 break;
8228 case GEOS_MULTIPOINT:
8229 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | 0);
8230 break;
8231 case GEOS_MULTILINESTRING:
8232 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | 0);
8233 break;
8234 case GEOS_MULTIPOLYGON:
8235 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | 0);
8236 break;
8237 case GEOS_GEOMETRYCOLLECTION:
8238 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | 0);
8239 break;
8242 return resultobj;
8243 fail:
8244 return NULL;
8248 SWIGINTERN PyObject *GeometryCollection_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8249 PyObject *obj;
8250 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
8251 SWIG_TypeNewClientData(SWIGTYPE_p_GeosGeometryCollection, SWIG_NewClientData(obj));
8252 return SWIG_Py_Void();
8255 SWIGINTERN PyObject *_wrap_delete_MultiPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8256 PyObject *resultobj = 0;
8257 GeosMultiPoint *arg1 = (GeosMultiPoint *) 0 ;
8258 void *argp1 = 0 ;
8259 int res1 = 0 ;
8260 PyObject * obj0 = 0 ;
8262 if(!PyArg_UnpackTuple(args,(char *)"delete_MultiPoint",1,1,&obj0)) SWIG_fail;
8263 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiPoint, SWIG_POINTER_DISOWN | 0 );
8264 if (!SWIG_IsOK(res1)) {
8265 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiPoint" "', argument " "1"" of type '" "GeosMultiPoint *""'");
8267 arg1 = reinterpret_cast< GeosMultiPoint * >(argp1);
8271 delete_GeosMultiPoint(arg1);
8273 catch (const std::exception& e)
8275 SWIG_exception(SWIG_RuntimeError, e.what());
8278 resultobj = SWIG_Py_Void();
8279 return resultobj;
8280 fail:
8281 return NULL;
8285 SWIGINTERN PyObject *MultiPoint_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8286 PyObject *obj;
8287 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
8288 SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiPoint, SWIG_NewClientData(obj));
8289 return SWIG_Py_Void();
8292 SWIGINTERN PyObject *_wrap_delete_MultiLineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8293 PyObject *resultobj = 0;
8294 GeosMultiLineString *arg1 = (GeosMultiLineString *) 0 ;
8295 void *argp1 = 0 ;
8296 int res1 = 0 ;
8297 PyObject * obj0 = 0 ;
8299 if(!PyArg_UnpackTuple(args,(char *)"delete_MultiLineString",1,1,&obj0)) SWIG_fail;
8300 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiLineString, SWIG_POINTER_DISOWN | 0 );
8301 if (!SWIG_IsOK(res1)) {
8302 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiLineString" "', argument " "1"" of type '" "GeosMultiLineString *""'");
8304 arg1 = reinterpret_cast< GeosMultiLineString * >(argp1);
8308 delete_GeosMultiLineString(arg1);
8310 catch (const std::exception& e)
8312 SWIG_exception(SWIG_RuntimeError, e.what());
8315 resultobj = SWIG_Py_Void();
8316 return resultobj;
8317 fail:
8318 return NULL;
8322 SWIGINTERN PyObject *MultiLineString_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8323 PyObject *obj;
8324 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
8325 SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiLineString, SWIG_NewClientData(obj));
8326 return SWIG_Py_Void();
8329 SWIGINTERN PyObject *_wrap_delete_MultiLinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8330 PyObject *resultobj = 0;
8331 GeosMultiLinearRing *arg1 = (GeosMultiLinearRing *) 0 ;
8332 void *argp1 = 0 ;
8333 int res1 = 0 ;
8334 PyObject * obj0 = 0 ;
8336 if(!PyArg_UnpackTuple(args,(char *)"delete_MultiLinearRing",1,1,&obj0)) SWIG_fail;
8337 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiLinearRing, SWIG_POINTER_DISOWN | 0 );
8338 if (!SWIG_IsOK(res1)) {
8339 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiLinearRing" "', argument " "1"" of type '" "GeosMultiLinearRing *""'");
8341 arg1 = reinterpret_cast< GeosMultiLinearRing * >(argp1);
8345 delete_GeosMultiLinearRing(arg1);
8347 catch (const std::exception& e)
8349 SWIG_exception(SWIG_RuntimeError, e.what());
8352 resultobj = SWIG_Py_Void();
8353 return resultobj;
8354 fail:
8355 return NULL;
8359 SWIGINTERN PyObject *MultiLinearRing_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8360 PyObject *obj;
8361 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
8362 SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiLinearRing, SWIG_NewClientData(obj));
8363 return SWIG_Py_Void();
8366 SWIGINTERN PyObject *_wrap_delete_MultiPolygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8367 PyObject *resultobj = 0;
8368 GeosMultiPolygon *arg1 = (GeosMultiPolygon *) 0 ;
8369 void *argp1 = 0 ;
8370 int res1 = 0 ;
8371 PyObject * obj0 = 0 ;
8373 if(!PyArg_UnpackTuple(args,(char *)"delete_MultiPolygon",1,1,&obj0)) SWIG_fail;
8374 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosMultiPolygon, SWIG_POINTER_DISOWN | 0 );
8375 if (!SWIG_IsOK(res1)) {
8376 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_MultiPolygon" "', argument " "1"" of type '" "GeosMultiPolygon *""'");
8378 arg1 = reinterpret_cast< GeosMultiPolygon * >(argp1);
8382 delete_GeosMultiPolygon(arg1);
8384 catch (const std::exception& e)
8386 SWIG_exception(SWIG_RuntimeError, e.what());
8389 resultobj = SWIG_Py_Void();
8390 return resultobj;
8391 fail:
8392 return NULL;
8396 SWIGINTERN PyObject *MultiPolygon_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8397 PyObject *obj;
8398 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
8399 SWIG_TypeNewClientData(SWIGTYPE_p_GeosMultiPolygon, SWIG_NewClientData(obj));
8400 return SWIG_Py_Void();
8403 SWIGINTERN PyObject *_wrap_createPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8404 PyObject *resultobj = 0;
8405 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
8406 int res1 = 0 ;
8407 PyObject * obj0 = 0 ;
8408 GeosGeometry *result = 0 ;
8410 if(!PyArg_UnpackTuple(args,(char *)"createPoint",1,1,&obj0)) SWIG_fail;
8411 res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN | 0 );
8412 if (!SWIG_IsOK(res1)) {
8413 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createPoint" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
8418 result = (GeosGeometry *)createPoint(arg1);
8420 catch (const std::exception& e)
8422 SWIG_exception(SWIG_RuntimeError, e.what());
8426 /* %typemap(out) GeosGeometry */
8428 if (result == NULL)
8429 SWIG_exception(SWIG_RuntimeError, message);
8431 GeosGeometry *geom = result;
8432 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
8434 switch (geomId)
8436 case GEOS_POINT:
8437 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
8438 break;
8439 case GEOS_LINESTRING:
8440 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
8441 break;
8442 case GEOS_LINEARRING:
8443 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
8444 break;
8445 case GEOS_POLYGON:
8446 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
8447 break;
8448 case GEOS_MULTIPOINT:
8449 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
8450 break;
8451 case GEOS_MULTILINESTRING:
8452 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
8453 break;
8454 case GEOS_MULTIPOLYGON:
8455 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
8456 break;
8457 case GEOS_GEOMETRYCOLLECTION:
8458 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
8459 break;
8462 return resultobj;
8463 fail:
8464 return NULL;
8468 SWIGINTERN PyObject *_wrap_createLineString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8469 PyObject *resultobj = 0;
8470 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
8471 int res1 = 0 ;
8472 PyObject * obj0 = 0 ;
8473 GeosGeometry *result = 0 ;
8475 if(!PyArg_UnpackTuple(args,(char *)"createLineString",1,1,&obj0)) SWIG_fail;
8476 res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN | 0 );
8477 if (!SWIG_IsOK(res1)) {
8478 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createLineString" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
8483 result = (GeosGeometry *)createLineString(arg1);
8485 catch (const std::exception& e)
8487 SWIG_exception(SWIG_RuntimeError, e.what());
8491 /* %typemap(out) GeosGeometry */
8493 if (result == NULL)
8494 SWIG_exception(SWIG_RuntimeError, message);
8496 GeosGeometry *geom = result;
8497 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
8499 switch (geomId)
8501 case GEOS_POINT:
8502 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
8503 break;
8504 case GEOS_LINESTRING:
8505 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
8506 break;
8507 case GEOS_LINEARRING:
8508 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
8509 break;
8510 case GEOS_POLYGON:
8511 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
8512 break;
8513 case GEOS_MULTIPOINT:
8514 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
8515 break;
8516 case GEOS_MULTILINESTRING:
8517 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
8518 break;
8519 case GEOS_MULTIPOLYGON:
8520 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
8521 break;
8522 case GEOS_GEOMETRYCOLLECTION:
8523 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
8524 break;
8527 return resultobj;
8528 fail:
8529 return NULL;
8533 SWIGINTERN PyObject *_wrap_createLinearRing(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8534 PyObject *resultobj = 0;
8535 GeosCoordinateSequence *arg1 = (GeosCoordinateSequence *) 0 ;
8536 int res1 = 0 ;
8537 PyObject * obj0 = 0 ;
8538 GeosGeometry *result = 0 ;
8540 if(!PyArg_UnpackTuple(args,(char *)"createLinearRing",1,1,&obj0)) SWIG_fail;
8541 res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosCoordinateSequence, SWIG_POINTER_DISOWN | 0 );
8542 if (!SWIG_IsOK(res1)) {
8543 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createLinearRing" "', argument " "1"" of type '" "GeosCoordinateSequence *""'");
8548 result = (GeosGeometry *)createLinearRing(arg1);
8550 catch (const std::exception& e)
8552 SWIG_exception(SWIG_RuntimeError, e.what());
8556 /* %typemap(out) GeosGeometry */
8558 if (result == NULL)
8559 SWIG_exception(SWIG_RuntimeError, message);
8561 GeosGeometry *geom = result;
8562 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
8564 switch (geomId)
8566 case GEOS_POINT:
8567 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
8568 break;
8569 case GEOS_LINESTRING:
8570 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
8571 break;
8572 case GEOS_LINEARRING:
8573 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
8574 break;
8575 case GEOS_POLYGON:
8576 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
8577 break;
8578 case GEOS_MULTIPOINT:
8579 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
8580 break;
8581 case GEOS_MULTILINESTRING:
8582 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
8583 break;
8584 case GEOS_MULTIPOLYGON:
8585 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
8586 break;
8587 case GEOS_GEOMETRYCOLLECTION:
8588 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
8589 break;
8592 return resultobj;
8593 fail:
8594 return NULL;
8598 SWIGINTERN PyObject *_wrap_createPolygon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8599 PyObject *resultobj = 0;
8600 GeosLinearRing *arg1 = (GeosLinearRing *) 0 ;
8601 GeosLinearRing **arg2 = (GeosLinearRing **) 0 ;
8602 size_t arg3 ;
8603 int res1 = 0 ;
8604 PyObject * obj0 = 0 ;
8605 PyObject * obj1 = 0 ;
8606 GeosGeometry *result = 0 ;
8609 arg2 = NULL;
8610 arg3 = 0;
8612 if(!PyArg_UnpackTuple(args,(char *)"createPolygon",1,2,&obj0,&obj1)) SWIG_fail;
8613 res1 = SWIG_ConvertPtr(obj0, SWIG_as_voidptrptr(&arg1), SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN | 0 );
8614 if (!SWIG_IsOK(res1)) {
8615 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
8617 if (obj1) {
8619 if (obj1 == Py_None)
8621 arg2 = NULL;
8622 arg3 = 0;
8624 else
8626 /* Make sure the input can be treated as an array. */
8627 if (!PySequence_Check(obj1))
8628 SWIG_exception_fail(SWIG_RuntimeError, "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
8630 /* Get the length */
8631 arg3 = PySequence_Size(obj1);
8633 /* Allocate space for the C array. */
8634 arg2 = (GeosLinearRing**) malloc(arg3*sizeof(GeosLinearRing*));
8636 for(size_t i = 0; i<arg3; i++)
8638 /* Get the Python Object */
8639 PyObject *item = PySequence_GetItem(obj1,i);
8641 /* Get the underlying pointer and give up ownership of it. */
8642 GeosLinearRing *ring = NULL;
8643 int convertResult = SWIG_ConvertPtr(item, (void**)&ring, SWIGTYPE_p_GeosLinearRing, SWIG_POINTER_DISOWN);
8644 if (!SWIG_IsOK(convertResult)) {
8645 SWIG_exception_fail(SWIG_ArgError(convertResult), "in method '" "createPolygon" "', argument " "1"" of type '" "GeosLinearRing *""'");
8648 /* Put the pointer in the array */
8649 arg2[i] = ring;
8657 result = (GeosGeometry *)createPolygon(arg1,arg2,arg3);
8659 catch (const std::exception& e)
8661 SWIG_exception(SWIG_RuntimeError, e.what());
8665 /* %typemap(out) GeosGeometry */
8667 if (result == NULL)
8668 SWIG_exception(SWIG_RuntimeError, message);
8670 GeosGeometry *geom = result;
8671 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
8673 switch (geomId)
8675 case GEOS_POINT:
8676 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
8677 break;
8678 case GEOS_LINESTRING:
8679 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
8680 break;
8681 case GEOS_LINEARRING:
8682 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
8683 break;
8684 case GEOS_POLYGON:
8685 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
8686 break;
8687 case GEOS_MULTIPOINT:
8688 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
8689 break;
8690 case GEOS_MULTILINESTRING:
8691 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
8692 break;
8693 case GEOS_MULTIPOLYGON:
8694 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
8695 break;
8696 case GEOS_GEOMETRYCOLLECTION:
8697 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
8698 break;
8702 if (arg2) {
8703 free((void*) arg2);
8706 return resultobj;
8707 fail:
8709 if (arg2) {
8710 free((void*) arg2);
8713 return NULL;
8717 SWIGINTERN PyObject *_wrap_new_Prepared(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8718 PyObject *resultobj = 0;
8719 GeosGeometry *arg1 = (GeosGeometry *) 0 ;
8720 void *argp1 = 0 ;
8721 int res1 = 0 ;
8722 PyObject * obj0 = 0 ;
8723 GeosPreparedGeometry *result = 0 ;
8725 if(!PyArg_UnpackTuple(args,(char *)"new_Prepared",1,1,&obj0)) SWIG_fail;
8726 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosGeometry, 0 | 0 );
8727 if (!SWIG_IsOK(res1)) {
8728 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Prepared" "', argument " "1"" of type '" "GeosGeometry const *""'");
8730 arg1 = reinterpret_cast< GeosGeometry * >(argp1);
8734 result = (GeosPreparedGeometry *)new_GeosPreparedGeometry((GeosGeometry const *)arg1);
8736 catch (const std::exception& e)
8738 SWIG_exception(SWIG_RuntimeError, e.what());
8741 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPreparedGeometry, SWIG_POINTER_NEW | 0 );
8742 return resultobj;
8743 fail:
8744 return NULL;
8748 SWIGINTERN PyObject *_wrap_delete_Prepared(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8749 PyObject *resultobj = 0;
8750 GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
8751 void *argp1 = 0 ;
8752 int res1 = 0 ;
8753 PyObject * obj0 = 0 ;
8755 if(!PyArg_UnpackTuple(args,(char *)"delete_Prepared",1,1,&obj0)) SWIG_fail;
8756 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, SWIG_POINTER_DISOWN | 0 );
8757 if (!SWIG_IsOK(res1)) {
8758 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Prepared" "', argument " "1"" of type '" "GeosPreparedGeometry *""'");
8760 arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
8764 delete_GeosPreparedGeometry(arg1);
8766 catch (const std::exception& e)
8768 SWIG_exception(SWIG_RuntimeError, e.what());
8771 resultobj = SWIG_Py_Void();
8772 return resultobj;
8773 fail:
8774 return NULL;
8778 SWIGINTERN PyObject *_wrap_Prepared_contains(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8779 PyObject *resultobj = 0;
8780 GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
8781 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
8782 void *argp1 = 0 ;
8783 int res1 = 0 ;
8784 void *argp2 = 0 ;
8785 int res2 = 0 ;
8786 PyObject * obj0 = 0 ;
8787 PyObject * obj1 = 0 ;
8788 bool result;
8790 if(!PyArg_UnpackTuple(args,(char *)"Prepared_contains",2,2,&obj0,&obj1)) SWIG_fail;
8791 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 | 0 );
8792 if (!SWIG_IsOK(res1)) {
8793 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_contains" "', argument " "1"" of type '" "GeosPreparedGeometry *""'");
8795 arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
8796 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
8797 if (!SWIG_IsOK(res2)) {
8798 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_contains" "', argument " "2"" of type '" "GeosGeometry const *""'");
8800 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
8804 result = (bool)GeosPreparedGeometry_contains(arg1,(GeosGeometry const *)arg2);
8806 catch (const std::exception& e)
8808 SWIG_exception(SWIG_RuntimeError, e.what());
8811 resultobj = SWIG_From_bool(static_cast< bool >(result));
8812 return resultobj;
8813 fail:
8814 return NULL;
8818 SWIGINTERN PyObject *_wrap_Prepared_containsProperly(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8819 PyObject *resultobj = 0;
8820 GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
8821 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
8822 void *argp1 = 0 ;
8823 int res1 = 0 ;
8824 void *argp2 = 0 ;
8825 int res2 = 0 ;
8826 PyObject * obj0 = 0 ;
8827 PyObject * obj1 = 0 ;
8828 bool result;
8830 if(!PyArg_UnpackTuple(args,(char *)"Prepared_containsProperly",2,2,&obj0,&obj1)) SWIG_fail;
8831 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 | 0 );
8832 if (!SWIG_IsOK(res1)) {
8833 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_containsProperly" "', argument " "1"" of type '" "GeosPreparedGeometry *""'");
8835 arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
8836 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
8837 if (!SWIG_IsOK(res2)) {
8838 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_containsProperly" "', argument " "2"" of type '" "GeosGeometry const *""'");
8840 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
8844 result = (bool)GeosPreparedGeometry_containsProperly(arg1,(GeosGeometry const *)arg2);
8846 catch (const std::exception& e)
8848 SWIG_exception(SWIG_RuntimeError, e.what());
8851 resultobj = SWIG_From_bool(static_cast< bool >(result));
8852 return resultobj;
8853 fail:
8854 return NULL;
8858 SWIGINTERN PyObject *_wrap_Prepared_covers(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8859 PyObject *resultobj = 0;
8860 GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
8861 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
8862 void *argp1 = 0 ;
8863 int res1 = 0 ;
8864 void *argp2 = 0 ;
8865 int res2 = 0 ;
8866 PyObject * obj0 = 0 ;
8867 PyObject * obj1 = 0 ;
8868 bool result;
8870 if(!PyArg_UnpackTuple(args,(char *)"Prepared_covers",2,2,&obj0,&obj1)) SWIG_fail;
8871 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 | 0 );
8872 if (!SWIG_IsOK(res1)) {
8873 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_covers" "', argument " "1"" of type '" "GeosPreparedGeometry *""'");
8875 arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
8876 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
8877 if (!SWIG_IsOK(res2)) {
8878 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_covers" "', argument " "2"" of type '" "GeosGeometry const *""'");
8880 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
8884 result = (bool)GeosPreparedGeometry_covers(arg1,(GeosGeometry const *)arg2);
8886 catch (const std::exception& e)
8888 SWIG_exception(SWIG_RuntimeError, e.what());
8891 resultobj = SWIG_From_bool(static_cast< bool >(result));
8892 return resultobj;
8893 fail:
8894 return NULL;
8898 SWIGINTERN PyObject *_wrap_Prepared_intersects(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8899 PyObject *resultobj = 0;
8900 GeosPreparedGeometry *arg1 = (GeosPreparedGeometry *) 0 ;
8901 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
8902 void *argp1 = 0 ;
8903 int res1 = 0 ;
8904 void *argp2 = 0 ;
8905 int res2 = 0 ;
8906 PyObject * obj0 = 0 ;
8907 PyObject * obj1 = 0 ;
8908 bool result;
8910 if(!PyArg_UnpackTuple(args,(char *)"Prepared_intersects",2,2,&obj0,&obj1)) SWIG_fail;
8911 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosPreparedGeometry, 0 | 0 );
8912 if (!SWIG_IsOK(res1)) {
8913 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Prepared_intersects" "', argument " "1"" of type '" "GeosPreparedGeometry *""'");
8915 arg1 = reinterpret_cast< GeosPreparedGeometry * >(argp1);
8916 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
8917 if (!SWIG_IsOK(res2)) {
8918 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Prepared_intersects" "', argument " "2"" of type '" "GeosGeometry const *""'");
8920 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
8924 result = (bool)GeosPreparedGeometry_intersects(arg1,(GeosGeometry const *)arg2);
8926 catch (const std::exception& e)
8928 SWIG_exception(SWIG_RuntimeError, e.what());
8931 resultobj = SWIG_From_bool(static_cast< bool >(result));
8932 return resultobj;
8933 fail:
8934 return NULL;
8938 SWIGINTERN PyObject *Prepared_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8939 PyObject *obj;
8940 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
8941 SWIG_TypeNewClientData(SWIGTYPE_p_GeosPreparedGeometry, SWIG_NewClientData(obj));
8942 return SWIG_Py_Void();
8945 SWIGINTERN PyObject *_wrap_new_STRtree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8946 PyObject *resultobj = 0;
8947 int arg1 ;
8948 int val1 ;
8949 int ecode1 = 0 ;
8950 PyObject * obj0 = 0 ;
8951 GeosSTRtree *result = 0 ;
8954 arg1 = 10;
8956 if(!PyArg_UnpackTuple(args,(char *)"new_STRtree",0,1,&obj0)) SWIG_fail;
8957 if (obj0) {
8958 ecode1 = SWIG_AsVal_int(obj0, &val1);
8959 if (!SWIG_IsOK(ecode1)) {
8960 SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_STRtree" "', argument " "1"" of type '" "int""'");
8962 arg1 = static_cast< int >(val1);
8967 result = (GeosSTRtree *)new_GeosSTRtree(arg1);
8969 catch (const std::exception& e)
8971 SWIG_exception(SWIG_RuntimeError, e.what());
8974 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosSTRtree, SWIG_POINTER_NEW | 0 );
8975 return resultobj;
8976 fail:
8977 return NULL;
8981 SWIGINTERN PyObject *_wrap_delete_STRtree(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
8982 PyObject *resultobj = 0;
8983 GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
8984 void *argp1 = 0 ;
8985 int res1 = 0 ;
8986 PyObject * obj0 = 0 ;
8988 if(!PyArg_UnpackTuple(args,(char *)"delete_STRtree",1,1,&obj0)) SWIG_fail;
8989 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, SWIG_POINTER_DISOWN | 0 );
8990 if (!SWIG_IsOK(res1)) {
8991 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_STRtree" "', argument " "1"" of type '" "GeosSTRtree *""'");
8993 arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
8997 delete_GeosSTRtree(arg1);
8999 catch (const std::exception& e)
9001 SWIG_exception(SWIG_RuntimeError, e.what());
9004 resultobj = SWIG_Py_Void();
9005 return resultobj;
9006 fail:
9007 return NULL;
9011 SWIGINTERN PyObject *_wrap_STRtree_insert(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9012 PyObject *resultobj = 0;
9013 GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
9014 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
9015 GeosIndexItem arg3 ;
9016 void *argp1 = 0 ;
9017 int res1 = 0 ;
9018 void *argp2 = 0 ;
9019 int res2 = 0 ;
9020 void *argp3 ;
9021 int res3 = 0 ;
9022 PyObject * obj0 = 0 ;
9023 PyObject * obj1 = 0 ;
9024 PyObject * obj2 = 0 ;
9026 if(!PyArg_UnpackTuple(args,(char *)"STRtree_insert",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
9027 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 | 0 );
9028 if (!SWIG_IsOK(res1)) {
9029 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_insert" "', argument " "1"" of type '" "GeosSTRtree *""'");
9031 arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
9032 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
9033 if (!SWIG_IsOK(res2)) {
9034 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_insert" "', argument " "2"" of type '" "GeosGeometry const *""'");
9036 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
9038 res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosIndexItem, 0 | 0);
9039 if (!SWIG_IsOK(res3)) {
9040 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_insert" "', argument " "3"" of type '" "GeosIndexItem""'");
9042 if (!argp3) {
9043 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_insert" "', argument " "3"" of type '" "GeosIndexItem""'");
9044 } else {
9045 GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp3);
9046 arg3 = *temp;
9047 if (SWIG_IsNewObj(res3)) delete temp;
9053 GeosSTRtree_insert(arg1,(GeosGeometry const *)arg2,arg3);
9055 catch (const std::exception& e)
9057 SWIG_exception(SWIG_RuntimeError, e.what());
9060 resultobj = SWIG_Py_Void();
9061 return resultobj;
9062 fail:
9063 return NULL;
9067 SWIGINTERN PyObject *_wrap_STRtree_remove(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9068 PyObject *resultobj = 0;
9069 GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
9070 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
9071 GeosIndexItem arg3 ;
9072 void *argp1 = 0 ;
9073 int res1 = 0 ;
9074 void *argp2 = 0 ;
9075 int res2 = 0 ;
9076 void *argp3 ;
9077 int res3 = 0 ;
9078 PyObject * obj0 = 0 ;
9079 PyObject * obj1 = 0 ;
9080 PyObject * obj2 = 0 ;
9082 if(!PyArg_UnpackTuple(args,(char *)"STRtree_remove",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
9083 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 | 0 );
9084 if (!SWIG_IsOK(res1)) {
9085 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_remove" "', argument " "1"" of type '" "GeosSTRtree *""'");
9087 arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
9088 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
9089 if (!SWIG_IsOK(res2)) {
9090 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_remove" "', argument " "2"" of type '" "GeosGeometry const *""'");
9092 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
9094 res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosIndexItem, 0 | 0);
9095 if (!SWIG_IsOK(res3)) {
9096 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_remove" "', argument " "3"" of type '" "GeosIndexItem""'");
9098 if (!argp3) {
9099 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_remove" "', argument " "3"" of type '" "GeosIndexItem""'");
9100 } else {
9101 GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp3);
9102 arg3 = *temp;
9103 if (SWIG_IsNewObj(res3)) delete temp;
9109 GeosSTRtree_remove(arg1,(GeosGeometry const *)arg2,arg3);
9111 catch (const std::exception& e)
9113 SWIG_exception(SWIG_RuntimeError, e.what());
9116 resultobj = SWIG_Py_Void();
9117 return resultobj;
9118 fail:
9119 return NULL;
9123 SWIGINTERN PyObject *_wrap_STRtree_query(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9124 PyObject *resultobj = 0;
9125 GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
9126 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
9127 GeosQueryCallback arg3 ;
9128 GeosIndexItem arg4 ;
9129 void *argp1 = 0 ;
9130 int res1 = 0 ;
9131 void *argp2 = 0 ;
9132 int res2 = 0 ;
9133 void *argp3 ;
9134 int res3 = 0 ;
9135 void *argp4 ;
9136 int res4 = 0 ;
9137 PyObject * obj0 = 0 ;
9138 PyObject * obj1 = 0 ;
9139 PyObject * obj2 = 0 ;
9140 PyObject * obj3 = 0 ;
9142 if(!PyArg_UnpackTuple(args,(char *)"STRtree_query",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
9143 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 | 0 );
9144 if (!SWIG_IsOK(res1)) {
9145 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_query" "', argument " "1"" of type '" "GeosSTRtree *""'");
9147 arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
9148 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
9149 if (!SWIG_IsOK(res2)) {
9150 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_query" "', argument " "2"" of type '" "GeosGeometry const *""'");
9152 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
9154 res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosQueryCallback, 0 | 0);
9155 if (!SWIG_IsOK(res3)) {
9156 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_query" "', argument " "3"" of type '" "GeosQueryCallback""'");
9158 if (!argp3) {
9159 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_query" "', argument " "3"" of type '" "GeosQueryCallback""'");
9160 } else {
9161 GeosQueryCallback * temp = reinterpret_cast< GeosQueryCallback * >(argp3);
9162 arg3 = *temp;
9163 if (SWIG_IsNewObj(res3)) delete temp;
9167 res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_GeosIndexItem, 0 | 0);
9168 if (!SWIG_IsOK(res4)) {
9169 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "STRtree_query" "', argument " "4"" of type '" "GeosIndexItem""'");
9171 if (!argp4) {
9172 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_query" "', argument " "4"" of type '" "GeosIndexItem""'");
9173 } else {
9174 GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp4);
9175 arg4 = *temp;
9176 if (SWIG_IsNewObj(res4)) delete temp;
9182 GeosSTRtree_query(arg1,(GeosGeometry const *)arg2,arg3,arg4);
9184 catch (const std::exception& e)
9186 SWIG_exception(SWIG_RuntimeError, e.what());
9189 resultobj = SWIG_Py_Void();
9190 return resultobj;
9191 fail:
9192 return NULL;
9196 SWIGINTERN PyObject *_wrap_STRtree_iterate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9197 PyObject *resultobj = 0;
9198 GeosSTRtree *arg1 = (GeosSTRtree *) 0 ;
9199 GeosQueryCallback arg2 ;
9200 GeosIndexItem arg3 ;
9201 void *argp1 = 0 ;
9202 int res1 = 0 ;
9203 void *argp2 ;
9204 int res2 = 0 ;
9205 void *argp3 ;
9206 int res3 = 0 ;
9207 PyObject * obj0 = 0 ;
9208 PyObject * obj1 = 0 ;
9209 PyObject * obj2 = 0 ;
9211 if(!PyArg_UnpackTuple(args,(char *)"STRtree_iterate",3,3,&obj0,&obj1,&obj2)) SWIG_fail;
9212 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosSTRtree, 0 | 0 );
9213 if (!SWIG_IsOK(res1)) {
9214 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "STRtree_iterate" "', argument " "1"" of type '" "GeosSTRtree *""'");
9216 arg1 = reinterpret_cast< GeosSTRtree * >(argp1);
9218 res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_GeosQueryCallback, 0 | 0);
9219 if (!SWIG_IsOK(res2)) {
9220 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "STRtree_iterate" "', argument " "2"" of type '" "GeosQueryCallback""'");
9222 if (!argp2) {
9223 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_iterate" "', argument " "2"" of type '" "GeosQueryCallback""'");
9224 } else {
9225 GeosQueryCallback * temp = reinterpret_cast< GeosQueryCallback * >(argp2);
9226 arg2 = *temp;
9227 if (SWIG_IsNewObj(res2)) delete temp;
9231 res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_GeosIndexItem, 0 | 0);
9232 if (!SWIG_IsOK(res3)) {
9233 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "STRtree_iterate" "', argument " "3"" of type '" "GeosIndexItem""'");
9235 if (!argp3) {
9236 SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "STRtree_iterate" "', argument " "3"" of type '" "GeosIndexItem""'");
9237 } else {
9238 GeosIndexItem * temp = reinterpret_cast< GeosIndexItem * >(argp3);
9239 arg3 = *temp;
9240 if (SWIG_IsNewObj(res3)) delete temp;
9246 GeosSTRtree_iterate(arg1,arg2,arg3);
9248 catch (const std::exception& e)
9250 SWIG_exception(SWIG_RuntimeError, e.what());
9253 resultobj = SWIG_Py_Void();
9254 return resultobj;
9255 fail:
9256 return NULL;
9260 SWIGINTERN PyObject *STRtree_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9261 PyObject *obj;
9262 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
9263 SWIG_TypeNewClientData(SWIGTYPE_p_GeosSTRtree, SWIG_NewClientData(obj));
9264 return SWIG_Py_Void();
9267 SWIGINTERN PyObject *_wrap_new_WktReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9268 PyObject *resultobj = 0;
9269 GeosWktReader *result = 0 ;
9274 result = (GeosWktReader *)new_GeosWktReader();
9276 catch (const std::exception& e)
9278 SWIG_exception(SWIG_RuntimeError, e.what());
9281 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWktReader, SWIG_POINTER_NEW | 0 );
9282 return resultobj;
9283 fail:
9284 return NULL;
9288 SWIGINTERN PyObject *_wrap_delete_WktReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9289 PyObject *resultobj = 0;
9290 GeosWktReader *arg1 = (GeosWktReader *) 0 ;
9291 void *argp1 = 0 ;
9292 int res1 = 0 ;
9293 PyObject * obj0 = 0 ;
9295 if(!PyArg_UnpackTuple(args,(char *)"delete_WktReader",1,1,&obj0)) SWIG_fail;
9296 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktReader, SWIG_POINTER_DISOWN | 0 );
9297 if (!SWIG_IsOK(res1)) {
9298 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WktReader" "', argument " "1"" of type '" "GeosWktReader *""'");
9300 arg1 = reinterpret_cast< GeosWktReader * >(argp1);
9304 delete_GeosWktReader(arg1);
9306 catch (const std::exception& e)
9308 SWIG_exception(SWIG_RuntimeError, e.what());
9311 resultobj = SWIG_Py_Void();
9312 return resultobj;
9313 fail:
9314 return NULL;
9318 SWIGINTERN PyObject *_wrap_WktReader_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9319 PyObject *resultobj = 0;
9320 GeosWktReader *arg1 = (GeosWktReader *) 0 ;
9321 char *arg2 = (char *) 0 ;
9322 void *argp1 = 0 ;
9323 int res1 = 0 ;
9324 int res2 ;
9325 char *buf2 = 0 ;
9326 int alloc2 = 0 ;
9327 PyObject * obj0 = 0 ;
9328 PyObject * obj1 = 0 ;
9329 GeosGeometry *result = 0 ;
9331 if(!PyArg_UnpackTuple(args,(char *)"WktReader_read",2,2,&obj0,&obj1)) SWIG_fail;
9332 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktReader, 0 | 0 );
9333 if (!SWIG_IsOK(res1)) {
9334 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WktReader_read" "', argument " "1"" of type '" "GeosWktReader *""'");
9336 arg1 = reinterpret_cast< GeosWktReader * >(argp1);
9337 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
9338 if (!SWIG_IsOK(res2)) {
9339 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WktReader_read" "', argument " "2"" of type '" "char const *""'");
9341 arg2 = reinterpret_cast< char * >(buf2);
9345 result = (GeosGeometry *)GeosWktReader_read(arg1,(char const *)arg2);
9347 catch (const std::exception& e)
9349 SWIG_exception(SWIG_RuntimeError, e.what());
9353 /* %typemap(out) GeosGeometry */
9355 if (result == NULL)
9356 SWIG_exception(SWIG_RuntimeError, message);
9358 GeosGeometry *geom = result;
9359 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
9361 switch (geomId)
9363 case GEOS_POINT:
9364 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
9365 break;
9366 case GEOS_LINESTRING:
9367 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
9368 break;
9369 case GEOS_LINEARRING:
9370 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
9371 break;
9372 case GEOS_POLYGON:
9373 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
9374 break;
9375 case GEOS_MULTIPOINT:
9376 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
9377 break;
9378 case GEOS_MULTILINESTRING:
9379 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
9380 break;
9381 case GEOS_MULTIPOLYGON:
9382 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
9383 break;
9384 case GEOS_GEOMETRYCOLLECTION:
9385 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
9386 break;
9389 if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9390 return resultobj;
9391 fail:
9392 if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
9393 return NULL;
9397 SWIGINTERN PyObject *WktReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9398 PyObject *obj;
9399 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
9400 SWIG_TypeNewClientData(SWIGTYPE_p_GeosWktReader, SWIG_NewClientData(obj));
9401 return SWIG_Py_Void();
9404 SWIGINTERN PyObject *_wrap_new_WktWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9405 PyObject *resultobj = 0;
9406 GeosWktWriter *result = 0 ;
9411 result = (GeosWktWriter *)new_GeosWktWriter();
9413 catch (const std::exception& e)
9415 SWIG_exception(SWIG_RuntimeError, e.what());
9418 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWktWriter, SWIG_POINTER_NEW | 0 );
9419 return resultobj;
9420 fail:
9421 return NULL;
9425 SWIGINTERN PyObject *_wrap_delete_WktWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9426 PyObject *resultobj = 0;
9427 GeosWktWriter *arg1 = (GeosWktWriter *) 0 ;
9428 void *argp1 = 0 ;
9429 int res1 = 0 ;
9430 PyObject * obj0 = 0 ;
9432 if(!PyArg_UnpackTuple(args,(char *)"delete_WktWriter",1,1,&obj0)) SWIG_fail;
9433 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktWriter, SWIG_POINTER_DISOWN | 0 );
9434 if (!SWIG_IsOK(res1)) {
9435 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WktWriter" "', argument " "1"" of type '" "GeosWktWriter *""'");
9437 arg1 = reinterpret_cast< GeosWktWriter * >(argp1);
9441 delete_GeosWktWriter(arg1);
9443 catch (const std::exception& e)
9445 SWIG_exception(SWIG_RuntimeError, e.what());
9448 resultobj = SWIG_Py_Void();
9449 return resultobj;
9450 fail:
9451 return NULL;
9455 SWIGINTERN PyObject *_wrap_WktWriter_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9456 PyObject *resultobj = 0;
9457 GeosWktWriter *arg1 = (GeosWktWriter *) 0 ;
9458 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
9459 void *argp1 = 0 ;
9460 int res1 = 0 ;
9461 void *argp2 = 0 ;
9462 int res2 = 0 ;
9463 PyObject * obj0 = 0 ;
9464 PyObject * obj1 = 0 ;
9465 char *result = 0 ;
9467 if(!PyArg_UnpackTuple(args,(char *)"WktWriter_write",2,2,&obj0,&obj1)) SWIG_fail;
9468 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWktWriter, 0 | 0 );
9469 if (!SWIG_IsOK(res1)) {
9470 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WktWriter_write" "', argument " "1"" of type '" "GeosWktWriter *""'");
9472 arg1 = reinterpret_cast< GeosWktWriter * >(argp1);
9473 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
9474 if (!SWIG_IsOK(res2)) {
9475 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WktWriter_write" "', argument " "2"" of type '" "GeosGeometry const *""'");
9477 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
9481 result = (char *)GeosWktWriter_write(arg1,(GeosGeometry const *)arg2);
9483 catch (const std::exception& e)
9485 SWIG_exception(SWIG_RuntimeError, e.what());
9488 resultobj = SWIG_FromCharPtr((const char *)result);
9489 return resultobj;
9490 fail:
9491 return NULL;
9495 SWIGINTERN PyObject *WktWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9496 PyObject *obj;
9497 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
9498 SWIG_TypeNewClientData(SWIGTYPE_p_GeosWktWriter, SWIG_NewClientData(obj));
9499 return SWIG_Py_Void();
9502 SWIGINTERN PyObject *_wrap_new_WkbReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9503 PyObject *resultobj = 0;
9504 GeosWkbReader *result = 0 ;
9509 result = (GeosWkbReader *)new_GeosWkbReader();
9511 catch (const std::exception& e)
9513 SWIG_exception(SWIG_RuntimeError, e.what());
9516 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWkbReader, SWIG_POINTER_NEW | 0 );
9517 return resultobj;
9518 fail:
9519 return NULL;
9523 SWIGINTERN PyObject *_wrap_delete_WkbReader(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9524 PyObject *resultobj = 0;
9525 GeosWkbReader *arg1 = (GeosWkbReader *) 0 ;
9526 void *argp1 = 0 ;
9527 int res1 = 0 ;
9528 PyObject * obj0 = 0 ;
9530 if(!PyArg_UnpackTuple(args,(char *)"delete_WkbReader",1,1,&obj0)) SWIG_fail;
9531 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbReader, SWIG_POINTER_DISOWN | 0 );
9532 if (!SWIG_IsOK(res1)) {
9533 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WkbReader" "', argument " "1"" of type '" "GeosWkbReader *""'");
9535 arg1 = reinterpret_cast< GeosWkbReader * >(argp1);
9539 delete_GeosWkbReader(arg1);
9541 catch (const std::exception& e)
9543 SWIG_exception(SWIG_RuntimeError, e.what());
9546 resultobj = SWIG_Py_Void();
9547 return resultobj;
9548 fail:
9549 return NULL;
9553 SWIGINTERN PyObject *_wrap_WkbReader_read(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9554 PyObject *resultobj = 0;
9555 GeosWkbReader *arg1 = (GeosWkbReader *) 0 ;
9556 unsigned char *arg2 = (unsigned char *) 0 ;
9557 size_t arg3 ;
9558 void *argp1 = 0 ;
9559 int res1 = 0 ;
9560 int alloc2 = 0 ;
9561 PyObject * obj0 = 0 ;
9562 PyObject * obj1 = 0 ;
9563 GeosGeometry *result = 0 ;
9565 if(!PyArg_UnpackTuple(args,(char *)"WkbReader_read",2,2,&obj0,&obj1)) SWIG_fail;
9566 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbReader, 0 | 0 );
9567 if (!SWIG_IsOK(res1)) {
9568 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbReader_read" "', argument " "1"" of type '" "GeosWkbReader *""'");
9570 arg1 = reinterpret_cast< GeosWkbReader * >(argp1);
9572 /* %typemap(in) (const unsigned char* wkb, size_t size) (int alloc2 = 0) */
9573 if (SWIG_AsCharPtrAndSize(obj1, (char**)&arg2, &arg3, &alloc2) != SWIG_OK)
9574 SWIG_exception(SWIG_RuntimeError, "Expecting a string");
9575 /* Don't want to include last null character! */
9576 arg3--;
9581 result = (GeosGeometry *)GeosWkbReader_read(arg1,(unsigned char const *)arg2,arg3);
9583 catch (const std::exception& e)
9585 SWIG_exception(SWIG_RuntimeError, e.what());
9589 /* %typemap(out) GeosGeometry */
9591 if (result == NULL)
9592 SWIG_exception(SWIG_RuntimeError, message);
9594 GeosGeometry *geom = result;
9595 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
9597 switch (geomId)
9599 case GEOS_POINT:
9600 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
9601 break;
9602 case GEOS_LINESTRING:
9603 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
9604 break;
9605 case GEOS_LINEARRING:
9606 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
9607 break;
9608 case GEOS_POLYGON:
9609 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
9610 break;
9611 case GEOS_MULTIPOINT:
9612 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
9613 break;
9614 case GEOS_MULTILINESTRING:
9615 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
9616 break;
9617 case GEOS_MULTIPOLYGON:
9618 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
9619 break;
9620 case GEOS_GEOMETRYCOLLECTION:
9621 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
9622 break;
9625 return resultobj;
9626 fail:
9627 return NULL;
9631 SWIGINTERN PyObject *_wrap_WkbReader_readHEX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9632 PyObject *resultobj = 0;
9633 GeosWkbReader *arg1 = (GeosWkbReader *) 0 ;
9634 unsigned char *arg2 = (unsigned char *) 0 ;
9635 size_t arg3 ;
9636 void *argp1 = 0 ;
9637 int res1 = 0 ;
9638 int alloc2 = 0 ;
9639 PyObject * obj0 = 0 ;
9640 PyObject * obj1 = 0 ;
9641 GeosGeometry *result = 0 ;
9643 if(!PyArg_UnpackTuple(args,(char *)"WkbReader_readHEX",2,2,&obj0,&obj1)) SWIG_fail;
9644 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbReader, 0 | 0 );
9645 if (!SWIG_IsOK(res1)) {
9646 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbReader_readHEX" "', argument " "1"" of type '" "GeosWkbReader *""'");
9648 arg1 = reinterpret_cast< GeosWkbReader * >(argp1);
9650 /* %typemap(in) (const unsigned char* wkb, size_t size) (int alloc2 = 0) */
9651 if (SWIG_AsCharPtrAndSize(obj1, (char**)&arg2, &arg3, &alloc2) != SWIG_OK)
9652 SWIG_exception(SWIG_RuntimeError, "Expecting a string");
9653 /* Don't want to include last null character! */
9654 arg3--;
9659 result = (GeosGeometry *)GeosWkbReader_readHEX(arg1,(unsigned char const *)arg2,arg3);
9661 catch (const std::exception& e)
9663 SWIG_exception(SWIG_RuntimeError, e.what());
9667 /* %typemap(out) GeosGeometry */
9669 if (result == NULL)
9670 SWIG_exception(SWIG_RuntimeError, message);
9672 GeosGeometry *geom = result;
9673 GEOSGeomTypes geomId = (GEOSGeomTypes)GEOSGeomTypeId((GEOSGeom) geom);
9675 switch (geomId)
9677 case GEOS_POINT:
9678 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPoint, 0 | SWIG_POINTER_OWN);
9679 break;
9680 case GEOS_LINESTRING:
9681 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLineString, 0 | SWIG_POINTER_OWN);
9682 break;
9683 case GEOS_LINEARRING:
9684 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosLinearRing, 0 | SWIG_POINTER_OWN);
9685 break;
9686 case GEOS_POLYGON:
9687 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosPolygon, 0 | SWIG_POINTER_OWN);
9688 break;
9689 case GEOS_MULTIPOINT:
9690 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPoint, 0 | SWIG_POINTER_OWN);
9691 break;
9692 case GEOS_MULTILINESTRING:
9693 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiLineString, 0 | SWIG_POINTER_OWN);
9694 break;
9695 case GEOS_MULTIPOLYGON:
9696 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosMultiPolygon, 0 | SWIG_POINTER_OWN);
9697 break;
9698 case GEOS_GEOMETRYCOLLECTION:
9699 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosGeometryCollection, 0 | SWIG_POINTER_OWN);
9700 break;
9703 return resultobj;
9704 fail:
9705 return NULL;
9709 SWIGINTERN PyObject *WkbReader_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9710 PyObject *obj;
9711 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
9712 SWIG_TypeNewClientData(SWIGTYPE_p_GeosWkbReader, SWIG_NewClientData(obj));
9713 return SWIG_Py_Void();
9716 SWIGINTERN PyObject *_wrap_new_WkbWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9717 PyObject *resultobj = 0;
9718 GeosWkbWriter *result = 0 ;
9723 result = (GeosWkbWriter *)new_GeosWkbWriter();
9725 catch (const std::exception& e)
9727 SWIG_exception(SWIG_RuntimeError, e.what());
9730 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GeosWkbWriter, SWIG_POINTER_NEW | 0 );
9731 return resultobj;
9732 fail:
9733 return NULL;
9737 SWIGINTERN PyObject *_wrap_delete_WkbWriter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9738 PyObject *resultobj = 0;
9739 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9740 void *argp1 = 0 ;
9741 int res1 = 0 ;
9742 PyObject * obj0 = 0 ;
9744 if(!PyArg_UnpackTuple(args,(char *)"delete_WkbWriter",1,1,&obj0)) SWIG_fail;
9745 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, SWIG_POINTER_DISOWN | 0 );
9746 if (!SWIG_IsOK(res1)) {
9747 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_WkbWriter" "', argument " "1"" of type '" "GeosWkbWriter *""'");
9749 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
9753 delete_GeosWkbWriter(arg1);
9755 catch (const std::exception& e)
9757 SWIG_exception(SWIG_RuntimeError, e.what());
9760 resultobj = SWIG_Py_Void();
9761 return resultobj;
9762 fail:
9763 return NULL;
9767 SWIGINTERN PyObject *_wrap_WkbWriter_getOutputDimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9768 PyObject *resultobj = 0;
9769 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9770 void *argp1 = 0 ;
9771 int res1 = 0 ;
9772 PyObject * obj0 = 0 ;
9773 int result;
9775 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_getOutputDimension",1,1,&obj0)) SWIG_fail;
9776 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
9777 if (!SWIG_IsOK(res1)) {
9778 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_getOutputDimension" "', argument " "1"" of type '" "GeosWkbWriter *""'");
9780 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
9784 result = (int)GeosWkbWriter_getOutputDimension(arg1);
9786 catch (const std::exception& e)
9788 SWIG_exception(SWIG_RuntimeError, e.what());
9791 resultobj = SWIG_From_int(static_cast< int >(result));
9792 return resultobj;
9793 fail:
9794 return NULL;
9798 SWIGINTERN PyObject *_wrap_WkbWriter_setOutputDimension(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9799 PyObject *resultobj = 0;
9800 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9801 int arg2 ;
9802 void *argp1 = 0 ;
9803 int res1 = 0 ;
9804 int val2 ;
9805 int ecode2 = 0 ;
9806 PyObject * obj0 = 0 ;
9807 PyObject * obj1 = 0 ;
9809 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_setOutputDimension",2,2,&obj0,&obj1)) SWIG_fail;
9810 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
9811 if (!SWIG_IsOK(res1)) {
9812 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_setOutputDimension" "', argument " "1"" of type '" "GeosWkbWriter *""'");
9814 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
9815 ecode2 = SWIG_AsVal_int(obj1, &val2);
9816 if (!SWIG_IsOK(ecode2)) {
9817 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WkbWriter_setOutputDimension" "', argument " "2"" of type '" "int""'");
9819 arg2 = static_cast< int >(val2);
9823 GeosWkbWriter_setOutputDimension(arg1,arg2);
9825 catch (const std::exception& e)
9827 SWIG_exception(SWIG_RuntimeError, e.what());
9830 resultobj = SWIG_Py_Void();
9831 return resultobj;
9832 fail:
9833 return NULL;
9837 SWIGINTERN PyObject *_wrap_WkbWriter_getByteOrder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9838 PyObject *resultobj = 0;
9839 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9840 void *argp1 = 0 ;
9841 int res1 = 0 ;
9842 PyObject * obj0 = 0 ;
9843 int result;
9845 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_getByteOrder",1,1,&obj0)) SWIG_fail;
9846 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
9847 if (!SWIG_IsOK(res1)) {
9848 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_getByteOrder" "', argument " "1"" of type '" "GeosWkbWriter *""'");
9850 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
9854 result = (int)GeosWkbWriter_getByteOrder(arg1);
9856 catch (const std::exception& e)
9858 SWIG_exception(SWIG_RuntimeError, e.what());
9861 resultobj = SWIG_From_int(static_cast< int >(result));
9862 return resultobj;
9863 fail:
9864 return NULL;
9868 SWIGINTERN PyObject *_wrap_WkbWriter_setByteOrder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9869 PyObject *resultobj = 0;
9870 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9871 int arg2 ;
9872 void *argp1 = 0 ;
9873 int res1 = 0 ;
9874 int val2 ;
9875 int ecode2 = 0 ;
9876 PyObject * obj0 = 0 ;
9877 PyObject * obj1 = 0 ;
9879 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_setByteOrder",2,2,&obj0,&obj1)) SWIG_fail;
9880 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
9881 if (!SWIG_IsOK(res1)) {
9882 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_setByteOrder" "', argument " "1"" of type '" "GeosWkbWriter *""'");
9884 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
9885 ecode2 = SWIG_AsVal_int(obj1, &val2);
9886 if (!SWIG_IsOK(ecode2)) {
9887 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WkbWriter_setByteOrder" "', argument " "2"" of type '" "int""'");
9889 arg2 = static_cast< int >(val2);
9893 GeosWkbWriter_setByteOrder(arg1,arg2);
9895 catch (const std::exception& e)
9897 SWIG_exception(SWIG_RuntimeError, e.what());
9900 resultobj = SWIG_Py_Void();
9901 return resultobj;
9902 fail:
9903 return NULL;
9907 SWIGINTERN PyObject *_wrap_WkbWriter_getIncludeSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9908 PyObject *resultobj = 0;
9909 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9910 void *argp1 = 0 ;
9911 int res1 = 0 ;
9912 PyObject * obj0 = 0 ;
9913 bool result;
9915 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_getIncludeSRID",1,1,&obj0)) SWIG_fail;
9916 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
9917 if (!SWIG_IsOK(res1)) {
9918 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_getIncludeSRID" "', argument " "1"" of type '" "GeosWkbWriter *""'");
9920 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
9924 result = (bool)GeosWkbWriter_getIncludeSRID(arg1);
9926 catch (const std::exception& e)
9928 SWIG_exception(SWIG_RuntimeError, e.what());
9931 resultobj = SWIG_From_bool(static_cast< bool >(result));
9932 return resultobj;
9933 fail:
9934 return NULL;
9938 SWIGINTERN PyObject *_wrap_WkbWriter_setIncludeSRID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9939 PyObject *resultobj = 0;
9940 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9941 bool arg2 ;
9942 void *argp1 = 0 ;
9943 int res1 = 0 ;
9944 bool val2 ;
9945 int ecode2 = 0 ;
9946 PyObject * obj0 = 0 ;
9947 PyObject * obj1 = 0 ;
9949 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_setIncludeSRID",2,2,&obj0,&obj1)) SWIG_fail;
9950 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
9951 if (!SWIG_IsOK(res1)) {
9952 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_setIncludeSRID" "', argument " "1"" of type '" "GeosWkbWriter *""'");
9954 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
9955 ecode2 = SWIG_AsVal_bool(obj1, &val2);
9956 if (!SWIG_IsOK(ecode2)) {
9957 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "WkbWriter_setIncludeSRID" "', argument " "2"" of type '" "bool""'");
9959 arg2 = static_cast< bool >(val2);
9963 GeosWkbWriter_setIncludeSRID(arg1,arg2);
9965 catch (const std::exception& e)
9967 SWIG_exception(SWIG_RuntimeError, e.what());
9970 resultobj = SWIG_Py_Void();
9971 return resultobj;
9972 fail:
9973 return NULL;
9977 SWIGINTERN PyObject *_wrap_WkbWriter_write(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
9978 PyObject *resultobj = 0;
9979 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
9980 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
9981 size_t *arg3 = (size_t *) 0 ;
9982 void *argp1 = 0 ;
9983 int res1 = 0 ;
9984 void *argp2 = 0 ;
9985 int res2 = 0 ;
9986 size_t temp3 = 0 ;
9987 PyObject * obj0 = 0 ;
9988 PyObject * obj1 = 0 ;
9989 unsigned char *result = 0 ;
9992 /* %typemap(in, numinputs=0) size_t *size (size_t temp3 = 0) */
9993 arg3 = &temp3;
9995 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_write",2,2,&obj0,&obj1)) SWIG_fail;
9996 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
9997 if (!SWIG_IsOK(res1)) {
9998 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_write" "', argument " "1"" of type '" "GeosWkbWriter *""'");
10000 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
10001 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
10002 if (!SWIG_IsOK(res2)) {
10003 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WkbWriter_write" "', argument " "2"" of type '" "GeosGeometry const *""'");
10005 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
10009 result = (unsigned char *)GeosWkbWriter_write(arg1,(GeosGeometry const *)arg2,arg3);
10011 catch (const std::exception& e)
10013 SWIG_exception(SWIG_RuntimeError, e.what());
10017 /* %typemap(out) unsigned char* */
10020 /* %typemap(argout) size_t *size */
10021 resultobj = SWIG_FromCharPtrAndSize((const char*)result, *arg3);
10024 /* %typemap(freearg) size_t *size */
10025 std::free(result);
10027 return resultobj;
10028 fail:
10030 /* %typemap(freearg) size_t *size */
10031 std::free(result);
10033 return NULL;
10037 SWIGINTERN PyObject *_wrap_WkbWriter_writeHEX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10038 PyObject *resultobj = 0;
10039 GeosWkbWriter *arg1 = (GeosWkbWriter *) 0 ;
10040 GeosGeometry *arg2 = (GeosGeometry *) 0 ;
10041 size_t *arg3 = (size_t *) 0 ;
10042 void *argp1 = 0 ;
10043 int res1 = 0 ;
10044 void *argp2 = 0 ;
10045 int res2 = 0 ;
10046 size_t temp3 = 0 ;
10047 PyObject * obj0 = 0 ;
10048 PyObject * obj1 = 0 ;
10049 unsigned char *result = 0 ;
10052 /* %typemap(in, numinputs=0) size_t *size (size_t temp3 = 0) */
10053 arg3 = &temp3;
10055 if(!PyArg_UnpackTuple(args,(char *)"WkbWriter_writeHEX",2,2,&obj0,&obj1)) SWIG_fail;
10056 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_GeosWkbWriter, 0 | 0 );
10057 if (!SWIG_IsOK(res1)) {
10058 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "WkbWriter_writeHEX" "', argument " "1"" of type '" "GeosWkbWriter *""'");
10060 arg1 = reinterpret_cast< GeosWkbWriter * >(argp1);
10061 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_GeosGeometry, 0 | 0 );
10062 if (!SWIG_IsOK(res2)) {
10063 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "WkbWriter_writeHEX" "', argument " "2"" of type '" "GeosGeometry const *""'");
10065 arg2 = reinterpret_cast< GeosGeometry * >(argp2);
10069 result = (unsigned char *)GeosWkbWriter_writeHEX(arg1,(GeosGeometry const *)arg2,arg3);
10071 catch (const std::exception& e)
10073 SWIG_exception(SWIG_RuntimeError, e.what());
10077 /* %typemap(out) unsigned char* */
10080 /* %typemap(argout) size_t *size */
10081 resultobj = SWIG_FromCharPtrAndSize((const char*)result, *arg3);
10084 /* %typemap(freearg) size_t *size */
10085 std::free(result);
10087 return resultobj;
10088 fail:
10090 /* %typemap(freearg) size_t *size */
10091 std::free(result);
10093 return NULL;
10097 SWIGINTERN PyObject *WkbWriter_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
10098 PyObject *obj;
10099 if (!PyArg_UnpackTuple(args,(char*)"swigregister", 1, 1,&obj)) return NULL;
10100 SWIG_TypeNewClientData(SWIGTYPE_p_GeosWkbWriter, SWIG_NewClientData(obj));
10101 return SWIG_Py_Void();
10104 static PyMethodDef SwigMethods[] = {
10105 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
10106 { (char *)"delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_VARARGS, NULL},
10107 { (char *)"SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_VARARGS, NULL},
10108 { (char *)"SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL},
10109 { (char *)"SwigPyIterator_decr", _wrap_SwigPyIterator_decr, METH_VARARGS, NULL},
10110 { (char *)"SwigPyIterator_distance", _wrap_SwigPyIterator_distance, METH_VARARGS, NULL},
10111 { (char *)"SwigPyIterator_equal", _wrap_SwigPyIterator_equal, METH_VARARGS, NULL},
10112 { (char *)"SwigPyIterator_copy", _wrap_SwigPyIterator_copy, METH_VARARGS, NULL},
10113 { (char *)"SwigPyIterator_next", _wrap_SwigPyIterator_next, METH_VARARGS, NULL},
10114 { (char *)"SwigPyIterator___next__", _wrap_SwigPyIterator___next__, METH_VARARGS, NULL},
10115 { (char *)"SwigPyIterator_previous", _wrap_SwigPyIterator_previous, METH_VARARGS, NULL},
10116 { (char *)"SwigPyIterator_advance", _wrap_SwigPyIterator_advance, METH_VARARGS, NULL},
10117 { (char *)"SwigPyIterator___eq__", _wrap_SwigPyIterator___eq__, METH_VARARGS, NULL},
10118 { (char *)"SwigPyIterator___ne__", _wrap_SwigPyIterator___ne__, METH_VARARGS, NULL},
10119 { (char *)"SwigPyIterator___iadd__", _wrap_SwigPyIterator___iadd__, METH_VARARGS, NULL},
10120 { (char *)"SwigPyIterator___isub__", _wrap_SwigPyIterator___isub__, METH_VARARGS, NULL},
10121 { (char *)"SwigPyIterator___add__", _wrap_SwigPyIterator___add__, METH_VARARGS, NULL},
10122 { (char *)"SwigPyIterator___sub__", _wrap_SwigPyIterator___sub__, METH_VARARGS, NULL},
10123 { (char *)"SwigPyIterator_swigregister", SwigPyIterator_swigregister, METH_VARARGS, NULL},
10124 { (char *)"version", _wrap_version, METH_VARARGS, NULL},
10125 { (char *)"new_CoordinateSequence", _wrap_new_CoordinateSequence, METH_VARARGS, NULL},
10126 { (char *)"delete_CoordinateSequence", _wrap_delete_CoordinateSequence, METH_VARARGS, NULL},
10127 { (char *)"CoordinateSequence_clone", _wrap_CoordinateSequence_clone, METH_VARARGS, NULL},
10128 { (char *)"CoordinateSequence_setX", _wrap_CoordinateSequence_setX, METH_VARARGS, NULL},
10129 { (char *)"CoordinateSequence_setY", _wrap_CoordinateSequence_setY, METH_VARARGS, NULL},
10130 { (char *)"CoordinateSequence_setZ", _wrap_CoordinateSequence_setZ, METH_VARARGS, NULL},
10131 { (char *)"CoordinateSequence_setOrdinate", _wrap_CoordinateSequence_setOrdinate, METH_VARARGS, NULL},
10132 { (char *)"CoordinateSequence_getX", _wrap_CoordinateSequence_getX, METH_VARARGS, NULL},
10133 { (char *)"CoordinateSequence_getY", _wrap_CoordinateSequence_getY, METH_VARARGS, NULL},
10134 { (char *)"CoordinateSequence_getZ", _wrap_CoordinateSequence_getZ, METH_VARARGS, NULL},
10135 { (char *)"CoordinateSequence_getOrdinate", _wrap_CoordinateSequence_getOrdinate, METH_VARARGS, NULL},
10136 { (char *)"CoordinateSequence_getSize", _wrap_CoordinateSequence_getSize, METH_VARARGS, NULL},
10137 { (char *)"CoordinateSequence_getDimensions", _wrap_CoordinateSequence_getDimensions, METH_VARARGS, NULL},
10138 { (char *)"CoordinateSequence_swigregister", CoordinateSequence_swigregister, METH_VARARGS, NULL},
10139 { (char *)"delete_Geometry", _wrap_delete_Geometry, METH_VARARGS, NULL},
10140 { (char *)"Geometry_clone", _wrap_Geometry_clone, METH_VARARGS, NULL},
10141 { (char *)"Geometry_geomType", _wrap_Geometry_geomType, METH_VARARGS, NULL},
10142 { (char *)"Geometry_typeId", _wrap_Geometry_typeId, METH_VARARGS, NULL},
10143 { (char *)"Geometry_normalize", _wrap_Geometry_normalize, METH_VARARGS, NULL},
10144 { (char *)"Geometry_getSRID", _wrap_Geometry_getSRID, METH_VARARGS, NULL},
10145 { (char *)"Geometry_setSRID", _wrap_Geometry_setSRID, METH_VARARGS, NULL},
10146 { (char *)"Geometry_getDimensions", _wrap_Geometry_getDimensions, METH_VARARGS, NULL},
10147 { (char *)"Geometry_getNumGeometries", _wrap_Geometry_getNumGeometries, METH_VARARGS, NULL},
10148 { (char *)"Geometry_intersection", _wrap_Geometry_intersection, METH_VARARGS, NULL},
10149 { (char *)"Geometry_buffer", _wrap_Geometry_buffer, METH_VARARGS, NULL},
10150 { (char *)"Geometry_convexHull", _wrap_Geometry_convexHull, METH_VARARGS, NULL},
10151 { (char *)"Geometry_difference", _wrap_Geometry_difference, METH_VARARGS, NULL},
10152 { (char *)"Geometry_symDifference", _wrap_Geometry_symDifference, METH_VARARGS, NULL},
10153 { (char *)"Geometry_boundary", _wrap_Geometry_boundary, METH_VARARGS, NULL},
10154 { (char *)"Geometry_union", _wrap_Geometry_union, METH_VARARGS, NULL},
10155 { (char *)"Geometry_pointOnSurface", _wrap_Geometry_pointOnSurface, METH_VARARGS, NULL},
10156 { (char *)"Geometry_getCentroid", _wrap_Geometry_getCentroid, METH_VARARGS, NULL},
10157 { (char *)"Geometry_getEnvelope", _wrap_Geometry_getEnvelope, METH_VARARGS, NULL},
10158 { (char *)"Geometry_relate", _wrap_Geometry_relate, METH_VARARGS, NULL},
10159 { (char *)"Geometry_lineMerge", _wrap_Geometry_lineMerge, METH_VARARGS, NULL},
10160 { (char *)"Geometry_simplify", _wrap_Geometry_simplify, METH_VARARGS, NULL},
10161 { (char *)"Geometry_topologyPreserveSimplify", _wrap_Geometry_topologyPreserveSimplify, METH_VARARGS, NULL},
10162 { (char *)"Geometry_relatePattern", _wrap_Geometry_relatePattern, METH_VARARGS, NULL},
10163 { (char *)"Geometry_disjoint", _wrap_Geometry_disjoint, METH_VARARGS, NULL},
10164 { (char *)"Geometry_touches", _wrap_Geometry_touches, METH_VARARGS, NULL},
10165 { (char *)"Geometry_intersects", _wrap_Geometry_intersects, METH_VARARGS, NULL},
10166 { (char *)"Geometry_crosses", _wrap_Geometry_crosses, METH_VARARGS, NULL},
10167 { (char *)"Geometry_within", _wrap_Geometry_within, METH_VARARGS, NULL},
10168 { (char *)"Geometry_contains", _wrap_Geometry_contains, METH_VARARGS, NULL},
10169 { (char *)"Geometry_overlaps", _wrap_Geometry_overlaps, METH_VARARGS, NULL},
10170 { (char *)"Geometry_equals", _wrap_Geometry_equals, METH_VARARGS, NULL},
10171 { (char *)"Geometry_equalsExact", _wrap_Geometry_equalsExact, METH_VARARGS, NULL},
10172 { (char *)"Geometry_isEmpty", _wrap_Geometry_isEmpty, METH_VARARGS, NULL},
10173 { (char *)"Geometry_isValid", _wrap_Geometry_isValid, METH_VARARGS, NULL},
10174 { (char *)"Geometry_isSimple", _wrap_Geometry_isSimple, METH_VARARGS, NULL},
10175 { (char *)"Geometry_isRing", _wrap_Geometry_isRing, METH_VARARGS, NULL},
10176 { (char *)"Geometry_hasZ", _wrap_Geometry_hasZ, METH_VARARGS, NULL},
10177 { (char *)"Geometry_area", _wrap_Geometry_area, METH_VARARGS, NULL},
10178 { (char *)"Geometry_length", _wrap_Geometry_length, METH_VARARGS, NULL},
10179 { (char *)"Geometry_distance", _wrap_Geometry_distance, METH_VARARGS, NULL},
10180 { (char *)"Geometry_swigregister", Geometry_swigregister, METH_VARARGS, NULL},
10181 { (char *)"delete_Point", _wrap_delete_Point, METH_VARARGS, NULL},
10182 { (char *)"Point_getCoordSeq", _wrap_Point_getCoordSeq, METH_VARARGS, NULL},
10183 { (char *)"Point_swigregister", Point_swigregister, METH_VARARGS, NULL},
10184 { (char *)"delete_LineString", _wrap_delete_LineString, METH_VARARGS, NULL},
10185 { (char *)"LineString_getCoordSeq", _wrap_LineString_getCoordSeq, METH_VARARGS, NULL},
10186 { (char *)"LineString_swigregister", LineString_swigregister, METH_VARARGS, NULL},
10187 { (char *)"delete_LinearRing", _wrap_delete_LinearRing, METH_VARARGS, NULL},
10188 { (char *)"LinearRing_getCoordSeq", _wrap_LinearRing_getCoordSeq, METH_VARARGS, NULL},
10189 { (char *)"LinearRing_swigregister", LinearRing_swigregister, METH_VARARGS, NULL},
10190 { (char *)"delete_Polygon", _wrap_delete_Polygon, METH_VARARGS, NULL},
10191 { (char *)"Polygon_getExteriorRing", _wrap_Polygon_getExteriorRing, METH_VARARGS, NULL},
10192 { (char *)"Polygon_getNumInteriorRings", _wrap_Polygon_getNumInteriorRings, METH_VARARGS, NULL},
10193 { (char *)"Polygon_getInteriorRingN", _wrap_Polygon_getInteriorRingN, METH_VARARGS, NULL},
10194 { (char *)"Polygon_swigregister", Polygon_swigregister, METH_VARARGS, NULL},
10195 { (char *)"delete_GeometryCollection", _wrap_delete_GeometryCollection, METH_VARARGS, NULL},
10196 { (char *)"GeometryCollection_getGeometryN", _wrap_GeometryCollection_getGeometryN, METH_VARARGS, NULL},
10197 { (char *)"GeometryCollection_swigregister", GeometryCollection_swigregister, METH_VARARGS, NULL},
10198 { (char *)"delete_MultiPoint", _wrap_delete_MultiPoint, METH_VARARGS, NULL},
10199 { (char *)"MultiPoint_swigregister", MultiPoint_swigregister, METH_VARARGS, NULL},
10200 { (char *)"delete_MultiLineString", _wrap_delete_MultiLineString, METH_VARARGS, NULL},
10201 { (char *)"MultiLineString_swigregister", MultiLineString_swigregister, METH_VARARGS, NULL},
10202 { (char *)"delete_MultiLinearRing", _wrap_delete_MultiLinearRing, METH_VARARGS, NULL},
10203 { (char *)"MultiLinearRing_swigregister", MultiLinearRing_swigregister, METH_VARARGS, NULL},
10204 { (char *)"delete_MultiPolygon", _wrap_delete_MultiPolygon, METH_VARARGS, NULL},
10205 { (char *)"MultiPolygon_swigregister", MultiPolygon_swigregister, METH_VARARGS, NULL},
10206 { (char *)"createPoint", _wrap_createPoint, METH_VARARGS, NULL},
10207 { (char *)"createLineString", _wrap_createLineString, METH_VARARGS, NULL},
10208 { (char *)"createLinearRing", _wrap_createLinearRing, METH_VARARGS, NULL},
10209 { (char *)"createPolygon", _wrap_createPolygon, METH_VARARGS, NULL},
10210 { (char *)"new_Prepared", _wrap_new_Prepared, METH_VARARGS, NULL},
10211 { (char *)"delete_Prepared", _wrap_delete_Prepared, METH_VARARGS, NULL},
10212 { (char *)"Prepared_contains", _wrap_Prepared_contains, METH_VARARGS, NULL},
10213 { (char *)"Prepared_containsProperly", _wrap_Prepared_containsProperly, METH_VARARGS, NULL},
10214 { (char *)"Prepared_covers", _wrap_Prepared_covers, METH_VARARGS, NULL},
10215 { (char *)"Prepared_intersects", _wrap_Prepared_intersects, METH_VARARGS, NULL},
10216 { (char *)"Prepared_swigregister", Prepared_swigregister, METH_VARARGS, NULL},
10217 { (char *)"new_STRtree", _wrap_new_STRtree, METH_VARARGS, NULL},
10218 { (char *)"delete_STRtree", _wrap_delete_STRtree, METH_VARARGS, NULL},
10219 { (char *)"STRtree_insert", _wrap_STRtree_insert, METH_VARARGS, NULL},
10220 { (char *)"STRtree_remove", _wrap_STRtree_remove, METH_VARARGS, NULL},
10221 { (char *)"STRtree_query", _wrap_STRtree_query, METH_VARARGS, NULL},
10222 { (char *)"STRtree_iterate", _wrap_STRtree_iterate, METH_VARARGS, NULL},
10223 { (char *)"STRtree_swigregister", STRtree_swigregister, METH_VARARGS, NULL},
10224 { (char *)"new_WktReader", _wrap_new_WktReader, METH_VARARGS, NULL},
10225 { (char *)"delete_WktReader", _wrap_delete_WktReader, METH_VARARGS, NULL},
10226 { (char *)"WktReader_read", _wrap_WktReader_read, METH_VARARGS, NULL},
10227 { (char *)"WktReader_swigregister", WktReader_swigregister, METH_VARARGS, NULL},
10228 { (char *)"new_WktWriter", _wrap_new_WktWriter, METH_VARARGS, NULL},
10229 { (char *)"delete_WktWriter", _wrap_delete_WktWriter, METH_VARARGS, NULL},
10230 { (char *)"WktWriter_write", _wrap_WktWriter_write, METH_VARARGS, NULL},
10231 { (char *)"WktWriter_swigregister", WktWriter_swigregister, METH_VARARGS, NULL},
10232 { (char *)"new_WkbReader", _wrap_new_WkbReader, METH_VARARGS, NULL},
10233 { (char *)"delete_WkbReader", _wrap_delete_WkbReader, METH_VARARGS, NULL},
10234 { (char *)"WkbReader_read", _wrap_WkbReader_read, METH_VARARGS, NULL},
10235 { (char *)"WkbReader_readHEX", _wrap_WkbReader_readHEX, METH_VARARGS, NULL},
10236 { (char *)"WkbReader_swigregister", WkbReader_swigregister, METH_VARARGS, NULL},
10237 { (char *)"new_WkbWriter", _wrap_new_WkbWriter, METH_VARARGS, NULL},
10238 { (char *)"delete_WkbWriter", _wrap_delete_WkbWriter, METH_VARARGS, NULL},
10239 { (char *)"WkbWriter_getOutputDimension", _wrap_WkbWriter_getOutputDimension, METH_VARARGS, NULL},
10240 { (char *)"WkbWriter_setOutputDimension", _wrap_WkbWriter_setOutputDimension, METH_VARARGS, NULL},
10241 { (char *)"WkbWriter_getByteOrder", _wrap_WkbWriter_getByteOrder, METH_VARARGS, NULL},
10242 { (char *)"WkbWriter_setByteOrder", _wrap_WkbWriter_setByteOrder, METH_VARARGS, NULL},
10243 { (char *)"WkbWriter_getIncludeSRID", _wrap_WkbWriter_getIncludeSRID, METH_VARARGS, NULL},
10244 { (char *)"WkbWriter_setIncludeSRID", _wrap_WkbWriter_setIncludeSRID, METH_VARARGS, NULL},
10245 { (char *)"WkbWriter_write", _wrap_WkbWriter_write, METH_VARARGS, NULL},
10246 { (char *)"WkbWriter_writeHEX", _wrap_WkbWriter_writeHEX, METH_VARARGS, NULL},
10247 { (char *)"WkbWriter_swigregister", WkbWriter_swigregister, METH_VARARGS, NULL},
10248 { NULL, NULL, 0, NULL }
10252 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
10254 static void *_p_GeosMultiPolygonTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10255 return (void *)((GeosGeometryCollection *) ((GeosMultiPolygon *) x));
10257 static void *_p_GeosMultiPointTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10258 return (void *)((GeosGeometryCollection *) ((GeosMultiPoint *) x));
10260 static void *_p_GeosMultiLineStringTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10261 return (void *)((GeosGeometryCollection *) ((GeosMultiLineString *) x));
10263 static void *_p_GeosMultiLinearRingTo_p_GeosGeometryCollection(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10264 return (void *)((GeosGeometryCollection *) ((GeosMultiLinearRing *) x));
10266 static void *_p_GeosPolygonTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10267 return (void *)((GeosGeometry *) ((GeosPolygon *) x));
10269 static void *_p_GeosMultiPolygonTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10270 return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiPolygon *) x));
10272 static void *_p_GeosPointTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10273 return (void *)((GeosGeometry *) ((GeosPoint *) x));
10275 static void *_p_GeosLineStringTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10276 return (void *)((GeosGeometry *) ((GeosLineString *) x));
10278 static void *_p_GeosLinearRingTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10279 return (void *)((GeosGeometry *) ((GeosLinearRing *) x));
10281 static void *_p_GeosMultiPointTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10282 return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiPoint *) x));
10284 static void *_p_GeosMultiLineStringTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10285 return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiLineString *) x));
10287 static void *_p_GeosMultiLinearRingTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10288 return (void *)((GeosGeometry *) (GeosGeometryCollection *) ((GeosMultiLinearRing *) x));
10290 static void *_p_GeosGeometryCollectionTo_p_GeosGeometry(void *x, int *SWIGUNUSEDPARM(newmemory)) {
10291 return (void *)((GeosGeometry *) ((GeosGeometryCollection *) x));
10293 static swig_type_info _swigt__p_GeosCoordinateSequence = {"_p_GeosCoordinateSequence", "GeosCoordinateSequence *", 0, 0, (void*)0, 0};
10294 static swig_type_info _swigt__p_GeosGeometry = {"_p_GeosGeometry", "GeosGeometry *", 0, 0, (void*)0, 0};
10295 static swig_type_info _swigt__p_GeosGeometryCollection = {"_p_GeosGeometryCollection", "GeosGeometryCollection *", 0, 0, (void*)0, 0};
10296 static swig_type_info _swigt__p_GeosIndexItem = {"_p_GeosIndexItem", "GeosIndexItem *", 0, 0, (void*)0, 0};
10297 static swig_type_info _swigt__p_GeosLineString = {"_p_GeosLineString", "GeosLineString *", 0, 0, (void*)0, 0};
10298 static swig_type_info _swigt__p_GeosLinearRing = {"_p_GeosLinearRing", "GeosLinearRing *", 0, 0, (void*)0, 0};
10299 static swig_type_info _swigt__p_GeosMultiLineString = {"_p_GeosMultiLineString", "GeosMultiLineString *", 0, 0, (void*)0, 0};
10300 static swig_type_info _swigt__p_GeosMultiLinearRing = {"_p_GeosMultiLinearRing", "GeosMultiLinearRing *", 0, 0, (void*)0, 0};
10301 static swig_type_info _swigt__p_GeosMultiPoint = {"_p_GeosMultiPoint", "GeosMultiPoint *", 0, 0, (void*)0, 0};
10302 static swig_type_info _swigt__p_GeosMultiPolygon = {"_p_GeosMultiPolygon", "GeosMultiPolygon *", 0, 0, (void*)0, 0};
10303 static swig_type_info _swigt__p_GeosPoint = {"_p_GeosPoint", "GeosPoint *", 0, 0, (void*)0, 0};
10304 static swig_type_info _swigt__p_GeosPolygon = {"_p_GeosPolygon", "GeosPolygon *", 0, 0, (void*)0, 0};
10305 static swig_type_info _swigt__p_GeosPreparedGeometry = {"_p_GeosPreparedGeometry", "GeosPreparedGeometry *", 0, 0, (void*)0, 0};
10306 static swig_type_info _swigt__p_GeosQueryCallback = {"_p_GeosQueryCallback", "GeosQueryCallback *", 0, 0, (void*)0, 0};
10307 static swig_type_info _swigt__p_GeosSTRtree = {"_p_GeosSTRtree", "GeosSTRtree *", 0, 0, (void*)0, 0};
10308 static swig_type_info _swigt__p_GeosWkbReader = {"_p_GeosWkbReader", "GeosWkbReader *", 0, 0, (void*)0, 0};
10309 static swig_type_info _swigt__p_GeosWkbWriter = {"_p_GeosWkbWriter", "GeosWkbWriter *", 0, 0, (void*)0, 0};
10310 static swig_type_info _swigt__p_GeosWktReader = {"_p_GeosWktReader", "GeosWktReader *", 0, 0, (void*)0, 0};
10311 static swig_type_info _swigt__p_GeosWktWriter = {"_p_GeosWktWriter", "GeosWktWriter *", 0, 0, (void*)0, 0};
10312 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
10313 static swig_type_info _swigt__p_p_GeosLinearRing = {"_p_p_GeosLinearRing", "GeosLinearRing **", 0, 0, (void*)0, 0};
10314 static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
10315 static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0};
10316 static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0};
10317 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
10319 static swig_type_info *swig_type_initial[] = {
10320 &_swigt__p_GeosCoordinateSequence,
10321 &_swigt__p_GeosGeometry,
10322 &_swigt__p_GeosGeometryCollection,
10323 &_swigt__p_GeosIndexItem,
10324 &_swigt__p_GeosLineString,
10325 &_swigt__p_GeosLinearRing,
10326 &_swigt__p_GeosMultiLineString,
10327 &_swigt__p_GeosMultiLinearRing,
10328 &_swigt__p_GeosMultiPoint,
10329 &_swigt__p_GeosMultiPolygon,
10330 &_swigt__p_GeosPoint,
10331 &_swigt__p_GeosPolygon,
10332 &_swigt__p_GeosPreparedGeometry,
10333 &_swigt__p_GeosQueryCallback,
10334 &_swigt__p_GeosSTRtree,
10335 &_swigt__p_GeosWkbReader,
10336 &_swigt__p_GeosWkbWriter,
10337 &_swigt__p_GeosWktReader,
10338 &_swigt__p_GeosWktWriter,
10339 &_swigt__p_char,
10340 &_swigt__p_p_GeosLinearRing,
10341 &_swigt__p_size_t,
10342 &_swigt__p_std__invalid_argument,
10343 &_swigt__p_swig__SwigPyIterator,
10344 &_swigt__p_unsigned_char,
10347 static swig_cast_info _swigc__p_GeosCoordinateSequence[] = { {&_swigt__p_GeosCoordinateSequence, 0, 0, 0},{0, 0, 0, 0}};
10348 static swig_cast_info _swigc__p_GeosGeometry[] = { {&_swigt__p_GeosPolygon, _p_GeosPolygonTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosMultiPolygon, _p_GeosMultiPolygonTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosPoint, _p_GeosPointTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosGeometry, 0, 0, 0}, {&_swigt__p_GeosLineString, _p_GeosLineStringTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosLinearRing, _p_GeosLinearRingTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosMultiPoint, _p_GeosMultiPointTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosMultiLineString, _p_GeosMultiLineStringTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosMultiLinearRing, _p_GeosMultiLinearRingTo_p_GeosGeometry, 0, 0}, {&_swigt__p_GeosGeometryCollection, _p_GeosGeometryCollectionTo_p_GeosGeometry, 0, 0},{0, 0, 0, 0}};
10349 static swig_cast_info _swigc__p_GeosGeometryCollection[] = { {&_swigt__p_GeosMultiPolygon, _p_GeosMultiPolygonTo_p_GeosGeometryCollection, 0, 0}, {&_swigt__p_GeosMultiPoint, _p_GeosMultiPointTo_p_GeosGeometryCollection, 0, 0}, {&_swigt__p_GeosMultiLineString, _p_GeosMultiLineStringTo_p_GeosGeometryCollection, 0, 0}, {&_swigt__p_GeosMultiLinearRing, _p_GeosMultiLinearRingTo_p_GeosGeometryCollection, 0, 0}, {&_swigt__p_GeosGeometryCollection, 0, 0, 0},{0, 0, 0, 0}};
10350 static swig_cast_info _swigc__p_GeosIndexItem[] = { {&_swigt__p_GeosIndexItem, 0, 0, 0},{0, 0, 0, 0}};
10351 static swig_cast_info _swigc__p_GeosLineString[] = { {&_swigt__p_GeosLineString, 0, 0, 0},{0, 0, 0, 0}};
10352 static swig_cast_info _swigc__p_GeosLinearRing[] = { {&_swigt__p_GeosLinearRing, 0, 0, 0},{0, 0, 0, 0}};
10353 static swig_cast_info _swigc__p_GeosMultiLineString[] = { {&_swigt__p_GeosMultiLineString, 0, 0, 0},{0, 0, 0, 0}};
10354 static swig_cast_info _swigc__p_GeosMultiLinearRing[] = { {&_swigt__p_GeosMultiLinearRing, 0, 0, 0},{0, 0, 0, 0}};
10355 static swig_cast_info _swigc__p_GeosMultiPoint[] = { {&_swigt__p_GeosMultiPoint, 0, 0, 0},{0, 0, 0, 0}};
10356 static swig_cast_info _swigc__p_GeosMultiPolygon[] = { {&_swigt__p_GeosMultiPolygon, 0, 0, 0},{0, 0, 0, 0}};
10357 static swig_cast_info _swigc__p_GeosPoint[] = { {&_swigt__p_GeosPoint, 0, 0, 0},{0, 0, 0, 0}};
10358 static swig_cast_info _swigc__p_GeosPolygon[] = { {&_swigt__p_GeosPolygon, 0, 0, 0},{0, 0, 0, 0}};
10359 static swig_cast_info _swigc__p_GeosPreparedGeometry[] = { {&_swigt__p_GeosPreparedGeometry, 0, 0, 0},{0, 0, 0, 0}};
10360 static swig_cast_info _swigc__p_GeosQueryCallback[] = { {&_swigt__p_GeosQueryCallback, 0, 0, 0},{0, 0, 0, 0}};
10361 static swig_cast_info _swigc__p_GeosSTRtree[] = { {&_swigt__p_GeosSTRtree, 0, 0, 0},{0, 0, 0, 0}};
10362 static swig_cast_info _swigc__p_GeosWkbReader[] = { {&_swigt__p_GeosWkbReader, 0, 0, 0},{0, 0, 0, 0}};
10363 static swig_cast_info _swigc__p_GeosWkbWriter[] = { {&_swigt__p_GeosWkbWriter, 0, 0, 0},{0, 0, 0, 0}};
10364 static swig_cast_info _swigc__p_GeosWktReader[] = { {&_swigt__p_GeosWktReader, 0, 0, 0},{0, 0, 0, 0}};
10365 static swig_cast_info _swigc__p_GeosWktWriter[] = { {&_swigt__p_GeosWktWriter, 0, 0, 0},{0, 0, 0, 0}};
10366 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
10367 static swig_cast_info _swigc__p_p_GeosLinearRing[] = { {&_swigt__p_p_GeosLinearRing, 0, 0, 0},{0, 0, 0, 0}};
10368 static swig_cast_info _swigc__p_size_t[] = { {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
10369 static swig_cast_info _swigc__p_std__invalid_argument[] = { {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}};
10370 static swig_cast_info _swigc__p_swig__SwigPyIterator[] = { {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}};
10371 static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
10373 static swig_cast_info *swig_cast_initial[] = {
10374 _swigc__p_GeosCoordinateSequence,
10375 _swigc__p_GeosGeometry,
10376 _swigc__p_GeosGeometryCollection,
10377 _swigc__p_GeosIndexItem,
10378 _swigc__p_GeosLineString,
10379 _swigc__p_GeosLinearRing,
10380 _swigc__p_GeosMultiLineString,
10381 _swigc__p_GeosMultiLinearRing,
10382 _swigc__p_GeosMultiPoint,
10383 _swigc__p_GeosMultiPolygon,
10384 _swigc__p_GeosPoint,
10385 _swigc__p_GeosPolygon,
10386 _swigc__p_GeosPreparedGeometry,
10387 _swigc__p_GeosQueryCallback,
10388 _swigc__p_GeosSTRtree,
10389 _swigc__p_GeosWkbReader,
10390 _swigc__p_GeosWkbWriter,
10391 _swigc__p_GeosWktReader,
10392 _swigc__p_GeosWktWriter,
10393 _swigc__p_char,
10394 _swigc__p_p_GeosLinearRing,
10395 _swigc__p_size_t,
10396 _swigc__p_std__invalid_argument,
10397 _swigc__p_swig__SwigPyIterator,
10398 _swigc__p_unsigned_char,
10402 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
10404 static swig_const_info swig_const_table[] = {
10405 {0, 0, 0, 0.0, 0, 0}};
10407 #ifdef __cplusplus
10409 #endif
10410 /* -----------------------------------------------------------------------------
10411 * Type initialization:
10412 * This problem is tough by the requirement that no dynamic
10413 * memory is used. Also, since swig_type_info structures store pointers to
10414 * swig_cast_info structures and swig_cast_info structures store pointers back
10415 * to swig_type_info structures, we need some lookup code at initialization.
10416 * The idea is that swig generates all the structures that are needed.
10417 * The runtime then collects these partially filled structures.
10418 * The SWIG_InitializeModule function takes these initial arrays out of
10419 * swig_module, and does all the lookup, filling in the swig_module.types
10420 * array with the correct data and linking the correct swig_cast_info
10421 * structures together.
10423 * The generated swig_type_info structures are assigned staticly to an initial
10424 * array. We just loop through that array, and handle each type individually.
10425 * First we lookup if this type has been already loaded, and if so, use the
10426 * loaded structure instead of the generated one. Then we have to fill in the
10427 * cast linked list. The cast data is initially stored in something like a
10428 * two-dimensional array. Each row corresponds to a type (there are the same
10429 * number of rows as there are in the swig_type_initial array). Each entry in
10430 * a column is one of the swig_cast_info structures for that type.
10431 * The cast_initial array is actually an array of arrays, because each row has
10432 * a variable number of columns. So to actually build the cast linked list,
10433 * we find the array of casts associated with the type, and loop through it
10434 * adding the casts to the list. The one last trick we need to do is making
10435 * sure the type pointer in the swig_cast_info struct is correct.
10437 * First off, we lookup the cast->type name to see if it is already loaded.
10438 * There are three cases to handle:
10439 * 1) If the cast->type has already been loaded AND the type we are adding
10440 * casting info to has not been loaded (it is in this module), THEN we
10441 * replace the cast->type pointer with the type pointer that has already
10442 * been loaded.
10443 * 2) If BOTH types (the one we are adding casting info to, and the
10444 * cast->type) are loaded, THEN the cast info has already been loaded by
10445 * the previous module so we just ignore it.
10446 * 3) Finally, if cast->type has not already been loaded, then we add that
10447 * swig_cast_info to the linked list (because the cast->type) pointer will
10448 * be correct.
10449 * ----------------------------------------------------------------------------- */
10451 #ifdef __cplusplus
10452 extern "C" {
10453 #if 0
10454 } /* c-mode */
10455 #endif
10456 #endif
10458 #if 0
10459 #define SWIGRUNTIME_DEBUG
10460 #endif
10463 SWIGRUNTIME void
10464 SWIG_InitializeModule(void *clientdata) {
10465 size_t i;
10466 swig_module_info *module_head, *iter;
10467 int found, init;
10469 /* check to see if the circular list has been setup, if not, set it up */
10470 if (swig_module.next==0) {
10471 /* Initialize the swig_module */
10472 swig_module.type_initial = swig_type_initial;
10473 swig_module.cast_initial = swig_cast_initial;
10474 swig_module.next = &swig_module;
10475 init = 1;
10476 } else {
10477 init = 0;
10480 /* Try and load any already created modules */
10481 module_head = SWIG_GetModule(clientdata);
10482 if (!module_head) {
10483 /* This is the first module loaded for this interpreter */
10484 /* so set the swig module into the interpreter */
10485 SWIG_SetModule(clientdata, &swig_module);
10486 module_head = &swig_module;
10487 } else {
10488 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
10489 found=0;
10490 iter=module_head;
10491 do {
10492 if (iter==&swig_module) {
10493 found=1;
10494 break;
10496 iter=iter->next;
10497 } while (iter!= module_head);
10499 /* if the is found in the list, then all is done and we may leave */
10500 if (found) return;
10501 /* otherwise we must add out module into the list */
10502 swig_module.next = module_head->next;
10503 module_head->next = &swig_module;
10506 /* When multiple interpeters are used, a module could have already been initialized in
10507 a different interpreter, but not yet have a pointer in this interpreter.
10508 In this case, we do not want to continue adding types... everything should be
10509 set up already */
10510 if (init == 0) return;
10512 /* Now work on filling in swig_module.types */
10513 #ifdef SWIGRUNTIME_DEBUG
10514 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
10515 #endif
10516 for (i = 0; i < swig_module.size; ++i) {
10517 swig_type_info *type = 0;
10518 swig_type_info *ret;
10519 swig_cast_info *cast;
10521 #ifdef SWIGRUNTIME_DEBUG
10522 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
10523 #endif
10525 /* if there is another module already loaded */
10526 if (swig_module.next != &swig_module) {
10527 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
10529 if (type) {
10530 /* Overwrite clientdata field */
10531 #ifdef SWIGRUNTIME_DEBUG
10532 printf("SWIG_InitializeModule: found type %s\n", type->name);
10533 #endif
10534 if (swig_module.type_initial[i]->clientdata) {
10535 type->clientdata = swig_module.type_initial[i]->clientdata;
10536 #ifdef SWIGRUNTIME_DEBUG
10537 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
10538 #endif
10540 } else {
10541 type = swig_module.type_initial[i];
10544 /* Insert casting types */
10545 cast = swig_module.cast_initial[i];
10546 while (cast->type) {
10547 /* Don't need to add information already in the list */
10548 ret = 0;
10549 #ifdef SWIGRUNTIME_DEBUG
10550 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
10551 #endif
10552 if (swig_module.next != &swig_module) {
10553 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
10554 #ifdef SWIGRUNTIME_DEBUG
10555 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
10556 #endif
10558 if (ret) {
10559 if (type == swig_module.type_initial[i]) {
10560 #ifdef SWIGRUNTIME_DEBUG
10561 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
10562 #endif
10563 cast->type = ret;
10564 ret = 0;
10565 } else {
10566 /* Check for casting already in the list */
10567 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
10568 #ifdef SWIGRUNTIME_DEBUG
10569 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
10570 #endif
10571 if (!ocast) ret = 0;
10575 if (!ret) {
10576 #ifdef SWIGRUNTIME_DEBUG
10577 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
10578 #endif
10579 if (type->cast) {
10580 type->cast->prev = cast;
10581 cast->next = type->cast;
10583 type->cast = cast;
10585 cast++;
10587 /* Set entry in modules->types array equal to the type */
10588 swig_module.types[i] = type;
10590 swig_module.types[i] = 0;
10592 #ifdef SWIGRUNTIME_DEBUG
10593 printf("**** SWIG_InitializeModule: Cast List ******\n");
10594 for (i = 0; i < swig_module.size; ++i) {
10595 int j = 0;
10596 swig_cast_info *cast = swig_module.cast_initial[i];
10597 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
10598 while (cast->type) {
10599 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
10600 cast++;
10601 ++j;
10603 printf("---- Total casts: %d\n",j);
10605 printf("**** SWIG_InitializeModule: Cast List ******\n");
10606 #endif
10609 /* This function will propagate the clientdata field of type to
10610 * any new swig_type_info structures that have been added into the list
10611 * of equivalent types. It is like calling
10612 * SWIG_TypeClientData(type, clientdata) a second time.
10614 SWIGRUNTIME void
10615 SWIG_PropagateClientData(void) {
10616 size_t i;
10617 swig_cast_info *equiv;
10618 static int init_run = 0;
10620 if (init_run) return;
10621 init_run = 1;
10623 for (i = 0; i < swig_module.size; i++) {
10624 if (swig_module.types[i]->clientdata) {
10625 equiv = swig_module.types[i]->cast;
10626 while (equiv) {
10627 if (!equiv->converter) {
10628 if (equiv->type && !equiv->type->clientdata)
10629 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
10631 equiv = equiv->next;
10637 #ifdef __cplusplus
10638 #if 0
10640 /* c-mode */
10641 #endif
10643 #endif
10647 #ifdef __cplusplus
10648 extern "C" {
10649 #endif
10651 /* Python-specific SWIG API */
10652 #define SWIG_newvarlink() SWIG_Python_newvarlink()
10653 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
10654 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
10656 /* -----------------------------------------------------------------------------
10657 * global variable support code.
10658 * ----------------------------------------------------------------------------- */
10660 typedef struct swig_globalvar {
10661 char *name; /* Name of global variable */
10662 PyObject *(*get_attr)(void); /* Return the current value */
10663 int (*set_attr)(PyObject *); /* Set the value */
10664 struct swig_globalvar *next;
10665 } swig_globalvar;
10667 typedef struct swig_varlinkobject {
10668 PyObject_HEAD
10669 swig_globalvar *vars;
10670 } swig_varlinkobject;
10672 SWIGINTERN PyObject *
10673 swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
10674 #if PY_VERSION_HEX >= 0x03000000
10675 return PyUnicode_InternFromString("<Swig global variables>");
10676 #else
10677 return PyString_FromString("<Swig global variables>");
10678 #endif
10681 SWIGINTERN PyObject *
10682 swig_varlink_str(swig_varlinkobject *v) {
10683 #if PY_VERSION_HEX >= 0x03000000
10684 PyObject *str = PyUnicode_InternFromString("(");
10685 PyObject *tail;
10686 PyObject *joined;
10687 swig_globalvar *var;
10688 for (var = v->vars; var; var=var->next) {
10689 tail = PyUnicode_FromString(var->name);
10690 joined = PyUnicode_Concat(str, tail);
10691 Py_DecRef(str);
10692 Py_DecRef(tail);
10693 str = joined;
10694 if (var->next) {
10695 tail = PyUnicode_InternFromString(", ");
10696 joined = PyUnicode_Concat(str, tail);
10697 Py_DecRef(str);
10698 Py_DecRef(tail);
10699 str = joined;
10702 tail = PyUnicode_InternFromString(")");
10703 joined = PyUnicode_Concat(str, tail);
10704 Py_DecRef(str);
10705 Py_DecRef(tail);
10706 str = joined;
10707 #else
10708 PyObject *str = PyString_FromString("(");
10709 swig_globalvar *var;
10710 for (var = v->vars; var; var=var->next) {
10711 PyString_ConcatAndDel(&str,PyString_FromString(var->name));
10712 if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
10714 PyString_ConcatAndDel(&str,PyString_FromString(")"));
10715 #endif
10716 return str;
10719 SWIGINTERN int
10720 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
10721 char *tmp;
10722 PyObject *str = swig_varlink_str(v);
10723 fprintf(fp,"Swig global variables ");
10724 fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
10725 SWIG_Python_str_DelForPy3(tmp);
10726 Py_DECREF(str);
10727 return 0;
10730 SWIGINTERN void
10731 swig_varlink_dealloc(swig_varlinkobject *v) {
10732 swig_globalvar *var = v->vars;
10733 while (var) {
10734 swig_globalvar *n = var->next;
10735 free(var->name);
10736 free(var);
10737 var = n;
10741 SWIGINTERN PyObject *
10742 swig_varlink_getattr(swig_varlinkobject *v, char *n) {
10743 PyObject *res = NULL;
10744 swig_globalvar *var = v->vars;
10745 while (var) {
10746 if (strcmp(var->name,n) == 0) {
10747 res = (*var->get_attr)();
10748 break;
10750 var = var->next;
10752 if (res == NULL && !PyErr_Occurred()) {
10753 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
10755 return res;
10758 SWIGINTERN int
10759 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
10760 int res = 1;
10761 swig_globalvar *var = v->vars;
10762 while (var) {
10763 if (strcmp(var->name,n) == 0) {
10764 res = (*var->set_attr)(p);
10765 break;
10767 var = var->next;
10769 if (res == 1 && !PyErr_Occurred()) {
10770 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
10772 return res;
10775 SWIGINTERN PyTypeObject*
10776 swig_varlink_type(void) {
10777 static char varlink__doc__[] = "Swig var link object";
10778 static PyTypeObject varlink_type;
10779 static int type_init = 0;
10780 if (!type_init) {
10781 const PyTypeObject tmp = {
10782 /* PyObject header changed in Python 3 */
10783 #if PY_VERSION_HEX >= 0x03000000
10784 PyVarObject_HEAD_INIT(NULL, 0)
10785 #else
10786 PyObject_HEAD_INIT(NULL)
10787 0, /* ob_size */
10788 #endif
10789 (char *)"swigvarlink", /* tp_name */
10790 sizeof(swig_varlinkobject), /* tp_basicsize */
10791 0, /* tp_itemsize */
10792 (destructor) swig_varlink_dealloc, /* tp_dealloc */
10793 (printfunc) swig_varlink_print, /* tp_print */
10794 (getattrfunc) swig_varlink_getattr, /* tp_getattr */
10795 (setattrfunc) swig_varlink_setattr, /* tp_setattr */
10796 0, /* tp_compare */
10797 (reprfunc) swig_varlink_repr, /* tp_repr */
10798 0, /* tp_as_number */
10799 0, /* tp_as_sequence */
10800 0, /* tp_as_mapping */
10801 0, /* tp_hash */
10802 0, /* tp_call */
10803 (reprfunc) swig_varlink_str, /* tp_str */
10804 0, /* tp_getattro */
10805 0, /* tp_setattro */
10806 0, /* tp_as_buffer */
10807 0, /* tp_flags */
10808 varlink__doc__, /* tp_doc */
10809 0, /* tp_traverse */
10810 0, /* tp_clear */
10811 0, /* tp_richcompare */
10812 0, /* tp_weaklistoffset */
10813 #if PY_VERSION_HEX >= 0x02020000
10814 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
10815 #endif
10816 #if PY_VERSION_HEX >= 0x02030000
10817 0, /* tp_del */
10818 #endif
10819 #if PY_VERSION_HEX >= 0x02060000
10820 0, /* tp_version */
10821 #endif
10822 #ifdef COUNT_ALLOCS
10823 0,0,0,0 /* tp_alloc -> tp_next */
10824 #endif
10826 varlink_type = tmp;
10827 type_init = 1;
10828 #if PY_VERSION_HEX < 0x02020000
10829 varlink_type.ob_type = &PyType_Type;
10830 #else
10831 if (PyType_Ready(&varlink_type) < 0)
10832 return NULL;
10833 #endif
10835 return &varlink_type;
10838 /* Create a variable linking object for use later */
10839 SWIGINTERN PyObject *
10840 SWIG_Python_newvarlink(void) {
10841 swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
10842 if (result) {
10843 result->vars = 0;
10845 return ((PyObject*) result);
10848 SWIGINTERN void
10849 SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
10850 swig_varlinkobject *v = (swig_varlinkobject *) p;
10851 swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
10852 if (gv) {
10853 size_t size = strlen(name)+1;
10854 gv->name = (char *)malloc(size);
10855 if (gv->name) {
10856 strncpy(gv->name,name,size);
10857 gv->get_attr = get_attr;
10858 gv->set_attr = set_attr;
10859 gv->next = v->vars;
10862 v->vars = gv;
10865 SWIGINTERN PyObject *
10866 SWIG_globals(void) {
10867 static PyObject *_SWIG_globals = 0;
10868 if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
10869 return _SWIG_globals;
10872 /* -----------------------------------------------------------------------------
10873 * constants/methods manipulation
10874 * ----------------------------------------------------------------------------- */
10876 /* Install Constants */
10877 SWIGINTERN void
10878 SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
10879 PyObject *obj = 0;
10880 size_t i;
10881 for (i = 0; constants[i].type; ++i) {
10882 switch(constants[i].type) {
10883 case SWIG_PY_POINTER:
10884 obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
10885 break;
10886 case SWIG_PY_BINARY:
10887 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
10888 break;
10889 default:
10890 obj = 0;
10891 break;
10893 if (obj) {
10894 PyDict_SetItemString(d, constants[i].name, obj);
10895 Py_DECREF(obj);
10900 /* -----------------------------------------------------------------------------*/
10901 /* Fix SwigMethods to carry the callback ptrs when needed */
10902 /* -----------------------------------------------------------------------------*/
10904 SWIGINTERN void
10905 SWIG_Python_FixMethods(PyMethodDef *methods,
10906 swig_const_info *const_table,
10907 swig_type_info **types,
10908 swig_type_info **types_initial) {
10909 size_t i;
10910 for (i = 0; methods[i].ml_name; ++i) {
10911 const char *c = methods[i].ml_doc;
10912 if (c && (c = strstr(c, "swig_ptr: "))) {
10913 int j;
10914 swig_const_info *ci = 0;
10915 const char *name = c + 10;
10916 for (j = 0; const_table[j].type; ++j) {
10917 if (strncmp(const_table[j].name, name,
10918 strlen(const_table[j].name)) == 0) {
10919 ci = &(const_table[j]);
10920 break;
10923 if (ci) {
10924 void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
10925 if (ptr) {
10926 size_t shift = (ci->ptype) - types;
10927 swig_type_info *ty = types_initial[shift];
10928 size_t ldoc = (c - methods[i].ml_doc);
10929 size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
10930 char *ndoc = (char*)malloc(ldoc + lptr + 10);
10931 if (ndoc) {
10932 char *buff = ndoc;
10933 strncpy(buff, methods[i].ml_doc, ldoc);
10934 buff += ldoc;
10935 strncpy(buff, "swig_ptr: ", 10);
10936 buff += 10;
10937 SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
10938 methods[i].ml_doc = ndoc;
10946 #ifdef __cplusplus
10948 #endif
10950 /* -----------------------------------------------------------------------------*
10951 * Partial Init method
10952 * -----------------------------------------------------------------------------*/
10954 #ifdef __cplusplus
10955 extern "C"
10956 #endif
10958 SWIGEXPORT
10959 #if PY_VERSION_HEX >= 0x03000000
10960 PyObject*
10961 #else
10962 void
10963 #endif
10964 SWIG_init(void) {
10965 PyObject *m, *d, *md;
10966 #if PY_VERSION_HEX >= 0x03000000
10967 static struct PyModuleDef SWIG_module = {
10968 # if PY_VERSION_HEX >= 0x03020000
10969 PyModuleDef_HEAD_INIT,
10970 # else
10972 PyObject_HEAD_INIT(NULL)
10973 NULL, /* m_init */
10974 0, /* m_index */
10975 NULL, /* m_copy */
10977 # endif
10978 (char *) SWIG_name,
10979 NULL,
10981 SwigMethods,
10982 NULL,
10983 NULL,
10984 NULL,
10985 NULL
10987 #endif
10989 #if defined(SWIGPYTHON_BUILTIN)
10990 static SwigPyClientData SwigPyObject_clientdata = {
10991 0, 0, 0, 0, 0, 0, 0
10993 static PyGetSetDef this_getset_def = {
10994 (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
10996 static SwigPyGetSet thisown_getset_closure = {
10997 (PyCFunction) SwigPyObject_own,
10998 (PyCFunction) SwigPyObject_own
11000 static PyGetSetDef thisown_getset_def = {
11001 (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
11003 PyObject *metatype_args;
11004 PyTypeObject *builtin_pytype;
11005 int builtin_base_count;
11006 swig_type_info *builtin_basetype;
11007 PyObject *tuple;
11008 PyGetSetDescrObject *static_getset;
11009 PyTypeObject *metatype;
11010 SwigPyClientData *cd;
11011 PyObject *public_interface, *public_symbol;
11012 PyObject *this_descr;
11013 PyObject *thisown_descr;
11014 int i;
11016 (void)builtin_pytype;
11017 (void)builtin_base_count;
11018 (void)builtin_basetype;
11019 (void)tuple;
11020 (void)static_getset;
11022 /* metatype is used to implement static member variables. */
11023 metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
11024 assert(metatype_args);
11025 metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
11026 assert(metatype);
11027 Py_DECREF(metatype_args);
11028 metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
11029 assert(PyType_Ready(metatype) >= 0);
11030 #endif
11032 /* Fix SwigMethods to carry the callback ptrs when needed */
11033 SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
11035 #if PY_VERSION_HEX >= 0x03000000
11036 m = PyModule_Create(&SWIG_module);
11037 #else
11038 m = Py_InitModule((char *) SWIG_name, SwigMethods);
11039 #endif
11040 md = d = PyModule_GetDict(m);
11041 (void)md;
11043 SWIG_InitializeModule(0);
11045 #ifdef SWIGPYTHON_BUILTIN
11046 SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
11047 assert(SwigPyObject_stype);
11048 cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
11049 if (!cd) {
11050 SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
11051 SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
11052 } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
11053 PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
11054 # if PY_VERSION_HEX >= 0x03000000
11055 return NULL;
11056 # else
11057 return;
11058 # endif
11061 /* All objects have a 'this' attribute */
11062 this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
11063 (void)this_descr;
11065 /* All objects have a 'thisown' attribute */
11066 thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
11067 (void)thisown_descr;
11069 public_interface = PyList_New(0);
11070 public_symbol = 0;
11071 (void)public_symbol;
11073 PyDict_SetItemString(md, "__all__", public_interface);
11074 Py_DECREF(public_interface);
11075 for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
11076 SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
11077 for (i = 0; swig_const_table[i].name != 0; ++i)
11078 SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
11079 #endif
11081 SWIG_InstallConstants(d,swig_const_table);
11083 SWIG_Python_SetConstant(d, "GEOS_VERSION_MAJOR",SWIG_From_int(static_cast< int >(3)));
11084 SWIG_Python_SetConstant(d, "GEOS_VERSION_MINOR",SWIG_From_int(static_cast< int >(5)));
11085 SWIG_Python_SetConstant(d, "GEOS_VERSION",SWIG_FromCharPtr("3.5.0dev"));
11086 SWIG_Python_SetConstant(d, "GEOS_JTS_PORT",SWIG_FromCharPtr("1.13.0"));
11087 SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_MAJOR",SWIG_From_int(static_cast< int >(1)));
11088 SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_MINOR",SWIG_From_int(static_cast< int >(9)));
11089 SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION_PATCH",SWIG_From_int(static_cast< int >(0)));
11090 SWIG_Python_SetConstant(d, "GEOS_CAPI_FIRST_INTERFACE",SWIG_From_int(static_cast< int >(1)));
11091 SWIG_Python_SetConstant(d, "GEOS_CAPI_LAST_INTERFACE",SWIG_From_int(static_cast< int >((1+9))));
11092 SWIG_Python_SetConstant(d, "GEOS_CAPI_VERSION",SWIG_FromCharPtr("3.5.0dev-CAPI-1.9.0"));
11093 SWIG_Python_SetConstant(d, "GEOS_POINT",SWIG_From_int(static_cast< int >(GEOS_POINT)));
11094 SWIG_Python_SetConstant(d, "GEOS_LINESTRING",SWIG_From_int(static_cast< int >(GEOS_LINESTRING)));
11095 SWIG_Python_SetConstant(d, "GEOS_LINEARRING",SWIG_From_int(static_cast< int >(GEOS_LINEARRING)));
11096 SWIG_Python_SetConstant(d, "GEOS_POLYGON",SWIG_From_int(static_cast< int >(GEOS_POLYGON)));
11097 SWIG_Python_SetConstant(d, "GEOS_MULTIPOINT",SWIG_From_int(static_cast< int >(GEOS_MULTIPOINT)));
11098 SWIG_Python_SetConstant(d, "GEOS_MULTILINESTRING",SWIG_From_int(static_cast< int >(GEOS_MULTILINESTRING)));
11099 SWIG_Python_SetConstant(d, "GEOS_MULTIPOLYGON",SWIG_From_int(static_cast< int >(GEOS_MULTIPOLYGON)));
11100 SWIG_Python_SetConstant(d, "GEOS_GEOMETRYCOLLECTION",SWIG_From_int(static_cast< int >(GEOS_GEOMETRYCOLLECTION)));
11101 SWIG_Python_SetConstant(d, "GEOS_WKB_XDR",SWIG_From_int(static_cast< int >(GEOS_WKB_XDR)));
11102 SWIG_Python_SetConstant(d, "GEOS_WKB_NDR",SWIG_From_int(static_cast< int >(GEOS_WKB_NDR)));
11104 initGEOS(noticeHandler, errorHandler);
11106 #if PY_VERSION_HEX >= 0x03000000
11107 return m;
11108 #else
11109 return;
11110 #endif