|
From: <js...@us...> - 2007-08-31 17:23:35
|
Revision: 3763
http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3763&view=rev
Author: jswhit
Date: 2007-08-31 10:23:32 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
regenerate with Cython 0.9.6.5
Modified Paths:
--------------
trunk/toolkits/basemap/src/_geod.c
trunk/toolkits/basemap/src/_proj.c
trunk/toolkits/basemap/src/_pyproj.pxi
Modified: trunk/toolkits/basemap/src/_geod.c
===================================================================
--- trunk/toolkits/basemap/src/_geod.c 2007-08-31 15:40:42 UTC (rev 3762)
+++ trunk/toolkits/basemap/src/_geod.c 2007-08-31 17:23:32 UTC (rev 3763)
@@ -1,10 +1,18 @@
-/* Generated by Pyrex 0.9.5.1 on Sun May 20 08:32:09 2007 */
+/* Generated by Pyrex 0.9.6.3 on Fri Aug 31 08:42:50 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)
+#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
@@ -15,12 +23,36 @@
#include "math.h"
#include "geodesic.h"
#include "proj_api.h"
-#include "pycompat.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;} __Pyx_StringTabEntry; /*proto*/
+#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__
+#define likely(x) __builtin_expect(!!(x), 1)
+#define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* __GNUC__ */
+#define likely(x) (x)
+#define unlikely(x) (x)
+#endif /* __GNUC__ */
+
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
@@ -70,13 +102,11 @@
static PyObject *__pyx_n___version__;
static PyObject *__pyx_n_radians;
static PyObject *__pyx_n_degrees;
-static PyObject *__pyx_n_False;
static PyObject *__pyx_k2p;
static PyObject *__pyx_n_iteritems;
static PyObject *__pyx_n_append;
-static PyObject *__pyx_n_str;
static PyObject *__pyx_n_join;
static PyObject *__pyx_n_RuntimeError;
@@ -85,6 +115,8 @@
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[]) = " ";
@@ -99,119 +131,187 @@
PyObject *__pyx_v_value;
int __pyx_r;
PyObject *__pyx_1 = 0;
- PyObject *__pyx_2 = 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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_geodparams)) return -1;
+ 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/trunk/toolkits/basemap/src/_geod.pyx":13 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":15 */
- __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":16 */
- __pyx_1 = PyObject_GetAttr(__pyx_v_geodparams, __pyx_n_iteritems); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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;
- __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 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 (;;) {
- __pyx_2 = PyIter_Next(__pyx_1);
- if (!__pyx_2) {
- if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- break;
+ 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;
+ }
}
- __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(__pyx_v_key);
- __pyx_v_key = __pyx_2;
- __pyx_2 = 0;
- __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(__pyx_v_value);
- __pyx_v_value = __pyx_2;
- __pyx_2 = 0;
- if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ 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/trunk/toolkits/basemap/src/_geod.pyx":17 */
- __pyx_2 = PyObject_GetAttr(__pyx_v_geodargs, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
- __pyx_3 = PyNumber_Add(__pyx_k6p, __pyx_v_key); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
- __pyx_4 = PyNumber_Add(__pyx_3, __pyx_k7p); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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 = __Pyx_GetName(__pyx_b, __pyx_n_str); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
+ __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_5, 0, __pyx_v_value);
- __pyx_6 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
+ 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;
- Py_DECREF(__pyx_5); __pyx_5 = 0;
- __pyx_3 = PyNumber_Add(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
+ __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_5 = PyNumber_Add(__pyx_3, __pyx_k8p); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
+ __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_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
- Py_DECREF(__pyx_4); __pyx_4 = 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/trunk/toolkits/basemap/src/_geod.pyx":18 */
- __pyx_3 = PyObject_GetAttr(__pyx_k9p, __pyx_n_join); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
- Py_DECREF(__pyx_3); __pyx_3 = 0;
+ __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_2);
- Py_DECREF(__pyx_2); __pyx_2 = 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/trunk/toolkits/basemap/src/_geod.pyx":20 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":21 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":22 */
- __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
- __pyx_6 = PyString_FromString(pj_strerrno(pj_errno)); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
- __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
- __pyx_6 = 0;
- __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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;
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __Pyx_Raise(__pyx_3, 0, 0);
- Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; goto __pyx_L1;}
goto __pyx_L4;
}
__pyx_L4:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":23 */
- __pyx_5 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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;
@@ -220,7 +320,6 @@
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
@@ -246,15 +345,21 @@
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+ if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))) return 0;
Py_INCREF(__pyx_v_self);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":27 */
- __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___class__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
- __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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 (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; goto __pyx_L1;}
+ __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;
@@ -281,6 +386,8 @@
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)";
@@ -308,15 +415,15 @@
void (*__pyx_v_distdat);
PyObject *__pyx_r;
int __pyx_1;
- PyObject *__pyx_2 = 0;
- int __pyx_3;
+ int __pyx_2;
+ PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
double __pyx_7;
static char *__pyx_argnames[] = {"lons","lats","az","dist","radians",0};
__pyx_v_radians = __pyx_k3;
- if (!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;
+ 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);
@@ -324,59 +431,105 @@
Py_INCREF(__pyx_v_dist);
Py_INCREF(__pyx_v_radians);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":40 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":41 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; goto __pyx_L1;}
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":42 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":43 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; goto __pyx_L1;}
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":44 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":45 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; goto __pyx_L1;}
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":46 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":47 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; goto __pyx_L1;}
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":49 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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;
@@ -384,141 +537,267 @@
__pyx_1 = __pyx_v_buflenaz == __pyx_v_buflend;
}
}
- __pyx_3 = (!__pyx_1);
- if (__pyx_3) {
+ __pyx_2 = (!__pyx_1);
+ if (__pyx_2) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":50 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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_4, 0, __pyx_k10p);
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ 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_Raise(__pyx_5, 0, 0);
- Py_DECREF(__pyx_5); __pyx_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
goto __pyx_L6;
}
__pyx_L6:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":51 */
- __pyx_2 = PyInt_FromLong(__pyx_v_buflenlons); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__doublesize); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- __pyx_5 = PyNumber_Divide(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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 = PyInt_AsLong(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
+ __pyx_6 = PyInt_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/trunk/toolkits/basemap/src/_geod.pyx":52 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":53 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":54 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":55 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":56 */
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ndim; ++__pyx_v_i) {
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":57 */
- __pyx_1 = PyObject_IsTrue(__pyx_v_radians); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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 = 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/trunk/toolkits/basemap/src/_geod.pyx":58 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":59 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":60 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":61 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":63 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_lonsdata[__pyx_v_i])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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 (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; goto __pyx_L1;}
+ __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/trunk/toolkits/basemap/src/_geod.pyx":64 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_latsdata[__pyx_v_i])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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 (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; goto __pyx_L1;}
+ __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/trunk/toolkits/basemap/src/_geod.pyx":65 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__dg2rad); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble((__pyx_v_azdata[__pyx_v_i])); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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 (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; goto __pyx_L1;}
+ __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/trunk/toolkits/basemap/src/_geod.pyx":66 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":67 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":68 */
- __pyx_3 = (pj_errno != 0);
- if (__pyx_3) {
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":69 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
- __pyx_4 = PyString_FromString(pj_strerrno(pj_errno)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
- __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
- __pyx_4 = 0;
- __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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_Raise(__pyx_4, 0, 0);
- Py_DECREF(__pyx_4); __pyx_4 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
goto __pyx_L10;
}
__pyx_L10:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":70 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":71 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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) == FP_NAN:
+ */
__pyx_1 = (pj_errno != 0);
if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":72 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
- __pyx_5 = PyString_FromString(pj_strerrno(pj_errno)); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
- PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
- __pyx_5 = 0;
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":72
+ * geod_for(&self.geodesic_t)
+ * if pj_errno != 0:
+ * raise RuntimeError(pj_strerrno(pj_errno)) # <<<<<<<<<<<<<<
+ * if isnan(self.geodesic_t.ALPHA21) == FP_NAN:
+ * 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;
@@ -527,69 +806,121 @@
}
__pyx_L11:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":73 */
- __pyx_3 = (isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21) == FP_NAN);
- if (__pyx_3) {
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":73
+ * if pj_errno != 0:
+ * raise RuntimeError(pj_strerrno(pj_errno))
+ * if isnan(self.geodesic_t.ALPHA21) == FP_NAN: # <<<<<<<<<<<<<<
+ * raise ValueError('undefined forward geodesic (may be an equatorial arc)')
+ * if radians:
+ */
+ __pyx_2 = (isnan(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21) == FP_NAN);
+ if (__pyx_2) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":74 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
- __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":74
+ * raise RuntimeError(pj_strerrno(pj_errno))
+ * if isnan(self.geodesic_t.ALPHA21) == FP_NAN:
+ * 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_4, 0, __pyx_k11p);
- __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ 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_Raise(__pyx_5, 0, 0);
- Py_DECREF(__pyx_5); __pyx_5 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; goto __pyx_L1;}
goto __pyx_L12;
}
__pyx_L12:;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":75 */
- __pyx_1 = PyObject_IsTrue(__pyx_v_radians); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
+ /* "/Volumes/User/jwhitaker/python/pyproj/_geod.pyx":75
+ * if isnan(self.geodesic_t.ALPHA21) == FP_NAN:
+ * 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_1 = PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
if (__pyx_1) {
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":76 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":77 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":78 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":80 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.v); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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_7 = PyFloat_AsDouble(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
(__pyx_v_lonsdata[__pyx_v_i]) = __pyx_7;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":81 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.p2.u); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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_7 = PyFloat_AsDouble(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
(__pyx_v_latsdata[__pyx_v_i]) = __pyx_7;
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":82 */
- __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__rad2dg); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
- __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_5_geod_Geod *)__pyx_v_self)->geodesic_t.ALPHA21); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
- __pyx_5 = PyNumber_Multiply(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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_7 = PyFloat_AsDouble(__pyx_5); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; goto __pyx_L1;}
- Py_DECREF(__pyx_5); __pyx_5 = 0;
(__pyx_v_azdata[__pyx_v_i]) = __pyx_7;
}
__pyx_L13:;
@@ -598,7 +929,7 @@
__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);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("_geod.Geod._fwd");
@@ -643,15 +974,15 @@
void (*__pyx_v_distdat);
PyObject *__pyx_r;
int __pyx_1;
- PyObject *__pyx_2 = 0;
- int __pyx_3;
+ int __pyx_2;
+ PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
double __pyx_7;
static char *__pyx_argnames[] = {"lons1","lats1","lons2","lats2","radians",0};
__pyx_v_radians = __pyx_k4;
- if (!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;
+ 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);
@@ -659,59 +990,105 @@
Py_INCREF(__pyx_v_lats2);
Py_INCREF(__pyx_v_radians);
- /* "/Users/jsw/python/matplotlib/trunk/toolkits/basemap/src/_geod.pyx":94 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":95 */
- __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; goto __pyx_L1;}
- __Pyx_Raise(__pyx_2, 0, 0);
- Py_DECREF(__pyx_2); __pyx_2 = 0;
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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/trunk/toolkits/basemap/src/_geod.pyx":96 */
+ /* "/Volumes/User/jwhitaker/python/pyproj/_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_...
[truncated message content] |