diff -Nru basemap-1.1.0+dfsg/debian/changelog basemap-1.1.0+dfsg/debian/changelog --- basemap-1.1.0+dfsg/debian/changelog 2018-06-28 11:39:40.000000000 +0000 +++ basemap-1.1.0+dfsg/debian/changelog 2018-08-10 01:07:12.000000000 +0000 @@ -1,3 +1,9 @@ +basemap (1.1.0+dfsg-2ubuntu1) cosmic; urgency=medium + + * Apply patch from debian bug 903579 to fix ftbfs with Python 3.7. + + -- Michael Hudson-Doyle Fri, 10 Aug 2018 13:07:12 +1200 + basemap (1.1.0+dfsg-2build1) cosmic; urgency=medium * No-change rebuild to build for python3.7. diff -Nru basemap-1.1.0+dfsg/debian/changelog.orig basemap-1.1.0+dfsg/debian/changelog.orig --- basemap-1.1.0+dfsg/debian/changelog.orig 1970-01-01 00:00:00.000000000 +0000 +++ basemap-1.1.0+dfsg/debian/changelog.orig 2018-08-10 01:06:27.000000000 +0000 @@ -0,0 +1,183 @@ +basemap (1.1.0+dfsg-2build1) cosmic; urgency=medium + + * No-change rebuild to build for python3.7. + + -- Matthias Klose Thu, 28 Jun 2018 11:39:40 +0000 + +basemap (1.1.0+dfsg-2) unstable; urgency=medium + + [ Ondřej Nový ] + * d/control: Set Vcs-* to salsa.debian.org + * d/copyright: Use https protocol in Format field + + [ Sandro Tosi ] + * debian/control + - bump Standards-Version to 4.1.4 (no changes needed) + * debian/rules + - fail build if any python3 installation fails; Closes: #866906 + + -- Sandro Tosi Sun, 13 May 2018 21:30:05 -0400 + +basemap (1.1.0+dfsg-1) unstable; urgency=medium + + * New upstream release; Closes: #869156 + * debian/control + - switch to PIL instead of imaging; #866415 + - bump Standards-Version to 4.1.3 + - remove priority: extra from -dbg packages + - add pyproj and pyshp to dep + - add netcdf4, pyproj and pyshp to b-d, needed by doc + * debian/copyright + - extend packaging copyright years + - exclude `geos-3.3.3` from upstream tarballs + - update for removed upstream code + * debian/watch + - update to point to github + + -- Sandro Tosi Mon, 22 Jan 2018 23:21:34 -0500 + +basemap (1.0.7+dfsg-4) unstable; urgency=medium + + [ Ondřej Nový ] + * Fixed VCS URL (https) + + [ Sandro Tosi ] + * debian/rules + - add to build-indep a dependency on build-arch; Closes: #806606 + * debian/control + - bump Standards-Version to 3.9.8 (no changes needed) + + -- Sandro Tosi Sun, 14 Aug 2016 17:39:28 +0100 + +basemap (1.0.7+dfsg-3) unstable; urgency=medium + + * debian/control + - set me as Maintainer, team as Uploaders + + -- Sandro Tosi Sun, 02 Aug 2015 20:43:53 +0100 + +basemap (1.0.7+dfsg-2) experimental; urgency=medium + + * debian/control + - added scipy to Suggests, needed for some interpolation routines + - added python-owslib to Suggests, needed to retrieve images using WMS + servers + - bump Standards-Version to 3.9.6 (no changes needed) + - update Homepage field + * Switch to dh_python2 + * Introduce a proper -dbg package + * Add py3k packages; thanks to Eike von Seggern for report; Closes: #776604 + * debian/copyright + - extend packaging copyright years + + -- Sandro Tosi Sat, 07 Feb 2015 15:15:57 +0000 + +basemap (1.0.7+dfsg-1) unstable; urgency=low + + [ Jakub Wilk ] + * Add Vcs-* fields. + * Fix a typo in the package description. + + [ Sandro Tosi ] + * New upstream release + * patch refreshed + * debian/copyright + - extended packaging copyright years + - use the right URL for Format header + - added reference to local file for GPL-2 license + * debian/control + - bump Standards-Version to 3.9.5 (no changes needed) + - update Homepage field + * debian/watch + - mangle local version + + -- Sandro Tosi Sat, 11 Jan 2014 22:12:05 +0100 + +basemap (1.0.6+dfsg-1) experimental; urgency=low + + * new upstream release + * debian/copyright + - extended Debian packaging years + - added new upstream files + * debian/patches/{fix_ftbfs_with_geos3.3, use_share_datafiles} + - updated to new upstream code + + -- Sandro Tosi Fri, 12 Apr 2013 22:57:26 +0200 + +basemap (1.0.5+dfsg-1) experimental; urgency=low + + * new upstream release + * debian/patches/* + - refresh patches + * debian/control + - add python-tk to b-d, needed to have a fully functional matplotlib module + * debian/rules + - fix a FTBFS when building the documentation + * debian/patches/use_share_datafiles + - use BASEMAPDATA variable also in pyproj.py, so that we can pass a local + directory when building doc + + -- Sandro Tosi Fri, 10 Aug 2012 23:46:23 +0200 + +basemap (1.0.3+dfsg-2) unstable; urgency=low + + * debian/rules + - set MPLCONFIGDIR to a writable directory, so it won't fail to build the + doc; thanks to Lucas Nussbaum for the report; Closes: #676058 + + -- Sandro Tosi Fri, 15 Jun 2012 19:51:28 +0200 + +basemap (1.0.3+dfsg-1) unstable; urgency=low + + * New upstream release + - removed geos-3.3.3 from tarball, hence the dfsg tag + * debian/copyright + - updated for new upstream code + - extended packaging copyright years + * debian/patches/dont_compile_nad2bin_on_clean + - removed, merged upstream + * debian/patches/use_share_datafiles + - updated for new upstream code + + -- Sandro Tosi Mon, 28 May 2012 20:07:00 +0200 + +basemap (1.0.2-3) unstable; urgency=low + + * debian/rules + - remove leftover from build process, so the package can be built twice in a + row; thanks to Jakub Wilk for the report; Closes: #671162 + - use xz compression; thanks Julian Taylor for the report and patch; + Closes: #654651 + + -- Sandro Tosi Fri, 04 May 2012 21:49:22 +0200 + +basemap (1.0.2-2) unstable; urgency=low + + * debian/patches/fix_ftbfs_with_geos3.3 + - fix a FTBFS with geos 3.3; thanks to Andreas Beckmann for the report and + to Francesco P. Lovergine for the patch; Closes: #663403 + * debian/{control, rules} + - use dh_numpy + * debian/control + - bump Standards-Version to 3.9.3 (no changes needed) + + -- Sandro Tosi Sat, 17 Mar 2012 16:51:34 +0100 + +basemap (1.0.2-1) unstable; urgency=low + + * New upstream release + * debian/copyright + - updated + * debian/patches/configure_third_party_modules_installation + - removed, no longer needed + * debian/patches/{dont_install_data_files, use_share_datafiles, + dont_compile_nad2bin_on_clean} + - updated to new upstream code + + -- Sandro Tosi Sun, 13 Nov 2011 22:50:58 +0100 + +basemap (1.0.1-1) unstable; urgency=low + + * Initial release (Closes: #389638) + + -- Sandro Tosi Wed, 21 Sep 2011 20:54:38 +0200 diff -Nru basemap-1.1.0+dfsg/debian/changelog.rej basemap-1.1.0+dfsg/debian/changelog.rej --- basemap-1.1.0+dfsg/debian/changelog.rej 1970-01-01 00:00:00.000000000 +0000 +++ basemap-1.1.0+dfsg/debian/changelog.rej 2018-08-10 01:06:27.000000000 +0000 @@ -0,0 +1,14 @@ +--- debian/changelog 2018-05-14 03:30:05.000000000 +0200 ++++ debian/changelog 2018-07-09 15:26:48.000000000 +0200 +@@ -1,3 +1,11 @@ ++basemap (1.1.0+dfsg-2.1) UNRELEASED; urgency=medium ++ ++ * Non-maintainer upload. ++ * Add patch to regenerate _geoslib.c with Cython 0.28.2. ++ * Update docs for README -> README.md rename. ++ ++ -- andro Tosi Mon, 09 Jul 2018 15:26:48 +0200 ++ + basemap (1.1.0+dfsg-2) unstable; urgency=medium + + [ Ondřej Nový ] diff -Nru basemap-1.1.0+dfsg/debian/control basemap-1.1.0+dfsg/debian/control --- basemap-1.1.0+dfsg/debian/control 2018-05-14 01:30:05.000000000 +0000 +++ basemap-1.1.0+dfsg/debian/control 2018-08-10 01:07:12.000000000 +0000 @@ -1,7 +1,8 @@ Source: basemap Section: python Priority: optional -Maintainer: Sandro Tosi +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Sandro Tosi Uploaders: Debian Python Modules Team Build-Depends: debhelper (>= 8.0.0), python-all, python-all-dev, python-all-dbg, python3-all, python3-all-dev, python3-all-dbg, libgeos-dev, python-httplib2, python-dap, dh-python, python-sphinx (>= 1.0.7+dfsg), python-numpy (>= 1:1.5.1-4), python-numpy-dbg, python3-numpy, python3-numpy-dbg, python-matplotlib, python-tk, python-netcdf4, python-pyproj, python-pyshp Standards-Version: 4.1.4 diff -Nru basemap-1.1.0+dfsg/debian/docs basemap-1.1.0+dfsg/debian/docs --- basemap-1.1.0+dfsg/debian/docs 2018-05-14 01:30:05.000000000 +0000 +++ basemap-1.1.0+dfsg/debian/docs 2018-08-10 01:06:27.000000000 +0000 @@ -1,2 +1,2 @@ FAQ -README +README.md diff -Nru basemap-1.1.0+dfsg/debian/patches/geos-cython-0.28.2.patch basemap-1.1.0+dfsg/debian/patches/geos-cython-0.28.2.patch --- basemap-1.1.0+dfsg/debian/patches/geos-cython-0.28.2.patch 1970-01-01 00:00:00.000000000 +0000 +++ basemap-1.1.0+dfsg/debian/patches/geos-cython-0.28.2.patch 2018-08-10 01:06:27.000000000 +0000 @@ -0,0 +1,4667 @@ +Description: Regenerate _geoslib.c with Cython 0.28.2 for Python 3.7 compatibility. +Author: Bas Couwenberg + +--- a/src/_geoslib.c ++++ b/src/_geoslib.c +@@ -1,24 +1,17 @@ +-/* Generated by Cython 0.23.4 */ +- +-/* BEGIN: Cython Metadata +-{ +- "distutils": { +- "depends": [] +- } +-} +-END: Cython Metadata */ ++/* Generated by Cython 0.28.2 */ + + #define PY_SSIZE_T_CLEAN + #include "Python.h" + #ifndef Py_PYTHON_H + #error Python headers needed to compile C extensions, please install development version of Python. +-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) +- #error Cython requires Python 2.6+ or Python 3.2+. ++#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000) ++ #error Cython requires Python 2.6+ or Python 3.3+. + #else +-#define CYTHON_ABI "0_23_4" ++#define CYTHON_ABI "0_28_2" ++#define CYTHON_FUTURE_DIVISION 0 + #include + #ifndef offsetof +-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) ++ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) + #endif + #if !defined(WIN32) && !defined(MS_WINDOWS) + #ifndef __stdcall +@@ -37,6 +30,12 @@ END: Cython Metadata */ + #ifndef DL_EXPORT + #define DL_EXPORT(t) t + #endif ++#define __PYX_COMMA , ++#ifndef HAVE_LONG_LONG ++ #if PY_VERSION_HEX >= 0x02070000 ++ #define HAVE_LONG_LONG ++ #endif ++#endif + #ifndef PY_LONG_LONG + #define PY_LONG_LONG LONG_LONG + #endif +@@ -44,17 +43,245 @@ END: Cython Metadata */ + #define Py_HUGE_VAL HUGE_VAL + #endif + #ifdef PYPY_VERSION +-#define CYTHON_COMPILING_IN_PYPY 1 +-#define CYTHON_COMPILING_IN_CPYTHON 0 ++ #define CYTHON_COMPILING_IN_PYPY 1 ++ #define CYTHON_COMPILING_IN_PYSTON 0 ++ #define CYTHON_COMPILING_IN_CPYTHON 0 ++ #undef CYTHON_USE_TYPE_SLOTS ++ #define CYTHON_USE_TYPE_SLOTS 0 ++ #undef CYTHON_USE_PYTYPE_LOOKUP ++ #define CYTHON_USE_PYTYPE_LOOKUP 0 ++ #if PY_VERSION_HEX < 0x03050000 ++ #undef CYTHON_USE_ASYNC_SLOTS ++ #define CYTHON_USE_ASYNC_SLOTS 0 ++ #elif !defined(CYTHON_USE_ASYNC_SLOTS) ++ #define CYTHON_USE_ASYNC_SLOTS 1 ++ #endif ++ #undef CYTHON_USE_PYLIST_INTERNALS ++ #define CYTHON_USE_PYLIST_INTERNALS 0 ++ #undef CYTHON_USE_UNICODE_INTERNALS ++ #define CYTHON_USE_UNICODE_INTERNALS 0 ++ #undef CYTHON_USE_UNICODE_WRITER ++ #define CYTHON_USE_UNICODE_WRITER 0 ++ #undef CYTHON_USE_PYLONG_INTERNALS ++ #define CYTHON_USE_PYLONG_INTERNALS 0 ++ #undef CYTHON_AVOID_BORROWED_REFS ++ #define CYTHON_AVOID_BORROWED_REFS 1 ++ #undef CYTHON_ASSUME_SAFE_MACROS ++ #define CYTHON_ASSUME_SAFE_MACROS 0 ++ #undef CYTHON_UNPACK_METHODS ++ #define CYTHON_UNPACK_METHODS 0 ++ #undef CYTHON_FAST_THREAD_STATE ++ #define CYTHON_FAST_THREAD_STATE 0 ++ #undef CYTHON_FAST_PYCALL ++ #define CYTHON_FAST_PYCALL 0 ++ #undef CYTHON_PEP489_MULTI_PHASE_INIT ++ #define CYTHON_PEP489_MULTI_PHASE_INIT 0 ++ #undef CYTHON_USE_TP_FINALIZE ++ #define CYTHON_USE_TP_FINALIZE 0 ++#elif defined(PYSTON_VERSION) ++ #define CYTHON_COMPILING_IN_PYPY 0 ++ #define CYTHON_COMPILING_IN_PYSTON 1 ++ #define CYTHON_COMPILING_IN_CPYTHON 0 ++ #ifndef CYTHON_USE_TYPE_SLOTS ++ #define CYTHON_USE_TYPE_SLOTS 1 ++ #endif ++ #undef CYTHON_USE_PYTYPE_LOOKUP ++ #define CYTHON_USE_PYTYPE_LOOKUP 0 ++ #undef CYTHON_USE_ASYNC_SLOTS ++ #define CYTHON_USE_ASYNC_SLOTS 0 ++ #undef CYTHON_USE_PYLIST_INTERNALS ++ #define CYTHON_USE_PYLIST_INTERNALS 0 ++ #ifndef CYTHON_USE_UNICODE_INTERNALS ++ #define CYTHON_USE_UNICODE_INTERNALS 1 ++ #endif ++ #undef CYTHON_USE_UNICODE_WRITER ++ #define CYTHON_USE_UNICODE_WRITER 0 ++ #undef CYTHON_USE_PYLONG_INTERNALS ++ #define CYTHON_USE_PYLONG_INTERNALS 0 ++ #ifndef CYTHON_AVOID_BORROWED_REFS ++ #define CYTHON_AVOID_BORROWED_REFS 0 ++ #endif ++ #ifndef CYTHON_ASSUME_SAFE_MACROS ++ #define CYTHON_ASSUME_SAFE_MACROS 1 ++ #endif ++ #ifndef CYTHON_UNPACK_METHODS ++ #define CYTHON_UNPACK_METHODS 1 ++ #endif ++ #undef CYTHON_FAST_THREAD_STATE ++ #define CYTHON_FAST_THREAD_STATE 0 ++ #undef CYTHON_FAST_PYCALL ++ #define CYTHON_FAST_PYCALL 0 ++ #undef CYTHON_PEP489_MULTI_PHASE_INIT ++ #define CYTHON_PEP489_MULTI_PHASE_INIT 0 ++ #undef CYTHON_USE_TP_FINALIZE ++ #define CYTHON_USE_TP_FINALIZE 0 ++#else ++ #define CYTHON_COMPILING_IN_PYPY 0 ++ #define CYTHON_COMPILING_IN_PYSTON 0 ++ #define CYTHON_COMPILING_IN_CPYTHON 1 ++ #ifndef CYTHON_USE_TYPE_SLOTS ++ #define CYTHON_USE_TYPE_SLOTS 1 ++ #endif ++ #if PY_VERSION_HEX < 0x02070000 ++ #undef CYTHON_USE_PYTYPE_LOOKUP ++ #define CYTHON_USE_PYTYPE_LOOKUP 0 ++ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP) ++ #define CYTHON_USE_PYTYPE_LOOKUP 1 ++ #endif ++ #if PY_MAJOR_VERSION < 3 ++ #undef CYTHON_USE_ASYNC_SLOTS ++ #define CYTHON_USE_ASYNC_SLOTS 0 ++ #elif !defined(CYTHON_USE_ASYNC_SLOTS) ++ #define CYTHON_USE_ASYNC_SLOTS 1 ++ #endif ++ #if PY_VERSION_HEX < 0x02070000 ++ #undef CYTHON_USE_PYLONG_INTERNALS ++ #define CYTHON_USE_PYLONG_INTERNALS 0 ++ #elif !defined(CYTHON_USE_PYLONG_INTERNALS) ++ #define CYTHON_USE_PYLONG_INTERNALS 1 ++ #endif ++ #ifndef CYTHON_USE_PYLIST_INTERNALS ++ #define CYTHON_USE_PYLIST_INTERNALS 1 ++ #endif ++ #ifndef CYTHON_USE_UNICODE_INTERNALS ++ #define CYTHON_USE_UNICODE_INTERNALS 1 ++ #endif ++ #if PY_VERSION_HEX < 0x030300F0 ++ #undef CYTHON_USE_UNICODE_WRITER ++ #define CYTHON_USE_UNICODE_WRITER 0 ++ #elif !defined(CYTHON_USE_UNICODE_WRITER) ++ #define CYTHON_USE_UNICODE_WRITER 1 ++ #endif ++ #ifndef CYTHON_AVOID_BORROWED_REFS ++ #define CYTHON_AVOID_BORROWED_REFS 0 ++ #endif ++ #ifndef CYTHON_ASSUME_SAFE_MACROS ++ #define CYTHON_ASSUME_SAFE_MACROS 1 ++ #endif ++ #ifndef CYTHON_UNPACK_METHODS ++ #define CYTHON_UNPACK_METHODS 1 ++ #endif ++ #ifndef CYTHON_FAST_THREAD_STATE ++ #define CYTHON_FAST_THREAD_STATE 1 ++ #endif ++ #ifndef CYTHON_FAST_PYCALL ++ #define CYTHON_FAST_PYCALL 1 ++ #endif ++ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT ++ #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000) ++ #endif ++ #ifndef CYTHON_USE_TP_FINALIZE ++ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1) ++ #endif ++#endif ++#if !defined(CYTHON_FAST_PYCCALL) ++#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) ++#endif ++#if CYTHON_USE_PYLONG_INTERNALS ++ #include "longintrepr.h" ++ #undef SHIFT ++ #undef BASE ++ #undef MASK ++#endif ++#ifndef __has_attribute ++ #define __has_attribute(x) 0 ++#endif ++#ifndef __has_cpp_attribute ++ #define __has_cpp_attribute(x) 0 ++#endif ++#ifndef CYTHON_RESTRICT ++ #if defined(__GNUC__) ++ #define CYTHON_RESTRICT __restrict__ ++ #elif defined(_MSC_VER) && _MSC_VER >= 1400 ++ #define CYTHON_RESTRICT __restrict ++ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ++ #define CYTHON_RESTRICT restrict ++ #else ++ #define CYTHON_RESTRICT ++ #endif ++#endif ++#ifndef CYTHON_UNUSED ++# if defined(__GNUC__) ++# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) ++# define CYTHON_UNUSED __attribute__ ((__unused__)) ++# else ++# define CYTHON_UNUSED ++# endif ++# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) ++# define CYTHON_UNUSED __attribute__ ((__unused__)) ++# else ++# define CYTHON_UNUSED ++# endif ++#endif ++#ifndef CYTHON_MAYBE_UNUSED_VAR ++# if defined(__cplusplus) ++ template void CYTHON_MAYBE_UNUSED_VAR( const T& ) { } ++# else ++# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x) ++# endif ++#endif ++#ifndef CYTHON_NCP_UNUSED ++# if CYTHON_COMPILING_IN_CPYTHON ++# define CYTHON_NCP_UNUSED ++# else ++# define CYTHON_NCP_UNUSED CYTHON_UNUSED ++# endif ++#endif ++#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) ++#ifdef _MSC_VER ++ #ifndef _MSC_STDINT_H_ ++ #if _MSC_VER < 1300 ++ typedef unsigned char uint8_t; ++ typedef unsigned int uint32_t; ++ #else ++ typedef unsigned __int8 uint8_t; ++ typedef unsigned __int32 uint32_t; ++ #endif ++ #endif + #else +-#define CYTHON_COMPILING_IN_PYPY 0 +-#define CYTHON_COMPILING_IN_CPYTHON 1 ++ #include ++#endif ++#ifndef CYTHON_FALLTHROUGH ++ #if defined(__cplusplus) && __cplusplus >= 201103L ++ #if __has_cpp_attribute(fallthrough) ++ #define CYTHON_FALLTHROUGH [[fallthrough]] ++ #elif __has_cpp_attribute(clang::fallthrough) ++ #define CYTHON_FALLTHROUGH [[clang::fallthrough]] ++ #elif __has_cpp_attribute(gnu::fallthrough) ++ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]] ++ #endif ++ #endif ++ #ifndef CYTHON_FALLTHROUGH ++ #if __has_attribute(fallthrough) ++ #define CYTHON_FALLTHROUGH __attribute__((fallthrough)) ++ #else ++ #define CYTHON_FALLTHROUGH ++ #endif ++ #endif ++ #if defined(__clang__ ) && defined(__apple_build_version__) ++ #if __apple_build_version__ < 7000000 ++ #undef CYTHON_FALLTHROUGH ++ #define CYTHON_FALLTHROUGH ++ #endif ++ #endif + #endif +-#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 +-#define CYTHON_USE_PYLONG_INTERNALS 1 ++ ++#ifndef CYTHON_INLINE ++ #if defined(__clang__) ++ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__)) ++ #elif defined(__GNUC__) ++ #define CYTHON_INLINE __inline__ ++ #elif defined(_MSC_VER) ++ #define CYTHON_INLINE __inline ++ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L ++ #define CYTHON_INLINE inline ++ #else ++ #define CYTHON_INLINE ++ #endif + #endif ++ + #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) +-#define Py_OptimizeFlag 0 ++ #define Py_OptimizeFlag 0 + #endif + #define __PYX_BUILD_PY_SSIZE_T "n" + #define CYTHON_FORMAT_SSIZE_T "z" +@@ -81,23 +308,117 @@ END: Cython Metadata */ + #ifndef Py_TPFLAGS_HAVE_FINALIZE + #define Py_TPFLAGS_HAVE_FINALIZE 0 + #endif ++#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL) ++ #ifndef METH_FASTCALL ++ #define METH_FASTCALL 0x80 ++ #endif ++ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs); ++ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, ++ Py_ssize_t nargs, PyObject *kwnames); ++#else ++ #define __Pyx_PyCFunctionFast _PyCFunctionFast ++ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords ++#endif ++#if CYTHON_FAST_PYCCALL ++#define __Pyx_PyFastCFunction_Check(func)\ ++ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))))) ++#else ++#define __Pyx_PyFastCFunction_Check(func) 0 ++#endif ++#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) ++ #define PyObject_Malloc(s) PyMem_Malloc(s) ++ #define PyObject_Free(p) PyMem_Free(p) ++ #define PyObject_Realloc(p) PyMem_Realloc(p) ++#endif ++#if CYTHON_COMPILING_IN_PYSTON ++ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co) ++ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno) ++#else ++ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0) ++ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno) ++#endif ++#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000 ++ #define __Pyx_PyThreadState_Current PyThreadState_GET() ++#elif PY_VERSION_HEX >= 0x03060000 ++ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet() ++#elif PY_VERSION_HEX >= 0x03000000 ++ #define __Pyx_PyThreadState_Current PyThreadState_GET() ++#else ++ #define __Pyx_PyThreadState_Current _PyThreadState_Current ++#endif ++#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT) ++#include "pythread.h" ++#define Py_tss_NEEDS_INIT 0 ++typedef int Py_tss_t; ++static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) { ++ *key = PyThread_create_key(); ++ return 0; // PyThread_create_key reports success always ++} ++static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) { ++ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t)); ++ *key = Py_tss_NEEDS_INIT; ++ return key; ++} ++static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) { ++ PyObject_Free(key); ++} ++static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) { ++ return *key != Py_tss_NEEDS_INIT; ++} ++static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) { ++ PyThread_delete_key(*key); ++ *key = Py_tss_NEEDS_INIT; ++} ++static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) { ++ return PyThread_set_key_value(*key, value); ++} ++static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) { ++ return PyThread_get_key_value(*key); ++} ++#endif // TSS (Thread Specific Storage) API ++#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized) ++#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n)) ++#else ++#define __Pyx_PyDict_NewPresized(n) PyDict_New() ++#endif ++#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION ++ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) ++ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) ++#else ++ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) ++ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) ++#endif ++#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS ++#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash) ++#else ++#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name) ++#endif + #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) + #define CYTHON_PEP393_ENABLED 1 + #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ + 0 : _PyUnicode_Ready((PyObject *)(op))) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) ++ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u) + #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) + #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) + #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) ++ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch) ++ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) + #else + #define CYTHON_PEP393_ENABLED 0 ++ #define PyUnicode_1BYTE_KIND 1 ++ #define PyUnicode_2BYTE_KIND 2 ++ #define PyUnicode_4BYTE_KIND 4 + #define __Pyx_PyUnicode_READY(op) (0) + #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) + #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) ++ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111) + #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) + #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) + #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) ++ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch) ++ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) + #endif + #if CYTHON_COMPILING_IN_PYPY + #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) +@@ -110,6 +431,12 @@ END: Cython Metadata */ + #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) + #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) + #endif ++#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) ++ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) ++#endif ++#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) ++ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) ++#endif + #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) + #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) + #if PY_MAJOR_VERSION >= 3 +@@ -117,6 +444,9 @@ END: Cython Metadata */ + #else + #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) + #endif ++#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) ++ #define PyObject_ASCII(o) PyObject_Repr(o) ++#endif + #if PY_MAJOR_VERSION >= 3 + #define PyBaseString_Type PyUnicode_Type + #define PyStringObject PyUnicodeObject +@@ -134,7 +464,11 @@ END: Cython Metadata */ + #ifndef PySet_CheckExact + #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) + #endif +-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) ++#if CYTHON_ASSUME_SAFE_MACROS ++ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq) ++#else ++ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq) ++#endif + #if PY_MAJOR_VERSION >= 3 + #define PyIntObject PyLongObject + #define PyInt_Type PyLong_Type +@@ -169,46 +503,26 @@ END: Cython Metadata */ + #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t + #endif + #if PY_MAJOR_VERSION >= 3 +- #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) ++ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func)) + #else + #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) + #endif +-#if PY_VERSION_HEX >= 0x030500B1 +-#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods +-#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) +-#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 +-typedef struct { +- unaryfunc am_await; +- unaryfunc am_aiter; +- unaryfunc am_anext; +-} __Pyx_PyAsyncMethodsStruct; +-#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) +-#else +-#define __Pyx_PyType_AsAsync(obj) NULL +-#endif +-#ifndef CYTHON_RESTRICT +- #if defined(__GNUC__) +- #define CYTHON_RESTRICT __restrict__ +- #elif defined(_MSC_VER) && _MSC_VER >= 1400 +- #define CYTHON_RESTRICT __restrict +- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +- #define CYTHON_RESTRICT restrict ++#if CYTHON_USE_ASYNC_SLOTS ++ #if PY_VERSION_HEX >= 0x030500B1 ++ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods ++ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) + #else +- #define CYTHON_RESTRICT ++ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) + #endif ++#else ++ #define __Pyx_PyType_AsAsync(obj) NULL + #endif +-#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) +- +-#ifndef CYTHON_INLINE +- #if defined(__GNUC__) +- #define CYTHON_INLINE __inline__ +- #elif defined(_MSC_VER) +- #define CYTHON_INLINE __inline +- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L +- #define CYTHON_INLINE inline +- #else +- #define CYTHON_INLINE +- #endif ++#ifndef __Pyx_PyAsyncMethodsStruct ++ typedef struct { ++ unaryfunc am_await; ++ unaryfunc am_aiter; ++ unaryfunc am_anext; ++ } __Pyx_PyAsyncMethodsStruct; + #endif + + #if defined(WIN32) || defined(MS_WINDOWS) +@@ -224,16 +538,18 @@ static CYTHON_INLINE float __PYX_NAN() { + return value; + } + #endif +- +- +-#if PY_MAJOR_VERSION >= 3 +- #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) +- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) ++#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) ++#define __Pyx_truncl trunc + #else +- #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) +- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) ++#define __Pyx_truncl truncl + #endif + ++ ++#define __PYX_ERR(f_index, lineno, Ln_error) \ ++{ \ ++ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ ++} ++ + #ifndef __PYX_EXTERN_C + #ifdef __cplusplus + #define __PYX_EXTERN_C extern "C" +@@ -244,37 +560,18 @@ static CYTHON_INLINE float __PYX_NAN() { + + #define __PYX_HAVE___geoslib + #define __PYX_HAVE_API___geoslib ++/* Early includes */ + #include "numpy/arrayobject.h" + #include "geos_c.h" + #ifdef _OPENMP + #include + #endif /* _OPENMP */ + +-#ifdef PYREX_WITHOUT_ASSERTIONS ++#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS) + #define CYTHON_WITHOUT_ASSERTIONS + #endif + +-#ifndef CYTHON_UNUSED +-# if defined(__GNUC__) +-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +-# define CYTHON_UNUSED __attribute__ ((__unused__)) +-# else +-# define CYTHON_UNUSED +-# endif +-# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) +-# define CYTHON_UNUSED __attribute__ ((__unused__)) +-# else +-# define CYTHON_UNUSED +-# endif +-#endif +-#ifndef CYTHON_NCP_UNUSED +-# if CYTHON_COMPILING_IN_CPYTHON +-# define CYTHON_NCP_UNUSED +-# else +-# define CYTHON_NCP_UNUSED CYTHON_UNUSED +-# endif +-#endif +-typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; ++typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; + const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; + + #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 +@@ -301,8 +598,8 @@ typedef struct {PyObject **p; char *s; c + #define __Pyx_sst_abs(value) abs(value) + #elif SIZEOF_LONG >= SIZEOF_SIZE_T + #define __Pyx_sst_abs(value) labs(value) +-#elif defined (_MSC_VER) && defined (_M_X64) +- #define __Pyx_sst_abs(value) _abs64(value) ++#elif defined (_MSC_VER) ++ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value)) + #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L + #define __Pyx_sst_abs(value) llabs(value) + #elif defined (__GNUC__) +@@ -310,8 +607,8 @@ typedef struct {PyObject **p; char *s; c + #else + #define __Pyx_sst_abs(value) ((value<0) ? -value : value) + #endif +-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); +-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); ++static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*); ++static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); + #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) + #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) + #define __Pyx_PyBytes_FromString PyBytes_FromString +@@ -324,23 +621,27 @@ static CYTHON_INLINE PyObject* __Pyx_PyU + #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString + #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize + #endif +-#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) +-#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) ++#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s)) ++#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s)) ++#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s)) ++#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s)) ++#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s)) ++#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s)) ++#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s)) ++#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) ++#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) ++#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s)) ++#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s)) + #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) + #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) + #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) + #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) + #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) +-#if PY_MAJOR_VERSION < 3 +-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) +-{ ++static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) { + const Py_UNICODE *u_end = u; + while (*u_end++) ; + return (size_t)(u_end - u - 1); + } +-#else +-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen +-#endif + #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) + #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode + #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode +@@ -348,15 +649,23 @@ static CYTHON_INLINE size_t __Pyx_Py_UNI + #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) + #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) + static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); +-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); ++static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); ++#define __Pyx_PySequence_Tuple(obj)\ ++ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj)) + static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); + static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); +-#if CYTHON_COMPILING_IN_CPYTHON ++#if CYTHON_ASSUME_SAFE_MACROS + #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) + #else + #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) + #endif + #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) ++#if PY_MAJOR_VERSION >= 3 ++#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) ++#else ++#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) ++#endif ++#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) + #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII + static int __Pyx_sys_getdefaultencoding_not_ascii; + static int __Pyx_init_sys_getdefaultencoding_params(void) { +@@ -441,12 +750,15 @@ bad: + #define likely(x) (x) + #define unlikely(x) (x) + #endif /* __GNUC__ */ ++static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; } + +-static PyObject *__pyx_m; ++static PyObject *__pyx_m = NULL; + static PyObject *__pyx_d; + static PyObject *__pyx_b; ++static PyObject *__pyx_cython_runtime; + static PyObject *__pyx_empty_tuple; + static PyObject *__pyx_empty_bytes; ++static PyObject *__pyx_empty_unicode; + static int __pyx_lineno; + static int __pyx_clineno = 0; + static const char * __pyx_cfilenm= __FILE__; +@@ -454,7 +766,7 @@ static const char *__pyx_filename; + + + static const char *__pyx_f[] = { +- "_geoslib.pyx", ++ "src/_geoslib.pyx", + }; + + /*--- Type declarations ---*/ +@@ -517,6 +829,7 @@ struct __pyx_obj_8_geoslib_Point { + + + /* --- Runtime support code (head) --- */ ++/* Refnanny.proto */ + #ifndef CYTHON_REFNANNY + #define CYTHON_REFNANNY 0 + #endif +@@ -579,55 +892,123 @@ struct __pyx_obj_8_geoslib_Point { + #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) + #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) + +-#if CYTHON_COMPILING_IN_CPYTHON +-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { +- PyTypeObject* tp = Py_TYPE(obj); +- if (likely(tp->tp_getattro)) +- return tp->tp_getattro(obj, attr_name); +-#if PY_MAJOR_VERSION < 3 +- if (likely(tp->tp_getattr)) +- return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); +-#endif +- return PyObject_GetAttr(obj, attr_name); +-} ++/* PyObjectGetAttrStr.proto */ ++#if CYTHON_USE_TYPE_SLOTS ++static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name); + #else + #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) + #endif + ++/* GetBuiltinName.proto */ + static PyObject *__Pyx_GetBuiltinName(PyObject *name); + +-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); +-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); +- ++/* PyThreadStateGet.proto */ ++#if CYTHON_FAST_THREAD_STATE ++#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; ++#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current; ++#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type ++#else ++#define __Pyx_PyThreadState_declare ++#define __Pyx_PyThreadState_assign ++#define __Pyx_PyErr_Occurred() PyErr_Occurred() ++#endif ++ ++/* SaveResetException.proto */ ++#if CYTHON_FAST_THREAD_STATE ++#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb) ++static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); ++#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb) ++static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); ++#else ++#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb) ++#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb) ++#endif ++ ++/* GetException.proto */ ++#if CYTHON_FAST_THREAD_STATE ++#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb) ++static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); ++#else + static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); ++#endif + ++/* GetModuleGlobalName.proto */ + static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); + ++/* PyCFunctionFastCall.proto */ ++#if CYTHON_FAST_PYCCALL ++static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs); ++#else ++#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL) ++#endif ++ ++/* PyFunctionFastCall.proto */ ++#if CYTHON_FAST_PYCALL ++#define __Pyx_PyFunction_FastCall(func, args, nargs)\ ++ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL) ++#if 1 || PY_VERSION_HEX < 0x030600B1 ++static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs); ++#else ++#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs) ++#endif ++#endif ++ ++/* PyObjectCall.proto */ + #if CYTHON_COMPILING_IN_CPYTHON + static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); + #else + #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) + #endif + ++/* PyObjectCallMethO.proto */ + #if CYTHON_COMPILING_IN_CPYTHON + static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); + #endif + ++/* PyObjectCallOneArg.proto */ + static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); + +-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); +-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); ++/* PyErrFetchRestore.proto */ ++#if CYTHON_FAST_THREAD_STATE ++#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL) ++#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) ++#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) ++#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) ++#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) ++static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); ++static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); ++#if CYTHON_COMPILING_IN_CPYTHON ++#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL)) ++#else ++#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) ++#endif ++#else ++#define __Pyx_PyErr_Clear() PyErr_Clear() ++#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc) ++#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) ++#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) ++#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb) ++#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb) ++#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) ++#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) ++#endif + ++/* WriteUnraisableException.proto */ + static void __Pyx_WriteUnraisable(const char *name, int clineno, + int lineno, const char *filename, + int full_traceback, int nogil); + +-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, +- const char *name, int exact); ++/* ArgTypeTest.proto */ ++#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\ ++ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\ ++ __Pyx__ArgTypeTest(obj, type, name, exact)) ++static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact); + ++/* RaiseException.proto */ + static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); + +-#if CYTHON_COMPILING_IN_CPYTHON ++/* ListAppend.proto */ ++#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS + static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { + PyListObject* L = (PyListObject*) list; + Py_ssize_t len = Py_SIZE(list); +@@ -643,23 +1024,29 @@ static CYTHON_INLINE int __Pyx_PyList_Ap + #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) + #endif + ++/* RaiseDoubleKeywords.proto */ + static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); + ++/* ParseKeywords.proto */ + static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\ + PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\ + const char* function_name); + ++/* RaiseArgTupleInvalid.proto */ + static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, + Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); + ++/* PyObjectCallNoArg.proto */ + #if CYTHON_COMPILING_IN_CPYTHON + static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); + #else + #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) + #endif + ++/* ExtTypeTest.proto */ + static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); + ++/* GetItemInt.proto */ + #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\ + (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\ + __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\ +@@ -677,15 +1064,45 @@ static CYTHON_INLINE PyObject *__Pyx_Get + (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + int wraparound, int boundscheck); +-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); ++static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, + int is_list, int wraparound, int boundscheck); + ++/* ObjectGetItem.proto */ ++#if CYTHON_USE_TYPE_SLOTS ++static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key); ++#else ++#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key) ++#endif ++ ++/* PyObject_GenericGetAttrNoDict.proto */ ++#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 ++static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name); ++#else ++#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr ++#endif ++ ++/* PyObject_GenericGetAttr.proto */ ++#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 ++static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name); ++#else ++#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr ++#endif ++ ++/* Import.proto */ + static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); + ++/* CLineInTraceback.proto */ ++#ifdef CYTHON_CLINE_IN_TRACEBACK ++#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0) ++#else ++static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line); ++#endif ++ ++/* CodeObjectCache.proto */ + typedef struct { +- int code_line; + PyCodeObject* code_object; ++ int code_line; + } __Pyx_CodeObjectCacheEntry; + struct __Pyx_CodeObjectCache { + int count; +@@ -697,23 +1114,45 @@ static int __pyx_bisect_code_objects(__P + static PyCodeObject *__pyx_find_code_object(int code_line); + static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); + ++/* AddTraceback.proto */ + static void __Pyx_AddTraceback(const char *funcname, int c_line, + int py_line, const char *filename); + ++/* CIntToPy.proto */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); + ++/* CIntToPy.proto */ + static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); + ++/* CIntToPy.proto */ ++static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); ++ ++/* CIntFromPy.proto */ + static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *); + ++/* CIntFromPy.proto */ + static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); + +-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value); +- ++/* CIntFromPy.proto */ + static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); + ++/* FastTypeChecks.proto */ ++#if CYTHON_COMPILING_IN_CPYTHON ++#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type) ++static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b); ++static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type); ++static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2); ++#else ++#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) ++#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type) ++#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2)) ++#endif ++#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception) ++ ++/* CheckBinaryVersion.proto */ + static int __Pyx_check_binary_version(void); + ++/* PyIdentifierFromString.proto */ + #if !defined(__Pyx_PyIdentifier_FromString) + #if PY_MAJOR_VERSION < 3 + #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) +@@ -722,10 +1161,13 @@ static int __Pyx_check_binary_version(vo + #endif + #endif + ++/* ModuleImport.proto */ + static PyObject *__Pyx_ImportModule(const char *name); + ++/* TypeImport.proto */ + static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); + ++/* InitStrings.proto */ + static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); + + +@@ -742,36 +1184,39 @@ static void __pyx_f_8_geoslib_error_h(ch + static PyObject *__pyx_f_8_geoslib_geos_version(void); /*proto*/ + static PyObject *__pyx_f_8_geoslib__get_coords(GEOSGeom *); /*proto*/ + #define __Pyx_MODULE_NAME "_geoslib" ++extern int __pyx_module_is_main__geoslib; + int __pyx_module_is_main__geoslib = 0; + + /* Implementation of '_geoslib' */ + static PyObject *__pyx_builtin_NotImplementedError; +-static char __pyx_k_b[] = "b"; +-static char __pyx_k_0_3[] = "0.3"; +-static char __pyx_k_sys[] = "sys"; +-static char __pyx_k_copy[] = "copy"; +-static char __pyx_k_main[] = "__main__"; +-static char __pyx_k_test[] = "__test__"; +-static char __pyx_k_class[] = "__class__"; +-static char __pyx_k_empty[] = "empty"; +-static char __pyx_k_numpy[] = "numpy"; +-static char __pyx_k_shape[] = "shape"; +-static char __pyx_k_write[] = "write"; +-static char __pyx_k_import[] = "__import__"; +-static char __pyx_k_stderr[] = "stderr"; +-static char __pyx_k_float64[] = "float64"; +-static char __pyx_k_version[] = "__version__"; +-static char __pyx_k_GEOS_ERROR_s[] = "GEOS_ERROR: %s\n"; +-static char __pyx_k_geos_version[] = "__geos_version__"; +-static char __pyx_k_geos_major_version[] = "__geos_major_version__"; +-static char __pyx_k_NotImplementedError[] = "NotImplementedError"; +-static char __pyx_k_intersections_of_type_s_not_yet[] = "intersections of type '%s' not yet implemented"; +-static char __pyx_k_unions_of_type_s_not_yet_impleme[] = "unions of type '%s' not yet implemented"; ++static const char __pyx_k_b[] = "b"; ++static const char __pyx_k_0_3[] = "0.3"; ++static const char __pyx_k_sys[] = "sys"; ++static const char __pyx_k_copy[] = "copy"; ++static const char __pyx_k_main[] = "__main__"; ++static const char __pyx_k_test[] = "__test__"; ++static const char __pyx_k_class[] = "__class__"; ++static const char __pyx_k_empty[] = "empty"; ++static const char __pyx_k_numpy[] = "numpy"; ++static const char __pyx_k_shape[] = "shape"; ++static const char __pyx_k_write[] = "write"; ++static const char __pyx_k_import[] = "__import__"; ++static const char __pyx_k_stderr[] = "stderr"; ++static const char __pyx_k_float64[] = "float64"; ++static const char __pyx_k_version[] = "__version__"; ++static const char __pyx_k_GEOS_ERROR_s[] = "GEOS_ERROR: %s\n"; ++static const char __pyx_k_geos_version[] = "__geos_version__"; ++static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; ++static const char __pyx_k_geos_major_version[] = "__geos_major_version__"; ++static const char __pyx_k_NotImplementedError[] = "NotImplementedError"; ++static const char __pyx_k_intersections_of_type_s_not_yet[] = "intersections of type '%s' not yet implemented"; ++static const char __pyx_k_unions_of_type_s_not_yet_impleme[] = "unions of type '%s' not yet implemented"; + static PyObject *__pyx_kp_s_0_3; + static PyObject *__pyx_kp_s_GEOS_ERROR_s; + static PyObject *__pyx_n_s_NotImplementedError; + static PyObject *__pyx_n_s_b; + static PyObject *__pyx_n_s_class; ++static PyObject *__pyx_n_s_cline_in_traceback; + static PyObject *__pyx_n_s_copy; + static PyObject *__pyx_n_s_empty; + static PyObject *__pyx_n_s_float64; +@@ -824,6 +1269,7 @@ static PyObject *__pyx_tuple_; + static PyObject *__pyx_tuple__2; + static PyObject *__pyx_tuple__3; + static PyObject *__pyx_tuple__4; ++/* Late includes */ + + /* "_geoslib.pyx":108 + * int GEOSCoordSeq_getSize(GEOSCoordSeq *s, unsigned int *size) +@@ -862,9 +1308,6 @@ static void __pyx_f_8_geoslib_error_h(ch + PyObject *__pyx_t_6 = NULL; + PyObject *__pyx_t_7 = NULL; + PyObject *__pyx_t_8 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("error_h", 0); + + /* "_geoslib.pyx":119 +@@ -874,7 +1317,7 @@ static void __pyx_f_8_geoslib_error_h(ch + * message = PyBytes_FromString(msg) + * try: + */ +- __pyx_t_1 = PyBytes_FromString(__pyx_v_fmt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = PyBytes_FromString(__pyx_v_fmt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_format = __pyx_t_1; + __pyx_t_1 = 0; +@@ -886,7 +1329,7 @@ static void __pyx_f_8_geoslib_error_h(ch + * try: + * warn_msg = format % message + */ +- __pyx_t_1 = PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_message = __pyx_t_1; + __pyx_t_1 = 0; +@@ -899,6 +1342,8 @@ static void __pyx_f_8_geoslib_error_h(ch + * except: + */ + { ++ __Pyx_PyThreadState_declare ++ __Pyx_PyThreadState_assign + __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4); + __Pyx_XGOTREF(__pyx_t_2); + __Pyx_XGOTREF(__pyx_t_3); +@@ -912,7 +1357,7 @@ static void __pyx_f_8_geoslib_error_h(ch + * except: + * warn_msg = format + */ +- __pyx_t_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L3_error;} ++ __pyx_t_1 = PyNumber_Remainder(__pyx_v_format, __pyx_v_message); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L3_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_v_warn_msg = __pyx_t_1; + __pyx_t_1 = 0; +@@ -928,7 +1373,7 @@ static void __pyx_f_8_geoslib_error_h(ch + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; +- goto __pyx_L10_try_end; ++ goto __pyx_L8_try_end; + __pyx_L3_error:; + __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + +@@ -941,7 +1386,7 @@ static void __pyx_f_8_geoslib_error_h(ch + */ + /*except:*/ { + __Pyx_AddTraceback("_geoslib.error_h", __pyx_clineno, __pyx_lineno, __pyx_filename); +- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;} ++ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 123, __pyx_L5_except_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GOTREF(__pyx_t_6); +@@ -979,7 +1424,7 @@ static void __pyx_f_8_geoslib_error_h(ch + __Pyx_XGIVEREF(__pyx_t_3); + __Pyx_XGIVEREF(__pyx_t_4); + __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4); +- __pyx_L10_try_end:; ++ __pyx_L8_try_end:; + } + + /* "_geoslib.pyx":125 +@@ -989,18 +1434,18 @@ static void __pyx_f_8_geoslib_error_h(ch + * + * # check library version + */ +- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); +- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_stderr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; +- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_write); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; +- __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_GEOS_ERROR_s, __pyx_v_warn_msg); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_GEOS_ERROR_s, __pyx_v_warn_msg); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_t_7 = NULL; +- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) { ++ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5); +@@ -1010,19 +1455,39 @@ static void __pyx_f_8_geoslib_error_h(ch + } + } + if (!__pyx_t_7) { +- __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_6); + } else { +- __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_8); +- __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; +- __Pyx_GIVEREF(__pyx_t_1); +- PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1); +- __pyx_t_1 = 0; +- __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_6); +- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ++ #if CYTHON_FAST_PYCALL ++ if (PyFunction_Check(__pyx_t_5)) { ++ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1}; ++ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) ++ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; ++ __Pyx_GOTREF(__pyx_t_6); ++ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; ++ } else ++ #endif ++ #if CYTHON_FAST_PYCCALL ++ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { ++ PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_1}; ++ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) ++ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; ++ __Pyx_GOTREF(__pyx_t_6); ++ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; ++ } else ++ #endif ++ { ++ __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 125, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_8); ++ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; ++ __Pyx_GIVEREF(__pyx_t_1); ++ PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_1); ++ __pyx_t_1 = 0; ++ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 125, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_6); ++ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ++ } + } + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; +@@ -1043,7 +1508,7 @@ static void __pyx_f_8_geoslib_error_h(ch + __Pyx_XDECREF(__pyx_t_6); + __Pyx_XDECREF(__pyx_t_7); + __Pyx_XDECREF(__pyx_t_8); +- __Pyx_WriteUnraisable("_geoslib.error_h", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); ++ __Pyx_WriteUnraisable("_geoslib.error_h", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0); + __pyx_L0:; + __Pyx_XDECREF(__pyx_v_format); + __Pyx_XDECREF(__pyx_v_message); +@@ -1063,9 +1528,6 @@ static PyObject *__pyx_f_8_geoslib_geos_ + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("geos_version", 0); + + /* "_geoslib.pyx":129 +@@ -1076,7 +1538,7 @@ static PyObject *__pyx_f_8_geoslib_geos_ + * __geos_major_version__ = GEOS_VERSION_MAJOR + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_1 = PyBytes_FromString(GEOSversion()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = PyBytes_FromString(GEOSversion()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; +@@ -1223,9 +1685,6 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("geom_type", 0); + + /* "_geoslib.pyx":152 +@@ -1236,7 +1695,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * def within(self, BaseGeometry geom): + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_1 = PyBytes_FromString(GEOSGeomType(__pyx_v_self->_geom)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = PyBytes_FromString(GEOSGeomType(__pyx_v_self->_geom)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; +@@ -1272,13 +1731,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + /* Python wrapper */ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_5within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_5within(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { +- CYTHON_UNUSED int __pyx_lineno = 0; +- CYTHON_UNUSED const char *__pyx_filename = NULL; +- CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("within (wrapper)", 0); +- 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_error;} ++ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_r = __pyx_pf_8_geoslib_12BaseGeometry_4within(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self), ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)); + + /* function exit code */ +@@ -1400,13 +1856,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + /* Python wrapper */ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_7union(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_7union(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { +- CYTHON_UNUSED int __pyx_lineno = 0; +- CYTHON_UNUSED const char *__pyx_filename = NULL; +- CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("union (wrapper)", 0); +- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_r = __pyx_pf_8_geoslib_12BaseGeometry_6union(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self), ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)); + + /* function exit code */ +@@ -1433,9 +1886,6 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + GEOSGeom *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("union", 0); + + /* "_geoslib.pyx":172 +@@ -1493,7 +1943,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * elif typeid == GEOS_LINESTRING: + */ +- __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_b = __pyx_t_2; + __pyx_t_2 = 0; +@@ -1505,16 +1955,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_LINESTRING: + * b = _get_coords(g3) + */ +- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); +- __pyx_t_3 = 0; ++ __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":176 + * g3 = GEOSUnion(g1, g2) +@@ -1541,10 +1985,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * # for multi-geom structures, just return first one. + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __pyx_v_b = __pyx_t_3; +- __pyx_t_3 = 0; ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __pyx_v_b = __pyx_t_2; ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":181 + * elif typeid == GEOS_LINESTRING: +@@ -1553,14 +1997,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * # for multi-geom structures, just return first one. + * elif typeid == GEOS_MULTIPOLYGON: + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); + __pyx_t_2 = 0; + +@@ -1607,7 +2045,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * elif typeid == GEOS_MULTILINESTRING: + */ +- __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_b = __pyx_t_2; + __pyx_t_2 = 0; +@@ -1619,16 +2057,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ +- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); +- __pyx_t_3 = 0; ++ __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":183 + * p = LineString(b) +@@ -1673,10 +2105,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * else: + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __pyx_v_b = __pyx_t_3; +- __pyx_t_3 = 0; ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __pyx_v_b = __pyx_t_2; ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":192 + * gout = GEOSGetGeometryN(g3, 0) +@@ -1685,14 +2117,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * else: + * type = PyBytes_FromString(GEOSGeomType(g3)) + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); + __pyx_t_2 = 0; + +@@ -1713,7 +2139,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * raise NotImplementedError("unions of type '%s' not yet implemented" % (type)) + * GEOSGeom_destroy(g3) + */ +- __pyx_t_2 = PyBytes_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = PyBytes_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_type = __pyx_t_2; + __pyx_t_2 = 0; +@@ -1725,19 +2151,14 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * GEOSGeom_destroy(g3) + * return p + */ +- __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_unions_of_type_s_not_yet_impleme, __pyx_v_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_unions_of_type_s_not_yet_impleme, __pyx_v_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __Pyx_GIVEREF(__pyx_t_2); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); +- __pyx_t_2 = 0; +- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __Pyx_Raise(__pyx_t_3, 0, 0, 0); ++ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ++ __PYX_ERR(0, 195, __pyx_L1_error) + break; + } + +@@ -1822,9 +2243,6 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + double __pyx_t_2; + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("simplify", 0); + + /* "_geoslib.pyx":205 +@@ -1844,7 +2262,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * g3 = GEOSSimplify(g1,tolerance) + * typeid = GEOSGeomTypeId(g3) + */ +- __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_v_tol); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_v_tolerance = __pyx_t_2; + + /* "_geoslib.pyx":207 +@@ -1882,7 +2300,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * elif typeid == GEOS_LINESTRING: + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_b = __pyx_t_3; + __pyx_t_3 = 0; +@@ -1894,16 +2312,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_LINESTRING: + * b = _get_coords(g3) + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_4); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_4); +- __pyx_t_4 = 0; ++ __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); ++ __pyx_t_3 = 0; + + /* "_geoslib.pyx":209 + * g3 = GEOSSimplify(g1,tolerance) +@@ -1930,10 +2342,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * # for multi-geom structures, just return first one. + */ +- __pyx_t_4 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_4); +- __pyx_v_b = __pyx_t_4; +- __pyx_t_4 = 0; ++ __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_3); ++ __pyx_v_b = __pyx_t_3; ++ __pyx_t_3 = 0; + + /* "_geoslib.pyx":214 + * elif typeid == GEOS_LINESTRING: +@@ -1942,14 +2354,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * # for multi-geom structures, just return first one. + * elif typeid == GEOS_MULTIPOLYGON: + */ +- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_4); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); + __pyx_t_3 = 0; + +@@ -1996,7 +2402,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * elif typeid == GEOS_MULTILINESTRING: + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_b = __pyx_t_3; + __pyx_t_3 = 0; +@@ -2008,16 +2414,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_4); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_4); +- __pyx_t_4 = 0; ++ __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); ++ __pyx_t_3 = 0; + + /* "_geoslib.pyx":216 + * p = LineString(b) +@@ -2062,10 +2462,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * else: + */ +- __pyx_t_4 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_4); +- __pyx_v_b = __pyx_t_4; +- __pyx_t_4 = 0; ++ __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 224, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_3); ++ __pyx_v_b = __pyx_t_3; ++ __pyx_t_3 = 0; + + /* "_geoslib.pyx":225 + * gout = GEOSGetGeometryN(g3, 0) +@@ -2074,14 +2474,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * else: + * type = PyBytes_FromString(GEOSGeomType(g3)) + */ +- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_4); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 225, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); + __pyx_t_3 = 0; + +@@ -2102,7 +2496,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * GEOSGeom_destroy(g3) + */ +- __pyx_t_3 = PyBytes_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = PyBytes_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_v_type = __pyx_t_3; + __pyx_t_3 = 0; +@@ -2114,19 +2508,14 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * GEOSGeom_destroy(g3) + * return p + */ +- __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_intersections_of_type_s_not_yet, __pyx_v_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_intersections_of_type_s_not_yet, __pyx_v_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); +- __Pyx_GIVEREF(__pyx_t_3); +- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); +- __pyx_t_3 = 0; +- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +- __Pyx_Raise(__pyx_t_3, 0, 0, 0); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __Pyx_Raise(__pyx_t_4, 0, 0, 0); ++ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; ++ __PYX_ERR(0, 228, __pyx_L1_error) + break; + } + +@@ -2209,9 +2598,6 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + GEOSGeom *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("fix", 0); + + /* "_geoslib.pyx":237 +@@ -2259,7 +2645,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * elif typeid == GEOS_LINESTRING: + */ +- __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_b = __pyx_t_2; + __pyx_t_2 = 0; +@@ -2271,16 +2657,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_LINESTRING: + * b = _get_coords(g3) + */ +- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); +- __pyx_t_3 = 0; ++ __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":240 + * g3 = GEOSBuffer(g1, 0., 0) +@@ -2307,10 +2687,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * # for multi-geom structures, just return first one. + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __pyx_v_b = __pyx_t_3; +- __pyx_t_3 = 0; ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __pyx_v_b = __pyx_t_2; ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":245 + * elif typeid == GEOS_LINESTRING: +@@ -2319,14 +2699,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * # for multi-geom structures, just return first one. + * elif typeid == GEOS_MULTIPOLYGON: + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); + __pyx_t_2 = 0; + +@@ -2373,7 +2747,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * elif typeid == GEOS_MULTILINESTRING: + */ +- __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_b = __pyx_t_2; + __pyx_t_2 = 0; +@@ -2385,16 +2759,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ +- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); +- __pyx_t_3 = 0; ++ __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":247 + * p = LineString(b) +@@ -2439,10 +2807,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * else: + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __pyx_v_b = __pyx_t_3; +- __pyx_t_3 = 0; ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __pyx_v_b = __pyx_t_2; ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":256 + * gout = GEOSGetGeometryN(g3, 0) +@@ -2451,14 +2819,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * else: + * type = PyBytes_FromString(GEOSGeomType(g3)) + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); + __pyx_t_2 = 0; + +@@ -2479,7 +2841,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * raise NotImplementedError("intersections of type '%s' not yet implemented" % (type)) + * GEOSGeom_destroy(g3) + */ +- __pyx_t_2 = PyBytes_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = PyBytes_FromString(GEOSGeomType(__pyx_v_g3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_type = __pyx_t_2; + __pyx_t_2 = 0; +@@ -2491,19 +2853,14 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * GEOSGeom_destroy(g3) + * return p + */ +- __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_intersections_of_type_s_not_yet, __pyx_v_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_intersections_of_type_s_not_yet, __pyx_v_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_NotImplementedError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __Pyx_GIVEREF(__pyx_t_2); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); +- __pyx_t_2 = 0; +- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_NotImplementedError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- __Pyx_Raise(__pyx_t_2, 0, 0, 0); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __Pyx_Raise(__pyx_t_3, 0, 0, 0); ++ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; ++ __PYX_ERR(0, 259, __pyx_L1_error) + break; + } + +@@ -2562,13 +2919,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + /* Python wrapper */ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_13intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_13intersects(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { +- CYTHON_UNUSED int __pyx_lineno = 0; +- CYTHON_UNUSED const char *__pyx_filename = NULL; +- CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersects (wrapper)", 0); +- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_r = __pyx_pf_8_geoslib_12BaseGeometry_12intersects(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self), ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)); + + /* function exit code */ +@@ -2690,13 +3044,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + /* Python wrapper */ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_15intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom); /*proto*/ + static PyObject *__pyx_pw_8_geoslib_12BaseGeometry_15intersection(PyObject *__pyx_v_self, PyObject *__pyx_v_geom) { +- CYTHON_UNUSED int __pyx_lineno = 0; +- CYTHON_UNUSED const char *__pyx_filename = NULL; +- CYTHON_UNUSED int __pyx_clineno = 0; + PyObject *__pyx_r = 0; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("intersection (wrapper)", 0); +- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_geom), __pyx_ptype_8_geoslib_BaseGeometry, 1, "geom", 0))) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_r = __pyx_pf_8_geoslib_12BaseGeometry_14intersection(((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_self), ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_v_geom)); + + /* function exit code */ +@@ -2723,12 +3074,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + __Pyx_RefNannyDeclarations + GEOSGeom *__pyx_t_1; + PyObject *__pyx_t_2 = NULL; +- PyObject *__pyx_t_3 = NULL; ++ int __pyx_t_3; + int __pyx_t_4; +- int __pyx_t_5; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("intersection", 0); + + /* "_geoslib.pyx":282 +@@ -2786,7 +3133,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * pout = [p] + */ +- __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_b = __pyx_t_2; + __pyx_t_2 = 0; +@@ -2798,16 +3145,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * pout = [p] + * elif typeid == GEOS_LINESTRING: + */ +- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3); +- __pyx_t_3 = 0; ++ __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":289 + * b = _get_coords(g3) +@@ -2816,13 +3157,13 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_LINESTRING: + * b = _get_coords(g3) + */ +- __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); ++ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_p)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_p)); +- PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_p)); +- __pyx_v_pout = ((PyObject*)__pyx_t_3); +- __pyx_t_3 = 0; ++ PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_p)); ++ __pyx_v_pout = ((PyObject*)__pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":286 + * g3 = GEOSIntersection(g1, g2) +@@ -2849,10 +3190,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * pout = [p] + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __pyx_v_b = __pyx_t_3; +- __pyx_t_3 = 0; ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_g3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __pyx_v_b = __pyx_t_2; ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":292 + * elif typeid == GEOS_LINESTRING: +@@ -2861,14 +3202,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * pout = [p] + * elif typeid == GEOS_MULTIPOLYGON: + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 292, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_p = ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2); + __pyx_t_2 = 0; + +@@ -2879,7 +3214,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_MULTIPOLYGON: + * numgeoms = GEOSGetNumGeometries(g3) + */ +- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 293, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(((PyObject *)__pyx_v_p)); + __Pyx_GIVEREF(((PyObject *)__pyx_v_p)); +@@ -2921,7 +3256,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ +- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_v_pout = ((PyObject*)__pyx_t_2); + __pyx_t_2 = 0; +@@ -2933,8 +3268,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * gout = GEOSGetGeometryN(g3, i) + * b = _get_coords(gout) + */ +- __pyx_t_4 = __pyx_v_numgeoms; +- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { ++ __pyx_t_3 = __pyx_v_numgeoms; ++ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "_geoslib.pyx":298 + * pout = [] +@@ -2952,7 +3287,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = Polygon(b) + * pout.append(p) + */ +- __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_2); + __pyx_t_2 = 0; +@@ -2964,16 +3299,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * pout.append(p) + * elif typeid == GEOS_MULTILINESTRING: + */ +- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 300, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_b); +- __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_Polygon), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __Pyx_XDECREF_SET(__pyx_v_p, ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_3)); +- __pyx_t_3 = 0; ++ __Pyx_XDECREF_SET(__pyx_v_p, ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2)); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":301 + * b = _get_coords(gout) +@@ -2982,7 +3311,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * elif typeid == GEOS_MULTILINESTRING: + * numgeoms = GEOSGetNumGeometries(g3) + */ +- __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pout, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_pout, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 301, __pyx_L1_error) + } + + /* "_geoslib.pyx":294 +@@ -3019,10 +3348,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * for i from 0 <= i < numgeoms: + * gout = GEOSGetGeometryN(g3, i) + */ +- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __pyx_v_pout = ((PyObject*)__pyx_t_3); +- __pyx_t_3 = 0; ++ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __pyx_v_pout = ((PyObject*)__pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":305 + * numgeoms = GEOSGetNumGeometries(g3) +@@ -3031,8 +3360,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * gout = GEOSGetGeometryN(g3, i) + * b = _get_coords(gout) + */ +- __pyx_t_4 = __pyx_v_numgeoms; +- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) { ++ __pyx_t_3 = __pyx_v_numgeoms; ++ for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) { + + /* "_geoslib.pyx":306 + * pout = [] +@@ -3050,10 +3379,10 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * p = LineString(b) + * pout.append(p) + */ +- __pyx_t_3 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_3); +- __pyx_t_3 = 0; ++ __pyx_t_2 = __pyx_f_8_geoslib__get_coords(__pyx_v_gout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __Pyx_XDECREF_SET(__pyx_v_b, __pyx_t_2); ++ __pyx_t_2 = 0; + + /* "_geoslib.pyx":308 + * gout = GEOSGetGeometryN(g3, i) +@@ -3062,14 +3391,8 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * pout.append(p) + * else: + */ +- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_3); +- __Pyx_INCREF(__pyx_v_b); +- __Pyx_GIVEREF(__pyx_v_b); +- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_b); +- __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8_geoslib_LineString), __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_XDECREF_SET(__pyx_v_p, ((struct __pyx_obj_8_geoslib_BaseGeometry *)__pyx_t_2)); + __pyx_t_2 = 0; + +@@ -3080,7 +3403,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * else: + * #type = PyBytes_FromString(GEOSGeomType(g3)) + */ +- __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_pout, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_pout, ((PyObject *)__pyx_v_p)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 309, __pyx_L1_error) + } + + /* "_geoslib.pyx":302 +@@ -3110,7 +3433,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * return pout + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_r = __pyx_t_2; + __pyx_t_2 = 0; +@@ -3150,7 +3473,6 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + /* function exit code */ + __pyx_L1_error:; + __Pyx_XDECREF(__pyx_t_2); +- __Pyx_XDECREF(__pyx_t_3); + __Pyx_AddTraceback("_geoslib.BaseGeometry.intersection", __pyx_clineno, __pyx_lineno, __pyx_filename); + __pyx_r = NULL; + __pyx_L0:; +@@ -3187,9 +3509,6 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("get_coords", 0); + + /* "_geoslib.pyx":319 +@@ -3200,7 +3519,7 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * def __dealloc__(self): + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_1 = __pyx_f_8_geoslib__get_coords(__pyx_v_self->_geom); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __pyx_f_8_geoslib__get_coords(__pyx_v_self->_geom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; +@@ -3297,9 +3616,6 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + PyObject *__pyx_t_1 = NULL; + PyObject *__pyx_t_2 = NULL; + PyObject *__pyx_t_3 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__reduce__", 0); + + /* "_geoslib.pyx":327 +@@ -3310,14 +3626,14 @@ static PyObject *__pyx_pf_8_geoslib_12Ba + * cdef class Polygon(BaseGeometry): + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_INCREF(__pyx_v_self->boundary); + __Pyx_GIVEREF(__pyx_v_self->boundary); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->boundary); +- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_GIVEREF(__pyx_t_1); + PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); +@@ -3457,9 +3773,6 @@ static int __pyx_pf_8_geoslib_12BaseGeom + static int __pyx_pw_8_geoslib_7Polygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ + static int __pyx_pw_8_geoslib_7Polygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_b = 0; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); +@@ -3471,17 +3784,18 @@ static int __pyx_pw_8_geoslib_7Polygon_1 + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); ++ CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: +- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; ++ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { +- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} ++ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 331, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; +@@ -3492,13 +3806,13 @@ static int __pyx_pw_8_geoslib_7Polygon_1 + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; +- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L3_error;} ++ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 331, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("_geoslib.Polygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; +- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8_geoslib_ndarray, 1, "b", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8_geoslib_ndarray, 1, "b", 0))) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_r = __pyx_pf_8_geoslib_7Polygon___init__(((struct __pyx_obj_8_geoslib_Polygon *)__pyx_v_self), __pyx_v_b); + + /* function exit code */ +@@ -3527,9 +3841,6 @@ static int __pyx_pf_8_geoslib_7Polygon__ + PyObject *__pyx_t_4 = NULL; + unsigned int __pyx_t_5; + int __pyx_t_6; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF((PyObject *)__pyx_v_b); + +@@ -3550,10 +3861,10 @@ static int __pyx_pf_8_geoslib_7Polygon__ + * + * m = b.shape[0] + */ +- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; +- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { ++ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +@@ -3563,14 +3874,14 @@ static int __pyx_pf_8_geoslib_7Polygon__ + } + } + if (__pyx_t_4) { +- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { +- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_geoslib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_geoslib_ndarray))))) __PYX_ERR(0, 341, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_b, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + +@@ -3590,12 +3901,12 @@ static int __pyx_pf_8_geoslib_7Polygon__ + * + * # Add closing coordinates to sequence? + */ +- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 343, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_m = __pyx_t_5; + +@@ -3606,28 +3917,28 @@ static int __pyx_pf_8_geoslib_7Polygon__ + * M = m + 1 + * else: + */ +- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple_); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple__2); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple__2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + if (!__pyx_t_6) { + } else { + __pyx_t_1 = __pyx_t_6; + goto __pyx_L5_bool_binop_done; + } +- __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple__3); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple__3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); +- __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple__4); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_b), __pyx_tuple__4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_1 = __pyx_t_6; + __pyx_L5_bool_binop_done:; +@@ -3726,7 +4037,7 @@ static int __pyx_pf_8_geoslib_7Polygon__ + * GEOSCoordSeq_setY(cs, i, dy) + * + */ +- GEOSCoordSeq_setX(__pyx_v_cs, __pyx_v_i, __pyx_v_dx); ++ (void)(GEOSCoordSeq_setX(__pyx_v_cs, __pyx_v_i, __pyx_v_dx)); + + /* "_geoslib.pyx":363 + * # always set X before Y +@@ -3735,7 +4046,7 @@ static int __pyx_pf_8_geoslib_7Polygon__ + * + * # Add closing coordinates to sequence? + */ +- GEOSCoordSeq_setY(__pyx_v_cs, __pyx_v_i, __pyx_v_dy); ++ (void)(GEOSCoordSeq_setY(__pyx_v_cs, __pyx_v_i, __pyx_v_dy)); + } + + /* "_geoslib.pyx":366 +@@ -3773,7 +4084,7 @@ static int __pyx_pf_8_geoslib_7Polygon__ + * GEOSCoordSeq_setY(cs, M-1, dy) + * + */ +- GEOSCoordSeq_setX(__pyx_v_cs, (__pyx_v_M - 1), __pyx_v_dx); ++ (void)(GEOSCoordSeq_setX(__pyx_v_cs, (__pyx_v_M - 1), __pyx_v_dx)); + + /* "_geoslib.pyx":370 + * dy = bbuffer[1] +@@ -3782,7 +4093,7 @@ static int __pyx_pf_8_geoslib_7Polygon__ + * + * # create LinearRing + */ +- GEOSCoordSeq_setY(__pyx_v_cs, (__pyx_v_M - 1), __pyx_v_dy); ++ (void)(GEOSCoordSeq_setY(__pyx_v_cs, (__pyx_v_M - 1), __pyx_v_dy)); + + /* "_geoslib.pyx":366 + * +@@ -3873,9 +4184,6 @@ static PyObject *__pyx_pf_8_geoslib_7Pol + PyObject *__pyx_r = NULL; + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("area", 0); + + /* "_geoslib.pyx":382 +@@ -3885,7 +4193,7 @@ static PyObject *__pyx_pf_8_geoslib_7Pol + * return area + * + */ +- GEOSArea(__pyx_v_self->__pyx_base._geom, (&__pyx_v_area)); ++ (void)(GEOSArea(__pyx_v_self->__pyx_base._geom, (&__pyx_v_area))); + + /* "_geoslib.pyx":383 + * cdef double area +@@ -3895,7 +4203,7 @@ static PyObject *__pyx_pf_8_geoslib_7Pol + * cdef class LineString(BaseGeometry): + */ + __Pyx_XDECREF(__pyx_r); +- __pyx_t_1 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_area); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 383, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __pyx_r = __pyx_t_1; + __pyx_t_1 = 0; +@@ -3932,9 +4240,6 @@ static PyObject *__pyx_pf_8_geoslib_7Pol + static int __pyx_pw_8_geoslib_10LineString_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ + static int __pyx_pw_8_geoslib_10LineString_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyArrayObject *__pyx_v_b = 0; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); +@@ -3946,17 +4251,18 @@ static int __pyx_pw_8_geoslib_10LineStri + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); ++ CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: +- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; ++ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { +- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} ++ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 386, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; +@@ -3967,13 +4273,13 @@ static int __pyx_pw_8_geoslib_10LineStri + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; +- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L3_error;} ++ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 386, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("_geoslib.LineString.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); + return -1; + __pyx_L4_argument_unpacking_done:; +- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8_geoslib_ndarray, 1, "b", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_b), __pyx_ptype_8_geoslib_ndarray, 1, "b", 0))) __PYX_ERR(0, 386, __pyx_L1_error) + __pyx_r = __pyx_pf_8_geoslib_10LineString___init__(((struct __pyx_obj_8_geoslib_LineString *)__pyx_v_self), __pyx_v_b); + + /* function exit code */ +@@ -3999,9 +4305,6 @@ static int __pyx_pf_8_geoslib_10LineStri + PyObject *__pyx_t_3 = NULL; + PyObject *__pyx_t_4 = NULL; + int __pyx_t_5; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + __Pyx_INCREF((PyObject *)__pyx_v_b); + +@@ -4022,10 +4325,10 @@ static int __pyx_pf_8_geoslib_10LineStri + * + * M = b.shape[0] + */ +- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __pyx_t_4 = NULL; +- if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) { ++ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { + __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_4)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); +@@ -4035,14 +4338,14 @@ static int __pyx_pf_8_geoslib_10LineStri + } + } + if (__pyx_t_4) { +- __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; + } else { +- __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) + } + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_geoslib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_geoslib_ndarray))))) __PYX_ERR(0, 395, __pyx_L1_error) + __Pyx_DECREF_SET(__pyx_v_b, ((PyArrayObject *)__pyx_t_2)); + __pyx_t_2 = 0; + +@@ -4062,12 +4365,12 @@ static int __pyx_pf_8_geoslib_10LineStri + * self._npts = M + * + */ +- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_b), __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); +- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; +- __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_v_M = __pyx_t_5; + +@@ -4133,7 +4436,7 @@ static int __pyx_pf_8_geoslib_10LineStri + * GEOSCoordSeq_setY(cs, i, dy) + * + */ +- GEOSCoordSeq_setX(__pyx_v_cs, __pyx_v_i, __pyx_v_dx); ++ (void)(GEOSCoordSeq_setX(__pyx_v_cs, __pyx_v_i, __pyx_v_dx)); + + /* "_geoslib.pyx":411 + * # always set X before Y +@@ -4142,7 +4445,7 @@ static int __pyx_pf_8_geoslib_10LineStri + * + * # create LineString + */ +- GEOSCoordSeq_setY(__pyx_v_cs, __pyx_v_i, __pyx_v_dy); ++ (void)(GEOSCoordSeq_setY(__pyx_v_cs, __pyx_v_i, __pyx_v_dy)); + } + + /* "_geoslib.pyx":414 +@@ -4202,9 +4505,6 @@ static int __pyx_pf_8_geoslib_10LineStri + static int __pyx_pw_8_geoslib_5Point_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ + static int __pyx_pw_8_geoslib_5Point_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { + PyObject *__pyx_v_b = 0; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + int __pyx_r; + __Pyx_RefNannyDeclarations + __Pyx_RefNannySetupContext("__init__ (wrapper)", 0); +@@ -4216,17 +4516,18 @@ static int __pyx_pw_8_geoslib_5Point_1__ + const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); + switch (pos_args) { + case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); ++ CYTHON_FALLTHROUGH; + case 0: break; + default: goto __pyx_L5_argtuple_error; + } + kw_args = PyDict_Size(__pyx_kwds); + switch (pos_args) { + case 0: +- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; ++ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--; + else goto __pyx_L5_argtuple_error; + } + if (unlikely(kw_args > 0)) { +- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;} ++ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 419, __pyx_L3_error) + } + } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { + goto __pyx_L5_argtuple_error; +@@ -4237,7 +4538,7 @@ static int __pyx_pw_8_geoslib_5Point_1__ + } + goto __pyx_L4_argument_unpacking_done; + __pyx_L5_argtuple_error:; +- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L3_error;} ++ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 419, __pyx_L3_error) + __pyx_L3_error:; + __Pyx_AddTraceback("_geoslib.Point.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_RefNannyFinishContext(); +@@ -4258,9 +4559,6 @@ static int __pyx_pf_8_geoslib_5Point___i + __Pyx_RefNannyDeclarations + PyObject *__pyx_t_1 = NULL; + double __pyx_t_2; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("__init__", 0); + + /* "_geoslib.pyx":423 +@@ -4279,14 +4577,14 @@ static int __pyx_pf_8_geoslib_5Point___i + * GEOSCoordSeq_setX(cs, 0, dx) + * GEOSCoordSeq_setY(cs, 0, dy) + */ +- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dx = __pyx_t_2; +- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_v_dy = __pyx_t_2; + +@@ -4297,7 +4595,7 @@ static int __pyx_pf_8_geoslib_5Point___i + * GEOSCoordSeq_setY(cs, 0, dy) + * self._geom = GEOSGeom_createPoint(cs) + */ +- GEOSCoordSeq_setX(__pyx_v_cs, 0, __pyx_v_dx); ++ (void)(GEOSCoordSeq_setX(__pyx_v_cs, 0, __pyx_v_dx)); + + /* "_geoslib.pyx":426 + * dx = b[0]; dy = b[1] +@@ -4306,7 +4604,7 @@ static int __pyx_pf_8_geoslib_5Point___i + * self._geom = GEOSGeom_createPoint(cs) + * self._npts = 1 + */ +- GEOSCoordSeq_setY(__pyx_v_cs, 0, __pyx_v_dy); ++ (void)(GEOSCoordSeq_setY(__pyx_v_cs, 0, __pyx_v_dy)); + + /* "_geoslib.pyx":427 + * GEOSCoordSeq_setX(cs, 0, dx) +@@ -4566,12 +4864,9 @@ static PyObject *__pyx_f_8_geoslib__get_ + PyObject *__pyx_t_4 = NULL; + PyObject *__pyx_t_5 = NULL; + PyObject *__pyx_t_6 = NULL; +- Py_ssize_t __pyx_t_7; ++ int __pyx_t_7; + PyObject *__pyx_t_8 = NULL; + unsigned int __pyx_t_9; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannySetupContext("_get_coords", 0); + + /* "_geoslib.pyx":438 +@@ -4631,7 +4926,7 @@ static PyObject *__pyx_f_8_geoslib__get_ + * b = numpy.empty((M,2), numpy.float64) + * bbuffer = b.data + */ +- GEOSCoordSeq_getSize(__pyx_v_cs, (&__pyx_v_M)); ++ (void)(GEOSCoordSeq_getSize(__pyx_v_cs, (&__pyx_v_M))); + + /* "_geoslib.pyx":444 + * cs = GEOSGeom_getCoordSeq(geom) +@@ -4640,14 +4935,14 @@ static PyObject *__pyx_f_8_geoslib__get_ + * bbuffer = b.data + * for i from 0 <= i < M: + */ +- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_4); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; +- __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_M); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_M); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_GIVEREF(__pyx_t_3); + PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); +@@ -4655,14 +4950,14 @@ static PyObject *__pyx_f_8_geoslib__get_ + __Pyx_GIVEREF(__pyx_int_2); + PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_2); + __pyx_t_3 = 0; +- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_3); +- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 444, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; + __pyx_t_3 = NULL; + __pyx_t_7 = 0; +- if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { ++ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) { + __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4); + if (likely(__pyx_t_3)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); +@@ -4672,22 +4967,44 @@ static PyObject *__pyx_f_8_geoslib__get_ + __pyx_t_7 = 1; + } + } +- __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_8); +- if (__pyx_t_3) { +- __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; +- } +- __Pyx_GIVEREF(__pyx_t_5); +- PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); +- __Pyx_GIVEREF(__pyx_t_6); +- PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_6); +- __pyx_t_5 = 0; +- __pyx_t_6 = 0; +- __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __Pyx_GOTREF(__pyx_t_2); +- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ++ #if CYTHON_FAST_PYCALL ++ if (PyFunction_Check(__pyx_t_4)) { ++ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_5, __pyx_t_6}; ++ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) ++ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; ++ __Pyx_GOTREF(__pyx_t_2); ++ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; ++ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; ++ } else ++ #endif ++ #if CYTHON_FAST_PYCCALL ++ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) { ++ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_5, __pyx_t_6}; ++ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) ++ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; ++ __Pyx_GOTREF(__pyx_t_2); ++ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; ++ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; ++ } else ++ #endif ++ { ++ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 444, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_8); ++ if (__pyx_t_3) { ++ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; ++ } ++ __Pyx_GIVEREF(__pyx_t_5); ++ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_5); ++ __Pyx_GIVEREF(__pyx_t_6); ++ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_6); ++ __pyx_t_5 = 0; ++ __pyx_t_6 = 0; ++ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) ++ __Pyx_GOTREF(__pyx_t_2); ++ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; ++ } + __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; +- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_geoslib_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_8_geoslib_ndarray))))) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_v_b = ((PyArrayObject *)__pyx_t_2); + __pyx_t_2 = 0; + +@@ -4717,7 +5034,7 @@ static PyObject *__pyx_f_8_geoslib__get_ + * GEOSCoordSeq_getY(cs, i, &dy) + * bbuffer[2*i] = dx + */ +- GEOSCoordSeq_getX(__pyx_v_cs, __pyx_v_i, (&__pyx_v_dx)); ++ (void)(GEOSCoordSeq_getX(__pyx_v_cs, __pyx_v_i, (&__pyx_v_dx))); + + /* "_geoslib.pyx":448 + * for i from 0 <= i < M: +@@ -4726,7 +5043,7 @@ static PyObject *__pyx_f_8_geoslib__get_ + * bbuffer[2*i] = dx + * bbuffer[2*i+1] = dy + */ +- GEOSCoordSeq_getY(__pyx_v_cs, __pyx_v_i, (&__pyx_v_dy)); ++ (void)(GEOSCoordSeq_getY(__pyx_v_cs, __pyx_v_i, (&__pyx_v_dy))); + + /* "_geoslib.pyx":449 + * GEOSCoordSeq_getX(cs, i, &dx) +@@ -4797,8 +5114,8 @@ static PyObject *__pyx_tp_new_8_geoslib_ + + static void __pyx_tp_dealloc_8_geoslib_BaseGeometry(PyObject *o) { + struct __pyx_obj_8_geoslib_BaseGeometry *p = (struct __pyx_obj_8_geoslib_BaseGeometry *)o; +- #if PY_VERSION_HEX >= 0x030400a1 +- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { ++ #if CYTHON_USE_TP_FINALIZE ++ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif +@@ -4861,7 +5178,7 @@ static PyMethodDef __pyx_methods_8_geosl + }; + + static struct PyGetSetDef __pyx_getsets_8_geoslib_BaseGeometry[] = { +- {(char *)"boundary", __pyx_getprop_8_geoslib_12BaseGeometry_boundary, __pyx_setprop_8_geoslib_12BaseGeometry_boundary, 0, 0}, ++ {(char *)"boundary", __pyx_getprop_8_geoslib_12BaseGeometry_boundary, __pyx_setprop_8_geoslib_12BaseGeometry_boundary, (char *)0, 0}, + {0, 0, 0, 0, 0} + }; + +@@ -5072,8 +5389,8 @@ static PyObject *__pyx_tp_new_8_geoslib_ + + static void __pyx_tp_dealloc_8_geoslib_Point(PyObject *o) { + struct __pyx_obj_8_geoslib_Point *p = (struct __pyx_obj_8_geoslib_Point *)o; +- #if PY_VERSION_HEX >= 0x030400a1 +- if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { ++ #if CYTHON_USE_TP_FINALIZE ++ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) { + if (PyObject_CallFinalizerFromDealloc(o)) return; + } + #endif +@@ -5141,8 +5458,8 @@ static PyMethodDef __pyx_methods_8_geosl + }; + + static struct PyGetSetDef __pyx_getsets_8_geoslib_Point[] = { +- {(char *)"x", __pyx_getprop_8_geoslib_5Point_x, __pyx_setprop_8_geoslib_5Point_x, 0, 0}, +- {(char *)"y", __pyx_getprop_8_geoslib_5Point_y, __pyx_setprop_8_geoslib_5Point_y, 0, 0}, ++ {(char *)"x", __pyx_getprop_8_geoslib_5Point_x, __pyx_setprop_8_geoslib_5Point_x, (char *)0, 0}, ++ {(char *)"y", __pyx_getprop_8_geoslib_5Point_y, __pyx_setprop_8_geoslib_5Point_y, (char *)0, 0}, + {0, 0, 0, 0, 0} + }; + +@@ -5209,17 +5526,31 @@ static PyMethodDef __pyx_methods[] = { + }; + + #if PY_MAJOR_VERSION >= 3 ++#if CYTHON_PEP489_MULTI_PHASE_INIT ++static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/ ++static int __pyx_pymod_exec__geoslib(PyObject* module); /*proto*/ ++static PyModuleDef_Slot __pyx_moduledef_slots[] = { ++ {Py_mod_create, (void*)__pyx_pymod_create}, ++ {Py_mod_exec, (void*)__pyx_pymod_exec__geoslib}, ++ {0, NULL} ++}; ++#endif ++ + static struct PyModuleDef __pyx_moduledef = { +- #if PY_VERSION_HEX < 0x03020000 +- { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, +- #else + PyModuleDef_HEAD_INIT, +- #endif + "_geoslib", + 0, /* m_doc */ ++ #if CYTHON_PEP489_MULTI_PHASE_INIT ++ 0, /* m_size */ ++ #else + -1, /* m_size */ ++ #endif + __pyx_methods /* m_methods */, ++ #if CYTHON_PEP489_MULTI_PHASE_INIT ++ __pyx_moduledef_slots, /* m_slots */ ++ #else + NULL, /* m_reload */ ++ #endif + NULL, /* m_traverse */ + NULL, /* m_clear */ + NULL /* m_free */ +@@ -5232,6 +5563,7 @@ static __Pyx_StringTabEntry __pyx_string + {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1}, + {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1}, + {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1}, ++ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1}, + {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1}, + {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1}, + {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1}, +@@ -5251,7 +5583,7 @@ static __Pyx_StringTabEntry __pyx_string + {0, 0, 0, 0, 0, 0, 0} + }; + static int __Pyx_InitCachedBuiltins(void) { +- __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 195, __pyx_L1_error) + return 0; + __pyx_L1_error:; + return -1; +@@ -5268,16 +5600,16 @@ static int __Pyx_InitCachedConstants(voi + * M = m + 1 + * else: + */ +- __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_tuple_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_tuple_ = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_0); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple_); + __Pyx_GIVEREF(__pyx_tuple_); +- __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__2); + __Pyx_GIVEREF(__pyx_tuple__2); +- __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_neg_1, __pyx_int_1); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__3); + __Pyx_GIVEREF(__pyx_tuple__3); +- __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 346, __pyx_L1_error) + __Pyx_GOTREF(__pyx_tuple__4); + __Pyx_GIVEREF(__pyx_tuple__4); + __Pyx_RefNannyFinishContext(); +@@ -5288,56 +5620,227 @@ static int __Pyx_InitCachedConstants(voi + } + + static int __Pyx_InitGlobals(void) { +- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; +- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); ++ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error) ++ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) ++ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error) ++ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error) ++ return 0; ++ __pyx_L1_error:; ++ return -1; ++} ++ ++static int __Pyx_modinit_global_init_code(void); /*proto*/ ++static int __Pyx_modinit_variable_export_code(void); /*proto*/ ++static int __Pyx_modinit_function_export_code(void); /*proto*/ ++static int __Pyx_modinit_type_init_code(void); /*proto*/ ++static int __Pyx_modinit_type_import_code(void); /*proto*/ ++static int __Pyx_modinit_variable_import_code(void); /*proto*/ ++static int __Pyx_modinit_function_import_code(void); /*proto*/ ++ ++static int __Pyx_modinit_global_init_code(void) { ++ __Pyx_RefNannyDeclarations ++ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0); ++ /*--- Global init code ---*/ ++ __Pyx_RefNannyFinishContext(); ++ return 0; ++} ++ ++static int __Pyx_modinit_variable_export_code(void) { ++ __Pyx_RefNannyDeclarations ++ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0); ++ /*--- Variable export code ---*/ ++ __Pyx_RefNannyFinishContext(); ++ return 0; ++} ++ ++static int __Pyx_modinit_function_export_code(void) { ++ __Pyx_RefNannyDeclarations ++ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0); ++ /*--- Function export code ---*/ ++ __Pyx_RefNannyFinishContext(); ++ return 0; ++} ++ ++static int __Pyx_modinit_type_init_code(void) { ++ __Pyx_RefNannyDeclarations ++ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); ++ /*--- Type init code ---*/ ++ __pyx_ptype_8_geoslib_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_8_geoslib_ndarray)) __PYX_ERR(0, 13, __pyx_L1_error) ++ if (PyType_Ready(&__pyx_type_8_geoslib_BaseGeometry) < 0) __PYX_ERR(0, 138, __pyx_L1_error) ++ __pyx_type_8_geoslib_BaseGeometry.tp_print = 0; ++ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8_geoslib_BaseGeometry.tp_dictoffset && __pyx_type_8_geoslib_BaseGeometry.tp_getattro == PyObject_GenericGetAttr)) { ++ __pyx_type_8_geoslib_BaseGeometry.tp_getattro = __Pyx_PyObject_GenericGetAttr; ++ } ++ if (PyObject_SetAttrString(__pyx_m, "BaseGeometry", (PyObject *)&__pyx_type_8_geoslib_BaseGeometry) < 0) __PYX_ERR(0, 138, __pyx_L1_error) ++ __pyx_ptype_8_geoslib_BaseGeometry = &__pyx_type_8_geoslib_BaseGeometry; ++ __pyx_type_8_geoslib_Polygon.tp_base = __pyx_ptype_8_geoslib_BaseGeometry; ++ if (PyType_Ready(&__pyx_type_8_geoslib_Polygon) < 0) __PYX_ERR(0, 329, __pyx_L1_error) ++ __pyx_type_8_geoslib_Polygon.tp_print = 0; ++ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8_geoslib_Polygon.tp_dictoffset && __pyx_type_8_geoslib_Polygon.tp_getattro == PyObject_GenericGetAttr)) { ++ __pyx_type_8_geoslib_Polygon.tp_getattro = __Pyx_PyObject_GenericGetAttr; ++ } ++ if (PyObject_SetAttrString(__pyx_m, "Polygon", (PyObject *)&__pyx_type_8_geoslib_Polygon) < 0) __PYX_ERR(0, 329, __pyx_L1_error) ++ __pyx_ptype_8_geoslib_Polygon = &__pyx_type_8_geoslib_Polygon; ++ __pyx_type_8_geoslib_LineString.tp_base = __pyx_ptype_8_geoslib_BaseGeometry; ++ if (PyType_Ready(&__pyx_type_8_geoslib_LineString) < 0) __PYX_ERR(0, 385, __pyx_L1_error) ++ __pyx_type_8_geoslib_LineString.tp_print = 0; ++ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8_geoslib_LineString.tp_dictoffset && __pyx_type_8_geoslib_LineString.tp_getattro == PyObject_GenericGetAttr)) { ++ __pyx_type_8_geoslib_LineString.tp_getattro = __Pyx_PyObject_GenericGetAttr; ++ } ++ if (PyObject_SetAttrString(__pyx_m, "LineString", (PyObject *)&__pyx_type_8_geoslib_LineString) < 0) __PYX_ERR(0, 385, __pyx_L1_error) ++ __pyx_ptype_8_geoslib_LineString = &__pyx_type_8_geoslib_LineString; ++ __pyx_type_8_geoslib_Point.tp_base = __pyx_ptype_8_geoslib_BaseGeometry; ++ if (PyType_Ready(&__pyx_type_8_geoslib_Point) < 0) __PYX_ERR(0, 417, __pyx_L1_error) ++ __pyx_type_8_geoslib_Point.tp_print = 0; ++ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8_geoslib_Point.tp_dictoffset && __pyx_type_8_geoslib_Point.tp_getattro == PyObject_GenericGetAttr)) { ++ __pyx_type_8_geoslib_Point.tp_getattro = __Pyx_PyObject_GenericGetAttr; ++ } ++ if (PyObject_SetAttrString(__pyx_m, "Point", (PyObject *)&__pyx_type_8_geoslib_Point) < 0) __PYX_ERR(0, 417, __pyx_L1_error) ++ __pyx_ptype_8_geoslib_Point = &__pyx_type_8_geoslib_Point; ++ __Pyx_RefNannyFinishContext(); + return 0; + __pyx_L1_error:; ++ __Pyx_RefNannyFinishContext(); + return -1; + } + ++static int __Pyx_modinit_type_import_code(void) { ++ __Pyx_RefNannyDeclarations ++ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0); ++ /*--- Type import code ---*/ ++ __Pyx_RefNannyFinishContext(); ++ return 0; ++} ++ ++static int __Pyx_modinit_variable_import_code(void) { ++ __Pyx_RefNannyDeclarations ++ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0); ++ /*--- Variable import code ---*/ ++ __Pyx_RefNannyFinishContext(); ++ return 0; ++} ++ ++static int __Pyx_modinit_function_import_code(void) { ++ __Pyx_RefNannyDeclarations ++ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0); ++ /*--- Function import code ---*/ ++ __Pyx_RefNannyFinishContext(); ++ return 0; ++} ++ ++ + #if PY_MAJOR_VERSION < 3 +-PyMODINIT_FUNC init_geoslib(void); /*proto*/ +-PyMODINIT_FUNC init_geoslib(void) ++#ifdef CYTHON_NO_PYINIT_EXPORT ++#define __Pyx_PyMODINIT_FUNC void ++#else ++#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC ++#endif ++#else ++#ifdef CYTHON_NO_PYINIT_EXPORT ++#define __Pyx_PyMODINIT_FUNC PyObject * + #else +-PyMODINIT_FUNC PyInit__geoslib(void); /*proto*/ +-PyMODINIT_FUNC PyInit__geoslib(void) ++#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC ++#endif ++#endif ++#ifndef CYTHON_SMALL_CODE ++#if defined(__clang__) ++ #define CYTHON_SMALL_CODE ++#elif defined(__GNUC__) ++ #define CYTHON_SMALL_CODE __attribute__((optimize("Os"))) ++#else ++ #define CYTHON_SMALL_CODE ++#endif ++#endif ++ ++ ++#if PY_MAJOR_VERSION < 3 ++__Pyx_PyMODINIT_FUNC init_geoslib(void) CYTHON_SMALL_CODE; /*proto*/ ++__Pyx_PyMODINIT_FUNC init_geoslib(void) ++#else ++__Pyx_PyMODINIT_FUNC PyInit__geoslib(void) CYTHON_SMALL_CODE; /*proto*/ ++__Pyx_PyMODINIT_FUNC PyInit__geoslib(void) ++#if CYTHON_PEP489_MULTI_PHASE_INIT ++{ ++ return PyModuleDef_Init(&__pyx_moduledef); ++} ++static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) { ++ PyObject *value = PyObject_GetAttrString(spec, from_name); ++ int result = 0; ++ if (likely(value)) { ++ result = PyDict_SetItemString(moddict, to_name, value); ++ Py_DECREF(value); ++ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) { ++ PyErr_Clear(); ++ } else { ++ result = -1; ++ } ++ return result; ++} ++static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) { ++ PyObject *module = NULL, *moddict, *modname; ++ if (__pyx_m) ++ return __Pyx_NewRef(__pyx_m); ++ modname = PyObject_GetAttrString(spec, "name"); ++ if (unlikely(!modname)) goto bad; ++ module = PyModule_NewObject(modname); ++ Py_DECREF(modname); ++ if (unlikely(!module)) goto bad; ++ moddict = PyModule_GetDict(module); ++ if (unlikely(!moddict)) goto bad; ++ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad; ++ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad; ++ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad; ++ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad; ++ return module; ++bad: ++ Py_XDECREF(module); ++ return NULL; ++} ++ ++ ++static int __pyx_pymod_exec__geoslib(PyObject *__pyx_pyinit_module) ++#endif + #endif + { + PyObject *__pyx_t_1 = NULL; +- int __pyx_lineno = 0; +- const char *__pyx_filename = NULL; +- int __pyx_clineno = 0; + __Pyx_RefNannyDeclarations +- #if CYTHON_REFNANNY +- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); +- if (!__Pyx_RefNanny) { +- PyErr_Clear(); +- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); +- if (!__Pyx_RefNanny) +- Py_FatalError("failed to import 'refnanny' module"); +- } ++ #if CYTHON_PEP489_MULTI_PHASE_INIT ++ if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0; ++ #elif PY_MAJOR_VERSION >= 3 ++ if (__pyx_m) return __Pyx_NewRef(__pyx_m); + #endif +- __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__geoslib(void)", 0); +- if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ #if CYTHON_REFNANNY ++__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); ++if (!__Pyx_RefNanny) { ++ PyErr_Clear(); ++ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); ++ if (!__Pyx_RefNanny) ++ Py_FatalError("failed to import 'refnanny' module"); ++} ++#endif ++ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__geoslib(void)", 0); ++ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) ++ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) ++ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) ++ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) + #ifdef __Pyx_CyFunction_USED +- if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_FusedFunction_USED +- if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Coroutine_USED +- if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_Generator_USED +- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) ++ #endif ++ #ifdef __Pyx_AsyncGen_USED ++ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + #ifdef __Pyx_StopAsyncIteration_USED +- if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + /*--- Library function declarations ---*/ + /*--- Threads initialization code ---*/ +@@ -5347,69 +5850,56 @@ PyMODINIT_FUNC PyInit__geoslib(void) + #endif + #endif + /*--- Module creation code ---*/ ++ #if CYTHON_PEP489_MULTI_PHASE_INIT ++ __pyx_m = __pyx_pyinit_module; ++ Py_INCREF(__pyx_m); ++ #else + #if PY_MAJOR_VERSION < 3 + __pyx_m = Py_InitModule4("_geoslib", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); + #else + __pyx_m = PyModule_Create(&__pyx_moduledef); + #endif +- if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) ++ #endif ++ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) + Py_INCREF(__pyx_d); +- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) ++ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error) + #if CYTHON_COMPILING_IN_PYPY + Py_INCREF(__pyx_b); + #endif +- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; ++ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); + /*--- Initialize various global constants etc. ---*/ +- if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) +- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + if (__pyx_module_is_main__geoslib) { +- if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + } + #if PY_MAJOR_VERSION >= 3 + { +- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "_geoslib")) { +- if (unlikely(PyDict_SetItemString(modules, "_geoslib", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (unlikely(PyDict_SetItemString(modules, "_geoslib", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) + } + } + #endif + /*--- Builtin init code ---*/ +- if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + /*--- Constants init code ---*/ +- if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- /*--- Global init code ---*/ +- /*--- Variable export code ---*/ +- /*--- Function export code ---*/ +- /*--- Type init code ---*/ +- __pyx_ptype_8_geoslib_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_8_geoslib_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- if (PyType_Ready(&__pyx_type_8_geoslib_BaseGeometry) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_type_8_geoslib_BaseGeometry.tp_print = 0; +- if (PyObject_SetAttrString(__pyx_m, "BaseGeometry", (PyObject *)&__pyx_type_8_geoslib_BaseGeometry) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_ptype_8_geoslib_BaseGeometry = &__pyx_type_8_geoslib_BaseGeometry; +- __pyx_type_8_geoslib_Polygon.tp_base = __pyx_ptype_8_geoslib_BaseGeometry; +- if (PyType_Ready(&__pyx_type_8_geoslib_Polygon) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_type_8_geoslib_Polygon.tp_print = 0; +- if (PyObject_SetAttrString(__pyx_m, "Polygon", (PyObject *)&__pyx_type_8_geoslib_Polygon) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_ptype_8_geoslib_Polygon = &__pyx_type_8_geoslib_Polygon; +- __pyx_type_8_geoslib_LineString.tp_base = __pyx_ptype_8_geoslib_BaseGeometry; +- if (PyType_Ready(&__pyx_type_8_geoslib_LineString) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_type_8_geoslib_LineString.tp_print = 0; +- if (PyObject_SetAttrString(__pyx_m, "LineString", (PyObject *)&__pyx_type_8_geoslib_LineString) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_ptype_8_geoslib_LineString = &__pyx_type_8_geoslib_LineString; +- __pyx_type_8_geoslib_Point.tp_base = __pyx_ptype_8_geoslib_BaseGeometry; +- if (PyType_Ready(&__pyx_type_8_geoslib_Point) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_type_8_geoslib_Point.tp_print = 0; +- if (PyObject_SetAttrString(__pyx_m, "Point", (PyObject *)&__pyx_type_8_geoslib_Point) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;} +- __pyx_ptype_8_geoslib_Point = &__pyx_type_8_geoslib_Point; +- /*--- Type import code ---*/ +- /*--- Variable import code ---*/ +- /*--- Function import code ---*/ ++ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) ++ /*--- Global type/function init code ---*/ ++ (void)__Pyx_modinit_global_init_code(); ++ (void)__Pyx_modinit_variable_export_code(); ++ (void)__Pyx_modinit_function_export_code(); ++ if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error; ++ (void)__Pyx_modinit_type_import_code(); ++ (void)__Pyx_modinit_variable_import_code(); ++ (void)__Pyx_modinit_function_import_code(); + /*--- Execution code ---*/ + #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) +- if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) + #endif + + /* "_geoslib.pyx":1 +@@ -5417,9 +5907,9 @@ PyMODINIT_FUNC PyInit__geoslib(void) + * import numpy + * + */ +- __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_geoslib.pyx":2 +@@ -5428,9 +5918,9 @@ PyMODINIT_FUNC PyInit__geoslib(void) + * + * __version__ = "0.3" + */ +- __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 2, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_geoslib.pyx":4 +@@ -5440,7 +5930,7 @@ PyMODINIT_FUNC PyInit__geoslib(void) + * + * # need some python C API functions for strings. + */ +- if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (PyDict_SetItem(__pyx_d, __pyx_n_s_version, __pyx_kp_s_0_3) < 0) __PYX_ERR(0, 4, __pyx_L1_error) + + /* "_geoslib.pyx":26 + * +@@ -5458,9 +5948,9 @@ PyMODINIT_FUNC PyInit__geoslib(void) + * __geos_major_version__ = GEOS_VERSION_MAJOR + * #if __geos_version__ != "2.2.3-CAPI-1.1.1": + */ +- __pyx_t_1 = __pyx_f_8_geoslib_geos_version(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __pyx_f_8_geoslib_geos_version(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- if (PyDict_SetItem(__pyx_d, __pyx_n_s_geos_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (PyDict_SetItem(__pyx_d, __pyx_n_s_geos_version, __pyx_t_1) < 0) __PYX_ERR(0, 130, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_geoslib.pyx":131 +@@ -5470,9 +5960,9 @@ PyMODINIT_FUNC PyInit__geoslib(void) + * #if __geos_version__ != "2.2.3-CAPI-1.1.1": + * # raise ValueError('version 2.2.3 of the geos library is required') + */ +- __pyx_t_1 = __Pyx_PyInt_From_int(GEOS_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __Pyx_PyInt_From_int(GEOS_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- if (PyDict_SetItem(__pyx_d, __pyx_n_s_geos_major_version, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (PyDict_SetItem(__pyx_d, __pyx_n_s_geos_major_version, __pyx_t_1) < 0) __PYX_ERR(0, 131, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /* "_geoslib.pyx":136 +@@ -5489,9 +5979,9 @@ PyMODINIT_FUNC PyInit__geoslib(void) + * import numpy + * + */ +- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); +- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} ++ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + + /*--- Wrapped vars code ---*/ +@@ -5501,7 +5991,7 @@ PyMODINIT_FUNC PyInit__geoslib(void) + __Pyx_XDECREF(__pyx_t_1); + if (__pyx_m) { + if (__pyx_d) { +- __Pyx_AddTraceback("init _geoslib", __pyx_clineno, __pyx_lineno, __pyx_filename); ++ __Pyx_AddTraceback("init _geoslib", 0, __pyx_lineno, __pyx_filename); + } + Py_DECREF(__pyx_m); __pyx_m = 0; + } else if (!PyErr_Occurred()) { +@@ -5509,14 +5999,17 @@ PyMODINIT_FUNC PyInit__geoslib(void) + } + __pyx_L0:; + __Pyx_RefNannyFinishContext(); +- #if PY_MAJOR_VERSION < 3 +- return; +- #else ++ #if CYTHON_PEP489_MULTI_PHASE_INIT ++ return (__pyx_m != NULL) ? 0 : -1; ++ #elif PY_MAJOR_VERSION >= 3 + return __pyx_m; ++ #else ++ return; + #endif + } + + /* --- Runtime support code --- */ ++/* Refnanny */ + #if CYTHON_REFNANNY + static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { + PyObject *m = NULL, *p = NULL; +@@ -5533,6 +6026,21 @@ end: + } + #endif + ++/* PyObjectGetAttrStr */ ++#if CYTHON_USE_TYPE_SLOTS ++static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { ++ PyTypeObject* tp = Py_TYPE(obj); ++ if (likely(tp->tp_getattro)) ++ return tp->tp_getattro(obj, attr_name); ++#if PY_MAJOR_VERSION < 3 ++ if (likely(tp->tp_getattr)) ++ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); ++#endif ++ return PyObject_GetAttr(obj, attr_name); ++} ++#endif ++ ++/* GetBuiltinName */ + static PyObject *__Pyx_GetBuiltinName(PyObject *name) { + PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); + if (unlikely(!result)) { +@@ -5546,42 +6054,54 @@ static PyObject *__Pyx_GetBuiltinName(Py + return result; + } + +-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) { +-#if CYTHON_COMPILING_IN_CPYTHON +- PyThreadState *tstate = PyThreadState_GET(); ++/* SaveResetException */ ++#if CYTHON_FAST_THREAD_STATE ++static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { ++ #if PY_VERSION_HEX >= 0x030700A2 ++ *type = tstate->exc_state.exc_type; ++ *value = tstate->exc_state.exc_value; ++ *tb = tstate->exc_state.exc_traceback; ++ #else + *type = tstate->exc_type; + *value = tstate->exc_value; + *tb = tstate->exc_traceback; ++ #endif + Py_XINCREF(*type); + Py_XINCREF(*value); + Py_XINCREF(*tb); +-#else +- PyErr_GetExcInfo(type, value, tb); +-#endif + } +-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) { +-#if CYTHON_COMPILING_IN_CPYTHON ++static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +- PyThreadState *tstate = PyThreadState_GET(); ++ #if PY_VERSION_HEX >= 0x030700A2 ++ tmp_type = tstate->exc_state.exc_type; ++ tmp_value = tstate->exc_state.exc_value; ++ tmp_tb = tstate->exc_state.exc_traceback; ++ tstate->exc_state.exc_type = type; ++ tstate->exc_state.exc_value = value; ++ tstate->exc_state.exc_traceback = tb; ++ #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = type; + tstate->exc_value = value; + tstate->exc_traceback = tb; ++ #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +-#else +- PyErr_SetExcInfo(type, value, tb); +-#endif + } ++#endif + ++/* GetException */ ++#if CYTHON_FAST_THREAD_STATE ++static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { ++#else + static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) { ++#endif + PyObject *local_type, *local_value, *local_tb; +-#if CYTHON_COMPILING_IN_CPYTHON ++#if CYTHON_FAST_THREAD_STATE + PyObject *tmp_type, *tmp_value, *tmp_tb; +- PyThreadState *tstate = PyThreadState_GET(); + local_type = tstate->curexc_type; + local_value = tstate->curexc_value; + local_tb = tstate->curexc_traceback; +@@ -5592,7 +6112,7 @@ static int __Pyx_GetException(PyObject * + PyErr_Fetch(&local_type, &local_value, &local_tb); + #endif + PyErr_NormalizeException(&local_type, &local_value, &local_tb); +-#if CYTHON_COMPILING_IN_CPYTHON ++#if CYTHON_FAST_THREAD_STATE + if (unlikely(tstate->curexc_type)) + #else + if (unlikely(PyErr_Occurred())) +@@ -5610,13 +6130,22 @@ static int __Pyx_GetException(PyObject * + *type = local_type; + *value = local_value; + *tb = local_tb; +-#if CYTHON_COMPILING_IN_CPYTHON ++#if CYTHON_FAST_THREAD_STATE ++ #if PY_VERSION_HEX >= 0x030700A2 ++ tmp_type = tstate->exc_state.exc_type; ++ tmp_value = tstate->exc_state.exc_value; ++ tmp_tb = tstate->exc_state.exc_traceback; ++ tstate->exc_state.exc_type = local_type; ++ tstate->exc_state.exc_value = local_value; ++ tstate->exc_state.exc_traceback = local_tb; ++ #else + tmp_type = tstate->exc_type; + tmp_value = tstate->exc_value; + tmp_tb = tstate->exc_traceback; + tstate->exc_type = local_type; + tstate->exc_value = local_value; + tstate->exc_traceback = local_tb; ++ #endif + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +@@ -5634,13 +6163,23 @@ bad: + return -1; + } + +-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { ++/* GetModuleGlobalName */ ++ static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { + PyObject *result; +-#if CYTHON_COMPILING_IN_CPYTHON ++#if !CYTHON_AVOID_BORROWED_REFS ++#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 ++ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash); ++ if (likely(result)) { ++ Py_INCREF(result); ++ } else if (unlikely(PyErr_Occurred())) { ++ result = NULL; ++ } else { ++#else + result = PyDict_GetItem(__pyx_d, name); + if (likely(result)) { + Py_INCREF(result); + } else { ++#endif + #else + result = PyObject_GetItem(__pyx_d, name); + if (!result) { +@@ -5651,7 +6190,151 @@ static CYTHON_INLINE PyObject *__Pyx_Get + return result; + } + +-#if CYTHON_COMPILING_IN_CPYTHON ++/* PyCFunctionFastCall */ ++ #if CYTHON_FAST_PYCCALL ++static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) { ++ PyCFunctionObject *func = (PyCFunctionObject*)func_obj; ++ PyCFunction meth = PyCFunction_GET_FUNCTION(func); ++ PyObject *self = PyCFunction_GET_SELF(func); ++ int flags = PyCFunction_GET_FLAGS(func); ++ assert(PyCFunction_Check(func)); ++ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS))); ++ assert(nargs >= 0); ++ assert(nargs == 0 || args != NULL); ++ /* _PyCFunction_FastCallDict() must not be called with an exception set, ++ because it may clear it (directly or indirectly) and so the ++ caller loses its exception */ ++ assert(!PyErr_Occurred()); ++ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) { ++ return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL); ++ } else { ++ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs); ++ } ++} ++#endif ++ ++/* PyFunctionFastCall */ ++ #if CYTHON_FAST_PYCALL ++#include "frameobject.h" ++static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na, ++ PyObject *globals) { ++ PyFrameObject *f; ++ PyThreadState *tstate = __Pyx_PyThreadState_Current; ++ PyObject **fastlocals; ++ Py_ssize_t i; ++ PyObject *result; ++ assert(globals != NULL); ++ /* XXX Perhaps we should create a specialized ++ PyFrame_New() that doesn't take locals, but does ++ take builtins without sanity checking them. ++ */ ++ assert(tstate != NULL); ++ f = PyFrame_New(tstate, co, globals, NULL); ++ if (f == NULL) { ++ return NULL; ++ } ++ fastlocals = f->f_localsplus; ++ for (i = 0; i < na; i++) { ++ Py_INCREF(*args); ++ fastlocals[i] = *args++; ++ } ++ result = PyEval_EvalFrameEx(f,0); ++ ++tstate->recursion_depth; ++ Py_DECREF(f); ++ --tstate->recursion_depth; ++ return result; ++} ++#if 1 || PY_VERSION_HEX < 0x030600B1 ++static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) { ++ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func); ++ PyObject *globals = PyFunction_GET_GLOBALS(func); ++ PyObject *argdefs = PyFunction_GET_DEFAULTS(func); ++ PyObject *closure; ++#if PY_MAJOR_VERSION >= 3 ++ PyObject *kwdefs; ++#endif ++ PyObject *kwtuple, **k; ++ PyObject **d; ++ Py_ssize_t nd; ++ Py_ssize_t nk; ++ PyObject *result; ++ assert(kwargs == NULL || PyDict_Check(kwargs)); ++ nk = kwargs ? PyDict_Size(kwargs) : 0; ++ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) { ++ return NULL; ++ } ++ if ( ++#if PY_MAJOR_VERSION >= 3 ++ co->co_kwonlyargcount == 0 && ++#endif ++ likely(kwargs == NULL || nk == 0) && ++ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) { ++ if (argdefs == NULL && co->co_argcount == nargs) { ++ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals); ++ goto done; ++ } ++ else if (nargs == 0 && argdefs != NULL ++ && co->co_argcount == Py_SIZE(argdefs)) { ++ /* function called with no arguments, but all parameters have ++ a default value: use default values as arguments .*/ ++ args = &PyTuple_GET_ITEM(argdefs, 0); ++ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals); ++ goto done; ++ } ++ } ++ if (kwargs != NULL) { ++ Py_ssize_t pos, i; ++ kwtuple = PyTuple_New(2 * nk); ++ if (kwtuple == NULL) { ++ result = NULL; ++ goto done; ++ } ++ k = &PyTuple_GET_ITEM(kwtuple, 0); ++ pos = i = 0; ++ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) { ++ Py_INCREF(k[i]); ++ Py_INCREF(k[i+1]); ++ i += 2; ++ } ++ nk = i / 2; ++ } ++ else { ++ kwtuple = NULL; ++ k = NULL; ++ } ++ closure = PyFunction_GET_CLOSURE(func); ++#if PY_MAJOR_VERSION >= 3 ++ kwdefs = PyFunction_GET_KW_DEFAULTS(func); ++#endif ++ if (argdefs != NULL) { ++ d = &PyTuple_GET_ITEM(argdefs, 0); ++ nd = Py_SIZE(argdefs); ++ } ++ else { ++ d = NULL; ++ nd = 0; ++ } ++#if PY_MAJOR_VERSION >= 3 ++ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL, ++ args, nargs, ++ k, (int)nk, ++ d, (int)nd, kwdefs, closure); ++#else ++ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL, ++ args, nargs, ++ k, (int)nk, ++ d, (int)nd, closure); ++#endif ++ Py_XDECREF(kwtuple); ++done: ++ Py_LeaveRecursiveCall(); ++ return result; ++} ++#endif ++#endif ++ ++/* PyObjectCall */ ++ #if CYTHON_COMPILING_IN_CPYTHON + static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { + PyObject *result; + ternaryfunc call = func->ob_type->tp_call; +@@ -5670,7 +6353,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyO + } + #endif + +-#if CYTHON_COMPILING_IN_CPYTHON ++/* PyObjectCallMethO */ ++ #if CYTHON_COMPILING_IN_CPYTHON + static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { + PyObject *self, *result; + PyCFunction cfunc; +@@ -5689,7 +6373,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyO + } + #endif + +-#if CYTHON_COMPILING_IN_CPYTHON ++/* PyObjectCallOneArg */ ++ #if CYTHON_COMPILING_IN_CPYTHON + static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { + PyObject *result; + PyObject *args = PyTuple_New(1); +@@ -5701,13 +6386,18 @@ static PyObject* __Pyx__PyObject_CallOne + return result; + } + static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { +-#ifdef __Pyx_CyFunction_USED +- if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { +-#else +- if (likely(PyCFunction_Check(func))) { ++#if CYTHON_FAST_PYCALL ++ if (PyFunction_Check(func)) { ++ return __Pyx_PyFunction_FastCall(func, &arg, 1); ++ } + #endif ++ if (likely(PyCFunction_Check(func))) { + if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { + return __Pyx_PyObject_CallMethO(func, arg); ++#if CYTHON_FAST_PYCCALL ++ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) { ++ return __Pyx_PyCFunction_FastCall(func, &arg, 1); ++#endif + } + } + return __Pyx__PyObject_CallOneArg(func, arg); +@@ -5723,10 +6413,10 @@ static CYTHON_INLINE PyObject* __Pyx_PyO + } + #endif + +-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { +-#if CYTHON_COMPILING_IN_CPYTHON ++/* PyErrFetchRestore */ ++ #if CYTHON_FAST_THREAD_STATE ++static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { + PyObject *tmp_type, *tmp_value, *tmp_tb; +- PyThreadState *tstate = PyThreadState_GET(); + tmp_type = tstate->curexc_type; + tmp_value = tstate->curexc_value; + tmp_tb = tstate->curexc_traceback; +@@ -5736,34 +6426,33 @@ static CYTHON_INLINE void __Pyx_ErrResto + Py_XDECREF(tmp_type); + Py_XDECREF(tmp_value); + Py_XDECREF(tmp_tb); +-#else +- PyErr_Restore(type, value, tb); +-#endif + } +-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { +-#if CYTHON_COMPILING_IN_CPYTHON +- PyThreadState *tstate = PyThreadState_GET(); ++static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { + *type = tstate->curexc_type; + *value = tstate->curexc_value; + *tb = tstate->curexc_traceback; + tstate->curexc_type = 0; + tstate->curexc_value = 0; + tstate->curexc_traceback = 0; +-#else +- PyErr_Fetch(type, value, tb); +-#endif + } ++#endif + +-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, ++/* WriteUnraisableException */ ++ static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, + CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, + int full_traceback, CYTHON_UNUSED int nogil) { + PyObject *old_exc, *old_val, *old_tb; + PyObject *ctx; ++ __Pyx_PyThreadState_declare + #ifdef WITH_THREAD + PyGILState_STATE state; + if (nogil) + state = PyGILState_Ensure(); ++#ifdef _MSC_VER ++ else state = (PyGILState_STATE)-1; ++#endif + #endif ++ __Pyx_PyThreadState_assign + __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); + if (full_traceback) { + Py_XINCREF(old_exc); +@@ -5790,35 +6479,32 @@ static void __Pyx_WriteUnraisable(const + #endif + } + +-static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { +- PyErr_Format(PyExc_TypeError, +- "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", +- name, type->tp_name, Py_TYPE(obj)->tp_name); +-} +-static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, +- const char *name, int exact) ++/* ArgTypeTest */ ++ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact) + { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } +- if (none_allowed && obj == Py_None) return 1; + else if (exact) { +- if (likely(Py_TYPE(obj) == type)) return 1; + #if PY_MAJOR_VERSION == 2 +- else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; ++ if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; + #endif + } + else { +- if (likely(PyObject_TypeCheck(obj, type))) return 1; ++ if (likely(__Pyx_TypeCheck(obj, type))) return 1; + } +- __Pyx_RaiseArgumentTypeInvalid(name, obj, type); ++ PyErr_Format(PyExc_TypeError, ++ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", ++ name, type->tp_name, Py_TYPE(obj)->tp_name); + return 0; + } + +-#if PY_MAJOR_VERSION < 3 ++/* RaiseException */ ++ #if PY_MAJOR_VERSION < 3 + static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, + CYTHON_UNUSED PyObject *cause) { ++ __Pyx_PyThreadState_declare + Py_XINCREF(type); + if (!value || value == Py_None) + value = NULL; +@@ -5857,6 +6543,7 @@ static void __Pyx_Raise(PyObject *type, + goto raise_error; + } + } ++ __Pyx_PyThreadState_assign + __Pyx_ErrRestore(type, value, tb); + return; + raise_error: +@@ -5929,11 +6616,7 @@ static void __Pyx_Raise(PyObject *type, + "raise: exception class must be a subclass of BaseException"); + goto bad; + } +-#if PY_VERSION_HEX >= 0x03030000 + if (cause) { +-#else +- if (cause && cause != Py_None) { +-#endif + PyObject *fixed_cause; + if (cause == Py_None) { + fixed_cause = NULL; +@@ -5961,7 +6644,7 @@ static void __Pyx_Raise(PyObject *type, + PyErr_Restore(tmp_type, tmp_value, tb); + Py_XDECREF(tmp_tb); + #else +- PyThreadState *tstate = PyThreadState_GET(); ++ PyThreadState *tstate = __Pyx_PyThreadState_Current; + PyObject* tmp_tb = tstate->curexc_traceback; + if (tb != tmp_tb) { + Py_INCREF(tb); +@@ -5976,7 +6659,8 @@ bad: + } + #endif + +-static void __Pyx_RaiseDoubleKeywordsError( ++/* RaiseDoubleKeywords */ ++ static void __Pyx_RaiseDoubleKeywordsError( + const char* func_name, + PyObject* kw_name) + { +@@ -5989,7 +6673,8 @@ static void __Pyx_RaiseDoubleKeywordsErr + #endif + } + +-static int __Pyx_ParseOptionalKeywords( ++/* ParseKeywords */ ++ static int __Pyx_ParseOptionalKeywords( + PyObject *kwds, + PyObject **argnames[], + PyObject *kwds2, +@@ -6090,7 +6775,8 @@ bad: + return -1; + } + +-static void __Pyx_RaiseArgtupleInvalid( ++/* RaiseArgTupleInvalid */ ++ static void __Pyx_RaiseArgtupleInvalid( + const char* func_name, + int exact, + Py_ssize_t num_min, +@@ -6115,10 +6801,16 @@ static void __Pyx_RaiseArgtupleInvalid( + (num_expected == 1) ? "" : "s", num_found); + } + +-#if CYTHON_COMPILING_IN_CPYTHON ++/* PyObjectCallNoArg */ ++ #if CYTHON_COMPILING_IN_CPYTHON + static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { ++#if CYTHON_FAST_PYCALL ++ if (PyFunction_Check(func)) { ++ return __Pyx_PyFunction_FastCall(func, NULL, 0); ++ } ++#endif + #ifdef __Pyx_CyFunction_USED +- if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { ++ if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) { + #else + if (likely(PyCFunction_Check(func))) { + #endif +@@ -6130,19 +6822,21 @@ static CYTHON_INLINE PyObject* __Pyx_PyO + } + #endif + +-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { ++/* ExtTypeTest */ ++ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { + if (unlikely(!type)) { + PyErr_SetString(PyExc_SystemError, "Missing type object"); + return 0; + } +- if (likely(PyObject_TypeCheck(obj, type))) ++ if (likely(__Pyx_TypeCheck(obj, type))) + return 1; + PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", + Py_TYPE(obj)->tp_name, type->tp_name); + return 0; + } + +-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { ++/* GetItemInt */ ++ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { + PyObject *r; + if (!j) return NULL; + r = PyObject_GetItem(o, j); +@@ -6152,10 +6846,13 @@ static CYTHON_INLINE PyObject *__Pyx_Get + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +-#if CYTHON_COMPILING_IN_CPYTHON +- if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); +- if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { +- PyObject *r = PyList_GET_ITEM(o, i); ++#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS ++ Py_ssize_t wrapped_i = i; ++ if (wraparound & unlikely(i < 0)) { ++ wrapped_i += PyList_GET_SIZE(o); ++ } ++ if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) { ++ PyObject *r = PyList_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } +@@ -6167,10 +6864,13 @@ static CYTHON_INLINE PyObject *__Pyx_Get + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +-#if CYTHON_COMPILING_IN_CPYTHON +- if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); +- if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { +- PyObject *r = PyTuple_GET_ITEM(o, i); ++#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS ++ Py_ssize_t wrapped_i = i; ++ if (wraparound & unlikely(i < 0)) { ++ wrapped_i += PyTuple_GET_SIZE(o); ++ } ++ if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) { ++ PyObject *r = PyTuple_GET_ITEM(o, wrapped_i); + Py_INCREF(r); + return r; + } +@@ -6182,7 +6882,7 @@ static CYTHON_INLINE PyObject *__Pyx_Get + static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list, + CYTHON_NCP_UNUSED int wraparound, + CYTHON_NCP_UNUSED int boundscheck) { +-#if CYTHON_COMPILING_IN_CPYTHON ++#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS + if (is_list || PyList_CheckExact(o)) { + Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); + if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { +@@ -6206,10 +6906,9 @@ static CYTHON_INLINE PyObject *__Pyx_Get + if (likely(l >= 0)) { + i += l; + } else { +- if (PyErr_ExceptionMatches(PyExc_OverflowError)) +- PyErr_Clear(); +- else ++ if (!PyErr_ExceptionMatches(PyExc_OverflowError)) + return NULL; ++ PyErr_Clear(); + } + } + return m->sq_item(o, i); +@@ -6223,13 +6922,93 @@ static CYTHON_INLINE PyObject *__Pyx_Get + return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); + } + +-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { ++/* ObjectGetItem */ ++ #if CYTHON_USE_TYPE_SLOTS ++static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) { ++ PyObject *runerr; ++ Py_ssize_t key_value; ++ PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence; ++ if (unlikely(!(m && m->sq_item))) { ++ PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name); ++ return NULL; ++ } ++ key_value = __Pyx_PyIndex_AsSsize_t(index); ++ if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) { ++ return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1); ++ } ++ if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) { ++ PyErr_Clear(); ++ PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name); ++ } ++ return NULL; ++} ++static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) { ++ PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping; ++ if (likely(m && m->mp_subscript)) { ++ return m->mp_subscript(obj, key); ++ } ++ return __Pyx_PyObject_GetIndex(obj, key); ++} ++#endif ++ ++/* PyObject_GenericGetAttrNoDict */ ++ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 ++static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) { ++ PyErr_Format(PyExc_AttributeError, ++#if PY_MAJOR_VERSION >= 3 ++ "'%.50s' object has no attribute '%U'", ++ tp->tp_name, attr_name); ++#else ++ "'%.50s' object has no attribute '%.400s'", ++ tp->tp_name, PyString_AS_STRING(attr_name)); ++#endif ++ return NULL; ++} ++static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) { ++ PyObject *descr; ++ PyTypeObject *tp = Py_TYPE(obj); ++ if (unlikely(!PyString_Check(attr_name))) { ++ return PyObject_GenericGetAttr(obj, attr_name); ++ } ++ assert(!tp->tp_dictoffset); ++ descr = _PyType_Lookup(tp, attr_name); ++ if (unlikely(!descr)) { ++ return __Pyx_RaiseGenericGetAttributeError(tp, attr_name); ++ } ++ Py_INCREF(descr); ++ #if PY_MAJOR_VERSION < 3 ++ if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS))) ++ #endif ++ { ++ descrgetfunc f = Py_TYPE(descr)->tp_descr_get; ++ if (unlikely(f)) { ++ PyObject *res = f(descr, obj, (PyObject *)tp); ++ Py_DECREF(descr); ++ return res; ++ } ++ } ++ return descr; ++} ++#endif ++ ++/* PyObject_GenericGetAttr */ ++ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000 ++static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) { ++ if (unlikely(Py_TYPE(obj)->tp_dictoffset)) { ++ return PyObject_GenericGetAttr(obj, attr_name); ++ } ++ return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name); ++} ++#endif ++ ++/* Import */ ++ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { + PyObject *empty_list = 0; + PyObject *module = 0; + PyObject *global_dict = 0; + PyObject *empty_dict = 0; + PyObject *list; +- #if PY_VERSION_HEX < 0x03030000 ++ #if PY_MAJOR_VERSION < 3 + PyObject *py_import; + py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); + if (!py_import) +@@ -6253,17 +7032,8 @@ static PyObject *__Pyx_Import(PyObject * + #if PY_MAJOR_VERSION >= 3 + if (level == -1) { + if (strchr(__Pyx_MODULE_NAME, '.')) { +- #if PY_VERSION_HEX < 0x03030000 +- PyObject *py_level = PyInt_FromLong(1); +- if (!py_level) +- goto bad; +- module = PyObject_CallFunctionObjArgs(py_import, +- name, global_dict, empty_dict, list, py_level, NULL); +- Py_DECREF(py_level); +- #else + module = PyImport_ImportModuleLevelObject( + name, global_dict, empty_dict, list, 1); +- #endif + if (!module) { + if (!PyErr_ExceptionMatches(PyExc_ImportError)) + goto bad; +@@ -6274,7 +7044,7 @@ static PyObject *__Pyx_Import(PyObject * + } + #endif + if (!module) { +- #if PY_VERSION_HEX < 0x03030000 ++ #if PY_MAJOR_VERSION < 3 + PyObject *py_level = PyInt_FromLong(level); + if (!py_level) + goto bad; +@@ -6288,7 +7058,7 @@ static PyObject *__Pyx_Import(PyObject * + } + } + bad: +- #if PY_VERSION_HEX < 0x03030000 ++ #if PY_MAJOR_VERSION < 3 + Py_XDECREF(py_import); + #endif + Py_XDECREF(empty_list); +@@ -6296,7 +7066,45 @@ bad: + return module; + } + +-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { ++/* CLineInTraceback */ ++ #ifndef CYTHON_CLINE_IN_TRACEBACK ++static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) { ++ PyObject *use_cline; ++ PyObject *ptype, *pvalue, *ptraceback; ++#if CYTHON_COMPILING_IN_CPYTHON ++ PyObject **cython_runtime_dict; ++#endif ++ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback); ++#if CYTHON_COMPILING_IN_CPYTHON ++ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime); ++ if (likely(cython_runtime_dict)) { ++ use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback); ++ } else ++#endif ++ { ++ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback); ++ if (use_cline_obj) { ++ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True; ++ Py_DECREF(use_cline_obj); ++ } else { ++ PyErr_Clear(); ++ use_cline = NULL; ++ } ++ } ++ if (!use_cline) { ++ c_line = 0; ++ PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False); ++ } ++ else if (PyObject_Not(use_cline) != 0) { ++ c_line = 0; ++ } ++ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback); ++ return c_line; ++} ++#endif ++ ++/* CodeObjectCache */ ++ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { + int start = 0, mid = 0, end = count - 1; + if (end >= 0 && code_line > entries[end].code_line) { + return count; +@@ -6375,7 +7183,8 @@ static void __pyx_insert_code_object(int + Py_INCREF(code_object); + } + +-#include "compile.h" ++/* AddTraceback */ ++ #include "compile.h" + #include "frameobject.h" + #include "traceback.h" + static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( +@@ -6434,28 +7243,33 @@ static void __Pyx_AddTraceback(const cha + int py_line, const char *filename) { + PyCodeObject *py_code = 0; + PyFrameObject *py_frame = 0; +- py_code = __pyx_find_code_object(c_line ? c_line : py_line); ++ PyThreadState *tstate = __Pyx_PyThreadState_Current; ++ if (c_line) { ++ c_line = __Pyx_CLineForTraceback(tstate, c_line); ++ } ++ py_code = __pyx_find_code_object(c_line ? -c_line : py_line); + if (!py_code) { + py_code = __Pyx_CreateCodeObjectForTraceback( + funcname, c_line, py_line, filename); + if (!py_code) goto bad; +- __pyx_insert_code_object(c_line ? c_line : py_line, py_code); ++ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code); + } + py_frame = PyFrame_New( +- PyThreadState_GET(), /*PyThreadState *tstate,*/ +- py_code, /*PyCodeObject *code,*/ +- __pyx_d, /*PyObject *globals,*/ +- 0 /*PyObject *locals*/ ++ tstate, /*PyThreadState *tstate,*/ ++ py_code, /*PyCodeObject *code,*/ ++ __pyx_d, /*PyObject *globals,*/ ++ 0 /*PyObject *locals*/ + ); + if (!py_frame) goto bad; +- py_frame->f_lineno = py_line; ++ __Pyx_PyFrame_SetLineNumber(py_frame, py_line); + PyTraceBack_Here(py_frame); + bad: + Py_XDECREF(py_code); + Py_XDECREF(py_frame); + } + +-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { ++/* CIntToPy */ ++ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { +@@ -6463,14 +7277,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyI + return PyInt_FromLong((long) value); + } else if (sizeof(int) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); ++#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); ++#endif + } + } else { + if (sizeof(int) <= sizeof(long)) { + return PyInt_FromLong((long) value); ++#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); ++#endif + } + } + { +@@ -6481,7 +7299,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyI + } + } + +-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { ++/* CIntToPy */ ++ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + if (is_unsigned) { +@@ -6489,14 +7308,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyI + return PyInt_FromLong((long) value); + } else if (sizeof(long) <= sizeof(unsigned long)) { + return PyLong_FromUnsignedLong((unsigned long) value); ++#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); ++#endif + } + } else { + if (sizeof(long) <= sizeof(long)) { + return PyInt_FromLong((long) value); ++#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + return PyLong_FromLongLong((PY_LONG_LONG) value); ++#endif + } + } + { +@@ -6507,7 +7330,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyI + } + } + +-#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ ++/* CIntFromPyVerify */ ++ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) + #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ + __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) +@@ -6528,11 +7352,39 @@ static CYTHON_INLINE PyObject* __Pyx_PyI + return (target_type) value;\ + } + +-#if CYTHON_USE_PYLONG_INTERNALS +- #include "longintrepr.h" ++/* CIntToPy */ ++ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { ++ const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; ++ const int is_unsigned = neg_one > const_zero; ++ if (is_unsigned) { ++ if (sizeof(unsigned int) < sizeof(long)) { ++ return PyInt_FromLong((long) value); ++ } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { ++ return PyLong_FromUnsignedLong((unsigned long) value); ++#ifdef HAVE_LONG_LONG ++ } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { ++ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); ++#endif ++ } ++ } else { ++ if (sizeof(unsigned int) <= sizeof(long)) { ++ return PyInt_FromLong((long) value); ++#ifdef HAVE_LONG_LONG ++ } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { ++ return PyLong_FromLongLong((PY_LONG_LONG) value); + #endif ++ } ++ } ++ { ++ int one = 1; int little = (int)*(unsigned char *)&one; ++ unsigned char *bytes = (unsigned char *)&value; ++ return _PyLong_FromByteArray(bytes, sizeof(unsigned int), ++ little, !is_unsigned); ++ } ++} + +-static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { ++/* CIntFromPy */ ++ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) { + const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; + const int is_unsigned = neg_one > const_zero; + #if PY_MAJOR_VERSION < 3 +@@ -6599,15 +7451,17 @@ static CYTHON_INLINE unsigned int __Pyx_ + #endif + if (sizeof(unsigned int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x)) ++#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) ++#endif + } + } else { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (unsigned int) 0; +- case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) digits[0]) ++ case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0]) + case -2: + if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) { +@@ -6667,8 +7521,10 @@ static CYTHON_INLINE unsigned int __Pyx_ + #endif + if (sizeof(unsigned int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x)) ++#ifdef HAVE_LONG_LONG + } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x)) ++#endif + } + } + { +@@ -6677,7 +7533,7 @@ static CYTHON_INLINE unsigned int __Pyx_ + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); + #else + unsigned int val; +- PyObject *v = __Pyx_PyNumber_Int(x); ++ PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; +@@ -6700,7 +7556,7 @@ static CYTHON_INLINE unsigned int __Pyx_ + } + } else { + unsigned int val; +- PyObject *tmp = __Pyx_PyNumber_Int(x); ++ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (unsigned int) -1; + val = __Pyx_PyInt_As_unsigned_int(tmp); + Py_DECREF(tmp); +@@ -6716,7 +7572,8 @@ raise_neg_overflow: + return (unsigned int) -1; + } + +-static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { ++/* CIntFromPy */ ++ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { + const int neg_one = (int) -1, const_zero = (int) 0; + const int is_unsigned = neg_one > const_zero; + #if PY_MAJOR_VERSION < 3 +@@ -6783,15 +7640,17 @@ static CYTHON_INLINE int __Pyx_PyInt_As_ + #endif + if (sizeof(int) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) ++#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) ++#endif + } + } else { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (int) 0; +- case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0]) ++ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) + case -2: + if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { +@@ -6851,8 +7710,10 @@ static CYTHON_INLINE int __Pyx_PyInt_As_ + #endif + if (sizeof(int) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) ++#ifdef HAVE_LONG_LONG + } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) ++#endif + } + } + { +@@ -6861,7 +7722,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_ + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); + #else + int val; +- PyObject *v = __Pyx_PyNumber_Int(x); ++ PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; +@@ -6884,7 +7745,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_ + } + } else { + int val; +- PyObject *tmp = __Pyx_PyNumber_Int(x); ++ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (int) -1; + val = __Pyx_PyInt_As_int(tmp); + Py_DECREF(tmp); +@@ -6900,33 +7761,8 @@ raise_neg_overflow: + return (int) -1; + } + +-static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) { +- const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0; +- const int is_unsigned = neg_one > const_zero; +- if (is_unsigned) { +- if (sizeof(unsigned int) < sizeof(long)) { +- return PyInt_FromLong((long) value); +- } else if (sizeof(unsigned int) <= sizeof(unsigned long)) { +- return PyLong_FromUnsignedLong((unsigned long) value); +- } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) { +- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); +- } +- } else { +- if (sizeof(unsigned int) <= sizeof(long)) { +- return PyInt_FromLong((long) value); +- } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) { +- return PyLong_FromLongLong((PY_LONG_LONG) value); +- } +- } +- { +- int one = 1; int little = (int)*(unsigned char *)&one; +- unsigned char *bytes = (unsigned char *)&value; +- return _PyLong_FromByteArray(bytes, sizeof(unsigned int), +- little, !is_unsigned); +- } +-} +- +-static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { ++/* CIntFromPy */ ++ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { + const long neg_one = (long) -1, const_zero = (long) 0; + const int is_unsigned = neg_one > const_zero; + #if PY_MAJOR_VERSION < 3 +@@ -6993,15 +7829,17 @@ static CYTHON_INLINE long __Pyx_PyInt_As + #endif + if (sizeof(long) <= sizeof(unsigned long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) ++#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) ++#endif + } + } else { + #if CYTHON_USE_PYLONG_INTERNALS + const digit* digits = ((PyLongObject*)x)->ob_digit; + switch (Py_SIZE(x)) { + case 0: return (long) 0; +- case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0]) ++ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) + case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) + case -2: + if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { +@@ -7061,8 +7899,10 @@ static CYTHON_INLINE long __Pyx_PyInt_As + #endif + if (sizeof(long) <= sizeof(long)) { + __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) ++#ifdef HAVE_LONG_LONG + } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { + __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) ++#endif + } + } + { +@@ -7071,7 +7911,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As + "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); + #else + long val; +- PyObject *v = __Pyx_PyNumber_Int(x); ++ PyObject *v = __Pyx_PyNumber_IntOrLong(x); + #if PY_MAJOR_VERSION < 3 + if (likely(v) && !PyLong_Check(v)) { + PyObject *tmp = v; +@@ -7094,7 +7934,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As + } + } else { + long val; +- PyObject *tmp = __Pyx_PyNumber_Int(x); ++ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); + if (!tmp) return (long) -1; + val = __Pyx_PyInt_As_long(tmp); + Py_DECREF(tmp); +@@ -7110,7 +7950,80 @@ raise_neg_overflow: + return (long) -1; + } + +-static int __Pyx_check_binary_version(void) { ++/* FastTypeChecks */ ++ #if CYTHON_COMPILING_IN_CPYTHON ++static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) { ++ while (a) { ++ a = a->tp_base; ++ if (a == b) ++ return 1; ++ } ++ return b == &PyBaseObject_Type; ++} ++static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) { ++ PyObject *mro; ++ if (a == b) return 1; ++ mro = a->tp_mro; ++ if (likely(mro)) { ++ Py_ssize_t i, n; ++ n = PyTuple_GET_SIZE(mro); ++ for (i = 0; i < n; i++) { ++ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b) ++ return 1; ++ } ++ return 0; ++ } ++ return __Pyx_InBases(a, b); ++} ++#if PY_MAJOR_VERSION == 2 ++static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) { ++ PyObject *exception, *value, *tb; ++ int res; ++ __Pyx_PyThreadState_declare ++ __Pyx_PyThreadState_assign ++ __Pyx_ErrFetch(&exception, &value, &tb); ++ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0; ++ if (unlikely(res == -1)) { ++ PyErr_WriteUnraisable(err); ++ res = 0; ++ } ++ if (!res) { ++ res = PyObject_IsSubclass(err, exc_type2); ++ if (unlikely(res == -1)) { ++ PyErr_WriteUnraisable(err); ++ res = 0; ++ } ++ } ++ __Pyx_ErrRestore(exception, value, tb); ++ return res; ++} ++#else ++static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) { ++ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0; ++ if (!res) { ++ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2); ++ } ++ return res; ++} ++#endif ++static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) { ++ if (likely(err == exc_type)) return 1; ++ if (likely(PyExceptionClass_Check(err))) { ++ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type); ++ } ++ return PyErr_GivenExceptionMatches(err, exc_type); ++} ++static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) { ++ if (likely(err == exc_type1 || err == exc_type2)) return 1; ++ if (likely(PyExceptionClass_Check(err))) { ++ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2); ++ } ++ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2)); ++} ++#endif ++ ++/* CheckBinaryVersion */ ++ static int __Pyx_check_binary_version(void) { + char ctversion[4], rtversion[4]; + PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); + PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); +@@ -7125,7 +8038,8 @@ static int __Pyx_check_binary_version(vo + return 0; + } + +-#ifndef __PYX_HAVE_RT_ImportModule ++/* ModuleImport */ ++ #ifndef __PYX_HAVE_RT_ImportModule + #define __PYX_HAVE_RT_ImportModule + static PyObject *__Pyx_ImportModule(const char *name) { + PyObject *py_name = 0; +@@ -7142,7 +8056,8 @@ bad: + } + #endif + +-#ifndef __PYX_HAVE_RT_ImportType ++/* TypeImport */ ++ #ifndef __PYX_HAVE_RT_ImportType + #define __PYX_HAVE_RT_ImportType + static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, + size_t size, int strict) +@@ -7188,14 +8103,14 @@ static PyTypeObject *__Pyx_ImportType(co + #endif + if (!strict && (size_t)basicsize > size) { + PyOS_snprintf(warning, sizeof(warning), +- "%s.%s size changed, may indicate binary incompatibility", +- module_name, class_name); ++ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", ++ module_name, class_name, basicsize, size); + if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; + } + else if ((size_t)basicsize != size) { + PyErr_Format(PyExc_ValueError, +- "%.200s.%.200s has the wrong size, try recompiling", +- module_name, class_name); ++ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", ++ module_name, class_name, basicsize, size); + goto bad; + } + return (PyTypeObject *)result; +@@ -7206,7 +8121,8 @@ bad: + } + #endif + +-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { ++/* InitStrings */ ++ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { + while (t->p) { + #if PY_MAJOR_VERSION < 3 + if (t->is_unicode) { +@@ -7231,6 +8147,8 @@ static int __Pyx_InitStrings(__Pyx_Strin + #endif + if (!*t->p) + return -1; ++ if (PyObject_Hash(*t->p) == -1) ++ return -1; + ++t; + } + return 0; +@@ -7239,50 +8157,57 @@ static int __Pyx_InitStrings(__Pyx_Strin + static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { + return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); + } +-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { ++static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) { + Py_ssize_t ignore; + return __Pyx_PyObject_AsStringAndSize(o, &ignore); + } +-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { +-#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) +- if ( +-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +- __Pyx_sys_getdefaultencoding_not_ascii && +-#endif +- PyUnicode_Check(o)) { +-#if PY_VERSION_HEX < 0x03030000 +- char* defenc_c; +- PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); +- if (!defenc) return NULL; +- defenc_c = PyBytes_AS_STRING(defenc); ++#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT ++#if !CYTHON_PEP393_ENABLED ++static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { ++ char* defenc_c; ++ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); ++ if (!defenc) return NULL; ++ defenc_c = PyBytes_AS_STRING(defenc); + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +- { +- char* end = defenc_c + PyBytes_GET_SIZE(defenc); +- char* c; +- for (c = defenc_c; c < end; c++) { +- if ((unsigned char) (*c) >= 128) { +- PyUnicode_AsASCIIString(o); +- return NULL; +- } ++ { ++ char* end = defenc_c + PyBytes_GET_SIZE(defenc); ++ char* c; ++ for (c = defenc_c; c < end; c++) { ++ if ((unsigned char) (*c) >= 128) { ++ PyUnicode_AsASCIIString(o); ++ return NULL; + } + } ++ } + #endif +- *length = PyBytes_GET_SIZE(defenc); +- return defenc_c; ++ *length = PyBytes_GET_SIZE(defenc); ++ return defenc_c; ++} + #else +- if (__Pyx_PyUnicode_READY(o) == -1) return NULL; ++static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) { ++ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL; + #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII +- if (PyUnicode_IS_ASCII(o)) { +- *length = PyUnicode_GET_LENGTH(o); +- return PyUnicode_AsUTF8(o); +- } else { +- PyUnicode_AsASCIIString(o); +- return NULL; +- } ++ if (likely(PyUnicode_IS_ASCII(o))) { ++ *length = PyUnicode_GET_LENGTH(o); ++ return PyUnicode_AsUTF8(o); ++ } else { ++ PyUnicode_AsASCIIString(o); ++ return NULL; ++ } + #else +- return PyUnicode_AsUTF8AndSize(o, length); ++ return PyUnicode_AsUTF8AndSize(o, length); ++#endif ++} + #endif + #endif ++static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { ++#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT ++ if ( ++#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII ++ __Pyx_sys_getdefaultencoding_not_ascii && ++#endif ++ PyUnicode_Check(o)) { ++ return __Pyx_PyUnicode_AsStringAndSize(o, length); + } else + #endif + #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) +@@ -7306,43 +8231,67 @@ static CYTHON_INLINE int __Pyx_PyObject_ + if (is_true | (x == Py_False) | (x == Py_None)) return is_true; + else return PyObject_IsTrue(x); + } +-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { ++static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) { ++#if PY_MAJOR_VERSION >= 3 ++ if (PyLong_Check(result)) { ++ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, ++ "__int__ returned non-int (type %.200s). " ++ "The ability to return an instance of a strict subclass of int " ++ "is deprecated, and may be removed in a future version of Python.", ++ Py_TYPE(result)->tp_name)) { ++ Py_DECREF(result); ++ return NULL; ++ } ++ return result; ++ } ++#endif ++ PyErr_Format(PyExc_TypeError, ++ "__%.4s__ returned non-%.4s (type %.200s)", ++ type_name, type_name, Py_TYPE(result)->tp_name); ++ Py_DECREF(result); ++ return NULL; ++} ++static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { ++#if CYTHON_USE_TYPE_SLOTS + PyNumberMethods *m; ++#endif + const char *name = NULL; + PyObject *res = NULL; + #if PY_MAJOR_VERSION < 3 +- if (PyInt_Check(x) || PyLong_Check(x)) ++ if (likely(PyInt_Check(x) || PyLong_Check(x))) + #else +- if (PyLong_Check(x)) ++ if (likely(PyLong_Check(x))) + #endif + return __Pyx_NewRef(x); ++#if CYTHON_USE_TYPE_SLOTS + m = Py_TYPE(x)->tp_as_number; +-#if PY_MAJOR_VERSION < 3 ++ #if PY_MAJOR_VERSION < 3 + if (m && m->nb_int) { + name = "int"; +- res = PyNumber_Int(x); ++ res = m->nb_int(x); + } + else if (m && m->nb_long) { + name = "long"; +- res = PyNumber_Long(x); ++ res = m->nb_long(x); + } +-#else +- if (m && m->nb_int) { ++ #else ++ if (likely(m && m->nb_int)) { + name = "int"; +- res = PyNumber_Long(x); ++ res = m->nb_int(x); ++ } ++ #endif ++#else ++ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) { ++ res = PyNumber_Int(x); + } + #endif +- if (res) { ++ if (likely(res)) { + #if PY_MAJOR_VERSION < 3 +- if (!PyInt_Check(res) && !PyLong_Check(res)) { ++ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) { + #else +- if (!PyLong_Check(res)) { ++ if (unlikely(!PyLong_CheckExact(res))) { + #endif +- PyErr_Format(PyExc_TypeError, +- "__%.4s__ returned non-%.4s (type %.200s)", +- name, name, Py_TYPE(res)->tp_name); +- Py_DECREF(res); +- return NULL; ++ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name); + } + } + else if (!PyErr_Occurred()) { diff -Nru basemap-1.1.0+dfsg/debian/patches/series basemap-1.1.0+dfsg/debian/patches/series --- basemap-1.1.0+dfsg/debian/patches/series 2018-05-14 01:30:05.000000000 +0000 +++ basemap-1.1.0+dfsg/debian/patches/series 2018-08-10 01:06:27.000000000 +0000 @@ -1,3 +1,4 @@ dont_install_data_files use_share_datafiles install_matplotlib_sphinxext +geos-cython-0.28.2.patch