|
From: <js...@us...> - 2008-08-08 12:05:38
|
Revision: 6002
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6002&view=rev
Author: jswhit
Date: 2008-08-08 12:05:35 +0000 (Fri, 08 Aug 2008)
Log Message:
-----------
handle geos major version number more gracefully.
Modified Paths:
--------------
trunk/toolkits/basemap/src/_geoslib.c
trunk/toolkits/basemap/src/_geoslib.pyx
Modified: trunk/toolkits/basemap/src/_geoslib.c
===================================================================
--- trunk/toolkits/basemap/src/_geoslib.c 2008-08-08 11:52:59 UTC (rev 6001)
+++ trunk/toolkits/basemap/src/_geoslib.c 2008-08-08 12:05:35 UTC (rev 6002)
@@ -1,4 +1,4 @@
-/* Generated by Cython 0.9.6.13.1 on Thu Aug 7 18:33:33 2008 */
+/* Generated by Cython 0.9.8 on Fri Aug 8 06:05:03 2008 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
@@ -6,6 +6,12 @@
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#if PY_VERSION_HEX < 0x02040000
+ #define METH_COEXIST 0
+#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
@@ -15,9 +21,69 @@
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#endif
-#if PY_VERSION_HEX < 0x02040000
- #define METH_COEXIST 0
+#if PY_VERSION_HEX < 0x02060000
+ #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
+ #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
+ #define Py_SIZE(ob) ((PyVarObject*)(ob))->ob_size)
+ #define PyVarObject_HEAD_INIT(type, size) \
+ PyObject_HEAD_INIT(type) size,
+
+ typedef struct {
+ void *buf;
+ Py_ssize_t len;
+ int readonly;
+ const char *format;
+ int ndim;
+ Py_ssize_t *shape;
+ Py_ssize_t *strides;
+ Py_ssize_t *suboffsets;
+ Py_ssize_t itemsize;
+ void *internal;
+ } Py_buffer;
+
+ #define PyBUF_SIMPLE 0
+ #define PyBUF_WRITABLE 0x0001
+ #define PyBUF_LOCK 0x0002
+ #define PyBUF_FORMAT 0x0004
+ #define PyBUF_ND 0x0008
+ #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
+ #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
+ #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
+ #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
+ #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#endif
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define Py_TPFLAGS_CHECKTYPES 0
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyString_Type PyBytes_Type
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+#else
+ #define PyBytes_Type PyString_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
+#endif
#ifndef __stdcall
#define __stdcall
#endif
@@ -30,6 +96,7 @@
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
+#define __PYX_HAVE_API___geoslib
#include "numpy/arrayobject.h"
#include "geos_c.h"
@@ -42,8 +109,7 @@
#define INLINE
#endif
-typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
-typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
+typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
@@ -52,6 +118,14 @@
/* Type Conversion Predeclarations */
+#if PY_MAJOR_VERSION < 3
+#define __Pyx_PyBytes_FromString PyString_FromString
+#define __Pyx_PyBytes_AsString PyString_AsString
+#else
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_AsString PyBytes_AsString
+#endif
+
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x);
static INLINE PY_LONG_LONG __pyx_PyInt_AsLongLong(PyObject* x);
@@ -91,11 +165,11 @@
static PyObject *__pyx_empty_tuple;
static int __pyx_lineno;
static int __pyx_clineno = 0;
-static char * __pyx_cfilenm= __FILE__;
-static char *__pyx_filename;
-static char **__pyx_f;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+static const char **__pyx_f;
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name, int exact); /*proto*/
static INLINE void __Pyx_RaiseArgtupleTooLong(Py_ssize_t num_expected, Py_ssize_t num_found); /*proto*/
@@ -105,30 +179,59 @@
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-static void __Pyx_WriteUnraisable(char *name); /*proto*/
+static void __Pyx_WriteUnraisable(const char *name); /*proto*/
+static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
+ if (likely(PyList_CheckExact(L))) {
+ if (PyList_Append(L, x) < 0) return NULL;
+ Py_INCREF(Py_None);
+ return Py_None; // this is just to have an accurate signature
+ }
+ else {
+ return PyObject_CallMethod(L, "append", "(O)", x);
+ }
+}
+
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
+static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) {
+ PyObject *r;
+ if (PyList_CheckExact(o) && 0 <= i && i < PyList_GET_SIZE(o)) {
+ r = PyList_GET_ITEM(o, i);
+ Py_INCREF(r);
+ }
+ else if (PyTuple_CheckExact(o) && 0 <= i && i < PyTuple_GET_SIZE(o)) {
+ r = PyTuple_GET_ITEM(o, i);
+ Py_INCREF(r);
+ }
+ else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0) || !is_unsigned))
+ r = PySequence_GetItem(o, i);
+ else {
+ PyObject *j = (likely(i >= 0) || !is_unsigned) ? PyInt_FromLong(i) : PyLong_FromUnsignedLongLong((sizeof(unsigned long long) > sizeof(Py_ssize_t) ? (1ULL << (sizeof(Py_ssize_t)*8)) : 0) + i);
+ if (!j)
+ return 0;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ }
+ return r;
+}
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-static int __Pyx_ExportFunction(char *n, void *f, char *s); /*proto*/
-
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
static PyObject *__Pyx_ImportModule(char *name); /*proto*/
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
+static void __Pyx_AddTraceback(const char *funcname); /*proto*/
-/* Declarations */
+/* Type declarations */
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":128
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":129
* initGEOS(notice_h, error_h)
*
- * cdef class BaseGeometry: # <<<<<<<<<<<<<<
+ * cdef class BaseGeometry: # <<<<<<<<<<<<<<
* cdef GEOSGeom *_geom
* cdef unsigned int _npts
*/
@@ -140,11 +243,11 @@
PyObject *boundary;
};
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":253
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":257
* return (self.__class__,(self.boundary,))
- *
- * cdef class Polygon(BaseGeometry): # <<<<<<<<<<<<<<
*
+ * cdef class Polygon(BaseGeometry): # <<<<<<<<<<<<<<
+ *
* def __init__(self, ndarray b):
*/
@@ -152,10 +255,10 @@
struct __pyx_obj_8_geoslib_BaseGeometry __pyx_base;
};
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":309
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":313
* return area
*
- * cdef class LineString(BaseGeometry): # <<<<<<<<<<<<<<
+ * cdef class LineString(BaseGeometry): # <<<<<<<<<<<<<<
* def __init__(self, ndarray b):
* cdef double dx, dy
*/
@@ -164,10 +267,10 @@
struct __pyx_obj_8_geoslib_BaseGeometry __pyx_base;
};
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":341
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":345
* self.boundary = b
*
- * cdef class Point(BaseGeometry): # <<<<<<<<<<<<<<
+ * cdef class Point(BaseGeometry): # <<<<<<<<<<<<<<
* cdef public x,y
* def __init__(self, b):
*/
@@ -177,7 +280,9 @@
PyObject *x;
PyObject *y;
};
+/* Module declarations from numpy */
+/* Module declarations from _geoslib */
static PyTypeObject *__pyx_ptype_8_geoslib_ndarray = 0;
static PyTypeObject *__pyx_ptype_8_geoslib_BaseGeometry = 0;
@@ -192,41 +297,60 @@
/* Implementation of _geoslib */
-static char __pyx_k_3[] = "0.1";
+static char __pyx_k_1[] = "0.1";
-static PyObject *__pyx_n_is_valid;
-static PyObject *__pyx_n_geom_type;
-static PyObject *__pyx_n_within;
-static PyObject *__pyx_n_simplify;
-static PyObject *__pyx_n_intersects;
-static PyObject *__pyx_n_intersection;
-static PyObject *__pyx_n_get_coords;
-static PyObject *__pyx_n___dealloc__;
-static PyObject *__pyx_n___reduce__;
-static PyObject *__pyx_n___init__;
-static PyObject *__pyx_n_area;
-static PyObject *__pyx_n_sys;
-static PyObject *__pyx_n_numpy;
-static PyObject *__pyx_n___version__;
-static PyObject *__pyx_n___geos_version__;
+static char __pyx_k_is_valid[] = "is_valid";
+static char __pyx_k_geom_type[] = "geom_type";
+static char __pyx_k_within[] = "within";
+static char __pyx_k_simplify[] = "simplify";
+static char __pyx_k_intersects[] = "intersects";
+static char __pyx_k_intersection[] = "intersection";
+static char __pyx_k_get_coords[] = "get_coords";
+static char __pyx_k___dealloc__[] = "__dealloc__";
+static char __pyx_k___reduce__[] = "__reduce__";
+static char __pyx_k___init__[] = "__init__";
+static char __pyx_k_area[] = "area";
+static char __pyx_k_sys[] = "sys";
+static char __pyx_k_numpy[] = "numpy";
+static char __pyx_k___version__[] = "__version__";
+static char __pyx_k___geos_version__[] = "__geos_version__";
-static PyObject *__pyx_k_3p;
+static PyObject *__pyx_kp_is_valid;
+static PyObject *__pyx_kp_geom_type;
+static PyObject *__pyx_kp_within;
+static PyObject *__pyx_kp_simplify;
+static PyObject *__pyx_kp_intersects;
+static PyObject *__pyx_kp_intersection;
+static PyObject *__pyx_kp_get_coords;
+static PyObject *__pyx_kp___dealloc__;
+static PyObject *__pyx_kp___reduce__;
+static PyObject *__pyx_kp___init__;
+static PyObject *__pyx_kp_area;
+static PyObject *__pyx_kp_sys;
+static PyObject *__pyx_kp_numpy;
+static PyObject *__pyx_kp___version__;
+static PyObject *__pyx_kp___geos_version__;
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":101
+static PyObject *__pyx_kp_1;
+
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":102
* int GEOSCoordSeq_getSize(GEOSCoordSeq *s, unsigned int *size)
*
- * cdef void notice_h(char *fmt, char*msg): # <<<<<<<<<<<<<<
+ * cdef void notice_h(char *fmt, char*msg): # <<<<<<<<<<<<<<
* format = PyString_FromString(fmt)
* message = PyString_FromString(msg)
*/
-static PyObject *__pyx_n_stdout;
-static PyObject *__pyx_n_write;
+static char __pyx_k_stdout[] = "stdout";
+static char __pyx_k_write[] = "write";
-static PyObject *__pyx_k_4p;
+static PyObject *__pyx_kp_stdout;
+static PyObject *__pyx_kp_write;
-static char __pyx_k_4[] = "GEOS_NOTICE: %s\n";
+static PyObject *__pyx_kp_2;
+static char __pyx_k_2[] = "GEOS_NOTICE: %s\n";
+
static void __pyx_f_8_geoslib_notice_h(char *__pyx_v_fmt, char *__pyx_v_msg) {
PyObject *__pyx_v_format;
PyObject *__pyx_v_message;
@@ -238,47 +362,47 @@
__pyx_v_message = Py_None; Py_INCREF(Py_None);
__pyx_v_warn_msg = Py_None; Py_INCREF(Py_None);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":102
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":103
*
* cdef void notice_h(char *fmt, char*msg):
- * format = PyString_FromString(fmt) # <<<<<<<<<<<<<<
+ * format = PyString_FromString(fmt) # <<<<<<<<<<<<<<
* message = PyString_FromString(msg)
* try:
*/
- __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_format);
__pyx_v_format = __pyx_1;
__pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":103
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":104
* cdef void notice_h(char *fmt, char*msg):
* format = PyString_FromString(fmt)
- * message = PyString_FromString(msg) # <<<<<<<<<<<<<<
+ * message = PyString_FromString(msg) # <<<<<<<<<<<<<<
* try:
* warn_msg = format % message
*/
- __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_message);
__pyx_v_message = __pyx_1;
__pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":104
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":105
* format = PyString_FromString(fmt)
* message = PyString_FromString(msg)
- * try: # <<<<<<<<<<<<<<
+ * try: # <<<<<<<<<<<<<<
* warn_msg = format % message
* except:
*/
/*try:*/ {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":105
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":106
* message = PyString_FromString(msg)
* try:
- * warn_msg = format % message # <<<<<<<<<<<<<<
+ * warn_msg = format % message # <<<<<<<<<<<<<<
* except:
* warn_msg = format
*/
- __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L2;}
+ __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L2;}
Py_DECREF(__pyx_v_warn_msg);
__pyx_v_warn_msg = __pyx_1;
__pyx_1 = 0;
@@ -287,21 +411,21 @@
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":106
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":107
* try:
* warn_msg = format % message
- * except: # <<<<<<<<<<<<<<
+ * except: # <<<<<<<<<<<<<<
* warn_msg = format
* sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg)
*/
/*except:*/ {
__Pyx_AddTraceback("_geoslib.notice_h");
- if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1;}
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":107
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":108
* warn_msg = format % message
* except:
- * warn_msg = format # <<<<<<<<<<<<<<
+ * warn_msg = format # <<<<<<<<<<<<<<
* sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg)
*
*/
@@ -315,25 +439,25 @@
}
__pyx_L3:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":108
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":109
* except:
* warn_msg = format
- * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) # <<<<<<<<<<<<<<
+ * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) # <<<<<<<<<<<<<<
*
* cdef void error_h(char *fmt, char*msg):
*/
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyNumber_Remainder(__pyx_k_4p, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyNumber_Remainder(__pyx_kp_2, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
- __pyx_1 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;
@@ -348,20 +472,22 @@
Py_DECREF(__pyx_v_warn_msg);
}
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":110
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":111
* sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg)
*
- * cdef void error_h(char *fmt, char*msg): # <<<<<<<<<<<<<<
+ * cdef void error_h(char *fmt, char*msg): # <<<<<<<<<<<<<<
* format = PyString_FromString(fmt)
* message = PyString_FromString(msg)
*/
-static PyObject *__pyx_n_stderr;
+static char __pyx_k_stderr[] = "stderr";
-static PyObject *__pyx_k_5p;
+static PyObject *__pyx_kp_stderr;
-static char __pyx_k_5[] = "GEOS_ERROR: %s\n";
+static PyObject *__pyx_kp_3;
+static char __pyx_k_3[] = "GEOS_ERROR: %s\n";
+
static void __pyx_f_8_geoslib_error_h(char *__pyx_v_fmt, char *__pyx_v_msg) {
PyObject *__pyx_v_format;
PyObject *__pyx_v_message;
@@ -373,47 +499,47 @@
__pyx_v_message = Py_None; Py_INCREF(Py_None);
__pyx_v_warn_msg = Py_None; Py_INCREF(Py_None);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":111
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":112
*
* cdef void error_h(char *fmt, char*msg):
- * format = PyString_FromString(fmt) # <<<<<<<<<<<<<<
+ * format = PyString_FromString(fmt) # <<<<<<<<<<<<<<
* message = PyString_FromString(msg)
* try:
*/
- __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyString_FromString(__pyx_v_fmt); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_format);
__pyx_v_format = __pyx_1;
__pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":112
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":113
* cdef void error_h(char *fmt, char*msg):
* format = PyString_FromString(fmt)
- * message = PyString_FromString(msg) # <<<<<<<<<<<<<<
+ * message = PyString_FromString(msg) # <<<<<<<<<<<<<<
* try:
* warn_msg = format % message
*/
- __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyString_FromString(__pyx_v_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_message);
__pyx_v_message = __pyx_1;
__pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":113
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":114
* format = PyString_FromString(fmt)
* message = PyString_FromString(msg)
- * try: # <<<<<<<<<<<<<<
+ * try: # <<<<<<<<<<<<<<
* warn_msg = format % message
* except:
*/
/*try:*/ {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":114
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":115
* message = PyString_FromString(msg)
* try:
- * warn_msg = format % message # <<<<<<<<<<<<<<
+ * warn_msg = format % message # <<<<<<<<<<<<<<
* except:
* warn_msg = format
*/
- __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L2;}
+ __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L2;}
Py_DECREF(__pyx_v_warn_msg);
__pyx_v_warn_msg = __pyx_1;
__pyx_1 = 0;
@@ -422,21 +548,21 @@
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":115
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":116
* try:
* warn_msg = format % message
- * except: # <<<<<<<<<<<<<<
+ * except: # <<<<<<<<<<<<<<
* warn_msg = format
* sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg)
*/
/*except:*/ {
__Pyx_AddTraceback("_geoslib.error_h");
- if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1;}
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":116
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":117
* warn_msg = format % message
* except:
- * warn_msg = format # <<<<<<<<<<<<<<
+ * warn_msg = format # <<<<<<<<<<<<<<
* sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg)
*
*/
@@ -450,25 +576,25 @@
}
__pyx_L3:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":117
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":118
* except:
* warn_msg = format
- * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<<
+ * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<<
*
* # check library version
*/
- __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_1 = PyNumber_Remainder(__pyx_k_5p, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyNumber_Remainder(__pyx_kp_3, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
- __pyx_1 = PyObject_Call(__pyx_3, __pyx_2, NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;
@@ -483,10 +609,10 @@
Py_DECREF(__pyx_v_warn_msg);
}
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":120
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":121
*
* # check library version
- * cdef geos_version(): # <<<<<<<<<<<<<<
+ * cdef geos_version(): # <<<<<<<<<<<<<<
* return PyString_FromString(GEOSversion())
* __geos_version__ = geos_version() # module variable.
*/
@@ -495,14 +621,14 @@
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":121
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":122
* # check library version
* cdef geos_version():
- * return PyString_FromString(GEOSversion()) # <<<<<<<<<<<<<<
+ * return PyString_FromString(GEOSversion()) # <<<<<<<<<<<<<<
* __geos_version__ = geos_version() # module variable.
* #if __geos_version__ != "2.2.3-CAPI-1.1.1":
*/
- __pyx_1 = PyString_FromString(GEOSversion()); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyString_FromString(GEOSversion()); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -517,10 +643,10 @@
return __pyx_r;
}
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":133
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":134
* cdef public object boundary
*
- * def is_valid(self): # <<<<<<<<<<<<<<
+ * def is_valid(self): # <<<<<<<<<<<<<<
* cdef char valid
* valid = GEOSisValid(self._geom)
*/
@@ -531,29 +657,29 @@
PyObject *__pyx_r;
char __pyx_1;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":135
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":136
* def is_valid(self):
* cdef char valid
- * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<<
+ * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<<
* if valid:
* return True
*/
__pyx_v_valid = GEOSisValid(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":136
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":137
* cdef char valid
* valid = GEOSisValid(self._geom)
- * if valid: # <<<<<<<<<<<<<<
+ * if valid: # <<<<<<<<<<<<<<
* return True
* else:
*/
__pyx_1 = __pyx_v_valid;
if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":137
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":138
* valid = GEOSisValid(self._geom)
* if valid:
- * return True # <<<<<<<<<<<<<<
+ * return True # <<<<<<<<<<<<<<
* else:
* return False
*/
@@ -564,10 +690,10 @@
}
/*else*/ {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":139
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":140
* return True
* else:
- * return False # <<<<<<<<<<<<<<
+ * return False # <<<<<<<<<<<<<<
*
* def geom_type(self):
*/
@@ -582,10 +708,10 @@
return __pyx_r;
}
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":141
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":142
* return False
*
- * def geom_type(self): # <<<<<<<<<<<<<<
+ * def geom_type(self): # <<<<<<<<<<<<<<
* return PyString_FromString(GEOSGeomType(self._geom))
*
*/
@@ -595,14 +721,14 @@
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":142
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":143
*
* def geom_type(self):
- * return PyString_FromString(GEOSGeomType(self._geom)) # <<<<<<<<<<<<<<
+ * return PyString_FromString(GEOSGeomType(self._geom)) # <<<<<<<<<<<<<<
*
* def within(self, BaseGeometry geom):
*/
- __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;
@@ -617,10 +743,10 @@
return __pyx_r;
}
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":144
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":145
* return PyString_FromString(GEOSGeomType(self._geom))
*
- * def within(self, BaseGeometry geom): # <<<<<<<<<<<<<<
+ * def within(self, BaseGeometry geom): # <<<<<<<<<<<<<<
* cdef GEOSGeom *g1, *g2
* cdef char answer
*/
@@ -632,49 +758,49 @@
char __pyx_v_answer;
PyObject *__pyx_r;
char __pyx_1;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1;}
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":147
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":148
* cdef GEOSGeom *g1, *g2
* cdef char answer
- * g1 = self._geom # <<<<<<<<<<<<<<
+ * g1 = self._geom # <<<<<<<<<<<<<<
* g2 = geom._geom
* answer = GEOSWithin(g1, g2)
*/
__pyx_v_g1 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":148
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":149
* cdef char answer
* g1 = self._geom
- * g2 = geom._geom # <<<<<<<<<<<<<<
+ * g2 = geom._geom # <<<<<<<<<<<<<<
* answer = GEOSWithin(g1, g2)
* if answer:
*/
__pyx_v_g2 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)->_geom;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":149
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":150
* g1 = self._geom
* g2 = geom._geom
- * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<<
+ * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<<
* if answer:
* return True
*/
__pyx_v_answer = GEOSWithin(__pyx_v_g1, __pyx_v_g2);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":150
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":151
* g2 = geom._geom
* answer = GEOSWithin(g1, g2)
- * if answer: # <<<<<<<<<<<<<<
+ * if answer: # <<<<<<<<<<<<<<
* return True
* else:
*/
__pyx_1 = __pyx_v_answer;
if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":151
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":152
* answer = GEOSWithin(g1, g2)
* if answer:
- * return True # <<<<<<<<<<<<<<
+ * return True # <<<<<<<<<<<<<<
* else:
* return False
*/
@@ -685,10 +811,10 @@
}
/*else*/ {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":153
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":154
* return True
* else:
- * return False # <<<<<<<<<<<<<<
+ * return False # <<<<<<<<<<<<<<
*
* def simplify(self, tol):
*/
@@ -707,24 +833,26 @@
return __pyx_r;
}
-/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":155
+/* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":156
* return False
*
- * def simplify(self, tol): # <<<<<<<<<<<<<<
+ * def simplify(self, tol): # <<<<<<<<<<<<<<
* cdef GEOSGeom *g1, *g3, *gout
* cdef double tolerance
*/
-static PyObject *__pyx_n_append;
-static PyObject *__pyx_n_NotImplementedError;
+static char __pyx_k_append[] = "append";
+static char __pyx_k_NotImplementedError[] = "NotImplementedError";
-static PyObject *__pyx_k_6p;
+static PyObject *__pyx_kp_append;
+static PyObject *__pyx_kp_NotImplementedError;
+static PyObject *__pyx_kp_4;
+
static PyObject *__pyx_builtin_NotImplementedError;
-static char __pyx_k_6[] = "intersections of type '%s' not yet implemented";
+static char __pyx_k_4[] = "intersections of type '%s' not yet implemented";
-#if GEOS_VERSION_MAJOR > 2
static PyObject *__pyx_pf_8_geoslib_12BaseGeometry_simplify(PyObject *__pyx_v_self, PyObject *__pyx_v_tol); /*proto*/
static PyObject *__pyx_pf_8_geoslib_12BaseGeometry_simplify(PyObject *__pyx_v_self, PyObject *__pyx_v_tol) {
GEOSGeom *__pyx_v_g1;
@@ -739,398 +867,409 @@
PyObject *__pyx_v_pout;
PyObject *__pyx_v_type;
PyObject *__pyx_r;
- double __pyx_1;
- int __pyx_2;
+ int __pyx_1;
+ double __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
- PyObject *__pyx_5 = 0;
__pyx_v_b = Py_None; Py_INCREF(Py_None);
__pyx_v_p = Py_None; Py_INCREF(Py_None);
__pyx_v_pout = Py_None; Py_INCREF(Py_None);
__pyx_v_type = Py_None; Py_INCREF(Py_None);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":159
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":160
* cdef double tolerance
* cdef int numgeoms, i, typeid
- * tolerance = tol # <<<<<<<<<<<<<<
- * g1 = self._geom
- * g3 = GEOSSimplify(g1, tolerance)
+ * g1 = self._geom # <<<<<<<<<<<<<<
+ * if GEOS_VERSION_MAJOR > 2:
+ * tolerance = tol
*/
- __pyx_1 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_v_tolerance = __pyx_1;
+ __pyx_v_g1 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":160
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":161
* cdef int numgeoms, i, typeid
- * tolerance = tol
- * g1 = self._geom # <<<<<<<<<<<<<<
- * g3 = GEOSSimplify(g1, tolerance)
- * typeid = GEOSGeomTypeId(g3)
+ * g1 = self._geom
+ * if GEOS_VERSION_MAJOR > 2: # <<<<<<<<<<<<<<
+ * tolerance = tol
+ * g3 = GEOSSimplify(g1, tolerance)
*/
- __pyx_v_g1 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom;
+ __pyx_1 = (GEOS_VERSION_MAJOR > 2);
+ if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":161
- * tolerance = tol
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":162
* g1 = self._geom
- * g3 = GEOSSimplify(g1, tolerance) # <<<<<<<<<<<<<<
+ * if GEOS_VERSION_MAJOR > 2:
+ * tolerance = tol # <<<<<<<<<<<<<<
+ * g3 = GEOSSimplify(g1, tolerance)
+ * else:
+ */
+ __pyx_2 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_v_tolerance = __pyx_2;
+
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":163
+ * if GEOS_VERSION_MAJOR > 2:
+ * tolerance = tol
+ * g3 = GEOSSimplify(g1, tolerance) # <<<<<<<<<<<<<<
+ * else:
+ * g3 = g1
+ */
+ __pyx_v_g3 = GEOSSimplify(__pyx_v_g1, __pyx_v_tolerance);
+ goto __pyx_L4;
+ }
+ /*else*/ {
+
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":165
+ * g3 = GEOSSimplify(g1, tolerance)
+ * else:
+ * g3 = g1 # <<<<<<<<<<<<<<
* typeid = GEOSGeomTypeId(g3)
* if typeid == GEOS_POLYGON:
*/
- __pyx_v_g3 = GEOSSimplify(__pyx_v_g1, __pyx_v_tolerance);
+ __pyx_v_g3 = __pyx_v_g1;
+ }
+ __pyx_L4:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":162
- * g1 = self._geom
- * g3 = GEOSSimplify(g1, tolerance)
- * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<<
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":166
+ * else:
+ * g3 = g1
+ * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<<
* if typeid == GEOS_POLYGON:
* b = _get_coords(g3)
*/
__pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":163
- * g3 = GEOSSimplify(g1, tolerance)
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":167
+ * g3 = g1
* typeid = GEOSGeomTypeId(g3)
- * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<<
+ * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<<
* b = _get_coords(g3)
* p = Polygon(b)
*/
- __pyx_2 = (__pyx_v_typeid == GEOS_POLYGON);
- if (__pyx_2) {
+ __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON);
+ if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":164
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":168
* typeid = GEOSGeomTypeId(g3)
* if typeid == GEOS_POLYGON:
- * b = _get_coords(g3) # <<<<<<<<<<<<<<
+ * b = _get_coords(g3) # <<<<<<<<<<<<<<
* p = Polygon(b)
* pout = [p]
*/
- __pyx_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_b);
__pyx_v_b = __pyx_3;
__pyx_3 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":165
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":169
* if typeid == GEOS_POLYGON:
* b = _get_coords(g3)
- * p = Polygon(b) # <<<<<<<<<<<<<<
+ * p = Polygon(b) # <<<<<<<<<<<<<<
* pout = [p]
* elif typeid == GEOS_LINESTRING:
*/
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_INCREF(__pyx_v_b);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_b);
- __pyx_4 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_Polygon), __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_Polygon), ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
Py_DECREF(__pyx_v_p);
__pyx_v_p = __pyx_4;
__pyx_4 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":166
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":170
* b = _get_coords(g3)
* p = Polygon(b)
- * pout = [p] # <<<<<<<<<<<<<<
+ * pout = [p] # <<<<<<<<<<<<<<
* elif typeid == GEOS_LINESTRING:
* b = _get_coords(g3)
*/
- __pyx_3 = PyList_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyList_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_INCREF(__pyx_v_p);
PyList_SET_ITEM(__pyx_3, 0, __pyx_v_p);
Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_3;
+ __pyx_v_pout = ((PyObject *)__pyx_3);
__pyx_3 = 0;
- goto __pyx_L4;
+ goto __pyx_L5;
}
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":167
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":171
* p = Polygon(b)
* pout = [p]
- * elif typeid == GEOS_LINESTRING: # <<<<<<<<<<<<<<
+ * elif typeid == GEOS_LINESTRING: # <<<<<<<<<<<<<<
* b = _get_coords(g3)
* p = LineString(b)
*/
- __pyx_2 = (__pyx_v_typeid == GEOS_LINESTRING);
- if (__pyx_2) {
+ __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING);
+ if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":168
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":172
* pout = [p]
* elif typeid == GEOS_LINESTRING:
- * b = _get_coords(g3) # <<<<<<<<<<<<<<
+ * b = _get_coords(g3) # <<<<<<<<<<<<<<
* p = LineString(b)
* pout = [p]
*/
- __pyx_4 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_b);
__pyx_v_b = __pyx_4;
__pyx_4 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":169
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":173
* elif typeid == GEOS_LINESTRING:
* b = _get_coords(g3)
- * p = LineString(b) # <<<<<<<<<<<<<<
+ * p = LineString(b) # <<<<<<<<<<<<<<
* pout = [p]
* elif typeid == GEOS_MULTIPOLYGON:
*/
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_INCREF(__pyx_v_b);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_b);
- __pyx_4 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_LineString), __pyx_3, NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __pyx_4 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_LineString), ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_3)); __pyx_3 = 0;
Py_DECREF(__pyx_v_p);
__pyx_v_p = __pyx_4;
__pyx_4 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":170
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":174
* b = _get_coords(g3)
* p = LineString(b)
- * pout = [p] # <<<<<<<<<<<<<<
+ * pout = [p] # <<<<<<<<<<<<<<
* elif typeid == GEOS_MULTIPOLYGON:
* numgeoms = GEOSGetNumGeometries(g3)
*/
- __pyx_3 = PyList_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyList_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_INCREF(__pyx_v_p);
PyList_SET_ITEM(__pyx_3, 0, __pyx_v_p);
Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_3;
+ __pyx_v_pout = ((PyObject *)__pyx_3);
__pyx_3 = 0;
- goto __pyx_L4;
+ goto __pyx_L5;
}
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":171
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":175
* p = LineString(b)
* pout = [p]
- * elif typeid == GEOS_MULTIPOLYGON: # <<<<<<<<<<<<<<
+ * elif typeid == GEOS_MULTIPOLYGON: # <<<<<<<<<<<<<<
* numgeoms = GEOSGetNumGeometries(g3)
* pout = []
*/
- __pyx_2 = (__pyx_v_typeid == GEOS_MULTIPOLYGON);
- if (__pyx_2) {
+ __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON);
+ if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":172
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":176
* pout = [p]
* elif typeid == GEOS_MULTIPOLYGON:
- * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<<
+ * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<<
* pout = []
* for i from 0 <= i < numgeoms:
*/
__pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":173
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":177
* elif typeid == GEOS_MULTIPOLYGON:
* numgeoms = GEOSGetNumGeometries(g3)
- * pout = [] # <<<<<<<<<<<<<<
+ * pout = [] # <<<<<<<<<<<<<<
* for i from 0 <= i < numgeoms:
* gout = GEOSGetGeometryN(g3, i)
*/
- __pyx_4 = PyList_New(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyList_New(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_4;
+ __pyx_v_pout = ((PyObject *)__pyx_4);
__pyx_4 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":174
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":178
* numgeoms = GEOSGetNumGeometries(g3)
* pout = []
- * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<<
+ * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<<
* gout = GEOSGetGeometryN(g3, i)
* b = _get_coords(gout)
*/
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":175
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":179
* pout = []
* for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<<
+ * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<<
* b = _get_coords(gout)
* p = Polygon(b)
*/
__pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3, __pyx_v_i);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":176
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":180
* for i from 0 <= i < numgeoms:
* gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout) # <<<<<<<<<<<<<<
+ * b = _get_coords(gout) # <<<<<<<<<<<<<<
* p = Polygon(b)
* pout.append(p)
*/
- __pyx_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_b);
__pyx_v_b = __pyx_3;
__pyx_3 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":177
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":181
* gout = GEOSGetGeometryN(g3, i)
* b = _get_coords(gout)
- * p = Polygon(b) # <<<<<<<<<<<<<<
+ * p = Polygon(b) # <<<<<<<<<<<<<<
* pout.append(p)
* elif typeid == GEOS_MULTILINESTRING:
*/
- __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_INCREF(__pyx_v_b);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_b);
- __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_Polygon), __pyx_4, NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
+ __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_Polygon), ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0;
Py_DECREF(__pyx_v_p);
__pyx_v_p = __pyx_3;
__pyx_3 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":178
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":182
* b = _get_coords(gout)
* p = Polygon(b)
- * pout.append(p) # <<<<<<<<<<<<<<
+ * pout.append(p) # <<<<<<<<<<<<<<
* elif typeid == GEOS_MULTILINESTRING:
* numgeoms = GEOSGetNumGeometries(g3)
*/
- __pyx_4 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1;}
- __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1;}
- Py_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p);
- __pyx_5 = PyObject_Call(__pyx_4, __pyx_3, NULL); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __Pyx_PyObject_Append(__pyx_v_pout, __pyx_v_p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
- Py_DECREF(__pyx_3); __pyx_3 = 0;
- Py_DECREF(__pyx_5); __pyx_5 = 0;
}
- goto __pyx_L4;
+ goto __pyx_L5;
}
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":179
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":183
* p = Polygon(b)
* pout.append(p)
- * elif typeid == GEOS_MULTILINESTRING: # <<<<<<<<<<<<<<
+ * elif typeid == GEOS_MULTILINESTRING: # <<<<<<<<<<<<<<
* numgeoms = GEOSGetNumGeometries(g3)
* pout = []
*/
- __pyx_2 = (__pyx_v_typeid == GEOS_MULTILINESTRING);
- if (__pyx_2) {
+ __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING);
+ if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":180
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":184
* pout.append(p)
* elif typeid == GEOS_MULTILINESTRING:
- * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<<
+ * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<<
* pout = []
* for i from 0 <= i < numgeoms:
*/
__pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":181
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":185
* elif typeid == GEOS_MULTILINESTRING:
* numgeoms = GEOSGetNumGeometries(g3)
- * pout = [] # <<<<<<<<<<<<<<
+ * pout = [] # <<<<<<<<<<<<<<
* for i from 0 <= i < numgeoms:
* gout = GEOSGetGeometryN(g3, i)
*/
- __pyx_4 = PyList_New(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_pout);
- __pyx_v_pout = __pyx_4;
- __pyx_4 = 0;
+ __pyx_v_pout = ((PyObject *)__pyx_3);
+ __pyx_3 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":182
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":186
* numgeoms = GEOSGetNumGeometries(g3)
* pout = []
- * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<<
+ * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<<
* gout = GEOSGetGeometryN(g3, i)
* b = _get_coords(gout)
*/
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":183
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":187
* pout = []
* for i from 0 <= i < numgeoms:
- * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<<
+ * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<<
* b = _get_coords(gout)
* p = LineString(b)
*/
__pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3, __pyx_v_i);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":184
+ /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geoslib.pyx":188
* for i from 0 <= i < numgeoms:
* gout = GEOSGetGeometryN(g3, i)
- * b = _get_coords(gout) # <<<<<<<<<<<<<<
+ * b = _get_coords(gout) # <<<<<<<<<<<<<<
* p = LineString(b)
* pout.append(p)
*/
- __pyx_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1;}
+ __pyx_4 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1;}
Py_DECREF(__pyx_v_b);
- __pyx_v_b = __pyx_3;
- __pyx_3 = 0;
+ __pyx_v_b = __pyx_4;
+ __pyx_4 = 0;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/...
[truncated message content] |