From: <js...@us...> - 2008-08-07 22:13:34
|
Revision: 5998 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=5998&view=rev Author: jswhit Date: 2008-08-07 22:13:31 +0000 (Thu, 07 Aug 2008) Log Message: ----------- fixes for geos 3 Modified Paths: -------------- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py trunk/toolkits/basemap/src/_geoslib.c trunk/toolkits/basemap/src/_geoslib.pyx Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-07 20:57:42 UTC (rev 5997) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2008-08-07 22:13:31 UTC (rev 5998) @@ -980,6 +980,10 @@ continue # create a GEOS geometry object. poly = Shape(b) + # this is a workaround to avoid + # GEOS_ERROR: TopologyException: found non-noded intersection between ... + # with geos 3.0.0 + poly = poly.simplify(1.e-10)[0] # if geometry instersects map projection # region, and doesn't have any invalid points, process it. if goodmask.all() and poly.intersects(boundarypolyxy): Modified: trunk/toolkits/basemap/src/_geoslib.c =================================================================== --- trunk/toolkits/basemap/src/_geoslib.c 2008-08-07 20:57:42 UTC (rev 5997) +++ trunk/toolkits/basemap/src/_geoslib.c 2008-08-07 22:13:31 UTC (rev 5998) @@ -1,4 +1,4 @@ -/* Generated by Cython 0.9.8 on Fri Jun 13 14:28:32 2008 */ +/* Generated by Cython 0.9.8 on Thu Aug 7 16:03:59 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -175,12 +175,10 @@ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/ +static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ + static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ - -static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ - static void __Pyx_WriteUnraisable(const char *name); /*proto*/ static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) { @@ -194,6 +192,8 @@ } } +static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ + static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ static INLINE PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i, int is_unsigned) { @@ -228,7 +228,7 @@ /* Type declarations */ -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":127 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":128 * initGEOS(notice_h, error_h) * * cdef class BaseGeometry: # <<<<<<<<<<<<<< @@ -243,7 +243,7 @@ PyObject *boundary; }; -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":214 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":253 * return (self.__class__,(self.boundary,)) * * cdef class Polygon(BaseGeometry): # <<<<<<<<<<<<<< @@ -255,7 +255,7 @@ struct __pyx_obj_8_geoslib_BaseGeometry __pyx_base; }; -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":270 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":309 * return area * * cdef class LineString(BaseGeometry): # <<<<<<<<<<<<<< @@ -267,7 +267,7 @@ struct __pyx_obj_8_geoslib_BaseGeometry __pyx_base; }; -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":302 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":341 * self.boundary = b * * cdef class Point(BaseGeometry): # <<<<<<<<<<<<<< @@ -298,12 +298,11 @@ /* Implementation of _geoslib */ static char __pyx_k_1[] = "0.1"; -static char __pyx_k_2[] = "2.2.3-CAPI-1.1.1"; -static char __pyx_k_3[] = "version 2.2.3 of the geos library is required"; 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"; @@ -315,11 +314,11 @@ static char __pyx_k_numpy[] = "numpy"; static char __pyx_k___version__[] = "__version__"; static char __pyx_k___geos_version__[] = "__geos_version__"; -static char __pyx_k_ValueError[] = "ValueError"; 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; @@ -331,15 +330,10 @@ static PyObject *__pyx_kp_numpy; static PyObject *__pyx_kp___version__; static PyObject *__pyx_kp___geos_version__; -static PyObject *__pyx_kp_ValueError; static PyObject *__pyx_kp_1; -static PyObject *__pyx_kp_2; -static PyObject *__pyx_kp_3; -static PyObject *__pyx_builtin_ValueError; - -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":100 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":101 * int GEOSCoordSeq_getSize(GEOSCoordSeq *s, unsigned int *size) * * cdef void notice_h(char *fmt, char*msg): # <<<<<<<<<<<<<< @@ -353,9 +347,9 @@ static PyObject *__pyx_kp_stdout; static PyObject *__pyx_kp_write; -static PyObject *__pyx_kp_4; +static PyObject *__pyx_kp_2; -static char __pyx_k_4[] = "GEOS_NOTICE: %s\n"; +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; @@ -368,31 +362,31 @@ __pyx_v_message = Py_None; Py_INCREF(Py_None); __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":101 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":102 * * cdef void notice_h(char *fmt, char*msg): * 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 = 101; __pyx_clineno = __LINE__; goto __pyx_L1;} + __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;} Py_DECREF(__pyx_v_format); __pyx_v_format = __pyx_1; __pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":102 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":103 * cdef void notice_h(char *fmt, char*msg): * format = PyString_FromString(fmt) * 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 = 102; __pyx_clineno = __LINE__; goto __pyx_L1;} + __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;} Py_DECREF(__pyx_v_message); __pyx_v_message = __pyx_1; __pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":103 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":104 * format = PyString_FromString(fmt) * message = PyString_FromString(msg) * try: # <<<<<<<<<<<<<< @@ -401,14 +395,14 @@ */ /*try:*/ { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":104 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":105 * message = PyString_FromString(msg) * try: * 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 = 104; __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 = 105; __pyx_clineno = __LINE__; goto __pyx_L2;} Py_DECREF(__pyx_v_warn_msg); __pyx_v_warn_msg = __pyx_1; __pyx_1 = 0; @@ -417,7 +411,7 @@ __pyx_L2:; Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":105 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":106 * try: * warn_msg = format % message * except: # <<<<<<<<<<<<<< @@ -426,9 +420,9 @@ */ /*except:*/ { __Pyx_AddTraceback("_geoslib.notice_h"); - if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1;} - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":106 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":107 * warn_msg = format % message * except: * warn_msg = format # <<<<<<<<<<<<<< @@ -445,23 +439,23 @@ } __pyx_L3:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":107 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":108 * except: * warn_msg = format * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) # <<<<<<<<<<<<<< * * cdef void error_h(char *fmt, char*msg): */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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 = 107; __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 = 108; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyNumber_Remainder(__pyx_kp_4, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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 = 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;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); __pyx_1 = 0; - __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -478,7 +472,7 @@ Py_DECREF(__pyx_v_warn_msg); } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":109 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":110 * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) * * cdef void error_h(char *fmt, char*msg): # <<<<<<<<<<<<<< @@ -490,9 +484,9 @@ static PyObject *__pyx_kp_stderr; -static PyObject *__pyx_kp_5; +static PyObject *__pyx_kp_3; -static char __pyx_k_5[] = "GEOS_ERROR: %s\n"; +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; @@ -505,31 +499,31 @@ __pyx_v_message = Py_None; Py_INCREF(Py_None); __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":110 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":111 * * cdef void error_h(char *fmt, char*msg): * 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 = 110; __pyx_clineno = __LINE__; goto __pyx_L1;} + __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;} Py_DECREF(__pyx_v_format); __pyx_v_format = __pyx_1; __pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":111 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":112 * cdef void error_h(char *fmt, char*msg): * format = PyString_FromString(fmt) * 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 = 111; __pyx_clineno = __LINE__; goto __pyx_L1;} + __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;} Py_DECREF(__pyx_v_message); __pyx_v_message = __pyx_1; __pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":112 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":113 * format = PyString_FromString(fmt) * message = PyString_FromString(msg) * try: # <<<<<<<<<<<<<< @@ -538,14 +532,14 @@ */ /*try:*/ { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":113 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":114 * message = PyString_FromString(msg) * try: * 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 = 113; __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 = 114; __pyx_clineno = __LINE__; goto __pyx_L2;} Py_DECREF(__pyx_v_warn_msg); __pyx_v_warn_msg = __pyx_1; __pyx_1 = 0; @@ -554,7 +548,7 @@ __pyx_L2:; Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":114 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":115 * try: * warn_msg = format % message * except: # <<<<<<<<<<<<<< @@ -563,9 +557,9 @@ */ /*except:*/ { __Pyx_AddTraceback("_geoslib.error_h"); - if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1;} - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":115 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":116 * warn_msg = format % message * except: * warn_msg = format # <<<<<<<<<<<<<< @@ -582,23 +576,23 @@ } __pyx_L3:; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":116 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":117 * except: * warn_msg = format * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) # <<<<<<<<<<<<<< * * # check library version */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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 = 116; __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 = 117; __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_kp_write); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyNumber_Remainder(__pyx_kp_5, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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 = 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;} PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); __pyx_1 = 0; - __pyx_1 = PyObject_Call(__pyx_3, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __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 = 117; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -615,7 +609,7 @@ Py_DECREF(__pyx_v_warn_msg); } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":119 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":120 * * # check library version * cdef geos_version(): # <<<<<<<<<<<<<< @@ -627,14 +621,14 @@ PyObject *__pyx_r; PyObject *__pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":120 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":121 * # check library version * cdef geos_version(): * return PyString_FromString(GEOSversion()) # <<<<<<<<<<<<<< * __geos_version__ = geos_version() # module variable. - * if __geos_version__ != "2.2.3-CAPI-1.1.1": + * #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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_1 = PyString_FromString(GEOSversion()); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -649,7 +643,7 @@ return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":132 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":133 * cdef public object boundary * * def is_valid(self): # <<<<<<<<<<<<<< @@ -663,7 +657,7 @@ PyObject *__pyx_r; char __pyx_1; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":134 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":135 * def is_valid(self): * cdef char valid * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<< @@ -672,7 +666,7 @@ */ __pyx_v_valid = GEOSisValid(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":135 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":136 * cdef char valid * valid = GEOSisValid(self._geom) * if valid: # <<<<<<<<<<<<<< @@ -682,7 +676,7 @@ __pyx_1 = __pyx_v_valid; if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":136 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":137 * valid = GEOSisValid(self._geom) * if valid: * return True # <<<<<<<<<<<<<< @@ -696,7 +690,7 @@ } /*else*/ { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":138 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":139 * return True * else: * return False # <<<<<<<<<<<<<< @@ -714,7 +708,7 @@ return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":140 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":141 * return False * * def geom_type(self): # <<<<<<<<<<<<<< @@ -727,14 +721,14 @@ PyObject *__pyx_r; PyObject *__pyx_1 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":141 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":142 * * def geom_type(self): * 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 = 141; __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 = 142; __pyx_clineno = __LINE__; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -749,7 +743,7 @@ return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":143 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":144 * return PyString_FromString(GEOSGeomType(self._geom)) * * def within(self, BaseGeometry geom): # <<<<<<<<<<<<<< @@ -764,9 +758,9 @@ 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", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __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 = 144; __pyx_clineno = __LINE__; goto __pyx_L1;} - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":146 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":147 * cdef GEOSGeom *g1, *g2 * cdef char answer * g1 = self._geom # <<<<<<<<<<<<<< @@ -775,7 +769,7 @@ */ __pyx_v_g1 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":147 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":148 * cdef char answer * g1 = self._geom * g2 = geom._geom # <<<<<<<<<<<<<< @@ -784,7 +778,7 @@ */ __pyx_v_g2 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)->_geom; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":148 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":149 * g1 = self._geom * g2 = geom._geom * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<< @@ -793,7 +787,7 @@ */ __pyx_v_answer = GEOSWithin(__pyx_v_g1, __pyx_v_g2); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":149 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":150 * g2 = geom._geom * answer = GEOSWithin(g1, g2) * if answer: # <<<<<<<<<<<<<< @@ -803,7 +797,7 @@ __pyx_1 = __pyx_v_answer; if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":150 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":151 * answer = GEOSWithin(g1, g2) * if answer: * return True # <<<<<<<<<<<<<< @@ -817,12 +811,12 @@ } /*else*/ { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":152 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":153 * return True * else: * return False # <<<<<<<<<<<<<< * - * def intersects(self, BaseGeometry geom): + * def simplify(self, tol): */ Py_INCREF(Py_False); __pyx_r = Py_False; @@ -839,9 +833,444 @@ return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":154 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":155 * return False * + * def simplify(self, tol): # <<<<<<<<<<<<<< + * cdef GEOSGeom *g1, *g3, *gout + * cdef double tolerance + */ + +static char __pyx_k_append[] = "append"; +static char __pyx_k_NotImplementedError[] = "NotImplementedError"; + +static PyObject *__pyx_kp_append; +static PyObject *__pyx_kp_NotImplementedError; + +static PyObject *__pyx_kp_4; + +static PyObject *__pyx_builtin_NotImplementedError; + +static char __pyx_k_4[] = "intersections of type '%s' not yet implemented"; + +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; + GEOSGeom *__pyx_v_g3; + GEOSGeom *__pyx_v_gout; + double __pyx_v_tolerance; + int __pyx_v_numgeoms; + int __pyx_v_i; + int __pyx_v_typeid; + PyObject *__pyx_v_b; + PyObject *__pyx_v_p; + PyObject *__pyx_v_pout; + PyObject *__pyx_v_type; + PyObject *__pyx_r; + double __pyx_1; + int __pyx_2; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 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); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":159 + * cdef double tolerance + * cdef int numgeoms, i, typeid + * tolerance = tol # <<<<<<<<<<<<<< + * g1 = self._geom + * g3 = GEOSSimplify(g1, tolerance) + */ + __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; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":160 + * cdef int numgeoms, i, typeid + * tolerance = tol + * g1 = self._geom # <<<<<<<<<<<<<< + * g3 = GEOSSimplify(g1, tolerance) + * typeid = GEOSGeomTypeId(g3) + */ + __pyx_v_g1 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":161 + * tolerance = tol + * g1 = self._geom + * g3 = GEOSSimplify(g1, tolerance) # <<<<<<<<<<<<<< + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + */ + __pyx_v_g3 = GEOSSimplify(__pyx_v_g1, __pyx_v_tolerance); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":162 + * g1 = self._geom + * g3 = GEOSSimplify(g1, tolerance) + * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< + * if typeid == GEOS_POLYGON: + * b = _get_coords(g3) + */ + __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":163 + * g3 = GEOSSimplify(g1, tolerance) + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< + * b = _get_coords(g3) + * p = Polygon(b) + */ + __pyx_2 = (__pyx_v_typeid == GEOS_POLYGON); + if (__pyx_2) { + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":164 + * typeid = GEOSGeomTypeId(g3) + * if typeid == GEOS_POLYGON: + * 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;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_3; + __pyx_3 = 0; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":165 + * if typeid == GEOS_POLYGON: + * b = _get_coords(g3) + * 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;} + Py_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_b); + __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 = 165; __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; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":166 + * b = _get_coords(g3) + * p = Polygon(b) + * 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;} + Py_INCREF(__pyx_v_p); + PyList_SET_ITEM(__pyx_3, 0, __pyx_v_p); + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = ((PyObject *)__pyx_3); + __pyx_3 = 0; + goto __pyx_L4; + } + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":167 + * p = Polygon(b) + * pout = [p] + * elif typeid == GEOS_LINESTRING: # <<<<<<<<<<<<<< + * b = _get_coords(g3) + * p = LineString(b) + */ + __pyx_2 = (__pyx_v_typeid == GEOS_LINESTRING); + if (__pyx_2) { + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":168 + * pout = [p] + * elif typeid == GEOS_LINESTRING: + * 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;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_4; + __pyx_4 = 0; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":169 + * elif typeid == GEOS_LINESTRING: + * b = _get_coords(g3) + * 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;} + Py_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_b); + __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 = 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; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":170 + * b = _get_coords(g3) + * p = LineString(b) + * 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;} + Py_INCREF(__pyx_v_p); + PyList_SET_ITEM(__pyx_3, 0, __pyx_v_p); + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = ((PyObject *)__pyx_3); + __pyx_3 = 0; + goto __pyx_L4; + } + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":171 + * p = LineString(b) + * pout = [p] + * elif typeid == GEOS_MULTIPOLYGON: # <<<<<<<<<<<<<< + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + */ + __pyx_2 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); + if (__pyx_2) { + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":172 + * pout = [p] + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":173 + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + * 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;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = ((PyObject *)__pyx_4); + __pyx_4 = 0; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":174 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * 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++) { + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":175 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * b = _get_coords(gout) + * p = Polygon(b) + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3, __pyx_v_i); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":176 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * 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;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_3; + __pyx_3 = 0; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":177 + * gout = GEOSGetGeometryN(g3, i) + * b = _get_coords(gout) + * 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;} + Py_INCREF(__pyx_v_b); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_b); + __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 = 177; __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; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":178 + * b = _get_coords(gout) + * p = Polygon(b) + * pout.append(p) # <<<<<<<<<<<<<< + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ + __pyx_4 = __Pyx_PyObject_Append(__pyx_v_pout, __pyx_v_p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + goto __pyx_L4; + } + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":179 + * p = Polygon(b) + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: # <<<<<<<<<<<<<< + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + */ + __pyx_2 = (__pyx_v_typeid == GEOS_MULTILINESTRING); + if (__pyx_2) { + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":180 + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< + * pout = [] + * for i from 0 <= i < numgeoms: + */ + __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":181 + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] # <<<<<<<<<<<<<< + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ + __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_DECREF(__pyx_v_pout); + __pyx_v_pout = ((PyObject *)__pyx_3); + __pyx_3 = 0; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":182 + * numgeoms = GEOSGetNumGeometries(g3) + * pout = [] + * 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++) { + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":183 + * pout = [] + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< + * b = _get_coords(gout) + * p = LineString(b) + */ + __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3, __pyx_v_i); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":184 + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + * b = _get_coords(gout) # <<<<<<<<<<<<<< + * p = LineString(b) + * pout.append(p) + */ + __pyx_4 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_DECREF(__pyx_v_b); + __pyx_v_b = __pyx_4; + __pyx_4 = 0; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":185 + * gout = GEOSGetGeometryN(g3, i) + * b = _get_coords(gout) + * p = LineString(b) # <<<<<<<<<<<<<< + * pout.append(p) + * else: + */ + __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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), ((PyObject *)__pyx_3), NULL); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":186 + * b = _get_coords(gout) + * p = LineString(b) + * pout.append(p) # <<<<<<<<<<<<<< + * else: + * type = PyString_FromString(GEOSGeomType(g3)) + */ + __pyx_3 = __Pyx_PyObject_Append(__pyx_v_pout, __pyx_v_p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + } + goto __pyx_L4; + } + /*else*/ { + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":188 + * pout.append(p) + * else: + * type = PyString_FromString(GEOSGeomType(g3)) # <<<<<<<<<<<<<< + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * GEOSGeom_destroy(g3) + */ + __pyx_4 = PyString_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_DECREF(__pyx_v_type); + __pyx_v_type = __pyx_4; + __pyx_4 = 0; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":189 + * else: + * type = PyString_FromString(GEOSGeomType(g3)) + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< + * GEOSGeom_destroy(g3) + * return pout + */ + __pyx_3 = PyNumber_Remainder(__pyx_kp_4, __pyx_v_type); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_Call(__pyx_builtin_NotImplementedError, ((PyObject *)__pyx_4), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1;} + Py_DECREF(((PyObject *)__pyx_4)); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1;} + } + __pyx_L4:; + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":190 + * type = PyString_FromString(GEOSGeomType(g3)) + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * GEOSGeom_destroy(g3) # <<<<<<<<<<<<<< + * return pout + * + */ + GEOSGeom_destroy(__pyx_v_g3); + + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":191 + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * GEOSGeom_destroy(g3) + * return pout # <<<<<<<<<<<<<< + * + * def intersects(self, BaseGeometry geom): + */ + Py_INCREF(__pyx_v_pout); + __pyx_r = __pyx_v_pout; + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_AddTraceback("_geoslib.BaseGeometry.simplify"); + __pyx_r = NULL; + __pyx_L0:; + Py_DECREF(__pyx_v_b); + Py_DECREF(__pyx_v_p); + Py_DECREF(__pyx_v_pout); + Py_DECREF(__pyx_v_type); + return __pyx_r; +} + +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":193 + * return pout + * * def intersects(self, BaseGeometry geom): # <<<<<<<<<<<<<< * cdef GEOSGeom *g1, *g2 * cdef char answer @@ -854,9 +1283,9 @@ 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", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __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 = 193; __pyx_clineno = __LINE__; goto __pyx_L1;} - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":157 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":196 * cdef GEOSGeom *g1, *g2 * cdef char answer * g1 = self._geom # <<<<<<<<<<<<<< @@ -865,7 +1294,7 @@ */ __pyx_v_g1 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":158 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":197 * cdef char answer * g1 = self._geom * g2 = geom._geom # <<<<<<<<<<<<<< @@ -874,7 +1303,7 @@ */ __pyx_v_g2 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)->_geom; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":159 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":198 * g1 = self._geom * g2 = geom._geom * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<< @@ -883,7 +1312,7 @@ */ __pyx_v_answer = GEOSIntersects(__pyx_v_g1, __pyx_v_g2); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":160 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":199 * g2 = geom._geom * answer = GEOSIntersects(g1, g2) * if answer: # <<<<<<<<<<<<<< @@ -893,7 +1322,7 @@ __pyx_1 = __pyx_v_answer; if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":161 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":200 * answer = GEOSIntersects(g1, g2) * if answer: * return True # <<<<<<<<<<<<<< @@ -907,7 +1336,7 @@ } /*else*/ { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":163 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":202 * return True * else: * return False # <<<<<<<<<<<<<< @@ -929,7 +1358,7 @@ return __pyx_r; } -/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":165 +/* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":204 * return False * * def intersection(self, BaseGeometry geom): # <<<<<<<<<<<<<< @@ -937,18 +1366,10 @@ * cdef char answer */ -static char __pyx_k_append[] = "append"; -static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +static PyObject *__pyx_kp_5; -static PyObject *__pyx_kp_append; -static PyObject *__pyx_kp_NotImplementedError; +static char __pyx_k_5[] = "intersections of type '%s' not yet implemented"; -static PyObject *__pyx_kp_6; - -static PyObject *__pyx_builtin_NotImplementedError; - -static char __pyx_k_6[] = "intersections of type '%s' not yet implemented"; - static PyObject *__pyx_pf_8_geoslib_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ static PyObject *__pyx_pf_8_geoslib_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { GEOSGeom *__pyx_v_g1; @@ -970,9 +1391,9 @@ __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); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __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 = 204; __pyx_clineno = __LINE__; goto __pyx_L1;} - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":169 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":208 * cdef char answer * cdef int numgeoms, i, typeid * g1 = self._geom # <<<<<<<<<<<<<< @@ -981,7 +1402,7 @@ */ __pyx_v_g1 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self)->_geom; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":170 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":209 * cdef int numgeoms, i, typeid * g1 = self._geom * g2 = geom._geom # <<<<<<<<<<<<<< @@ -990,7 +1411,7 @@ */ __pyx_v_g2 = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)->_geom; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":171 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":210 * g1 = self._geom * g2 = geom._geom * g3 = GEOSIntersection(g1, g2) # <<<<<<<<<<<<<< @@ -999,7 +1420,7 @@ */ __pyx_v_g3 = GEOSIntersection(__pyx_v_g1, __pyx_v_g2); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":172 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":211 * g2 = geom._geom * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< @@ -1008,7 +1429,7 @@ */ __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":173 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":212 * g3 = GEOSIntersection(g1, g2) * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< @@ -1018,42 +1439,42 @@ __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":174 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":213 * typeid = GEOSGeomTypeId(g3) * if typeid == GEOS_POLYGON: * b = _get_coords(g3) # <<<<<<<<<<<<<< * p = Polygon(b) * pout = [p] */ - __pyx_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_v_b); __pyx_v_b = __pyx_2; __pyx_2 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":175 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":214 * if typeid == GEOS_POLYGON: * b = _get_coords(g3) * p = Polygon(b) # <<<<<<<<<<<<<< * pout = [p] * elif typeid == GEOS_LINESTRING: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_INCREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b); - __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_Polygon), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_Polygon), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_3; __pyx_3 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":176 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":215 * b = _get_coords(g3) * p = Polygon(b) * pout = [p] # <<<<<<<<<<<<<< * elif typeid == GEOS_LINESTRING: * b = _get_coords(g3) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); Py_DECREF(__pyx_v_pout); @@ -1062,7 +1483,7 @@ goto __pyx_L4; } - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":177 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":216 * p = Polygon(b) * pout = [p] * elif typeid == GEOS_LINESTRING: # <<<<<<<<<<<<<< @@ -1072,42 +1493,42 @@ __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":178 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":217 * pout = [p] * elif typeid == GEOS_LINESTRING: * b = _get_coords(g3) # <<<<<<<<<<<<<< * p = LineString(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 = 178; __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 = 217; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_v_b); __pyx_v_b = __pyx_3; __pyx_3 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":179 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":218 * elif typeid == GEOS_LINESTRING: * b = _get_coords(g3) * p = LineString(b) # <<<<<<<<<<<<<< * pout = [p] * elif typeid == GEOS_MULTIPOLYGON: */ - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_INCREF(__pyx_v_b); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b); - __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_LineString), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyObject_Call(((PyObject*)__pyx_ptype_8_geoslib_LineString), ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0; Py_DECREF(__pyx_v_p); __pyx_v_p = __pyx_3; __pyx_3 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":180 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":219 * b = _get_coords(g3) * p = LineString(b) * pout = [p] # <<<<<<<<<<<<<< * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) */ - __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); Py_DECREF(__pyx_v_pout); @@ -1116,7 +1537,7 @@ goto __pyx_L4; } - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":181 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":220 * p = LineString(b) * pout = [p] * elif typeid == GEOS_MULTIPOLYGON: # <<<<<<<<<<<<<< @@ -1126,7 +1547,7 @@ __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); if (__pyx_1) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":182 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":221 * pout = [p] * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) # <<<<<<<<<<<<<< @@ -1135,19 +1556,19 @@ */ __pyx_v_numgeoms = GEOSGetNumGeometries(__pyx_v_g3); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":183 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":222 * elif typeid == GEOS_MULTIPOLYGON: * numgeoms = GEOSGetNumGeometries(g3) * pout = [] # <<<<<<<<<<<<<< * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) */ - __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_3 = PyList_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECREF(__pyx_v_pout); __pyx_v_pout = ((PyObject *)__pyx_3); __pyx_3 = 0; - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":184 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":223 * numgeoms = GEOSGetNumGeometries(g3) * pout = [] * for i from 0 <= i < numgeoms: # <<<<<<<<<<<<<< @@ -1156,7 +1577,7 @@ */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_numgeoms; __pyx_v_i++) { - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":185 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":224 * pout = [] * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) # <<<<<<<<<<<<<< @@ -1165,48 +1586,48 @@ */ __pyx_v_gout = GEOSGetGeometryN(__pyx_v_g3, __pyx_v_i); - /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":186 + /* "/Volumes/User/jwhitaker/matplotlib/basemap/src/_geoslib.pyx":225 * for i from 0 <= i < numgeoms: * gout = GEOSGetGeometryN(g3, i) * b = _get_coords(gout) # <<<<<<<<<<<<<< * p = Polygon(b) * pout.append(p) */ - __pyx_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1;} + __pyx_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1;} Py_DECRE... [truncated message content] |