From: <js...@us...> - 2008-02-13 17:15:18
|
Revision: 4960 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=4960&view=rev Author: jswhit Date: 2008-02-13 09:15:11 -0800 (Wed, 13 Feb 2008) Log Message: ----------- renamed _geos to _geoslib, fixes for omerc Modified Paths: -------------- trunk/toolkits/basemap/Changelog trunk/toolkits/basemap/examples/test.py trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py trunk/toolkits/basemap/setup.py Added Paths: ----------- trunk/toolkits/basemap/src/_geoslib.c trunk/toolkits/basemap/src/_geoslib.pyx Removed Paths: ------------- trunk/toolkits/basemap/src/_geos.c trunk/toolkits/basemap/src/_geos.pyx Modified: trunk/toolkits/basemap/Changelog =================================================================== --- trunk/toolkits/basemap/Changelog 2008-02-13 13:50:29 UTC (rev 4959) +++ trunk/toolkits/basemap/Changelog 2008-02-13 17:15:11 UTC (rev 4960) @@ -6,6 +6,9 @@ namespace package, so basemap can now be installed if matplotlib is installed as an egg. Python 2.3 support re-enabled. + * changed _geos to _geoslib, so as not to conflict with + the python module bundled with the GEOS library. + * some fixes/enhancements for omerc projection. version 0.9.9.1 (svn revision 4808) * require python 2.4 (really only needed for building). Once namespace packages are re-enabled in matplotlib, Modified: trunk/toolkits/basemap/examples/test.py =================================================================== --- trunk/toolkits/basemap/examples/test.py 2008-02-13 13:50:29 UTC (rev 4959) +++ trunk/toolkits/basemap/examples/test.py 2008-02-13 17:15:11 UTC (rev 4960) @@ -196,10 +196,9 @@ # create new figure fig=figure() # setup oblique mercator basemap. -m = Basemap(llcrnrlon=-130.,llcrnrlat=39,urcrnrlon=-124.,urcrnrlat=60.,\ +m = Basemap(height=16700000,width=12000000, resolution='l',area_thresh=1000.,projection='omerc',\ - lon_2=-140,lat_2=55,lon_1=-120,lat_1=40) -fig.add_axes([0.125,0.2,0.6,0.6]) + lon_0=-100,lat_0=15,lon_2=-120,lat_2=65,lon_1=-50,lat_1=-55) # transform to nx x ny regularly spaced native projection grid nx = int((m.xmax-m.xmin)/20000.)+1; ny = int((m.ymax-m.ymin)/20000.)+1 topodat = m.transform_scalar(topoin,lons,lats,nx,ny) @@ -216,13 +215,9 @@ m.drawcountries() m.drawstates() # draw parallels -delat = 3. -circles = arange(40,60,delat) -m.drawparallels(circles,labels=[1,0,0,0],fontsize=10) +m.drawparallels(arange(-80,81,20),labels=[1,0,0,0],fontsize=10) # draw meridians -delon = 3. -meridians = arange(-140,-120,delon) -m.drawmeridians(meridians,labels=[0,0,0,1],fontsize=10) +m.drawmeridians(arange(-180,181,30),labels=[0,0,0,1],fontsize=10) title('Oblique Mercator Projection') print 'plotting Oblique Mercator example ...' print m.srs Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py =================================================================== --- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-02-13 13:50:29 UTC (rev 4959) +++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/basemap.py 2008-02-13 17:15:11 UTC (rev 4960) @@ -36,7 +36,7 @@ import numpy as npy from numpy import linspace, squeeze, ma from shapelib import ShapeFile -import _geos, pupynere, netcdftime +import _geoslib, pupynere, netcdftime # basemap data files now installed in lib/matplotlib/toolkits/basemap/data basemap_datadir = os.sep.join([os.path.dirname(__file__), 'data']) @@ -79,7 +79,7 @@ projection_params = {'cyl' : 'corners only (no width/height)', 'merc' : 'corners plus lat_ts (no width/height)', 'tmerc' : 'lon_0,lat_0', - 'omerc' : 'lon_0,lat_0,lat_1,lat_2,lon_1,lon_2,no width/height', + 'omerc' : 'lat_0,lat_1,lat_2,lon_1,lon_2', 'mill' : 'corners only (no width/height)', 'lcc' : 'lon_0,lat_0,lat_1,lat_2', 'laea' : 'lon_0,lat_0', @@ -527,14 +527,23 @@ self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat elif projection == 'omerc': - if lat_1 is None or lon_1 is None or lat_2 is None or lon_2 is None: - raise ValueError, 'must specify lat_1,lon_1 and lat_2,lon_2 for Oblique Mercator basemap' + if lat_1 is None or lon_1 is None or lat_2 is None or lon_2 is None or lat_0 is None: + raise ValueError, 'must specify lat_0 and lat_1,lon_1 and lat_2,lon_2 for Oblique Mercator basemap' projparams['lat_1'] = lat_1 projparams['lon_1'] = lon_1 projparams['lat_2'] = lat_2 projparams['lon_2'] = lon_2 + projparams['lat_0'] = lat_0 + #if not using_corners: + # raise ValueError, 'cannot specify map region with width and height keywords for this projection, please specify lat/lon values of corners' if not using_corners: - raise ValueError, 'cannot specify map region with width and height keywords for this projection, please specify lat/lon values of corners' + if width is None or height is None: + raise ValueError, 'must either specify lat/lon values of corners (llcrnrlon,llcrnrlat,ucrnrlon,urcrnrlat) in degrees or width and height in meters' + if lon_0 is None or lat_0 is None: + raise ValueError, 'must specify lon_0 and lat_0 when using width, height to specify projection region' + llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat = _choosecorners(width,height,**projparams) + self.llcrnrlon = llcrnrlon; self.llcrnrlat = llcrnrlat + self.urcrnrlon = urcrnrlon; self.urcrnrlat = urcrnrlat elif projection == 'aeqd': if lat_0 is None or lon_0 is None: raise ValueError, 'must specify lat_0 and lon_0 for Azimuthal Equidistant basemap' @@ -736,12 +745,12 @@ polygon_types = [] # coastlines are polygons, other boundaries are line segments. if name == 'gshhs': - Shape = _geos.Polygon + Shape = _geoslib.Polygon else: - Shape = _geos.LineString + Shape = _geoslib.LineString # see if map projection region polygon contains a pole. - NPole = _geos.Point(self(0.,90.)) - SPole = _geos.Point(self(0.,-90.)) + NPole = _geoslib.Point(self(0.,90.)) + SPole = _geoslib.Point(self(0.,-90.)) boundarypolyxy = self._boundarypolyxy boundarypolyll = self._boundarypolyll hasNP = NPole.within(boundarypolyxy) @@ -749,7 +758,8 @@ containsPole = hasNP or hasSP # these projections cannot cross pole. if containsPole and\ - self.projection in ['tmerc','cass','omerc','merc','mill','cyl','robin','moll','sinu','geos']: + self.projection in ['merc','mill','cyl','robin','moll','sinu','geos']: + #self.projection in ['tmerc','omerc','cass','merc','mill','cyl','robin','moll','sinu','geos']: raise ValueError('%s projection cannot cross pole'%(self.projection)) # make sure orthographic projection has containsPole=True # we will compute the intersections in stereographic @@ -770,7 +780,7 @@ b = self._boundarypolyll.boundary blons = b[:,0]; blats = b[:,1] b[:,0], b[:,1] = maptran(blons, blats) - boundarypolyxy = _geos.Polygon(b) + boundarypolyxy = _geoslib.Polygon(b) for line in bdatmetafile: linesplit = line.split() area = float(linesplit[1]) @@ -817,7 +827,7 @@ lats.append(-90.) b = npy.empty((len(lons),2),npy.float64) b[:,0] = lons; b[:,1] = lats - poly = _geos.Polygon(b) + poly = _geoslib.Polygon(b) antart = True else: poly = Shape(b) @@ -940,7 +950,7 @@ y = rminor*npy.sin(thetas) + rminor b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = _geos.Polygon(b) + boundaryxy = _geoslib.Polygon(b) # compute proj instance for full disk, if necessary. if not self._fulldisk: projparms = self.projparams.copy() @@ -979,7 +989,7 @@ x, y = maptran(lons,lats) b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = _geos.Polygon(b) + boundaryxy = _geoslib.Polygon(b) else: # all other projections are rectangular. # left side (x = xmin, ymin <= y <= ymax) yy = linspace(self.ymin, self.ymax, ny)[:-1] @@ -1000,7 +1010,7 @@ b = npy.empty((4,2),npy.float64) b[:,0]=[self.xmin,self.xmin,self.xmax,self.xmax] b[:,1]=[self.ymin,self.ymax,self.ymax,self.ymin] - boundaryxy = _geos.Polygon(b) + boundaryxy = _geoslib.Polygon(b) if self.projection in ['mill','merc','cyl']: # make sure map boundary doesn't quite include pole. if self.urcrnrlat > 89.9999: @@ -1016,7 +1026,7 @@ x, y = self(lons, lats) b = npy.empty((len(x),2),npy.float64) b[:,0]=x; b[:,1]=y - boundaryxy = _geos.Polygon(b) + boundaryxy = _geoslib.Polygon(b) else: if self.projection not in ['moll','robin','sinu']: lons, lats = maptran(x,y,inverse=True) @@ -1034,7 +1044,7 @@ n = n + 1 b = npy.empty((len(lons),2),npy.float64) b[:,0]=lons; b[:,1]=lats - boundaryll = _geos.Polygon(b) + boundaryll = _geoslib.Polygon(b) return boundaryll, boundaryxy Modified: trunk/toolkits/basemap/setup.py =================================================================== --- trunk/toolkits/basemap/setup.py 2008-02-13 13:50:29 UTC (rev 4959) +++ trunk/toolkits/basemap/setup.py 2008-02-13 17:15:11 UTC (rev 4960) @@ -31,7 +31,7 @@ else: return [("HAVE_UPDATE_HEADER", "0")] -def check_geosversion(GEOS_dir): +def checkversion(GEOS_dir): """check geos C-API header file (geos_c.h)""" try: f = open(os.path.join(GEOS_dir,'include/geos_c.h')) @@ -54,7 +54,7 @@ # if GEOS_dir not set, check a few standard locations. GEOS_dirs = ['/usr/local','/sw','/opt','/opt/local',os.path.expanduser('~')] for direc in GEOS_dirs: - geos_version = check_geosversion(direc) + geos_version = checkversion(direc) print 'checking for GEOS lib in %s ....' % direc if geos_version != '"2.2.3"': continue @@ -63,7 +63,7 @@ GEOS_dir = direc break else: - geos_version = check_geosversion(GEOS_dir) + geos_version = checkversion(GEOS_dir) #if geos_version != '"2.2.3"': # raise SystemExit(""" #Can't find geos library version 2.2.3. Please set the @@ -81,15 +81,15 @@ deps = glob.glob('src/*.c') deps.remove(os.path.join('src','_proj.c')) deps.remove(os.path.join('src','_geod.c')) -deps.remove(os.path.join('src','_geos.c')) +deps.remove(os.path.join('src','_geoslib.c')) packages = ['mpl_toolkits','mpl_toolkits.basemap'] package_dirs = {'':'lib'} extensions = [Extension("mpl_toolkits.basemap._proj",deps+['src/_proj.c'],include_dirs = ['src'],)] extensions.append(Extension("mpl_toolkits.basemap._geod",deps+['src/_geod.c'],include_dirs = ['src'],)) # for some reason, pickling won't work if this extension is installed -# as "matplotlib.toolkits.basemap._geos" -extensions.append(Extension("_geos",['src/_geos.c'], +# as "matplotlib.toolkits.basemap._geoslib" +extensions.append(Extension("_geoslib",['src/_geoslib.c'], library_dirs=geos_library_dirs, runtime_library_dirs=geos_library_dirs, include_dirs=geos_include_dirs, Deleted: trunk/toolkits/basemap/src/_geos.c =================================================================== --- trunk/toolkits/basemap/src/_geos.c 2008-02-13 13:50:29 UTC (rev 4959) +++ trunk/toolkits/basemap/src/_geos.c 2008-02-13 17:15:11 UTC (rev 4960) @@ -1,3119 +0,0 @@ -/* Generated by Cython 0.9.6.8 on Thu Nov 15 13:56:55 2007 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#include "structmember.h" -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#if PY_VERSION_HEX < 0x02050000 - typedef int Py_ssize_t; - #define PY_SSIZE_T_MAX INT_MAX - #define PY_SSIZE_T_MIN INT_MIN - #define PyInt_FromSsize_t(z) PyInt_FromLong(z) - #define PyInt_AsSsize_t(o) PyInt_AsLong(o) - #define PyNumber_Index(o) PyNumber_Int(o) - #define PyIndex_Check(o) PyNumber_Check(o) -#endif -#ifndef WIN32 - #define __stdcall - #define __cdecl -#endif -#ifdef __cplusplus -#define __PYX_EXTERN_C extern "C" -#else -#define __PYX_EXTERN_C extern -#endif -#include <math.h> -#include "numpy/arrayobject.h" -#include "geos_c.h" - - -#ifdef __GNUC__ -#define INLINE __inline__ -#elif _WIN32 -#define INLINE __inline -#else -#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*/ - -static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject* x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} - -#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) { - if (x == Py_True) return 1; - else if (x == Py_False) return 0; - else return PyObject_IsTrue(x); -} - - - -static int __pyx_skip_dispatch = 0; - - -#ifdef __GNUC__ -/* Test for GCC > 2.95 */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) -#define likely(x) __builtin_expect(!!(x), 1) -#define unlikely(x) __builtin_expect(!!(x), 0) -#else /* __GNUC__ > 2 ... */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ > 2 ... */ -#else /* __GNUC__ */ -#define likely(x) (x) -#define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_b; -static int __pyx_lineno; -static char *__pyx_filename; -static char **__pyx_f; - -static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/ - -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*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(char *name); /*proto*/ - -static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ - -static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ - -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*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 int __Pyx_RegisterCleanup(); /*proto*/ -static PyObject* cleanup(PyObject *self, PyObject *unused); /*proto*/ -static PyMethodDef cleanup_def = {"__cleanup", (PyCFunction)&cleanup, METH_NOARGS, 0}; - -/* Declarations from numpy */ - - -/* Declarations from _geos */ - -struct __pyx_obj_5_geos_BaseGeometry { - PyObject_HEAD - GEOSGeom *_geom; - unsigned int _npts; - PyObject *boundary; -}; - -struct __pyx_obj_5_geos_Polygon { - struct __pyx_obj_5_geos_BaseGeometry __pyx_base; -}; - -struct __pyx_obj_5_geos_LineString { - struct __pyx_obj_5_geos_BaseGeometry __pyx_base; -}; - -struct __pyx_obj_5_geos_Point { - struct __pyx_obj_5_geos_BaseGeometry __pyx_base; - PyObject *x; - PyObject *y; -}; - - - - - -static PyTypeObject *__pyx_ptype_5_geos_ndarray = 0; -static PyTypeObject *__pyx_ptype_5_geos_BaseGeometry = 0; -static PyTypeObject *__pyx_ptype_5_geos_Polygon = 0; -static PyTypeObject *__pyx_ptype_5_geos_LineString = 0; -static PyTypeObject *__pyx_ptype_5_geos_Point = 0; -static void __pyx_f_5_geos_notice_h(char *,char *); /*proto*/ -static void __pyx_f_5_geos_error_h(char *,char *); /*proto*/ -static PyObject *__pyx_f_5_geos_geos_version(void); /*proto*/ -static PyObject *__pyx_f_5_geos__get_coords(GEOSGeom *); /*proto*/ - - -/* Implementation of _geos */ - -static char __pyx_k3[] = "0.1"; -static char __pyx_k4[] = "2.2.3-CAPI-1.1.1"; -static char __pyx_k5[] = "version 2.2.3 of the geos library is required"; - -static PyObject *__pyx_n_is_valid; -static PyObject *__pyx_n_geom_type; -static PyObject *__pyx_n_within; -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 PyObject *__pyx_n_ValueError; - -static PyObject *__pyx_k3p; -static PyObject *__pyx_k4p; -static PyObject *__pyx_k5p; - -static PyObject *__pyx_builtin_ValueError; - -static PyObject *__pyx_n_stdout; -static PyObject *__pyx_n_write; - -static PyObject *__pyx_k6p; - -static char __pyx_k6[] = "GEOS_NOTICE: %s\n"; - -static void __pyx_f_5_geos_notice_h(char *__pyx_v_fmt,char *__pyx_v_msg) { - PyObject *__pyx_v_format; - PyObject *__pyx_v_message; - PyObject *__pyx_v_warn_msg; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - __pyx_v_format = Py_None; Py_INCREF(Py_None); - __pyx_v_message = Py_None; Py_INCREF(Py_None); - __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":101 - * - * 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; goto __pyx_L1;} - Py_DECREF(__pyx_v_format); - __pyx_v_format = __pyx_1; - __pyx_1 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":102 - * 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; goto __pyx_L1;} - Py_DECREF(__pyx_v_message); - __pyx_v_message = __pyx_1; - __pyx_1 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":103 - * format = PyString_FromString(fmt) - * message = PyString_FromString(msg) - * try: # <<<<<<<<<<<<<< - * warn_msg = format % message - * except: - */ - /*try:*/ { - __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L2;} - Py_DECREF(__pyx_v_warn_msg); - __pyx_v_warn_msg = __pyx_1; - __pyx_1 = 0; - } - goto __pyx_L3; - __pyx_L2:; - Py_XDECREF(__pyx_1); __pyx_1 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":105 - * try: - * warn_msg = format % message - * except: # <<<<<<<<<<<<<< - * warn_msg = format - * sys.stdout.write('GEOS_NOTICE: %s\n' % warn_msg) - */ - /*except:*/ { - __Pyx_AddTraceback("_geos.notice_h"); - if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;} - Py_INCREF(__pyx_v_format); - Py_DECREF(__pyx_v_warn_msg); - __pyx_v_warn_msg = __pyx_v_format; - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":107 - * 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_n_sys); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stdout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; 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 = 107; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyNumber_Remainder(__pyx_k6p, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); - __pyx_1 = 0; - __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - - goto __pyx_L0; - __pyx_L1:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - __Pyx_WriteUnraisable("_geos.notice_h"); - __pyx_L0:; - Py_DECREF(__pyx_v_format); - Py_DECREF(__pyx_v_message); - Py_DECREF(__pyx_v_warn_msg); -} - -static PyObject *__pyx_n_stderr; - -static PyObject *__pyx_k7p; - -static char __pyx_k7[] = "GEOS_ERROR: %s\n"; - -static void __pyx_f_5_geos_error_h(char *__pyx_v_fmt,char *__pyx_v_msg) { - PyObject *__pyx_v_format; - PyObject *__pyx_v_message; - PyObject *__pyx_v_warn_msg; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - __pyx_v_format = Py_None; Py_INCREF(Py_None); - __pyx_v_message = Py_None; Py_INCREF(Py_None); - __pyx_v_warn_msg = Py_None; Py_INCREF(Py_None); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":110 - * - * 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; goto __pyx_L1;} - Py_DECREF(__pyx_v_format); - __pyx_v_format = __pyx_1; - __pyx_1 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":111 - * 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; goto __pyx_L1;} - Py_DECREF(__pyx_v_message); - __pyx_v_message = __pyx_1; - __pyx_1 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":112 - * format = PyString_FromString(fmt) - * message = PyString_FromString(msg) - * try: # <<<<<<<<<<<<<< - * warn_msg = format % message - * except: - */ - /*try:*/ { - __pyx_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; goto __pyx_L2;} - Py_DECREF(__pyx_v_warn_msg); - __pyx_v_warn_msg = __pyx_1; - __pyx_1 = 0; - } - goto __pyx_L3; - __pyx_L2:; - Py_XDECREF(__pyx_1); __pyx_1 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":114 - * try: - * warn_msg = format % message - * except: # <<<<<<<<<<<<<< - * warn_msg = format - * sys.stderr.write('GEOS_ERROR: %s\n' % warn_msg) - */ - /*except:*/ { - __Pyx_AddTraceback("_geos.error_h"); - if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;} - Py_INCREF(__pyx_v_format); - Py_DECREF(__pyx_v_warn_msg); - __pyx_v_warn_msg = __pyx_v_format; - Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - goto __pyx_L3; - } - __pyx_L3:; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":116 - * except: - * warn_msg = format - * 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 = 116; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_stderr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; 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 = 116; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyNumber_Remainder(__pyx_k7p, __pyx_v_warn_msg); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); - __pyx_1 = 0; - __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - - goto __pyx_L0; - __pyx_L1:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - __Pyx_WriteUnraisable("_geos.error_h"); - __pyx_L0:; - Py_DECREF(__pyx_v_format); - Py_DECREF(__pyx_v_message); - Py_DECREF(__pyx_v_warn_msg); -} - -static PyObject *__pyx_f_5_geos_geos_version(void) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - __pyx_1 = PyString_FromString(GEOSversion()); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;} - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("_geos.geos_version"); - __pyx_r = 0; - __pyx_L0:; - return __pyx_r; -} - -static PyObject *__pyx_pf_5_geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_5_geos_12BaseGeometry_is_valid(PyObject *__pyx_v_self, PyObject *unused) { - char __pyx_v_valid; - PyObject *__pyx_r; - char __pyx_1; - Py_INCREF(__pyx_v_self); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":134 - * def is_valid(self): - * cdef char valid - * valid = GEOSisValid(self._geom) # <<<<<<<<<<<<<< - * if valid: - * return True - */ - __pyx_v_valid = GEOSisValid(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":135 - * cdef char valid - * valid = GEOSisValid(self._geom) - * if valid: # <<<<<<<<<<<<<< - * return True - * else: - */ - __pyx_1 = __pyx_v_valid; - if (__pyx_1) { - Py_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - goto __pyx_L2; - } - /*else*/ { - Py_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - } - __pyx_L2:; - - __pyx_r = Py_None; Py_INCREF(Py_None); - __pyx_L0:; - Py_DECREF(__pyx_v_self); - return __pyx_r; -} - -static PyObject *__pyx_pf_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_5_geos_12BaseGeometry_geom_type(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - Py_INCREF(__pyx_v_self); - __pyx_1 = PyString_FromString(GEOSGeomType(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;} - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("_geos.BaseGeometry.geom_type"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_self); - return __pyx_r; -} - -static PyObject *__pyx_pf_5_geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ -static PyObject *__pyx_pf_5_geos_12BaseGeometry_within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { - GEOSGeom *__pyx_v_g1; - GEOSGeom *__pyx_v_g2; - char __pyx_v_answer; - PyObject *__pyx_r; - char __pyx_1; - Py_INCREF(__pyx_v_self); - Py_INCREF(__pyx_v_geom); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;} - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":146 - * cdef GEOSGeom *g1, *g2 - * cdef char answer - * g1 = self._geom # <<<<<<<<<<<<<< - * g2 = geom._geom - * answer = GEOSWithin(g1, g2) - */ - __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":147 - * cdef char answer - * g1 = self._geom - * g2 = geom._geom # <<<<<<<<<<<<<< - * answer = GEOSWithin(g1, g2) - * if answer: - */ - __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":148 - * g1 = self._geom - * g2 = geom._geom - * answer = GEOSWithin(g1, g2) # <<<<<<<<<<<<<< - * if answer: - * return True - */ - __pyx_v_answer = GEOSWithin(__pyx_v_g1,__pyx_v_g2); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":149 - * g2 = geom._geom - * answer = GEOSWithin(g1, g2) - * if answer: # <<<<<<<<<<<<<< - * return True - * else: - */ - __pyx_1 = __pyx_v_answer; - if (__pyx_1) { - Py_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - goto __pyx_L2; - } - /*else*/ { - Py_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - } - __pyx_L2:; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1:; - __Pyx_AddTraceback("_geos.BaseGeometry.within"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_self); - Py_DECREF(__pyx_v_geom); - return __pyx_r; -} - -static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ -static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { - GEOSGeom *__pyx_v_g1; - GEOSGeom *__pyx_v_g2; - char __pyx_v_answer; - PyObject *__pyx_r; - char __pyx_1; - Py_INCREF(__pyx_v_self); - Py_INCREF(__pyx_v_geom); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; goto __pyx_L1;} - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":157 - * cdef GEOSGeom *g1, *g2 - * cdef char answer - * g1 = self._geom # <<<<<<<<<<<<<< - * g2 = geom._geom - * answer = GEOSIntersects(g1, g2) - */ - __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":158 - * cdef char answer - * g1 = self._geom - * g2 = geom._geom # <<<<<<<<<<<<<< - * answer = GEOSIntersects(g1, g2) - * if answer: - */ - __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":159 - * g1 = self._geom - * g2 = geom._geom - * answer = GEOSIntersects(g1, g2) # <<<<<<<<<<<<<< - * if answer: - * return True - */ - __pyx_v_answer = GEOSIntersects(__pyx_v_g1,__pyx_v_g2); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":160 - * g2 = geom._geom - * answer = GEOSIntersects(g1, g2) - * if answer: # <<<<<<<<<<<<<< - * return True - * else: - */ - __pyx_1 = __pyx_v_answer; - if (__pyx_1) { - Py_INCREF(Py_True); - __pyx_r = Py_True; - goto __pyx_L0; - goto __pyx_L2; - } - /*else*/ { - Py_INCREF(Py_False); - __pyx_r = Py_False; - goto __pyx_L0; - } - __pyx_L2:; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1:; - __Pyx_AddTraceback("_geos.BaseGeometry.intersects"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_self); - Py_DECREF(__pyx_v_geom); - return __pyx_r; -} - -static PyObject *__pyx_n_append; -static PyObject *__pyx_n_NotImplementedError; - -static PyObject *__pyx_k8p; - -static PyObject *__pyx_builtin_NotImplementedError; - -static char __pyx_k8[] = "intersections of type '%s' not yet implemented"; - -static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ -static PyObject *__pyx_pf_5_geos_12BaseGeometry_intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { - GEOSGeom *__pyx_v_g1; - GEOSGeom *__pyx_v_g2; - GEOSGeom *__pyx_v_g3; - GEOSGeom *__pyx_v_gout; - 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; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - Py_INCREF(__pyx_v_self); - Py_INCREF(__pyx_v_geom); - __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); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_5_geos_BaseGeometry, 1, "geom"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;} - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":169 - * cdef char answer - * cdef int numgeoms, i, typeid - * g1 = self._geom # <<<<<<<<<<<<<< - * g2 = geom._geom - * g3 = GEOSIntersection(g1, g2) - */ - __pyx_v_g1 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":170 - * cdef int numgeoms, i, typeid - * g1 = self._geom - * g2 = geom._geom # <<<<<<<<<<<<<< - * g3 = GEOSIntersection(g1, g2) - * typeid = GEOSGeomTypeId(g3) - */ - __pyx_v_g2 = ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_geom)->_geom; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":171 - * g1 = self._geom - * g2 = geom._geom - * g3 = GEOSIntersection(g1, g2) # <<<<<<<<<<<<<< - * typeid = GEOSGeomTypeId(g3) - * if typeid == GEOS_POLYGON: - */ - __pyx_v_g3 = GEOSIntersection(__pyx_v_g1,__pyx_v_g2); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":172 - * g2 = geom._geom - * g3 = GEOSIntersection(g1, g2) - * typeid = GEOSGeomTypeId(g3) # <<<<<<<<<<<<<< - * if typeid == GEOS_POLYGON: - * b = _get_coords(g3) - */ - __pyx_v_typeid = GEOSGeomTypeId(__pyx_v_g3); - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":173 - * g3 = GEOSIntersection(g1, g2) - * typeid = GEOSGeomTypeId(g3) - * if typeid == GEOS_POLYGON: # <<<<<<<<<<<<<< - * b = _get_coords(g3) - * p = Polygon(b) - */ - __pyx_1 = (__pyx_v_typeid == GEOS_POLYGON); - if (__pyx_1) { - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":174 - * typeid = GEOSGeomTypeId(g3) - * if typeid == GEOS_POLYGON: - * b = _get_coords(g3) # <<<<<<<<<<<<<< - * p = Polygon(b) - * pout = [p] - */ - __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} - Py_DECREF(__pyx_v_b); - __pyx_v_b = __pyx_2; - __pyx_2 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":175 - * 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; goto __pyx_L1;} - Py_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b); - __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_3; - __pyx_3 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":176 - * 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; goto __pyx_L1;} - Py_INCREF(__pyx_v_p); - PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); - Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_2; - __pyx_2 = 0; - goto __pyx_L2; - } - __pyx_1 = (__pyx_v_typeid == GEOS_LINESTRING); - if (__pyx_1) { - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":178 - * pout = [p] - * elif typeid == GEOS_LINESTRING: - * b = _get_coords(g3) # <<<<<<<<<<<<<< - * p = LineString(b) - * pout = [p] - */ - __pyx_3 = __pyx_f_5_geos__get_coords(__pyx_v_g3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;} - Py_DECREF(__pyx_v_b); - __pyx_v_b = __pyx_3; - __pyx_3 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":179 - * 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; goto __pyx_L1;} - Py_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_b); - __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_3; - __pyx_3 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":180 - * 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; goto __pyx_L1;} - Py_INCREF(__pyx_v_p); - PyList_SET_ITEM(__pyx_2, 0, __pyx_v_p); - Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_2; - __pyx_2 = 0; - goto __pyx_L2; - } - __pyx_1 = (__pyx_v_typeid == GEOS_MULTIPOLYGON); - if (__pyx_1) { - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":182 - * 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-testing/src/_geos.pyx":183 - * 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; goto __pyx_L1;} - Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_3; - __pyx_3 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":184 - * 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-testing/src/_geos.pyx":185 - * 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-testing/src/_geos.pyx":186 - * for i from 0 <= i < numgeoms: - * gout = GEOSGetGeometryN(g3, i) - * b = _get_coords(gout) # <<<<<<<<<<<<<< - * p = Polygon(b) - * pout.append(p) - */ - __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; goto __pyx_L1;} - Py_DECREF(__pyx_v_b); - __pyx_v_b = __pyx_2; - __pyx_2 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":187 - * gout = GEOSGetGeometryN(g3, i) - * b = _get_coords(gout) - * p = Polygon(b) # <<<<<<<<<<<<<< - * pout.append(p) - * elif typeid == GEOS_MULTILINESTRING: - */ - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} - Py_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_b); - __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_Polygon), __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_2; - __pyx_2 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":188 - * b = _get_coords(gout) - * p = Polygon(b) - * pout.append(p) # <<<<<<<<<<<<<< - * elif typeid == GEOS_MULTILINESTRING: - * numgeoms = GEOSGetNumGeometries(g3) - */ - __pyx_3 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;} - Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - } - goto __pyx_L2; - } - __pyx_1 = (__pyx_v_typeid == GEOS_MULTILINESTRING); - if (__pyx_1) { - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":190 - * 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-testing/src/_geos.pyx":191 - * 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 = 191; goto __pyx_L1;} - Py_DECREF(__pyx_v_pout); - __pyx_v_pout = __pyx_3; - __pyx_3 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":192 - * 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-testing/src/_geos.pyx":193 - * 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-testing/src/_geos.pyx":194 - * for i from 0 <= i < numgeoms: - * gout = GEOSGetGeometryN(g3, i) - * b = _get_coords(gout) # <<<<<<<<<<<<<< - * p = LineString(b) - * pout.append(p) - */ - __pyx_2 = __pyx_f_5_geos__get_coords(__pyx_v_gout); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;} - Py_DECREF(__pyx_v_b); - __pyx_v_b = __pyx_2; - __pyx_2 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":195 - * gout = GEOSGetGeometryN(g3, i) - * b = _get_coords(gout) - * p = LineString(b) # <<<<<<<<<<<<<< - * pout.append(p) - * else: - */ - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} - Py_INCREF(__pyx_v_b); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_b); - __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5_geos_LineString), __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(__pyx_v_p); - __pyx_v_p = __pyx_3; - __pyx_3 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":196 - * b = _get_coords(gout) - * p = LineString(b) - * pout.append(p) # <<<<<<<<<<<<<< - * else: - * type = PyString_FromString(GEOSGeomType(g3)) - */ - __pyx_2 = PyObject_GetAttr(__pyx_v_pout, __pyx_n_append); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} - Py_INCREF(__pyx_v_p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - } - goto __pyx_L2; - } - /*else*/ { - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":198 - * pout.append(p) - * else: - * type = PyString_FromString(GEOSGeomType(g3)) # <<<<<<<<<<<<<< - * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) - * GEOSGeom_destroy(g3) - */ - __pyx_2 = PyString_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} - Py_DECREF(__pyx_v_type); - __pyx_v_type = __pyx_2; - __pyx_2 = 0; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":199 - * else: - * type = PyString_FromString(GEOSGeomType(g3)) - * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) # <<<<<<<<<<<<<< - * GEOSGeom_destroy(g3) - * return pout - */ - __pyx_4 = PyNumber_Remainder(__pyx_k8p, __pyx_v_type); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); - __pyx_4 = 0; - __pyx_2 = PyObject_CallObject(__pyx_builtin_NotImplementedError, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;} - } - __pyx_L2:; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":200 - * 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-testing/src/_geos.pyx":201 - * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) - * GEOSGeom_destroy(g3) - * return pout # <<<<<<<<<<<<<< - * - * def get_coords(self): - */ - 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_2); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_4); - __Pyx_AddTraceback("_geos.BaseGeometry.intersection"); - __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); - Py_DECREF(__pyx_v_self); - Py_DECREF(__pyx_v_geom); - return __pyx_r; -} - -static PyObject *__pyx_pf_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static PyObject *__pyx_pf_5_geos_12BaseGeometry_get_coords(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - Py_INCREF(__pyx_v_self); - __pyx_1 = __pyx_f_5_geos__get_coords(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; goto __pyx_L1;} - __pyx_r = __pyx_1; - __pyx_1 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1:; - Py_XDECREF(__pyx_1); - __Pyx_AddTraceback("_geos.BaseGeometry.get_coords"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_self); - return __pyx_r; -} - -static void __pyx_pf_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self); /*proto*/ -static void __pyx_pf_5_geos_12BaseGeometry___dealloc__(PyObject *__pyx_v_self) { - Py_INCREF(__pyx_v_self); - GEOSGeom_destroy(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->_geom); - - Py_DECREF(__pyx_v_self); -} - -static PyObject *__pyx_n___class__; - -static PyObject *__pyx_pf_5_geos_12BaseGeometry___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/ -static char __pyx_doc_5_geos_12BaseGeometry___reduce__[] = "special method that allows geos instance to be pickled"; -static PyObject *__pyx_pf_5_geos_12BaseGeometry___reduce__(PyObject *__pyx_v_self, PyObject *unused) { - PyObject *__pyx_r; - PyObject *__pyx_1 = 0; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - Py_INCREF(__pyx_v_self); - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} - Py_INCREF(((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary); - PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geos_BaseGeometry *)__pyx_v_self)->boundary); - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); - __pyx_1 = 0; - __pyx_2 = 0; - __pyx_r = __pyx_3; - __pyx_3 = 0; - goto __pyx_L0; - - __pyx_r = Py_None; Py_INCREF(Py_None); - goto __pyx_L0; - __pyx_L1:; - Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_3); - __Pyx_AddTraceback("_geos.BaseGeometry.__reduce__"); - __pyx_r = NULL; - __pyx_L0:; - Py_DECREF(__pyx_v_self); - return __pyx_r; -} - -static PyObject *__pyx_num_neg_1; -static PyObject *__pyx_num_0; -static PyObject *__pyx_num_1; - -static PyObject *__pyx_n_copy; -static PyObject *__pyx_n_shape; - -static int __pyx_pf_5_geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pf_5_geos_7Polygon___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { - PyArrayObject *__pyx_v_b = 0; - unsigned int __pyx_v_M; - unsigned int __pyx_v_m; - unsigned int __pyx_v_i; - double __pyx_v_dx; - double __pyx_v_dy; - double *__pyx_v_bbuffer; - GEOSCoordSeq *__pyx_v_cs; - GEOSGeom *__pyx_v_lr; - int __pyx_r; - int __pyx_1; - PyObject *__pyx_2 = 0; - PyObject *__pyx_3 = 0; - PyObject *__pyx_4 = 0; - unsigned int __pyx_5; - PyObject *__pyx_6 = 0; - static char *__pyx_argnames[] = {"b",0}; - if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_b))) return -1; - Py_INCREF((PyObject *)__pyx_v_self); - Py_INCREF(__pyx_v_b); - if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_5_geos_ndarray, 1, "b"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;} - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":225 - * # make sure data is contiguous. - * # if not, make a local copy. - * if not PyArray_ISCONTIGUOUS(b): # <<<<<<<<<<<<<< - * b = b.copy() - * - */ - __pyx_1 = (!PyArray_ISCONTIGUOUS(__pyx_v_b)); - if (__pyx_1) { - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_copy); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} - __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5_geos_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} - Py_DECREF(((PyObject *)__pyx_v_b)); - __pyx_v_b = ((PyArrayObject *)__pyx_3); - __pyx_3 = 0; - goto __pyx_L2; - } - __pyx_L2:; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":228 - * b = b.copy() - * - * m = b.shape[0] # <<<<<<<<<<<<<< - * - * # Add closing coordinates to sequence? - */ - __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_b), __pyx_n_shape); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} - if (PyList_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_2)) { - __pyx_4 = PyList_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4); - } else if (PyTuple_CheckExact(__pyx_2) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_2)) { - __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0); Py_INCREF(__pyx_4); - } else { - __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - } - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_v_m = __pyx_5; - - /* "/Volumes/User/jwhitaker/matplotlib/basemap-testing/src/_geos.pyx":231 - * - * # Add closing coordinates to sequence? - * if b[-1,0] != b[0,0] or b[-1,1] != b[0,1]: # <<<<<<<<<<<<<< - * M = m + 1 - * else: - */ - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_INCREF(__pyx_num_neg_1); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1); - Py_INCREF(__pyx_num_0); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0); - __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_INCREF(__pyx_num_0); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_0); - Py_INCREF(__pyx_num_0); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_0); - __pyx_6 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_6, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - if (!__pyx_1) { - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_INCREF(__pyx_num_neg_1); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_neg_1); - Py_INCREF(__pyx_num_1); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_num_1); - __pyx_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_INCREF(__pyx_num_0); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_num_0); - Py_INCREF(__pyx_num_1); - PyTuple_SET_ITEM(__pyx_6, 1, __pyx_num_1); - __pyx_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_2 = PyObject_RichCompare(__pyx_4, __pyx_3, Py_NE); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - } - __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_... [truncated message content] |