/* Generated by Cython 0.9.6.7 on Sun Oct 14 08:16:22 2007 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
#define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02050000
typedef int Py_ssize_t;
#define PY_SSIZE_T_MAX INT_MAX
#define PY_SSIZE_T_MIN INT_MIN
#define PyInt_FromSsize_t(z) PyInt_FromLong(z)
#define PyInt_AsSsize_t(o) PyInt_AsLong(o)
#define PyNumber_Index(o) PyNumber_Int(o)
#define PyIndex_Check(o) PyNumber_Check(o)
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
__PYX_EXTERN_C double pow(double, double);
#include "stdlib.h"
#include "math.h"
#include "geodesic.h"
#include "proj_api.h"
#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE
#endif
typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/
#define __pyx_PyIndex_AsSsize_t(b) PyInt_AsSsize_t(PyNumber_Index(b))
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
if (x == Py_True) return 1;
else if (x == Py_False) return 0;
else return PyObject_IsTrue(x);
}
#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
#define likely(x) __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x) (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
static void __Pyx_AddTraceback(char *funcname); /*proto*/
/* Declarations from _geod */
struct __pyx_obj_5_geod_Geod {
PyObject_HEAD
GEODESIC_T geodesic_t;
PyObject *geodparams;
PyObject *proj_version;
char (*geodinitstring);
};
static PyTypeObject *__pyx_ptype_5_geod_Geod = 0;
static PyObject *__pyx_k3;
static PyObject *__pyx_k4;
static PyObject *__pyx_k5;
/* Implementation of _geod */
static char (__pyx_k2[]) = "1.8.3";
static PyObject *__pyx_n_math;
static PyObject *__pyx_n__dg2rad;
static PyObject *__pyx_n__rad2dg;
static PyObject *__pyx_n__doublesize;
static PyObject *__pyx_n___version__;
static PyObject *__pyx_n___new__;
static PyObject *__pyx_n___reduce__;
static PyObject *__pyx_n__fwd;
static PyObject *__pyx_n__inv;
static PyObject *__pyx_n__npts;
static PyObject *__pyx_n_radians;
static PyObject *__pyx_n_degrees;
static PyObject *__pyx_k2p;
static PyObject *__pyx_n_iteritems;
static PyObject *__pyx_n_append;
static PyObject *__pyx_n_join;
static PyObject *__pyx_n_RuntimeError;
static PyObject *__pyx_k6p;
static PyObject *__pyx_k7p;
static PyObject *__pyx_k8p;
static PyObject *__pyx_k9p;
static PyObject *__pyx_builtin_RuntimeError;
static char (__pyx_k6[]) = "+";
static char (__pyx_k7[]) = "=";
static char (__pyx_k8[]) = " ";
static char (__pyx_k9[]) = "";
static int __pyx_f_py_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_py_5_geod_4Geod___new__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_geodparams = 0;
GEODESIC_T __pyx_v_GEOD_T;
PyObject *__pyx_v_geodargs;
PyObject *__pyx_v_key;
PyObject *__pyx_v_value;
int __pyx_r;
PyObject *__pyx_1 = 0;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
static char *__pyx_argnames[] = {"geodparams",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geodparams))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_geodparams);
__pyx_v_geodargs = Py_None; Py_INCREF(Py_None);
__pyx_v_key = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":13
* def __new__(self, geodparams):
* cdef GEODESIC_T GEOD_T
* self.geodparams = geodparams # <<<<<<<<<<<<<<
* # setup proj initialization string.
* geodargs = []
*/
Py_INCREF(__pyx_v_geodparams);
Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams);
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams = __pyx_v_geodparams;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":15
* self.geodparams = geodparams
* # setup proj initialization string.
* geodargs = [] # <<<<<<<<<<<<<<
* for key,value in geodparams.iteritems():
* geodargs.append('+'+key+"="+str(value)+' ')
*/
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
Py_DECREF(__pyx_v_geodargs);
__pyx_v_geodargs = __pyx_1;
__pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":16
* # setup proj initialization string.
* geodargs = []
* for key,value in geodparams.iteritems(): # <<<<<<<<<<<<<<
* geodargs.append('+'+key+"="+str(value)+' ')
* self.geodinitstring = PyString_AsString(''.join(geodargs))
*/
__pyx_1 = PyObject_GetAttr(__pyx_v_geodparams, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_2 = 0; __pyx_1 = __pyx_3; Py_INCREF(__pyx_1); }
else { __pyx_1 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {
if (PyList_CheckExact(__pyx_1)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_2++); Py_INCREF(__pyx_3); }
else {
__pyx_3 = PyIter_Next(__pyx_1);
if (!__pyx_3) {
break;
}
}
if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
__pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0);
Py_INCREF(__pyx_5);
Py_DECREF(__pyx_v_key);
__pyx_v_key = __pyx_5;
__pyx_5 = 0;
__pyx_5 = PyTuple_GET_ITEM(__pyx_3, 1);
Py_INCREF(__pyx_5);
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_5;
__pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
}
else {
__pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_v_key);
__pyx_v_key = __pyx_5;
__pyx_5 = 0;
__pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_5;
__pyx_5 = 0;
if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
}
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":17
* geodargs = []
* for key,value in geodparams.iteritems():
* geodargs.append('+'+key+"="+str(value)+' ') # <<<<<<<<<<<<<<
* self.geodinitstring = PyString_AsString(''.join(geodargs))
* # initialize projection
*/
__pyx_5 = PyObject_GetAttr(__pyx_v_geodargs, __pyx_n_append); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_k6p, __pyx_v_key); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_4 = PyNumber_Add(__pyx_3, __pyx_k7p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
Py_INCREF(__pyx_v_value);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value);
__pyx_6 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyNumber_Add(__pyx_4, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
__pyx_4 = PyNumber_Add(__pyx_3, __pyx_k8p); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
__pyx_4 = 0;
__pyx_3 = PyObject_CallObject(__pyx_5, __pyx_6); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":18
* for key,value in geodparams.iteritems():
* geodargs.append('+'+key+"="+str(value)+' ')
* self.geodinitstring = PyString_AsString(''.join(geodargs)) # <<<<<<<<<<<<<<
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0]
*/
__pyx_4 = PyObject_GetAttr(__pyx_k9p, __pyx_n_join); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
Py_INCREF(__pyx_v_geodargs);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_geodargs);
__pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring = PyString_AsString(__pyx_6);
Py_DECREF(__pyx_6); __pyx_6 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":20
* self.geodinitstring = PyString_AsString(''.join(geodargs))
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0] # <<<<<<<<<<<<<<
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t = (GEOD_init_plus(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodinitstring,(&__pyx_v_GEOD_T))[0]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":21
* # initialize projection
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0]
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* self.proj_version = PJ_VERSION/100.
*/
__pyx_7 = (pj_errno != 0);
if (__pyx_7) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":22
* self.geodesic_t = GEOD_init_plus(self.geodinitstring, &GEOD_T)[0]
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
* self.proj_version = PJ_VERSION/100.
*
*/
__pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
__pyx_3 = 0;
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":23
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<<
*
* def __reduce__(self):
*/
__pyx_5 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version);
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->proj_version = __pyx_5;
__pyx_5 = 0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("_geod.Geod.__new__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_geodargs);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_geodparams);
return __pyx_r;
}
static PyObject *__pyx_n___class__;
static PyObject *__pyx_f_py_5_geod_4Geod___reduce__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_5_geod_4Geod___reduce__[] = "special method that allows pyproj.Geod instance to be pickled";
static PyObject *__pyx_f_py_5_geod_4Geod___reduce__(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":27
* def __reduce__(self):
* """special method that allows pyproj.Geod instance to be pickled"""
* return (self.__class__,(self.geodparams,)) # <<<<<<<<<<<<<<
*
* def _fwd(self, object lons, object lats, object az, object dist, radians=False):
*/
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams);
PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodparams);
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
__pyx_1 = 0;
__pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("_geod.Geod.__reduce__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}
static PyObject *__pyx_n_ValueError;
static PyObject *__pyx_k10p;
static PyObject *__pyx_k11p;
static PyObject *__pyx_builtin_ValueError;
static char (__pyx_k10[]) = "Buffer lengths not the same";
static char (__pyx_k11[]) = "undefined forward geodesic (may be an equatorial arc)";
static PyObject *__pyx_f_py_5_geod_4Geod__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__fwd[] = "\n forward transformation - determine longitude, latitude and back azimuth \n of a terminus point given an initial point longitude and latitude, plus\n forward azimuth and distance.\n if radians=True, lons/lats are radians instead of degrees.\n ";
static PyObject *__pyx_f_py_5_geod_4Geod__fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_lons = 0;
PyObject *__pyx_v_lats = 0;
PyObject *__pyx_v_az = 0;
PyObject *__pyx_v_dist = 0;
PyObject *__pyx_v_radians = 0;
Py_ssize_t __pyx_v_buflenlons;
Py_ssize_t __pyx_v_buflenlats;
Py_ssize_t __pyx_v_buflenaz;
Py_ssize_t __pyx_v_buflend;
Py_ssize_t __pyx_v_ndim;
Py_ssize_t __pyx_v_i;
double (*__pyx_v_lonsdata);
double (*__pyx_v_latsdata);
double (*__pyx_v_azdata);
double (*__pyx_v_distdata);
void (*__pyx_v_londata);
void (*__pyx_v_latdata);
void (*__pyx_v_azdat);
void (*__pyx_v_distdat);
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
double __pyx_7;
int __pyx_8;
static char *__pyx_argnames[] = {"lons","lats","az","dist","radians",0};
__pyx_v_radians = __pyx_k3;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons, &__pyx_v_lats, &__pyx_v_az, &__pyx_v_dist, &__pyx_v_radians))) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_lons);
Py_INCREF(__pyx_v_lats);
Py_INCREF(__pyx_v_az);
Py_INCREF(__pyx_v_dist);
Py_INCREF(__pyx_v_radians);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":40
* cdef void *londata, *latdata, *azdat, *distdat
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons,(&__pyx_v_londata),(&__pyx_v_buflenlons)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":41
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":42
* if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats,(&__pyx_v_latdata),(&__pyx_v_buflenlats)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":43
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":44
* if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_az,(&__pyx_v_azdat),(&__pyx_v_buflenaz)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":45
* raise RuntimeError
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0:
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":46
* if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* # process data in buffer
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_dist,(&__pyx_v_distdat),(&__pyx_v_buflend)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":47
* raise RuntimeError
* if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend:
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":49
* raise RuntimeError
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<<
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
*/
__pyx_1 = (__pyx_v_buflenlons == __pyx_v_buflenlats);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenlats == __pyx_v_buflenaz);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenaz == __pyx_v_buflend);
}
}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":50
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
Py_INCREF(__pyx_k10p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k10p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":51
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize # <<<<<<<<<<<<<<
* lonsdata = <double *>londata
* latsdata = <double *>latdata
*/
__pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
__pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_ndim = __pyx_6;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":52
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata # <<<<<<<<<<<<<<
* latsdata = <double *>latdata
* azdata = <double *>azdat
*/
__pyx_v_lonsdata = ((double (*))__pyx_v_londata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":53
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
* latsdata = <double *>latdata # <<<<<<<<<<<<<<
* azdata = <double *>azdat
* distdata = <double *>distdat
*/
__pyx_v_latsdata = ((double (*))__pyx_v_latdata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":54
* lonsdata = <double *>londata
* latsdata = <double *>latdata
* azdata = <double *>azdat # <<<<<<<<<<<<<<
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
*/
__pyx_v_azdata = ((double (*))__pyx_v_azdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":55
* latsdata = <double *>latdata
* azdata = <double *>azdat
* distdata = <double *>distdat # <<<<<<<<<<<<<<
* for i from 0 <= i < ndim:
* if radians:
*/
__pyx_v_distdata = ((double (*))__pyx_v_distdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":56
* azdata = <double *>azdat
* distdata = <double *>distdat
* for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
*/
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i++) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":57
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
* if radians: # <<<<<<<<<<<<<<
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":58
* for i from 0 <= i < ndim:
* if radians:
* self.geodesic_t.p1.v = lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = (__pyx_v_lonsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":59
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.ALPHA12 = azdata[i]
* self.geodesic_t.DIST = distdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = (__pyx_v_latsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":60
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.DIST = distdata[i]
* else:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = (__pyx_v_azdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":61
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.ALPHA12 = azdata[i]
* self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<<
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_distdata[__pyx_v_i]);
goto __pyx_L9;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":63
* self.geodesic_t.DIST = distdata[i]
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":64
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":65
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t)
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12 = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":66
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i] # <<<<<<<<<<<<<<
* geod_pre(&self.geodesic_t)
* if pj_errno != 0:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_distdata[__pyx_v_i]);
}
__pyx_L9:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":67
* self.geodesic_t.ALPHA12 = _dg2rad*azdata[i]
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t) # <<<<<<<<<<<<<<
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
*/
geod_pre((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":68
* self.geodesic_t.DIST = distdata[i]
* geod_pre(&self.geodesic_t)
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t)
*/
__pyx_2 = (pj_errno != 0);
if (__pyx_2) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":69
* geod_pre(&self.geodesic_t)
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
* geod_for(&self.geodesic_t)
* if pj_errno != 0:
*/
__pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_5 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
goto __pyx_L10;
}
__pyx_L10:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":70
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t) # <<<<<<<<<<<<<<
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
*/
geod_for((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":71
* raise RuntimeError(pj_strerrno(pj_errno))
* geod_for(&self.geodesic_t)
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* if isnan(self.geodesic_t.ALPHA21):
*/
__pyx_1 = (pj_errno != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":72
* geod_for(&self.geodesic_t)
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
* if isnan(self.geodesic_t.ALPHA21):
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
*/
__pyx_3 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_5 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
goto __pyx_L11;
}
__pyx_L11:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":73
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* if isnan(self.geodesic_t.ALPHA21): # <<<<<<<<<<<<<<
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
* if radians:
*/
__pyx_8 = isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21);
if (__pyx_8) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":74
* raise RuntimeError(pj_strerrno(pj_errno))
* if isnan(self.geodesic_t.ALPHA21):
* raise ValueError('undefined forward geodesic (may be an equatorial arc)') # <<<<<<<<<<<<<<
* if radians:
* lonsdata[i] = self.geodesic_t.p2.v
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
Py_INCREF(__pyx_k11p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k11p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_ValueError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
goto __pyx_L12;
}
__pyx_L12:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":75
* if isnan(self.geodesic_t.ALPHA21):
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
* if radians: # <<<<<<<<<<<<<<
* lonsdata[i] = self.geodesic_t.p2.v
* latsdata[i] = self.geodesic_t.p2.u
*/
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
if (__pyx_2) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":76
* raise ValueError('undefined forward geodesic (may be an equatorial arc)')
* if radians:
* lonsdata[i] = self.geodesic_t.p2.v # <<<<<<<<<<<<<<
* latsdata[i] = self.geodesic_t.p2.u
* azdata[i] = self.geodesic_t.ALPHA21
*/
(__pyx_v_lonsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":77
* if radians:
* lonsdata[i] = self.geodesic_t.p2.v
* latsdata[i] = self.geodesic_t.p2.u # <<<<<<<<<<<<<<
* azdata[i] = self.geodesic_t.ALPHA21
* else:
*/
(__pyx_v_latsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":78
* lonsdata[i] = self.geodesic_t.p2.v
* latsdata[i] = self.geodesic_t.p2.u
* azdata[i] = self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
*/
(__pyx_v_azdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21;
goto __pyx_L13;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":80
* azdata[i] = self.geodesic_t.ALPHA21
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v # <<<<<<<<<<<<<<
* latsdata[i] = _rad2dg*self.geodesic_t.p2.u
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_lonsdata[__pyx_v_i]) = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":81
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
* latsdata[i] = _rad2dg*self.geodesic_t.p2.u # <<<<<<<<<<<<<<
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_latsdata[__pyx_v_i]) = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":82
* lonsdata[i] = _rad2dg*self.geodesic_t.p2.v
* latsdata[i] = _rad2dg*self.geodesic_t.p2.u
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
*
* def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False):
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_azdata[__pyx_v_i]) = __pyx_7;
}
__pyx_L13:;
}
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("_geod.Geod._fwd");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_lons);
Py_DECREF(__pyx_v_lats);
Py_DECREF(__pyx_v_az);
Py_DECREF(__pyx_v_dist);
Py_DECREF(__pyx_v_radians);
return __pyx_r;
}
static PyObject *__pyx_k12p;
static PyObject *__pyx_k13p;
static char (__pyx_k12[]) = "Buffer lengths not the same";
static char (__pyx_k13[]) = "undefined inverse geodesic (may be an antipodal point)";
static PyObject *__pyx_f_py_5_geod_4Geod__inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__inv[] = "\n inverse transformation - return forward and back azimuths, plus distance\n between an initial and terminus lat/lon pair.\n if radians=True, lons/lats are radians instead of degrees.\n ";
static PyObject *__pyx_f_py_5_geod_4Geod__inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_lons1 = 0;
PyObject *__pyx_v_lats1 = 0;
PyObject *__pyx_v_lons2 = 0;
PyObject *__pyx_v_lats2 = 0;
PyObject *__pyx_v_radians = 0;
Py_ssize_t __pyx_v_buflenlons;
Py_ssize_t __pyx_v_buflenlats;
Py_ssize_t __pyx_v_buflenaz;
Py_ssize_t __pyx_v_buflend;
Py_ssize_t __pyx_v_ndim;
Py_ssize_t __pyx_v_i;
double (*__pyx_v_lonsdata);
double (*__pyx_v_latsdata);
double (*__pyx_v_azdata);
double (*__pyx_v_distdata);
void (*__pyx_v_londata);
void (*__pyx_v_latdata);
void (*__pyx_v_azdat);
void (*__pyx_v_distdat);
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
double __pyx_7;
int __pyx_8;
static char *__pyx_argnames[] = {"lons1","lats1","lons2","lats2","radians",0};
__pyx_v_radians = __pyx_k4;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO|O", __pyx_argnames, &__pyx_v_lons1, &__pyx_v_lats1, &__pyx_v_lons2, &__pyx_v_lats2, &__pyx_v_radians))) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_lons1);
Py_INCREF(__pyx_v_lats1);
Py_INCREF(__pyx_v_lons2);
Py_INCREF(__pyx_v_lats2);
Py_INCREF(__pyx_v_radians);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":94
* cdef void *londata, *latdata, *azdat, *distdat
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons1,(&__pyx_v_londata),(&__pyx_v_buflenlons)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":95
* # if buffer api is supported, get pointer to data buffers.
* if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
goto __pyx_L2;
}
__pyx_L2:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":96
* if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats1,(&__pyx_v_latdata),(&__pyx_v_buflenlats)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":97
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
goto __pyx_L3;
}
__pyx_L3:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":98
* if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0:
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lons2,(&__pyx_v_azdat),(&__pyx_v_buflenaz)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":99
* raise RuntimeError
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0:
* raise RuntimeError
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":100
* if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<<
* raise RuntimeError
* # process data in buffer
*/
__pyx_1 = (PyObject_AsWriteBuffer(__pyx_v_lats2,(&__pyx_v_distdat),(&__pyx_v_buflend)) != 0);
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":101
* raise RuntimeError
* if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0:
* raise RuntimeError # <<<<<<<<<<<<<<
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend:
*/
__Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
goto __pyx_L5;
}
__pyx_L5:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":103
* raise RuntimeError
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<<
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
*/
__pyx_1 = (__pyx_v_buflenlons == __pyx_v_buflenlats);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenlats == __pyx_v_buflenaz);
if (__pyx_1) {
__pyx_1 = (__pyx_v_buflenaz == __pyx_v_buflend);
}
}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":104
* # process data in buffer
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
Py_INCREF(__pyx_k12p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k12p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":105
* if not buflenlons == buflenlats == buflenaz == buflend:
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize # <<<<<<<<<<<<<<
* lonsdata = <double *>londata
* latsdata = <double *>latdata
*/
__pyx_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
__pyx_5 = PyNumber_Divide(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
__pyx_v_ndim = __pyx_6;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":106
* raise RuntimeError("Buffer lengths not the same")
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata # <<<<<<<<<<<<<<
* latsdata = <double *>latdata
* azdata = <double *>azdat
*/
__pyx_v_lonsdata = ((double (*))__pyx_v_londata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":107
* ndim = buflenlons/_doublesize
* lonsdata = <double *>londata
* latsdata = <double *>latdata # <<<<<<<<<<<<<<
* azdata = <double *>azdat
* distdata = <double *>distdat
*/
__pyx_v_latsdata = ((double (*))__pyx_v_latdata);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":108
* lonsdata = <double *>londata
* latsdata = <double *>latdata
* azdata = <double *>azdat # <<<<<<<<<<<<<<
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
*/
__pyx_v_azdata = ((double (*))__pyx_v_azdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":109
* latsdata = <double *>latdata
* azdata = <double *>azdat
* distdata = <double *>distdat # <<<<<<<<<<<<<<
* for i from 0 <= i < ndim:
* if radians:
*/
__pyx_v_distdata = ((double (*))__pyx_v_distdat);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":110
* azdata = <double *>azdat
* distdata = <double *>distdat
* for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
*/
for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; __pyx_v_i++) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":111
* distdata = <double *>distdat
* for i from 0 <= i < ndim:
* if radians: # <<<<<<<<<<<<<<
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":112
* for i from 0 <= i < ndim:
* if radians:
* self.geodesic_t.p1.v = lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.p2.v = azdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = (__pyx_v_lonsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":113
* if radians:
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = azdata[i]
* self.geodesic_t.p2.u = distdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = (__pyx_v_latsdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":114
* self.geodesic_t.p1.v = lonsdata[i]
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.p2.v = azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = distdata[i]
* else:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = (__pyx_v_azdata[__pyx_v_i]);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":115
* self.geodesic_t.p1.u = latsdata[i]
* self.geodesic_t.p2.v = azdata[i]
* self.geodesic_t.p2.u = distdata[i] # <<<<<<<<<<<<<<
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = (__pyx_v_distdata[__pyx_v_i]);
goto __pyx_L9;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":117
* self.geodesic_t.p2.u = distdata[i]
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":118
* else:
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":119
* self.geodesic_t.p1.v = _dg2rad*lonsdata[i]
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.p2.v = _dg2rad*azdata[i] # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
* geod_inv(&self.geodesic_t)
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":120
* self.geodesic_t.p1.u = _dg2rad*latsdata[i]
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
* self.geodesic_t.p2.u = _dg2rad*distdata[i] # <<<<<<<<<<<<<<
* geod_inv(&self.geodesic_t)
* if isnan(self.geodesic_t.DIST):
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble((__pyx_v_distdata[__pyx_v_i])); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
__pyx_5 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_5); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = __pyx_7;
}
__pyx_L9:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":121
* self.geodesic_t.p2.v = _dg2rad*azdata[i]
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
* geod_inv(&self.geodesic_t) # <<<<<<<<<<<<<<
* if isnan(self.geodesic_t.DIST):
* raise ValueError('undefined inverse geodesic (may be an antipodal point)')
*/
geod_inv((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":122
* self.geodesic_t.p2.u = _dg2rad*distdata[i]
* geod_inv(&self.geodesic_t)
* if isnan(self.geodesic_t.DIST): # <<<<<<<<<<<<<<
* raise ValueError('undefined inverse geodesic (may be an antipodal point)')
* if pj_errno != 0:
*/
__pyx_8 = isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST);
if (__pyx_8) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":123
* geod_inv(&self.geodesic_t)
* if isnan(self.geodesic_t.DIST):
* raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<<
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
*/
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_INCREF(__pyx_k13p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k13p);
__pyx_4 = PyObject_CallObject(__pyx_builtin_ValueError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
goto __pyx_L10;
}
__pyx_L10:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":124
* if isnan(self.geodesic_t.DIST):
* raise ValueError('undefined inverse geodesic (may be an antipodal point)')
* if pj_errno != 0: # <<<<<<<<<<<<<<
* raise RuntimeError(pj_strerrno(pj_errno))
* if radians:
*/
__pyx_2 = (pj_errno != 0);
if (__pyx_2) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":125
* raise ValueError('undefined inverse geodesic (may be an antipodal point)')
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
* if radians:
* lonsdata[i] = self.geodesic_t.ALPHA12
*/
__pyx_5 = PyString_FromString(pj_strerrno(pj_errno)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
__pyx_5 = 0;
__pyx_4 = PyObject_CallObject(__pyx_builtin_RuntimeError, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__Pyx_Raise(__pyx_4, 0, 0);
Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; goto __pyx_L1;}
goto __pyx_L11;
}
__pyx_L11:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":126
* if pj_errno != 0:
* raise RuntimeError(pj_strerrno(pj_errno))
* if radians: # <<<<<<<<<<<<<<
* lonsdata[i] = self.geodesic_t.ALPHA12
* latsdata[i] = self.geodesic_t.ALPHA21
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":127
* raise RuntimeError(pj_strerrno(pj_errno))
* if radians:
* lonsdata[i] = self.geodesic_t.ALPHA12 # <<<<<<<<<<<<<<
* latsdata[i] = self.geodesic_t.ALPHA21
* else:
*/
(__pyx_v_lonsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":128
* if radians:
* lonsdata[i] = self.geodesic_t.ALPHA12
* latsdata[i] = self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12
*/
(__pyx_v_latsdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21;
goto __pyx_L12;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":130
* latsdata[i] = self.geodesic_t.ALPHA21
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12 # <<<<<<<<<<<<<<
* latsdata[i] = _rad2dg*self.geodesic_t.ALPHA21
* azdata[i] = self.geodesic_t.DIST
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA12); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_lonsdata[__pyx_v_i]) = __pyx_7;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":131
* else:
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12
* latsdata[i] = _rad2dg*self.geodesic_t.ALPHA21 # <<<<<<<<<<<<<<
* azdata[i] = self.geodesic_t.DIST
*
*/
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_5, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_7 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
(__pyx_v_latsdata[__pyx_v_i]) = __pyx_7;
}
__pyx_L12:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":132
* lonsdata[i] = _rad2dg*self.geodesic_t.ALPHA12
* latsdata[i] = _rad2dg*self.geodesic_t.ALPHA21
* azdata[i] = self.geodesic_t.DIST # <<<<<<<<<<<<<<
*
* def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False):
*/
(__pyx_v_azdata[__pyx_v_i]) = ((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST;
}
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("_geod.Geod._inv");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_lons1);
Py_DECREF(__pyx_v_lats1);
Py_DECREF(__pyx_v_lons2);
Py_DECREF(__pyx_v_lats2);
Py_DECREF(__pyx_v_radians);
return __pyx_r;
}
static PyObject *__pyx_f_py_5_geod_4Geod__npts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5_geod_4Geod__npts[] = "\n given initial and terminus lat/lon, find npts intermediate points.";
static PyObject *__pyx_f_py_5_geod_4Geod__npts(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
double __pyx_v_lon1;
double __pyx_v_lat1;
double __pyx_v_lon2;
double __pyx_v_lat2;
int __pyx_v_npts;
PyObject *__pyx_v_radians = 0;
int __pyx_v_i;
double __pyx_v_del_s;
PyObject *__pyx_v_lats;
PyObject *__pyx_v_lons;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
double __pyx_5;
long __pyx_6;
static char *__pyx_argnames[] = {"lon1","lat1","lon2","lat2","npts","radians",0};
__pyx_v_radians = __pyx_k5;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "ddddi|O", __pyx_argnames, &__pyx_v_lon1, &__pyx_v_lat1, &__pyx_v_lon2, &__pyx_v_lat2, &__pyx_v_npts, &__pyx_v_radians))) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_radians);
__pyx_v_lats = Py_None; Py_INCREF(Py_None);
__pyx_v_lons = Py_None; Py_INCREF(Py_None);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":139
* cdef int i
* cdef double del_s
* if radians: # <<<<<<<<<<<<<<
* self.geodesic_t.p1.v = lon1
* self.geodesic_t.p1.u = lat1
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":140
* cdef double del_s
* if radians:
* self.geodesic_t.p1.v = lon1 # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = lat1
* self.geodesic_t.p2.v = lon2
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_v_lon1;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":141
* if radians:
* self.geodesic_t.p1.v = lon1
* self.geodesic_t.p1.u = lat1 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = lon2
* self.geodesic_t.p2.u = lat2
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_v_lat1;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":142
* self.geodesic_t.p1.v = lon1
* self.geodesic_t.p1.u = lat1
* self.geodesic_t.p2.v = lon2 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = lat2
* else:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = __pyx_v_lon2;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":143
* self.geodesic_t.p1.u = lat1
* self.geodesic_t.p2.v = lon2
* self.geodesic_t.p2.u = lat2 # <<<<<<<<<<<<<<
* else:
* self.geodesic_t.p1.v = _dg2rad*lon1
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = __pyx_v_lat2;
goto __pyx_L2;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":145
* self.geodesic_t.p2.u = lat2
* else:
* self.geodesic_t.p1.v = _dg2rad*lon1 # <<<<<<<<<<<<<<
* self.geodesic_t.p1.u = _dg2rad*lat1
* self.geodesic_t.p2.v = _dg2rad*lon2
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lon1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.v = __pyx_5;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":146
* else:
* self.geodesic_t.p1.v = _dg2rad*lon1
* self.geodesic_t.p1.u = _dg2rad*lat1 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.v = _dg2rad*lon2
* self.geodesic_t.p2.u = _dg2rad*lat2
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lat1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p1.u = __pyx_5;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":147
* self.geodesic_t.p1.v = _dg2rad*lon1
* self.geodesic_t.p1.u = _dg2rad*lat1
* self.geodesic_t.p2.v = _dg2rad*lon2 # <<<<<<<<<<<<<<
* self.geodesic_t.p2.u = _dg2rad*lat2
* # do inverse computation to set azimuths, distance.
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lon2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v = __pyx_5;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":148
* self.geodesic_t.p1.u = _dg2rad*lat1
* self.geodesic_t.p2.v = _dg2rad*lon2
* self.geodesic_t.p2.u = _dg2rad*lat2 # <<<<<<<<<<<<<<
* # do inverse computation to set azimuths, distance.
* geod_inv(&self.geodesic_t)
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
__pyx_3 = PyFloat_FromDouble(__pyx_v_lat2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyFloat_AsDouble(__pyx_4); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u = __pyx_5;
}
__pyx_L2:;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":150
* self.geodesic_t.p2.u = _dg2rad*lat2
* # do inverse computation to set azimuths, distance.
* geod_inv(&self.geodesic_t) # <<<<<<<<<<<<<<
* # set up some constants needed for forward computation.
* geod_pre(&self.geodesic_t)
*/
geod_inv((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":152
* geod_inv(&self.geodesic_t)
* # set up some constants needed for forward computation.
* geod_pre(&self.geodesic_t) # <<<<<<<<<<<<<<
* # distance increment.
* del_s = self.geodesic_t.DIST/(npts+1)
*/
geod_pre((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":154
* geod_pre(&self.geodesic_t)
* # distance increment.
* del_s = self.geodesic_t.DIST/(npts+1) # <<<<<<<<<<<<<<
* # initialize output tuples.
* lats = ()
*/
__pyx_v_del_s = (((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST / (__pyx_v_npts + 1));
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":156
* del_s = self.geodesic_t.DIST/(npts+1)
* # initialize output tuples.
* lats = () # <<<<<<<<<<<<<<
* lons = ()
* # loop over intermediate points, compute lat/lons.
*/
__pyx_2 = PyTuple_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; goto __pyx_L1;}
Py_DECREF(__pyx_v_lats);
__pyx_v_lats = __pyx_2;
__pyx_2 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":157
* # initialize output tuples.
* lats = ()
* lons = () # <<<<<<<<<<<<<<
* # loop over intermediate points, compute lat/lons.
* for i from 1 <= i < npts+1:
*/
__pyx_3 = PyTuple_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;}
Py_DECREF(__pyx_v_lons);
__pyx_v_lons = __pyx_3;
__pyx_3 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":159
* lons = ()
* # loop over intermediate points, compute lat/lons.
* for i from 1 <= i < npts+1: # <<<<<<<<<<<<<<
* self.geodesic_t.DIST = i*del_s
* geod_for(&self.geodesic_t)
*/
__pyx_6 = (__pyx_v_npts + 1);
for (__pyx_v_i = 1; __pyx_v_i < __pyx_6; __pyx_v_i++) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":160
* # loop over intermediate points, compute lat/lons.
* for i from 1 <= i < npts+1:
* self.geodesic_t.DIST = i*del_s # <<<<<<<<<<<<<<
* geod_for(&self.geodesic_t)
* if radians:
*/
((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.DIST = (__pyx_v_i * __pyx_v_del_s);
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":161
* for i from 1 <= i < npts+1:
* self.geodesic_t.DIST = i*del_s
* geod_for(&self.geodesic_t) # <<<<<<<<<<<<<<
* if radians:
* lats = lats + (self.geodesic_t.p2.u,)
*/
geod_for((&((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t));
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":162
* self.geodesic_t.DIST = i*del_s
* geod_for(&self.geodesic_t)
* if radians: # <<<<<<<<<<<<<<
* lats = lats + (self.geodesic_t.p2.u,)
* lons = lons + (self.geodesic_t.p2.v,)
*/
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
if (__pyx_1) {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":163
* geod_for(&self.geodesic_t)
* if radians:
* lats = lats + (self.geodesic_t.p2.u,) # <<<<<<<<<<<<<<
* lons = lons + (self.geodesic_t.p2.v,)
* else:
*/
__pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
__pyx_3 = PyNumber_Add(__pyx_v_lats, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_lats);
__pyx_v_lats = __pyx_3;
__pyx_3 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":164
* if radians:
* lats = lats + (self.geodesic_t.p2.u,)
* lons = lons + (self.geodesic_t.p2.v,) # <<<<<<<<<<<<<<
* else:
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,)
*/
__pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
__pyx_3 = PyNumber_Add(__pyx_v_lons, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_lons);
__pyx_v_lons = __pyx_3;
__pyx_3 = 0;
goto __pyx_L5;
}
/*else*/ {
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":166
* lons = lons + (self.geodesic_t.p2.v,)
* else:
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,) # <<<<<<<<<<<<<<
* lons = lons + (_rad2dg*self.geodesic_t.p2.v,)
* return lons, lats
*/
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
__pyx_2 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
__pyx_3 = PyNumber_Multiply(__pyx_4, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
__pyx_3 = 0;
__pyx_2 = PyNumber_Add(__pyx_v_lats, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_lats);
__pyx_v_lats = __pyx_2;
__pyx_2 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":167
* else:
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,)
* lons = lons + (_rad2dg*self.geodesic_t.p2.v,) # <<<<<<<<<<<<<<
* return lons, lats
*/
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
__pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
__pyx_2 = PyNumber_Multiply(__pyx_3, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
__pyx_4 = PyNumber_Add(__pyx_v_lons, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_lons);
__pyx_v_lons = __pyx_4;
__pyx_4 = 0;
}
__pyx_L5:;
}
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":168
* lats = lats + (_rad2dg*self.geodesic_t.p2.u,)
* lons = lons + (_rad2dg*self.geodesic_t.p2.v,)
* return lons, lats # <<<<<<<<<<<<<<
*/
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;}
Py_INCREF(__pyx_v_lons);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_lons);
Py_INCREF(__pyx_v_lats);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_lats);
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;
__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("_geod.Geod._npts");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_lats);
Py_DECREF(__pyx_v_lons);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_radians);
return __pyx_r;
}
static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_RuntimeError, "RuntimeError"},
{&__pyx_n_ValueError, "ValueError"},
{&__pyx_n___class__, "__class__"},
{&__pyx_n___new__, "__new__"},
{&__pyx_n___reduce__, "__reduce__"},
{&__pyx_n___version__, "__version__"},
{&__pyx_n__dg2rad, "_dg2rad"},
{&__pyx_n__doublesize, "_doublesize"},
{&__pyx_n__fwd, "_fwd"},
{&__pyx_n__inv, "_inv"},
{&__pyx_n__npts, "_npts"},
{&__pyx_n__rad2dg, "_rad2dg"},
{&__pyx_n_append, "append"},
{&__pyx_n_degrees, "degrees"},
{&__pyx_n_iteritems, "iteritems"},
{&__pyx_n_join, "join"},
{&__pyx_n_math, "math"},
{&__pyx_n_radians, "radians"},
{0, 0}
};
static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_k2p, __pyx_k2, sizeof(__pyx_k2), 0},
{&__pyx_k6p, __pyx_k6, sizeof(__pyx_k6), 0},
{&__pyx_k7p, __pyx_k7, sizeof(__pyx_k7), 0},
{&__pyx_k8p, __pyx_k8, sizeof(__pyx_k8), 0},
{&__pyx_k9p, __pyx_k9, sizeof(__pyx_k9), 0},
{&__pyx_k10p, __pyx_k10, sizeof(__pyx_k10), 0},
{&__pyx_k11p, __pyx_k11, sizeof(__pyx_k11), 0},
{&__pyx_k12p, __pyx_k12, sizeof(__pyx_k12), 0},
{&__pyx_k13p, __pyx_k13, sizeof(__pyx_k13), 0},
{0, 0, 0, 0}
};
static PyObject *__pyx_tp_new_5_geod_Geod(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5_geod_Geod *p = (struct __pyx_obj_5_geod_Geod *)o;
p->geodparams = Py_None; Py_INCREF(Py_None);
p->proj_version = Py_None; Py_INCREF(Py_None);
if (__pyx_f_py_5_geod_4Geod___new__(o, a, k) < 0) {
Py_DECREF(o); o = 0;
}
return o;
}
static void __pyx_tp_dealloc_5_geod_Geod(PyObject *o) {
struct __pyx_obj_5_geod_Geod *p = (struct __pyx_obj_5_geod_Geod *)o;
Py_XDECREF(p->geodparams);
Py_XDECREF(p->proj_version);
(*o->ob_type->tp_free)(o);
}
static int __pyx_tp_traverse_5_geod_Geod(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5_geod_Geod *p = (struct __pyx_obj_5_geod_Geod *)o;
if (p->geodparams) {
e = (*v)(p->geodparams, a); if (e) return e;
}
if (p->proj_version) {
e = (*v)(p->proj_version, a); if (e) return e;
}
return 0;
}
static int __pyx_tp_clear_5_geod_Geod(PyObject *o) {
struct __pyx_obj_5_geod_Geod *p = (struct __pyx_obj_5_geod_Geod *)o;
Py_XDECREF(p->geodparams);
p->geodparams = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->proj_version);
p->proj_version = Py_None; Py_INCREF(Py_None);
return 0;
}
static struct PyMethodDef __pyx_methods_5_geod_Geod[] = {
{"__reduce__", (PyCFunction)__pyx_f_py_5_geod_4Geod___reduce__, METH_NOARGS, __pyx_doc_5_geod_4Geod___reduce__},
{"_fwd", (PyCFunction)__pyx_f_py_5_geod_4Geod__fwd, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5_geod_4Geod__fwd},
{"_inv", (PyCFunction)__pyx_f_py_5_geod_4Geod__inv, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5_geod_4Geod__inv},
{"_npts", (PyCFunction)__pyx_f_py_5_geod_4Geod__npts, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5_geod_4Geod__npts},
{0, 0, 0, 0}
};
static struct PyMemberDef __pyx_members_5_geod_Geod[] = {
{"geodparams", T_OBJECT, offsetof(struct __pyx_obj_5_geod_Geod, geodparams), 0, 0},
{"proj_version", T_OBJECT, offsetof(struct __pyx_obj_5_geod_Geod, proj_version), 0, 0},
{0, 0, 0, 0, 0}
};
static PyNumberMethods __pyx_tp_as_number_Geod = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if PY_VERSION_HEX >= 0x02050000
0, /*nb_index*/
#endif
};
static PySequenceMethods __pyx_tp_as_sequence_Geod = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};
static PyMappingMethods __pyx_tp_as_mapping_Geod = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};
static PyBufferProcs __pyx_tp_as_buffer_Geod = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};
PyTypeObject __pyx_type_5_geod_Geod = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"_geod.Geod", /*tp_name*/
sizeof(struct __pyx_obj_5_geod_Geod), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5_geod_Geod, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_Geod, /*tp_as_number*/
&__pyx_tp_as_sequence_Geod, /*tp_as_sequence*/
&__pyx_tp_as_mapping_Geod, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_Geod, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5_geod_Geod, /*tp_traverse*/
__pyx_tp_clear_5_geod_Geod, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5_geod_Geod, /*tp_methods*/
__pyx_members_5_geod_Geod, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5_geod_Geod, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct PyMethodDef __pyx_methods[] = {
{0, 0, 0, 0}
};
static void __pyx_init_filenames(void); /*proto*/
PyMODINIT_FUNC init_geod(void); /*proto*/
PyMODINIT_FUNC init_geod(void) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
__pyx_init_filenames();
__pyx_m = Py_InitModule4("_geod", __pyx_methods, 0, 0, PYTHON_API_VERSION);
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
__pyx_b = PyImport_AddModule("__builtin__");
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3; goto __pyx_L1;};
__pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
__pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
__pyx_type_5_geod_Geod.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5_geod_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "Geod", (PyObject *)&__pyx_type_5_geod_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; goto __pyx_L1;}
__pyx_ptype_5_geod_Geod = &__pyx_type_5_geod_Geod;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_pyproj.pxi":1
* import math # <<<<<<<<<<<<<<
*
* _dg2rad = math.radians(1.)
*/
__pyx_1 = __Pyx_Import(__pyx_n_math, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_math, __pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 1; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_pyproj.pxi":3
* import math
*
* _dg2rad = math.radians(1.) # <<<<<<<<<<<<<<
* _rad2dg = math.degrees(1.)
* _doublesize = sizeof(double)
*/
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_math); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_radians); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n__dg2rad, __pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_pyproj.pxi":4
*
* _dg2rad = math.radians(1.)
* _rad2dg = math.degrees(1.) # <<<<<<<<<<<<<<
* _doublesize = sizeof(double)
* __version__ = "1.8.3"
*/
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_math); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_degrees); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n__rad2dg, __pyx_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_pyproj.pxi":5
* _dg2rad = math.radians(1.)
* _rad2dg = math.degrees(1.)
* _doublesize = sizeof(double) # <<<<<<<<<<<<<<
* __version__ = "1.8.3"
*
*/
__pyx_3 = PyInt_FromLong((sizeof(double ))); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n__doublesize, __pyx_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 5; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_pyproj.pxi":6
* _rad2dg = math.degrees(1.)
* _doublesize = sizeof(double)
* __version__ = "1.8.3" # <<<<<<<<<<<<<<
*
* cdef extern from "stdlib.h":
*/
if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_k2p) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 6; goto __pyx_L1;}
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":29
* return (self.__class__,(self.geodparams,))
*
* def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<<
* """
* forward transformation - determine longitude, latitude and back azimuth
*/
Py_INCREF(Py_False);
__pyx_k3 = Py_False;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":84
* azdata[i] = _rad2dg*self.geodesic_t.ALPHA21
*
* def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False): # <<<<<<<<<<<<<<
* """
* inverse transformation - return forward and back azimuths, plus distance
*/
Py_INCREF(Py_False);
__pyx_k4 = Py_False;
/* "/Users/jsw/python/matplotlib/toolkits/basemap/src/_geod.pyx":134
* azdata[i] = self.geodesic_t.DIST
*
* def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False): # <<<<<<<<<<<<<<
* """
* given initial and terminus lat/lon, find npts intermediate points."""
*/
Py_INCREF(Py_False);
__pyx_k5 = Py_False;
return;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("_geod");
}
static char *__pyx_filenames[] = {
"_geod.pyx",
"_pyproj.pxi",
};
/* Runtime support code */
static void __pyx_init_filenames(void) {
__pyx_f = __pyx_filenames;
}
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
PyObject *__import__ = 0;
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
PyObject *list;
__import__ = PyObject_GetAttrString(__pyx_b, "__import__");
if (!__import__)
goto bad;
if (from_list)
list = from_list;
else {
empty_list = PyList_New(0);
if (!empty_list)
goto bad;
list = empty_list;
}
global_dict = PyModule_GetDict(__pyx_m);
if (!global_dict)
goto bad;
empty_dict = PyDict_New();
if (!empty_dict)
goto bad;
module = PyObject_CallFunction(__import__, "OOOO",
name, global_dict, empty_dict, list);
bad:
Py_XDECREF(empty_list);
Py_XDECREF(__import__);
Py_XDECREF(empty_dict);
return module;
}
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
PyObject *result;
result = PyObject_GetAttr(dict, name);
if (!result)
PyErr_SetObject(PyExc_NameError, name);
return result;
}
static void __Pyx_UnpackError(void) {
PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
}
static PyObject *__Pyx_UnpackItem(PyObject *iter) {
PyObject *item;
if (!(item = PyIter_Next(iter))) {
if (!PyErr_Occurred())
__Pyx_UnpackError();
}
return item;
}
static int __Pyx_EndUnpack(PyObject *iter) {
PyObject *item;
if ((item = PyIter_Next(iter))) {
Py_DECREF(item);
__Pyx_UnpackError();
return -1;
}
else if (!PyErr_Occurred())
return 0;
else
return -1;
}
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
Py_XINCREF(type);
Py_XINCREF(value);
Py_XINCREF(tb);
/* First, check the traceback argument, replacing None with NULL. */
if (tb == Py_None) {
Py_DECREF(tb);
tb = 0;
}
else if (tb != NULL && !PyTraceBack_Check(tb)) {
PyErr_SetString(PyExc_TypeError,
"raise: arg 3 must be a traceback or None");
goto raise_error;
}
/* Next, replace a missing value with None */
if (value == NULL) {
value = Py_None;
Py_INCREF(value);
}
/* Next, repeatedly, replace a tuple exception with its first item */
while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
PyObject *tmp = type;
type = PyTuple_GET_ITEM(type, 0);
Py_INCREF(type);
Py_DECREF(tmp);
}
if (PyString_Check(type)) {
if (PyErr_Warn(PyExc_DeprecationWarning,
"raising a string exception is deprecated"))
goto raise_error;
}
else if (PyType_Check(type) || PyClass_Check(type))
; /*PyErr_NormalizeException(&type, &value, &tb);*/
else {
/* Raising an instance. The value should be a dummy. */
if (value != Py_None) {
PyErr_SetString(PyExc_TypeError,
"instance exception may not have a separate value");
goto raise_error;
}
/* Normalize to raise <class>, <instance> */
Py_DECREF(value);
value = type;
if (PyInstance_Check(type))
type = (PyObject*) ((PyInstanceObject*)type)->in_class;
else
type = (PyObject*) type->ob_type;
Py_INCREF(type);
}
PyErr_Restore(type, value, tb);
return;
raise_error:
Py_XDECREF(value);
Py_XDECREF(type);
Py_XDECREF(tb);
return;
}
static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
while (t->p) {
*t->p = PyString_InternFromString(t->s);
if (!*t->p)
return -1;
++t;
}
return 0;
}
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
while (t->p) {
if (t->is_unicode) {
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
} else {
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
}
if (!*t->p)
return -1;
++t;
}
return 0;
}
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static void __Pyx_AddTraceback(char *funcname) {
PyObject *py_srcfile = 0;
PyObject *py_funcname = 0;
PyObject *py_globals = 0;
PyObject *empty_tuple = 0;
PyObject *empty_string = 0;
PyCodeObject *py_code = 0;
PyFrameObject *py_frame = 0;
py_srcfile = PyString_FromString(__pyx_filename);
if (!py_srcfile) goto bad;
py_funcname = PyString_FromString(funcname);
if (!py_funcname) goto bad;
py_globals = PyModule_GetDict(__pyx_m);
if (!py_globals) goto bad;
empty_tuple = PyTuple_New(0);
if (!empty_tuple) goto bad;
empty_string = PyString_FromString("");
if (!empty_string) goto bad;
py_code = PyCode_New(
0, /*int argcount,*/
0, /*int nlocals,*/
0, /*int stacksize,*/
0, /*int flags,*/
empty_string, /*PyObject *code,*/
empty_tuple, /*PyObject *consts,*/
empty_tuple, /*PyObject *names,*/
empty_tuple, /*PyObject *varnames,*/
empty_tuple, /*PyObject *freevars,*/
empty_tuple, /*PyObject *cellvars,*/
py_srcfile, /*PyObject *filename,*/
py_funcname, /*PyObject *name,*/
__pyx_lineno, /*int firstlineno,*/
empty_string /*PyObject *lnotab*/
);
if (!py_code) goto bad;
py_frame = PyFrame_New(
PyThreadState_Get(), /*PyThreadState *tstate,*/
py_code, /*PyCodeObject *code,*/
py_globals, /*PyObject *globals,*/
0 /*PyObject *locals*/
);
if (!py_frame) goto bad;
py_frame->f_lineno = __pyx_lineno;
PyTraceBack_Here(py_frame);
bad:
Py_XDECREF(py_srcfile);
Py_XDECREF(py_funcname);
Py_XDECREF(empty_tuple);
Py_XDECREF(empty_string);
Py_XDECREF(py_code);
Py_XDECREF(py_frame);
}