Codebase list python-pyproj / b09ed1c
Imported Upstream version 1.9.4 Bas Couwenberg 9 years ago
68 changed file(s) with 7928 addition(s) and 3551 deletion(s). Raw diff Collapse all Expand all
0 1.9.4 (git tag v1.9.4rel)
1 * migrate to github from googlecode.
2 * update proj4 source code from svn r2595 (version 4.9.0RC2).
3 * include runtime_library_dirs in setup-proj.py.
4 * added to_latlong method (issue 51).
5 * fix back azimuth when lon1 and lon2 are identical.
06 1.9.3 (svn revision 327)
17 * Geod now uses C code adapted from geographiclib now included in proj4 source,
28 instead of pure python code directly from geographiclib.
0 Contact: Jeffrey Whitaker <jeffrey.s.whitaker@noaa.gov
1
2 copyright (c) 2013 by Jeffrey Whitaker.
3
4 Permission to use, copy, modify, and distribute this software
5 and its documentation for any purpose and without fee is hereby
6 granted, provided that the above copyright notice appear in all
7 copies and that both the copyright notice and this permission
8 notice appear in supporting documentation. THE AUTHOR DISCLAIMS
9 ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
10 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT
11 SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR
12 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
14 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
15 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+0
-3
LICENSE_geographiclib less more
0 Copyright (c) Charles Karney (2011) <charles@karney.com> and licensed
1 under the MIT/X11 License. For more information, see
2 http://geographiclib.sourceforge.net/
0 include README
0 include README.md
11 include MANIFEST.in
22 include LICENSE_proj4
3 include LICENSE_geographiclib
3 include LICENSE
44 include Changelog
55 include create_docs.sh
66 include _proj.pyx
+0
-24
PKG-INFO less more
0 Metadata-Version: 1.1
1 Name: pyproj
2 Version: 1.9.3
3 Summary: Python interface to PROJ.4 library
4 Home-page: http://code.google.com/p/pyproj
5 Author: Jeff Whitaker
6 Author-email: jeffrey.s.whitaker@noaa.gov
7 License: OSI Approved
8 Download-URL: http://python.org/pypi/pyproj
9 Description:
10 Performs cartographic transformations between geographic (lat/lon)
11 and map projection (x/y) coordinates. Can also transform directly
12 from one map projection coordinate system to another.
13 Coordinates can be given as numpy arrays, python arrays, lists or scalars.
14 Optimized for numpy arrays.
15 Keywords: python,map projections,GIS,mapping,maps
16 Platform: any
17 Classifier: Development Status :: 4 - Beta
18 Classifier: Intended Audience :: Science/Research
19 Classifier: License :: OSI Approved
20 Classifier: Topic :: Software Development :: Libraries :: Python Modules
21 Classifier: Topic :: Scientific/Engineering :: GIS
22 Classifier: Topic :: Scientific/Engineering :: Mathematics
23 Classifier: Operating System :: OS Independent
+0
-11
README less more
0 To install:
1
2 python setup.py build
3 python setup.py install
4
5 To use installed proj lib (and data files), use setup-proj.py instead
6 and set PROJ_DIR env var to point to location of proj installation.
7
8 Docs at http://pyproj.googlecode.com/svn/trunk/docs/index.html
9
10 Report bugs/ask questions at http://code.google.com/p/pyproj/issues/list
0 To install:
1
2 * clone github repo or download source release at http://python.org/pypi/pyproj.
3 * python setup.py build
4 * python setup.py install (with sudo if necessary).
5
6 To test, run `python -c "import pyproj; pyproj.test()"`
7
8 To use installed proj lib (and data files), use setup-proj.py instead
9 and set PROJ_DIR env var to point to location of proj installation.
10
11 Docs at http://jswhit.github.io/pyproj.
12
13 Report bugs/ask questions at https://github.com/jswhit/pyproj/issues.
+1464
-1113
_proj.c less more
0 /* Generated by Cython 0.17.4 on Sat Jan 5 16:03:47 2013 */
0 /* Generated by Cython 0.19.1 on Tue Nov 5 11:06:29 2013 */
11
22 #define PY_SSIZE_T_CLEAN
3 #ifndef CYTHON_USE_PYLONG_INTERNALS
4 #ifdef PYLONG_BITS_IN_DIGIT
5 #define CYTHON_USE_PYLONG_INTERNALS 0
6 #else
7 #include "pyconfig.h"
8 #ifdef PYLONG_BITS_IN_DIGIT
9 #define CYTHON_USE_PYLONG_INTERNALS 1
10 #else
11 #define CYTHON_USE_PYLONG_INTERNALS 0
12 #endif
13 #endif
14 #endif
315 #include "Python.h"
416 #ifndef Py_PYTHON_H
517 #error Python headers needed to compile C extensions, please install development version of Python.
115127 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
116128 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
117129 #endif
130 #if PY_VERSION_HEX < 0x02060000
131 #define Py_TPFLAGS_HAVE_VERSION_TAG 0
132 #endif
118133 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
119134 #define CYTHON_PEP393_ENABLED 1
120135 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
154169 #define PyBytes_Concat PyString_Concat
155170 #define PyBytes_ConcatAndDel PyString_ConcatAndDel
156171 #endif
172 #if PY_MAJOR_VERSION >= 3
173 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
174 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
175 #else
176 #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
177 PyString_Check(obj) || PyUnicode_Check(obj))
178 #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
179 #endif
157180 #if PY_VERSION_HEX < 0x02060000
158181 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
159182 #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
226249 #define __Pyx_NAMESTR(n) (n)
227250 #define __Pyx_DOCSTR(n) (n)
228251 #endif
229
230
231 #if PY_MAJOR_VERSION >= 3
232 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
233 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
234 #else
235 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
236 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
237 #endif
238
239 #ifndef __PYX_EXTERN_C
240 #ifdef __cplusplus
241 #define __PYX_EXTERN_C extern "C"
242 #else
243 #define __PYX_EXTERN_C extern
244 #endif
245 #endif
246
247 #if defined(WIN32) || defined(MS_WINDOWS)
248 #define _USE_MATH_DEFINES
249 #endif
250 #include <math.h>
251 #define __PYX_HAVE___proj
252 #define __PYX_HAVE_API___proj
253 #include "math.h"
254 #include "geodesic.h"
255 #include "proj_api.h"
256 #ifdef _OPENMP
257 #include <omp.h>
258 #endif /* _OPENMP */
259
260 #ifdef PYREX_WITHOUT_ASSERTIONS
261 #define CYTHON_WITHOUT_ASSERTIONS
262 #endif
263
264
265 /* inline attribute */
266252 #ifndef CYTHON_INLINE
267253 #if defined(__GNUC__)
268254 #define CYTHON_INLINE __inline__
274260 #define CYTHON_INLINE
275261 #endif
276262 #endif
277
278 /* unused attribute */
263 #ifndef CYTHON_RESTRICT
264 #if defined(__GNUC__)
265 #define CYTHON_RESTRICT __restrict__
266 #elif defined(_MSC_VER)
267 #define CYTHON_RESTRICT __restrict
268 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
269 #define CYTHON_RESTRICT restrict
270 #else
271 #define CYTHON_RESTRICT
272 #endif
273 #endif
274 #ifdef NAN
275 #define __PYX_NAN() ((float) NAN)
276 #else
277 static CYTHON_INLINE float __PYX_NAN() {
278 /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
279 a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
280 a quiet NaN. */
281 float value;
282 memset(&value, 0xFF, sizeof(value));
283 return value;
284 }
285 #endif
286
287
288 #if PY_MAJOR_VERSION >= 3
289 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
290 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
291 #else
292 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
293 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
294 #endif
295
296 #ifndef __PYX_EXTERN_C
297 #ifdef __cplusplus
298 #define __PYX_EXTERN_C extern "C"
299 #else
300 #define __PYX_EXTERN_C extern
301 #endif
302 #endif
303
304 #if defined(WIN32) || defined(MS_WINDOWS)
305 #define _USE_MATH_DEFINES
306 #endif
307 #include <math.h>
308 #define __PYX_HAVE___proj
309 #define __PYX_HAVE_API___proj
310 #include "math.h"
311 #include "geodesic.h"
312 #include "proj_api.h"
313 #ifdef _OPENMP
314 #include <omp.h>
315 #endif /* _OPENMP */
316
317 #ifdef PYREX_WITHOUT_ASSERTIONS
318 #define CYTHON_WITHOUT_ASSERTIONS
319 #endif
320
279321 #ifndef CYTHON_UNUSED
280322 # if defined(__GNUC__)
281323 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
289331 # define CYTHON_UNUSED
290332 # endif
291333 #endif
292
293 typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
294
295
296 /* Type Conversion Predeclarations */
297
298 #define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
299 #define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
300
334 typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
335 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
336
337 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
338 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
339 #define __PYX_DEFAULT_STRING_ENCODING ""
340 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
341 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
342 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
343 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
344 #define __Pyx_PyBytes_FromString PyBytes_FromString
345 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
346 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
347 #if PY_MAJOR_VERSION < 3
348 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
349 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
350 #else
351 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
352 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
353 #endif
354 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
355 #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
356 #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
357 #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
358 #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
359 #if PY_MAJOR_VERSION < 3
360 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
361 {
362 const Py_UNICODE *u_end = u;
363 while (*u_end++) ;
364 return u_end - u - 1;
365 }
366 #else
367 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
368 #endif
369 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
370 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
371 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
301372 #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
302373 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
303374 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
304375 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
305
306376 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
307377 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
308378 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
309
310379 #if CYTHON_COMPILING_IN_CPYTHON
311380 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
312381 #else
313382 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
314383 #endif
315384 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
385 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
386 static int __Pyx_sys_getdefaultencoding_not_ascii;
387 static int __Pyx_init_sys_getdefaultencoding_params() {
388 PyObject* sys = NULL;
389 PyObject* default_encoding = NULL;
390 PyObject* ascii_chars_u = NULL;
391 PyObject* ascii_chars_b = NULL;
392 sys = PyImport_ImportModule("sys");
393 if (sys == NULL) goto bad;
394 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
395 if (default_encoding == NULL) goto bad;
396 if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
397 __Pyx_sys_getdefaultencoding_not_ascii = 0;
398 } else {
399 const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
400 char ascii_chars[128];
401 int c;
402 for (c = 0; c < 128; c++) {
403 ascii_chars[c] = c;
404 }
405 __Pyx_sys_getdefaultencoding_not_ascii = 1;
406 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
407 if (ascii_chars_u == NULL) goto bad;
408 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
409 if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
410 PyErr_Format(
411 PyExc_ValueError,
412 "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.",
413 default_encoding_c);
414 goto bad;
415 }
416 }
417 Py_XDECREF(sys);
418 Py_XDECREF(default_encoding);
419 Py_XDECREF(ascii_chars_u);
420 Py_XDECREF(ascii_chars_b);
421 return 0;
422 bad:
423 Py_XDECREF(sys);
424 Py_XDECREF(default_encoding);
425 Py_XDECREF(ascii_chars_u);
426 Py_XDECREF(ascii_chars_b);
427 return -1;
428 }
429 #endif
430 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
431 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
432 #else
433 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
434 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
435 static char* __PYX_DEFAULT_STRING_ENCODING;
436 static int __Pyx_init_sys_getdefaultencoding_params() {
437 PyObject* sys = NULL;
438 PyObject* default_encoding = NULL;
439 char* default_encoding_c;
440 sys = PyImport_ImportModule("sys");
441 if (sys == NULL) goto bad;
442 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
443 if (default_encoding == NULL) goto bad;
444 default_encoding_c = PyBytes_AS_STRING(default_encoding);
445 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
446 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
447 Py_DECREF(sys);
448 Py_DECREF(default_encoding);
449 return 0;
450 bad:
451 Py_XDECREF(sys);
452 Py_XDECREF(default_encoding);
453 return -1;
454 }
455 #endif
456 #endif
457
316458
317459 #ifdef __GNUC__
318460 /* Test for GCC > 2.95 */
327469 #define likely(x) (x)
328470 #define unlikely(x) (x)
329471 #endif /* __GNUC__ */
330
472
331473 static PyObject *__pyx_m;
474 static PyObject *__pyx_d;
332475 static PyObject *__pyx_b;
333476 static PyObject *__pyx_empty_tuple;
334477 static PyObject *__pyx_empty_bytes;
347490 struct __pyx_obj_5_proj_Geod;
348491 struct __pyx_opt_args_5_proj__strencode;
349492
350 /* "_proj.pyx":346
493 /* "_proj.pyx":359
351494 * yy[i] = yy[i]*_rad2dg
352495 *
353496 * cdef _strencode(pystr,encoding='ascii'): # <<<<<<<<<<<<<<
359502 PyObject *encoding;
360503 };
361504
362 /* "_proj.pyx":62
363 * pj_set_searchpath(1, &searchpath)
505 /* "_proj.pyx":66
506 * return Proj(projstring)
364507 *
365508 * cdef class Proj: # <<<<<<<<<<<<<<
366509 * cdef projPJ projpj
376519 };
377520
378521
379 /* "_proj.pyx":353
522 /* "_proj.pyx":366
380523 * return pystr # already bytes?
381524 *
382525 * cdef class Geod: # <<<<<<<<<<<<<<
383 * cdef Geodesic _Geodesic
526 * cdef geod_geodesic _geod_geodesic
384527 * cdef public object initstring
385528 */
386529 struct __pyx_obj_5_proj_Geod {
387530 PyObject_HEAD
388 struct Geodesic _Geodesic;
531 struct geod_geodesic _geod_geodesic;
389532 PyObject *initstring;
390533 };
391534
443586 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
444587 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
445588
446 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
589 #if CYTHON_COMPILING_IN_CPYTHON
590 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
591 PyTypeObject* tp = Py_TYPE(obj);
592 if (likely(tp->tp_getattro))
593 return tp->tp_getattro(obj, attr_name);
594 #if PY_MAJOR_VERSION < 3
595 if (likely(tp->tp_getattr))
596 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
597 #endif
598 return PyObject_GetAttr(obj, attr_name);
599 }
600 #else
601 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
602 #endif
603
604 static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
447605
448606 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
449607
459617
460618 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
461619
620 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
621
462622 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
463623 const char *name, int exact); /*proto*/
464624
466626
467627 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
468628
629 #ifndef __PYX_FORCE_INIT_THREADS
630 #define __PYX_FORCE_INIT_THREADS 0
631 #endif
632
469633 static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
470634 static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
471635
472 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level); /*proto*/
636 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
473637
474638 static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
475639
539703 static PyObject *__pyx_builtin_AttributeError;
540704 static PyObject *__pyx_builtin_ValueError;
541705 static PyObject *__pyx_pf_5_proj_set_datapath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datapath); /* proto */
706 static PyObject *__pyx_pf_5_proj_2_createproj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_projstring); /* proto */
542707 static int __pyx_pf_5_proj_4Proj___cinit__(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_projstring); /* proto */
543708 static void __pyx_pf_5_proj_4Proj_2__dealloc__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
544 static PyObject *__pyx_pf_5_proj_4Proj_4__reduce__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
545 static PyObject *__pyx_pf_5_proj_4Proj_6_fwd(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_lons, PyObject *__pyx_v_lats, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck); /* proto */
546 static PyObject *__pyx_pf_5_proj_4Proj_8_inv(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck); /* proto */
547 static PyObject *__pyx_pf_5_proj_4Proj_10is_latlong(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
548 static PyObject *__pyx_pf_5_proj_4Proj_12is_geocent(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
709 static PyObject *__pyx_pf_5_proj_4Proj_4to_latlong(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
710 static PyObject *__pyx_pf_5_proj_4Proj_6__reduce__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
711 static PyObject *__pyx_pf_5_proj_4Proj_8_fwd(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_lons, PyObject *__pyx_v_lats, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck); /* proto */
712 static PyObject *__pyx_pf_5_proj_4Proj_10_inv(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck); /* proto */
713 static PyObject *__pyx_pf_5_proj_4Proj_12is_latlong(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
714 static PyObject *__pyx_pf_5_proj_4Proj_14is_geocent(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
549715 static PyObject *__pyx_pf_5_proj_4Proj_12proj_version___get__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
550716 static int __pyx_pf_5_proj_4Proj_12proj_version_2__set__(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
551717 static int __pyx_pf_5_proj_4Proj_12proj_version_4__del__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
552718 static PyObject *__pyx_pf_5_proj_4Proj_3srs___get__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
553719 static int __pyx_pf_5_proj_4Proj_3srs_2__set__(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
554720 static int __pyx_pf_5_proj_4Proj_3srs_4__del__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */
555 static PyObject *__pyx_pf_5_proj_2_transform(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5_proj_Proj *__pyx_v_p1, struct __pyx_obj_5_proj_Proj *__pyx_v_p2, PyObject *__pyx_v_inx, PyObject *__pyx_v_iny, PyObject *__pyx_v_inz, PyObject *__pyx_v_radians); /* proto */
721 static PyObject *__pyx_pf_5_proj_4_transform(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5_proj_Proj *__pyx_v_p1, struct __pyx_obj_5_proj_Proj *__pyx_v_p2, PyObject *__pyx_v_inx, PyObject *__pyx_v_iny, PyObject *__pyx_v_inz, PyObject *__pyx_v_radians); /* proto */
556722 static int __pyx_pf_5_proj_4Geod___cinit__(struct __pyx_obj_5_proj_Geod *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_f); /* proto */
557723 static PyObject *__pyx_pf_5_proj_4Geod_2__reduce__(struct __pyx_obj_5_proj_Geod *__pyx_v_self); /* proto */
558724 static PyObject *__pyx_pf_5_proj_4Geod_4_fwd(struct __pyx_obj_5_proj_Geod *__pyx_v_self, PyObject *__pyx_v_lons, PyObject *__pyx_v_lats, PyObject *__pyx_v_az, PyObject *__pyx_v_dist, PyObject *__pyx_v_radians); /* proto */
561727 static PyObject *__pyx_pf_5_proj_4Geod_10initstring___get__(struct __pyx_obj_5_proj_Geod *__pyx_v_self); /* proto */
562728 static int __pyx_pf_5_proj_4Geod_10initstring_2__set__(struct __pyx_obj_5_proj_Geod *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
563729 static int __pyx_pf_5_proj_4Geod_10initstring_4__del__(struct __pyx_obj_5_proj_Geod *__pyx_v_self); /* proto */
730 static PyObject *__pyx_tp_new_5_proj_Proj(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
731 static PyObject *__pyx_tp_new_5_proj_Geod(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
564732 static char __pyx_k_3[] = "Buffer lengths not the same";
565733 static char __pyx_k_5[] = "projection undefined";
566734 static char __pyx_k_15[] = "x,y and z must be same size";
567735 static char __pyx_k_17[] = "+a=%s +f=%s";
568736 static char __pyx_k_20[] = "undefined inverse geodesic (may be an antipodal point)";
569 static char __pyx_k_26[] = "1.9.3";
570 static char __pyx_k_29[] = "/Users/jsw/python/pyproj/_proj.pyx";
737 static char __pyx_k_26[] = "1.9.4";
738 static char __pyx_k_29[] = "/Volumes/User/jwhitaker/python/pyproj/_proj.pyx";
571739 static char __pyx_k__a[] = "a";
572740 static char __pyx_k__f[] = "f";
573741 static char __pyx_k__i[] = "i";
614782 static char __pyx_k__errcheck[] = "errcheck";
615783 static char __pyx_k____class__[] = "__class__";
616784 static char __pyx_k__ValueError[] = "ValueError";
785 static char __pyx_k____import__[] = "__import__";
617786 static char __pyx_k___transform[] = "_transform";
618787 static char __pyx_k__is_latlong[] = "is_latlong";
619788 static char __pyx_k__projstring[] = "projstring";
620789 static char __pyx_k__searchpath[] = "searchpath";
621790 static char __pyx_k____version__[] = "__version__";
791 static char __pyx_k___createproj[] = "_createproj";
622792 static char __pyx_k___doublesize[] = "_doublesize";
623793 static char __pyx_k__RuntimeError[] = "RuntimeError";
624794 static char __pyx_k__set_datapath[] = "set_datapath";
634804 static PyObject *__pyx_n_s__RuntimeError;
635805 static PyObject *__pyx_n_s__ValueError;
636806 static PyObject *__pyx_n_s____class__;
807 static PyObject *__pyx_n_s____import__;
637808 static PyObject *__pyx_n_s____main__;
638809 static PyObject *__pyx_n_s____test__;
639810 static PyObject *__pyx_n_s____version__;
811 static PyObject *__pyx_n_s___createproj;
640812 static PyObject *__pyx_n_s___doublesize;
641813 static PyObject *__pyx_n_s___proj;
642814 static PyObject *__pyx_n_s___transform;
707879 static PyObject *__pyx_k_tuple_24;
708880 static PyObject *__pyx_k_tuple_27;
709881 static PyObject *__pyx_k_tuple_30;
882 static PyObject *__pyx_k_tuple_32;
710883 static PyObject *__pyx_k_codeobj_28;
711884 static PyObject *__pyx_k_codeobj_31;
885 static PyObject *__pyx_k_codeobj_33;
712886
713887 /* Python wrapper */
714888 static PyObject *__pyx_pw_5_proj_1set_datapath(PyObject *__pyx_self, PyObject *__pyx_v_datapath); /*proto*/
722896 return __pyx_r;
723897 }
724898
725 /* "_proj.pyx":56
899 /* "_proj.pyx":58
726900 * int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len)
727901 *
728902 * def set_datapath(datapath): # <<<<<<<<<<<<<<
729 * cdef char *searchpath
730903 * bytestr = _strencode(datapath)
904 * cdef const char *searchpath = bytestr
731905 */
732906
733907 static PyObject *__pyx_pf_5_proj_set_datapath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datapath) {
734 char *__pyx_v_searchpath;
735908 PyObject *__pyx_v_bytestr = NULL;
909 char const *__pyx_v_searchpath;
736910 PyObject *__pyx_r = NULL;
737911 __Pyx_RefNannyDeclarations
738912 PyObject *__pyx_t_1 = NULL;
739 char *__pyx_t_2;
913 char const *__pyx_t_2;
740914 int __pyx_lineno = 0;
741915 const char *__pyx_filename = NULL;
742916 int __pyx_clineno = 0;
743917 __Pyx_RefNannySetupContext("set_datapath", 0);
744918
745 /* "_proj.pyx":58
919 /* "_proj.pyx":59
920 *
746921 * def set_datapath(datapath):
747 * cdef char *searchpath
748922 * bytestr = _strencode(datapath) # <<<<<<<<<<<<<<
749 * searchpath = bytestr
923 * cdef const char *searchpath = bytestr
750924 * pj_set_searchpath(1, &searchpath)
751925 */
752 __pyx_t_1 = __pyx_f_5_proj__strencode(__pyx_v_datapath, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
926 __pyx_t_1 = __pyx_f_5_proj__strencode(__pyx_v_datapath, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
753927 __Pyx_GOTREF(__pyx_t_1);
754928 __pyx_v_bytestr = __pyx_t_1;
755929 __pyx_t_1 = 0;
756930
757 /* "_proj.pyx":59
758 * cdef char *searchpath
931 /* "_proj.pyx":60
932 * def set_datapath(datapath):
759933 * bytestr = _strencode(datapath)
760 * searchpath = bytestr # <<<<<<<<<<<<<<
934 * cdef const char *searchpath = bytestr # <<<<<<<<<<<<<<
761935 * pj_set_searchpath(1, &searchpath)
762936 *
763937 */
764 __pyx_t_2 = PyBytes_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
938 __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
765939 __pyx_v_searchpath = __pyx_t_2;
766940
767 /* "_proj.pyx":60
941 /* "_proj.pyx":61
768942 * bytestr = _strencode(datapath)
769 * searchpath = bytestr
943 * cdef const char *searchpath = bytestr
770944 * pj_set_searchpath(1, &searchpath) # <<<<<<<<<<<<<<
771945 *
772 * cdef class Proj:
946 * def _createproj(projstring):
773947 */
774948 pj_set_searchpath(1, (&__pyx_v_searchpath));
775949
787961 }
788962
789963 /* Python wrapper */
964 static PyObject *__pyx_pw_5_proj_3_createproj(PyObject *__pyx_self, PyObject *__pyx_v_projstring); /*proto*/
965 static PyMethodDef __pyx_mdef_5_proj_3_createproj = {__Pyx_NAMESTR("_createproj"), (PyCFunction)__pyx_pw_5_proj_3_createproj, METH_O, __Pyx_DOCSTR(0)};
966 static PyObject *__pyx_pw_5_proj_3_createproj(PyObject *__pyx_self, PyObject *__pyx_v_projstring) {
967 PyObject *__pyx_r = 0;
968 __Pyx_RefNannyDeclarations
969 __Pyx_RefNannySetupContext("_createproj (wrapper)", 0);
970 __pyx_r = __pyx_pf_5_proj_2_createproj(__pyx_self, ((PyObject *)__pyx_v_projstring));
971 __Pyx_RefNannyFinishContext();
972 return __pyx_r;
973 }
974
975 /* "_proj.pyx":63
976 * pj_set_searchpath(1, &searchpath)
977 *
978 * def _createproj(projstring): # <<<<<<<<<<<<<<
979 * return Proj(projstring)
980 *
981 */
982
983 static PyObject *__pyx_pf_5_proj_2_createproj(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_projstring) {
984 PyObject *__pyx_r = NULL;
985 __Pyx_RefNannyDeclarations
986 PyObject *__pyx_t_1 = NULL;
987 PyObject *__pyx_t_2 = NULL;
988 int __pyx_lineno = 0;
989 const char *__pyx_filename = NULL;
990 int __pyx_clineno = 0;
991 __Pyx_RefNannySetupContext("_createproj", 0);
992
993 /* "_proj.pyx":64
994 *
995 * def _createproj(projstring):
996 * return Proj(projstring) # <<<<<<<<<<<<<<
997 *
998 * cdef class Proj:
999 */
1000 __Pyx_XDECREF(__pyx_r);
1001 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1002 __Pyx_GOTREF(__pyx_t_1);
1003 __Pyx_INCREF(__pyx_v_projstring);
1004 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_projstring);
1005 __Pyx_GIVEREF(__pyx_v_projstring);
1006 __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_5_proj_Proj)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1007 __Pyx_GOTREF(__pyx_t_2);
1008 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
1009 __pyx_r = __pyx_t_2;
1010 __pyx_t_2 = 0;
1011 goto __pyx_L0;
1012
1013 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1014 goto __pyx_L0;
1015 __pyx_L1_error:;
1016 __Pyx_XDECREF(__pyx_t_1);
1017 __Pyx_XDECREF(__pyx_t_2);
1018 __Pyx_AddTraceback("_proj._createproj", __pyx_clineno, __pyx_lineno, __pyx_filename);
1019 __pyx_r = NULL;
1020 __pyx_L0:;
1021 __Pyx_XGIVEREF(__pyx_r);
1022 __Pyx_RefNannyFinishContext();
1023 return __pyx_r;
1024 }
1025
1026 /* Python wrapper */
7901027 static int __pyx_pw_5_proj_4Proj_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7911028 static int __pyx_pw_5_proj_4Proj_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7921029 PyObject *__pyx_v_projstring = 0;
1030 int __pyx_lineno = 0;
1031 const char *__pyx_filename = NULL;
1032 int __pyx_clineno = 0;
7931033 int __pyx_r;
7941034 __Pyx_RefNannyDeclarations
7951035 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
8111051 else goto __pyx_L5_argtuple_error;
8121052 }
8131053 if (unlikely(kw_args > 0)) {
814 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1054 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8151055 }
8161056 } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8171057 goto __pyx_L5_argtuple_error;
8221062 }
8231063 goto __pyx_L4_argument_unpacking_done;
8241064 __pyx_L5_argtuple_error:;
825 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1065 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
8261066 __pyx_L3_error:;
8271067 __Pyx_AddTraceback("_proj.Proj.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8281068 __Pyx_RefNannyFinishContext();
8331073 return __pyx_r;
8341074 }
8351075
836 /* "_proj.pyx":69
1076 /* "_proj.pyx":73
8371077 * cdef public object srs
8381078 *
8391079 * def __cinit__(self, projstring): # <<<<<<<<<<<<<<
8551095 int __pyx_clineno = 0;
8561096 __Pyx_RefNannySetupContext("__cinit__", 0);
8571097
858 /* "_proj.pyx":72
1098 /* "_proj.pyx":76
8591099 * # setup proj initialization string.
8601100 * cdef int err
8611101 * self.srs = projstring # <<<<<<<<<<<<<<
8681108 __Pyx_DECREF(__pyx_v_self->srs);
8691109 __pyx_v_self->srs = __pyx_v_projstring;
8701110
871 /* "_proj.pyx":73
1111 /* "_proj.pyx":77
8721112 * cdef int err
8731113 * self.srs = projstring
8741114 * bytestr = _strencode(projstring) # <<<<<<<<<<<<<<
8751115 * self.pjinitstring = bytestr
8761116 * # initialize projection
8771117 */
878 __pyx_t_1 = __pyx_f_5_proj__strencode(__pyx_v_projstring, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1118 __pyx_t_1 = __pyx_f_5_proj__strencode(__pyx_v_projstring, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8791119 __Pyx_GOTREF(__pyx_t_1);
8801120 __pyx_v_bytestr = __pyx_t_1;
8811121 __pyx_t_1 = 0;
8821122
883 /* "_proj.pyx":74
1123 /* "_proj.pyx":78
8841124 * self.srs = projstring
8851125 * bytestr = _strencode(projstring)
8861126 * self.pjinitstring = bytestr # <<<<<<<<<<<<<<
8871127 * # initialize projection
8881128 * self.projctx = pj_ctx_alloc()
8891129 */
890 __pyx_t_2 = PyBytes_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1130 __pyx_t_2 = __Pyx_PyObject_AsString(__pyx_v_bytestr); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
8911131 __pyx_v_self->pjinitstring = __pyx_t_2;
8921132
893 /* "_proj.pyx":76
1133 /* "_proj.pyx":80
8941134 * self.pjinitstring = bytestr
8951135 * # initialize projection
8961136 * self.projctx = pj_ctx_alloc() # <<<<<<<<<<<<<<
8991139 */
9001140 __pyx_v_self->projctx = pj_ctx_alloc();
9011141
902 /* "_proj.pyx":77
1142 /* "_proj.pyx":81
9031143 * # initialize projection
9041144 * self.projctx = pj_ctx_alloc()
9051145 * self.projpj = pj_init_plus_ctx(self.projctx, self.pjinitstring) # <<<<<<<<<<<<<<
9081148 */
9091149 __pyx_v_self->projpj = pj_init_plus_ctx(__pyx_v_self->projctx, __pyx_v_self->pjinitstring);
9101150
911 /* "_proj.pyx":78
1151 /* "_proj.pyx":82
9121152 * self.projctx = pj_ctx_alloc()
9131153 * self.projpj = pj_init_plus_ctx(self.projctx, self.pjinitstring)
9141154 * err = pj_ctx_get_errno(self.projctx) # <<<<<<<<<<<<<<
9171157 */
9181158 __pyx_v_err = pj_ctx_get_errno(__pyx_v_self->projctx);
9191159
920 /* "_proj.pyx":79
1160 /* "_proj.pyx":83
9211161 * self.projpj = pj_init_plus_ctx(self.projctx, self.pjinitstring)
9221162 * err = pj_ctx_get_errno(self.projctx)
9231163 * if err != 0: # <<<<<<<<<<<<<<
9241164 * raise RuntimeError(pj_strerrno(err))
9251165 * self.proj_version = PJ_VERSION/100.
9261166 */
927 __pyx_t_3 = (__pyx_v_err != 0);
1167 __pyx_t_3 = ((__pyx_v_err != 0) != 0);
9281168 if (__pyx_t_3) {
9291169
930 /* "_proj.pyx":80
1170 /* "_proj.pyx":84
9311171 * err = pj_ctx_get_errno(self.projctx)
9321172 * if err != 0:
9331173 * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<<
9341174 * self.proj_version = PJ_VERSION/100.
9351175 *
9361176 */
937 __pyx_t_1 = PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1177 __pyx_t_1 = __Pyx_PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9381178 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
939 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1179 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9401180 __Pyx_GOTREF(__pyx_t_4);
9411181 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1));
9421182 __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
9431183 __pyx_t_1 = 0;
944 __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1184 __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9451185 __Pyx_GOTREF(__pyx_t_1);
9461186 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
9471187 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9481188 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
949 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1189 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9501190 goto __pyx_L3;
9511191 }
9521192 __pyx_L3:;
9531193
954 /* "_proj.pyx":81
1194 /* "_proj.pyx":85
9551195 * if err != 0:
9561196 * raise RuntimeError(pj_strerrno(err))
9571197 * self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<<
9581198 *
9591199 * def __dealloc__(self):
9601200 */
961 __pyx_t_1 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1201 __pyx_t_1 = PyFloat_FromDouble((PJ_VERSION / 100.)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
9621202 __Pyx_GOTREF(__pyx_t_1);
9631203 __Pyx_GIVEREF(__pyx_t_1);
9641204 __Pyx_GOTREF(__pyx_v_self->proj_version);
9881228 __Pyx_RefNannyFinishContext();
9891229 }
9901230
991 /* "_proj.pyx":83
1231 /* "_proj.pyx":87
9921232 * self.proj_version = PJ_VERSION/100.
9931233 *
9941234 * def __dealloc__(self): # <<<<<<<<<<<<<<
10001240 __Pyx_RefNannyDeclarations
10011241 __Pyx_RefNannySetupContext("__dealloc__", 0);
10021242
1003 /* "_proj.pyx":85
1243 /* "_proj.pyx":89
10041244 * def __dealloc__(self):
10051245 * """destroy projection definition"""
10061246 * pj_free(self.projpj) # <<<<<<<<<<<<<<
10091249 */
10101250 pj_free(__pyx_v_self->projpj);
10111251
1012 /* "_proj.pyx":86
1252 /* "_proj.pyx":90
10131253 * """destroy projection definition"""
10141254 * pj_free(self.projpj)
10151255 * pj_ctx_free(self.projctx) # <<<<<<<<<<<<<<
10161256 *
1257 * def to_latlong(self):
1258 */
1259 pj_ctx_free(__pyx_v_self->projctx);
1260
1261 __Pyx_RefNannyFinishContext();
1262 }
1263
1264 /* Python wrapper */
1265 static PyObject *__pyx_pw_5_proj_4Proj_5to_latlong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1266 static char __pyx_doc_5_proj_4Proj_4to_latlong[] = "return a new Proj instance which is the geographic (lat/lon)\n coordinate version of the current projection";
1267 static PyObject *__pyx_pw_5_proj_4Proj_5to_latlong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1268 PyObject *__pyx_r = 0;
1269 __Pyx_RefNannyDeclarations
1270 __Pyx_RefNannySetupContext("to_latlong (wrapper)", 0);
1271 __pyx_r = __pyx_pf_5_proj_4Proj_4to_latlong(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self));
1272 __Pyx_RefNannyFinishContext();
1273 return __pyx_r;
1274 }
1275
1276 /* "_proj.pyx":92
1277 * pj_ctx_free(self.projctx)
1278 *
1279 * def to_latlong(self): # <<<<<<<<<<<<<<
1280 * """return a new Proj instance which is the geographic (lat/lon)
1281 * coordinate version of the current projection"""
1282 */
1283
1284 static PyObject *__pyx_pf_5_proj_4Proj_4to_latlong(struct __pyx_obj_5_proj_Proj *__pyx_v_self) {
1285 projPJ __pyx_v_llpj;
1286 char *__pyx_v_initstring;
1287 PyObject *__pyx_r = NULL;
1288 __Pyx_RefNannyDeclarations
1289 PyObject *__pyx_t_1 = NULL;
1290 PyObject *__pyx_t_2 = NULL;
1291 PyObject *__pyx_t_3 = NULL;
1292 int __pyx_lineno = 0;
1293 const char *__pyx_filename = NULL;
1294 int __pyx_clineno = 0;
1295 __Pyx_RefNannySetupContext("to_latlong", 0);
1296
1297 /* "_proj.pyx":96
1298 * coordinate version of the current projection"""
1299 * cdef projPJ llpj
1300 * llpj = pj_latlong_from_proj(self.projpj) # <<<<<<<<<<<<<<
1301 * initstring = pj_get_def(llpj, 0)
1302 * pj_free(llpj)
1303 */
1304 __pyx_v_llpj = pj_latlong_from_proj(__pyx_v_self->projpj);
1305
1306 /* "_proj.pyx":97
1307 * cdef projPJ llpj
1308 * llpj = pj_latlong_from_proj(self.projpj)
1309 * initstring = pj_get_def(llpj, 0) # <<<<<<<<<<<<<<
1310 * pj_free(llpj)
1311 * return _createproj(initstring)
1312 */
1313 __pyx_v_initstring = pj_get_def(__pyx_v_llpj, 0);
1314
1315 /* "_proj.pyx":98
1316 * llpj = pj_latlong_from_proj(self.projpj)
1317 * initstring = pj_get_def(llpj, 0)
1318 * pj_free(llpj) # <<<<<<<<<<<<<<
1319 * return _createproj(initstring)
1320 *
1321 */
1322 pj_free(__pyx_v_llpj);
1323
1324 /* "_proj.pyx":99
1325 * initstring = pj_get_def(llpj, 0)
1326 * pj_free(llpj)
1327 * return _createproj(initstring) # <<<<<<<<<<<<<<
1328 *
10171329 * def __reduce__(self):
10181330 */
1019 pj_ctx_free(__pyx_v_self->projctx);
1020
1331 __Pyx_XDECREF(__pyx_r);
1332 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___createproj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1333 __Pyx_GOTREF(__pyx_t_1);
1334 __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_initstring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1335 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
1336 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1337 __Pyx_GOTREF(__pyx_t_3);
1338 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
1339 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
1340 __pyx_t_2 = 0;
1341 __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1342 __Pyx_GOTREF(__pyx_t_2);
1343 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1344 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
1345 __pyx_r = __pyx_t_2;
1346 __pyx_t_2 = 0;
1347 goto __pyx_L0;
1348
1349 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1350 goto __pyx_L0;
1351 __pyx_L1_error:;
1352 __Pyx_XDECREF(__pyx_t_1);
1353 __Pyx_XDECREF(__pyx_t_2);
1354 __Pyx_XDECREF(__pyx_t_3);
1355 __Pyx_AddTraceback("_proj.Proj.to_latlong", __pyx_clineno, __pyx_lineno, __pyx_filename);
1356 __pyx_r = NULL;
1357 __pyx_L0:;
1358 __Pyx_XGIVEREF(__pyx_r);
10211359 __Pyx_RefNannyFinishContext();
1360 return __pyx_r;
10221361 }
10231362
10241363 /* Python wrapper */
1025 static PyObject *__pyx_pw_5_proj_4Proj_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1026 static char __pyx_doc_5_proj_4Proj_4__reduce__[] = "special method that allows pyproj.Proj instance to be pickled";
1027 static PyObject *__pyx_pw_5_proj_4Proj_5__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
1364 static PyObject *__pyx_pw_5_proj_4Proj_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
1365 static char __pyx_doc_5_proj_4Proj_6__reduce__[] = "special method that allows pyproj.Proj instance to be pickled";
1366 static PyObject *__pyx_pw_5_proj_4Proj_7__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
10281367 PyObject *__pyx_r = 0;
10291368 __Pyx_RefNannyDeclarations
10301369 __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
1031 __pyx_r = __pyx_pf_5_proj_4Proj_4__reduce__(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self));
1370 __pyx_r = __pyx_pf_5_proj_4Proj_6__reduce__(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self));
10321371 __Pyx_RefNannyFinishContext();
10331372 return __pyx_r;
10341373 }
10351374
1036 /* "_proj.pyx":88
1037 * pj_ctx_free(self.projctx)
1375 /* "_proj.pyx":101
1376 * return _createproj(initstring)
10381377 *
10391378 * def __reduce__(self): # <<<<<<<<<<<<<<
10401379 * """special method that allows pyproj.Proj instance to be pickled"""
10411380 * return (self.__class__,(self.srs,))
10421381 */
10431382
1044 static PyObject *__pyx_pf_5_proj_4Proj_4__reduce__(struct __pyx_obj_5_proj_Proj *__pyx_v_self) {
1383 static PyObject *__pyx_pf_5_proj_4Proj_6__reduce__(struct __pyx_obj_5_proj_Proj *__pyx_v_self) {
10451384 PyObject *__pyx_r = NULL;
10461385 __Pyx_RefNannyDeclarations
10471386 PyObject *__pyx_t_1 = NULL;
10521391 int __pyx_clineno = 0;
10531392 __Pyx_RefNannySetupContext("__reduce__", 0);
10541393
1055 /* "_proj.pyx":90
1394 /* "_proj.pyx":103
10561395 * def __reduce__(self):
10571396 * """special method that allows pyproj.Proj instance to be pickled"""
10581397 * return (self.__class__,(self.srs,)) # <<<<<<<<<<<<<<
10601399 * def _fwd(self, object lons, object lats, radians=False, errcheck=False):
10611400 */
10621401 __Pyx_XDECREF(__pyx_r);
1063 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1402 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10641403 __Pyx_GOTREF(__pyx_t_1);
1065 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1404 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10661405 __Pyx_GOTREF(__pyx_t_2);
10671406 __Pyx_INCREF(__pyx_v_self->srs);
10681407 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->srs);
10691408 __Pyx_GIVEREF(__pyx_v_self->srs);
1070 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1409 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
10711410 __Pyx_GOTREF(__pyx_t_3);
10721411 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10731412 __Pyx_GIVEREF(__pyx_t_1);
10941433 }
10951434
10961435 /* Python wrapper */
1097 static PyObject *__pyx_pw_5_proj_4Proj_7_fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1098 static char __pyx_doc_5_proj_4Proj_6_fwd[] = "\n forward transformation - lons,lats to x,y (done in place).\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the forward transformation is invalid.\n if errcheck=False and the forward transformation is invalid, no exception is\n raised and 1.e30 is returned.\n ";
1099 static PyObject *__pyx_pw_5_proj_4Proj_7_fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1436 static PyObject *__pyx_pw_5_proj_4Proj_9_fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1437 static char __pyx_doc_5_proj_4Proj_8_fwd[] = "\n forward transformation - lons,lats to x,y (done in place).\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the forward transformation is invalid.\n if errcheck=False and the forward transformation is invalid, no exception is\n raised and 1.e30 is returned.\n ";
1438 static PyObject *__pyx_pw_5_proj_4Proj_9_fwd(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11001439 PyObject *__pyx_v_lons = 0;
11011440 PyObject *__pyx_v_lats = 0;
11021441 PyObject *__pyx_v_radians = 0;
11031442 PyObject *__pyx_v_errcheck = 0;
1443 int __pyx_lineno = 0;
1444 const char *__pyx_filename = NULL;
1445 int __pyx_clineno = 0;
11041446 PyObject *__pyx_r = 0;
11051447 __Pyx_RefNannyDeclarations
11061448 __Pyx_RefNannySetupContext("_fwd (wrapper)", 0);
11281470 case 1:
11291471 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats)) != 0)) kw_args--;
11301472 else {
1131 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1473 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11321474 }
11331475 case 2:
11341476 if (kw_args > 0) {
11421484 }
11431485 }
11441486 if (unlikely(kw_args > 0)) {
1145 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1487 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11461488 }
11471489 } else {
11481490 switch (PyTuple_GET_SIZE(__pyx_args)) {
11611503 }
11621504 goto __pyx_L4_argument_unpacking_done;
11631505 __pyx_L5_argtuple_error:;
1164 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
1506 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
11651507 __pyx_L3_error:;
11661508 __Pyx_AddTraceback("_proj.Proj._fwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
11671509 __Pyx_RefNannyFinishContext();
11681510 return NULL;
11691511 __pyx_L4_argument_unpacking_done:;
1170 __pyx_r = __pyx_pf_5_proj_4Proj_6_fwd(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self), __pyx_v_lons, __pyx_v_lats, __pyx_v_radians, __pyx_v_errcheck);
1512 __pyx_r = __pyx_pf_5_proj_4Proj_8_fwd(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self), __pyx_v_lons, __pyx_v_lats, __pyx_v_radians, __pyx_v_errcheck);
11711513 __Pyx_RefNannyFinishContext();
11721514 return __pyx_r;
11731515 }
11741516
1175 /* "_proj.pyx":92
1517 /* "_proj.pyx":105
11761518 * return (self.__class__,(self.srs,))
11771519 *
11781520 * def _fwd(self, object lons, object lats, radians=False, errcheck=False): # <<<<<<<<<<<<<<
11801522 * forward transformation - lons,lats to x,y (done in place).
11811523 */
11821524
1183 static PyObject *__pyx_pf_5_proj_4Proj_6_fwd(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_lons, PyObject *__pyx_v_lats, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck) {
1525 static PyObject *__pyx_pf_5_proj_4Proj_8_fwd(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_lons, PyObject *__pyx_v_lats, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck) {
11841526 projUV __pyx_v_projxyout;
11851527 projUV __pyx_v_projlonlatin;
11861528 Py_ssize_t __pyx_v_buflenx;
12071549 int __pyx_clineno = 0;
12081550 __Pyx_RefNannySetupContext("_fwd", 0);
12091551
1210 /* "_proj.pyx":107
1552 /* "_proj.pyx":120
12111553 * cdef int err
12121554 * # if buffer api is supported, get pointer to data buffers.
12131555 * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0: # <<<<<<<<<<<<<<
12141556 * raise RuntimeError
12151557 * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0:
12161558 */
1217 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lons, (&__pyx_v_londata), (&__pyx_v_buflenx)) != 0);
1559 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lons, (&__pyx_v_londata), (&__pyx_v_buflenx)) != 0) != 0);
12181560 if (__pyx_t_1) {
12191561
1220 /* "_proj.pyx":108
1562 /* "_proj.pyx":121
12211563 * # if buffer api is supported, get pointer to data buffers.
12221564 * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0:
12231565 * raise RuntimeError # <<<<<<<<<<<<<<
12251567 * raise RuntimeError
12261568 */
12271569 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
1228 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1570 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12291571 goto __pyx_L3;
12301572 }
12311573 __pyx_L3:;
12321574
1233 /* "_proj.pyx":109
1575 /* "_proj.pyx":122
12341576 * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0:
12351577 * raise RuntimeError
12361578 * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0: # <<<<<<<<<<<<<<
12371579 * raise RuntimeError
12381580 * # process data in buffer
12391581 */
1240 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lats, (&__pyx_v_latdata), (&__pyx_v_bufleny)) != 0);
1582 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lats, (&__pyx_v_latdata), (&__pyx_v_bufleny)) != 0) != 0);
12411583 if (__pyx_t_1) {
12421584
1243 /* "_proj.pyx":110
1585 /* "_proj.pyx":123
12441586 * raise RuntimeError
12451587 * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0:
12461588 * raise RuntimeError # <<<<<<<<<<<<<<
12481590 * if buflenx != bufleny:
12491591 */
12501592 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
1251 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1593 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12521594 goto __pyx_L4;
12531595 }
12541596 __pyx_L4:;
12551597
1256 /* "_proj.pyx":112
1598 /* "_proj.pyx":125
12571599 * raise RuntimeError
12581600 * # process data in buffer
12591601 * if buflenx != bufleny: # <<<<<<<<<<<<<<
12601602 * raise RuntimeError("Buffer lengths not the same")
12611603 * ndim = buflenx//_doublesize
12621604 */
1263 __pyx_t_1 = (__pyx_v_buflenx != __pyx_v_bufleny);
1605 __pyx_t_1 = ((__pyx_v_buflenx != __pyx_v_bufleny) != 0);
12641606 if (__pyx_t_1) {
12651607
1266 /* "_proj.pyx":113
1608 /* "_proj.pyx":126
12671609 * # process data in buffer
12681610 * if buflenx != bufleny:
12691611 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
12701612 * ndim = buflenx//_doublesize
12711613 * lonsdata = <double *>londata
12721614 */
1273 __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1615 __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12741616 __Pyx_GOTREF(__pyx_t_2);
12751617 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12761618 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1277 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1619 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12781620 goto __pyx_L5;
12791621 }
12801622 __pyx_L5:;
12811623
1282 /* "_proj.pyx":114
1624 /* "_proj.pyx":127
12831625 * if buflenx != bufleny:
12841626 * raise RuntimeError("Buffer lengths not the same")
12851627 * ndim = buflenx//_doublesize # <<<<<<<<<<<<<<
12861628 * lonsdata = <double *>londata
12871629 * latsdata = <double *>latdata
12881630 */
1289 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_buflenx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1631 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_buflenx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12901632 __Pyx_GOTREF(__pyx_t_2);
1291 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___doublesize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1633 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___doublesize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12921634 __Pyx_GOTREF(__pyx_t_3);
1293 __pyx_t_4 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1635 __pyx_t_4 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12941636 __Pyx_GOTREF(__pyx_t_4);
12951637 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12961638 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1297 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1639 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
12981640 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12991641 __pyx_v_ndim = __pyx_t_5;
13001642
1301 /* "_proj.pyx":115
1643 /* "_proj.pyx":128
13021644 * raise RuntimeError("Buffer lengths not the same")
13031645 * ndim = buflenx//_doublesize
13041646 * lonsdata = <double *>londata # <<<<<<<<<<<<<<
13071649 */
13081650 __pyx_v_lonsdata = ((double *)__pyx_v_londata);
13091651
1310 /* "_proj.pyx":116
1652 /* "_proj.pyx":129
13111653 * ndim = buflenx//_doublesize
13121654 * lonsdata = <double *>londata
13131655 * latsdata = <double *>latdata # <<<<<<<<<<<<<<
13161658 */
13171659 __pyx_v_latsdata = ((double *)__pyx_v_latdata);
13181660
1319 /* "_proj.pyx":117
1661 /* "_proj.pyx":130
13201662 * lonsdata = <double *>londata
13211663 * latsdata = <double *>latdata
13221664 * for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
13261668 __pyx_t_5 = __pyx_v_ndim;
13271669 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
13281670
1329 /* "_proj.pyx":119
1671 /* "_proj.pyx":132
13301672 * for i from 0 <= i < ndim:
13311673 * # if inputs are nan's, return big number.
13321674 * if lonsdata[i] != lonsdata[i] or latsdata[i] != latsdata[i]: # <<<<<<<<<<<<<<
13331675 * lonsdata[i]=1.e30; latsdata[i]=1.e30
13341676 * if errcheck:
13351677 */
1336 __pyx_t_1 = ((__pyx_v_lonsdata[__pyx_v_i]) != (__pyx_v_lonsdata[__pyx_v_i]));
1678 __pyx_t_1 = (((__pyx_v_lonsdata[__pyx_v_i]) != (__pyx_v_lonsdata[__pyx_v_i])) != 0);
13371679 if (!__pyx_t_1) {
1338 __pyx_t_6 = ((__pyx_v_latsdata[__pyx_v_i]) != (__pyx_v_latsdata[__pyx_v_i]));
1680 __pyx_t_6 = (((__pyx_v_latsdata[__pyx_v_i]) != (__pyx_v_latsdata[__pyx_v_i])) != 0);
13391681 __pyx_t_7 = __pyx_t_6;
13401682 } else {
13411683 __pyx_t_7 = __pyx_t_1;
13421684 }
13431685 if (__pyx_t_7) {
13441686
1345 /* "_proj.pyx":120
1687 /* "_proj.pyx":133
13461688 * # if inputs are nan's, return big number.
13471689 * if lonsdata[i] != lonsdata[i] or latsdata[i] != latsdata[i]:
13481690 * lonsdata[i]=1.e30; latsdata[i]=1.e30 # <<<<<<<<<<<<<<
13521694 (__pyx_v_lonsdata[__pyx_v_i]) = 1.e30;
13531695 (__pyx_v_latsdata[__pyx_v_i]) = 1.e30;
13541696
1355 /* "_proj.pyx":121
1697 /* "_proj.pyx":134
13561698 * if lonsdata[i] != lonsdata[i] or latsdata[i] != latsdata[i]:
13571699 * lonsdata[i]=1.e30; latsdata[i]=1.e30
13581700 * if errcheck: # <<<<<<<<<<<<<<
13591701 * raise RuntimeError('projection undefined')
13601702 * continue
13611703 */
1362 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1704 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13631705 if (__pyx_t_7) {
13641706
1365 /* "_proj.pyx":122
1707 /* "_proj.pyx":135
13661708 * lonsdata[i]=1.e30; latsdata[i]=1.e30
13671709 * if errcheck:
13681710 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
13691711 * continue
13701712 * if radians:
13711713 */
1372 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1714 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13731715 __Pyx_GOTREF(__pyx_t_4);
13741716 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
13751717 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1376 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1718 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
13771719 goto __pyx_L9;
13781720 }
13791721 __pyx_L9:;
13801722
1381 /* "_proj.pyx":123
1723 /* "_proj.pyx":136
13821724 * if errcheck:
13831725 * raise RuntimeError('projection undefined')
13841726 * continue # <<<<<<<<<<<<<<
13901732 }
13911733 __pyx_L8:;
13921734
1393 /* "_proj.pyx":124
1735 /* "_proj.pyx":137
13941736 * raise RuntimeError('projection undefined')
13951737 * continue
13961738 * if radians: # <<<<<<<<<<<<<<
13971739 * projlonlatin.u = lonsdata[i]
13981740 * projlonlatin.v = latsdata[i]
13991741 */
1400 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1742 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14011743 if (__pyx_t_7) {
14021744
1403 /* "_proj.pyx":125
1745 /* "_proj.pyx":138
14041746 * continue
14051747 * if radians:
14061748 * projlonlatin.u = lonsdata[i] # <<<<<<<<<<<<<<
14091751 */
14101752 __pyx_v_projlonlatin.u = (__pyx_v_lonsdata[__pyx_v_i]);
14111753
1412 /* "_proj.pyx":126
1754 /* "_proj.pyx":139
14131755 * if radians:
14141756 * projlonlatin.u = lonsdata[i]
14151757 * projlonlatin.v = latsdata[i] # <<<<<<<<<<<<<<
14211763 }
14221764 /*else*/ {
14231765
1424 /* "_proj.pyx":128
1766 /* "_proj.pyx":141
14251767 * projlonlatin.v = latsdata[i]
14261768 * else:
14271769 * projlonlatin.u = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<<
14301772 */
14311773 __pyx_v_projlonlatin.u = (__pyx_v_5_proj__dg2rad * (__pyx_v_lonsdata[__pyx_v_i]));
14321774
1433 /* "_proj.pyx":129
1775 /* "_proj.pyx":142
14341776 * else:
14351777 * projlonlatin.u = _dg2rad*lonsdata[i]
14361778 * projlonlatin.v = _dg2rad*latsdata[i] # <<<<<<<<<<<<<<
14411783 }
14421784 __pyx_L10:;
14431785
1444 /* "_proj.pyx":130
1786 /* "_proj.pyx":143
14451787 * projlonlatin.u = _dg2rad*lonsdata[i]
14461788 * projlonlatin.v = _dg2rad*latsdata[i]
14471789 * projxyout = pj_fwd(projlonlatin,self.projpj) # <<<<<<<<<<<<<<
14501792 */
14511793 __pyx_v_projxyout = pj_fwd(__pyx_v_projlonlatin, __pyx_v_self->projpj);
14521794
1453 /* "_proj.pyx":131
1795 /* "_proj.pyx":144
14541796 * projlonlatin.v = _dg2rad*latsdata[i]
14551797 * projxyout = pj_fwd(projlonlatin,self.projpj)
14561798 * if errcheck: # <<<<<<<<<<<<<<
14571799 * err = pj_ctx_get_errno(self.projctx)
14581800 * if err != 0:
14591801 */
1460 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1802 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14611803 if (__pyx_t_7) {
14621804
1463 /* "_proj.pyx":132
1805 /* "_proj.pyx":145
14641806 * projxyout = pj_fwd(projlonlatin,self.projpj)
14651807 * if errcheck:
14661808 * err = pj_ctx_get_errno(self.projctx) # <<<<<<<<<<<<<<
14691811 */
14701812 __pyx_v_err = pj_ctx_get_errno(__pyx_v_self->projctx);
14711813
1472 /* "_proj.pyx":133
1814 /* "_proj.pyx":146
14731815 * if errcheck:
14741816 * err = pj_ctx_get_errno(self.projctx)
14751817 * if err != 0: # <<<<<<<<<<<<<<
14761818 * raise RuntimeError(pj_strerrno(err))
14771819 * # since HUGE_VAL can be 'inf',
14781820 */
1479 __pyx_t_7 = (__pyx_v_err != 0);
1821 __pyx_t_7 = ((__pyx_v_err != 0) != 0);
14801822 if (__pyx_t_7) {
14811823
1482 /* "_proj.pyx":134
1824 /* "_proj.pyx":147
14831825 * err = pj_ctx_get_errno(self.projctx)
14841826 * if err != 0:
14851827 * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<<
14861828 * # since HUGE_VAL can be 'inf',
14871829 * # change it to a real (but very large) number.
14881830 */
1489 __pyx_t_4 = PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1831 __pyx_t_4 = __Pyx_PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14901832 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
1491 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1833 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14921834 __Pyx_GOTREF(__pyx_t_3);
14931835 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
14941836 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
14951837 __pyx_t_4 = 0;
1496 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1838 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
14971839 __Pyx_GOTREF(__pyx_t_4);
14981840 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
14991841 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
15001842 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1501 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1843 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15021844 goto __pyx_L12;
15031845 }
15041846 __pyx_L12:;
15061848 }
15071849 __pyx_L11:;
15081850
1509 /* "_proj.pyx":138
1851 /* "_proj.pyx":151
15101852 * # change it to a real (but very large) number.
15111853 * # also check for NaNs.
15121854 * if projxyout.u == HUGE_VAL or\ # <<<<<<<<<<<<<<
15131855 * projxyout.u != projxyout.u:
15141856 * if errcheck:
15151857 */
1516 __pyx_t_7 = (__pyx_v_projxyout.u == HUGE_VAL);
1858 __pyx_t_7 = ((__pyx_v_projxyout.u == HUGE_VAL) != 0);
15171859 if (!__pyx_t_7) {
15181860
1519 /* "_proj.pyx":139
1861 /* "_proj.pyx":152
15201862 * # also check for NaNs.
15211863 * if projxyout.u == HUGE_VAL or\
15221864 * projxyout.u != projxyout.u: # <<<<<<<<<<<<<<
15231865 * if errcheck:
15241866 * raise RuntimeError('projection undefined')
15251867 */
1526 __pyx_t_1 = (__pyx_v_projxyout.u != __pyx_v_projxyout.u);
1868 __pyx_t_1 = ((__pyx_v_projxyout.u != __pyx_v_projxyout.u) != 0);
15271869 __pyx_t_6 = __pyx_t_1;
15281870 } else {
15291871 __pyx_t_6 = __pyx_t_7;
15301872 }
15311873 if (__pyx_t_6) {
15321874
1533 /* "_proj.pyx":140
1875 /* "_proj.pyx":153
15341876 * if projxyout.u == HUGE_VAL or\
15351877 * projxyout.u != projxyout.u:
15361878 * if errcheck: # <<<<<<<<<<<<<<
15371879 * raise RuntimeError('projection undefined')
15381880 * lonsdata[i] = 1.e30
15391881 */
1540 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1882 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15411883 if (__pyx_t_6) {
15421884
1543 /* "_proj.pyx":141
1885 /* "_proj.pyx":154
15441886 * projxyout.u != projxyout.u:
15451887 * if errcheck:
15461888 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
15471889 * lonsdata[i] = 1.e30
15481890 * else:
15491891 */
1550 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1892 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15511893 __Pyx_GOTREF(__pyx_t_4);
15521894 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
15531895 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1554 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1896 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
15551897 goto __pyx_L14;
15561898 }
15571899 __pyx_L14:;
15581900
1559 /* "_proj.pyx":142
1901 /* "_proj.pyx":155
15601902 * if errcheck:
15611903 * raise RuntimeError('projection undefined')
15621904 * lonsdata[i] = 1.e30 # <<<<<<<<<<<<<<
15681910 }
15691911 /*else*/ {
15701912
1571 /* "_proj.pyx":144
1913 /* "_proj.pyx":157
15721914 * lonsdata[i] = 1.e30
15731915 * else:
15741916 * lonsdata[i] = projxyout.u # <<<<<<<<<<<<<<
15801922 }
15811923 __pyx_L13:;
15821924
1583 /* "_proj.pyx":145
1925 /* "_proj.pyx":158
15841926 * else:
15851927 * lonsdata[i] = projxyout.u
15861928 * if projxyout.v == HUGE_VAL or\ # <<<<<<<<<<<<<<
15871929 * projxyout.u != projxyout.u:
15881930 * if errcheck:
15891931 */
1590 __pyx_t_6 = (__pyx_v_projxyout.v == HUGE_VAL);
1932 __pyx_t_6 = ((__pyx_v_projxyout.v == HUGE_VAL) != 0);
15911933 if (!__pyx_t_6) {
15921934
1593 /* "_proj.pyx":146
1935 /* "_proj.pyx":159
15941936 * lonsdata[i] = projxyout.u
15951937 * if projxyout.v == HUGE_VAL or\
15961938 * projxyout.u != projxyout.u: # <<<<<<<<<<<<<<
15971939 * if errcheck:
15981940 * raise RuntimeError('projection undefined')
15991941 */
1600 __pyx_t_7 = (__pyx_v_projxyout.u != __pyx_v_projxyout.u);
1942 __pyx_t_7 = ((__pyx_v_projxyout.u != __pyx_v_projxyout.u) != 0);
16011943 __pyx_t_1 = __pyx_t_7;
16021944 } else {
16031945 __pyx_t_1 = __pyx_t_6;
16041946 }
16051947 if (__pyx_t_1) {
16061948
1607 /* "_proj.pyx":147
1949 /* "_proj.pyx":160
16081950 * if projxyout.v == HUGE_VAL or\
16091951 * projxyout.u != projxyout.u:
16101952 * if errcheck: # <<<<<<<<<<<<<<
16111953 * raise RuntimeError('projection undefined')
16121954 * latsdata[i] = 1.e30
16131955 */
1614 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1956 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16151957 if (__pyx_t_1) {
16161958
1617 /* "_proj.pyx":148
1959 /* "_proj.pyx":161
16181960 * projxyout.u != projxyout.u:
16191961 * if errcheck:
16201962 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
16211963 * latsdata[i] = 1.e30
16221964 * else:
16231965 */
1624 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1966 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16251967 __Pyx_GOTREF(__pyx_t_4);
16261968 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
16271969 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1628 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
1970 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
16291971 goto __pyx_L16;
16301972 }
16311973 __pyx_L16:;
16321974
1633 /* "_proj.pyx":149
1975 /* "_proj.pyx":162
16341976 * if errcheck:
16351977 * raise RuntimeError('projection undefined')
16361978 * latsdata[i] = 1.e30 # <<<<<<<<<<<<<<
16421984 }
16431985 /*else*/ {
16441986
1645 /* "_proj.pyx":151
1987 /* "_proj.pyx":164
16461988 * latsdata[i] = 1.e30
16471989 * else:
16481990 * latsdata[i] = projxyout.v # <<<<<<<<<<<<<<
16712013 }
16722014
16732015 /* Python wrapper */
1674 static PyObject *__pyx_pw_5_proj_4Proj_9_inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1675 static char __pyx_doc_5_proj_4Proj_8_inv[] = "\n inverse transformation - x,y to lons,lats (done in place).\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the inverse transformation is invalid.\n if errcheck=False and the inverse transformation is invalid, no exception is\n raised and 1.e30 is returned.\n ";
1676 static PyObject *__pyx_pw_5_proj_4Proj_9_inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2016 static PyObject *__pyx_pw_5_proj_4Proj_11_inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2017 static char __pyx_doc_5_proj_4Proj_10_inv[] = "\n inverse transformation - x,y to lons,lats (done in place).\n if radians=True, lons/lats are radians instead of degrees.\n if errcheck=True, an exception is raised if the inverse transformation is invalid.\n if errcheck=False and the inverse transformation is invalid, no exception is\n raised and 1.e30 is returned.\n ";
2018 static PyObject *__pyx_pw_5_proj_4Proj_11_inv(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16772019 PyObject *__pyx_v_x = 0;
16782020 PyObject *__pyx_v_y = 0;
16792021 PyObject *__pyx_v_radians = 0;
16802022 PyObject *__pyx_v_errcheck = 0;
2023 int __pyx_lineno = 0;
2024 const char *__pyx_filename = NULL;
2025 int __pyx_clineno = 0;
16812026 PyObject *__pyx_r = 0;
16822027 __Pyx_RefNannyDeclarations
16832028 __Pyx_RefNannySetupContext("_inv (wrapper)", 0);
17052050 case 1:
17062051 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
17072052 else {
1708 __Pyx_RaiseArgtupleInvalid("_inv", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2053 __Pyx_RaiseArgtupleInvalid("_inv", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17092054 }
17102055 case 2:
17112056 if (kw_args > 0) {
17192064 }
17202065 }
17212066 if (unlikely(kw_args > 0)) {
1722 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2067 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17232068 }
17242069 } else {
17252070 switch (PyTuple_GET_SIZE(__pyx_args)) {
17382083 }
17392084 goto __pyx_L4_argument_unpacking_done;
17402085 __pyx_L5_argtuple_error:;
1741 __Pyx_RaiseArgtupleInvalid("_inv", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
2086 __Pyx_RaiseArgtupleInvalid("_inv", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
17422087 __pyx_L3_error:;
17432088 __Pyx_AddTraceback("_proj.Proj._inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
17442089 __Pyx_RefNannyFinishContext();
17452090 return NULL;
17462091 __pyx_L4_argument_unpacking_done:;
1747 __pyx_r = __pyx_pf_5_proj_4Proj_8_inv(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_radians, __pyx_v_errcheck);
2092 __pyx_r = __pyx_pf_5_proj_4Proj_10_inv(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self), __pyx_v_x, __pyx_v_y, __pyx_v_radians, __pyx_v_errcheck);
17482093 __Pyx_RefNannyFinishContext();
17492094 return __pyx_r;
17502095 }
17512096
1752 /* "_proj.pyx":153
2097 /* "_proj.pyx":166
17532098 * latsdata[i] = projxyout.v
17542099 *
17552100 * def _inv(self, object x, object y, radians=False, errcheck=False): # <<<<<<<<<<<<<<
17572102 * inverse transformation - x,y to lons,lats (done in place).
17582103 */
17592104
1760 static PyObject *__pyx_pf_5_proj_4Proj_8_inv(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck) {
2105 static PyObject *__pyx_pf_5_proj_4Proj_10_inv(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_radians, PyObject *__pyx_v_errcheck) {
17612106 projUV __pyx_v_projxyin;
17622107 projUV __pyx_v_projlonlatout;
17632108 Py_ssize_t __pyx_v_buflenx;
17842129 int __pyx_clineno = 0;
17852130 __Pyx_RefNannySetupContext("_inv", 0);
17862131
1787 /* "_proj.pyx":167
2132 /* "_proj.pyx":180
17882133 * cdef double *xdatab, *ydatab
17892134 * # if buffer api is supported, get pointer to data buffers.
17902135 * if PyObject_AsWriteBuffer(x, &xdata, &buflenx) <> 0: # <<<<<<<<<<<<<<
17912136 * raise RuntimeError
17922137 * if PyObject_AsWriteBuffer(y, &ydata, &bufleny) <> 0:
17932138 */
1794 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_x, (&__pyx_v_xdata), (&__pyx_v_buflenx)) != 0);
2139 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_x, (&__pyx_v_xdata), (&__pyx_v_buflenx)) != 0) != 0);
17952140 if (__pyx_t_1) {
17962141
1797 /* "_proj.pyx":168
2142 /* "_proj.pyx":181
17982143 * # if buffer api is supported, get pointer to data buffers.
17992144 * if PyObject_AsWriteBuffer(x, &xdata, &buflenx) <> 0:
18002145 * raise RuntimeError # <<<<<<<<<<<<<<
18022147 * raise RuntimeError
18032148 */
18042149 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
1805 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2150 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18062151 goto __pyx_L3;
18072152 }
18082153 __pyx_L3:;
18092154
1810 /* "_proj.pyx":169
2155 /* "_proj.pyx":182
18112156 * if PyObject_AsWriteBuffer(x, &xdata, &buflenx) <> 0:
18122157 * raise RuntimeError
18132158 * if PyObject_AsWriteBuffer(y, &ydata, &bufleny) <> 0: # <<<<<<<<<<<<<<
18142159 * raise RuntimeError
18152160 * # process data in buffer
18162161 */
1817 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_y, (&__pyx_v_ydata), (&__pyx_v_bufleny)) != 0);
2162 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_y, (&__pyx_v_ydata), (&__pyx_v_bufleny)) != 0) != 0);
18182163 if (__pyx_t_1) {
18192164
1820 /* "_proj.pyx":170
2165 /* "_proj.pyx":183
18212166 * raise RuntimeError
18222167 * if PyObject_AsWriteBuffer(y, &ydata, &bufleny) <> 0:
18232168 * raise RuntimeError # <<<<<<<<<<<<<<
18252170 * # (for numpy/regular python arrays).
18262171 */
18272172 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
1828 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2173 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18292174 goto __pyx_L4;
18302175 }
18312176 __pyx_L4:;
18322177
1833 /* "_proj.pyx":173
2178 /* "_proj.pyx":186
18342179 * # process data in buffer
18352180 * # (for numpy/regular python arrays).
18362181 * if buflenx != bufleny: # <<<<<<<<<<<<<<
18372182 * raise RuntimeError("Buffer lengths not the same")
18382183 * ndim = buflenx//_doublesize
18392184 */
1840 __pyx_t_1 = (__pyx_v_buflenx != __pyx_v_bufleny);
2185 __pyx_t_1 = ((__pyx_v_buflenx != __pyx_v_bufleny) != 0);
18412186 if (__pyx_t_1) {
18422187
1843 /* "_proj.pyx":174
2188 /* "_proj.pyx":187
18442189 * # (for numpy/regular python arrays).
18452190 * if buflenx != bufleny:
18462191 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
18472192 * ndim = buflenx//_doublesize
18482193 * xdatab = <double *>xdata
18492194 */
1850 __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2195 __pyx_t_2 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18512196 __Pyx_GOTREF(__pyx_t_2);
18522197 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
18532198 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
1854 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2199 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18552200 goto __pyx_L5;
18562201 }
18572202 __pyx_L5:;
18582203
1859 /* "_proj.pyx":175
2204 /* "_proj.pyx":188
18602205 * if buflenx != bufleny:
18612206 * raise RuntimeError("Buffer lengths not the same")
18622207 * ndim = buflenx//_doublesize # <<<<<<<<<<<<<<
18632208 * xdatab = <double *>xdata
18642209 * ydatab = <double *>ydata
18652210 */
1866 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_buflenx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2211 __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_buflenx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18672212 __Pyx_GOTREF(__pyx_t_2);
1868 __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s___doublesize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2213 __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___doublesize); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18692214 __Pyx_GOTREF(__pyx_t_3);
1870 __pyx_t_4 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2215 __pyx_t_4 = PyNumber_FloorDivide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18712216 __Pyx_GOTREF(__pyx_t_4);
18722217 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18732218 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1874 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2219 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
18752220 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18762221 __pyx_v_ndim = __pyx_t_5;
18772222
1878 /* "_proj.pyx":176
2223 /* "_proj.pyx":189
18792224 * raise RuntimeError("Buffer lengths not the same")
18802225 * ndim = buflenx//_doublesize
18812226 * xdatab = <double *>xdata # <<<<<<<<<<<<<<
18842229 */
18852230 __pyx_v_xdatab = ((double *)__pyx_v_xdata);
18862231
1887 /* "_proj.pyx":177
2232 /* "_proj.pyx":190
18882233 * ndim = buflenx//_doublesize
18892234 * xdatab = <double *>xdata
18902235 * ydatab = <double *>ydata # <<<<<<<<<<<<<<
18932238 */
18942239 __pyx_v_ydatab = ((double *)__pyx_v_ydata);
18952240
1896 /* "_proj.pyx":178
2241 /* "_proj.pyx":191
18972242 * xdatab = <double *>xdata
18982243 * ydatab = <double *>ydata
18992244 * for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
19032248 __pyx_t_5 = __pyx_v_ndim;
19042249 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
19052250
1906 /* "_proj.pyx":180
2251 /* "_proj.pyx":193
19072252 * for i from 0 <= i < ndim:
19082253 * # if inputs are nan's, return big number.
19092254 * if xdatab[i] != xdatab[i] or ydatab[i] != ydatab[i]: # <<<<<<<<<<<<<<
19102255 * xdatab[i]=1.e30; ydatab[i]=1.e30
19112256 * if errcheck:
19122257 */
1913 __pyx_t_1 = ((__pyx_v_xdatab[__pyx_v_i]) != (__pyx_v_xdatab[__pyx_v_i]));
2258 __pyx_t_1 = (((__pyx_v_xdatab[__pyx_v_i]) != (__pyx_v_xdatab[__pyx_v_i])) != 0);
19142259 if (!__pyx_t_1) {
1915 __pyx_t_6 = ((__pyx_v_ydatab[__pyx_v_i]) != (__pyx_v_ydatab[__pyx_v_i]));
2260 __pyx_t_6 = (((__pyx_v_ydatab[__pyx_v_i]) != (__pyx_v_ydatab[__pyx_v_i])) != 0);
19162261 __pyx_t_7 = __pyx_t_6;
19172262 } else {
19182263 __pyx_t_7 = __pyx_t_1;
19192264 }
19202265 if (__pyx_t_7) {
19212266
1922 /* "_proj.pyx":181
2267 /* "_proj.pyx":194
19232268 * # if inputs are nan's, return big number.
19242269 * if xdatab[i] != xdatab[i] or ydatab[i] != ydatab[i]:
19252270 * xdatab[i]=1.e30; ydatab[i]=1.e30 # <<<<<<<<<<<<<<
19292274 (__pyx_v_xdatab[__pyx_v_i]) = 1.e30;
19302275 (__pyx_v_ydatab[__pyx_v_i]) = 1.e30;
19312276
1932 /* "_proj.pyx":182
2277 /* "_proj.pyx":195
19332278 * if xdatab[i] != xdatab[i] or ydatab[i] != ydatab[i]:
19342279 * xdatab[i]=1.e30; ydatab[i]=1.e30
19352280 * if errcheck: # <<<<<<<<<<<<<<
19362281 * raise RuntimeError('projection undefined')
19372282 * continue
19382283 */
1939 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2284 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19402285 if (__pyx_t_7) {
19412286
1942 /* "_proj.pyx":183
2287 /* "_proj.pyx":196
19432288 * xdatab[i]=1.e30; ydatab[i]=1.e30
19442289 * if errcheck:
19452290 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
19462291 * continue
19472292 * projxyin.u = xdatab[i]
19482293 */
1949 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2294 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19502295 __Pyx_GOTREF(__pyx_t_4);
19512296 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
19522297 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1953 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2298 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
19542299 goto __pyx_L9;
19552300 }
19562301 __pyx_L9:;
19572302
1958 /* "_proj.pyx":184
2303 /* "_proj.pyx":197
19592304 * if errcheck:
19602305 * raise RuntimeError('projection undefined')
19612306 * continue # <<<<<<<<<<<<<<
19672312 }
19682313 __pyx_L8:;
19692314
1970 /* "_proj.pyx":185
2315 /* "_proj.pyx":198
19712316 * raise RuntimeError('projection undefined')
19722317 * continue
19732318 * projxyin.u = xdatab[i] # <<<<<<<<<<<<<<
19762321 */
19772322 __pyx_v_projxyin.u = (__pyx_v_xdatab[__pyx_v_i]);
19782323
1979 /* "_proj.pyx":186
2324 /* "_proj.pyx":199
19802325 * continue
19812326 * projxyin.u = xdatab[i]
19822327 * projxyin.v = ydatab[i] # <<<<<<<<<<<<<<
19852330 */
19862331 __pyx_v_projxyin.v = (__pyx_v_ydatab[__pyx_v_i]);
19872332
1988 /* "_proj.pyx":187
2333 /* "_proj.pyx":200
19892334 * projxyin.u = xdatab[i]
19902335 * projxyin.v = ydatab[i]
19912336 * projlonlatout = pj_inv(projxyin,self.projpj) # <<<<<<<<<<<<<<
19942339 */
19952340 __pyx_v_projlonlatout = pj_inv(__pyx_v_projxyin, __pyx_v_self->projpj);
19962341
1997 /* "_proj.pyx":188
2342 /* "_proj.pyx":201
19982343 * projxyin.v = ydatab[i]
19992344 * projlonlatout = pj_inv(projxyin,self.projpj)
20002345 * if errcheck: # <<<<<<<<<<<<<<
20012346 * err = pj_ctx_get_errno(self.projctx)
20022347 * if err != 0:
20032348 */
2004 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2349 __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20052350 if (__pyx_t_7) {
20062351
2007 /* "_proj.pyx":189
2352 /* "_proj.pyx":202
20082353 * projlonlatout = pj_inv(projxyin,self.projpj)
20092354 * if errcheck:
20102355 * err = pj_ctx_get_errno(self.projctx) # <<<<<<<<<<<<<<
20132358 */
20142359 __pyx_v_err = pj_ctx_get_errno(__pyx_v_self->projctx);
20152360
2016 /* "_proj.pyx":190
2361 /* "_proj.pyx":203
20172362 * if errcheck:
20182363 * err = pj_ctx_get_errno(self.projctx)
20192364 * if err != 0: # <<<<<<<<<<<<<<
20202365 * raise RuntimeError(pj_strerrno(err))
20212366 * # since HUGE_VAL can be 'inf',
20222367 */
2023 __pyx_t_7 = (__pyx_v_err != 0);
2368 __pyx_t_7 = ((__pyx_v_err != 0) != 0);
20242369 if (__pyx_t_7) {
20252370
2026 /* "_proj.pyx":191
2371 /* "_proj.pyx":204
20272372 * err = pj_ctx_get_errno(self.projctx)
20282373 * if err != 0:
20292374 * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<<
20302375 * # since HUGE_VAL can be 'inf',
20312376 * # change it to a real (but very large) number.
20322377 */
2033 __pyx_t_4 = PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2378 __pyx_t_4 = __Pyx_PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20342379 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
2035 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2380 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20362381 __Pyx_GOTREF(__pyx_t_3);
20372382 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
20382383 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
20392384 __pyx_t_4 = 0;
2040 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2385 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20412386 __Pyx_GOTREF(__pyx_t_4);
20422387 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
20432388 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20442389 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2045 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2390 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20462391 goto __pyx_L11;
20472392 }
20482393 __pyx_L11:;
20502395 }
20512396 __pyx_L10:;
20522397
2053 /* "_proj.pyx":195
2398 /* "_proj.pyx":208
20542399 * # change it to a real (but very large) number.
20552400 * # also check for NaNs.
20562401 * if projlonlatout.u == HUGE_VAL or \ # <<<<<<<<<<<<<<
20572402 * projlonlatout.u != projlonlatout.u:
20582403 * if errcheck:
20592404 */
2060 __pyx_t_7 = (__pyx_v_projlonlatout.u == HUGE_VAL);
2405 __pyx_t_7 = ((__pyx_v_projlonlatout.u == HUGE_VAL) != 0);
20612406 if (!__pyx_t_7) {
20622407
2063 /* "_proj.pyx":196
2408 /* "_proj.pyx":209
20642409 * # also check for NaNs.
20652410 * if projlonlatout.u == HUGE_VAL or \
20662411 * projlonlatout.u != projlonlatout.u: # <<<<<<<<<<<<<<
20672412 * if errcheck:
20682413 * raise RuntimeError('projection undefined')
20692414 */
2070 __pyx_t_1 = (__pyx_v_projlonlatout.u != __pyx_v_projlonlatout.u);
2415 __pyx_t_1 = ((__pyx_v_projlonlatout.u != __pyx_v_projlonlatout.u) != 0);
20712416 __pyx_t_6 = __pyx_t_1;
20722417 } else {
20732418 __pyx_t_6 = __pyx_t_7;
20742419 }
20752420 if (__pyx_t_6) {
20762421
2077 /* "_proj.pyx":197
2422 /* "_proj.pyx":210
20782423 * if projlonlatout.u == HUGE_VAL or \
20792424 * projlonlatout.u != projlonlatout.u:
20802425 * if errcheck: # <<<<<<<<<<<<<<
20812426 * raise RuntimeError('projection undefined')
20822427 * xdatab[i] = 1.e30
20832428 */
2084 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2429 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20852430 if (__pyx_t_6) {
20862431
2087 /* "_proj.pyx":198
2432 /* "_proj.pyx":211
20882433 * projlonlatout.u != projlonlatout.u:
20892434 * if errcheck:
20902435 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
20912436 * xdatab[i] = 1.e30
20922437 * elif radians:
20932438 */
2094 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2439 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20952440 __Pyx_GOTREF(__pyx_t_4);
20962441 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
20972442 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2098 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2443 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
20992444 goto __pyx_L13;
21002445 }
21012446 __pyx_L13:;
21022447
2103 /* "_proj.pyx":199
2448 /* "_proj.pyx":212
21042449 * if errcheck:
21052450 * raise RuntimeError('projection undefined')
21062451 * xdatab[i] = 1.e30 # <<<<<<<<<<<<<<
21112456 goto __pyx_L12;
21122457 }
21132458
2114 /* "_proj.pyx":200
2459 /* "_proj.pyx":213
21152460 * raise RuntimeError('projection undefined')
21162461 * xdatab[i] = 1.e30
21172462 * elif radians: # <<<<<<<<<<<<<<
21182463 * xdatab[i] = projlonlatout.u
21192464 * else:
21202465 */
2121 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2466 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21222467 if (__pyx_t_6) {
21232468
2124 /* "_proj.pyx":201
2469 /* "_proj.pyx":214
21252470 * xdatab[i] = 1.e30
21262471 * elif radians:
21272472 * xdatab[i] = projlonlatout.u # <<<<<<<<<<<<<<
21342479 }
21352480 /*else*/ {
21362481
2137 /* "_proj.pyx":203
2482 /* "_proj.pyx":216
21382483 * xdatab[i] = projlonlatout.u
21392484 * else:
21402485 * xdatab[i] = _rad2dg*projlonlatout.u # <<<<<<<<<<<<<<
21452490 }
21462491 __pyx_L12:;
21472492
2148 /* "_proj.pyx":204
2493 /* "_proj.pyx":217
21492494 * else:
21502495 * xdatab[i] = _rad2dg*projlonlatout.u
21512496 * if projlonlatout.v == HUGE_VAL or \ # <<<<<<<<<<<<<<
21522497 * projlonlatout.v != projlonlatout.v:
21532498 * if errcheck:
21542499 */
2155 __pyx_t_6 = (__pyx_v_projlonlatout.v == HUGE_VAL);
2500 __pyx_t_6 = ((__pyx_v_projlonlatout.v == HUGE_VAL) != 0);
21562501 if (!__pyx_t_6) {
21572502
2158 /* "_proj.pyx":205
2503 /* "_proj.pyx":218
21592504 * xdatab[i] = _rad2dg*projlonlatout.u
21602505 * if projlonlatout.v == HUGE_VAL or \
21612506 * projlonlatout.v != projlonlatout.v: # <<<<<<<<<<<<<<
21622507 * if errcheck:
21632508 * raise RuntimeError('projection undefined')
21642509 */
2165 __pyx_t_7 = (__pyx_v_projlonlatout.v != __pyx_v_projlonlatout.v);
2510 __pyx_t_7 = ((__pyx_v_projlonlatout.v != __pyx_v_projlonlatout.v) != 0);
21662511 __pyx_t_1 = __pyx_t_7;
21672512 } else {
21682513 __pyx_t_1 = __pyx_t_6;
21692514 }
21702515 if (__pyx_t_1) {
21712516
2172 /* "_proj.pyx":206
2517 /* "_proj.pyx":219
21732518 * if projlonlatout.v == HUGE_VAL or \
21742519 * projlonlatout.v != projlonlatout.v:
21752520 * if errcheck: # <<<<<<<<<<<<<<
21762521 * raise RuntimeError('projection undefined')
21772522 * ydatab[i] = 1.e30
21782523 */
2179 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2524 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_errcheck); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21802525 if (__pyx_t_1) {
21812526
2182 /* "_proj.pyx":207
2527 /* "_proj.pyx":220
21832528 * projlonlatout.v != projlonlatout.v:
21842529 * if errcheck:
21852530 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
21862531 * ydatab[i] = 1.e30
21872532 * elif radians:
21882533 */
2189 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2534 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21902535 __Pyx_GOTREF(__pyx_t_4);
21912536 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
21922537 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2193 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2538 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
21942539 goto __pyx_L15;
21952540 }
21962541 __pyx_L15:;
21972542
2198 /* "_proj.pyx":208
2543 /* "_proj.pyx":221
21992544 * if errcheck:
22002545 * raise RuntimeError('projection undefined')
22012546 * ydatab[i] = 1.e30 # <<<<<<<<<<<<<<
22062551 goto __pyx_L14;
22072552 }
22082553
2209 /* "_proj.pyx":209
2554 /* "_proj.pyx":222
22102555 * raise RuntimeError('projection undefined')
22112556 * ydatab[i] = 1.e30
22122557 * elif radians: # <<<<<<<<<<<<<<
22132558 * ydatab[i] = projlonlatout.v
22142559 * else:
22152560 */
2216 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2561 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
22172562 if (__pyx_t_1) {
22182563
2219 /* "_proj.pyx":210
2564 /* "_proj.pyx":223
22202565 * ydatab[i] = 1.e30
22212566 * elif radians:
22222567 * ydatab[i] = projlonlatout.v # <<<<<<<<<<<<<<
22292574 }
22302575 /*else*/ {
22312576
2232 /* "_proj.pyx":212
2577 /* "_proj.pyx":225
22332578 * ydatab[i] = projlonlatout.v
22342579 * else:
22352580 * ydatab[i] = _rad2dg*projlonlatout.v # <<<<<<<<<<<<<<
22572602 }
22582603
22592604 /* Python wrapper */
2260 static PyObject *__pyx_pw_5_proj_4Proj_11is_latlong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2261 static PyObject *__pyx_pw_5_proj_4Proj_11is_latlong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2605 static PyObject *__pyx_pw_5_proj_4Proj_13is_latlong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2606 static PyObject *__pyx_pw_5_proj_4Proj_13is_latlong(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
22622607 PyObject *__pyx_r = 0;
22632608 __Pyx_RefNannyDeclarations
22642609 __Pyx_RefNannySetupContext("is_latlong (wrapper)", 0);
2265 __pyx_r = __pyx_pf_5_proj_4Proj_10is_latlong(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self));
2610 __pyx_r = __pyx_pf_5_proj_4Proj_12is_latlong(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self));
22662611 __Pyx_RefNannyFinishContext();
22672612 return __pyx_r;
22682613 }
22692614
2270 /* "_proj.pyx":291
2615 /* "_proj.pyx":304
22712616 * # llptr[i].v = _rad2dg*projlonlatout.v
22722617 *
22732618 * def is_latlong(self): # <<<<<<<<<<<<<<
22752620 * cdef int i
22762621 */
22772622
2278 static PyObject *__pyx_pf_5_proj_4Proj_10is_latlong(struct __pyx_obj_5_proj_Proj *__pyx_v_self) {
2623 static PyObject *__pyx_pf_5_proj_4Proj_12is_latlong(struct __pyx_obj_5_proj_Proj *__pyx_v_self) {
22792624 int __pyx_v_i;
22802625 PyObject *__pyx_r = NULL;
22812626 __Pyx_RefNannyDeclarations
2282 PyObject *__pyx_t_1 = NULL;
2627 int __pyx_t_1;
2628 PyObject *__pyx_t_2 = NULL;
22832629 int __pyx_lineno = 0;
22842630 const char *__pyx_filename = NULL;
22852631 int __pyx_clineno = 0;
22862632 __Pyx_RefNannySetupContext("is_latlong", 0);
22872633
2288 /* "_proj.pyx":294
2634 /* "_proj.pyx":307
22892635 * # returns True if projection in geographic (lon/lat) coordinates
22902636 * cdef int i
22912637 * i = pj_is_latlong(self.projpj) # <<<<<<<<<<<<<<
22942640 */
22952641 __pyx_v_i = pj_is_latlong(__pyx_v_self->projpj);
22962642
2297 /* "_proj.pyx":295
2643 /* "_proj.pyx":308
22982644 * cdef int i
22992645 * i = pj_is_latlong(self.projpj)
23002646 * if i: # <<<<<<<<<<<<<<
23012647 * return True
23022648 * else:
23032649 */
2304 if (__pyx_v_i) {
2305
2306 /* "_proj.pyx":296
2650 __pyx_t_1 = (__pyx_v_i != 0);
2651 if (__pyx_t_1) {
2652
2653 /* "_proj.pyx":309
23072654 * i = pj_is_latlong(self.projpj)
23082655 * if i:
23092656 * return True # <<<<<<<<<<<<<<
23112658 * return False
23122659 */
23132660 __Pyx_XDECREF(__pyx_r);
2314 __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2315 __Pyx_GOTREF(__pyx_t_1);
2316 __pyx_r = __pyx_t_1;
2317 __pyx_t_1 = 0;
2661 __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2662 __Pyx_GOTREF(__pyx_t_2);
2663 __pyx_r = __pyx_t_2;
2664 __pyx_t_2 = 0;
23182665 goto __pyx_L0;
23192666 goto __pyx_L3;
23202667 }
23212668 /*else*/ {
23222669
2323 /* "_proj.pyx":298
2670 /* "_proj.pyx":311
23242671 * return True
23252672 * else:
23262673 * return False # <<<<<<<<<<<<<<
23282675 * def is_geocent(self):
23292676 */
23302677 __Pyx_XDECREF(__pyx_r);
2331 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2332 __Pyx_GOTREF(__pyx_t_1);
2333 __pyx_r = __pyx_t_1;
2334 __pyx_t_1 = 0;
2678 __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2679 __Pyx_GOTREF(__pyx_t_2);
2680 __pyx_r = __pyx_t_2;
2681 __pyx_t_2 = 0;
23352682 goto __pyx_L0;
23362683 }
23372684 __pyx_L3:;
23392686 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
23402687 goto __pyx_L0;
23412688 __pyx_L1_error:;
2342 __Pyx_XDECREF(__pyx_t_1);
2689 __Pyx_XDECREF(__pyx_t_2);
23432690 __Pyx_AddTraceback("_proj.Proj.is_latlong", __pyx_clineno, __pyx_lineno, __pyx_filename);
23442691 __pyx_r = NULL;
23452692 __pyx_L0:;
23492696 }
23502697
23512698 /* Python wrapper */
2352 static PyObject *__pyx_pw_5_proj_4Proj_13is_geocent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2353 static PyObject *__pyx_pw_5_proj_4Proj_13is_geocent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2699 static PyObject *__pyx_pw_5_proj_4Proj_15is_geocent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2700 static PyObject *__pyx_pw_5_proj_4Proj_15is_geocent(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
23542701 PyObject *__pyx_r = 0;
23552702 __Pyx_RefNannyDeclarations
23562703 __Pyx_RefNannySetupContext("is_geocent (wrapper)", 0);
2357 __pyx_r = __pyx_pf_5_proj_4Proj_12is_geocent(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self));
2704 __pyx_r = __pyx_pf_5_proj_4Proj_14is_geocent(((struct __pyx_obj_5_proj_Proj *)__pyx_v_self));
23582705 __Pyx_RefNannyFinishContext();
23592706 return __pyx_r;
23602707 }
23612708
2362 /* "_proj.pyx":300
2709 /* "_proj.pyx":313
23632710 * return False
23642711 *
23652712 * def is_geocent(self): # <<<<<<<<<<<<<<
23672714 * cdef int i
23682715 */
23692716
2370 static PyObject *__pyx_pf_5_proj_4Proj_12is_geocent(struct __pyx_obj_5_proj_Proj *__pyx_v_self) {
2717 static PyObject *__pyx_pf_5_proj_4Proj_14is_geocent(struct __pyx_obj_5_proj_Proj *__pyx_v_self) {
23712718 int __pyx_v_i;
23722719 PyObject *__pyx_r = NULL;
23732720 __Pyx_RefNannyDeclarations
2374 PyObject *__pyx_t_1 = NULL;
2721 int __pyx_t_1;
2722 PyObject *__pyx_t_2 = NULL;
23752723 int __pyx_lineno = 0;
23762724 const char *__pyx_filename = NULL;
23772725 int __pyx_clineno = 0;
23782726 __Pyx_RefNannySetupContext("is_geocent", 0);
23792727
2380 /* "_proj.pyx":303
2728 /* "_proj.pyx":316
23812729 * # returns True if projection in geocentric (x/y) coordinates
23822730 * cdef int i
23832731 * i = pj_is_geocent(self.projpj) # <<<<<<<<<<<<<<
23862734 */
23872735 __pyx_v_i = pj_is_geocent(__pyx_v_self->projpj);
23882736
2389 /* "_proj.pyx":304
2737 /* "_proj.pyx":317
23902738 * cdef int i
23912739 * i = pj_is_geocent(self.projpj)
23922740 * if i: # <<<<<<<<<<<<<<
23932741 * return True
23942742 * else:
23952743 */
2396 if (__pyx_v_i) {
2397
2398 /* "_proj.pyx":305
2744 __pyx_t_1 = (__pyx_v_i != 0);
2745 if (__pyx_t_1) {
2746
2747 /* "_proj.pyx":318
23992748 * i = pj_is_geocent(self.projpj)
24002749 * if i:
24012750 * return True # <<<<<<<<<<<<<<
24032752 * return False
24042753 */
24052754 __Pyx_XDECREF(__pyx_r);
2406 __pyx_t_1 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2407 __Pyx_GOTREF(__pyx_t_1);
2408 __pyx_r = __pyx_t_1;
2409 __pyx_t_1 = 0;
2755 __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2756 __Pyx_GOTREF(__pyx_t_2);
2757 __pyx_r = __pyx_t_2;
2758 __pyx_t_2 = 0;
24102759 goto __pyx_L0;
24112760 goto __pyx_L3;
24122761 }
24132762 /*else*/ {
24142763
2415 /* "_proj.pyx":307
2764 /* "_proj.pyx":320
24162765 * return True
24172766 * else:
24182767 * return False # <<<<<<<<<<<<<<
24202769 * def _transform(Proj p1, Proj p2, inx, iny, inz, radians):
24212770 */
24222771 __Pyx_XDECREF(__pyx_r);
2423 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2424 __Pyx_GOTREF(__pyx_t_1);
2425 __pyx_r = __pyx_t_1;
2426 __pyx_t_1 = 0;
2772 __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2773 __Pyx_GOTREF(__pyx_t_2);
2774 __pyx_r = __pyx_t_2;
2775 __pyx_t_2 = 0;
24272776 goto __pyx_L0;
24282777 }
24292778 __pyx_L3:;
24312780 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
24322781 goto __pyx_L0;
24332782 __pyx_L1_error:;
2434 __Pyx_XDECREF(__pyx_t_1);
2783 __Pyx_XDECREF(__pyx_t_2);
24352784 __Pyx_AddTraceback("_proj.Proj.is_geocent", __pyx_clineno, __pyx_lineno, __pyx_filename);
24362785 __pyx_r = NULL;
24372786 __pyx_L0:;
24512800 return __pyx_r;
24522801 }
24532802
2454 /* "_proj.pyx":65
2803 /* "_proj.pyx":69
24552804 * cdef projPJ projpj
24562805 * cdef projCtx projctx
24572806 * cdef public object proj_version # <<<<<<<<<<<<<<
25382887 return __pyx_r;
25392888 }
25402889
2541 /* "_proj.pyx":67
2890 /* "_proj.pyx":71
25422891 * cdef public object proj_version
25432892 * cdef char *pjinitstring
25442893 * cdef public object srs # <<<<<<<<<<<<<<
26152964 }
26162965
26172966 /* Python wrapper */
2618 static PyObject *__pyx_pw_5_proj_3_transform(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2619 static PyMethodDef __pyx_mdef_5_proj_3_transform = {__Pyx_NAMESTR("_transform"), (PyCFunction)__pyx_pw_5_proj_3_transform, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
2620 static PyObject *__pyx_pw_5_proj_3_transform(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2967 static PyObject *__pyx_pw_5_proj_5_transform(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2968 static PyMethodDef __pyx_mdef_5_proj_5_transform = {__Pyx_NAMESTR("_transform"), (PyCFunction)__pyx_pw_5_proj_5_transform, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
2969 static PyObject *__pyx_pw_5_proj_5_transform(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
26212970 struct __pyx_obj_5_proj_Proj *__pyx_v_p1 = 0;
26222971 struct __pyx_obj_5_proj_Proj *__pyx_v_p2 = 0;
26232972 PyObject *__pyx_v_inx = 0;
26242973 PyObject *__pyx_v_iny = 0;
26252974 PyObject *__pyx_v_inz = 0;
26262975 PyObject *__pyx_v_radians = 0;
2976 int __pyx_lineno = 0;
2977 const char *__pyx_filename = NULL;
2978 int __pyx_clineno = 0;
26272979 PyObject *__pyx_r = 0;
26282980 __Pyx_RefNannyDeclarations
26292981 __Pyx_RefNannySetupContext("_transform (wrapper)", 0);
26513003 case 1:
26523004 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p2)) != 0)) kw_args--;
26533005 else {
2654 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3006 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26553007 }
26563008 case 2:
26573009 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__inx)) != 0)) kw_args--;
26583010 else {
2659 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3011 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26603012 }
26613013 case 3:
26623014 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iny)) != 0)) kw_args--;
26633015 else {
2664 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3016 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26653017 }
26663018 case 4:
26673019 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__inz)) != 0)) kw_args--;
26683020 else {
2669 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3021 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26703022 }
26713023 case 5:
26723024 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__radians)) != 0)) kw_args--;
26733025 else {
2674 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3026 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26753027 }
26763028 }
26773029 if (unlikely(kw_args > 0)) {
2678 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_transform") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3030 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_transform") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
26793031 }
26803032 } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
26813033 goto __pyx_L5_argtuple_error;
26963048 }
26973049 goto __pyx_L4_argument_unpacking_done;
26983050 __pyx_L5_argtuple_error:;
2699 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3051 __Pyx_RaiseArgtupleInvalid("_transform", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
27003052 __pyx_L3_error:;
27013053 __Pyx_AddTraceback("_proj._transform", __pyx_clineno, __pyx_lineno, __pyx_filename);
27023054 __Pyx_RefNannyFinishContext();
27033055 return NULL;
27043056 __pyx_L4_argument_unpacking_done:;
2705 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p1), __pyx_ptype_5_proj_Proj, 1, "p1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2706 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p2), __pyx_ptype_5_proj_Proj, 1, "p2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
2707 __pyx_r = __pyx_pf_5_proj_2_transform(__pyx_self, __pyx_v_p1, __pyx_v_p2, __pyx_v_inx, __pyx_v_iny, __pyx_v_inz, __pyx_v_radians);
3057 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p1), __pyx_ptype_5_proj_Proj, 1, "p1", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3058 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_p2), __pyx_ptype_5_proj_Proj, 1, "p2", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3059 __pyx_r = __pyx_pf_5_proj_4_transform(__pyx_self, __pyx_v_p1, __pyx_v_p2, __pyx_v_inx, __pyx_v_iny, __pyx_v_inz, __pyx_v_radians);
27083060 goto __pyx_L0;
27093061 __pyx_L1_error:;
27103062 __pyx_r = NULL;
27133065 return __pyx_r;
27143066 }
27153067
2716 /* "_proj.pyx":309
3068 /* "_proj.pyx":322
27173069 * return False
27183070 *
27193071 * def _transform(Proj p1, Proj p2, inx, iny, inz, radians): # <<<<<<<<<<<<<<
27213073 * cdef void *xdata, *ydata, *zdata
27223074 */
27233075
2724 static PyObject *__pyx_pf_5_proj_2_transform(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5_proj_Proj *__pyx_v_p1, struct __pyx_obj_5_proj_Proj *__pyx_v_p2, PyObject *__pyx_v_inx, PyObject *__pyx_v_iny, PyObject *__pyx_v_inz, PyObject *__pyx_v_radians) {
3076 static PyObject *__pyx_pf_5_proj_4_transform(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_5_proj_Proj *__pyx_v_p1, struct __pyx_obj_5_proj_Proj *__pyx_v_p2, PyObject *__pyx_v_inx, PyObject *__pyx_v_iny, PyObject *__pyx_v_inz, PyObject *__pyx_v_radians) {
27253077 void *__pyx_v_xdata;
27263078 void *__pyx_v_ydata;
27273079 void *__pyx_v_zdata;
27473099 int __pyx_clineno = 0;
27483100 __Pyx_RefNannySetupContext("_transform", 0);
27493101
2750 /* "_proj.pyx":315
3102 /* "_proj.pyx":328
27513103 * cdef Py_ssize_t buflenx, bufleny, buflenz, npts, i
27523104 * cdef int err
27533105 * if PyObject_AsWriteBuffer(inx, &xdata, &buflenx) <> 0: # <<<<<<<<<<<<<<
27543106 * raise RuntimeError
27553107 * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0:
27563108 */
2757 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_inx, (&__pyx_v_xdata), (&__pyx_v_buflenx)) != 0);
3109 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_inx, (&__pyx_v_xdata), (&__pyx_v_buflenx)) != 0) != 0);
27583110 if (__pyx_t_1) {
27593111
2760 /* "_proj.pyx":316
3112 /* "_proj.pyx":329
27613113 * cdef int err
27623114 * if PyObject_AsWriteBuffer(inx, &xdata, &buflenx) <> 0:
27633115 * raise RuntimeError # <<<<<<<<<<<<<<
27653117 * raise RuntimeError
27663118 */
27673119 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
2768 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3120 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27693121 goto __pyx_L3;
27703122 }
27713123 __pyx_L3:;
27723124
2773 /* "_proj.pyx":317
3125 /* "_proj.pyx":330
27743126 * if PyObject_AsWriteBuffer(inx, &xdata, &buflenx) <> 0:
27753127 * raise RuntimeError
27763128 * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0: # <<<<<<<<<<<<<<
27773129 * raise RuntimeError
27783130 * if inz is not None:
27793131 */
2780 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_iny, (&__pyx_v_ydata), (&__pyx_v_bufleny)) != 0);
3132 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_iny, (&__pyx_v_ydata), (&__pyx_v_bufleny)) != 0) != 0);
27813133 if (__pyx_t_1) {
27823134
2783 /* "_proj.pyx":318
3135 /* "_proj.pyx":331
27843136 * raise RuntimeError
27853137 * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0:
27863138 * raise RuntimeError # <<<<<<<<<<<<<<
27883140 * if PyObject_AsWriteBuffer(inz, &zdata, &buflenz) <> 0:
27893141 */
27903142 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
2791 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3143 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
27923144 goto __pyx_L4;
27933145 }
27943146 __pyx_L4:;
27953147
2796 /* "_proj.pyx":319
3148 /* "_proj.pyx":332
27973149 * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0:
27983150 * raise RuntimeError
27993151 * if inz is not None: # <<<<<<<<<<<<<<
28013153 * raise RuntimeError
28023154 */
28033155 __pyx_t_1 = (__pyx_v_inz != Py_None);
2804 if (__pyx_t_1) {
2805
2806 /* "_proj.pyx":320
3156 __pyx_t_2 = (__pyx_t_1 != 0);
3157 if (__pyx_t_2) {
3158
3159 /* "_proj.pyx":333
28073160 * raise RuntimeError
28083161 * if inz is not None:
28093162 * if PyObject_AsWriteBuffer(inz, &zdata, &buflenz) <> 0: # <<<<<<<<<<<<<<
28103163 * raise RuntimeError
28113164 * else:
28123165 */
2813 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_inz, (&__pyx_v_zdata), (&__pyx_v_buflenz)) != 0);
2814 if (__pyx_t_1) {
2815
2816 /* "_proj.pyx":321
3166 __pyx_t_2 = ((PyObject_AsWriteBuffer(__pyx_v_inz, (&__pyx_v_zdata), (&__pyx_v_buflenz)) != 0) != 0);
3167 if (__pyx_t_2) {
3168
3169 /* "_proj.pyx":334
28173170 * if inz is not None:
28183171 * if PyObject_AsWriteBuffer(inz, &zdata, &buflenz) <> 0:
28193172 * raise RuntimeError # <<<<<<<<<<<<<<
28213174 * buflenz = bufleny
28223175 */
28233176 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
2824 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3177 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28253178 goto __pyx_L6;
28263179 }
28273180 __pyx_L6:;
28293182 }
28303183 /*else*/ {
28313184
2832 /* "_proj.pyx":323
3185 /* "_proj.pyx":336
28333186 * raise RuntimeError
28343187 * else:
28353188 * buflenz = bufleny # <<<<<<<<<<<<<<
28403193 }
28413194 __pyx_L5:;
28423195
2843 /* "_proj.pyx":324
3196 /* "_proj.pyx":337
28443197 * else:
28453198 * buflenz = bufleny
28463199 * if not (buflenx == bufleny == buflenz): # <<<<<<<<<<<<<<
28473200 * raise RuntimeError('x,y and z must be same size')
28483201 * xx = <double *>xdata
28493202 */
2850 __pyx_t_1 = (__pyx_v_buflenx == __pyx_v_bufleny);
3203 __pyx_t_2 = (__pyx_v_buflenx == __pyx_v_bufleny);
3204 if (__pyx_t_2) {
3205 __pyx_t_2 = (__pyx_v_bufleny == __pyx_v_buflenz);
3206 }
3207 __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
28513208 if (__pyx_t_1) {
2852 __pyx_t_1 = (__pyx_v_bufleny == __pyx_v_buflenz);
2853 }
2854 __pyx_t_2 = (!__pyx_t_1);
2855 if (__pyx_t_2) {
2856
2857 /* "_proj.pyx":325
3209
3210 /* "_proj.pyx":338
28583211 * buflenz = bufleny
28593212 * if not (buflenx == bufleny == buflenz):
28603213 * raise RuntimeError('x,y and z must be same size') # <<<<<<<<<<<<<<
28613214 * xx = <double *>xdata
28623215 * yy = <double *>ydata
28633216 */
2864 __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3217 __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28653218 __Pyx_GOTREF(__pyx_t_3);
28663219 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
28673220 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2868 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3221 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
28693222 goto __pyx_L7;
28703223 }
28713224 __pyx_L7:;
28723225
2873 /* "_proj.pyx":326
3226 /* "_proj.pyx":339
28743227 * if not (buflenx == bufleny == buflenz):
28753228 * raise RuntimeError('x,y and z must be same size')
28763229 * xx = <double *>xdata # <<<<<<<<<<<<<<
28793232 */
28803233 __pyx_v_xx = ((double *)__pyx_v_xdata);
28813234
2882 /* "_proj.pyx":327
3235 /* "_proj.pyx":340
28833236 * raise RuntimeError('x,y and z must be same size')
28843237 * xx = <double *>xdata
28853238 * yy = <double *>ydata # <<<<<<<<<<<<<<
28883241 */
28893242 __pyx_v_yy = ((double *)__pyx_v_ydata);
28903243
2891 /* "_proj.pyx":328
3244 /* "_proj.pyx":341
28923245 * xx = <double *>xdata
28933246 * yy = <double *>ydata
28943247 * if inz is not None: # <<<<<<<<<<<<<<
28953248 * zz = <double *>zdata
28963249 * npts = buflenx/8
28973250 */
2898 __pyx_t_2 = (__pyx_v_inz != Py_None);
3251 __pyx_t_1 = (__pyx_v_inz != Py_None);
3252 __pyx_t_2 = (__pyx_t_1 != 0);
28993253 if (__pyx_t_2) {
29003254
2901 /* "_proj.pyx":329
3255 /* "_proj.pyx":342
29023256 * yy = <double *>ydata
29033257 * if inz is not None:
29043258 * zz = <double *>zdata # <<<<<<<<<<<<<<
29103264 }
29113265 __pyx_L8:;
29123266
2913 /* "_proj.pyx":330
3267 /* "_proj.pyx":343
29143268 * if inz is not None:
29153269 * zz = <double *>zdata
29163270 * npts = buflenx/8 # <<<<<<<<<<<<<<
29193273 */
29203274 __pyx_v_npts = __Pyx_div_Py_ssize_t(__pyx_v_buflenx, 8);
29213275
2922 /* "_proj.pyx":331
3276 /* "_proj.pyx":344
29233277 * zz = <double *>zdata
29243278 * npts = buflenx/8
29253279 * if not radians and p1.is_latlong(): # <<<<<<<<<<<<<<
29263280 * for i from 0 <= i < npts:
29273281 * xx[i] = xx[i]*_dg2rad
29283282 */
2929 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3283 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29303284 __pyx_t_1 = (!__pyx_t_2);
29313285 if (__pyx_t_1) {
2932 __pyx_t_3 = PyObject_GetAttr(((PyObject *)__pyx_v_p1), __pyx_n_s__is_latlong); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3286 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p1), __pyx_n_s__is_latlong); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29333287 __Pyx_GOTREF(__pyx_t_3);
2934 __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3288 __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29353289 __Pyx_GOTREF(__pyx_t_4);
29363290 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2937 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3291 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
29383292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
29393293 __pyx_t_5 = __pyx_t_2;
29403294 } else {
29423296 }
29433297 if (__pyx_t_5) {
29443298
2945 /* "_proj.pyx":332
3299 /* "_proj.pyx":345
29463300 * npts = buflenx/8
29473301 * if not radians and p1.is_latlong():
29483302 * for i from 0 <= i < npts: # <<<<<<<<<<<<<<
29523306 __pyx_t_6 = __pyx_v_npts;
29533307 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
29543308
2955 /* "_proj.pyx":333
3309 /* "_proj.pyx":346
29563310 * if not radians and p1.is_latlong():
29573311 * for i from 0 <= i < npts:
29583312 * xx[i] = xx[i]*_dg2rad # <<<<<<<<<<<<<<
29613315 */
29623316 (__pyx_v_xx[__pyx_v_i]) = ((__pyx_v_xx[__pyx_v_i]) * __pyx_v_5_proj__dg2rad);
29633317
2964 /* "_proj.pyx":334
3318 /* "_proj.pyx":347
29653319 * for i from 0 <= i < npts:
29663320 * xx[i] = xx[i]*_dg2rad
29673321 * yy[i] = yy[i]*_dg2rad # <<<<<<<<<<<<<<
29743328 }
29753329 __pyx_L9:;
29763330
2977 /* "_proj.pyx":335
3331 /* "_proj.pyx":348
29783332 * xx[i] = xx[i]*_dg2rad
29793333 * yy[i] = yy[i]*_dg2rad
29803334 * if inz is not None: # <<<<<<<<<<<<<<
29823336 * else:
29833337 */
29843338 __pyx_t_5 = (__pyx_v_inz != Py_None);
2985 if (__pyx_t_5) {
2986
2987 /* "_proj.pyx":336
3339 __pyx_t_1 = (__pyx_t_5 != 0);
3340 if (__pyx_t_1) {
3341
3342 /* "_proj.pyx":349
29883343 * yy[i] = yy[i]*_dg2rad
29893344 * if inz is not None:
29903345 * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, zz) # <<<<<<<<<<<<<<
29963351 }
29973352 /*else*/ {
29983353
2999 /* "_proj.pyx":338
3354 /* "_proj.pyx":351
30003355 * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, zz)
30013356 * else:
30023357 * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, NULL) # <<<<<<<<<<<<<<
30073362 }
30083363 __pyx_L12:;
30093364
3010 /* "_proj.pyx":339
3365 /* "_proj.pyx":352
30113366 * else:
30123367 * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, NULL)
30133368 * if err != 0: # <<<<<<<<<<<<<<
30143369 * raise RuntimeError(pj_strerrno(err))
30153370 * if not radians and p2.is_latlong():
30163371 */
3017 __pyx_t_5 = (__pyx_v_err != 0);
3018 if (__pyx_t_5) {
3019
3020 /* "_proj.pyx":340
3372 __pyx_t_1 = ((__pyx_v_err != 0) != 0);
3373 if (__pyx_t_1) {
3374
3375 /* "_proj.pyx":353
30213376 * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, NULL)
30223377 * if err != 0:
30233378 * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<<
30243379 * if not radians and p2.is_latlong():
30253380 * for i from 0 <= i < npts:
30263381 */
3027 __pyx_t_4 = PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3382 __pyx_t_4 = __Pyx_PyBytes_FromString(pj_strerrno(__pyx_v_err)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30283383 __Pyx_GOTREF(((PyObject *)__pyx_t_4));
3029 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3384 __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30303385 __Pyx_GOTREF(__pyx_t_3);
30313386 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
30323387 __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
30333388 __pyx_t_4 = 0;
3034 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3389 __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30353390 __Pyx_GOTREF(__pyx_t_4);
30363391 __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
30373392 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
30383393 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3039 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3394 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30403395 goto __pyx_L13;
30413396 }
30423397 __pyx_L13:;
30433398
3044 /* "_proj.pyx":341
3399 /* "_proj.pyx":354
30453400 * if err != 0:
30463401 * raise RuntimeError(pj_strerrno(err))
30473402 * if not radians and p2.is_latlong(): # <<<<<<<<<<<<<<
30483403 * for i from 0 <= i < npts:
30493404 * xx[i] = xx[i]*_rad2dg
30503405 */
3051 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3052 __pyx_t_1 = (!__pyx_t_5);
3053 if (__pyx_t_1) {
3054 __pyx_t_4 = PyObject_GetAttr(((PyObject *)__pyx_v_p2), __pyx_n_s__is_latlong); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3406 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3407 __pyx_t_5 = (!__pyx_t_1);
3408 if (__pyx_t_5) {
3409 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_p2), __pyx_n_s__is_latlong); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30553410 __Pyx_GOTREF(__pyx_t_4);
3056 __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3411 __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30573412 __Pyx_GOTREF(__pyx_t_3);
30583413 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3059 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3414 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
30603415 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3416 __pyx_t_2 = __pyx_t_1;
3417 } else {
30613418 __pyx_t_2 = __pyx_t_5;
3062 } else {
3063 __pyx_t_2 = __pyx_t_1;
30643419 }
30653420 if (__pyx_t_2) {
30663421
3067 /* "_proj.pyx":342
3422 /* "_proj.pyx":355
30683423 * raise RuntimeError(pj_strerrno(err))
30693424 * if not radians and p2.is_latlong():
30703425 * for i from 0 <= i < npts: # <<<<<<<<<<<<<<
30743429 __pyx_t_6 = __pyx_v_npts;
30753430 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
30763431
3077 /* "_proj.pyx":343
3432 /* "_proj.pyx":356
30783433 * if not radians and p2.is_latlong():
30793434 * for i from 0 <= i < npts:
30803435 * xx[i] = xx[i]*_rad2dg # <<<<<<<<<<<<<<
30833438 */
30843439 (__pyx_v_xx[__pyx_v_i]) = ((__pyx_v_xx[__pyx_v_i]) * __pyx_v_5_proj__rad2dg);
30853440
3086 /* "_proj.pyx":344
3441 /* "_proj.pyx":357
30873442 * for i from 0 <= i < npts:
30883443 * xx[i] = xx[i]*_rad2dg
30893444 * yy[i] = yy[i]*_rad2dg # <<<<<<<<<<<<<<
31093464 return __pyx_r;
31103465 }
31113466
3112 /* "_proj.pyx":346
3467 /* "_proj.pyx":359
31133468 * yy[i] = yy[i]*_rad2dg
31143469 *
31153470 * cdef _strencode(pystr,encoding='ascii'): # <<<<<<<<<<<<<<
31383493 }
31393494 }
31403495
3141 /* "_proj.pyx":348
3496 /* "_proj.pyx":361
31423497 * cdef _strencode(pystr,encoding='ascii'):
31433498 * # encode a string into bytes. If already bytes, do nothing.
31443499 * try: # <<<<<<<<<<<<<<
31523507 __Pyx_XGOTREF(__pyx_t_3);
31533508 /*try:*/ {
31543509
3155 /* "_proj.pyx":349
3510 /* "_proj.pyx":362
31563511 * # encode a string into bytes. If already bytes, do nothing.
31573512 * try:
31583513 * return pystr.encode(encoding) # <<<<<<<<<<<<<<
31603515 * return pystr # already bytes?
31613516 */
31623517 __Pyx_XDECREF(__pyx_r);
3163 __pyx_t_4 = PyObject_GetAttr(__pyx_v_pystr, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3518 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pystr, __pyx_n_s__encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
31643519 __Pyx_GOTREF(__pyx_t_4);
3165 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3520 __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
31663521 __Pyx_GOTREF(__pyx_t_5);
31673522 __Pyx_INCREF(__pyx_v_encoding);
31683523 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_encoding);
31693524 __Pyx_GIVEREF(__pyx_v_encoding);
3170 __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3525 __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
31713526 __Pyx_GOTREF(__pyx_t_6);
31723527 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
31733528 __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
31903545 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
31913546 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
31923547
3193 /* "_proj.pyx":350
3548 /* "_proj.pyx":363
31943549 * try:
31953550 * return pystr.encode(encoding)
31963551 * except AttributeError: # <<<<<<<<<<<<<<
32003555 __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
32013556 if (__pyx_t_7) {
32023557 __Pyx_AddTraceback("_proj._strencode", __pyx_clineno, __pyx_lineno, __pyx_filename);
3203 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
3558 if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
32043559 __Pyx_GOTREF(__pyx_t_6);
32053560 __Pyx_GOTREF(__pyx_t_5);
32063561 __Pyx_GOTREF(__pyx_t_4);
32073562
3208 /* "_proj.pyx":351
3563 /* "_proj.pyx":364
32093564 * return pystr.encode(encoding)
32103565 * except AttributeError:
32113566 * return pystr # already bytes? # <<<<<<<<<<<<<<
32633618 static int __pyx_pw_5_proj_4Geod_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
32643619 PyObject *__pyx_v_a = 0;
32653620 PyObject *__pyx_v_f = 0;
3621 int __pyx_lineno = 0;
3622 const char *__pyx_filename = NULL;
3623 int __pyx_clineno = 0;
32663624 int __pyx_r;
32673625 __Pyx_RefNannyDeclarations
32683626 __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
32863644 case 1:
32873645 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--;
32883646 else {
3289 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3647 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32903648 }
32913649 }
32923650 if (unlikely(kw_args > 0)) {
3293 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3651 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
32943652 }
32953653 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
32963654 goto __pyx_L5_argtuple_error;
33033661 }
33043662 goto __pyx_L4_argument_unpacking_done;
33053663 __pyx_L5_argtuple_error:;
3306 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3664 __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
33073665 __pyx_L3_error:;
33083666 __Pyx_AddTraceback("_proj.Geod.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
33093667 __Pyx_RefNannyFinishContext();
33143672 return __pyx_r;
33153673 }
33163674
3317 /* "_proj.pyx":357
3675 /* "_proj.pyx":370
33183676 * cdef public object initstring
33193677 *
33203678 * def __cinit__(self, a, f): # <<<<<<<<<<<<<<
33213679 * self.initstring = '+a=%s +f=%s' % (a, f)
3322 * GeodesicInit(&self._Geodesic, <double> a, <double> f)
3680 * geod_init(&self._geod_geodesic, <double> a, <double> f)
33233681 */
33243682
33253683 static int __pyx_pf_5_proj_4Geod___cinit__(struct __pyx_obj_5_proj_Geod *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_f) {
33343692 int __pyx_clineno = 0;
33353693 __Pyx_RefNannySetupContext("__cinit__", 0);
33363694
3337 /* "_proj.pyx":358
3695 /* "_proj.pyx":371
33383696 *
33393697 * def __cinit__(self, a, f):
33403698 * self.initstring = '+a=%s +f=%s' % (a, f) # <<<<<<<<<<<<<<
3341 * GeodesicInit(&self._Geodesic, <double> a, <double> f)
3699 * geod_init(&self._geod_geodesic, <double> a, <double> f)
33423700 *
33433701 */
3344 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3702 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33453703 __Pyx_GOTREF(__pyx_t_1);
33463704 __Pyx_INCREF(__pyx_v_a);
33473705 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_a);
33493707 __Pyx_INCREF(__pyx_v_f);
33503708 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_f);
33513709 __Pyx_GIVEREF(__pyx_v_f);
3352 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3710 __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_17), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
33533711 __Pyx_GOTREF(((PyObject *)__pyx_t_2));
33543712 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
33553713 __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
33583716 __pyx_v_self->initstring = ((PyObject *)__pyx_t_2);
33593717 __pyx_t_2 = 0;
33603718
3361 /* "_proj.pyx":359
3719 /* "_proj.pyx":372
33623720 * def __cinit__(self, a, f):
33633721 * self.initstring = '+a=%s +f=%s' % (a, f)
3364 * GeodesicInit(&self._Geodesic, <double> a, <double> f) # <<<<<<<<<<<<<<
3722 * geod_init(&self._geod_geodesic, <double> a, <double> f) # <<<<<<<<<<<<<<
33653723 *
33663724 * def __reduce__(self):
33673725 */
3368 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3369 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_f); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3370 GeodesicInit((&__pyx_v_self->_Geodesic), ((double)__pyx_t_3), ((double)__pyx_t_4));
3726 __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_a); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3727 __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_f); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3728 geod_init((&__pyx_v_self->_geod_geodesic), ((double)__pyx_t_3), ((double)__pyx_t_4));
33713729
33723730 __pyx_r = 0;
33733731 goto __pyx_L0;
33933751 return __pyx_r;
33943752 }
33953753
3396 /* "_proj.pyx":361
3397 * GeodesicInit(&self._Geodesic, <double> a, <double> f)
3754 /* "_proj.pyx":374
3755 * geod_init(&self._geod_geodesic, <double> a, <double> f)
33983756 *
33993757 * def __reduce__(self): # <<<<<<<<<<<<<<
34003758 * """special method that allows pyproj.Geod instance to be pickled"""
34123770 int __pyx_clineno = 0;
34133771 __Pyx_RefNannySetupContext("__reduce__", 0);
34143772
3415 /* "_proj.pyx":363
3773 /* "_proj.pyx":376
34163774 * def __reduce__(self):
34173775 * """special method that allows pyproj.Geod instance to be pickled"""
34183776 * return (self.__class__,(self.initstring,)) # <<<<<<<<<<<<<<
34203778 * def _fwd(self, object lons, object lats, object az, object dist, radians=False):
34213779 */
34223780 __Pyx_XDECREF(__pyx_r);
3423 __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3781 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34243782 __Pyx_GOTREF(__pyx_t_1);
3425 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3783 __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34263784 __Pyx_GOTREF(__pyx_t_2);
34273785 __Pyx_INCREF(__pyx_v_self->initstring);
34283786 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->initstring);
34293787 __Pyx_GIVEREF(__pyx_v_self->initstring);
3430 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3788 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
34313789 __Pyx_GOTREF(__pyx_t_3);
34323790 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
34333791 __Pyx_GIVEREF(__pyx_t_1);
34623820 PyObject *__pyx_v_az = 0;
34633821 PyObject *__pyx_v_dist = 0;
34643822 PyObject *__pyx_v_radians = 0;
3823 int __pyx_lineno = 0;
3824 const char *__pyx_filename = NULL;
3825 int __pyx_clineno = 0;
34653826 PyObject *__pyx_r = 0;
34663827 __Pyx_RefNannyDeclarations
34673828 __Pyx_RefNannySetupContext("_fwd (wrapper)", 0);
34893850 case 1:
34903851 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats)) != 0)) kw_args--;
34913852 else {
3492 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3853 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
34933854 }
34943855 case 2:
34953856 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__az)) != 0)) kw_args--;
34963857 else {
3497 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3858 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
34983859 }
34993860 case 3:
35003861 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist)) != 0)) kw_args--;
35013862 else {
3502 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3863 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35033864 }
35043865 case 4:
35053866 if (kw_args > 0) {
35083869 }
35093870 }
35103871 if (unlikely(kw_args > 0)) {
3511 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3872 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_fwd") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35123873 }
35133874 } else {
35143875 switch (PyTuple_GET_SIZE(__pyx_args)) {
35293890 }
35303891 goto __pyx_L4_argument_unpacking_done;
35313892 __pyx_L5_argtuple_error:;
3532 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
3893 __Pyx_RaiseArgtupleInvalid("_fwd", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
35333894 __pyx_L3_error:;
35343895 __Pyx_AddTraceback("_proj.Geod._fwd", __pyx_clineno, __pyx_lineno, __pyx_filename);
35353896 __Pyx_RefNannyFinishContext();
35403901 return __pyx_r;
35413902 }
35423903
3543 /* "_proj.pyx":365
3904 /* "_proj.pyx":378
35443905 * return (self.__class__,(self.initstring,))
35453906 *
35463907 * def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<<
35833944 int __pyx_clineno = 0;
35843945 __Pyx_RefNannySetupContext("_fwd", 0);
35853946
3586 /* "_proj.pyx":377
3947 /* "_proj.pyx":390
35873948 * cdef void *londata, *latdata, *azdat, *distdat
35883949 * # if buffer api is supported, get pointer to data buffers.
35893950 * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<<
35903951 * raise RuntimeError
35913952 * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
35923953 */
3593 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lons, (&__pyx_v_londata), (&__pyx_v_buflenlons)) != 0);
3954 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lons, (&__pyx_v_londata), (&__pyx_v_buflenlons)) != 0) != 0);
35943955 if (__pyx_t_1) {
35953956
3596 /* "_proj.pyx":378
3957 /* "_proj.pyx":391
35973958 * # if buffer api is supported, get pointer to data buffers.
35983959 * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
35993960 * raise RuntimeError # <<<<<<<<<<<<<<
36013962 * raise RuntimeError
36023963 */
36033964 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
3604 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3965 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36053966 goto __pyx_L3;
36063967 }
36073968 __pyx_L3:;
36083969
3609 /* "_proj.pyx":379
3970 /* "_proj.pyx":392
36103971 * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0:
36113972 * raise RuntimeError
36123973 * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<<
36133974 * raise RuntimeError
36143975 * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
36153976 */
3616 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lats, (&__pyx_v_latdata), (&__pyx_v_buflenlats)) != 0);
3977 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lats, (&__pyx_v_latdata), (&__pyx_v_buflenlats)) != 0) != 0);
36173978 if (__pyx_t_1) {
36183979
3619 /* "_proj.pyx":380
3980 /* "_proj.pyx":393
36203981 * raise RuntimeError
36213982 * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
36223983 * raise RuntimeError # <<<<<<<<<<<<<<
36243985 * raise RuntimeError
36253986 */
36263987 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
3627 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3988 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36283989 goto __pyx_L4;
36293990 }
36303991 __pyx_L4:;
36313992
3632 /* "_proj.pyx":381
3993 /* "_proj.pyx":394
36333994 * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0:
36343995 * raise RuntimeError
36353996 * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<<
36363997 * raise RuntimeError
36373998 * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0:
36383999 */
3639 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_az, (&__pyx_v_azdat), (&__pyx_v_buflenaz)) != 0);
4000 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_az, (&__pyx_v_azdat), (&__pyx_v_buflenaz)) != 0) != 0);
36404001 if (__pyx_t_1) {
36414002
3642 /* "_proj.pyx":382
4003 /* "_proj.pyx":395
36434004 * raise RuntimeError
36444005 * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
36454006 * raise RuntimeError # <<<<<<<<<<<<<<
36474008 * raise RuntimeError
36484009 */
36494010 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
3650 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4011 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36514012 goto __pyx_L5;
36524013 }
36534014 __pyx_L5:;
36544015
3655 /* "_proj.pyx":383
4016 /* "_proj.pyx":396
36564017 * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0:
36574018 * raise RuntimeError
36584019 * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<<
36594020 * raise RuntimeError
36604021 * # process data in buffer
36614022 */
3662 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_dist, (&__pyx_v_distdat), (&__pyx_v_buflend)) != 0);
4023 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_dist, (&__pyx_v_distdat), (&__pyx_v_buflend)) != 0) != 0);
36634024 if (__pyx_t_1) {
36644025
3665 /* "_proj.pyx":384
4026 /* "_proj.pyx":397
36664027 * raise RuntimeError
36674028 * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0:
36684029 * raise RuntimeError # <<<<<<<<<<<<<<
36704031 * if not buflenlons == buflenlats == buflenaz == buflend:
36714032 */
36724033 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
3673 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4034 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
36744035 goto __pyx_L6;
36754036 }
36764037 __pyx_L6:;
36774038
3678 /* "_proj.pyx":386
4039 /* "_proj.pyx":399
36794040 * raise RuntimeError
36804041 * # process data in buffer
36814042 * if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<<
36894050 __pyx_t_1 = (__pyx_v_buflenaz == __pyx_v_buflend);
36904051 }
36914052 }
3692 __pyx_t_2 = (!__pyx_t_1);
4053 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
36934054 if (__pyx_t_2) {
36944055
3695 /* "_proj.pyx":387
4056 /* "_proj.pyx":400
36964057 * # process data in buffer
36974058 * if not buflenlons == buflenlats == buflenaz == buflend:
36984059 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
36994060 * ndim = buflenlons//_doublesize
37004061 * lonsdata = <double *>londata
37014062 */
3702 __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4063 __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37034064 __Pyx_GOTREF(__pyx_t_3);
37044065 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
37054066 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3706 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4067 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37074068 goto __pyx_L7;
37084069 }
37094070 __pyx_L7:;
37104071
3711 /* "_proj.pyx":388
4072 /* "_proj.pyx":401
37124073 * if not buflenlons == buflenlats == buflenaz == buflend:
37134074 * raise RuntimeError("Buffer lengths not the same")
37144075 * ndim = buflenlons//_doublesize # <<<<<<<<<<<<<<
37154076 * lonsdata = <double *>londata
37164077 * latsdata = <double *>latdata
37174078 */
3718 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4079 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37194080 __Pyx_GOTREF(__pyx_t_3);
3720 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___doublesize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4081 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___doublesize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37214082 __Pyx_GOTREF(__pyx_t_4);
3722 __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4083 __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37234084 __Pyx_GOTREF(__pyx_t_5);
37244085 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
37254086 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3726 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4087 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
37274088 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
37284089 __pyx_v_ndim = __pyx_t_6;
37294090
3730 /* "_proj.pyx":389
4091 /* "_proj.pyx":402
37314092 * raise RuntimeError("Buffer lengths not the same")
37324093 * ndim = buflenlons//_doublesize
37334094 * lonsdata = <double *>londata # <<<<<<<<<<<<<<
37364097 */
37374098 __pyx_v_lonsdata = ((double *)__pyx_v_londata);
37384099
3739 /* "_proj.pyx":390
4100 /* "_proj.pyx":403
37404101 * ndim = buflenlons//_doublesize
37414102 * lonsdata = <double *>londata
37424103 * latsdata = <double *>latdata # <<<<<<<<<<<<<<
37454106 */
37464107 __pyx_v_latsdata = ((double *)__pyx_v_latdata);
37474108
3748 /* "_proj.pyx":391
4109 /* "_proj.pyx":404
37494110 * lonsdata = <double *>londata
37504111 * latsdata = <double *>latdata
37514112 * azdata = <double *>azdat # <<<<<<<<<<<<<<
37544115 */
37554116 __pyx_v_azdata = ((double *)__pyx_v_azdat);
37564117
3757 /* "_proj.pyx":392
4118 /* "_proj.pyx":405
37584119 * latsdata = <double *>latdata
37594120 * azdata = <double *>azdat
37604121 * distdata = <double *>distdat # <<<<<<<<<<<<<<
37634124 */
37644125 __pyx_v_distdata = ((double *)__pyx_v_distdat);
37654126
3766 /* "_proj.pyx":393
4127 /* "_proj.pyx":406
37674128 * azdata = <double *>azdat
37684129 * distdata = <double *>distdat
37694130 * for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
37734134 __pyx_t_6 = __pyx_v_ndim;
37744135 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
37754136
3776 /* "_proj.pyx":394
4137 /* "_proj.pyx":407
37774138 * distdata = <double *>distdat
37784139 * for i from 0 <= i < ndim:
37794140 * if not radians: # <<<<<<<<<<<<<<
37804141 * lon1 = lonsdata[i]
37814142 * lat1 = latsdata[i]
37824143 */
3783 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3784 __pyx_t_1 = (!__pyx_t_2);
4144 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4145 __pyx_t_1 = ((!__pyx_t_2) != 0);
37854146 if (__pyx_t_1) {
37864147
3787 /* "_proj.pyx":395
4148 /* "_proj.pyx":408
37884149 * for i from 0 <= i < ndim:
37894150 * if not radians:
37904151 * lon1 = lonsdata[i] # <<<<<<<<<<<<<<
37934154 */
37944155 __pyx_v_lon1 = (__pyx_v_lonsdata[__pyx_v_i]);
37954156
3796 /* "_proj.pyx":396
4157 /* "_proj.pyx":409
37974158 * if not radians:
37984159 * lon1 = lonsdata[i]
37994160 * lat1 = latsdata[i] # <<<<<<<<<<<<<<
38024163 */
38034164 __pyx_v_lat1 = (__pyx_v_latsdata[__pyx_v_i]);
38044165
3805 /* "_proj.pyx":397
4166 /* "_proj.pyx":410
38064167 * lon1 = lonsdata[i]
38074168 * lat1 = latsdata[i]
38084169 * az1 = azdata[i] # <<<<<<<<<<<<<<
38114172 */
38124173 __pyx_v_az1 = (__pyx_v_azdata[__pyx_v_i]);
38134174
3814 /* "_proj.pyx":398
4175 /* "_proj.pyx":411
38154176 * lat1 = latsdata[i]
38164177 * az1 = azdata[i]
38174178 * s12 = distdata[i] # <<<<<<<<<<<<<<
38234184 }
38244185 /*else*/ {
38254186
3826 /* "_proj.pyx":400
4187 /* "_proj.pyx":413
38274188 * s12 = distdata[i]
38284189 * else:
38294190 * lon1 = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<<
38324193 */
38334194 __pyx_v_lon1 = (__pyx_v_5_proj__dg2rad * (__pyx_v_lonsdata[__pyx_v_i]));
38344195
3835 /* "_proj.pyx":401
4196 /* "_proj.pyx":414
38364197 * else:
38374198 * lon1 = _dg2rad*lonsdata[i]
38384199 * lat1 = _dg2rad*latsdata[i] # <<<<<<<<<<<<<<
38414202 */
38424203 __pyx_v_lat1 = (__pyx_v_5_proj__dg2rad * (__pyx_v_latsdata[__pyx_v_i]));
38434204
3844 /* "_proj.pyx":402
4205 /* "_proj.pyx":415
38454206 * lon1 = _dg2rad*lonsdata[i]
38464207 * lat1 = _dg2rad*latsdata[i]
38474208 * az1 = _dg2rad*azdata[i] # <<<<<<<<<<<<<<
38484209 * s12 = distdata[i]
3849 * Direct(&self._Geodesic, lat1, lon1, az1, s12,\
4210 * geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\
38504211 */
38514212 __pyx_v_az1 = (__pyx_v_5_proj__dg2rad * (__pyx_v_azdata[__pyx_v_i]));
38524213
3853 /* "_proj.pyx":403
4214 /* "_proj.pyx":416
38544215 * lat1 = _dg2rad*latsdata[i]
38554216 * az1 = _dg2rad*azdata[i]
38564217 * s12 = distdata[i] # <<<<<<<<<<<<<<
3857 * Direct(&self._Geodesic, lat1, lon1, az1, s12,\
4218 * geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\
38584219 * &plat2, &plon2, &pazi2)
38594220 */
38604221 __pyx_v_s12 = (__pyx_v_distdata[__pyx_v_i]);
38614222 }
38624223 __pyx_L10:;
38634224
3864 /* "_proj.pyx":405
4225 /* "_proj.pyx":418
38654226 * s12 = distdata[i]
3866 * Direct(&self._Geodesic, lat1, lon1, az1, s12,\
4227 * geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\
38674228 * &plat2, &plon2, &pazi2) # <<<<<<<<<<<<<<
38684229 * # back azimuth needs to be flipped 180 degrees
38694230 * # to match what proj4 geod utility produces.
38704231 */
3871 Direct((&__pyx_v_self->_Geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_az1, __pyx_v_s12, (&__pyx_v_plat2), (&__pyx_v_plon2), (&__pyx_v_pazi2));
3872
3873 /* "_proj.pyx":408
4232 geod_direct((&__pyx_v_self->_geod_geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_az1, __pyx_v_s12, (&__pyx_v_plat2), (&__pyx_v_plon2), (&__pyx_v_pazi2));
4233
4234 /* "_proj.pyx":421
38744235 * # back azimuth needs to be flipped 180 degrees
38754236 * # to match what proj4 geod utility produces.
38764237 * if pazi2 > 0: # <<<<<<<<<<<<<<
38774238 * pazi2 = pazi2-180.
3878 * elif pazi2 < 0:
3879 */
3880 __pyx_t_1 = (__pyx_v_pazi2 > 0.0);
4239 * elif pazi2 <= 0:
4240 */
4241 __pyx_t_1 = ((__pyx_v_pazi2 > 0.0) != 0);
38814242 if (__pyx_t_1) {
38824243
3883 /* "_proj.pyx":409
4244 /* "_proj.pyx":422
38844245 * # to match what proj4 geod utility produces.
38854246 * if pazi2 > 0:
38864247 * pazi2 = pazi2-180. # <<<<<<<<<<<<<<
3887 * elif pazi2 < 0:
4248 * elif pazi2 <= 0:
38884249 * pazi2 = pazi2+180.
38894250 */
38904251 __pyx_v_pazi2 = (__pyx_v_pazi2 - 180.);
38914252 goto __pyx_L11;
38924253 }
38934254
3894 /* "_proj.pyx":410
4255 /* "_proj.pyx":423
38954256 * if pazi2 > 0:
38964257 * pazi2 = pazi2-180.
3897 * elif pazi2 < 0: # <<<<<<<<<<<<<<
4258 * elif pazi2 <= 0: # <<<<<<<<<<<<<<
38984259 * pazi2 = pazi2+180.
38994260 * # check for NaN.
39004261 */
3901 __pyx_t_1 = (__pyx_v_pazi2 < 0.0);
4262 __pyx_t_1 = ((__pyx_v_pazi2 <= 0.0) != 0);
39024263 if (__pyx_t_1) {
39034264
3904 /* "_proj.pyx":411
4265 /* "_proj.pyx":424
39054266 * pazi2 = pazi2-180.
3906 * elif pazi2 < 0:
4267 * elif pazi2 <= 0:
39074268 * pazi2 = pazi2+180. # <<<<<<<<<<<<<<
39084269 * # check for NaN.
39094270 * if pazi2 != pazi2:
39134274 }
39144275 __pyx_L11:;
39154276
3916 /* "_proj.pyx":413
4277 /* "_proj.pyx":426
39174278 * pazi2 = pazi2+180.
39184279 * # check for NaN.
39194280 * if pazi2 != pazi2: # <<<<<<<<<<<<<<
39204281 * raise ValueError('undefined inverse geodesic (may be an antipodal point)')
39214282 * if not radians:
39224283 */
3923 __pyx_t_1 = (__pyx_v_pazi2 != __pyx_v_pazi2);
4284 __pyx_t_1 = ((__pyx_v_pazi2 != __pyx_v_pazi2) != 0);
39244285 if (__pyx_t_1) {
39254286
3926 /* "_proj.pyx":414
4287 /* "_proj.pyx":427
39274288 * # check for NaN.
39284289 * if pazi2 != pazi2:
39294290 * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<<
39304291 * if not radians:
39314292 * lonsdata[i] = plon2
39324293 */
3933 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4294 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39344295 __Pyx_GOTREF(__pyx_t_5);
39354296 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
39364297 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3937 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4298 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
39384299 goto __pyx_L12;
39394300 }
39404301 __pyx_L12:;
39414302
3942 /* "_proj.pyx":415
4303 /* "_proj.pyx":428
39434304 * if pazi2 != pazi2:
39444305 * raise ValueError('undefined inverse geodesic (may be an antipodal point)')
39454306 * if not radians: # <<<<<<<<<<<<<<
39464307 * lonsdata[i] = plon2
39474308 * latsdata[i] = plat2
39484309 */
3949 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
3950 __pyx_t_2 = (!__pyx_t_1);
4310 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4311 __pyx_t_2 = ((!__pyx_t_1) != 0);
39514312 if (__pyx_t_2) {
39524313
3953 /* "_proj.pyx":416
4314 /* "_proj.pyx":429
39544315 * raise ValueError('undefined inverse geodesic (may be an antipodal point)')
39554316 * if not radians:
39564317 * lonsdata[i] = plon2 # <<<<<<<<<<<<<<
39594320 */
39604321 (__pyx_v_lonsdata[__pyx_v_i]) = __pyx_v_plon2;
39614322
3962 /* "_proj.pyx":417
4323 /* "_proj.pyx":430
39634324 * if not radians:
39644325 * lonsdata[i] = plon2
39654326 * latsdata[i] = plat2 # <<<<<<<<<<<<<<
39684329 */
39694330 (__pyx_v_latsdata[__pyx_v_i]) = __pyx_v_plat2;
39704331
3971 /* "_proj.pyx":418
4332 /* "_proj.pyx":431
39724333 * lonsdata[i] = plon2
39734334 * latsdata[i] = plat2
39744335 * azdata[i] = pazi2 # <<<<<<<<<<<<<<
39804341 }
39814342 /*else*/ {
39824343
3983 /* "_proj.pyx":420
4344 /* "_proj.pyx":433
39844345 * azdata[i] = pazi2
39854346 * else:
39864347 * lonsdata[i] = _rad2dg*plon2 # <<<<<<<<<<<<<<
39894350 */
39904351 (__pyx_v_lonsdata[__pyx_v_i]) = (__pyx_v_5_proj__rad2dg * __pyx_v_plon2);
39914352
3992 /* "_proj.pyx":421
4353 /* "_proj.pyx":434
39934354 * else:
39944355 * lonsdata[i] = _rad2dg*plon2
39954356 * latsdata[i] = _rad2dg*plat2 # <<<<<<<<<<<<<<
39984359 */
39994360 (__pyx_v_latsdata[__pyx_v_i]) = (__pyx_v_5_proj__rad2dg * __pyx_v_plat2);
40004361
4001 /* "_proj.pyx":422
4362 /* "_proj.pyx":435
40024363 * lonsdata[i] = _rad2dg*plon2
40034364 * latsdata[i] = _rad2dg*plat2
40044365 * azdata[i] = _rad2dg*pazi2 # <<<<<<<<<<<<<<
40334394 PyObject *__pyx_v_lons2 = 0;
40344395 PyObject *__pyx_v_lats2 = 0;
40354396 PyObject *__pyx_v_radians = 0;
4397 int __pyx_lineno = 0;
4398 const char *__pyx_filename = NULL;
4399 int __pyx_clineno = 0;
40364400 PyObject *__pyx_r = 0;
40374401 __Pyx_RefNannyDeclarations
40384402 __Pyx_RefNannySetupContext("_inv (wrapper)", 0);
40604424 case 1:
40614425 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats1)) != 0)) kw_args--;
40624426 else {
4063 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4427 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40644428 }
40654429 case 2:
40664430 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lons2)) != 0)) kw_args--;
40674431 else {
4068 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4432 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40694433 }
40704434 case 3:
40714435 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats2)) != 0)) kw_args--;
40724436 else {
4073 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4437 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40744438 }
40754439 case 4:
40764440 if (kw_args > 0) {
40794443 }
40804444 }
40814445 if (unlikely(kw_args > 0)) {
4082 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4446 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_inv") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
40834447 }
40844448 } else {
40854449 switch (PyTuple_GET_SIZE(__pyx_args)) {
41004464 }
41014465 goto __pyx_L4_argument_unpacking_done;
41024466 __pyx_L5_argtuple_error:;
4103 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4467 __Pyx_RaiseArgtupleInvalid("_inv", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
41044468 __pyx_L3_error:;
41054469 __Pyx_AddTraceback("_proj.Geod._inv", __pyx_clineno, __pyx_lineno, __pyx_filename);
41064470 __Pyx_RefNannyFinishContext();
41114475 return __pyx_r;
41124476 }
41134477
4114 /* "_proj.pyx":424
4478 /* "_proj.pyx":437
41154479 * azdata[i] = _rad2dg*pazi2
41164480 *
41174481 * def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False): # <<<<<<<<<<<<<<
41554519 int __pyx_clineno = 0;
41564520 __Pyx_RefNannySetupContext("_inv", 0);
41574521
4158 /* "_proj.pyx":435
4522 /* "_proj.pyx":448
41594523 * cdef void *londata, *latdata, *azdat, *distdat
41604524 * # if buffer api is supported, get pointer to data buffers.
41614525 * if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<<
41624526 * raise RuntimeError
41634527 * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
41644528 */
4165 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lons1, (&__pyx_v_londata), (&__pyx_v_buflenlons)) != 0);
4529 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lons1, (&__pyx_v_londata), (&__pyx_v_buflenlons)) != 0) != 0);
41664530 if (__pyx_t_1) {
41674531
4168 /* "_proj.pyx":436
4532 /* "_proj.pyx":449
41694533 * # if buffer api is supported, get pointer to data buffers.
41704534 * if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0:
41714535 * raise RuntimeError # <<<<<<<<<<<<<<
41734537 * raise RuntimeError
41744538 */
41754539 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
4176 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4540 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
41774541 goto __pyx_L3;
41784542 }
41794543 __pyx_L3:;
41804544
4181 /* "_proj.pyx":437
4545 /* "_proj.pyx":450
41824546 * if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0:
41834547 * raise RuntimeError
41844548 * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<<
41854549 * raise RuntimeError
41864550 * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
41874551 */
4188 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lats1, (&__pyx_v_latdata), (&__pyx_v_buflenlats)) != 0);
4552 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lats1, (&__pyx_v_latdata), (&__pyx_v_buflenlats)) != 0) != 0);
41894553 if (__pyx_t_1) {
41904554
4191 /* "_proj.pyx":438
4555 /* "_proj.pyx":451
41924556 * raise RuntimeError
41934557 * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
41944558 * raise RuntimeError # <<<<<<<<<<<<<<
41964560 * raise RuntimeError
41974561 */
41984562 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
4199 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4563 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42004564 goto __pyx_L4;
42014565 }
42024566 __pyx_L4:;
42034567
4204 /* "_proj.pyx":439
4568 /* "_proj.pyx":452
42054569 * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0:
42064570 * raise RuntimeError
42074571 * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<<
42084572 * raise RuntimeError
42094573 * if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0:
42104574 */
4211 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lons2, (&__pyx_v_azdat), (&__pyx_v_buflenaz)) != 0);
4575 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lons2, (&__pyx_v_azdat), (&__pyx_v_buflenaz)) != 0) != 0);
42124576 if (__pyx_t_1) {
42134577
4214 /* "_proj.pyx":440
4578 /* "_proj.pyx":453
42154579 * raise RuntimeError
42164580 * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
42174581 * raise RuntimeError # <<<<<<<<<<<<<<
42194583 * raise RuntimeError
42204584 */
42214585 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
4222 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4586 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42234587 goto __pyx_L5;
42244588 }
42254589 __pyx_L5:;
42264590
4227 /* "_proj.pyx":441
4591 /* "_proj.pyx":454
42284592 * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0:
42294593 * raise RuntimeError
42304594 * if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<<
42314595 * raise RuntimeError
42324596 * # process data in buffer
42334597 */
4234 __pyx_t_1 = (PyObject_AsWriteBuffer(__pyx_v_lats2, (&__pyx_v_distdat), (&__pyx_v_buflend)) != 0);
4598 __pyx_t_1 = ((PyObject_AsWriteBuffer(__pyx_v_lats2, (&__pyx_v_distdat), (&__pyx_v_buflend)) != 0) != 0);
42354599 if (__pyx_t_1) {
42364600
4237 /* "_proj.pyx":442
4601 /* "_proj.pyx":455
42384602 * raise RuntimeError
42394603 * if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0:
42404604 * raise RuntimeError # <<<<<<<<<<<<<<
42424606 * if not buflenlons == buflenlats == buflenaz == buflend:
42434607 */
42444608 __Pyx_Raise(__pyx_builtin_RuntimeError, 0, 0, 0);
4245 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4609 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42464610 goto __pyx_L6;
42474611 }
42484612 __pyx_L6:;
42494613
4250 /* "_proj.pyx":444
4614 /* "_proj.pyx":457
42514615 * raise RuntimeError
42524616 * # process data in buffer
42534617 * if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<<
42614625 __pyx_t_1 = (__pyx_v_buflenaz == __pyx_v_buflend);
42624626 }
42634627 }
4264 __pyx_t_2 = (!__pyx_t_1);
4628 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
42654629 if (__pyx_t_2) {
42664630
4267 /* "_proj.pyx":445
4631 /* "_proj.pyx":458
42684632 * # process data in buffer
42694633 * if not buflenlons == buflenlats == buflenaz == buflend:
42704634 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
42714635 * ndim = buflenlons//_doublesize
42724636 * lonsdata = <double *>londata
42734637 */
4274 __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4638 __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42754639 __Pyx_GOTREF(__pyx_t_3);
42764640 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
42774641 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4278 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4642 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42794643 goto __pyx_L7;
42804644 }
42814645 __pyx_L7:;
42824646
4283 /* "_proj.pyx":446
4647 /* "_proj.pyx":459
42844648 * if not buflenlons == buflenlats == buflenaz == buflend:
42854649 * raise RuntimeError("Buffer lengths not the same")
42864650 * ndim = buflenlons//_doublesize # <<<<<<<<<<<<<<
42874651 * lonsdata = <double *>londata
42884652 * latsdata = <double *>latdata
42894653 */
4290 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4654 __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_buflenlons); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42914655 __Pyx_GOTREF(__pyx_t_3);
4292 __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s___doublesize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4656 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___doublesize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42934657 __Pyx_GOTREF(__pyx_t_4);
4294 __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4658 __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42954659 __Pyx_GOTREF(__pyx_t_5);
42964660 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
42974661 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4298 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4662 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
42994663 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
43004664 __pyx_v_ndim = __pyx_t_6;
43014665
4302 /* "_proj.pyx":447
4666 /* "_proj.pyx":460
43034667 * raise RuntimeError("Buffer lengths not the same")
43044668 * ndim = buflenlons//_doublesize
43054669 * lonsdata = <double *>londata # <<<<<<<<<<<<<<
43084672 */
43094673 __pyx_v_lonsdata = ((double *)__pyx_v_londata);
43104674
4311 /* "_proj.pyx":448
4675 /* "_proj.pyx":461
43124676 * ndim = buflenlons//_doublesize
43134677 * lonsdata = <double *>londata
43144678 * latsdata = <double *>latdata # <<<<<<<<<<<<<<
43174681 */
43184682 __pyx_v_latsdata = ((double *)__pyx_v_latdata);
43194683
4320 /* "_proj.pyx":449
4684 /* "_proj.pyx":462
43214685 * lonsdata = <double *>londata
43224686 * latsdata = <double *>latdata
43234687 * azdata = <double *>azdat # <<<<<<<<<<<<<<
43264690 */
43274691 __pyx_v_azdata = ((double *)__pyx_v_azdat);
43284692
4329 /* "_proj.pyx":450
4693 /* "_proj.pyx":463
43304694 * latsdata = <double *>latdata
43314695 * azdata = <double *>azdat
43324696 * distdata = <double *>distdat # <<<<<<<<<<<<<<
43354699 */
43364700 __pyx_v_distdata = ((double *)__pyx_v_distdat);
43374701
4338 /* "_proj.pyx":451
4702 /* "_proj.pyx":464
43394703 * azdata = <double *>azdat
43404704 * distdata = <double *>distdat
43414705 * errmsg = 'undefined inverse geodesic (may be an antipodal point)' # <<<<<<<<<<<<<<
43454709 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
43464710 __pyx_v_errmsg = ((PyObject *)__pyx_kp_s_20);
43474711
4348 /* "_proj.pyx":452
4712 /* "_proj.pyx":465
43494713 * distdata = <double *>distdat
43504714 * errmsg = 'undefined inverse geodesic (may be an antipodal point)'
43514715 * for i from 0 <= i < ndim: # <<<<<<<<<<<<<<
43554719 __pyx_t_6 = __pyx_v_ndim;
43564720 for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
43574721
4358 /* "_proj.pyx":453
4722 /* "_proj.pyx":466
43594723 * errmsg = 'undefined inverse geodesic (may be an antipodal point)'
43604724 * for i from 0 <= i < ndim:
43614725 * if radians: # <<<<<<<<<<<<<<
43624726 * lon1 = _rad2dg*lonsdata[i]
43634727 * lat1 = _rad2dg*latsdata[i]
43644728 */
4365 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4729 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
43664730 if (__pyx_t_2) {
43674731
4368 /* "_proj.pyx":454
4732 /* "_proj.pyx":467
43694733 * for i from 0 <= i < ndim:
43704734 * if radians:
43714735 * lon1 = _rad2dg*lonsdata[i] # <<<<<<<<<<<<<<
43744738 */
43754739 __pyx_v_lon1 = (__pyx_v_5_proj__rad2dg * (__pyx_v_lonsdata[__pyx_v_i]));
43764740
4377 /* "_proj.pyx":455
4741 /* "_proj.pyx":468
43784742 * if radians:
43794743 * lon1 = _rad2dg*lonsdata[i]
43804744 * lat1 = _rad2dg*latsdata[i] # <<<<<<<<<<<<<<
43834747 */
43844748 __pyx_v_lat1 = (__pyx_v_5_proj__rad2dg * (__pyx_v_latsdata[__pyx_v_i]));
43854749
4386 /* "_proj.pyx":456
4750 /* "_proj.pyx":469
43874751 * lon1 = _rad2dg*lonsdata[i]
43884752 * lat1 = _rad2dg*latsdata[i]
43894753 * lon2 = _rad2dg*azdata[i] # <<<<<<<<<<<<<<
43924756 */
43934757 __pyx_v_lon2 = (__pyx_v_5_proj__rad2dg * (__pyx_v_azdata[__pyx_v_i]));
43944758
4395 /* "_proj.pyx":457
4759 /* "_proj.pyx":470
43964760 * lat1 = _rad2dg*latsdata[i]
43974761 * lon2 = _rad2dg*azdata[i]
43984762 * lat2 = _rad2dg*distdata[i] # <<<<<<<<<<<<<<
44044768 }
44054769 /*else*/ {
44064770
4407 /* "_proj.pyx":459
4771 /* "_proj.pyx":472
44084772 * lat2 = _rad2dg*distdata[i]
44094773 * else:
44104774 * lon1 = lonsdata[i] # <<<<<<<<<<<<<<
44134777 */
44144778 __pyx_v_lon1 = (__pyx_v_lonsdata[__pyx_v_i]);
44154779
4416 /* "_proj.pyx":460
4780 /* "_proj.pyx":473
44174781 * else:
44184782 * lon1 = lonsdata[i]
44194783 * lat1 = latsdata[i] # <<<<<<<<<<<<<<
44224786 */
44234787 __pyx_v_lat1 = (__pyx_v_latsdata[__pyx_v_i]);
44244788
4425 /* "_proj.pyx":461
4789 /* "_proj.pyx":474
44264790 * lon1 = lonsdata[i]
44274791 * lat1 = latsdata[i]
44284792 * lon2 = azdata[i] # <<<<<<<<<<<<<<
44294793 * lat2 = distdata[i]
4430 * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2,
4794 * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2,
44314795 */
44324796 __pyx_v_lon2 = (__pyx_v_azdata[__pyx_v_i]);
44334797
4434 /* "_proj.pyx":462
4798 /* "_proj.pyx":475
44354799 * lat1 = latsdata[i]
44364800 * lon2 = azdata[i]
44374801 * lat2 = distdata[i] # <<<<<<<<<<<<<<
4438 * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2,
4802 * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2,
44394803 * &ps12, &pazi1, &pazi2)
44404804 */
44414805 __pyx_v_lat2 = (__pyx_v_distdata[__pyx_v_i]);
44424806 }
44434807 __pyx_L10:;
44444808
4445 /* "_proj.pyx":464
4809 /* "_proj.pyx":477
44464810 * lat2 = distdata[i]
4447 * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2,
4811 * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2,
44484812 * &ps12, &pazi1, &pazi2) # <<<<<<<<<<<<<<
44494813 * # back azimuth needs to be flipped 180 degrees
44504814 * # to match what proj4 geod utility produces.
44514815 */
4452 Inverse((&__pyx_v_self->_Geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_lat2, __pyx_v_lon2, (&__pyx_v_ps12), (&__pyx_v_pazi1), (&__pyx_v_pazi2));
4453
4454 /* "_proj.pyx":467
4816 geod_inverse((&__pyx_v_self->_geod_geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_lat2, __pyx_v_lon2, (&__pyx_v_ps12), (&__pyx_v_pazi1), (&__pyx_v_pazi2));
4817
4818 /* "_proj.pyx":480
44554819 * # back azimuth needs to be flipped 180 degrees
44564820 * # to match what proj4 geod utility produces.
44574821 * if pazi2 > 0: # <<<<<<<<<<<<<<
44584822 * pazi2 = pazi2-180.
4459 * elif pazi2 < 0:
4460 */
4461 __pyx_t_2 = (__pyx_v_pazi2 > 0.0);
4823 * elif pazi2 <= 0:
4824 */
4825 __pyx_t_2 = ((__pyx_v_pazi2 > 0.0) != 0);
44624826 if (__pyx_t_2) {
44634827
4464 /* "_proj.pyx":468
4828 /* "_proj.pyx":481
44654829 * # to match what proj4 geod utility produces.
44664830 * if pazi2 > 0:
44674831 * pazi2 = pazi2-180. # <<<<<<<<<<<<<<
4468 * elif pazi2 < 0:
4832 * elif pazi2 <= 0:
44694833 * pazi2 = pazi2+180.
44704834 */
44714835 __pyx_v_pazi2 = (__pyx_v_pazi2 - 180.);
44724836 goto __pyx_L11;
44734837 }
44744838
4475 /* "_proj.pyx":469
4839 /* "_proj.pyx":482
44764840 * if pazi2 > 0:
44774841 * pazi2 = pazi2-180.
4478 * elif pazi2 < 0: # <<<<<<<<<<<<<<
4842 * elif pazi2 <= 0: # <<<<<<<<<<<<<<
44794843 * pazi2 = pazi2+180.
44804844 * if ps12 != ps12: # check for NaN
44814845 */
4482 __pyx_t_2 = (__pyx_v_pazi2 < 0.0);
4846 __pyx_t_2 = ((__pyx_v_pazi2 <= 0.0) != 0);
44834847 if (__pyx_t_2) {
44844848
4485 /* "_proj.pyx":470
4849 /* "_proj.pyx":483
44864850 * pazi2 = pazi2-180.
4487 * elif pazi2 < 0:
4851 * elif pazi2 <= 0:
44884852 * pazi2 = pazi2+180. # <<<<<<<<<<<<<<
44894853 * if ps12 != ps12: # check for NaN
44904854 * raise ValueError('undefined inverse geodesic (may be an antipodal point)')
44944858 }
44954859 __pyx_L11:;
44964860
4497 /* "_proj.pyx":471
4498 * elif pazi2 < 0:
4861 /* "_proj.pyx":484
4862 * elif pazi2 <= 0:
44994863 * pazi2 = pazi2+180.
45004864 * if ps12 != ps12: # check for NaN # <<<<<<<<<<<<<<
45014865 * raise ValueError('undefined inverse geodesic (may be an antipodal point)')
45024866 * if radians:
45034867 */
4504 __pyx_t_2 = (__pyx_v_ps12 != __pyx_v_ps12);
4868 __pyx_t_2 = ((__pyx_v_ps12 != __pyx_v_ps12) != 0);
45054869 if (__pyx_t_2) {
45064870
4507 /* "_proj.pyx":472
4871 /* "_proj.pyx":485
45084872 * pazi2 = pazi2+180.
45094873 * if ps12 != ps12: # check for NaN
45104874 * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<<
45114875 * if radians:
45124876 * lonsdata[i] = _rad2dg*pazi1
45134877 */
4514 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4878 __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45154879 __Pyx_GOTREF(__pyx_t_5);
45164880 __Pyx_Raise(__pyx_t_5, 0, 0, 0);
45174881 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4518 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4882 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45194883 goto __pyx_L12;
45204884 }
45214885 __pyx_L12:;
45224886
4523 /* "_proj.pyx":473
4887 /* "_proj.pyx":486
45244888 * if ps12 != ps12: # check for NaN
45254889 * raise ValueError('undefined inverse geodesic (may be an antipodal point)')
45264890 * if radians: # <<<<<<<<<<<<<<
45274891 * lonsdata[i] = _rad2dg*pazi1
45284892 * latsdata[i] = _rad2dg*pazi2
45294893 */
4530 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
4894 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
45314895 if (__pyx_t_2) {
45324896
4533 /* "_proj.pyx":474
4897 /* "_proj.pyx":487
45344898 * raise ValueError('undefined inverse geodesic (may be an antipodal point)')
45354899 * if radians:
45364900 * lonsdata[i] = _rad2dg*pazi1 # <<<<<<<<<<<<<<
45394903 */
45404904 (__pyx_v_lonsdata[__pyx_v_i]) = (__pyx_v_5_proj__rad2dg * __pyx_v_pazi1);
45414905
4542 /* "_proj.pyx":475
4906 /* "_proj.pyx":488
45434907 * if radians:
45444908 * lonsdata[i] = _rad2dg*pazi1
45454909 * latsdata[i] = _rad2dg*pazi2 # <<<<<<<<<<<<<<
45514915 }
45524916 /*else*/ {
45534917
4554 /* "_proj.pyx":477
4918 /* "_proj.pyx":490
45554919 * latsdata[i] = _rad2dg*pazi2
45564920 * else:
45574921 * lonsdata[i] = pazi1 # <<<<<<<<<<<<<<
45604924 */
45614925 (__pyx_v_lonsdata[__pyx_v_i]) = __pyx_v_pazi1;
45624926
4563 /* "_proj.pyx":478
4927 /* "_proj.pyx":491
45644928 * else:
45654929 * lonsdata[i] = pazi1
45664930 * latsdata[i] = pazi2 # <<<<<<<<<<<<<<
45714935 }
45724936 __pyx_L13:;
45734937
4574 /* "_proj.pyx":479
4938 /* "_proj.pyx":492
45754939 * lonsdata[i] = pazi1
45764940 * latsdata[i] = pazi2
45774941 * azdata[i] = ps12 # <<<<<<<<<<<<<<
46064970 double __pyx_v_lat2;
46074971 int __pyx_v_npts;
46084972 PyObject *__pyx_v_radians = 0;
4973 int __pyx_lineno = 0;
4974 const char *__pyx_filename = NULL;
4975 int __pyx_clineno = 0;
46094976 PyObject *__pyx_r = 0;
46104977 __Pyx_RefNannyDeclarations
46114978 __Pyx_RefNannySetupContext("_npts (wrapper)", 0);
46345001 case 1:
46355002 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lat1)) != 0)) kw_args--;
46365003 else {
4637 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5004 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46385005 }
46395006 case 2:
46405007 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lon2)) != 0)) kw_args--;
46415008 else {
4642 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5009 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46435010 }
46445011 case 3:
46455012 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lat2)) != 0)) kw_args--;
46465013 else {
4647 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5014 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46485015 }
46495016 case 4:
46505017 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__npts)) != 0)) kw_args--;
46515018 else {
4652 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5019 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46535020 }
46545021 case 5:
46555022 if (kw_args > 0) {
46585025 }
46595026 }
46605027 if (unlikely(kw_args > 0)) {
4661 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_npts") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5028 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_npts") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46625029 }
46635030 } else {
46645031 switch (PyTuple_GET_SIZE(__pyx_args)) {
46725039 default: goto __pyx_L5_argtuple_error;
46735040 }
46745041 }
4675 __pyx_v_lon1 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_lon1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4676 __pyx_v_lat1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_lat1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4677 __pyx_v_lon2 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_lon2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4678 __pyx_v_lat2 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_lat2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
4679 __pyx_v_npts = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_npts == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5042 __pyx_v_lon1 = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_lon1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5043 __pyx_v_lat1 = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_lat1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5044 __pyx_v_lon2 = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_lon2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5045 __pyx_v_lat2 = __pyx_PyFloat_AsDouble(values[3]); if (unlikely((__pyx_v_lat2 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5046 __pyx_v_npts = __Pyx_PyInt_AsInt(values[4]); if (unlikely((__pyx_v_npts == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46805047 __pyx_v_radians = values[5];
46815048 }
46825049 goto __pyx_L4_argument_unpacking_done;
46835050 __pyx_L5_argtuple_error:;
4684 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
5051 __Pyx_RaiseArgtupleInvalid("_npts", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
46855052 __pyx_L3_error:;
46865053 __Pyx_AddTraceback("_proj.Geod._npts", __pyx_clineno, __pyx_lineno, __pyx_filename);
46875054 __Pyx_RefNannyFinishContext();
46925059 return __pyx_r;
46935060 }
46945061
4695 /* "_proj.pyx":481
5062 /* "_proj.pyx":494
46965063 * azdata[i] = ps12
46975064 *
46985065 * def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False): # <<<<<<<<<<<<<<
47225089 int __pyx_clineno = 0;
47235090 __Pyx_RefNannySetupContext("_npts", 0);
47245091
4725 /* "_proj.pyx":486
5092 /* "_proj.pyx":499
47265093 * cdef int i
47275094 * cdef double del_s,ps12,pazi1,pazi2,s12,plon2,plat2
47285095 * if radians: # <<<<<<<<<<<<<<
47295096 * lon1 = _rad2dg*lon1
47305097 * lat1 = _rad2dg*lat1
47315098 */
4732 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5099 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47335100 if (__pyx_t_1) {
47345101
4735 /* "_proj.pyx":487
5102 /* "_proj.pyx":500
47365103 * cdef double del_s,ps12,pazi1,pazi2,s12,plon2,plat2
47375104 * if radians:
47385105 * lon1 = _rad2dg*lon1 # <<<<<<<<<<<<<<
47415108 */
47425109 __pyx_v_lon1 = (__pyx_v_5_proj__rad2dg * __pyx_v_lon1);
47435110
4744 /* "_proj.pyx":488
5111 /* "_proj.pyx":501
47455112 * if radians:
47465113 * lon1 = _rad2dg*lon1
47475114 * lat1 = _rad2dg*lat1 # <<<<<<<<<<<<<<
47505117 */
47515118 __pyx_v_lat1 = (__pyx_v_5_proj__rad2dg * __pyx_v_lat1);
47525119
4753 /* "_proj.pyx":489
5120 /* "_proj.pyx":502
47545121 * lon1 = _rad2dg*lon1
47555122 * lat1 = _rad2dg*lat1
47565123 * lon2 = _rad2dg*lon2 # <<<<<<<<<<<<<<
47595126 */
47605127 __pyx_v_lon2 = (__pyx_v_5_proj__rad2dg * __pyx_v_lon2);
47615128
4762 /* "_proj.pyx":490
5129 /* "_proj.pyx":503
47635130 * lat1 = _rad2dg*lat1
47645131 * lon2 = _rad2dg*lon2
47655132 * lat2 = _rad2dg*lat2 # <<<<<<<<<<<<<<
47665133 * # do inverse computation to set azimuths, distance.
4767 * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2,
5134 * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2,
47685135 */
47695136 __pyx_v_lat2 = (__pyx_v_5_proj__rad2dg * __pyx_v_lat2);
47705137 goto __pyx_L3;
47715138 }
47725139 __pyx_L3:;
47735140
4774 /* "_proj.pyx":493
5141 /* "_proj.pyx":506
47755142 * # do inverse computation to set azimuths, distance.
4776 * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2,
5143 * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2,
47775144 * &ps12, &pazi1, &pazi2) # <<<<<<<<<<<<<<
47785145 * # distance increment.
47795146 * del_s = ps12/(npts+1)
47805147 */
4781 Inverse((&__pyx_v_self->_Geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_lat2, __pyx_v_lon2, (&__pyx_v_ps12), (&__pyx_v_pazi1), (&__pyx_v_pazi2));
4782
4783 /* "_proj.pyx":495
5148 geod_inverse((&__pyx_v_self->_geod_geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_lat2, __pyx_v_lon2, (&__pyx_v_ps12), (&__pyx_v_pazi1), (&__pyx_v_pazi2));
5149
5150 /* "_proj.pyx":508
47845151 * &ps12, &pazi1, &pazi2)
47855152 * # distance increment.
47865153 * del_s = ps12/(npts+1) # <<<<<<<<<<<<<<
47895156 */
47905157 __pyx_t_2 = (__pyx_v_npts + 1);
47915158 if (unlikely(__pyx_t_2 == 0)) {
5159 #ifdef WITH_THREAD
5160 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
5161 #endif
47925162 PyErr_Format(PyExc_ZeroDivisionError, "float division");
4793 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5163 #ifdef WITH_THREAD
5164 PyGILState_Release(__pyx_gilstate_save);
5165 #endif
5166 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
47945167 }
47955168 __pyx_v_del_s = (__pyx_v_ps12 / __pyx_t_2);
47965169
4797 /* "_proj.pyx":497
5170 /* "_proj.pyx":510
47985171 * del_s = ps12/(npts+1)
47995172 * # initialize output tuples.
48005173 * lats = () # <<<<<<<<<<<<<<
48045177 __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
48055178 __pyx_v_lats = __pyx_empty_tuple;
48065179
4807 /* "_proj.pyx":498
5180 /* "_proj.pyx":511
48085181 * # initialize output tuples.
48095182 * lats = ()
48105183 * lons = () # <<<<<<<<<<<<<<
48145187 __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
48155188 __pyx_v_lons = __pyx_empty_tuple;
48165189
4817 /* "_proj.pyx":500
5190 /* "_proj.pyx":513
48185191 * lons = ()
48195192 * # loop over intermediate points, compute lat/lons.
48205193 * for i from 1 <= i < npts+1: # <<<<<<<<<<<<<<
48215194 * s12 = i*del_s
4822 * Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\
5195 * geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\
48235196 */
48245197 __pyx_t_2 = (__pyx_v_npts + 1);
48255198 for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) {
48265199
4827 /* "_proj.pyx":501
5200 /* "_proj.pyx":514
48285201 * # loop over intermediate points, compute lat/lons.
48295202 * for i from 1 <= i < npts+1:
48305203 * s12 = i*del_s # <<<<<<<<<<<<<<
4831 * Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\
5204 * geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\
48325205 * &plat2, &plon2, &pazi2)
48335206 */
48345207 __pyx_v_s12 = (__pyx_v_i * __pyx_v_del_s);
48355208
4836 /* "_proj.pyx":503
5209 /* "_proj.pyx":516
48375210 * s12 = i*del_s
4838 * Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\
5211 * geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\
48395212 * &plat2, &plon2, &pazi2) # <<<<<<<<<<<<<<
48405213 * if radians:
48415214 * lats = lats + (_dg2rad*plat2,)
48425215 */
4843 Direct((&__pyx_v_self->_Geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_pazi1, __pyx_v_s12, (&__pyx_v_plat2), (&__pyx_v_plon2), (&__pyx_v_pazi2));
4844
4845 /* "_proj.pyx":504
4846 * Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\
5216 geod_direct((&__pyx_v_self->_geod_geodesic), __pyx_v_lat1, __pyx_v_lon1, __pyx_v_pazi1, __pyx_v_s12, (&__pyx_v_plat2), (&__pyx_v_plon2), (&__pyx_v_pazi2));
5217
5218 /* "_proj.pyx":517
5219 * geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\
48475220 * &plat2, &plon2, &pazi2)
48485221 * if radians: # <<<<<<<<<<<<<<
48495222 * lats = lats + (_dg2rad*plat2,)
48505223 * lons = lons + (_dg2rad*plon2,)
48515224 */
4852 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5225 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_radians); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48535226 if (__pyx_t_1) {
48545227
4855 /* "_proj.pyx":505
5228 /* "_proj.pyx":518
48565229 * &plat2, &plon2, &pazi2)
48575230 * if radians:
48585231 * lats = lats + (_dg2rad*plat2,) # <<<<<<<<<<<<<<
48595232 * lons = lons + (_dg2rad*plon2,)
48605233 * else:
48615234 */
4862 __pyx_t_3 = PyFloat_FromDouble((__pyx_v_5_proj__dg2rad * __pyx_v_plat2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5235 __pyx_t_3 = PyFloat_FromDouble((__pyx_v_5_proj__dg2rad * __pyx_v_plat2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48635236 __Pyx_GOTREF(__pyx_t_3);
4864 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5237 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48655238 __Pyx_GOTREF(__pyx_t_4);
48665239 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
48675240 __Pyx_GIVEREF(__pyx_t_3);
48685241 __pyx_t_3 = 0;
4869 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lats), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5242 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lats), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48705243 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
48715244 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
48725245 __Pyx_DECREF(((PyObject *)__pyx_v_lats));
4873 __pyx_v_lats = __pyx_t_3;
5246 __pyx_v_lats = ((PyObject*)__pyx_t_3);
48745247 __pyx_t_3 = 0;
48755248
4876 /* "_proj.pyx":506
5249 /* "_proj.pyx":519
48775250 * if radians:
48785251 * lats = lats + (_dg2rad*plat2,)
48795252 * lons = lons + (_dg2rad*plon2,) # <<<<<<<<<<<<<<
48805253 * else:
48815254 * lats = lats + (plat2,)
48825255 */
4883 __pyx_t_3 = PyFloat_FromDouble((__pyx_v_5_proj__dg2rad * __pyx_v_plon2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5256 __pyx_t_3 = PyFloat_FromDouble((__pyx_v_5_proj__dg2rad * __pyx_v_plon2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48845257 __Pyx_GOTREF(__pyx_t_3);
4885 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5258 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48865259 __Pyx_GOTREF(__pyx_t_4);
48875260 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
48885261 __Pyx_GIVEREF(__pyx_t_3);
48895262 __pyx_t_3 = 0;
4890 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lons), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5263 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lons), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
48915264 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
48925265 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
48935266 __Pyx_DECREF(((PyObject *)__pyx_v_lons));
4894 __pyx_v_lons = __pyx_t_3;
5267 __pyx_v_lons = ((PyObject*)__pyx_t_3);
48955268 __pyx_t_3 = 0;
48965269 goto __pyx_L6;
48975270 }
48985271 /*else*/ {
48995272
4900 /* "_proj.pyx":508
5273 /* "_proj.pyx":521
49015274 * lons = lons + (_dg2rad*plon2,)
49025275 * else:
49035276 * lats = lats + (plat2,) # <<<<<<<<<<<<<<
49045277 * lons = lons + (plon2,)
49055278 * return lons, lats
49065279 */
4907 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_plat2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5280 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_plat2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49085281 __Pyx_GOTREF(__pyx_t_3);
4909 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5282 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49105283 __Pyx_GOTREF(__pyx_t_4);
49115284 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
49125285 __Pyx_GIVEREF(__pyx_t_3);
49135286 __pyx_t_3 = 0;
4914 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lats), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5287 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lats), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49155288 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
49165289 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
49175290 __Pyx_DECREF(((PyObject *)__pyx_v_lats));
4918 __pyx_v_lats = __pyx_t_3;
5291 __pyx_v_lats = ((PyObject*)__pyx_t_3);
49195292 __pyx_t_3 = 0;
49205293
4921 /* "_proj.pyx":509
5294 /* "_proj.pyx":522
49225295 * else:
49235296 * lats = lats + (plat2,)
49245297 * lons = lons + (plon2,) # <<<<<<<<<<<<<<
49255298 * return lons, lats
49265299 */
4927 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_plon2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5300 __pyx_t_3 = PyFloat_FromDouble(__pyx_v_plon2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49285301 __Pyx_GOTREF(__pyx_t_3);
4929 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5302 __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49305303 __Pyx_GOTREF(__pyx_t_4);
49315304 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
49325305 __Pyx_GIVEREF(__pyx_t_3);
49335306 __pyx_t_3 = 0;
4934 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lons), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5307 __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_v_lons), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49355308 __Pyx_GOTREF(((PyObject *)__pyx_t_3));
49365309 __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
49375310 __Pyx_DECREF(((PyObject *)__pyx_v_lons));
4938 __pyx_v_lons = __pyx_t_3;
5311 __pyx_v_lons = ((PyObject*)__pyx_t_3);
49395312 __pyx_t_3 = 0;
49405313 }
49415314 __pyx_L6:;
49425315 }
49435316
4944 /* "_proj.pyx":510
5317 /* "_proj.pyx":523
49455318 * lats = lats + (plat2,)
49465319 * lons = lons + (plon2,)
49475320 * return lons, lats # <<<<<<<<<<<<<<
49485321 */
49495322 __Pyx_XDECREF(__pyx_r);
4950 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5323 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
49515324 __Pyx_GOTREF(__pyx_t_3);
49525325 __Pyx_INCREF(((PyObject *)__pyx_v_lons));
49535326 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_lons));
49855358 return __pyx_r;
49865359 }
49875360
4988 /* "_proj.pyx":355
5361 /* "_proj.pyx":368
49895362 * cdef class Geod:
4990 * cdef Geodesic _Geodesic
5363 * cdef geod_geodesic _geod_geodesic
49915364 * cdef public object initstring # <<<<<<<<<<<<<<
49925365 *
49935366 * def __cinit__(self, a, f):
50635436
50645437 static PyObject *__pyx_tp_new_5_proj_Proj(PyTypeObject *t, PyObject *a, PyObject *k) {
50655438 struct __pyx_obj_5_proj_Proj *p;
5066 PyObject *o = (*t->tp_alloc)(t, 0);
5067 if (!o) return 0;
5439 PyObject *o;
5440 o = (*t->tp_alloc)(t, 0);
5441 if (unlikely(!o)) return 0;
50685442 p = ((struct __pyx_obj_5_proj_Proj *)o);
50695443 p->proj_version = Py_None; Py_INCREF(Py_None);
50705444 p->srs = Py_None; Py_INCREF(Py_None);
5071 if (__pyx_pw_5_proj_4Proj_1__cinit__(o, a, k) < 0) {
5445 if (unlikely(__pyx_pw_5_proj_4Proj_1__cinit__(o, a, k) < 0)) {
50725446 Py_DECREF(o); o = 0;
50735447 }
50745448 return o;
50885462 }
50895463 Py_CLEAR(p->proj_version);
50905464 Py_CLEAR(p->srs);
5091 PyObject_GC_Track(o);
50925465 (*Py_TYPE(o)->tp_free)(o);
50935466 }
50945467
51435516 }
51445517
51455518 static PyMethodDef __pyx_methods_5_proj_Proj[] = {
5146 {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_5_proj_4Proj_5__reduce__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5_proj_4Proj_4__reduce__)},
5147 {__Pyx_NAMESTR("_fwd"), (PyCFunction)__pyx_pw_5_proj_4Proj_7_fwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5_proj_4Proj_6_fwd)},
5148 {__Pyx_NAMESTR("_inv"), (PyCFunction)__pyx_pw_5_proj_4Proj_9_inv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5_proj_4Proj_8_inv)},
5149 {__Pyx_NAMESTR("is_latlong"), (PyCFunction)__pyx_pw_5_proj_4Proj_11is_latlong, METH_NOARGS, __Pyx_DOCSTR(0)},
5150 {__Pyx_NAMESTR("is_geocent"), (PyCFunction)__pyx_pw_5_proj_4Proj_13is_geocent, METH_NOARGS, __Pyx_DOCSTR(0)},
5519 {__Pyx_NAMESTR("to_latlong"), (PyCFunction)__pyx_pw_5_proj_4Proj_5to_latlong, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5_proj_4Proj_4to_latlong)},
5520 {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_5_proj_4Proj_7__reduce__, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_5_proj_4Proj_6__reduce__)},
5521 {__Pyx_NAMESTR("_fwd"), (PyCFunction)__pyx_pw_5_proj_4Proj_9_fwd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5_proj_4Proj_8_fwd)},
5522 {__Pyx_NAMESTR("_inv"), (PyCFunction)__pyx_pw_5_proj_4Proj_11_inv, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_5_proj_4Proj_10_inv)},
5523 {__Pyx_NAMESTR("is_latlong"), (PyCFunction)__pyx_pw_5_proj_4Proj_13is_latlong, METH_NOARGS, __Pyx_DOCSTR(0)},
5524 {__Pyx_NAMESTR("is_geocent"), (PyCFunction)__pyx_pw_5_proj_4Proj_15is_geocent, METH_NOARGS, __Pyx_DOCSTR(0)},
51515525 {0, 0, 0, 0}
51525526 };
51535527
51555529 {(char *)"proj_version", __pyx_getprop_5_proj_4Proj_proj_version, __pyx_setprop_5_proj_4Proj_proj_version, 0, 0},
51565530 {(char *)"srs", __pyx_getprop_5_proj_4Proj_srs, __pyx_setprop_5_proj_4Proj_srs, 0, 0},
51575531 {0, 0, 0, 0, 0}
5158 };
5159
5160 static PyNumberMethods __pyx_tp_as_number_Proj = {
5161 0, /*nb_add*/
5162 0, /*nb_subtract*/
5163 0, /*nb_multiply*/
5164 #if PY_MAJOR_VERSION < 3
5165 0, /*nb_divide*/
5166 #endif
5167 0, /*nb_remainder*/
5168 0, /*nb_divmod*/
5169 0, /*nb_power*/
5170 0, /*nb_negative*/
5171 0, /*nb_positive*/
5172 0, /*nb_absolute*/
5173 0, /*nb_nonzero*/
5174 0, /*nb_invert*/
5175 0, /*nb_lshift*/
5176 0, /*nb_rshift*/
5177 0, /*nb_and*/
5178 0, /*nb_xor*/
5179 0, /*nb_or*/
5180 #if PY_MAJOR_VERSION < 3
5181 0, /*nb_coerce*/
5182 #endif
5183 0, /*nb_int*/
5184 #if PY_MAJOR_VERSION < 3
5185 0, /*nb_long*/
5186 #else
5187 0, /*reserved*/
5188 #endif
5189 0, /*nb_float*/
5190 #if PY_MAJOR_VERSION < 3
5191 0, /*nb_oct*/
5192 #endif
5193 #if PY_MAJOR_VERSION < 3
5194 0, /*nb_hex*/
5195 #endif
5196 0, /*nb_inplace_add*/
5197 0, /*nb_inplace_subtract*/
5198 0, /*nb_inplace_multiply*/
5199 #if PY_MAJOR_VERSION < 3
5200 0, /*nb_inplace_divide*/
5201 #endif
5202 0, /*nb_inplace_remainder*/
5203 0, /*nb_inplace_power*/
5204 0, /*nb_inplace_lshift*/
5205 0, /*nb_inplace_rshift*/
5206 0, /*nb_inplace_and*/
5207 0, /*nb_inplace_xor*/
5208 0, /*nb_inplace_or*/
5209 0, /*nb_floor_divide*/
5210 0, /*nb_true_divide*/
5211 0, /*nb_inplace_floor_divide*/
5212 0, /*nb_inplace_true_divide*/
5213 #if PY_VERSION_HEX >= 0x02050000
5214 0, /*nb_index*/
5215 #endif
5216 };
5217
5218 static PySequenceMethods __pyx_tp_as_sequence_Proj = {
5219 0, /*sq_length*/
5220 0, /*sq_concat*/
5221 0, /*sq_repeat*/
5222 0, /*sq_item*/
5223 0, /*sq_slice*/
5224 0, /*sq_ass_item*/
5225 0, /*sq_ass_slice*/
5226 0, /*sq_contains*/
5227 0, /*sq_inplace_concat*/
5228 0, /*sq_inplace_repeat*/
5229 };
5230
5231 static PyMappingMethods __pyx_tp_as_mapping_Proj = {
5232 0, /*mp_length*/
5233 0, /*mp_subscript*/
5234 0, /*mp_ass_subscript*/
5235 };
5236
5237 static PyBufferProcs __pyx_tp_as_buffer_Proj = {
5238 #if PY_MAJOR_VERSION < 3
5239 0, /*bf_getreadbuffer*/
5240 #endif
5241 #if PY_MAJOR_VERSION < 3
5242 0, /*bf_getwritebuffer*/
5243 #endif
5244 #if PY_MAJOR_VERSION < 3
5245 0, /*bf_getsegcount*/
5246 #endif
5247 #if PY_MAJOR_VERSION < 3
5248 0, /*bf_getcharbuffer*/
5249 #endif
5250 #if PY_VERSION_HEX >= 0x02060000
5251 0, /*bf_getbuffer*/
5252 #endif
5253 #if PY_VERSION_HEX >= 0x02060000
5254 0, /*bf_releasebuffer*/
5255 #endif
52565532 };
52575533
52585534 static PyTypeObject __pyx_type_5_proj_Proj = {
52705546 0, /*reserved*/
52715547 #endif
52725548 0, /*tp_repr*/
5273 &__pyx_tp_as_number_Proj, /*tp_as_number*/
5274 &__pyx_tp_as_sequence_Proj, /*tp_as_sequence*/
5275 &__pyx_tp_as_mapping_Proj, /*tp_as_mapping*/
5549 0, /*tp_as_number*/
5550 0, /*tp_as_sequence*/
5551 0, /*tp_as_mapping*/
52765552 0, /*tp_hash*/
52775553 0, /*tp_call*/
52785554 0, /*tp_str*/
52795555 0, /*tp_getattro*/
52805556 0, /*tp_setattro*/
5281 &__pyx_tp_as_buffer_Proj, /*tp_as_buffer*/
5282 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
5557 0, /*tp_as_buffer*/
5558 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
52835559 0, /*tp_doc*/
52845560 __pyx_tp_traverse_5_proj_Proj, /*tp_traverse*/
52855561 __pyx_tp_clear_5_proj_Proj, /*tp_clear*/
53135589
53145590 static PyObject *__pyx_tp_new_5_proj_Geod(PyTypeObject *t, PyObject *a, PyObject *k) {
53155591 struct __pyx_obj_5_proj_Geod *p;
5316 PyObject *o = (*t->tp_alloc)(t, 0);
5317 if (!o) return 0;
5592 PyObject *o;
5593 o = (*t->tp_alloc)(t, 0);
5594 if (unlikely(!o)) return 0;
53185595 p = ((struct __pyx_obj_5_proj_Geod *)o);
53195596 p->initstring = Py_None; Py_INCREF(Py_None);
5320 if (__pyx_pw_5_proj_4Geod_1__cinit__(o, a, k) < 0) {
5597 if (unlikely(__pyx_pw_5_proj_4Geod_1__cinit__(o, a, k) < 0)) {
53215598 Py_DECREF(o); o = 0;
53225599 }
53235600 return o;
53275604 struct __pyx_obj_5_proj_Geod *p = (struct __pyx_obj_5_proj_Geod *)o;
53285605 PyObject_GC_UnTrack(o);
53295606 Py_CLEAR(p->initstring);
5330 PyObject_GC_Track(o);
53315607 (*Py_TYPE(o)->tp_free)(o);
53325608 }
53335609
53735649 static struct PyGetSetDef __pyx_getsets_5_proj_Geod[] = {
53745650 {(char *)"initstring", __pyx_getprop_5_proj_4Geod_initstring, __pyx_setprop_5_proj_4Geod_initstring, 0, 0},
53755651 {0, 0, 0, 0, 0}
5376 };
5377
5378 static PyNumberMethods __pyx_tp_as_number_Geod = {
5379 0, /*nb_add*/
5380 0, /*nb_subtract*/
5381 0, /*nb_multiply*/
5382 #if PY_MAJOR_VERSION < 3
5383 0, /*nb_divide*/
5384 #endif
5385 0, /*nb_remainder*/
5386 0, /*nb_divmod*/
5387 0, /*nb_power*/
5388 0, /*nb_negative*/
5389 0, /*nb_positive*/
5390 0, /*nb_absolute*/
5391 0, /*nb_nonzero*/
5392 0, /*nb_invert*/
5393 0, /*nb_lshift*/
5394 0, /*nb_rshift*/
5395 0, /*nb_and*/
5396 0, /*nb_xor*/
5397 0, /*nb_or*/
5398 #if PY_MAJOR_VERSION < 3
5399 0, /*nb_coerce*/
5400 #endif
5401 0, /*nb_int*/
5402 #if PY_MAJOR_VERSION < 3
5403 0, /*nb_long*/
5404 #else
5405 0, /*reserved*/
5406 #endif
5407 0, /*nb_float*/
5408 #if PY_MAJOR_VERSION < 3
5409 0, /*nb_oct*/
5410 #endif
5411 #if PY_MAJOR_VERSION < 3
5412 0, /*nb_hex*/
5413 #endif
5414 0, /*nb_inplace_add*/
5415 0, /*nb_inplace_subtract*/
5416 0, /*nb_inplace_multiply*/
5417 #if PY_MAJOR_VERSION < 3
5418 0, /*nb_inplace_divide*/
5419 #endif
5420 0, /*nb_inplace_remainder*/
5421 0, /*nb_inplace_power*/
5422 0, /*nb_inplace_lshift*/
5423 0, /*nb_inplace_rshift*/
5424 0, /*nb_inplace_and*/
5425 0, /*nb_inplace_xor*/
5426 0, /*nb_inplace_or*/
5427 0, /*nb_floor_divide*/
5428 0, /*nb_true_divide*/
5429 0, /*nb_inplace_floor_divide*/
5430 0, /*nb_inplace_true_divide*/
5431 #if PY_VERSION_HEX >= 0x02050000
5432 0, /*nb_index*/
5433 #endif
5434 };
5435
5436 static PySequenceMethods __pyx_tp_as_sequence_Geod = {
5437 0, /*sq_length*/
5438 0, /*sq_concat*/
5439 0, /*sq_repeat*/
5440 0, /*sq_item*/
5441 0, /*sq_slice*/
5442 0, /*sq_ass_item*/
5443 0, /*sq_ass_slice*/
5444 0, /*sq_contains*/
5445 0, /*sq_inplace_concat*/
5446 0, /*sq_inplace_repeat*/
5447 };
5448
5449 static PyMappingMethods __pyx_tp_as_mapping_Geod = {
5450 0, /*mp_length*/
5451 0, /*mp_subscript*/
5452 0, /*mp_ass_subscript*/
5453 };
5454
5455 static PyBufferProcs __pyx_tp_as_buffer_Geod = {
5456 #if PY_MAJOR_VERSION < 3
5457 0, /*bf_getreadbuffer*/
5458 #endif
5459 #if PY_MAJOR_VERSION < 3
5460 0, /*bf_getwritebuffer*/
5461 #endif
5462 #if PY_MAJOR_VERSION < 3
5463 0, /*bf_getsegcount*/
5464 #endif
5465 #if PY_MAJOR_VERSION < 3
5466 0, /*bf_getcharbuffer*/
5467 #endif
5468 #if PY_VERSION_HEX >= 0x02060000
5469 0, /*bf_getbuffer*/
5470 #endif
5471 #if PY_VERSION_HEX >= 0x02060000
5472 0, /*bf_releasebuffer*/
5473 #endif
54745652 };
54755653
54765654 static PyTypeObject __pyx_type_5_proj_Geod = {
54885666 0, /*reserved*/
54895667 #endif
54905668 0, /*tp_repr*/
5491 &__pyx_tp_as_number_Geod, /*tp_as_number*/
5492 &__pyx_tp_as_sequence_Geod, /*tp_as_sequence*/
5493 &__pyx_tp_as_mapping_Geod, /*tp_as_mapping*/
5669 0, /*tp_as_number*/
5670 0, /*tp_as_sequence*/
5671 0, /*tp_as_mapping*/
54945672 0, /*tp_hash*/
54955673 0, /*tp_call*/
54965674 0, /*tp_str*/
54975675 0, /*tp_getattro*/
54985676 0, /*tp_setattro*/
5499 &__pyx_tp_as_buffer_Geod, /*tp_as_buffer*/
5500 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
5677 0, /*tp_as_buffer*/
5678 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
55015679 0, /*tp_doc*/
55025680 __pyx_tp_traverse_5_proj_Geod, /*tp_traverse*/
55035681 __pyx_tp_clear_5_proj_Geod, /*tp_clear*/
55355713
55365714 #if PY_MAJOR_VERSION >= 3
55375715 static struct PyModuleDef __pyx_moduledef = {
5716 #if PY_VERSION_HEX < 0x03020000
5717 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
5718 #else
55385719 PyModuleDef_HEAD_INIT,
5720 #endif
55395721 __Pyx_NAMESTR("_proj"),
55405722 0, /* m_doc */
55415723 -1, /* m_size */
55595741 {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
55605742 {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
55615743 {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
5744 {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
55625745 {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
55635746 {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
55645747 {&__pyx_n_s____version__, __pyx_k____version__, sizeof(__pyx_k____version__), 0, 0, 1, 1},
5748 {&__pyx_n_s___createproj, __pyx_k___createproj, sizeof(__pyx_k___createproj), 0, 0, 1, 1},
55655749 {&__pyx_n_s___doublesize, __pyx_k___doublesize, sizeof(__pyx_k___doublesize), 0, 0, 1, 1},
55665750 {&__pyx_n_s___proj, __pyx_k___proj, sizeof(__pyx_k___proj), 0, 0, 1, 1},
55675751 {&__pyx_n_s___transform, __pyx_k___transform, sizeof(__pyx_k___transform), 0, 0, 1, 1},
56135797 {0, 0, 0, 0, 0, 0, 0}
56145798 };
56155799 static int __Pyx_InitCachedBuiltins(void) {
5616 __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5617 __pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5618 __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5800 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5801 __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s__AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5802 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56195803 return 0;
56205804 __pyx_L1_error:;
56215805 return -1;
56255809 __Pyx_RefNannyDeclarations
56265810 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
56275811
5628 /* "_proj.pyx":113
5812 /* "_proj.pyx":126
56295813 * # process data in buffer
56305814 * if buflenx != bufleny:
56315815 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
56325816 * ndim = buflenx//_doublesize
56335817 * lonsdata = <double *>londata
56345818 */
5635 __pyx_k_tuple_4 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5819 __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56365820 __Pyx_GOTREF(__pyx_k_tuple_4);
5637 __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
5638 PyTuple_SET_ITEM(__pyx_k_tuple_4, 0, ((PyObject *)__pyx_kp_s_3));
5639 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
56405821 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
56415822
5642 /* "_proj.pyx":122
5823 /* "_proj.pyx":135
56435824 * lonsdata[i]=1.e30; latsdata[i]=1.e30
56445825 * if errcheck:
56455826 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
56465827 * continue
56475828 * if radians:
56485829 */
5649 __pyx_k_tuple_6 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5830 __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56505831 __Pyx_GOTREF(__pyx_k_tuple_6);
5651 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
5652 PyTuple_SET_ITEM(__pyx_k_tuple_6, 0, ((PyObject *)__pyx_kp_s_5));
5653 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
56545832 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
56555833
5656 /* "_proj.pyx":141
5834 /* "_proj.pyx":154
56575835 * projxyout.u != projxyout.u:
56585836 * if errcheck:
56595837 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
56605838 * lonsdata[i] = 1.e30
56615839 * else:
56625840 */
5663 __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5841 __pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56645842 __Pyx_GOTREF(__pyx_k_tuple_7);
5665 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
5666 PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_s_5));
5667 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
56685843 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
56695844
5670 /* "_proj.pyx":148
5845 /* "_proj.pyx":161
56715846 * projxyout.u != projxyout.u:
56725847 * if errcheck:
56735848 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
56745849 * latsdata[i] = 1.e30
56755850 * else:
56765851 */
5677 __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5852 __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56785853 __Pyx_GOTREF(__pyx_k_tuple_8);
5679 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
5680 PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_5));
5681 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
56825854 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
56835855
5684 /* "_proj.pyx":174
5856 /* "_proj.pyx":187
56855857 * # (for numpy/regular python arrays).
56865858 * if buflenx != bufleny:
56875859 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
56885860 * ndim = buflenx//_doublesize
56895861 * xdatab = <double *>xdata
56905862 */
5691 __pyx_k_tuple_11 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5863 __pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
56925864 __Pyx_GOTREF(__pyx_k_tuple_11);
5693 __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
5694 PyTuple_SET_ITEM(__pyx_k_tuple_11, 0, ((PyObject *)__pyx_kp_s_3));
5695 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
56965865 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
56975866
5698 /* "_proj.pyx":183
5867 /* "_proj.pyx":196
56995868 * xdatab[i]=1.e30; ydatab[i]=1.e30
57005869 * if errcheck:
57015870 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
57025871 * continue
57035872 * projxyin.u = xdatab[i]
57045873 */
5705 __pyx_k_tuple_12 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5874 __pyx_k_tuple_12 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57065875 __Pyx_GOTREF(__pyx_k_tuple_12);
5707 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
5708 PyTuple_SET_ITEM(__pyx_k_tuple_12, 0, ((PyObject *)__pyx_kp_s_5));
5709 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
57105876 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
57115877
5712 /* "_proj.pyx":198
5878 /* "_proj.pyx":211
57135879 * projlonlatout.u != projlonlatout.u:
57145880 * if errcheck:
57155881 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
57165882 * xdatab[i] = 1.e30
57175883 * elif radians:
57185884 */
5719 __pyx_k_tuple_13 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5885 __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57205886 __Pyx_GOTREF(__pyx_k_tuple_13);
5721 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
5722 PyTuple_SET_ITEM(__pyx_k_tuple_13, 0, ((PyObject *)__pyx_kp_s_5));
5723 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
57245887 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
57255888
5726 /* "_proj.pyx":207
5889 /* "_proj.pyx":220
57275890 * projlonlatout.v != projlonlatout.v:
57285891 * if errcheck:
57295892 * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<<
57305893 * ydatab[i] = 1.e30
57315894 * elif radians:
57325895 */
5733 __pyx_k_tuple_14 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5896 __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57345897 __Pyx_GOTREF(__pyx_k_tuple_14);
5735 __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
5736 PyTuple_SET_ITEM(__pyx_k_tuple_14, 0, ((PyObject *)__pyx_kp_s_5));
5737 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
57385898 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
57395899
5740 /* "_proj.pyx":325
5900 /* "_proj.pyx":338
57415901 * buflenz = bufleny
57425902 * if not (buflenx == bufleny == buflenz):
57435903 * raise RuntimeError('x,y and z must be same size') # <<<<<<<<<<<<<<
57445904 * xx = <double *>xdata
57455905 * yy = <double *>ydata
57465906 */
5747 __pyx_k_tuple_16 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5907 __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57485908 __Pyx_GOTREF(__pyx_k_tuple_16);
5749 __Pyx_INCREF(((PyObject *)__pyx_kp_s_15));
5750 PyTuple_SET_ITEM(__pyx_k_tuple_16, 0, ((PyObject *)__pyx_kp_s_15));
5751 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_15));
57525909 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
57535910
5754 /* "_proj.pyx":387
5911 /* "_proj.pyx":400
57555912 * # process data in buffer
57565913 * if not buflenlons == buflenlats == buflenaz == buflend:
57575914 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
57585915 * ndim = buflenlons//_doublesize
57595916 * lonsdata = <double *>londata
57605917 */
5761 __pyx_k_tuple_19 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5918 __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57625919 __Pyx_GOTREF(__pyx_k_tuple_19);
5763 __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
5764 PyTuple_SET_ITEM(__pyx_k_tuple_19, 0, ((PyObject *)__pyx_kp_s_3));
5765 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
57665920 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
57675921
5768 /* "_proj.pyx":414
5922 /* "_proj.pyx":427
57695923 * # check for NaN.
57705924 * if pazi2 != pazi2:
57715925 * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<<
57725926 * if not radians:
57735927 * lonsdata[i] = plon2
57745928 */
5775 __pyx_k_tuple_21 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5929 __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57765930 __Pyx_GOTREF(__pyx_k_tuple_21);
5777 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5778 PyTuple_SET_ITEM(__pyx_k_tuple_21, 0, ((PyObject *)__pyx_kp_s_20));
5779 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
57805931 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
57815932
5782 /* "_proj.pyx":445
5933 /* "_proj.pyx":458
57835934 * # process data in buffer
57845935 * if not buflenlons == buflenlats == buflenaz == buflend:
57855936 * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<<
57865937 * ndim = buflenlons//_doublesize
57875938 * lonsdata = <double *>londata
57885939 */
5789 __pyx_k_tuple_23 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5940 __pyx_k_tuple_23 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
57905941 __Pyx_GOTREF(__pyx_k_tuple_23);
5791 __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
5792 PyTuple_SET_ITEM(__pyx_k_tuple_23, 0, ((PyObject *)__pyx_kp_s_3));
5793 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
57945942 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
57955943
5796 /* "_proj.pyx":472
5944 /* "_proj.pyx":485
57975945 * pazi2 = pazi2+180.
57985946 * if ps12 != ps12: # check for NaN
57995947 * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<<
58005948 * if radians:
58015949 * lonsdata[i] = _rad2dg*pazi1
58025950 */
5803 __pyx_k_tuple_24 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5951 __pyx_k_tuple_24 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58045952 __Pyx_GOTREF(__pyx_k_tuple_24);
5805 __Pyx_INCREF(((PyObject *)__pyx_kp_s_20));
5806 PyTuple_SET_ITEM(__pyx_k_tuple_24, 0, ((PyObject *)__pyx_kp_s_20));
5807 __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_20));
58085953 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
58095954
5810 /* "_proj.pyx":56
5955 /* "_proj.pyx":58
58115956 * int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len)
58125957 *
58135958 * def set_datapath(datapath): # <<<<<<<<<<<<<<
5814 * cdef char *searchpath
58155959 * bytestr = _strencode(datapath)
5816 */
5817 __pyx_k_tuple_27 = PyTuple_New(3); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5960 * cdef const char *searchpath = bytestr
5961 */
5962 __pyx_k_tuple_27 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__datapath), ((PyObject *)__pyx_n_s__bytestr), ((PyObject *)__pyx_n_s__searchpath)); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58185963 __Pyx_GOTREF(__pyx_k_tuple_27);
5819 __Pyx_INCREF(((PyObject *)__pyx_n_s__datapath));
5820 PyTuple_SET_ITEM(__pyx_k_tuple_27, 0, ((PyObject *)__pyx_n_s__datapath));
5821 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__datapath));
5822 __Pyx_INCREF(((PyObject *)__pyx_n_s__searchpath));
5823 PyTuple_SET_ITEM(__pyx_k_tuple_27, 1, ((PyObject *)__pyx_n_s__searchpath));
5824 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__searchpath));
5825 __Pyx_INCREF(((PyObject *)__pyx_n_s__bytestr));
5826 PyTuple_SET_ITEM(__pyx_k_tuple_27, 2, ((PyObject *)__pyx_n_s__bytestr));
5827 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bytestr));
58285964 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
5829 __pyx_k_codeobj_28 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_29, __pyx_n_s__set_datapath, 56, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5830
5831 /* "_proj.pyx":309
5965 __pyx_k_codeobj_28 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_29, __pyx_n_s__set_datapath, 58, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5966
5967 /* "_proj.pyx":63
5968 * pj_set_searchpath(1, &searchpath)
5969 *
5970 * def _createproj(projstring): # <<<<<<<<<<<<<<
5971 * return Proj(projstring)
5972 *
5973 */
5974 __pyx_k_tuple_30 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__projstring)); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5975 __Pyx_GOTREF(__pyx_k_tuple_30);
5976 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));
5977 __pyx_k_codeobj_31 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_29, __pyx_n_s___createproj, 63, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5978
5979 /* "_proj.pyx":322
58325980 * return False
58335981 *
58345982 * def _transform(Proj p1, Proj p2, inx, iny, inz, radians): # <<<<<<<<<<<<<<
58355983 * # private function to call pj_transform
58365984 * cdef void *xdata, *ydata, *zdata
58375985 */
5838 __pyx_k_tuple_30 = PyTuple_New(18); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5839 __Pyx_GOTREF(__pyx_k_tuple_30);
5840 __Pyx_INCREF(((PyObject *)__pyx_n_s__p1));
5841 PyTuple_SET_ITEM(__pyx_k_tuple_30, 0, ((PyObject *)__pyx_n_s__p1));
5842 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p1));
5843 __Pyx_INCREF(((PyObject *)__pyx_n_s__p2));
5844 PyTuple_SET_ITEM(__pyx_k_tuple_30, 1, ((PyObject *)__pyx_n_s__p2));
5845 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__p2));
5846 __Pyx_INCREF(((PyObject *)__pyx_n_s__inx));
5847 PyTuple_SET_ITEM(__pyx_k_tuple_30, 2, ((PyObject *)__pyx_n_s__inx));
5848 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__inx));
5849 __Pyx_INCREF(((PyObject *)__pyx_n_s__iny));
5850 PyTuple_SET_ITEM(__pyx_k_tuple_30, 3, ((PyObject *)__pyx_n_s__iny));
5851 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__iny));
5852 __Pyx_INCREF(((PyObject *)__pyx_n_s__inz));
5853 PyTuple_SET_ITEM(__pyx_k_tuple_30, 4, ((PyObject *)__pyx_n_s__inz));
5854 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__inz));
5855 __Pyx_INCREF(((PyObject *)__pyx_n_s__radians));
5856 PyTuple_SET_ITEM(__pyx_k_tuple_30, 5, ((PyObject *)__pyx_n_s__radians));
5857 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__radians));
5858 __Pyx_INCREF(((PyObject *)__pyx_n_s__xdata));
5859 PyTuple_SET_ITEM(__pyx_k_tuple_30, 6, ((PyObject *)__pyx_n_s__xdata));
5860 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xdata));
5861 __Pyx_INCREF(((PyObject *)__pyx_n_s__ydata));
5862 PyTuple_SET_ITEM(__pyx_k_tuple_30, 7, ((PyObject *)__pyx_n_s__ydata));
5863 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ydata));
5864 __Pyx_INCREF(((PyObject *)__pyx_n_s__zdata));
5865 PyTuple_SET_ITEM(__pyx_k_tuple_30, 8, ((PyObject *)__pyx_n_s__zdata));
5866 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zdata));
5867 __Pyx_INCREF(((PyObject *)__pyx_n_s__xx));
5868 PyTuple_SET_ITEM(__pyx_k_tuple_30, 9, ((PyObject *)__pyx_n_s__xx));
5869 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__xx));
5870 __Pyx_INCREF(((PyObject *)__pyx_n_s__yy));
5871 PyTuple_SET_ITEM(__pyx_k_tuple_30, 10, ((PyObject *)__pyx_n_s__yy));
5872 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__yy));
5873 __Pyx_INCREF(((PyObject *)__pyx_n_s__zz));
5874 PyTuple_SET_ITEM(__pyx_k_tuple_30, 11, ((PyObject *)__pyx_n_s__zz));
5875 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__zz));
5876 __Pyx_INCREF(((PyObject *)__pyx_n_s__buflenx));
5877 PyTuple_SET_ITEM(__pyx_k_tuple_30, 12, ((PyObject *)__pyx_n_s__buflenx));
5878 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflenx));
5879 __Pyx_INCREF(((PyObject *)__pyx_n_s__bufleny));
5880 PyTuple_SET_ITEM(__pyx_k_tuple_30, 13, ((PyObject *)__pyx_n_s__bufleny));
5881 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__bufleny));
5882 __Pyx_INCREF(((PyObject *)__pyx_n_s__buflenz));
5883 PyTuple_SET_ITEM(__pyx_k_tuple_30, 14, ((PyObject *)__pyx_n_s__buflenz));
5884 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__buflenz));
5885 __Pyx_INCREF(((PyObject *)__pyx_n_s__npts));
5886 PyTuple_SET_ITEM(__pyx_k_tuple_30, 15, ((PyObject *)__pyx_n_s__npts));
5887 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__npts));
5888 __Pyx_INCREF(((PyObject *)__pyx_n_s__i));
5889 PyTuple_SET_ITEM(__pyx_k_tuple_30, 16, ((PyObject *)__pyx_n_s__i));
5890 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__i));
5891 __Pyx_INCREF(((PyObject *)__pyx_n_s__err));
5892 PyTuple_SET_ITEM(__pyx_k_tuple_30, 17, ((PyObject *)__pyx_n_s__err));
5893 __Pyx_GIVEREF(((PyObject *)__pyx_n_s__err));
5894 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));
5895 __pyx_k_codeobj_31 = (PyObject*)__Pyx_PyCode_New(6, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_29, __pyx_n_s___transform, 309, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5986 __pyx_k_tuple_32 = PyTuple_Pack(18, ((PyObject *)__pyx_n_s__p1), ((PyObject *)__pyx_n_s__p2), ((PyObject *)__pyx_n_s__inx), ((PyObject *)__pyx_n_s__iny), ((PyObject *)__pyx_n_s__inz), ((PyObject *)__pyx_n_s__radians), ((PyObject *)__pyx_n_s__xdata), ((PyObject *)__pyx_n_s__ydata), ((PyObject *)__pyx_n_s__zdata), ((PyObject *)__pyx_n_s__xx), ((PyObject *)__pyx_n_s__yy), ((PyObject *)__pyx_n_s__zz), ((PyObject *)__pyx_n_s__buflenx), ((PyObject *)__pyx_n_s__bufleny), ((PyObject *)__pyx_n_s__buflenz), ((PyObject *)__pyx_n_s__npts), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__err)); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5987 __Pyx_GOTREF(__pyx_k_tuple_32);
5988 __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));
5989 __pyx_k_codeobj_33 = (PyObject*)__Pyx_PyCode_New(6, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_29, __pyx_n_s___transform, 322, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
58965990 __Pyx_RefNannyFinishContext();
58975991 return 0;
58985992 __pyx_L1_error:;
59196013 PyObject *__pyx_t_2 = NULL;
59206014 PyObject *__pyx_t_3 = NULL;
59216015 double __pyx_t_4;
6016 int __pyx_lineno = 0;
6017 const char *__pyx_filename = NULL;
6018 int __pyx_clineno = 0;
59226019 __Pyx_RefNannyDeclarations
59236020 #if CYTHON_REFNANNY
59246021 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
59566053 __pyx_m = PyModule_Create(&__pyx_moduledef);
59576054 #endif
59586055 if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6056 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6057 Py_INCREF(__pyx_d);
59596058 #if PY_MAJOR_VERSION >= 3
59606059 {
59616060 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59716070 if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
59726071 /*--- Initialize various global constants etc. ---*/
59736072 if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6073 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
6074 if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6075 #endif
59746076 if (__pyx_module_is_main__proj) {
59756077 if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
59766078 }
59826084 /*--- Variable export code ---*/
59836085 /*--- Function export code ---*/
59846086 /*--- Type init code ---*/
5985 if (PyType_Ready(&__pyx_type_5_proj_Proj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5986 if (__Pyx_SetAttrString(__pyx_m, "Proj", (PyObject *)&__pyx_type_5_proj_Proj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6087 if (PyType_Ready(&__pyx_type_5_proj_Proj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6088 if (__Pyx_SetAttrString(__pyx_m, "Proj", (PyObject *)&__pyx_type_5_proj_Proj) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59876089 __pyx_ptype_5_proj_Proj = &__pyx_type_5_proj_Proj;
5988 if (PyType_Ready(&__pyx_type_5_proj_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
5989 if (__Pyx_SetAttrString(__pyx_m, "Geod", (PyObject *)&__pyx_type_5_proj_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6090 if (PyType_Ready(&__pyx_type_5_proj_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6091 if (__Pyx_SetAttrString(__pyx_m, "Geod", (PyObject *)&__pyx_type_5_proj_Geod) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
59906092 __pyx_ptype_5_proj_Geod = &__pyx_type_5_proj_Geod;
59916093 /*--- Type import code ---*/
59926094 /*--- Variable import code ---*/
60026104 */
60036105 __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__math), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60046106 __Pyx_GOTREF(__pyx_t_1);
6005 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6107 if (PyDict_SetItem(__pyx_d, __pyx_n_s__math, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60066108 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60076109
60086110 /* "_proj.pyx":8
60126114 * _rad2dg = math.degrees(1.)
60136115 * _doublesize = sizeof(double)
60146116 */
6015 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6117 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60166118 __Pyx_GOTREF(__pyx_t_1);
6017 __pyx_t_2 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__radians); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6119 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__radians); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60186120 __Pyx_GOTREF(__pyx_t_2);
60196121 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60206122 __pyx_t_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60376139 * _dg2rad = math.radians(1.)
60386140 * _rad2dg = math.degrees(1.) # <<<<<<<<<<<<<<
60396141 * _doublesize = sizeof(double)
6040 * __version__ = "1.9.3"
6041 */
6042 __pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6142 * __version__ = "1.9.4"
6143 */
6144 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__math); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60436145 __Pyx_GOTREF(__pyx_t_1);
6044 __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_n_s__degrees); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6146 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__degrees); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60456147 __Pyx_GOTREF(__pyx_t_3);
60466148 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60476149 __pyx_t_1 = PyFloat_FromDouble(1.); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60636165 * _dg2rad = math.radians(1.)
60646166 * _rad2dg = math.degrees(1.)
60656167 * _doublesize = sizeof(double) # <<<<<<<<<<<<<<
6066 * __version__ = "1.9.3"
6168 * __version__ = "1.9.4"
60676169 *
60686170 */
60696171 __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(double))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60706172 __Pyx_GOTREF(__pyx_t_1);
6071 if (PyObject_SetAttr(__pyx_m, __pyx_n_s___doublesize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6173 if (PyDict_SetItem(__pyx_d, __pyx_n_s___doublesize, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60726174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60736175
60746176 /* "_proj.pyx":11
60756177 * _rad2dg = math.degrees(1.)
60766178 * _doublesize = sizeof(double)
6077 * __version__ = "1.9.3" # <<<<<<<<<<<<<<
6179 * __version__ = "1.9.4" # <<<<<<<<<<<<<<
60786180 *
60796181 * cdef extern from "math.h":
60806182 */
6081 if (PyObject_SetAttr(__pyx_m, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6082
6083 /* "_proj.pyx":56
6183 if (PyDict_SetItem(__pyx_d, __pyx_n_s____version__, ((PyObject *)__pyx_kp_s_26)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6184
6185 /* "_proj.pyx":58
60846186 * int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len)
60856187 *
60866188 * def set_datapath(datapath): # <<<<<<<<<<<<<<
6087 * cdef char *searchpath
60886189 * bytestr = _strencode(datapath)
6089 */
6090 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5_proj_1set_datapath, NULL, __pyx_n_s___proj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6190 * cdef const char *searchpath = bytestr
6191 */
6192 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5_proj_1set_datapath, NULL, __pyx_n_s___proj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60916193 __Pyx_GOTREF(__pyx_t_1);
6092 if (PyObject_SetAttr(__pyx_m, __pyx_n_s__set_datapath, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6194 if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_datapath, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
60936195 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
60946196
6095 /* "_proj.pyx":92
6197 /* "_proj.pyx":63
6198 * pj_set_searchpath(1, &searchpath)
6199 *
6200 * def _createproj(projstring): # <<<<<<<<<<<<<<
6201 * return Proj(projstring)
6202 *
6203 */
6204 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5_proj_3_createproj, NULL, __pyx_n_s___proj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6205 __Pyx_GOTREF(__pyx_t_1);
6206 if (PyDict_SetItem(__pyx_d, __pyx_n_s___createproj, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6207 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6208
6209 /* "_proj.pyx":105
60966210 * return (self.__class__,(self.srs,))
60976211 *
60986212 * def _fwd(self, object lons, object lats, radians=False, errcheck=False): # <<<<<<<<<<<<<<
60996213 * """
61006214 * forward transformation - lons,lats to x,y (done in place).
61016215 */
6102 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6216 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61036217 __Pyx_GOTREF(__pyx_t_1);
61046218 __pyx_k_1 = __pyx_t_1;
61056219 __Pyx_GIVEREF(__pyx_t_1);
61066220 __pyx_t_1 = 0;
6107 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6221 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61086222 __Pyx_GOTREF(__pyx_t_1);
61096223 __pyx_k_2 = __pyx_t_1;
61106224 __Pyx_GIVEREF(__pyx_t_1);
61116225 __pyx_t_1 = 0;
61126226
6113 /* "_proj.pyx":153
6227 /* "_proj.pyx":166
61146228 * latsdata[i] = projxyout.v
61156229 *
61166230 * def _inv(self, object x, object y, radians=False, errcheck=False): # <<<<<<<<<<<<<<
61176231 * """
61186232 * inverse transformation - x,y to lons,lats (done in place).
61196233 */
6120 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6234 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61216235 __Pyx_GOTREF(__pyx_t_1);
61226236 __pyx_k_9 = __pyx_t_1;
61236237 __Pyx_GIVEREF(__pyx_t_1);
61246238 __pyx_t_1 = 0;
6125 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6239 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61266240 __Pyx_GOTREF(__pyx_t_1);
61276241 __pyx_k_10 = __pyx_t_1;
61286242 __Pyx_GIVEREF(__pyx_t_1);
61296243 __pyx_t_1 = 0;
61306244
6131 /* "_proj.pyx":309
6245 /* "_proj.pyx":322
61326246 * return False
61336247 *
61346248 * def _transform(Proj p1, Proj p2, inx, iny, inz, radians): # <<<<<<<<<<<<<<
61356249 * # private function to call pj_transform
61366250 * cdef void *xdata, *ydata, *zdata
61376251 */
6138 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5_proj_3_transform, NULL, __pyx_n_s___proj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6252 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_5_proj_5_transform, NULL, __pyx_n_s___proj); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61396253 __Pyx_GOTREF(__pyx_t_1);
6140 if (PyObject_SetAttr(__pyx_m, __pyx_n_s___transform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6254 if (PyDict_SetItem(__pyx_d, __pyx_n_s___transform, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61416255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
61426256
6143 /* "_proj.pyx":365
6257 /* "_proj.pyx":378
61446258 * return (self.__class__,(self.initstring,))
61456259 *
61466260 * def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<<
61476261 * """
61486262 * forward transformation - determine longitude, latitude and back azimuth
61496263 */
6150 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6264 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61516265 __Pyx_GOTREF(__pyx_t_1);
61526266 __pyx_k_18 = __pyx_t_1;
61536267 __Pyx_GIVEREF(__pyx_t_1);
61546268 __pyx_t_1 = 0;
61556269
6156 /* "_proj.pyx":424
6270 /* "_proj.pyx":437
61576271 * azdata[i] = _rad2dg*pazi2
61586272 *
61596273 * def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False): # <<<<<<<<<<<<<<
61606274 * """
61616275 * inverse transformation - return forward and back azimuths, plus distance
61626276 */
6163 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6277 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61646278 __Pyx_GOTREF(__pyx_t_1);
61656279 __pyx_k_22 = __pyx_t_1;
61666280 __Pyx_GIVEREF(__pyx_t_1);
61676281 __pyx_t_1 = 0;
61686282
6169 /* "_proj.pyx":481
6283 /* "_proj.pyx":494
61706284 * azdata[i] = ps12
61716285 *
61726286 * def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False): # <<<<<<<<<<<<<<
61736287 * """
61746288 * given initial and terminus lat/lon, find npts intermediate points."""
61756289 */
6176 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6290 __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61776291 __Pyx_GOTREF(__pyx_t_1);
61786292 __pyx_k_25 = __pyx_t_1;
61796293 __Pyx_GIVEREF(__pyx_t_1);
61866300 */
61876301 __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61886302 __Pyx_GOTREF(((PyObject *)__pyx_t_1));
6189 if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
6303 if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
61906304 __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
61916305 goto __pyx_L0;
61926306 __pyx_L1_error:;
62256339 }
62266340 #endif /* CYTHON_REFNANNY */
62276341
6228 static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
6229 PyObject *result;
6230 result = PyObject_GetAttr(dict, name);
6231 if (!result) {
6232 if (dict != __pyx_b) {
6233 PyErr_Clear();
6234 result = PyObject_GetAttr(__pyx_b, name);
6235 }
6236 if (!result) {
6237 PyErr_SetObject(PyExc_NameError, name);
6238 }
6342 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
6343 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
6344 if (unlikely(!result)) {
6345 PyErr_Format(PyExc_NameError,
6346 #if PY_MAJOR_VERSION >= 3
6347 "name '%U' is not defined", name);
6348 #else
6349 "name '%s' is not defined", PyString_AS_STRING(name));
6350 #endif
62396351 }
62406352 return result;
62416353 }
64486560 }
64496561 value = type;
64506562 #if PY_VERSION_HEX < 0x02050000
6451 if (PyInstance_Check(type)) {
6452 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
6453 Py_INCREF(type);
6454 }
6455 else {
6456 type = 0;
6457 PyErr_SetString(PyExc_TypeError,
6458 "raise: exception must be an old-style class or instance");
6459 goto raise_error;
6460 }
6563 if (PyInstance_Check(type)) {
6564 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
6565 Py_INCREF(type);
6566 } else {
6567 type = 0;
6568 PyErr_SetString(PyExc_TypeError,
6569 "raise: exception must be an old-style class or instance");
6570 goto raise_error;
6571 }
64616572 #else
6462 type = (PyObject*) Py_TYPE(type);
6463 Py_INCREF(type);
6464 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
6465 PyErr_SetString(PyExc_TypeError,
6466 "raise: exception class must be a subclass of BaseException");
6467 goto raise_error;
6468 }
6573 type = (PyObject*) Py_TYPE(type);
6574 Py_INCREF(type);
6575 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
6576 PyErr_SetString(PyExc_TypeError,
6577 "raise: exception class must be a subclass of BaseException");
6578 goto raise_error;
6579 }
64696580 #endif
64706581 }
64716582 __Pyx_ErrRestore(type, value, tb);
65036614 else if (PyTuple_Check(value)) {
65046615 Py_INCREF(value);
65056616 args = value;
6506 }
6507 else
6617 } else
65086618 args = PyTuple_Pack(1, value);
65096619 if (!args)
65106620 goto bad;
65256635 "raise: exception class must be a subclass of BaseException");
65266636 goto bad;
65276637 }
6638 #if PY_VERSION_HEX >= 0x03030000
6639 if (cause) {
6640 #else
65286641 if (cause && cause != Py_None) {
6642 #endif
65296643 PyObject *fixed_cause;
6530 if (PyExceptionClass_Check(cause)) {
6644 if (cause == Py_None) {
6645 fixed_cause = NULL;
6646 } else if (PyExceptionClass_Check(cause)) {
65316647 fixed_cause = PyObject_CallObject(cause, NULL);
65326648 if (fixed_cause == NULL)
65336649 goto bad;
6534 }
6535 else if (PyExceptionInstance_Check(cause)) {
6650 } else if (PyExceptionInstance_Check(cause)) {
65366651 fixed_cause = cause;
65376652 Py_INCREF(fixed_cause);
6538 }
6539 else {
6653 } else {
65406654 PyErr_SetString(PyExc_TypeError,
65416655 "exception causes must derive from "
65426656 "BaseException");
65596673 return;
65606674 }
65616675 #endif
6676
6677 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
6678 PyObject *result;
6679 #if CYTHON_COMPILING_IN_CPYTHON
6680 result = PyDict_GetItem(__pyx_d, name);
6681 if (result) {
6682 Py_INCREF(result);
6683 } else {
6684 #else
6685 result = PyObject_GetItem(__pyx_d, name);
6686 if (!result) {
6687 PyErr_Clear();
6688 #endif
6689 result = __Pyx_GetBuiltinName(name);
6690 }
6691 return result;
6692 }
65626693
65636694 static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
65646695 const char *name, int exact)
66756806 #endif
66766807 }
66776808
6678 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, long level) {
6679 PyObject *py_import = 0;
6809 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
66806810 PyObject *empty_list = 0;
66816811 PyObject *module = 0;
66826812 PyObject *global_dict = 0;
66836813 PyObject *empty_dict = 0;
66846814 PyObject *list;
6685 py_import = __Pyx_GetAttrString(__pyx_b, "__import__");
6815 #if PY_VERSION_HEX < 0x03030000
6816 PyObject *py_import;
6817 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
66866818 if (!py_import)
66876819 goto bad;
6820 #endif
66886821 if (from_list)
66896822 list = from_list;
66906823 else {
67046837 #if PY_MAJOR_VERSION >= 3
67056838 if (level == -1) {
67066839 if (strchr(__Pyx_MODULE_NAME, '.')) {
6707 /* try package relative import first */
6840 #if PY_VERSION_HEX < 0x03030000
67086841 PyObject *py_level = PyInt_FromLong(1);
67096842 if (!py_level)
67106843 goto bad;
67116844 module = PyObject_CallFunctionObjArgs(py_import,
67126845 name, global_dict, empty_dict, list, py_level, NULL);
67136846 Py_DECREF(py_level);
6847 #else
6848 module = PyImport_ImportModuleLevelObject(
6849 name, global_dict, empty_dict, list, 1);
6850 #endif
67146851 if (!module) {
67156852 if (!PyErr_ExceptionMatches(PyExc_ImportError))
67166853 goto bad;
67216858 }
67226859 #endif
67236860 if (!module) {
6861 #if PY_VERSION_HEX < 0x03030000
67246862 PyObject *py_level = PyInt_FromLong(level);
67256863 if (!py_level)
67266864 goto bad;
67276865 module = PyObject_CallFunctionObjArgs(py_import,
67286866 name, global_dict, empty_dict, list, py_level, NULL);
67296867 Py_DECREF(py_level);
6868 #else
6869 module = PyImport_ImportModuleLevelObject(
6870 name, global_dict, empty_dict, list, level);
6871 #endif
67306872 }
67316873 }
67326874 #else
67386880 name, global_dict, empty_dict, list, NULL);
67396881 #endif
67406882 bad:
6883 #if PY_VERSION_HEX < 0x03030000
6884 Py_XDECREF(py_import);
6885 #endif
67416886 Py_XDECREF(empty_list);
6742 Py_XDECREF(py_import);
67436887 Py_XDECREF(empty_dict);
67446888 return module;
67456889 }
69347078 return (int)__Pyx_PyInt_AsLong(x);
69357079 }
69367080
7081 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7082 #if CYTHON_USE_PYLONG_INTERNALS
7083 #include "longintrepr.h"
7084 #endif
7085 #endif
69377086 static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
69387087 const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
69397088 const int is_unsigned = neg_one > const_zero;
6940 #if PY_VERSION_HEX < 0x03000000
7089 #if PY_MAJOR_VERSION < 3
69417090 if (likely(PyInt_Check(x))) {
69427091 long val = PyInt_AS_LONG(x);
69437092 if (is_unsigned && unlikely(val < 0)) {
69507099 #endif
69517100 if (likely(PyLong_Check(x))) {
69527101 if (is_unsigned) {
7102 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7103 #if CYTHON_USE_PYLONG_INTERNALS
7104 if (sizeof(digit) <= sizeof(unsigned long)) {
7105 switch (Py_SIZE(x)) {
7106 case 0: return 0;
7107 case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
7108 }
7109 }
7110 #endif
7111 #endif
69537112 if (unlikely(Py_SIZE(x) < 0)) {
69547113 PyErr_SetString(PyExc_OverflowError,
69557114 "can't convert negative value to unsigned long");
69577116 }
69587117 return (unsigned long)PyLong_AsUnsignedLong(x);
69597118 } else {
7119 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7120 #if CYTHON_USE_PYLONG_INTERNALS
7121 if (sizeof(digit) <= sizeof(unsigned long)) {
7122 switch (Py_SIZE(x)) {
7123 case 0: return 0;
7124 case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
7125 case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
7126 }
7127 }
7128 #endif
7129 #endif
69607130 return (unsigned long)PyLong_AsLong(x);
69617131 }
69627132 } else {
69697139 }
69707140 }
69717141
7142 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7143 #if CYTHON_USE_PYLONG_INTERNALS
7144 #include "longintrepr.h"
7145 #endif
7146 #endif
69727147 static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
69737148 const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
69747149 const int is_unsigned = neg_one > const_zero;
6975 #if PY_VERSION_HEX < 0x03000000
7150 #if PY_MAJOR_VERSION < 3
69767151 if (likely(PyInt_Check(x))) {
69777152 long val = PyInt_AS_LONG(x);
69787153 if (is_unsigned && unlikely(val < 0)) {
69857160 #endif
69867161 if (likely(PyLong_Check(x))) {
69877162 if (is_unsigned) {
7163 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7164 #if CYTHON_USE_PYLONG_INTERNALS
7165 if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
7166 switch (Py_SIZE(x)) {
7167 case 0: return 0;
7168 case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7169 }
7170 }
7171 #endif
7172 #endif
69887173 if (unlikely(Py_SIZE(x) < 0)) {
69897174 PyErr_SetString(PyExc_OverflowError,
69907175 "can't convert negative value to unsigned PY_LONG_LONG");
69927177 }
69937178 return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
69947179 } else {
7180 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7181 #if CYTHON_USE_PYLONG_INTERNALS
7182 if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
7183 switch (Py_SIZE(x)) {
7184 case 0: return 0;
7185 case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7186 case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7187 }
7188 }
7189 #endif
7190 #endif
69957191 return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
69967192 }
69977193 } else {
70047200 }
70057201 }
70067202
7203 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7204 #if CYTHON_USE_PYLONG_INTERNALS
7205 #include "longintrepr.h"
7206 #endif
7207 #endif
70077208 static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
70087209 const long neg_one = (long)-1, const_zero = 0;
70097210 const int is_unsigned = neg_one > const_zero;
7010 #if PY_VERSION_HEX < 0x03000000
7211 #if PY_MAJOR_VERSION < 3
70117212 if (likely(PyInt_Check(x))) {
70127213 long val = PyInt_AS_LONG(x);
70137214 if (is_unsigned && unlikely(val < 0)) {
70207221 #endif
70217222 if (likely(PyLong_Check(x))) {
70227223 if (is_unsigned) {
7224 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7225 #if CYTHON_USE_PYLONG_INTERNALS
7226 if (sizeof(digit) <= sizeof(long)) {
7227 switch (Py_SIZE(x)) {
7228 case 0: return 0;
7229 case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
7230 }
7231 }
7232 #endif
7233 #endif
70237234 if (unlikely(Py_SIZE(x) < 0)) {
70247235 PyErr_SetString(PyExc_OverflowError,
70257236 "can't convert negative value to long");
70277238 }
70287239 return (long)PyLong_AsUnsignedLong(x);
70297240 } else {
7241 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7242 #if CYTHON_USE_PYLONG_INTERNALS
7243 if (sizeof(digit) <= sizeof(long)) {
7244 switch (Py_SIZE(x)) {
7245 case 0: return 0;
7246 case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
7247 case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
7248 }
7249 }
7250 #endif
7251 #endif
70307252 return (long)PyLong_AsLong(x);
70317253 }
70327254 } else {
70397261 }
70407262 }
70417263
7264 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7265 #if CYTHON_USE_PYLONG_INTERNALS
7266 #include "longintrepr.h"
7267 #endif
7268 #endif
70427269 static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
70437270 const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
70447271 const int is_unsigned = neg_one > const_zero;
7045 #if PY_VERSION_HEX < 0x03000000
7272 #if PY_MAJOR_VERSION < 3
70467273 if (likely(PyInt_Check(x))) {
70477274 long val = PyInt_AS_LONG(x);
70487275 if (is_unsigned && unlikely(val < 0)) {
70557282 #endif
70567283 if (likely(PyLong_Check(x))) {
70577284 if (is_unsigned) {
7285 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7286 #if CYTHON_USE_PYLONG_INTERNALS
7287 if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
7288 switch (Py_SIZE(x)) {
7289 case 0: return 0;
7290 case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7291 }
7292 }
7293 #endif
7294 #endif
70587295 if (unlikely(Py_SIZE(x) < 0)) {
70597296 PyErr_SetString(PyExc_OverflowError,
70607297 "can't convert negative value to PY_LONG_LONG");
70627299 }
70637300 return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
70647301 } else {
7302 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7303 #if CYTHON_USE_PYLONG_INTERNALS
7304 if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
7305 switch (Py_SIZE(x)) {
7306 case 0: return 0;
7307 case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7308 case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7309 }
7310 }
7311 #endif
7312 #endif
70657313 return (PY_LONG_LONG)PyLong_AsLongLong(x);
70667314 }
70677315 } else {
70747322 }
70757323 }
70767324
7325 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7326 #if CYTHON_USE_PYLONG_INTERNALS
7327 #include "longintrepr.h"
7328 #endif
7329 #endif
70777330 static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
70787331 const signed long neg_one = (signed long)-1, const_zero = 0;
70797332 const int is_unsigned = neg_one > const_zero;
7080 #if PY_VERSION_HEX < 0x03000000
7333 #if PY_MAJOR_VERSION < 3
70817334 if (likely(PyInt_Check(x))) {
70827335 long val = PyInt_AS_LONG(x);
70837336 if (is_unsigned && unlikely(val < 0)) {
70907343 #endif
70917344 if (likely(PyLong_Check(x))) {
70927345 if (is_unsigned) {
7346 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7347 #if CYTHON_USE_PYLONG_INTERNALS
7348 if (sizeof(digit) <= sizeof(signed long)) {
7349 switch (Py_SIZE(x)) {
7350 case 0: return 0;
7351 case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
7352 }
7353 }
7354 #endif
7355 #endif
70937356 if (unlikely(Py_SIZE(x) < 0)) {
70947357 PyErr_SetString(PyExc_OverflowError,
70957358 "can't convert negative value to signed long");
70977360 }
70987361 return (signed long)PyLong_AsUnsignedLong(x);
70997362 } else {
7363 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7364 #if CYTHON_USE_PYLONG_INTERNALS
7365 if (sizeof(digit) <= sizeof(signed long)) {
7366 switch (Py_SIZE(x)) {
7367 case 0: return 0;
7368 case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
7369 case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
7370 }
7371 }
7372 #endif
7373 #endif
71007374 return (signed long)PyLong_AsLong(x);
71017375 }
71027376 } else {
71097383 }
71107384 }
71117385
7386 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7387 #if CYTHON_USE_PYLONG_INTERNALS
7388 #include "longintrepr.h"
7389 #endif
7390 #endif
71127391 static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
71137392 const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
71147393 const int is_unsigned = neg_one > const_zero;
7115 #if PY_VERSION_HEX < 0x03000000
7394 #if PY_MAJOR_VERSION < 3
71167395 if (likely(PyInt_Check(x))) {
71177396 long val = PyInt_AS_LONG(x);
71187397 if (is_unsigned && unlikely(val < 0)) {
71257404 #endif
71267405 if (likely(PyLong_Check(x))) {
71277406 if (is_unsigned) {
7407 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7408 #if CYTHON_USE_PYLONG_INTERNALS
7409 if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
7410 switch (Py_SIZE(x)) {
7411 case 0: return 0;
7412 case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7413 }
7414 }
7415 #endif
7416 #endif
71287417 if (unlikely(Py_SIZE(x) < 0)) {
71297418 PyErr_SetString(PyExc_OverflowError,
71307419 "can't convert negative value to signed PY_LONG_LONG");
71327421 }
71337422 return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
71347423 } else {
7424 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
7425 #if CYTHON_USE_PYLONG_INTERNALS
7426 if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
7427 switch (Py_SIZE(x)) {
7428 case 0: return 0;
7429 case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7430 case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
7431 }
7432 }
7433 #endif
7434 #endif
71357435 return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
71367436 }
71377437 } else {
73557655 return 0;
73567656 }
73577657
7358
7359 /* Type Conversion Functions */
7360
7658 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
7659 return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
7660 }
7661 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
7662 Py_ssize_t ignore;
7663 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
7664 }
7665 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
7666 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
7667 if (
7668 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7669 __Pyx_sys_getdefaultencoding_not_ascii &&
7670 #endif
7671 PyUnicode_Check(o)) {
7672 #if PY_VERSION_HEX < 0x03030000
7673 char* defenc_c;
7674 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
7675 if (!defenc) return NULL;
7676 defenc_c = PyBytes_AS_STRING(defenc);
7677 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7678 {
7679 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
7680 char* c;
7681 for (c = defenc_c; c < end; c++) {
7682 if ((unsigned char) (*c) >= 128) {
7683 PyUnicode_AsASCIIString(o);
7684 return NULL;
7685 }
7686 }
7687 }
7688 #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
7689 *length = PyBytes_GET_SIZE(defenc);
7690 return defenc_c;
7691 #else /* PY_VERSION_HEX < 0x03030000 */
7692 if (PyUnicode_READY(o) == -1) return NULL;
7693 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
7694 if (PyUnicode_IS_ASCII(o)) {
7695 *length = PyUnicode_GET_DATA_SIZE(o);
7696 return PyUnicode_AsUTF8(o);
7697 } else {
7698 PyUnicode_AsASCIIString(o);
7699 return NULL;
7700 }
7701 #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
7702 return PyUnicode_AsUTF8AndSize(o, length);
7703 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
7704 #endif /* PY_VERSION_HEX < 0x03030000 */
7705 } else
7706 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
7707 {
7708 char* result;
7709 int r = PyBytes_AsStringAndSize(o, &result, length);
7710 if (r < 0) {
7711 return NULL;
7712 } else {
7713 return result;
7714 }
7715 }
7716 }
73617717 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
73627718 int is_true = x == Py_True;
73637719 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
73647720 else return PyObject_IsTrue(x);
73657721 }
7366
73677722 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
73687723 PyNumberMethods *m;
73697724 const char *name = NULL;
73707725 PyObject *res = NULL;
7371 #if PY_VERSION_HEX < 0x03000000
7726 #if PY_MAJOR_VERSION < 3
73727727 if (PyInt_Check(x) || PyLong_Check(x))
73737728 #else
73747729 if (PyLong_Check(x))
73757730 #endif
73767731 return Py_INCREF(x), x;
73777732 m = Py_TYPE(x)->tp_as_number;
7378 #if PY_VERSION_HEX < 0x03000000
7733 #if PY_MAJOR_VERSION < 3
73797734 if (m && m->nb_int) {
73807735 name = "int";
73817736 res = PyNumber_Int(x);
73917746 }
73927747 #endif
73937748 if (res) {
7394 #if PY_VERSION_HEX < 0x03000000
7749 #if PY_MAJOR_VERSION < 3
73957750 if (!PyInt_Check(res) && !PyLong_Check(res)) {
73967751 #else
73977752 if (!PyLong_Check(res)) {
74097764 }
74107765 return res;
74117766 }
7412
74137767 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
74147768 Py_ssize_t ival;
74157769 PyObject* x = PyNumber_Index(b);
74187772 Py_DECREF(x);
74197773 return ival;
74207774 }
7421
74227775 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
74237776 #if PY_VERSION_HEX < 0x02050000
74247777 if (ival <= LONG_MAX)
74327785 return PyInt_FromSize_t(ival);
74337786 #endif
74347787 }
7435
74367788 static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
74377789 unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
7438 if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
7439 return (size_t)-1;
7440 } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
7441 PyErr_SetString(PyExc_OverflowError,
7442 "value too large to convert to size_t");
7790 if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
7791 if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
7792 PyErr_SetString(PyExc_OverflowError,
7793 "value too large to convert to size_t");
74437794 return (size_t)-1;
74447795 }
74457796 return (size_t)val;
77 _dg2rad = math.radians(1.)
88 _rad2dg = math.degrees(1.)
99 _doublesize = sizeof(double)
10 __version__ = "1.9.3"
10 __version__ = "1.9.4"
1111
1212 cdef extern from "math.h":
1313 cdef enum:
1515 FP_NAN
1616
1717 cdef extern from "geodesic.h":
18 struct Geodesic:
18 struct geod_geodesic:
1919 pass
20 void GeodesicInit(Geodesic* g, double a, double f)
21 void Direct(Geodesic* g,\
20 void geod_init(geod_geodesic* g, double a, double f)
21 void geod_direct(geod_geodesic* g,\
2222 double lat1, double lon1, double azi1, double s12,\
2323 double* plat2, double* plon2, double* pazi2)
24 void Inverse(Geodesic* g,\
24 void geod_inverse(geod_geodesic* g,\
2525 double lat1, double lon1, double lat2, double lon2,\
2626 double* ps12, double* pazi1, double* pazi2)
2727
3535 projPJ pj_init_plus_ctx(projCtx, char *)
3636 projUV pj_fwd(projUV, projPJ)
3737 projUV pj_inv(projUV, projPJ)
38 projPJ pj_latlong_from_proj(projPJ)
3839 int pj_transform(projPJ src, projPJ dst, long point_count, int point_offset,
3940 double *x, double *y, double *z)
4041 int pj_is_latlong(projPJ)
42 char *pj_get_def( projPJ pj, int options)
4143 int pj_is_geocent(projPJ)
4244 char *pj_strerrno(int)
4345 void pj_ctx_free( projCtx )
5355 int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len)
5456
5557 def set_datapath(datapath):
56 cdef char *searchpath
5758 bytestr = _strencode(datapath)
58 searchpath = bytestr
59 cdef const char *searchpath = bytestr
5960 pj_set_searchpath(1, &searchpath)
61
62 def _createproj(projstring):
63 return Proj(projstring)
6064
6165 cdef class Proj:
6266 cdef projPJ projpj
8387 """destroy projection definition"""
8488 pj_free(self.projpj)
8589 pj_ctx_free(self.projctx)
90
91 def to_latlong(self):
92 """return a new Proj instance which is the geographic (lat/lon)
93 coordinate version of the current projection"""
94 cdef projPJ llpj
95 llpj = pj_latlong_from_proj(self.projpj)
96 initstring = pj_get_def(llpj, 0)
97 pj_free(llpj)
98 return _createproj(initstring)
8699
87100 def __reduce__(self):
88101 """special method that allows pyproj.Proj instance to be pickled"""
350363 return pystr # already bytes?
351364
352365 cdef class Geod:
353 cdef Geodesic _Geodesic
366 cdef geod_geodesic _geod_geodesic
354367 cdef public object initstring
355368
356369 def __cinit__(self, a, f):
357370 self.initstring = '+a=%s +f=%s' % (a, f)
358 GeodesicInit(&self._Geodesic, <double> a, <double> f)
371 geod_init(&self._geod_geodesic, <double> a, <double> f)
359372
360373 def __reduce__(self):
361374 """special method that allows pyproj.Geod instance to be pickled"""
400413 lat1 = _dg2rad*latsdata[i]
401414 az1 = _dg2rad*azdata[i]
402415 s12 = distdata[i]
403 Direct(&self._Geodesic, lat1, lon1, az1, s12,\
416 geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\
404417 &plat2, &plon2, &pazi2)
405418 # back azimuth needs to be flipped 180 degrees
406419 # to match what proj4 geod utility produces.
407420 if pazi2 > 0:
408421 pazi2 = pazi2-180.
409 elif pazi2 < 0:
422 elif pazi2 <= 0:
410423 pazi2 = pazi2+180.
411424 # check for NaN.
412425 if pazi2 != pazi2:
459472 lat1 = latsdata[i]
460473 lon2 = azdata[i]
461474 lat2 = distdata[i]
462 Inverse(&self._Geodesic, lat1, lon1, lat2, lon2,
475 geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2,
463476 &ps12, &pazi1, &pazi2)
464477 # back azimuth needs to be flipped 180 degrees
465478 # to match what proj4 geod utility produces.
466479 if pazi2 > 0:
467480 pazi2 = pazi2-180.
468 elif pazi2 < 0:
481 elif pazi2 <= 0:
469482 pazi2 = pazi2+180.
470483 if ps12 != ps12: # check for NaN
471484 raise ValueError('undefined inverse geodesic (may be an antipodal point)')
488501 lon2 = _rad2dg*lon2
489502 lat2 = _rad2dg*lat2
490503 # do inverse computation to set azimuths, distance.
491 Inverse(&self._Geodesic, lat1, lon1, lat2, lon2,
504 geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2,
492505 &ps12, &pazi1, &pazi2)
493506 # distance increment.
494507 del_s = ps12/(npts+1)
498511 # loop over intermediate points, compute lat/lons.
499512 for i from 1 <= i < npts+1:
500513 s12 = i*del_s
501 Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\
514 geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\
502515 &plat2, &plon2, &pazi2)
503516 if radians:
504517 lats = lats + (_dg2rad*plat2,)
1414 pyproj.Geod.inv pyproj.Geod-class.html#inv
1515 pyproj.Geod.npts pyproj.Geod-class.html#npts
1616 pyproj.Proj pyproj.Proj-class.html
17 pyproj.Proj.__new__ pyproj.Proj-class.html#__new__
18 pyproj.Proj.__call__ pyproj.Proj-class.html#__call__
19 pyproj.Proj.to_latlong pyproj.Proj-class.html#to_latlong
1720 pyproj.Proj.is_latlong pyproj.Proj-class.html#is_latlong
18 pyproj.Proj.__new__ pyproj.Proj-class.html#__new__
1921 pyproj.Proj.is_geocent pyproj.Proj-class.html#is_geocent
20 pyproj.Proj.__call__ pyproj.Proj-class.html#__call__
9797 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
9898 <tr>
9999 <td align="left" class="footer">
100 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
100 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
101101 </td>
102102 <td align="right" class="footer">
103103 <a target="mainFrame" href="http://epydoc.sourceforge.net"
239239 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
240240 <tr>
241241 <td align="left" class="footer">
242 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
242 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
243243 </td>
244244 <td align="right" class="footer">
245245 <a target="mainFrame" href="http://epydoc.sourceforge.net"
152152 <tr>
153153 <td width="33%" class="link-index"><a href="pyproj-module.html#test">test()</a><br />
154154 <span class="index-where">(in&nbsp;<a href="pyproj-module.html">pyproj</a>)</span></td>
155 <td width="33%" class="link-index"><a href="pyproj.Proj-class.html#to_latlong">to_latlong()</a><br />
156 <span class="index-where">(in&nbsp;<a href="pyproj.Proj-class.html">Proj</a>)</span></td>
155157 <td width="33%" class="link-index"><a href="pyproj-module.html#transform">transform()</a><br />
156158 <span class="index-where">(in&nbsp;<a href="pyproj-module.html">pyproj</a>)</span></td>
157 <td width="33%" class="link-index">&nbsp;</td>
158159 </tr>
159160 <tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
160161 </table>
205206 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
206207 <tr>
207208 <td align="left" class="footer">
208 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
209 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
209210 </td>
210211 <td align="right" class="footer">
211212 <a target="mainFrame" href="http://epydoc.sourceforge.net"
6666 <p>Input coordinates can be given as python arrays, lists/tuples, scalars
6767 or numpy/Numeric/numarray arrays. Optimized for objects that support the
6868 Python buffer protocol (regular python and numpy array objects).</p>
69 <p>Download: http://code.google.com/p/pyproj/downloads/list</p>
69 <p>Download: http://python.org/pypi/pyproj</p>
7070 <p>Requirements: python 2.4 or higher.</p>
7171 <p>Example scripts are in 'test' subdirectory of source distribution. The
7272 'test()' function will run the examples in the docstrings.</p>
8686
8787 <hr />
8888 <div class="fields"> <p><strong>Version:</strong>
89 1.9.3
89 1.9.4
9090 </p>
9191 </div><!-- ==================== CLASSES ==================== -->
9292 <a name="section-Classes"></a>
213213 <td width="15%" align="right" valign="top" class="summary">
214214 <span class="summary-type">&nbsp;</span>
215215 </td><td class="summary">
216 <a href="pyproj-module.html#pyproj_datadir" class="summary-name">pyproj_datadir</a> = <code title="'/Users/jsw/Library/Python/2.7/lib/python/site-packages/pyproj/data'"><code class="variable-quote">'</code><code class="variable-string">/Users/jsw/Library/Python/2.7/lib/python/sit</code><code class="variable-ellipsis">...</code></code>
216 <a href="pyproj-module.html#pyproj_datadir" class="summary-name">pyproj_datadir</a> = <code title="'/Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/pyproj/d\
217 ata'"><code class="variable-quote">'</code><code class="variable-string">/Users/jwhitaker/Library/Python/2.7/lib/pyth</code><code class="variable-ellipsis">...</code></code>
217218 </td>
218219 </tr>
219220 </table>
384385 <dl class="fields">
385386 <dt>Value:</dt>
386387 <dd><table><tr><td><pre class="variable">
387 <code class="variable-quote">'</code><code class="variable-string">/Users/jsw/Library/Python/2.7/lib/python/site-packages/pyproj/data</code><code class="variable-quote">'</code>
388 <code class="variable-quote">'</code><code class="variable-string">/Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/pyproj/d</code><span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
389 <code class="variable-string">ata</code><code class="variable-quote">'</code>
388390 </pre></td></tr></table>
389391 </dd>
390392 </dl>
417419 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
418420 <tr>
419421 <td align="left" class="footer">
420 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
422 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
421423 </td>
422424 <td align="right" class="footer">
423425 <a target="mainFrame" href="http://epydoc.sourceforge.net"
7777 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
7878 <tr>
7979 <td align="left" class="footer">
80 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
80 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
8181 </td>
8282 <td align="right" class="footer">
8383 <a target="mainFrame" href="http://epydoc.sourceforge.net"
6666 <p>Input coordinates can be given as python arrays, lists/tuples, scalars
6767 or numpy/Numeric/numarray arrays. Optimized for objects that support the
6868 Python buffer protocol (regular python and numpy array objects).</p>
69 <p>Download: http://code.google.com/p/pyproj/downloads/list</p>
69 <p>Download: http://python.org/pypi/pyproj</p>
7070 <p>Requirements: python 2.4 or higher.</p>
7171 <p>Example scripts are in 'test' subdirectory of source distribution. The
7272 'test()' function will run the examples in the docstrings.</p>
8686
8787 <hr />
8888 <div class="fields"> <p><strong>Version:</strong>
89 1.9.3
89 1.9.4
9090 </p>
9191 </div><!-- ==================== CLASSES ==================== -->
9292 <a name="section-Classes"></a>
213213 <td width="15%" align="right" valign="top" class="summary">
214214 <span class="summary-type">&nbsp;</span>
215215 </td><td class="summary">
216 <a href="pyproj-module.html#pyproj_datadir" class="summary-name">pyproj_datadir</a> = <code title="'/Users/jsw/Library/Python/2.7/lib/python/site-packages/pyproj/data'"><code class="variable-quote">'</code><code class="variable-string">/Users/jsw/Library/Python/2.7/lib/python/sit</code><code class="variable-ellipsis">...</code></code>
216 <a href="pyproj-module.html#pyproj_datadir" class="summary-name">pyproj_datadir</a> = <code title="'/Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/pyproj/d\
217 ata'"><code class="variable-quote">'</code><code class="variable-string">/Users/jwhitaker/Library/Python/2.7/lib/pyth</code><code class="variable-ellipsis">...</code></code>
217218 </td>
218219 </tr>
219220 </table>
384385 <dl class="fields">
385386 <dt>Value:</dt>
386387 <dd><table><tr><td><pre class="variable">
387 <code class="variable-quote">'</code><code class="variable-string">/Users/jsw/Library/Python/2.7/lib/python/site-packages/pyproj/data</code><code class="variable-quote">'</code>
388 <code class="variable-quote">'</code><code class="variable-string">/Users/jwhitaker/Library/Python/2.7/lib/python/site-packages/pyproj/d</code><span class="variable-linewrap"><img src="crarr.png" alt="\" /></span>
389 <code class="variable-string">ata</code><code class="variable-quote">'</code>
388390 </pre></td></tr></table>
389391 </dd>
390392 </dl>
417419 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
418420 <tr>
419421 <td align="left" class="footer">
420 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
422 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
421423 </td>
422424 <td align="right" class="footer">
423425 <a target="mainFrame" href="http://epydoc.sourceforge.net"
7373 <a name="L23"></a><tt class="py-lineno"> 23</tt> <tt class="py-line"><tt class="py-docstring">that support the Python buffer protocol (regular python and</tt> </tt>
7474 <a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"><tt class="py-docstring">numpy array objects).</tt> </tt>
7575 <a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
76 <a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"><tt class="py-docstring">Download: http://code.google.com/p/pyproj/downloads/list</tt> </tt>
76 <a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"><tt class="py-docstring">Download: http://python.org/pypi/pyproj</tt> </tt>
7777 <a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
7878 <a name="L28"></a><tt class="py-lineno"> 28</tt> <tt class="py-line"><tt class="py-docstring">Requirements: python 2.4 or higher.</tt> </tt>
7979 <a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
442442 <a name="L391"></a><tt class="py-lineno">391</tt> <tt class="py-line"> <tt class="py-name">outy</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">yisfloat</tt><tt class="py-op">,</tt><tt class="py-name">yislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">)</tt> </tt>
443443 <a name="L392"></a><tt class="py-lineno">392</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt> </tt>
444444 </div><a name="L393"></a><tt class="py-lineno">393</tt> <tt class="py-line"> </tt>
445 <a name="Proj.is_latlong"></a><div id="Proj.is_latlong-def"><a name="L394"></a><tt class="py-lineno">394</tt> <a class="py-toggle" href="#" id="Proj.is_latlong-toggle" onclick="return toggle('Proj.is_latlong');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Proj-class.html#is_latlong">is_latlong</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
446 </div><div id="Proj.is_latlong-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Proj.is_latlong-expanded"><a name="L395"></a><tt class="py-lineno">395</tt> <tt class="py-line"> <tt class="py-docstring">"""returns True if projection in geographic (lon/lat) coordinates"""</tt> </tt>
447 <a name="L396"></a><tt class="py-lineno">396</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="pyproj.Proj" class="py-name" href="#" onclick="return doclink('link-10', 'Proj', 'link-6');">Proj</a></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method pyproj.Proj.is_latlong()=pyproj.Proj-class.html#is_latlong"><a title="pyproj.Proj.is_latlong" class="py-name" href="#" onclick="return doclink('link-11', 'is_latlong', 'link-11');">is_latlong</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
448 </div><a name="L397"></a><tt class="py-lineno">397</tt> <tt class="py-line"> </tt>
449 <a name="Proj.is_geocent"></a><div id="Proj.is_geocent-def"><a name="L398"></a><tt class="py-lineno">398</tt> <a class="py-toggle" href="#" id="Proj.is_geocent-toggle" onclick="return toggle('Proj.is_geocent');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Proj-class.html#is_geocent">is_geocent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
450 </div><div id="Proj.is_geocent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Proj.is_geocent-expanded"><a name="L399"></a><tt class="py-lineno">399</tt> <tt class="py-line"> <tt class="py-docstring">"""returns True if projection in geocentric (x/y) coordinates"""</tt> </tt>
451 <a name="L400"></a><tt class="py-lineno">400</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="pyproj.Proj" class="py-name" href="#" onclick="return doclink('link-12', 'Proj', 'link-6');">Proj</a></tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method pyproj.Proj.is_geocent()=pyproj.Proj-class.html#is_geocent"><a title="pyproj.Proj.is_geocent" class="py-name" href="#" onclick="return doclink('link-13', 'is_geocent', 'link-13');">is_geocent</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
452 </div></div><a name="L401"></a><tt class="py-lineno">401</tt> <tt class="py-line"> </tt>
453 <a name="transform"></a><div id="transform-def"><a name="L402"></a><tt class="py-lineno">402</tt> <a class="py-toggle" href="#" id="transform-toggle" onclick="return toggle('transform');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#transform">transform</a><tt class="py-op">(</tt><tt class="py-param">p1</tt><tt class="py-op">,</tt> <tt class="py-param">p2</tt><tt class="py-op">,</tt> <tt class="py-param">x</tt><tt class="py-op">,</tt> <tt class="py-param">y</tt><tt class="py-op">,</tt> <tt class="py-param">z</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
454 </div><div id="transform-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="transform-expanded"><a name="L403"></a><tt class="py-lineno">403</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
455 <a name="L404"></a><tt class="py-lineno">404</tt> <tt class="py-line"><tt class="py-docstring"> x2, y2, z2 = transform(p1, p2, x1, y1, z1, radians=False)</tt> </tt>
456 <a name="L405"></a><tt class="py-lineno">405</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
457 <a name="L406"></a><tt class="py-lineno">406</tt> <tt class="py-line"><tt class="py-docstring"> Transform points between two coordinate systems defined by the</tt> </tt>
458 <a name="L407"></a><tt class="py-lineno">407</tt> <tt class="py-line"><tt class="py-docstring"> Proj instances p1 and p2.</tt> </tt>
459 <a name="L408"></a><tt class="py-lineno">408</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
460 <a name="L409"></a><tt class="py-lineno">409</tt> <tt class="py-line"><tt class="py-docstring"> The points x1,y1,z1 in the coordinate system defined by p1 are</tt> </tt>
461 <a name="L410"></a><tt class="py-lineno">410</tt> <tt class="py-line"><tt class="py-docstring"> transformed to x2,y2,z2 in the coordinate system defined by p2.</tt> </tt>
462 <a name="L411"></a><tt class="py-lineno">411</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
463 <a name="L412"></a><tt class="py-lineno">412</tt> <tt class="py-line"><tt class="py-docstring"> z1 is optional, if it is not set it is assumed to be zero (and</tt> </tt>
464 <a name="L413"></a><tt class="py-lineno">413</tt> <tt class="py-line"><tt class="py-docstring"> only x2 and y2 are returned).</tt> </tt>
465 <a name="L414"></a><tt class="py-lineno">414</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
466 <a name="L415"></a><tt class="py-lineno">415</tt> <tt class="py-line"><tt class="py-docstring"> In addition to converting between cartographic and geographic</tt> </tt>
467 <a name="L416"></a><tt class="py-lineno">416</tt> <tt class="py-line"><tt class="py-docstring"> projection coordinates, this function can take care of datum</tt> </tt>
468 <a name="L417"></a><tt class="py-lineno">417</tt> <tt class="py-line"><tt class="py-docstring"> shifts (which cannot be done using the __call__ method of the</tt> </tt>
469 <a name="L418"></a><tt class="py-lineno">418</tt> <tt class="py-line"><tt class="py-docstring"> Proj instances). It also allows for one of the coordinate</tt> </tt>
470 <a name="L419"></a><tt class="py-lineno">419</tt> <tt class="py-line"><tt class="py-docstring"> systems to be geographic (proj = 'latlong').</tt> </tt>
471 <a name="L420"></a><tt class="py-lineno">420</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
472 <a name="L421"></a><tt class="py-lineno">421</tt> <tt class="py-line"><tt class="py-docstring"> If optional keyword 'radians' is True (default is False) and p1</tt> </tt>
473 <a name="L422"></a><tt class="py-lineno">422</tt> <tt class="py-line"><tt class="py-docstring"> is defined in geographic coordinate (pj.is_latlong() is True),</tt> </tt>
474 <a name="L423"></a><tt class="py-lineno">423</tt> <tt class="py-line"><tt class="py-docstring"> x1,y1 is interpreted as radians instead of the default degrees.</tt> </tt>
475 <a name="L424"></a><tt class="py-lineno">424</tt> <tt class="py-line"><tt class="py-docstring"> Similarly, if p2 is defined in geographic coordinates and</tt> </tt>
476 <a name="L425"></a><tt class="py-lineno">425</tt> <tt class="py-line"><tt class="py-docstring"> radians=True, x2, y2 are returned in radians instead of degrees.</tt> </tt>
477 <a name="L426"></a><tt class="py-lineno">426</tt> <tt class="py-line"><tt class="py-docstring"> if p1.is_latlong() and p2.is_latlong() both are False, the</tt> </tt>
478 <a name="L427"></a><tt class="py-lineno">427</tt> <tt class="py-line"><tt class="py-docstring"> radians keyword has no effect.</tt> </tt>
479 <a name="L428"></a><tt class="py-lineno">428</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
480 <a name="L429"></a><tt class="py-lineno">429</tt> <tt class="py-line"><tt class="py-docstring"> x,y and z can be numpy or regular python arrays, python</tt> </tt>
481 <a name="L430"></a><tt class="py-lineno">430</tt> <tt class="py-line"><tt class="py-docstring"> lists/tuples or scalars. Arrays are fastest. For projections in</tt> </tt>
482 <a name="L431"></a><tt class="py-lineno">431</tt> <tt class="py-line"><tt class="py-docstring"> geocentric coordinates, values of x and y are given in meters.</tt> </tt>
483 <a name="L432"></a><tt class="py-lineno">432</tt> <tt class="py-line"><tt class="py-docstring"> z is always meters.</tt> </tt>
445 <a name="Proj.to_latlong"></a><div id="Proj.to_latlong-def"><a name="L394"></a><tt class="py-lineno">394</tt> <a class="py-toggle" href="#" id="Proj.to_latlong-toggle" onclick="return toggle('Proj.to_latlong');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Proj-class.html#to_latlong">to_latlong</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
446 </div><div id="Proj.to_latlong-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Proj.to_latlong-expanded"><a name="L395"></a><tt class="py-lineno">395</tt> <tt class="py-line"> <tt class="py-docstring">"""returns an equivalent Proj in the corresponding lon/lat</tt> </tt>
447 <a name="L396"></a><tt class="py-lineno">396</tt> <tt class="py-line"><tt class="py-docstring"> coordinates. (see pj_latlong_from_proj() in the Proj.4 C API)"""</tt> </tt>
448 <a name="L397"></a><tt class="py-lineno">397</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name"><a title="pyproj.Proj" class="py-name" href="#" onclick="return doclink('link-10', 'Proj', 'link-6');">Proj</a></tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method pyproj.Proj.to_latlong()=pyproj.Proj-class.html#to_latlong"><a title="pyproj.Proj.to_latlong" class="py-name" href="#" onclick="return doclink('link-11', 'to_latlong', 'link-11');">to_latlong</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
449 </div><a name="L398"></a><tt class="py-lineno">398</tt> <tt class="py-line"> </tt>
450 <a name="Proj.is_latlong"></a><div id="Proj.is_latlong-def"><a name="L399"></a><tt class="py-lineno">399</tt> <a class="py-toggle" href="#" id="Proj.is_latlong-toggle" onclick="return toggle('Proj.is_latlong');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Proj-class.html#is_latlong">is_latlong</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
451 </div><div id="Proj.is_latlong-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Proj.is_latlong-expanded"><a name="L400"></a><tt class="py-lineno">400</tt> <tt class="py-line"> <tt class="py-docstring">"""returns True if projection in geographic (lon/lat) coordinates"""</tt> </tt>
452 <a name="L401"></a><tt class="py-lineno">401</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="pyproj.Proj" class="py-name" href="#" onclick="return doclink('link-12', 'Proj', 'link-6');">Proj</a></tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method pyproj.Proj.is_latlong()=pyproj.Proj-class.html#is_latlong"><a title="pyproj.Proj.is_latlong" class="py-name" href="#" onclick="return doclink('link-13', 'is_latlong', 'link-13');">is_latlong</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
453 </div><a name="L402"></a><tt class="py-lineno">402</tt> <tt class="py-line"> </tt>
454 <a name="Proj.is_geocent"></a><div id="Proj.is_geocent-def"><a name="L403"></a><tt class="py-lineno">403</tt> <a class="py-toggle" href="#" id="Proj.is_geocent-toggle" onclick="return toggle('Proj.is_geocent');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Proj-class.html#is_geocent">is_geocent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
455 </div><div id="Proj.is_geocent-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Proj.is_geocent-expanded"><a name="L404"></a><tt class="py-lineno">404</tt> <tt class="py-line"> <tt class="py-docstring">"""returns True if projection in geocentric (x/y) coordinates"""</tt> </tt>
456 <a name="L405"></a><tt class="py-lineno">405</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="pyproj.Proj" class="py-name" href="#" onclick="return doclink('link-14', 'Proj', 'link-6');">Proj</a></tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Method pyproj.Proj.is_geocent()=pyproj.Proj-class.html#is_geocent"><a title="pyproj.Proj.is_geocent" class="py-name" href="#" onclick="return doclink('link-15', 'is_geocent', 'link-15');">is_geocent</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">)</tt> </tt>
457 </div></div><a name="L406"></a><tt class="py-lineno">406</tt> <tt class="py-line"> </tt>
458 <a name="transform"></a><div id="transform-def"><a name="L407"></a><tt class="py-lineno">407</tt> <a class="py-toggle" href="#" id="transform-toggle" onclick="return toggle('transform');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#transform">transform</a><tt class="py-op">(</tt><tt class="py-param">p1</tt><tt class="py-op">,</tt> <tt class="py-param">p2</tt><tt class="py-op">,</tt> <tt class="py-param">x</tt><tt class="py-op">,</tt> <tt class="py-param">y</tt><tt class="py-op">,</tt> <tt class="py-param">z</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
459 </div><div id="transform-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="transform-expanded"><a name="L408"></a><tt class="py-lineno">408</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
460 <a name="L409"></a><tt class="py-lineno">409</tt> <tt class="py-line"><tt class="py-docstring"> x2, y2, z2 = transform(p1, p2, x1, y1, z1, radians=False)</tt> </tt>
461 <a name="L410"></a><tt class="py-lineno">410</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
462 <a name="L411"></a><tt class="py-lineno">411</tt> <tt class="py-line"><tt class="py-docstring"> Transform points between two coordinate systems defined by the</tt> </tt>
463 <a name="L412"></a><tt class="py-lineno">412</tt> <tt class="py-line"><tt class="py-docstring"> Proj instances p1 and p2.</tt> </tt>
464 <a name="L413"></a><tt class="py-lineno">413</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
465 <a name="L414"></a><tt class="py-lineno">414</tt> <tt class="py-line"><tt class="py-docstring"> The points x1,y1,z1 in the coordinate system defined by p1 are</tt> </tt>
466 <a name="L415"></a><tt class="py-lineno">415</tt> <tt class="py-line"><tt class="py-docstring"> transformed to x2,y2,z2 in the coordinate system defined by p2.</tt> </tt>
467 <a name="L416"></a><tt class="py-lineno">416</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
468 <a name="L417"></a><tt class="py-lineno">417</tt> <tt class="py-line"><tt class="py-docstring"> z1 is optional, if it is not set it is assumed to be zero (and</tt> </tt>
469 <a name="L418"></a><tt class="py-lineno">418</tt> <tt class="py-line"><tt class="py-docstring"> only x2 and y2 are returned).</tt> </tt>
470 <a name="L419"></a><tt class="py-lineno">419</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
471 <a name="L420"></a><tt class="py-lineno">420</tt> <tt class="py-line"><tt class="py-docstring"> In addition to converting between cartographic and geographic</tt> </tt>
472 <a name="L421"></a><tt class="py-lineno">421</tt> <tt class="py-line"><tt class="py-docstring"> projection coordinates, this function can take care of datum</tt> </tt>
473 <a name="L422"></a><tt class="py-lineno">422</tt> <tt class="py-line"><tt class="py-docstring"> shifts (which cannot be done using the __call__ method of the</tt> </tt>
474 <a name="L423"></a><tt class="py-lineno">423</tt> <tt class="py-line"><tt class="py-docstring"> Proj instances). It also allows for one of the coordinate</tt> </tt>
475 <a name="L424"></a><tt class="py-lineno">424</tt> <tt class="py-line"><tt class="py-docstring"> systems to be geographic (proj = 'latlong').</tt> </tt>
476 <a name="L425"></a><tt class="py-lineno">425</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
477 <a name="L426"></a><tt class="py-lineno">426</tt> <tt class="py-line"><tt class="py-docstring"> If optional keyword 'radians' is True (default is False) and p1</tt> </tt>
478 <a name="L427"></a><tt class="py-lineno">427</tt> <tt class="py-line"><tt class="py-docstring"> is defined in geographic coordinate (pj.is_latlong() is True),</tt> </tt>
479 <a name="L428"></a><tt class="py-lineno">428</tt> <tt class="py-line"><tt class="py-docstring"> x1,y1 is interpreted as radians instead of the default degrees.</tt> </tt>
480 <a name="L429"></a><tt class="py-lineno">429</tt> <tt class="py-line"><tt class="py-docstring"> Similarly, if p2 is defined in geographic coordinates and</tt> </tt>
481 <a name="L430"></a><tt class="py-lineno">430</tt> <tt class="py-line"><tt class="py-docstring"> radians=True, x2, y2 are returned in radians instead of degrees.</tt> </tt>
482 <a name="L431"></a><tt class="py-lineno">431</tt> <tt class="py-line"><tt class="py-docstring"> if p1.is_latlong() and p2.is_latlong() both are False, the</tt> </tt>
483 <a name="L432"></a><tt class="py-lineno">432</tt> <tt class="py-line"><tt class="py-docstring"> radians keyword has no effect.</tt> </tt>
484484 <a name="L433"></a><tt class="py-lineno">433</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
485 <a name="L434"></a><tt class="py-lineno">434</tt> <tt class="py-line"><tt class="py-docstring"> Example usage:</tt> </tt>
486 <a name="L435"></a><tt class="py-lineno">435</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
487 <a name="L436"></a><tt class="py-lineno">436</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # projection 1: UTM zone 15, grs80 ellipse, NAD83 datum</tt> </tt>
488 <a name="L437"></a><tt class="py-lineno">437</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # (defined by epsg code 26915)</tt> </tt>
489 <a name="L438"></a><tt class="py-lineno">438</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p1 = Proj(init='epsg:26915')</tt> </tt>
490 <a name="L439"></a><tt class="py-lineno">439</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # projection 2: UTM zone 15, clrk66 ellipse, NAD27 datum</tt> </tt>
491 <a name="L440"></a><tt class="py-lineno">440</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p2 = Proj(init='epsg:26715')</tt> </tt>
492 <a name="L441"></a><tt class="py-lineno">441</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # find x,y of Jefferson City, MO.</tt> </tt>
493 <a name="L442"></a><tt class="py-lineno">442</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x1, y1 = p1(-92.199881,38.56694)</tt> </tt>
494 <a name="L443"></a><tt class="py-lineno">443</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # transform this point to projection 2 coordinates.</tt> </tt>
495 <a name="L444"></a><tt class="py-lineno">444</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x2, y2 = transform(p1,p2,x1,y1)</tt> </tt>
496 <a name="L445"></a><tt class="py-lineno">445</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %11.3f' % (x1,y1)</tt> </tt>
497 <a name="L446"></a><tt class="py-lineno">446</tt> <tt class="py-line"><tt class="py-docstring"> '569704.566 4269024.671'</tt> </tt>
498 <a name="L447"></a><tt class="py-lineno">447</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %11.3f' % (x2,y2)</tt> </tt>
499 <a name="L448"></a><tt class="py-lineno">448</tt> <tt class="py-line"><tt class="py-docstring"> '569722.342 4268814.027'</tt> </tt>
500 <a name="L449"></a><tt class="py-lineno">449</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%8.3f %5.3f' % p2(x2,y2,inverse=True)</tt> </tt>
501 <a name="L450"></a><tt class="py-lineno">450</tt> <tt class="py-line"><tt class="py-docstring"> ' -92.200 38.567'</tt> </tt>
502 <a name="L451"></a><tt class="py-lineno">451</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # process 3 points at a time in a tuple</tt> </tt>
503 <a name="L452"></a><tt class="py-lineno">452</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lats = (38.83,39.32,38.75) # Columbia, KC and StL Missouri</tt> </tt>
504 <a name="L453"></a><tt class="py-lineno">453</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons = (-92.22,-94.72,-90.37)</tt> </tt>
505 <a name="L454"></a><tt class="py-lineno">454</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x1, y1 = p1(lons,lats)</tt> </tt>
506 <a name="L455"></a><tt class="py-lineno">455</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x2, y2 = transform(p1,p2,x1,y1)</tt> </tt>
507 <a name="L456"></a><tt class="py-lineno">456</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; xy = x1+y1</tt> </tt>
508 <a name="L457"></a><tt class="py-lineno">457</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy</tt> </tt>
509 <a name="L458"></a><tt class="py-lineno">458</tt> <tt class="py-line"><tt class="py-docstring"> '567703.344 351730.944 728553.093 4298200.739 4353698.725 4292319.005'</tt> </tt>
510 <a name="L459"></a><tt class="py-lineno">459</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; xy = x2+y2</tt> </tt>
511 <a name="L460"></a><tt class="py-lineno">460</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy</tt> </tt>
512 <a name="L461"></a><tt class="py-lineno">461</tt> <tt class="py-line"><tt class="py-docstring"> '567721.149 351747.558 728569.133 4297989.112 4353489.644 4292106.305'</tt> </tt>
513 <a name="L462"></a><tt class="py-lineno">462</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons, lats = p2(x2,y2,inverse=True)</tt> </tt>
514 <a name="L463"></a><tt class="py-lineno">463</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; xy = lons+lats</tt> </tt>
515 <a name="L464"></a><tt class="py-lineno">464</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%8.3f %8.3f %8.3f %5.3f %5.3f %5.3f' % xy</tt> </tt>
516 <a name="L465"></a><tt class="py-lineno">465</tt> <tt class="py-line"><tt class="py-docstring"> ' -92.220 -94.720 -90.370 38.830 39.320 38.750'</tt> </tt>
517 <a name="L466"></a><tt class="py-lineno">466</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # test datum shifting, installation of extra datum grid files.</tt> </tt>
518 <a name="L467"></a><tt class="py-lineno">467</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p1 = Proj(proj='latlong',datum='WGS84')</tt> </tt>
519 <a name="L468"></a><tt class="py-lineno">468</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x1 = -111.5; y1 = 45.25919444444</tt> </tt>
520 <a name="L469"></a><tt class="py-lineno">469</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p2 = Proj(proj="utm",zone=10,datum='NAD27')</tt> </tt>
521 <a name="L470"></a><tt class="py-lineno">470</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x2, y2 = transform(p1, p2, x1, y1)</tt> </tt>
522 <a name="L471"></a><tt class="py-lineno">471</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%12.3f %12.3f" % (x2,y2)</tt> </tt>
523 <a name="L472"></a><tt class="py-lineno">472</tt> <tt class="py-line"><tt class="py-docstring"> ' 1402285.991 5076292.423'</tt> </tt>
524 <a name="L473"></a><tt class="py-lineno">473</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
525 <a name="L474"></a><tt class="py-lineno">474</tt> <tt class="py-line"> <tt class="py-comment"># process inputs, making copies that support buffer API.</tt> </tt>
526 <a name="L475"></a><tt class="py-lineno">475</tt> <tt class="py-line"> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">xisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">xislist</tt><tt class="py-op">,</tt> <tt class="py-name">xistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
527 <a name="L476"></a><tt class="py-lineno">476</tt> <tt class="py-line"> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">yisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">yislist</tt><tt class="py-op">,</tt> <tt class="py-name">yistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
528 <a name="L477"></a><tt class="py-lineno">477</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">z</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
529 <a name="L478"></a><tt class="py-lineno">478</tt> <tt class="py-line"> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">zisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">zislist</tt><tt class="py-op">,</tt> <tt class="py-name">zistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">z</tt><tt class="py-op">)</tt> </tt>
530 <a name="L479"></a><tt class="py-lineno">479</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
531 <a name="L480"></a><tt class="py-lineno">480</tt> <tt class="py-line"> <tt class="py-name">inz</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
532 <a name="L481"></a><tt class="py-lineno">481</tt> <tt class="py-line"> <tt class="py-comment"># call pj_transform. inx,iny,inz buffers modified in place.</tt> </tt>
533 <a name="L482"></a><tt class="py-lineno">482</tt> <tt class="py-line"> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt class="py-name">_transform</tt><tt class="py-op">(</tt><tt class="py-name">p1</tt><tt class="py-op">,</tt><tt class="py-name">p2</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">,</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
534 <a name="L483"></a><tt class="py-lineno">483</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back.</tt> </tt>
535 <a name="L484"></a><tt class="py-lineno">484</tt> <tt class="py-line"> <tt class="py-name">outx</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">xisfloat</tt><tt class="py-op">,</tt><tt class="py-name">xislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
536 <a name="L485"></a><tt class="py-lineno">485</tt> <tt class="py-line"> <tt class="py-name">outy</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">yisfloat</tt><tt class="py-op">,</tt><tt class="py-name">yislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">)</tt> </tt>
537 <a name="L486"></a><tt class="py-lineno">486</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">inz</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
538 <a name="L487"></a><tt class="py-lineno">487</tt> <tt class="py-line"> <tt class="py-name">outz</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">zisfloat</tt><tt class="py-op">,</tt><tt class="py-name">zislist</tt><tt class="py-op">,</tt><tt class="py-name">zistuple</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">)</tt> </tt>
539 <a name="L488"></a><tt class="py-lineno">488</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt><tt class="py-op">,</tt> <tt class="py-name">outz</tt> </tt>
540 <a name="L489"></a><tt class="py-lineno">489</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
541 <a name="L490"></a><tt class="py-lineno">490</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt> </tt>
542 </div><a name="L491"></a><tt class="py-lineno">491</tt> <tt class="py-line"> </tt>
543 <a name="_copytobuffer_return_scalar"></a><div id="_copytobuffer_return_scalar-def"><a name="L492"></a><tt class="py-lineno">492</tt> <a class="py-toggle" href="#" id="_copytobuffer_return_scalar-toggle" onclick="return toggle('_copytobuffer_return_scalar');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_copytobuffer_return_scalar">_copytobuffer_return_scalar</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
544 </div><div id="_copytobuffer_return_scalar-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_copytobuffer_return_scalar-expanded"><a name="L493"></a><tt class="py-lineno">493</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
545 <a name="L494"></a><tt class="py-lineno">494</tt> <tt class="py-line"> <tt class="py-comment"># inx,isfloat,islist,istuple</tt> </tt>
546 <a name="L495"></a><tt class="py-lineno">495</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt> </tt>
547 <a name="L496"></a><tt class="py-lineno">496</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
548 <a name="L497"></a><tt class="py-lineno">497</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">'input must be an array, list, tuple or scalar'</tt><tt class="py-op">)</tt> </tt>
549 </div><a name="L498"></a><tt class="py-lineno">498</tt> <tt class="py-line"> </tt>
550 <a name="_copytobuffer"></a><div id="_copytobuffer-def"><a name="L499"></a><tt class="py-lineno">499</tt> <a class="py-toggle" href="#" id="_copytobuffer-toggle" onclick="return toggle('_copytobuffer');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_copytobuffer">_copytobuffer</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
551 </div><div id="_copytobuffer-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_copytobuffer-expanded"><a name="L500"></a><tt class="py-lineno">500</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
552 <a name="L501"></a><tt class="py-lineno">501</tt> <tt class="py-line"><tt class="py-docstring"> return a copy of x as an object that supports the python Buffer</tt> </tt>
553 <a name="L502"></a><tt class="py-lineno">502</tt> <tt class="py-line"><tt class="py-docstring"> API (python array if input is float, list or tuple, numpy array</tt> </tt>
554 <a name="L503"></a><tt class="py-lineno">503</tt> <tt class="py-line"><tt class="py-docstring"> if input is a numpy array). returns copyofx, isfloat, islist,</tt> </tt>
555 <a name="L504"></a><tt class="py-lineno">504</tt> <tt class="py-line"><tt class="py-docstring"> istuple (islist is True if input is a list, istuple is true if</tt> </tt>
556 <a name="L505"></a><tt class="py-lineno">505</tt> <tt class="py-line"><tt class="py-docstring"> input is a tuple, isfloat is true if input is a float).</tt> </tt>
557 <a name="L506"></a><tt class="py-lineno">506</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
558 <a name="L507"></a><tt class="py-lineno">507</tt> <tt class="py-line"> <tt class="py-comment"># make sure x supports Buffer API and contains doubles.</tt> </tt>
559 <a name="L508"></a><tt class="py-lineno">508</tt> <tt class="py-line"> <tt class="py-name">isfloat</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt><tt class="py-op">;</tt> <tt class="py-name">islist</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt><tt class="py-op">;</tt> <tt class="py-name">istuple</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
560 <a name="L509"></a><tt class="py-lineno">509</tt> <tt class="py-line"> <tt class="py-comment"># first, if it's a numpy array scalar convert to float</tt> </tt>
561 <a name="L510"></a><tt class="py-lineno">510</tt> <tt class="py-line"> <tt class="py-comment"># (array scalars don't support buffer API)</tt> </tt>
562 <a name="L511"></a><tt class="py-lineno">511</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt><tt class="py-string">'shape'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
563 <a name="L512"></a><tt class="py-lineno">512</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">shape</tt> <tt class="py-op">==</tt> <tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
564 <a name="L513"></a><tt class="py-lineno">513</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_copytobuffer_return_scalar</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
565 <a name="L514"></a><tt class="py-lineno">514</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
566 <a name="L515"></a><tt class="py-lineno">515</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
567 <a name="L516"></a><tt class="py-lineno">516</tt> <tt class="py-line"> <tt class="py-comment"># typecast numpy arrays to double.</tt> </tt>
568 <a name="L517"></a><tt class="py-lineno">517</tt> <tt class="py-line"> <tt class="py-comment"># (this makes a copy - which is crucial</tt> </tt>
569 <a name="L518"></a><tt class="py-lineno">518</tt> <tt class="py-line"> <tt class="py-comment"># since buffer is modified in place)</tt> </tt>
570 <a name="L519"></a><tt class="py-lineno">519</tt> <tt class="py-line"> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">dtype</tt><tt class="py-op">.</tt><tt class="py-name">char</tt> </tt>
571 <a name="L520"></a><tt class="py-lineno">520</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">)</tt> </tt>
572 <a name="L521"></a><tt class="py-lineno">521</tt> <tt class="py-line"> <tt class="py-comment"># inx,isfloat,islist,istuple</tt> </tt>
573 <a name="L522"></a><tt class="py-lineno">522</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt> </tt>
574 <a name="L523"></a><tt class="py-lineno">523</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
575 <a name="L524"></a><tt class="py-lineno">524</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-comment"># perhaps they are Numeric/numarrays?</tt> </tt>
576 <a name="L525"></a><tt class="py-lineno">525</tt> <tt class="py-line"> <tt class="py-comment"># sorry, not tested yet.</tt> </tt>
577 <a name="L526"></a><tt class="py-lineno">526</tt> <tt class="py-line"> <tt class="py-comment"># i don't know Numeric/numarrays has `shape'.</tt> </tt>
578 <a name="L527"></a><tt class="py-lineno">527</tt> <tt class="py-line"> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">typecode</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
579 <a name="L528"></a><tt class="py-lineno">528</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">)</tt> </tt>
580 <a name="L529"></a><tt class="py-lineno">529</tt> <tt class="py-line"> <tt class="py-comment"># inx,isfloat,islist,istuple</tt> </tt>
581 <a name="L530"></a><tt class="py-lineno">530</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt> </tt>
582 <a name="L531"></a><tt class="py-lineno">531</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
583 <a name="L532"></a><tt class="py-lineno">532</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">'input must be an array, list, tuple or scalar'</tt><tt class="py-op">)</tt> </tt>
584 <a name="L533"></a><tt class="py-lineno">533</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
585 <a name="L534"></a><tt class="py-lineno">534</tt> <tt class="py-line"> <tt class="py-comment"># perhaps they are regular python arrays?</tt> </tt>
586 <a name="L535"></a><tt class="py-lineno">535</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-string">'typecode'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
587 <a name="L536"></a><tt class="py-lineno">536</tt> <tt class="py-line"> <tt class="py-comment">#x.typecode</tt> </tt>
588 <a name="L537"></a><tt class="py-lineno">537</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
589 <a name="L538"></a><tt class="py-lineno">538</tt> <tt class="py-line"> <tt class="py-comment"># try to convert to python array</tt> </tt>
590 <a name="L539"></a><tt class="py-lineno">539</tt> <tt class="py-line"> <tt class="py-comment"># a list.</tt> </tt>
591 <a name="L540"></a><tt class="py-lineno">540</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">list</tt><tt class="py-op">:</tt> </tt>
592 <a name="L541"></a><tt class="py-lineno">541</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
593 <a name="L542"></a><tt class="py-lineno">542</tt> <tt class="py-line"> <tt class="py-name">islist</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
594 <a name="L543"></a><tt class="py-lineno">543</tt> <tt class="py-line"> <tt class="py-comment"># a tuple.</tt> </tt>
595 <a name="L544"></a><tt class="py-lineno">544</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">tuple</tt><tt class="py-op">:</tt> </tt>
596 <a name="L545"></a><tt class="py-lineno">545</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
597 <a name="L546"></a><tt class="py-lineno">546</tt> <tt class="py-line"> <tt class="py-name">istuple</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
598 <a name="L547"></a><tt class="py-lineno">547</tt> <tt class="py-line"> <tt class="py-comment"># a scalar?</tt> </tt>
599 <a name="L548"></a><tt class="py-lineno">548</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
600 <a name="L549"></a><tt class="py-lineno">549</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_copytobuffer_return_scalar</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
601 <a name="L550"></a><tt class="py-lineno">550</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">isfloat</tt><tt class="py-op">,</tt><tt class="py-name">islist</tt><tt class="py-op">,</tt><tt class="py-name">istuple</tt> </tt>
602 </div><a name="L551"></a><tt class="py-lineno">551</tt> <tt class="py-line"> </tt>
603 <a name="_convertback"></a><div id="_convertback-def"><a name="L552"></a><tt class="py-lineno">552</tt> <a class="py-toggle" href="#" id="_convertback-toggle" onclick="return toggle('_convertback');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_convertback">_convertback</a><tt class="py-op">(</tt><tt class="py-param">isfloat</tt><tt class="py-op">,</tt><tt class="py-param">islist</tt><tt class="py-op">,</tt><tt class="py-param">istuple</tt><tt class="py-op">,</tt><tt class="py-param">inx</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
604 </div><div id="_convertback-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_convertback-expanded"><a name="L553"></a><tt class="py-lineno">553</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back to original type.</tt> </tt>
605 <a name="L554"></a><tt class="py-lineno">554</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">isfloat</tt><tt class="py-op">:</tt> </tt>
606 <a name="L555"></a><tt class="py-lineno">555</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
607 <a name="L556"></a><tt class="py-lineno">556</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">islist</tt><tt class="py-op">:</tt> </tt>
608 <a name="L557"></a><tt class="py-lineno">557</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">.</tt><tt class="py-name">tolist</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
609 <a name="L558"></a><tt class="py-lineno">558</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">istuple</tt><tt class="py-op">:</tt> </tt>
610 <a name="L559"></a><tt class="py-lineno">559</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
611 <a name="L560"></a><tt class="py-lineno">560</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
612 <a name="L561"></a><tt class="py-lineno">561</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt> </tt>
613 </div><a name="L562"></a><tt class="py-lineno">562</tt> <tt class="py-line"> </tt>
614 <a name="_dict2string"></a><div id="_dict2string-def"><a name="L563"></a><tt class="py-lineno">563</tt> <a class="py-toggle" href="#" id="_dict2string-toggle" onclick="return toggle('_dict2string');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_dict2string">_dict2string</a><tt class="py-op">(</tt><tt class="py-param">projparams</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
615 </div><div id="_dict2string-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_dict2string-expanded"><a name="L564"></a><tt class="py-lineno">564</tt> <tt class="py-line"> <tt class="py-comment"># convert a dict to a proj4 string.</tt> </tt>
616 <a name="L565"></a><tt class="py-lineno">565</tt> <tt class="py-line"> <tt class="py-name">pjargs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
617 <a name="L566"></a><tt class="py-lineno">566</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt><tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt class="py-name">projparams</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
618 <a name="L567"></a><tt class="py-lineno">567</tt> <tt class="py-line"> <tt class="py-name">pjargs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-string">'+'</tt><tt class="py-op">+</tt><tt class="py-name">key</tt><tt class="py-op">+</tt><tt class="py-string">"="</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-string">' '</tt><tt class="py-op">)</tt> </tt>
619 <a name="L568"></a><tt class="py-lineno">568</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">''</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">pjargs</tt><tt class="py-op">)</tt> </tt>
620 </div><a name="L569"></a><tt class="py-lineno">569</tt> <tt class="py-line"> </tt>
621 <a name="Geod"></a><div id="Geod-def"><a name="L570"></a><tt class="py-lineno">570</tt> <a class="py-toggle" href="#" id="Geod-toggle" onclick="return toggle('Geod');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyproj.Geod-class.html">Geod</a><tt class="py-op">(</tt><tt class="py-base-class">_proj</tt><tt class="py-op">.</tt><tt class="py-base-class">Geod</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
622 </div><div id="Geod-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Geod-expanded"><a name="L571"></a><tt class="py-lineno">571</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
623 <a name="L572"></a><tt class="py-lineno">572</tt> <tt class="py-line"><tt class="py-docstring"> performs forward and inverse geodetic, or Great Circle,</tt> </tt>
624 <a name="L573"></a><tt class="py-lineno">573</tt> <tt class="py-line"><tt class="py-docstring"> computations. The forward computation (using the 'fwd' method)</tt> </tt>
625 <a name="L574"></a><tt class="py-lineno">574</tt> <tt class="py-line"><tt class="py-docstring"> involves determining latitude, longitude and back azimuth of a</tt> </tt>
626 <a name="L575"></a><tt class="py-lineno">575</tt> <tt class="py-line"><tt class="py-docstring"> computations. The forward computation (using the 'fwd' method)</tt> </tt>
627 <a name="L576"></a><tt class="py-lineno">576</tt> <tt class="py-line"><tt class="py-docstring"> involves determining latitude, longitude and back azimuth of a</tt> </tt>
628 <a name="L577"></a><tt class="py-lineno">577</tt> <tt class="py-line"><tt class="py-docstring"> terminus point given the latitude and longitude of an initial</tt> </tt>
629 <a name="L578"></a><tt class="py-lineno">578</tt> <tt class="py-line"><tt class="py-docstring"> point, plus azimuth and distance. The inverse computation (using</tt> </tt>
630 <a name="L579"></a><tt class="py-lineno">579</tt> <tt class="py-line"><tt class="py-docstring"> the 'inv' method) involves determining the forward and back</tt> </tt>
631 <a name="L580"></a><tt class="py-lineno">580</tt> <tt class="py-line"><tt class="py-docstring"> azimuths and distance given the latitudes and longitudes of an</tt> </tt>
632 <a name="L581"></a><tt class="py-lineno">581</tt> <tt class="py-line"><tt class="py-docstring"> initial and terminus point.</tt> </tt>
633 <a name="L582"></a><tt class="py-lineno">582</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
634 <a name="Geod.__new__"></a><div id="Geod.__new__-def"><a name="L583"></a><tt class="py-lineno">583</tt> <a class="py-toggle" href="#" id="Geod.__new__-toggle" onclick="return toggle('Geod.__new__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#__new__">__new__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">initstring</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
635 </div><div id="Geod.__new__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.__new__-expanded"><a name="L584"></a><tt class="py-lineno">584</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
636 <a name="L585"></a><tt class="py-lineno">585</tt> <tt class="py-line"><tt class="py-docstring"> initialize a Geod class instance.</tt> </tt>
637 <a name="L586"></a><tt class="py-lineno">586</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
638 <a name="L587"></a><tt class="py-lineno">587</tt> <tt class="py-line"><tt class="py-docstring"> Geodetic parameters for specifying the ellipsoid</tt> </tt>
639 <a name="L588"></a><tt class="py-lineno">588</tt> <tt class="py-line"><tt class="py-docstring"> can be given in a dictionary 'initparams', as keyword arguments,</tt> </tt>
640 <a name="L589"></a><tt class="py-lineno">589</tt> <tt class="py-line"><tt class="py-docstring"> or as as proj4 geod initialization string.</tt> </tt>
641 <a name="L590"></a><tt class="py-lineno">590</tt> <tt class="py-line"><tt class="py-docstring"> Following is a list of the ellipsoids that may be defined using the</tt> </tt>
642 <a name="L591"></a><tt class="py-lineno">591</tt> <tt class="py-line"><tt class="py-docstring"> 'ellps' keyword (these are stored in the model variable pj_ellps)::</tt> </tt>
643 <a name="L592"></a><tt class="py-lineno">592</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
644 <a name="L593"></a><tt class="py-lineno">593</tt> <tt class="py-line"><tt class="py-docstring"> MERIT a=6378137.0 rf=298.257 MERIT 1983</tt> </tt>
645 <a name="L594"></a><tt class="py-lineno">594</tt> <tt class="py-line"><tt class="py-docstring"> SGS85 a=6378136.0 rf=298.257 Soviet Geodetic System 85</tt> </tt>
646 <a name="L595"></a><tt class="py-lineno">595</tt> <tt class="py-line"><tt class="py-docstring"> GRS80 a=6378137.0 rf=298.257222101 GRS 1980(IUGG, 1980)</tt> </tt>
647 <a name="L596"></a><tt class="py-lineno">596</tt> <tt class="py-line"><tt class="py-docstring"> IAU76 a=6378140.0 rf=298.257 IAU 1976</tt> </tt>
648 <a name="L597"></a><tt class="py-lineno">597</tt> <tt class="py-line"><tt class="py-docstring"> airy a=6377563.396 b=6356256.910 Airy 1830</tt> </tt>
649 <a name="L598"></a><tt class="py-lineno">598</tt> <tt class="py-line"><tt class="py-docstring"> APL4.9 a=6378137.0. rf=298.25 Appl. Physics. 1965</tt> </tt>
650 <a name="L599"></a><tt class="py-lineno">599</tt> <tt class="py-line"><tt class="py-docstring"> airy a=6377563.396 b=6356256.910 Airy 1830</tt> </tt>
651 <a name="L600"></a><tt class="py-lineno">600</tt> <tt class="py-line"><tt class="py-docstring"> APL4.9 a=6378137.0. rf=298.25 Appl. Physics. 1965</tt> </tt>
652 <a name="L601"></a><tt class="py-lineno">601</tt> <tt class="py-line"><tt class="py-docstring"> NWL9D a=6378145.0. rf=298.25 Naval Weapons Lab., 1965</tt> </tt>
653 <a name="L602"></a><tt class="py-lineno">602</tt> <tt class="py-line"><tt class="py-docstring"> mod_airy a=6377340.189 b=6356034.446 Modified Airy</tt> </tt>
654 <a name="L603"></a><tt class="py-lineno">603</tt> <tt class="py-line"><tt class="py-docstring"> andrae a=6377104.43 rf=300.0 Andrae 1876 (Den., Iclnd.)</tt> </tt>
655 <a name="L604"></a><tt class="py-lineno">604</tt> <tt class="py-line"><tt class="py-docstring"> aust_SA a=6378160.0 rf=298.25 Australian Natl &amp; S. Amer. 1969</tt> </tt>
656 <a name="L605"></a><tt class="py-lineno">605</tt> <tt class="py-line"><tt class="py-docstring"> GRS67 a=6378160.0 rf=298.247167427 GRS 67(IUGG 1967)</tt> </tt>
657 <a name="L606"></a><tt class="py-lineno">606</tt> <tt class="py-line"><tt class="py-docstring"> bessel a=6377397.155 rf=299.1528128 Bessel 1841</tt> </tt>
658 <a name="L607"></a><tt class="py-lineno">607</tt> <tt class="py-line"><tt class="py-docstring"> bess_nam a=6377483.865 rf=299.1528128 Bessel 1841 (Namibia)</tt> </tt>
659 <a name="L608"></a><tt class="py-lineno">608</tt> <tt class="py-line"><tt class="py-docstring"> clrk66 a=6378206.4 b=6356583.8 Clarke 1866</tt> </tt>
660 <a name="L609"></a><tt class="py-lineno">609</tt> <tt class="py-line"><tt class="py-docstring"> clrk80 a=6378249.145 rf=293.4663 Clarke 1880 mod.</tt> </tt>
661 <a name="L610"></a><tt class="py-lineno">610</tt> <tt class="py-line"><tt class="py-docstring"> CPM a=6375738.7 rf=334.29 Comm. des Poids et Mesures 1799</tt> </tt>
662 <a name="L611"></a><tt class="py-lineno">611</tt> <tt class="py-line"><tt class="py-docstring"> delmbr a=6376428. rf=311.5 Delambre 1810 (Belgium)</tt> </tt>
663 <a name="L612"></a><tt class="py-lineno">612</tt> <tt class="py-line"><tt class="py-docstring"> engelis a=6378136.05 rf=298.2566 Engelis 1985</tt> </tt>
664 <a name="L613"></a><tt class="py-lineno">613</tt> <tt class="py-line"><tt class="py-docstring"> evrst30 a=6377276.345 rf=300.8017 Everest 1830</tt> </tt>
665 <a name="L614"></a><tt class="py-lineno">614</tt> <tt class="py-line"><tt class="py-docstring"> evrst48 a=6377304.063 rf=300.8017 Everest 1948</tt> </tt>
666 <a name="L615"></a><tt class="py-lineno">615</tt> <tt class="py-line"><tt class="py-docstring"> evrst56 a=6377301.243 rf=300.8017 Everest 1956</tt> </tt>
667 <a name="L616"></a><tt class="py-lineno">616</tt> <tt class="py-line"><tt class="py-docstring"> evrst69 a=6377295.664 rf=300.8017 Everest 1969</tt> </tt>
668 <a name="L617"></a><tt class="py-lineno">617</tt> <tt class="py-line"><tt class="py-docstring"> evrstSS a=6377298.556 rf=300.8017 Everest (Sabah &amp; Sarawak)</tt> </tt>
669 <a name="L618"></a><tt class="py-lineno">618</tt> <tt class="py-line"><tt class="py-docstring"> fschr60 a=6378166. rf=298.3 Fischer (Mercury Datum) 1960</tt> </tt>
670 <a name="L619"></a><tt class="py-lineno">619</tt> <tt class="py-line"><tt class="py-docstring"> fschr60m a=6378155. rf=298.3 Modified Fischer 1960</tt> </tt>
671 <a name="L620"></a><tt class="py-lineno">620</tt> <tt class="py-line"><tt class="py-docstring"> fschr68 a=6378150. rf=298.3 Fischer 1968</tt> </tt>
672 <a name="L621"></a><tt class="py-lineno">621</tt> <tt class="py-line"><tt class="py-docstring"> helmert a=6378200. rf=298.3 Helmert 1906</tt> </tt>
673 <a name="L622"></a><tt class="py-lineno">622</tt> <tt class="py-line"><tt class="py-docstring"> hough a=6378270.0 rf=297. Hough</tt> </tt>
674 <a name="L623"></a><tt class="py-lineno">623</tt> <tt class="py-line"><tt class="py-docstring"> helmert a=6378200. rf=298.3 Helmert 1906</tt> </tt>
675 <a name="L624"></a><tt class="py-lineno">624</tt> <tt class="py-line"><tt class="py-docstring"> hough a=6378270.0 rf=297. Hough</tt> </tt>
676 <a name="L625"></a><tt class="py-lineno">625</tt> <tt class="py-line"><tt class="py-docstring"> intl a=6378388.0 rf=297. International 1909 (Hayford)</tt> </tt>
677 <a name="L626"></a><tt class="py-lineno">626</tt> <tt class="py-line"><tt class="py-docstring"> krass a=6378245.0 rf=298.3 Krassovsky, 1942</tt> </tt>
678 <a name="L627"></a><tt class="py-lineno">627</tt> <tt class="py-line"><tt class="py-docstring"> kaula a=6378163. rf=298.24 Kaula 1961</tt> </tt>
679 <a name="L628"></a><tt class="py-lineno">628</tt> <tt class="py-line"><tt class="py-docstring"> lerch a=6378139. rf=298.257 Lerch 1979</tt> </tt>
680 <a name="L629"></a><tt class="py-lineno">629</tt> <tt class="py-line"><tt class="py-docstring"> mprts a=6397300. rf=191. Maupertius 1738</tt> </tt>
681 <a name="L630"></a><tt class="py-lineno">630</tt> <tt class="py-line"><tt class="py-docstring"> new_intl a=6378157.5 b=6356772.2 New International 1967</tt> </tt>
682 <a name="L631"></a><tt class="py-lineno">631</tt> <tt class="py-line"><tt class="py-docstring"> plessis a=6376523. b=6355863. Plessis 1817 (France)</tt> </tt>
683 <a name="L632"></a><tt class="py-lineno">632</tt> <tt class="py-line"><tt class="py-docstring"> SEasia a=6378155.0 b=6356773.3205 Southeast Asia</tt> </tt>
684 <a name="L633"></a><tt class="py-lineno">633</tt> <tt class="py-line"><tt class="py-docstring"> walbeck a=6376896.0 b=6355834.8467 Walbeck</tt> </tt>
685 <a name="L634"></a><tt class="py-lineno">634</tt> <tt class="py-line"><tt class="py-docstring"> WGS60 a=6378165.0 rf=298.3 WGS 60</tt> </tt>
686 <a name="L635"></a><tt class="py-lineno">635</tt> <tt class="py-line"><tt class="py-docstring"> WGS66 a=6378145.0 rf=298.25 WGS 66</tt> </tt>
687 <a name="L636"></a><tt class="py-lineno">636</tt> <tt class="py-line"><tt class="py-docstring"> WGS72 a=6378135.0 rf=298.26 WGS 72</tt> </tt>
688 <a name="L637"></a><tt class="py-lineno">637</tt> <tt class="py-line"><tt class="py-docstring"> WGS84 a=6378137.0 rf=298.257223563 WGS 84</tt> </tt>
689 <a name="L638"></a><tt class="py-lineno">638</tt> <tt class="py-line"><tt class="py-docstring"> sphere a=6370997.0 b=6370997.0 Normal Sphere (r=6370997)</tt> </tt>
690 <a name="L639"></a><tt class="py-lineno">639</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
691 <a name="L640"></a><tt class="py-lineno">640</tt> <tt class="py-line"><tt class="py-docstring"> The parameters of the ellipsoid may also be set directly using</tt> </tt>
692 <a name="L641"></a><tt class="py-lineno">641</tt> <tt class="py-line"><tt class="py-docstring"> the 'a' (semi-major or equatorial axis radius) keyword, and</tt> </tt>
693 <a name="L642"></a><tt class="py-lineno">642</tt> <tt class="py-line"><tt class="py-docstring"> any one of the following keywords: 'b' (semi-minor,</tt> </tt>
694 <a name="L643"></a><tt class="py-lineno">643</tt> <tt class="py-line"><tt class="py-docstring"> or polar axis radius), 'e' (eccentricity), 'es' (eccentricity</tt> </tt>
695 <a name="L644"></a><tt class="py-lineno">644</tt> <tt class="py-line"><tt class="py-docstring"> squared), 'f' (flattening), or 'rf' (reciprocal flattening).</tt> </tt>
696 <a name="L645"></a><tt class="py-lineno">645</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
697 <a name="L646"></a><tt class="py-lineno">646</tt> <tt class="py-line"><tt class="py-docstring"> See the proj documentation (http://trac.osgeo.org/proj/) for more</tt> </tt>
698 <a name="L647"></a><tt class="py-lineno">647</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
699 <a name="L648"></a><tt class="py-lineno">648</tt> <tt class="py-line"><tt class="py-docstring"> See the proj documentation (http://trac.osgeo.org/proj/) for more</tt> </tt>
700 <a name="L649"></a><tt class="py-lineno">649</tt> <tt class="py-line"><tt class="py-docstring"> information about specifying ellipsoid parameters (specifically,</tt> </tt>
701 <a name="L650"></a><tt class="py-lineno">650</tt> <tt class="py-line"><tt class="py-docstring"> the chapter 'Specifying the Earth's figure' in the main Proj</tt> </tt>
702 <a name="L651"></a><tt class="py-lineno">651</tt> <tt class="py-line"><tt class="py-docstring"> users manual).</tt> </tt>
485 <a name="L434"></a><tt class="py-lineno">434</tt> <tt class="py-line"><tt class="py-docstring"> x,y and z can be numpy or regular python arrays, python</tt> </tt>
486 <a name="L435"></a><tt class="py-lineno">435</tt> <tt class="py-line"><tt class="py-docstring"> lists/tuples or scalars. Arrays are fastest. For projections in</tt> </tt>
487 <a name="L436"></a><tt class="py-lineno">436</tt> <tt class="py-line"><tt class="py-docstring"> geocentric coordinates, values of x and y are given in meters.</tt> </tt>
488 <a name="L437"></a><tt class="py-lineno">437</tt> <tt class="py-line"><tt class="py-docstring"> z is always meters.</tt> </tt>
489 <a name="L438"></a><tt class="py-lineno">438</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
490 <a name="L439"></a><tt class="py-lineno">439</tt> <tt class="py-line"><tt class="py-docstring"> Example usage:</tt> </tt>
491 <a name="L440"></a><tt class="py-lineno">440</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
492 <a name="L441"></a><tt class="py-lineno">441</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # projection 1: UTM zone 15, grs80 ellipse, NAD83 datum</tt> </tt>
493 <a name="L442"></a><tt class="py-lineno">442</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # (defined by epsg code 26915)</tt> </tt>
494 <a name="L443"></a><tt class="py-lineno">443</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p1 = Proj(init='epsg:26915')</tt> </tt>
495 <a name="L444"></a><tt class="py-lineno">444</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # projection 2: UTM zone 15, clrk66 ellipse, NAD27 datum</tt> </tt>
496 <a name="L445"></a><tt class="py-lineno">445</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p2 = Proj(init='epsg:26715')</tt> </tt>
497 <a name="L446"></a><tt class="py-lineno">446</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # find x,y of Jefferson City, MO.</tt> </tt>
498 <a name="L447"></a><tt class="py-lineno">447</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x1, y1 = p1(-92.199881,38.56694)</tt> </tt>
499 <a name="L448"></a><tt class="py-lineno">448</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # transform this point to projection 2 coordinates.</tt> </tt>
500 <a name="L449"></a><tt class="py-lineno">449</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x2, y2 = transform(p1,p2,x1,y1)</tt> </tt>
501 <a name="L450"></a><tt class="py-lineno">450</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %11.3f' % (x1,y1)</tt> </tt>
502 <a name="L451"></a><tt class="py-lineno">451</tt> <tt class="py-line"><tt class="py-docstring"> '569704.566 4269024.671'</tt> </tt>
503 <a name="L452"></a><tt class="py-lineno">452</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %11.3f' % (x2,y2)</tt> </tt>
504 <a name="L453"></a><tt class="py-lineno">453</tt> <tt class="py-line"><tt class="py-docstring"> '569722.342 4268814.027'</tt> </tt>
505 <a name="L454"></a><tt class="py-lineno">454</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%8.3f %5.3f' % p2(x2,y2,inverse=True)</tt> </tt>
506 <a name="L455"></a><tt class="py-lineno">455</tt> <tt class="py-line"><tt class="py-docstring"> ' -92.200 38.567'</tt> </tt>
507 <a name="L456"></a><tt class="py-lineno">456</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # process 3 points at a time in a tuple</tt> </tt>
508 <a name="L457"></a><tt class="py-lineno">457</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lats = (38.83,39.32,38.75) # Columbia, KC and StL Missouri</tt> </tt>
509 <a name="L458"></a><tt class="py-lineno">458</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons = (-92.22,-94.72,-90.37)</tt> </tt>
510 <a name="L459"></a><tt class="py-lineno">459</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x1, y1 = p1(lons,lats)</tt> </tt>
511 <a name="L460"></a><tt class="py-lineno">460</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x2, y2 = transform(p1,p2,x1,y1)</tt> </tt>
512 <a name="L461"></a><tt class="py-lineno">461</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; xy = x1+y1</tt> </tt>
513 <a name="L462"></a><tt class="py-lineno">462</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy</tt> </tt>
514 <a name="L463"></a><tt class="py-lineno">463</tt> <tt class="py-line"><tt class="py-docstring"> '567703.344 351730.944 728553.093 4298200.739 4353698.725 4292319.005'</tt> </tt>
515 <a name="L464"></a><tt class="py-lineno">464</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; xy = x2+y2</tt> </tt>
516 <a name="L465"></a><tt class="py-lineno">465</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy</tt> </tt>
517 <a name="L466"></a><tt class="py-lineno">466</tt> <tt class="py-line"><tt class="py-docstring"> '567721.149 351747.558 728569.133 4297989.112 4353489.644 4292106.305'</tt> </tt>
518 <a name="L467"></a><tt class="py-lineno">467</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons, lats = p2(x2,y2,inverse=True)</tt> </tt>
519 <a name="L468"></a><tt class="py-lineno">468</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; xy = lons+lats</tt> </tt>
520 <a name="L469"></a><tt class="py-lineno">469</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; '%8.3f %8.3f %8.3f %5.3f %5.3f %5.3f' % xy</tt> </tt>
521 <a name="L470"></a><tt class="py-lineno">470</tt> <tt class="py-line"><tt class="py-docstring"> ' -92.220 -94.720 -90.370 38.830 39.320 38.750'</tt> </tt>
522 <a name="L471"></a><tt class="py-lineno">471</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # test datum shifting, installation of extra datum grid files.</tt> </tt>
523 <a name="L472"></a><tt class="py-lineno">472</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p1 = Proj(proj='latlong',datum='WGS84')</tt> </tt>
524 <a name="L473"></a><tt class="py-lineno">473</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x1 = -111.5; y1 = 45.25919444444</tt> </tt>
525 <a name="L474"></a><tt class="py-lineno">474</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; p2 = Proj(proj="utm",zone=10,datum='NAD27')</tt> </tt>
526 <a name="L475"></a><tt class="py-lineno">475</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; x2, y2 = transform(p1, p2, x1, y1)</tt> </tt>
527 <a name="L476"></a><tt class="py-lineno">476</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%12.3f %12.3f" % (x2,y2)</tt> </tt>
528 <a name="L477"></a><tt class="py-lineno">477</tt> <tt class="py-line"><tt class="py-docstring"> ' 1402285.991 5076292.423'</tt> </tt>
529 <a name="L478"></a><tt class="py-lineno">478</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
530 <a name="L479"></a><tt class="py-lineno">479</tt> <tt class="py-line"> <tt class="py-comment"># process inputs, making copies that support buffer API.</tt> </tt>
531 <a name="L480"></a><tt class="py-lineno">480</tt> <tt class="py-line"> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">xisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">xislist</tt><tt class="py-op">,</tt> <tt class="py-name">xistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
532 <a name="L481"></a><tt class="py-lineno">481</tt> <tt class="py-line"> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">yisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">yislist</tt><tt class="py-op">,</tt> <tt class="py-name">yistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">y</tt><tt class="py-op">)</tt> </tt>
533 <a name="L482"></a><tt class="py-lineno">482</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">z</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
534 <a name="L483"></a><tt class="py-lineno">483</tt> <tt class="py-line"> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">zisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">zislist</tt><tt class="py-op">,</tt> <tt class="py-name">zistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">z</tt><tt class="py-op">)</tt> </tt>
535 <a name="L484"></a><tt class="py-lineno">484</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
536 <a name="L485"></a><tt class="py-lineno">485</tt> <tt class="py-line"> <tt class="py-name">inz</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
537 <a name="L486"></a><tt class="py-lineno">486</tt> <tt class="py-line"> <tt class="py-comment"># call pj_transform. inx,iny,inz buffers modified in place.</tt> </tt>
538 <a name="L487"></a><tt class="py-lineno">487</tt> <tt class="py-line"> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt class="py-name">_transform</tt><tt class="py-op">(</tt><tt class="py-name">p1</tt><tt class="py-op">,</tt><tt class="py-name">p2</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">,</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
539 <a name="L488"></a><tt class="py-lineno">488</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back.</tt> </tt>
540 <a name="L489"></a><tt class="py-lineno">489</tt> <tt class="py-line"> <tt class="py-name">outx</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">xisfloat</tt><tt class="py-op">,</tt><tt class="py-name">xislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
541 <a name="L490"></a><tt class="py-lineno">490</tt> <tt class="py-line"> <tt class="py-name">outy</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">yisfloat</tt><tt class="py-op">,</tt><tt class="py-name">yislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">)</tt> </tt>
542 <a name="L491"></a><tt class="py-lineno">491</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">inz</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
543 <a name="L492"></a><tt class="py-lineno">492</tt> <tt class="py-line"> <tt class="py-name">outz</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">zisfloat</tt><tt class="py-op">,</tt><tt class="py-name">zislist</tt><tt class="py-op">,</tt><tt class="py-name">zistuple</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">)</tt> </tt>
544 <a name="L493"></a><tt class="py-lineno">493</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt><tt class="py-op">,</tt> <tt class="py-name">outz</tt> </tt>
545 <a name="L494"></a><tt class="py-lineno">494</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
546 <a name="L495"></a><tt class="py-lineno">495</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt> </tt>
547 </div><a name="L496"></a><tt class="py-lineno">496</tt> <tt class="py-line"> </tt>
548 <a name="_copytobuffer_return_scalar"></a><div id="_copytobuffer_return_scalar-def"><a name="L497"></a><tt class="py-lineno">497</tt> <a class="py-toggle" href="#" id="_copytobuffer_return_scalar-toggle" onclick="return toggle('_copytobuffer_return_scalar');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_copytobuffer_return_scalar">_copytobuffer_return_scalar</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
549 </div><div id="_copytobuffer_return_scalar-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_copytobuffer_return_scalar-expanded"><a name="L498"></a><tt class="py-lineno">498</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
550 <a name="L499"></a><tt class="py-lineno">499</tt> <tt class="py-line"> <tt class="py-comment"># inx,isfloat,islist,istuple</tt> </tt>
551 <a name="L500"></a><tt class="py-lineno">500</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt> </tt>
552 <a name="L501"></a><tt class="py-lineno">501</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
553 <a name="L502"></a><tt class="py-lineno">502</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">'input must be an array, list, tuple or scalar'</tt><tt class="py-op">)</tt> </tt>
554 </div><a name="L503"></a><tt class="py-lineno">503</tt> <tt class="py-line"> </tt>
555 <a name="_copytobuffer"></a><div id="_copytobuffer-def"><a name="L504"></a><tt class="py-lineno">504</tt> <a class="py-toggle" href="#" id="_copytobuffer-toggle" onclick="return toggle('_copytobuffer');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_copytobuffer">_copytobuffer</a><tt class="py-op">(</tt><tt class="py-param">x</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
556 </div><div id="_copytobuffer-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_copytobuffer-expanded"><a name="L505"></a><tt class="py-lineno">505</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
557 <a name="L506"></a><tt class="py-lineno">506</tt> <tt class="py-line"><tt class="py-docstring"> return a copy of x as an object that supports the python Buffer</tt> </tt>
558 <a name="L507"></a><tt class="py-lineno">507</tt> <tt class="py-line"><tt class="py-docstring"> API (python array if input is float, list or tuple, numpy array</tt> </tt>
559 <a name="L508"></a><tt class="py-lineno">508</tt> <tt class="py-line"><tt class="py-docstring"> if input is a numpy array). returns copyofx, isfloat, islist,</tt> </tt>
560 <a name="L509"></a><tt class="py-lineno">509</tt> <tt class="py-line"><tt class="py-docstring"> istuple (islist is True if input is a list, istuple is true if</tt> </tt>
561 <a name="L510"></a><tt class="py-lineno">510</tt> <tt class="py-line"><tt class="py-docstring"> input is a tuple, isfloat is true if input is a float).</tt> </tt>
562 <a name="L511"></a><tt class="py-lineno">511</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
563 <a name="L512"></a><tt class="py-lineno">512</tt> <tt class="py-line"> <tt class="py-comment"># make sure x supports Buffer API and contains doubles.</tt> </tt>
564 <a name="L513"></a><tt class="py-lineno">513</tt> <tt class="py-line"> <tt class="py-name">isfloat</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt><tt class="py-op">;</tt> <tt class="py-name">islist</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt><tt class="py-op">;</tt> <tt class="py-name">istuple</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
565 <a name="L514"></a><tt class="py-lineno">514</tt> <tt class="py-line"> <tt class="py-comment"># first, if it's a numpy array scalar convert to float</tt> </tt>
566 <a name="L515"></a><tt class="py-lineno">515</tt> <tt class="py-line"> <tt class="py-comment"># (array scalars don't support buffer API)</tt> </tt>
567 <a name="L516"></a><tt class="py-lineno">516</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt><tt class="py-string">'shape'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
568 <a name="L517"></a><tt class="py-lineno">517</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">shape</tt> <tt class="py-op">==</tt> <tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
569 <a name="L518"></a><tt class="py-lineno">518</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_copytobuffer_return_scalar</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
570 <a name="L519"></a><tt class="py-lineno">519</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
571 <a name="L520"></a><tt class="py-lineno">520</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
572 <a name="L521"></a><tt class="py-lineno">521</tt> <tt class="py-line"> <tt class="py-comment"># typecast numpy arrays to double.</tt> </tt>
573 <a name="L522"></a><tt class="py-lineno">522</tt> <tt class="py-line"> <tt class="py-comment"># (this makes a copy - which is crucial</tt> </tt>
574 <a name="L523"></a><tt class="py-lineno">523</tt> <tt class="py-line"> <tt class="py-comment"># since buffer is modified in place)</tt> </tt>
575 <a name="L524"></a><tt class="py-lineno">524</tt> <tt class="py-line"> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">dtype</tt><tt class="py-op">.</tt><tt class="py-name">char</tt> </tt>
576 <a name="L525"></a><tt class="py-lineno">525</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">)</tt> </tt>
577 <a name="L526"></a><tt class="py-lineno">526</tt> <tt class="py-line"> <tt class="py-comment"># inx,isfloat,islist,istuple</tt> </tt>
578 <a name="L527"></a><tt class="py-lineno">527</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt> </tt>
579 <a name="L528"></a><tt class="py-lineno">528</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
580 <a name="L529"></a><tt class="py-lineno">529</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> <tt class="py-comment"># perhaps they are Numeric/numarrays?</tt> </tt>
581 <a name="L530"></a><tt class="py-lineno">530</tt> <tt class="py-line"> <tt class="py-comment"># sorry, not tested yet.</tt> </tt>
582 <a name="L531"></a><tt class="py-lineno">531</tt> <tt class="py-line"> <tt class="py-comment"># i don't know Numeric/numarrays has `shape'.</tt> </tt>
583 <a name="L532"></a><tt class="py-lineno">532</tt> <tt class="py-line"> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">typecode</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
584 <a name="L533"></a><tt class="py-lineno">533</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">x</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">)</tt> </tt>
585 <a name="L534"></a><tt class="py-lineno">534</tt> <tt class="py-line"> <tt class="py-comment"># inx,isfloat,islist,istuple</tt> </tt>
586 <a name="L535"></a><tt class="py-lineno">535</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">False</tt> </tt>
587 <a name="L536"></a><tt class="py-lineno">536</tt> <tt class="py-line"> <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
588 <a name="L537"></a><tt class="py-lineno">537</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt class="py-name">TypeError</tt><tt class="py-op">(</tt><tt class="py-string">'input must be an array, list, tuple or scalar'</tt><tt class="py-op">)</tt> </tt>
589 <a name="L538"></a><tt class="py-lineno">538</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
590 <a name="L539"></a><tt class="py-lineno">539</tt> <tt class="py-line"> <tt class="py-comment"># perhaps they are regular python arrays?</tt> </tt>
591 <a name="L540"></a><tt class="py-lineno">540</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">hasattr</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">,</tt> <tt class="py-string">'typecode'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
592 <a name="L541"></a><tt class="py-lineno">541</tt> <tt class="py-line"> <tt class="py-comment">#x.typecode</tt> </tt>
593 <a name="L542"></a><tt class="py-lineno">542</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
594 <a name="L543"></a><tt class="py-lineno">543</tt> <tt class="py-line"> <tt class="py-comment"># try to convert to python array</tt> </tt>
595 <a name="L544"></a><tt class="py-lineno">544</tt> <tt class="py-line"> <tt class="py-comment"># a list.</tt> </tt>
596 <a name="L545"></a><tt class="py-lineno">545</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">list</tt><tt class="py-op">:</tt> </tt>
597 <a name="L546"></a><tt class="py-lineno">546</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
598 <a name="L547"></a><tt class="py-lineno">547</tt> <tt class="py-line"> <tt class="py-name">islist</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
599 <a name="L548"></a><tt class="py-lineno">548</tt> <tt class="py-line"> <tt class="py-comment"># a tuple.</tt> </tt>
600 <a name="L549"></a><tt class="py-lineno">549</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">tuple</tt><tt class="py-op">:</tt> </tt>
601 <a name="L550"></a><tt class="py-lineno">550</tt> <tt class="py-line"> <tt class="py-name">inx</tt> <tt class="py-op">=</tt> <tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-string">'d'</tt><tt class="py-op">,</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
602 <a name="L551"></a><tt class="py-lineno">551</tt> <tt class="py-line"> <tt class="py-name">istuple</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
603 <a name="L552"></a><tt class="py-lineno">552</tt> <tt class="py-line"> <tt class="py-comment"># a scalar?</tt> </tt>
604 <a name="L553"></a><tt class="py-lineno">553</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
605 <a name="L554"></a><tt class="py-lineno">554</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_copytobuffer_return_scalar</tt><tt class="py-op">(</tt><tt class="py-name">x</tt><tt class="py-op">)</tt> </tt>
606 <a name="L555"></a><tt class="py-lineno">555</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">isfloat</tt><tt class="py-op">,</tt><tt class="py-name">islist</tt><tt class="py-op">,</tt><tt class="py-name">istuple</tt> </tt>
607 </div><a name="L556"></a><tt class="py-lineno">556</tt> <tt class="py-line"> </tt>
608 <a name="_convertback"></a><div id="_convertback-def"><a name="L557"></a><tt class="py-lineno">557</tt> <a class="py-toggle" href="#" id="_convertback-toggle" onclick="return toggle('_convertback');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_convertback">_convertback</a><tt class="py-op">(</tt><tt class="py-param">isfloat</tt><tt class="py-op">,</tt><tt class="py-param">islist</tt><tt class="py-op">,</tt><tt class="py-param">istuple</tt><tt class="py-op">,</tt><tt class="py-param">inx</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
609 </div><div id="_convertback-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_convertback-expanded"><a name="L558"></a><tt class="py-lineno">558</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back to original type.</tt> </tt>
610 <a name="L559"></a><tt class="py-lineno">559</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">isfloat</tt><tt class="py-op">:</tt> </tt>
611 <a name="L560"></a><tt class="py-lineno">560</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
612 <a name="L561"></a><tt class="py-lineno">561</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">islist</tt><tt class="py-op">:</tt> </tt>
613 <a name="L562"></a><tt class="py-lineno">562</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt><tt class="py-op">.</tt><tt class="py-name">tolist</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
614 <a name="L563"></a><tt class="py-lineno">563</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">istuple</tt><tt class="py-op">:</tt> </tt>
615 <a name="L564"></a><tt class="py-lineno">564</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
616 <a name="L565"></a><tt class="py-lineno">565</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
617 <a name="L566"></a><tt class="py-lineno">566</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">inx</tt> </tt>
618 </div><a name="L567"></a><tt class="py-lineno">567</tt> <tt class="py-line"> </tt>
619 <a name="_dict2string"></a><div id="_dict2string-def"><a name="L568"></a><tt class="py-lineno">568</tt> <a class="py-toggle" href="#" id="_dict2string-toggle" onclick="return toggle('_dict2string');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#_dict2string">_dict2string</a><tt class="py-op">(</tt><tt class="py-param">projparams</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
620 </div><div id="_dict2string-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="_dict2string-expanded"><a name="L569"></a><tt class="py-lineno">569</tt> <tt class="py-line"> <tt class="py-comment"># convert a dict to a proj4 string.</tt> </tt>
621 <a name="L570"></a><tt class="py-lineno">570</tt> <tt class="py-line"> <tt class="py-name">pjargs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
622 <a name="L571"></a><tt class="py-lineno">571</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">key</tt><tt class="py-op">,</tt><tt class="py-name">value</tt> <tt class="py-keyword">in</tt> <tt class="py-name">projparams</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
623 <a name="L572"></a><tt class="py-lineno">572</tt> <tt class="py-line"> <tt class="py-name">pjargs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-string">'+'</tt><tt class="py-op">+</tt><tt class="py-name">key</tt><tt class="py-op">+</tt><tt class="py-string">"="</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">value</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-string">' '</tt><tt class="py-op">)</tt> </tt>
624 <a name="L573"></a><tt class="py-lineno">573</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-string">''</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">pjargs</tt><tt class="py-op">)</tt> </tt>
625 </div><a name="L574"></a><tt class="py-lineno">574</tt> <tt class="py-line"> </tt>
626 <a name="Geod"></a><div id="Geod-def"><a name="L575"></a><tt class="py-lineno">575</tt> <a class="py-toggle" href="#" id="Geod-toggle" onclick="return toggle('Geod');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="pyproj.Geod-class.html">Geod</a><tt class="py-op">(</tt><tt class="py-base-class">_proj</tt><tt class="py-op">.</tt><tt class="py-base-class">Geod</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
627 </div><div id="Geod-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Geod-expanded"><a name="L576"></a><tt class="py-lineno">576</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
628 <a name="L577"></a><tt class="py-lineno">577</tt> <tt class="py-line"><tt class="py-docstring"> performs forward and inverse geodetic, or Great Circle,</tt> </tt>
629 <a name="L578"></a><tt class="py-lineno">578</tt> <tt class="py-line"><tt class="py-docstring"> computations. The forward computation (using the 'fwd' method)</tt> </tt>
630 <a name="L579"></a><tt class="py-lineno">579</tt> <tt class="py-line"><tt class="py-docstring"> involves determining latitude, longitude and back azimuth of a</tt> </tt>
631 <a name="L580"></a><tt class="py-lineno">580</tt> <tt class="py-line"><tt class="py-docstring"> computations. The forward computation (using the 'fwd' method)</tt> </tt>
632 <a name="L581"></a><tt class="py-lineno">581</tt> <tt class="py-line"><tt class="py-docstring"> involves determining latitude, longitude and back azimuth of a</tt> </tt>
633 <a name="L582"></a><tt class="py-lineno">582</tt> <tt class="py-line"><tt class="py-docstring"> terminus point given the latitude and longitude of an initial</tt> </tt>
634 <a name="L583"></a><tt class="py-lineno">583</tt> <tt class="py-line"><tt class="py-docstring"> point, plus azimuth and distance. The inverse computation (using</tt> </tt>
635 <a name="L584"></a><tt class="py-lineno">584</tt> <tt class="py-line"><tt class="py-docstring"> the 'inv' method) involves determining the forward and back</tt> </tt>
636 <a name="L585"></a><tt class="py-lineno">585</tt> <tt class="py-line"><tt class="py-docstring"> azimuths and distance given the latitudes and longitudes of an</tt> </tt>
637 <a name="L586"></a><tt class="py-lineno">586</tt> <tt class="py-line"><tt class="py-docstring"> initial and terminus point.</tt> </tt>
638 <a name="L587"></a><tt class="py-lineno">587</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
639 <a name="Geod.__new__"></a><div id="Geod.__new__-def"><a name="L588"></a><tt class="py-lineno">588</tt> <a class="py-toggle" href="#" id="Geod.__new__-toggle" onclick="return toggle('Geod.__new__');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#__new__">__new__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">initstring</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-op">**</tt><tt class="py-param">kwargs</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
640 </div><div id="Geod.__new__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.__new__-expanded"><a name="L589"></a><tt class="py-lineno">589</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
641 <a name="L590"></a><tt class="py-lineno">590</tt> <tt class="py-line"><tt class="py-docstring"> initialize a Geod class instance.</tt> </tt>
642 <a name="L591"></a><tt class="py-lineno">591</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
643 <a name="L592"></a><tt class="py-lineno">592</tt> <tt class="py-line"><tt class="py-docstring"> Geodetic parameters for specifying the ellipsoid</tt> </tt>
644 <a name="L593"></a><tt class="py-lineno">593</tt> <tt class="py-line"><tt class="py-docstring"> can be given in a dictionary 'initparams', as keyword arguments,</tt> </tt>
645 <a name="L594"></a><tt class="py-lineno">594</tt> <tt class="py-line"><tt class="py-docstring"> or as as proj4 geod initialization string.</tt> </tt>
646 <a name="L595"></a><tt class="py-lineno">595</tt> <tt class="py-line"><tt class="py-docstring"> Following is a list of the ellipsoids that may be defined using the</tt> </tt>
647 <a name="L596"></a><tt class="py-lineno">596</tt> <tt class="py-line"><tt class="py-docstring"> 'ellps' keyword (these are stored in the model variable pj_ellps)::</tt> </tt>
648 <a name="L597"></a><tt class="py-lineno">597</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
649 <a name="L598"></a><tt class="py-lineno">598</tt> <tt class="py-line"><tt class="py-docstring"> MERIT a=6378137.0 rf=298.257 MERIT 1983</tt> </tt>
650 <a name="L599"></a><tt class="py-lineno">599</tt> <tt class="py-line"><tt class="py-docstring"> SGS85 a=6378136.0 rf=298.257 Soviet Geodetic System 85</tt> </tt>
651 <a name="L600"></a><tt class="py-lineno">600</tt> <tt class="py-line"><tt class="py-docstring"> GRS80 a=6378137.0 rf=298.257222101 GRS 1980(IUGG, 1980)</tt> </tt>
652 <a name="L601"></a><tt class="py-lineno">601</tt> <tt class="py-line"><tt class="py-docstring"> IAU76 a=6378140.0 rf=298.257 IAU 1976</tt> </tt>
653 <a name="L602"></a><tt class="py-lineno">602</tt> <tt class="py-line"><tt class="py-docstring"> airy a=6377563.396 b=6356256.910 Airy 1830</tt> </tt>
654 <a name="L603"></a><tt class="py-lineno">603</tt> <tt class="py-line"><tt class="py-docstring"> APL4.9 a=6378137.0. rf=298.25 Appl. Physics. 1965</tt> </tt>
655 <a name="L604"></a><tt class="py-lineno">604</tt> <tt class="py-line"><tt class="py-docstring"> airy a=6377563.396 b=6356256.910 Airy 1830</tt> </tt>
656 <a name="L605"></a><tt class="py-lineno">605</tt> <tt class="py-line"><tt class="py-docstring"> APL4.9 a=6378137.0. rf=298.25 Appl. Physics. 1965</tt> </tt>
657 <a name="L606"></a><tt class="py-lineno">606</tt> <tt class="py-line"><tt class="py-docstring"> NWL9D a=6378145.0. rf=298.25 Naval Weapons Lab., 1965</tt> </tt>
658 <a name="L607"></a><tt class="py-lineno">607</tt> <tt class="py-line"><tt class="py-docstring"> mod_airy a=6377340.189 b=6356034.446 Modified Airy</tt> </tt>
659 <a name="L608"></a><tt class="py-lineno">608</tt> <tt class="py-line"><tt class="py-docstring"> andrae a=6377104.43 rf=300.0 Andrae 1876 (Den., Iclnd.)</tt> </tt>
660 <a name="L609"></a><tt class="py-lineno">609</tt> <tt class="py-line"><tt class="py-docstring"> aust_SA a=6378160.0 rf=298.25 Australian Natl &amp; S. Amer. 1969</tt> </tt>
661 <a name="L610"></a><tt class="py-lineno">610</tt> <tt class="py-line"><tt class="py-docstring"> GRS67 a=6378160.0 rf=298.247167427 GRS 67(IUGG 1967)</tt> </tt>
662 <a name="L611"></a><tt class="py-lineno">611</tt> <tt class="py-line"><tt class="py-docstring"> bessel a=6377397.155 rf=299.1528128 Bessel 1841</tt> </tt>
663 <a name="L612"></a><tt class="py-lineno">612</tt> <tt class="py-line"><tt class="py-docstring"> bess_nam a=6377483.865 rf=299.1528128 Bessel 1841 (Namibia)</tt> </tt>
664 <a name="L613"></a><tt class="py-lineno">613</tt> <tt class="py-line"><tt class="py-docstring"> clrk66 a=6378206.4 b=6356583.8 Clarke 1866</tt> </tt>
665 <a name="L614"></a><tt class="py-lineno">614</tt> <tt class="py-line"><tt class="py-docstring"> clrk80 a=6378249.145 rf=293.4663 Clarke 1880 mod.</tt> </tt>
666 <a name="L615"></a><tt class="py-lineno">615</tt> <tt class="py-line"><tt class="py-docstring"> CPM a=6375738.7 rf=334.29 Comm. des Poids et Mesures 1799</tt> </tt>
667 <a name="L616"></a><tt class="py-lineno">616</tt> <tt class="py-line"><tt class="py-docstring"> delmbr a=6376428. rf=311.5 Delambre 1810 (Belgium)</tt> </tt>
668 <a name="L617"></a><tt class="py-lineno">617</tt> <tt class="py-line"><tt class="py-docstring"> engelis a=6378136.05 rf=298.2566 Engelis 1985</tt> </tt>
669 <a name="L618"></a><tt class="py-lineno">618</tt> <tt class="py-line"><tt class="py-docstring"> evrst30 a=6377276.345 rf=300.8017 Everest 1830</tt> </tt>
670 <a name="L619"></a><tt class="py-lineno">619</tt> <tt class="py-line"><tt class="py-docstring"> evrst48 a=6377304.063 rf=300.8017 Everest 1948</tt> </tt>
671 <a name="L620"></a><tt class="py-lineno">620</tt> <tt class="py-line"><tt class="py-docstring"> evrst56 a=6377301.243 rf=300.8017 Everest 1956</tt> </tt>
672 <a name="L621"></a><tt class="py-lineno">621</tt> <tt class="py-line"><tt class="py-docstring"> evrst69 a=6377295.664 rf=300.8017 Everest 1969</tt> </tt>
673 <a name="L622"></a><tt class="py-lineno">622</tt> <tt class="py-line"><tt class="py-docstring"> evrstSS a=6377298.556 rf=300.8017 Everest (Sabah &amp; Sarawak)</tt> </tt>
674 <a name="L623"></a><tt class="py-lineno">623</tt> <tt class="py-line"><tt class="py-docstring"> fschr60 a=6378166. rf=298.3 Fischer (Mercury Datum) 1960</tt> </tt>
675 <a name="L624"></a><tt class="py-lineno">624</tt> <tt class="py-line"><tt class="py-docstring"> fschr60m a=6378155. rf=298.3 Modified Fischer 1960</tt> </tt>
676 <a name="L625"></a><tt class="py-lineno">625</tt> <tt class="py-line"><tt class="py-docstring"> fschr68 a=6378150. rf=298.3 Fischer 1968</tt> </tt>
677 <a name="L626"></a><tt class="py-lineno">626</tt> <tt class="py-line"><tt class="py-docstring"> helmert a=6378200. rf=298.3 Helmert 1906</tt> </tt>
678 <a name="L627"></a><tt class="py-lineno">627</tt> <tt class="py-line"><tt class="py-docstring"> hough a=6378270.0 rf=297. Hough</tt> </tt>
679 <a name="L628"></a><tt class="py-lineno">628</tt> <tt class="py-line"><tt class="py-docstring"> helmert a=6378200. rf=298.3 Helmert 1906</tt> </tt>
680 <a name="L629"></a><tt class="py-lineno">629</tt> <tt class="py-line"><tt class="py-docstring"> hough a=6378270.0 rf=297. Hough</tt> </tt>
681 <a name="L630"></a><tt class="py-lineno">630</tt> <tt class="py-line"><tt class="py-docstring"> intl a=6378388.0 rf=297. International 1909 (Hayford)</tt> </tt>
682 <a name="L631"></a><tt class="py-lineno">631</tt> <tt class="py-line"><tt class="py-docstring"> krass a=6378245.0 rf=298.3 Krassovsky, 1942</tt> </tt>
683 <a name="L632"></a><tt class="py-lineno">632</tt> <tt class="py-line"><tt class="py-docstring"> kaula a=6378163. rf=298.24 Kaula 1961</tt> </tt>
684 <a name="L633"></a><tt class="py-lineno">633</tt> <tt class="py-line"><tt class="py-docstring"> lerch a=6378139. rf=298.257 Lerch 1979</tt> </tt>
685 <a name="L634"></a><tt class="py-lineno">634</tt> <tt class="py-line"><tt class="py-docstring"> mprts a=6397300. rf=191. Maupertius 1738</tt> </tt>
686 <a name="L635"></a><tt class="py-lineno">635</tt> <tt class="py-line"><tt class="py-docstring"> new_intl a=6378157.5 b=6356772.2 New International 1967</tt> </tt>
687 <a name="L636"></a><tt class="py-lineno">636</tt> <tt class="py-line"><tt class="py-docstring"> plessis a=6376523. b=6355863. Plessis 1817 (France)</tt> </tt>
688 <a name="L637"></a><tt class="py-lineno">637</tt> <tt class="py-line"><tt class="py-docstring"> SEasia a=6378155.0 b=6356773.3205 Southeast Asia</tt> </tt>
689 <a name="L638"></a><tt class="py-lineno">638</tt> <tt class="py-line"><tt class="py-docstring"> walbeck a=6376896.0 b=6355834.8467 Walbeck</tt> </tt>
690 <a name="L639"></a><tt class="py-lineno">639</tt> <tt class="py-line"><tt class="py-docstring"> WGS60 a=6378165.0 rf=298.3 WGS 60</tt> </tt>
691 <a name="L640"></a><tt class="py-lineno">640</tt> <tt class="py-line"><tt class="py-docstring"> WGS66 a=6378145.0 rf=298.25 WGS 66</tt> </tt>
692 <a name="L641"></a><tt class="py-lineno">641</tt> <tt class="py-line"><tt class="py-docstring"> WGS72 a=6378135.0 rf=298.26 WGS 72</tt> </tt>
693 <a name="L642"></a><tt class="py-lineno">642</tt> <tt class="py-line"><tt class="py-docstring"> WGS84 a=6378137.0 rf=298.257223563 WGS 84</tt> </tt>
694 <a name="L643"></a><tt class="py-lineno">643</tt> <tt class="py-line"><tt class="py-docstring"> sphere a=6370997.0 b=6370997.0 Normal Sphere (r=6370997)</tt> </tt>
695 <a name="L644"></a><tt class="py-lineno">644</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
696 <a name="L645"></a><tt class="py-lineno">645</tt> <tt class="py-line"><tt class="py-docstring"> The parameters of the ellipsoid may also be set directly using</tt> </tt>
697 <a name="L646"></a><tt class="py-lineno">646</tt> <tt class="py-line"><tt class="py-docstring"> the 'a' (semi-major or equatorial axis radius) keyword, and</tt> </tt>
698 <a name="L647"></a><tt class="py-lineno">647</tt> <tt class="py-line"><tt class="py-docstring"> any one of the following keywords: 'b' (semi-minor,</tt> </tt>
699 <a name="L648"></a><tt class="py-lineno">648</tt> <tt class="py-line"><tt class="py-docstring"> or polar axis radius), 'e' (eccentricity), 'es' (eccentricity</tt> </tt>
700 <a name="L649"></a><tt class="py-lineno">649</tt> <tt class="py-line"><tt class="py-docstring"> squared), 'f' (flattening), or 'rf' (reciprocal flattening).</tt> </tt>
701 <a name="L650"></a><tt class="py-lineno">650</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
702 <a name="L651"></a><tt class="py-lineno">651</tt> <tt class="py-line"><tt class="py-docstring"> See the proj documentation (http://trac.osgeo.org/proj/) for more</tt> </tt>
703703 <a name="L652"></a><tt class="py-lineno">652</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
704 <a name="L653"></a><tt class="py-lineno">653</tt> <tt class="py-line"><tt class="py-docstring"> Example usage:</tt> </tt>
705 <a name="L654"></a><tt class="py-lineno">654</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
706 <a name="L655"></a><tt class="py-lineno">655</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; from pyproj import Geod</tt> </tt>
707 <a name="L656"></a><tt class="py-lineno">656</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g = Geod(ellps='clrk66') # Use Clarke 1966 ellipsoid.</tt> </tt>
708 <a name="L657"></a><tt class="py-lineno">657</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # specify the lat/lons of some cities.</tt> </tt>
709 <a name="L658"></a><tt class="py-lineno">658</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)</tt> </tt>
710 <a name="L659"></a><tt class="py-lineno">659</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)</tt> </tt>
711 <a name="L660"></a><tt class="py-lineno">660</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; newyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)</tt> </tt>
712 <a name="L661"></a><tt class="py-lineno">661</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; london_lat = 51.+(32./60.); london_lon = -(5./60.)</tt> </tt>
713 <a name="L662"></a><tt class="py-lineno">662</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # compute forward and back azimuths, plus distance</tt> </tt>
714 <a name="L663"></a><tt class="py-lineno">663</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # between Boston and Portland.</tt> </tt>
715 <a name="L664"></a><tt class="py-lineno">664</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; az12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)</tt> </tt>
716 <a name="L665"></a><tt class="py-lineno">665</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%7.3f %6.3f %12.3f" % (az12,az21,dist)</tt> </tt>
717 <a name="L666"></a><tt class="py-lineno">666</tt> <tt class="py-line"><tt class="py-docstring"> '-66.531 75.654 4164192.708'</tt> </tt>
718 <a name="L667"></a><tt class="py-lineno">667</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # compute latitude, longitude and back azimuth of Portland,</tt> </tt>
719 <a name="L668"></a><tt class="py-lineno">668</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # given Boston lat/lon, forward azimuth and distance to Portland.</tt> </tt>
720 <a name="L669"></a><tt class="py-lineno">669</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; endlon, endlat, backaz = g.fwd(boston_lon, boston_lat, az12, dist)</tt> </tt>
721 <a name="L670"></a><tt class="py-lineno">670</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%6.3f %6.3f %13.3f" % (endlat,endlon,backaz)</tt> </tt>
722 <a name="L671"></a><tt class="py-lineno">671</tt> <tt class="py-line"><tt class="py-docstring"> '45.517 -123.683 75.654'</tt> </tt>
723 <a name="L672"></a><tt class="py-lineno">672</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # compute the azimuths, distances from New York to several</tt> </tt>
724 <a name="L673"></a><tt class="py-lineno">673</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # cities (pass a list)</tt> </tt>
725 <a name="L674"></a><tt class="py-lineno">674</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons1 = 3*[newyork_lon]; lats1 = 3*[newyork_lat]</tt> </tt>
726 <a name="L675"></a><tt class="py-lineno">675</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons2 = [boston_lon, portland_lon, london_lon]</tt> </tt>
727 <a name="L676"></a><tt class="py-lineno">676</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lats2 = [boston_lat, portland_lat, london_lat]</tt> </tt>
728 <a name="L677"></a><tt class="py-lineno">677</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; az12,az21,dist = g.inv(lons1,lats1,lons2,lats2)</tt> </tt>
729 <a name="L678"></a><tt class="py-lineno">678</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; for faz,baz,d in list(zip(az12,az21,dist)): "%7.3f %7.3f %9.3f" % (faz,baz,d)</tt> </tt>
730 <a name="L679"></a><tt class="py-lineno">679</tt> <tt class="py-line"><tt class="py-docstring"> ' 54.663 -123.448 288303.720'</tt> </tt>
731 <a name="L680"></a><tt class="py-lineno">680</tt> <tt class="py-line"><tt class="py-docstring"> '-65.463 79.342 4013037.318'</tt> </tt>
732 <a name="L681"></a><tt class="py-lineno">681</tt> <tt class="py-line"><tt class="py-docstring"> ' 51.254 -71.576 5579916.651'</tt> </tt>
733 <a name="L682"></a><tt class="py-lineno">682</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g2 = Geod('+ellps=clrk66') # use proj4 style initialization string</tt> </tt>
734 <a name="L683"></a><tt class="py-lineno">683</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; az12,az21,dist = g2.inv(boston_lon,boston_lat,portland_lon,portland_lat)</tt> </tt>
735 <a name="L684"></a><tt class="py-lineno">684</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%7.3f %6.3f %12.3f" % (az12,az21,dist)</tt> </tt>
736 <a name="L685"></a><tt class="py-lineno">685</tt> <tt class="py-line"><tt class="py-docstring"> '-66.531 75.654 4164192.708'</tt> </tt>
737 <a name="L686"></a><tt class="py-lineno">686</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
738 <a name="L687"></a><tt class="py-lineno">687</tt> <tt class="py-line"> <tt class="py-comment"># if initparams is a proj-type init string,</tt> </tt>
739 <a name="L688"></a><tt class="py-lineno">688</tt> <tt class="py-line"> <tt class="py-comment"># convert to dict.</tt> </tt>
740 <a name="L689"></a><tt class="py-lineno">689</tt> <tt class="py-line"> <tt class="py-name">ellpsd</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
741 <a name="L690"></a><tt class="py-lineno">690</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">initstring</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
742 <a name="L691"></a><tt class="py-lineno">691</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">kvpair</tt> <tt class="py-keyword">in</tt> <tt class="py-name">initstring</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
743 <a name="L692"></a><tt class="py-lineno">692</tt> <tt class="py-line"> <tt class="py-name">k</tt><tt class="py-op">,</tt><tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt class="py-name">kvpair</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">)</tt> </tt>
744 <a name="L693"></a><tt class="py-lineno">693</tt> <tt class="py-line"> <tt class="py-name">k</tt> <tt class="py-op">=</tt> <tt class="py-name">k</tt><tt class="py-op">.</tt><tt class="py-name">lstrip</tt><tt class="py-op">(</tt><tt class="py-string">'+'</tt><tt class="py-op">)</tt> </tt>
745 <a name="L694"></a><tt class="py-lineno">694</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">k</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">,</tt><tt class="py-string">'b'</tt><tt class="py-op">,</tt><tt class="py-string">'rf'</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op">,</tt><tt class="py-string">'es'</tt><tt class="py-op">,</tt><tt class="py-string">'e'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
746 <a name="L695"></a><tt class="py-lineno">695</tt> <tt class="py-line"> <tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
747 <a name="L696"></a><tt class="py-lineno">696</tt> <tt class="py-line"> <tt class="py-name">ellpsd</tt><tt class="py-op">[</tt><tt class="py-name">k</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">v</tt> </tt>
748 <a name="L697"></a><tt class="py-lineno">697</tt> <tt class="py-line"> <tt class="py-comment"># merge this dict with kwargs dict.</tt> </tt>
749 <a name="L698"></a><tt class="py-lineno">698</tt> <tt class="py-line"> <tt class="py-name">kwargs</tt> <tt class="py-op">=</tt> <tt class="py-name">dict</tt><tt class="py-op">(</tt><tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">ellpsd</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
750 <a name="L699"></a><tt class="py-lineno">699</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sphere</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
751 <a name="L700"></a><tt class="py-lineno">700</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'ellps'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
752 <a name="L701"></a><tt class="py-lineno">701</tt> <tt class="py-line"> <tt class="py-comment"># ellipse name given, look up in pj_ellps dict</tt> </tt>
753 <a name="L702"></a><tt class="py-lineno">702</tt> <tt class="py-line"> <tt class="py-name">ellps_dict</tt> <tt class="py-op">=</tt> <tt id="link-14" class="py-name"><a title="pyproj.pj_ellps" class="py-name" href="#" onclick="return doclink('link-14', 'pj_ellps', 'link-4');">pj_ellps</a></tt><tt class="py-op">[</tt><tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'ellps'</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
754 <a name="L703"></a><tt class="py-lineno">703</tt> <tt class="py-line"> <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">]</tt> </tt>
755 <a name="L704"></a><tt class="py-lineno">704</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'description'</tt><tt class="py-op">]</tt><tt class="py-op">==</tt><tt class="py-string">'Normal Sphere'</tt><tt class="py-op">:</tt> </tt>
756 <a name="L705"></a><tt class="py-lineno">705</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sphere</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
757 <a name="L706"></a><tt class="py-lineno">706</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'b'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">:</tt> </tt>
758 <a name="L707"></a><tt class="py-lineno">707</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'b'</tt><tt class="py-op">]</tt> </tt>
759 <a name="L708"></a><tt class="py-lineno">708</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">*</tt> <tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
760 <a name="L709"></a><tt class="py-lineno">709</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
761 <a name="L710"></a><tt class="py-lineno">710</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'rf'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">:</tt> </tt>
762 <a name="L711"></a><tt class="py-lineno">711</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt><tt class="py-op">/</tt><tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'rf'</tt><tt class="py-op">]</tt> </tt>
763 <a name="L712"></a><tt class="py-lineno">712</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
704 <a name="L653"></a><tt class="py-lineno">653</tt> <tt class="py-line"><tt class="py-docstring"> See the proj documentation (http://trac.osgeo.org/proj/) for more</tt> </tt>
705 <a name="L654"></a><tt class="py-lineno">654</tt> <tt class="py-line"><tt class="py-docstring"> information about specifying ellipsoid parameters (specifically,</tt> </tt>
706 <a name="L655"></a><tt class="py-lineno">655</tt> <tt class="py-line"><tt class="py-docstring"> the chapter 'Specifying the Earth's figure' in the main Proj</tt> </tt>
707 <a name="L656"></a><tt class="py-lineno">656</tt> <tt class="py-line"><tt class="py-docstring"> users manual).</tt> </tt>
708 <a name="L657"></a><tt class="py-lineno">657</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
709 <a name="L658"></a><tt class="py-lineno">658</tt> <tt class="py-line"><tt class="py-docstring"> Example usage:</tt> </tt>
710 <a name="L659"></a><tt class="py-lineno">659</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
711 <a name="L660"></a><tt class="py-lineno">660</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; from pyproj import Geod</tt> </tt>
712 <a name="L661"></a><tt class="py-lineno">661</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g = Geod(ellps='clrk66') # Use Clarke 1966 ellipsoid.</tt> </tt>
713 <a name="L662"></a><tt class="py-lineno">662</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # specify the lat/lons of some cities.</tt> </tt>
714 <a name="L663"></a><tt class="py-lineno">663</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)</tt> </tt>
715 <a name="L664"></a><tt class="py-lineno">664</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)</tt> </tt>
716 <a name="L665"></a><tt class="py-lineno">665</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; newyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)</tt> </tt>
717 <a name="L666"></a><tt class="py-lineno">666</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; london_lat = 51.+(32./60.); london_lon = -(5./60.)</tt> </tt>
718 <a name="L667"></a><tt class="py-lineno">667</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # compute forward and back azimuths, plus distance</tt> </tt>
719 <a name="L668"></a><tt class="py-lineno">668</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # between Boston and Portland.</tt> </tt>
720 <a name="L669"></a><tt class="py-lineno">669</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; az12,az21,dist = g.inv(boston_lon,boston_lat,portland_lon,portland_lat)</tt> </tt>
721 <a name="L670"></a><tt class="py-lineno">670</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%7.3f %6.3f %12.3f" % (az12,az21,dist)</tt> </tt>
722 <a name="L671"></a><tt class="py-lineno">671</tt> <tt class="py-line"><tt class="py-docstring"> '-66.531 75.654 4164192.708'</tt> </tt>
723 <a name="L672"></a><tt class="py-lineno">672</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # compute latitude, longitude and back azimuth of Portland,</tt> </tt>
724 <a name="L673"></a><tt class="py-lineno">673</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # given Boston lat/lon, forward azimuth and distance to Portland.</tt> </tt>
725 <a name="L674"></a><tt class="py-lineno">674</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; endlon, endlat, backaz = g.fwd(boston_lon, boston_lat, az12, dist)</tt> </tt>
726 <a name="L675"></a><tt class="py-lineno">675</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%6.3f %6.3f %13.3f" % (endlat,endlon,backaz)</tt> </tt>
727 <a name="L676"></a><tt class="py-lineno">676</tt> <tt class="py-line"><tt class="py-docstring"> '45.517 -123.683 75.654'</tt> </tt>
728 <a name="L677"></a><tt class="py-lineno">677</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # compute the azimuths, distances from New York to several</tt> </tt>
729 <a name="L678"></a><tt class="py-lineno">678</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # cities (pass a list)</tt> </tt>
730 <a name="L679"></a><tt class="py-lineno">679</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons1 = 3*[newyork_lon]; lats1 = 3*[newyork_lat]</tt> </tt>
731 <a name="L680"></a><tt class="py-lineno">680</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lons2 = [boston_lon, portland_lon, london_lon]</tt> </tt>
732 <a name="L681"></a><tt class="py-lineno">681</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lats2 = [boston_lat, portland_lat, london_lat]</tt> </tt>
733 <a name="L682"></a><tt class="py-lineno">682</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; az12,az21,dist = g.inv(lons1,lats1,lons2,lats2)</tt> </tt>
734 <a name="L683"></a><tt class="py-lineno">683</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; for faz,baz,d in list(zip(az12,az21,dist)): "%7.3f %7.3f %9.3f" % (faz,baz,d)</tt> </tt>
735 <a name="L684"></a><tt class="py-lineno">684</tt> <tt class="py-line"><tt class="py-docstring"> ' 54.663 -123.448 288303.720'</tt> </tt>
736 <a name="L685"></a><tt class="py-lineno">685</tt> <tt class="py-line"><tt class="py-docstring"> '-65.463 79.342 4013037.318'</tt> </tt>
737 <a name="L686"></a><tt class="py-lineno">686</tt> <tt class="py-line"><tt class="py-docstring"> ' 51.254 -71.576 5579916.651'</tt> </tt>
738 <a name="L687"></a><tt class="py-lineno">687</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g2 = Geod('+ellps=clrk66') # use proj4 style initialization string</tt> </tt>
739 <a name="L688"></a><tt class="py-lineno">688</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; az12,az21,dist = g2.inv(boston_lon,boston_lat,portland_lon,portland_lat)</tt> </tt>
740 <a name="L689"></a><tt class="py-lineno">689</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; "%7.3f %6.3f %12.3f" % (az12,az21,dist)</tt> </tt>
741 <a name="L690"></a><tt class="py-lineno">690</tt> <tt class="py-line"><tt class="py-docstring"> '-66.531 75.654 4164192.708'</tt> </tt>
742 <a name="L691"></a><tt class="py-lineno">691</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
743 <a name="L692"></a><tt class="py-lineno">692</tt> <tt class="py-line"> <tt class="py-comment"># if initparams is a proj-type init string,</tt> </tt>
744 <a name="L693"></a><tt class="py-lineno">693</tt> <tt class="py-line"> <tt class="py-comment"># convert to dict.</tt> </tt>
745 <a name="L694"></a><tt class="py-lineno">694</tt> <tt class="py-line"> <tt class="py-name">ellpsd</tt> <tt class="py-op">=</tt> <tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
746 <a name="L695"></a><tt class="py-lineno">695</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">initstring</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
747 <a name="L696"></a><tt class="py-lineno">696</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">kvpair</tt> <tt class="py-keyword">in</tt> <tt class="py-name">initstring</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
748 <a name="L697"></a><tt class="py-lineno">697</tt> <tt class="py-line"> <tt class="py-name">k</tt><tt class="py-op">,</tt><tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt class="py-name">kvpair</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-string">'='</tt><tt class="py-op">)</tt> </tt>
749 <a name="L698"></a><tt class="py-lineno">698</tt> <tt class="py-line"> <tt class="py-name">k</tt> <tt class="py-op">=</tt> <tt class="py-name">k</tt><tt class="py-op">.</tt><tt class="py-name">lstrip</tt><tt class="py-op">(</tt><tt class="py-string">'+'</tt><tt class="py-op">)</tt> </tt>
750 <a name="L699"></a><tt class="py-lineno">699</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">k</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">,</tt><tt class="py-string">'b'</tt><tt class="py-op">,</tt><tt class="py-string">'rf'</tt><tt class="py-op">,</tt><tt class="py-string">'f'</tt><tt class="py-op">,</tt><tt class="py-string">'es'</tt><tt class="py-op">,</tt><tt class="py-string">'e'</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
751 <a name="L700"></a><tt class="py-lineno">700</tt> <tt class="py-line"> <tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
752 <a name="L701"></a><tt class="py-lineno">701</tt> <tt class="py-line"> <tt class="py-name">ellpsd</tt><tt class="py-op">[</tt><tt class="py-name">k</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">v</tt> </tt>
753 <a name="L702"></a><tt class="py-lineno">702</tt> <tt class="py-line"> <tt class="py-comment"># merge this dict with kwargs dict.</tt> </tt>
754 <a name="L703"></a><tt class="py-lineno">703</tt> <tt class="py-line"> <tt class="py-name">kwargs</tt> <tt class="py-op">=</tt> <tt class="py-name">dict</tt><tt class="py-op">(</tt><tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">kwargs</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">+</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">ellpsd</tt><tt class="py-op">.</tt><tt class="py-name">items</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
755 <a name="L704"></a><tt class="py-lineno">704</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sphere</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
756 <a name="L705"></a><tt class="py-lineno">705</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'ellps'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
757 <a name="L706"></a><tt class="py-lineno">706</tt> <tt class="py-line"> <tt class="py-comment"># ellipse name given, look up in pj_ellps dict</tt> </tt>
758 <a name="L707"></a><tt class="py-lineno">707</tt> <tt class="py-line"> <tt class="py-name">ellps_dict</tt> <tt class="py-op">=</tt> <tt id="link-16" class="py-name"><a title="pyproj.pj_ellps" class="py-name" href="#" onclick="return doclink('link-16', 'pj_ellps', 'link-4');">pj_ellps</a></tt><tt class="py-op">[</tt><tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'ellps'</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
759 <a name="L708"></a><tt class="py-lineno">708</tt> <tt class="py-line"> <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">]</tt> </tt>
760 <a name="L709"></a><tt class="py-lineno">709</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'description'</tt><tt class="py-op">]</tt><tt class="py-op">==</tt><tt class="py-string">'Normal Sphere'</tt><tt class="py-op">:</tt> </tt>
761 <a name="L710"></a><tt class="py-lineno">710</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sphere</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
762 <a name="L711"></a><tt class="py-lineno">711</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'b'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">:</tt> </tt>
763 <a name="L712"></a><tt class="py-lineno">712</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'b'</tt><tt class="py-op">]</tt> </tt>
764764 <a name="L713"></a><tt class="py-lineno">713</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">*</tt> <tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
765 <a name="L714"></a><tt class="py-lineno">714</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
766 <a name="L715"></a><tt class="py-lineno">715</tt> <tt class="py-line"> <tt class="py-comment"># a (semi-major axis) and one of</tt> </tt>
767 <a name="L716"></a><tt class="py-lineno">716</tt> <tt class="py-line"> <tt class="py-comment"># b the semi-minor axis</tt> </tt>
768 <a name="L717"></a><tt class="py-lineno">717</tt> <tt class="py-line"> <tt class="py-comment"># rf the reciprocal flattening</tt> </tt>
769 <a name="L718"></a><tt class="py-lineno">718</tt> <tt class="py-line"> <tt class="py-comment"># f flattening</tt> </tt>
770 <a name="L719"></a><tt class="py-lineno">719</tt> <tt class="py-line"> <tt class="py-comment"># es eccentricity squared</tt> </tt>
771 <a name="L720"></a><tt class="py-lineno">720</tt> <tt class="py-line"> <tt class="py-comment"># must be given.</tt> </tt>
772 <a name="L721"></a><tt class="py-lineno">721</tt> <tt class="py-line"> <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">]</tt> </tt>
773 <a name="L722"></a><tt class="py-lineno">722</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'b'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
774 <a name="L723"></a><tt class="py-lineno">723</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'b'</tt><tt class="py-op">]</tt> </tt>
775 <a name="L724"></a><tt class="py-lineno">724</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">*</tt> <tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
776 <a name="L725"></a><tt class="py-lineno">725</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
777 <a name="L726"></a><tt class="py-lineno">726</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'rf'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
778 <a name="L727"></a><tt class="py-lineno">727</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt><tt class="py-op">/</tt><tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'rf'</tt><tt class="py-op">]</tt> </tt>
779 <a name="L728"></a><tt class="py-lineno">728</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
765 <a name="L714"></a><tt class="py-lineno">714</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
766 <a name="L715"></a><tt class="py-lineno">715</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'rf'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">ellps_dict</tt><tt class="py-op">:</tt> </tt>
767 <a name="L716"></a><tt class="py-lineno">716</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt><tt class="py-op">/</tt><tt class="py-name">ellps_dict</tt><tt class="py-op">[</tt><tt class="py-string">'rf'</tt><tt class="py-op">]</tt> </tt>
768 <a name="L717"></a><tt class="py-lineno">717</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
769 <a name="L718"></a><tt class="py-lineno">718</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">*</tt> <tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
770 <a name="L719"></a><tt class="py-lineno">719</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
771 <a name="L720"></a><tt class="py-lineno">720</tt> <tt class="py-line"> <tt class="py-comment"># a (semi-major axis) and one of</tt> </tt>
772 <a name="L721"></a><tt class="py-lineno">721</tt> <tt class="py-line"> <tt class="py-comment"># b the semi-minor axis</tt> </tt>
773 <a name="L722"></a><tt class="py-lineno">722</tt> <tt class="py-line"> <tt class="py-comment"># rf the reciprocal flattening</tt> </tt>
774 <a name="L723"></a><tt class="py-lineno">723</tt> <tt class="py-line"> <tt class="py-comment"># f flattening</tt> </tt>
775 <a name="L724"></a><tt class="py-lineno">724</tt> <tt class="py-line"> <tt class="py-comment"># es eccentricity squared</tt> </tt>
776 <a name="L725"></a><tt class="py-lineno">725</tt> <tt class="py-line"> <tt class="py-comment"># must be given.</tt> </tt>
777 <a name="L726"></a><tt class="py-lineno">726</tt> <tt class="py-line"> <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'a'</tt><tt class="py-op">]</tt> </tt>
778 <a name="L727"></a><tt class="py-lineno">727</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-string">'b'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
779 <a name="L728"></a><tt class="py-lineno">728</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'b'</tt><tt class="py-op">]</tt> </tt>
780780 <a name="L729"></a><tt class="py-lineno">729</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">*</tt> <tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
781 <a name="L730"></a><tt class="py-lineno">730</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'f'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
782 <a name="L731"></a><tt class="py-lineno">731</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'f'</tt><tt class="py-op">]</tt> </tt>
783 <a name="L732"></a><tt class="py-lineno">732</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
784 <a name="L733"></a><tt class="py-lineno">733</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt><tt class="py-op">/</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> </tt>
785 <a name="L734"></a><tt class="py-lineno">734</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'es'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
786 <a name="L735"></a><tt class="py-lineno">735</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'es'</tt><tt class="py-op">]</tt> </tt>
787 <a name="L736"></a><tt class="py-lineno">736</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">-</tt> <tt class="py-name">es</tt><tt class="py-op">*</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
788 <a name="L737"></a><tt class="py-lineno">737</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
789 <a name="L738"></a><tt class="py-lineno">738</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'e'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
790 <a name="L739"></a><tt class="py-lineno">739</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'e'</tt><tt class="py-op">]</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> </tt>
791 <a name="L740"></a><tt class="py-lineno">740</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">-</tt> <tt class="py-name">es</tt><tt class="py-op">*</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
792 <a name="L741"></a><tt class="py-lineno">741</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
793 <a name="L742"></a><tt class="py-lineno">742</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
794 <a name="L743"></a><tt class="py-lineno">743</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt> </tt>
795 <a name="L744"></a><tt class="py-lineno">744</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-number">0.</tt> </tt>
796 <a name="L745"></a><tt class="py-lineno">745</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">0.</tt> </tt>
797 <a name="L746"></a><tt class="py-lineno">746</tt> <tt class="py-line"> <tt class="py-comment">#msg='ellipse name or a, plus one of f,es,b must be given'</tt> </tt>
798 <a name="L747"></a><tt class="py-lineno">747</tt> <tt class="py-line"> <tt class="py-comment">#raise ValueError(msg)</tt> </tt>
799 <a name="L748"></a><tt class="py-lineno">748</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">1.e-8</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sphere</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
800 <a name="L749"></a><tt class="py-lineno">749</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt> </tt>
801 <a name="L750"></a><tt class="py-lineno">750</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">b</tt> </tt>
802 <a name="L751"></a><tt class="py-lineno">751</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt> </tt>
803 <a name="L752"></a><tt class="py-lineno">752</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-name">es</tt> </tt>
804 <a name="L753"></a><tt class="py-lineno">753</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-15" class="py-name" targets="Class pyproj.Geod=pyproj.Geod-class.html"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-15', 'Geod', 'link-15');">Geod</a></tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="pyproj.Geod.__new__
805 pyproj.Proj.__new__" class="py-name" href="#" onclick="return doclink('link-16', '__new__', 'link-7');">__new__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
806 </div><a name="L754"></a><tt class="py-lineno">754</tt> <tt class="py-line"> </tt>
807 <a name="Geod.fwd"></a><div id="Geod.fwd-def"><a name="L755"></a><tt class="py-lineno">755</tt> <a class="py-toggle" href="#" id="Geod.fwd-toggle" onclick="return toggle('Geod.fwd');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#fwd">fwd</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">lons</tt><tt class="py-op">,</tt> <tt class="py-param">lats</tt><tt class="py-op">,</tt> <tt class="py-param">az</tt><tt class="py-op">,</tt> <tt class="py-param">dist</tt><tt class="py-op">,</tt> <tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
808 </div><div id="Geod.fwd-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.fwd-expanded"><a name="L756"></a><tt class="py-lineno">756</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
809 <a name="L757"></a><tt class="py-lineno">757</tt> <tt class="py-line"><tt class="py-docstring"> forward transformation - Returns longitudes, latitudes and back</tt> </tt>
810 <a name="L758"></a><tt class="py-lineno">758</tt> <tt class="py-line"><tt class="py-docstring"> azimuths of terminus points given longitudes (lons) and</tt> </tt>
811 <a name="L759"></a><tt class="py-lineno">759</tt> <tt class="py-line"><tt class="py-docstring"> latitudes (lats) of initial points, plus forward azimuths (az)</tt> </tt>
812 <a name="L760"></a><tt class="py-lineno">760</tt> <tt class="py-line"><tt class="py-docstring"> and distances (dist).</tt> </tt>
813 <a name="L761"></a><tt class="py-lineno">761</tt> <tt class="py-line"><tt class="py-docstring"> latitudes (lats) of initial points, plus forward azimuths (az)</tt> </tt>
814 <a name="L762"></a><tt class="py-lineno">762</tt> <tt class="py-line"><tt class="py-docstring"> and distances (dist).</tt> </tt>
815 <a name="L763"></a><tt class="py-lineno">763</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
816 <a name="L764"></a><tt class="py-lineno">764</tt> <tt class="py-line"><tt class="py-docstring"> Works with numpy and regular python array objects, python</tt> </tt>
817 <a name="L765"></a><tt class="py-lineno">765</tt> <tt class="py-line"><tt class="py-docstring"> sequences and scalars.</tt> </tt>
818 <a name="L766"></a><tt class="py-lineno">766</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
819 <a name="L767"></a><tt class="py-lineno">767</tt> <tt class="py-line"><tt class="py-docstring"> if radians=True, lons/lats and azimuths are radians instead of</tt> </tt>
820 <a name="L768"></a><tt class="py-lineno">768</tt> <tt class="py-line"><tt class="py-docstring"> degrees. Distances are in meters.</tt> </tt>
821 <a name="L769"></a><tt class="py-lineno">769</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
822 <a name="L770"></a><tt class="py-lineno">770</tt> <tt class="py-line"> <tt class="py-comment"># process inputs, making copies that support buffer API.</tt> </tt>
823 <a name="L771"></a><tt class="py-lineno">771</tt> <tt class="py-line"> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">xisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">xislist</tt><tt class="py-op">,</tt> <tt class="py-name">xistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">)</tt> </tt>
824 <a name="L772"></a><tt class="py-lineno">772</tt> <tt class="py-line"> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">yisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">yislist</tt><tt class="py-op">,</tt> <tt class="py-name">yistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lats</tt><tt class="py-op">)</tt> </tt>
825 <a name="L773"></a><tt class="py-lineno">773</tt> <tt class="py-line"> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">zisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">zislist</tt><tt class="py-op">,</tt> <tt class="py-name">zistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">az</tt><tt class="py-op">)</tt> </tt>
826 <a name="L774"></a><tt class="py-lineno">774</tt> <tt class="py-line"> <tt class="py-name">ind</tt><tt class="py-op">,</tt> <tt class="py-name">disfloat</tt><tt class="py-op">,</tt> <tt class="py-name">dislist</tt><tt class="py-op">,</tt> <tt class="py-name">distuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">dist</tt><tt class="py-op">)</tt> </tt>
827 <a name="L775"></a><tt class="py-lineno">775</tt> <tt class="py-line"> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-17', 'Geod', 'link-15');">Geod</a></tt><tt class="py-op">.</tt><tt class="py-name">_fwd</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">ind</tt><tt class="py-op">,</tt> <tt class="py-name">radians</tt><tt class="py-op">=</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
828 <a name="L776"></a><tt class="py-lineno">776</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back.</tt> </tt>
829 <a name="L777"></a><tt class="py-lineno">777</tt> <tt class="py-line"> <tt class="py-name">outx</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">xisfloat</tt><tt class="py-op">,</tt><tt class="py-name">xislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
830 <a name="L778"></a><tt class="py-lineno">778</tt> <tt class="py-line"> <tt class="py-name">outy</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">yisfloat</tt><tt class="py-op">,</tt><tt class="py-name">yislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">)</tt> </tt>
831 <a name="L779"></a><tt class="py-lineno">779</tt> <tt class="py-line"> <tt class="py-name">outz</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">zisfloat</tt><tt class="py-op">,</tt><tt class="py-name">zislist</tt><tt class="py-op">,</tt><tt class="py-name">zistuple</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">)</tt> </tt>
832 <a name="L780"></a><tt class="py-lineno">780</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt><tt class="py-op">,</tt> <tt class="py-name">outz</tt> </tt>
833 </div><a name="L781"></a><tt class="py-lineno">781</tt> <tt class="py-line"> </tt>
834 <a name="Geod.inv"></a><div id="Geod.inv-def"><a name="L782"></a><tt class="py-lineno">782</tt> <a class="py-toggle" href="#" id="Geod.inv-toggle" onclick="return toggle('Geod.inv');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#inv">inv</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">lons1</tt><tt class="py-op">,</tt><tt class="py-param">lats1</tt><tt class="py-op">,</tt><tt class="py-param">lons2</tt><tt class="py-op">,</tt><tt class="py-param">lats2</tt><tt class="py-op">,</tt><tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
835 </div><div id="Geod.inv-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.inv-expanded"><a name="L783"></a><tt class="py-lineno">783</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
836 <a name="L784"></a><tt class="py-lineno">784</tt> <tt class="py-line"><tt class="py-docstring"> inverse transformation - Returns forward and back azimuths, plus</tt> </tt>
837 <a name="L785"></a><tt class="py-lineno">785</tt> <tt class="py-line"><tt class="py-docstring"> distances between initial points (specified by lons1, lats1) and</tt> </tt>
838 <a name="L786"></a><tt class="py-lineno">786</tt> <tt class="py-line"><tt class="py-docstring"> terminus points (specified by lons2, lats2).</tt> </tt>
839 <a name="L787"></a><tt class="py-lineno">787</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
840 <a name="L788"></a><tt class="py-lineno">788</tt> <tt class="py-line"><tt class="py-docstring"> Works with numpy and regular python array objects, python</tt> </tt>
841 <a name="L789"></a><tt class="py-lineno">789</tt> <tt class="py-line"><tt class="py-docstring"> sequences and scalars.</tt> </tt>
842 <a name="L790"></a><tt class="py-lineno">790</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
843 <a name="L791"></a><tt class="py-lineno">791</tt> <tt class="py-line"><tt class="py-docstring"> if radians=True, lons/lats and azimuths are radians instead of</tt> </tt>
844 <a name="L792"></a><tt class="py-lineno">792</tt> <tt class="py-line"><tt class="py-docstring"> degrees. Distances are in meters.</tt> </tt>
845 <a name="L793"></a><tt class="py-lineno">793</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
846 <a name="L794"></a><tt class="py-lineno">794</tt> <tt class="py-line"> <tt class="py-comment"># process inputs, making copies that support buffer API.</tt> </tt>
847 <a name="L795"></a><tt class="py-lineno">795</tt> <tt class="py-line"> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">xisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">xislist</tt><tt class="py-op">,</tt> <tt class="py-name">xistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lons1</tt><tt class="py-op">)</tt> </tt>
848 <a name="L796"></a><tt class="py-lineno">796</tt> <tt class="py-line"> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">yisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">yislist</tt><tt class="py-op">,</tt> <tt class="py-name">yistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lats1</tt><tt class="py-op">)</tt> </tt>
849 <a name="L797"></a><tt class="py-lineno">797</tt> <tt class="py-line"> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">zisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">zislist</tt><tt class="py-op">,</tt> <tt class="py-name">zistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lons2</tt><tt class="py-op">)</tt> </tt>
850 <a name="L798"></a><tt class="py-lineno">798</tt> <tt class="py-line"> <tt class="py-name">ind</tt><tt class="py-op">,</tt> <tt class="py-name">disfloat</tt><tt class="py-op">,</tt> <tt class="py-name">dislist</tt><tt class="py-op">,</tt> <tt class="py-name">distuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lats2</tt><tt class="py-op">)</tt> </tt>
851 <a name="L799"></a><tt class="py-lineno">799</tt> <tt class="py-line"> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-18', 'Geod', 'link-15');">Geod</a></tt><tt class="py-op">.</tt><tt class="py-name">_inv</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">,</tt><tt class="py-name">ind</tt><tt class="py-op">,</tt><tt class="py-name">radians</tt><tt class="py-op">=</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
852 <a name="L800"></a><tt class="py-lineno">800</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back.</tt> </tt>
853 <a name="L801"></a><tt class="py-lineno">801</tt> <tt class="py-line"> <tt class="py-name">outx</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">xisfloat</tt><tt class="py-op">,</tt><tt class="py-name">xislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
854 <a name="L802"></a><tt class="py-lineno">802</tt> <tt class="py-line"> <tt class="py-name">outy</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">yisfloat</tt><tt class="py-op">,</tt><tt class="py-name">yislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">)</tt> </tt>
855 <a name="L803"></a><tt class="py-lineno">803</tt> <tt class="py-line"> <tt class="py-name">outz</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">zisfloat</tt><tt class="py-op">,</tt><tt class="py-name">zislist</tt><tt class="py-op">,</tt><tt class="py-name">zistuple</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">)</tt> </tt>
856 <a name="L804"></a><tt class="py-lineno">804</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt><tt class="py-op">,</tt> <tt class="py-name">outz</tt> </tt>
857 </div><a name="L805"></a><tt class="py-lineno">805</tt> <tt class="py-line"> </tt>
858 <a name="Geod.npts"></a><div id="Geod.npts-def"><a name="L806"></a><tt class="py-lineno">806</tt> <a class="py-toggle" href="#" id="Geod.npts-toggle" onclick="return toggle('Geod.npts');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#npts">npts</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">lon1</tt><tt class="py-op">,</tt> <tt class="py-param">lat1</tt><tt class="py-op">,</tt> <tt class="py-param">lon2</tt><tt class="py-op">,</tt> <tt class="py-param">lat2</tt><tt class="py-op">,</tt> <tt class="py-param">npts</tt><tt class="py-op">,</tt> <tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
859 </div><div id="Geod.npts-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.npts-expanded"><a name="L807"></a><tt class="py-lineno">807</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
860 <a name="L808"></a><tt class="py-lineno">808</tt> <tt class="py-line"><tt class="py-docstring"> Given a single initial point and terminus point (specified by</tt> </tt>
861 <a name="L809"></a><tt class="py-lineno">809</tt> <tt class="py-line"><tt class="py-docstring"> python floats lon1,lat1 and lon2,lat2), returns a list of</tt> </tt>
862 <a name="L810"></a><tt class="py-lineno">810</tt> <tt class="py-line"><tt class="py-docstring"> longitude/latitude pairs describing npts equally spaced</tt> </tt>
863 <a name="L811"></a><tt class="py-lineno">811</tt> <tt class="py-line"><tt class="py-docstring"> intermediate points along the geodesic between the initial and</tt> </tt>
864 <a name="L812"></a><tt class="py-lineno">812</tt> <tt class="py-line"><tt class="py-docstring"> terminus points.</tt> </tt>
865 <a name="L813"></a><tt class="py-lineno">813</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
866 <a name="L814"></a><tt class="py-lineno">814</tt> <tt class="py-line"><tt class="py-docstring"> if radians=True, lons/lats are radians instead of degrees.</tt> </tt>
867 <a name="L815"></a><tt class="py-lineno">815</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
868 <a name="L816"></a><tt class="py-lineno">816</tt> <tt class="py-line"><tt class="py-docstring"> Example usage:</tt> </tt>
869 <a name="L817"></a><tt class="py-lineno">817</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
870 <a name="L818"></a><tt class="py-lineno">818</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; from pyproj import Geod</tt> </tt>
871 <a name="L819"></a><tt class="py-lineno">819</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g = Geod(ellps='clrk66') # Use Clarke 1966 ellipsoid.</tt> </tt>
872 <a name="L820"></a><tt class="py-lineno">820</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # specify the lat/lons of Boston and Portland.</tt> </tt>
873 <a name="L821"></a><tt class="py-lineno">821</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g = Geod(ellps='clrk66') # Use Clarke 1966 ellipsoid.</tt> </tt>
874 <a name="L822"></a><tt class="py-lineno">822</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # specify the lat/lons of Boston and Portland.</tt> </tt>
875 <a name="L823"></a><tt class="py-lineno">823</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)</tt> </tt>
876 <a name="L824"></a><tt class="py-lineno">824</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)</tt> </tt>
877 <a name="L825"></a><tt class="py-lineno">825</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # find ten equally spaced points between Boston and Portland.</tt> </tt>
878 <a name="L826"></a><tt class="py-lineno">826</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lonlats = g.npts(boston_lon,boston_lat,portland_lon,portland_lat,10)</tt> </tt>
879 <a name="L827"></a><tt class="py-lineno">827</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; for lon,lat in lonlats: '%6.3f %7.3f' % (lat, lon)</tt> </tt>
880 <a name="L828"></a><tt class="py-lineno">828</tt> <tt class="py-line"><tt class="py-docstring"> '43.528 -75.414'</tt> </tt>
881 <a name="L829"></a><tt class="py-lineno">829</tt> <tt class="py-line"><tt class="py-docstring"> '44.637 -79.883'</tt> </tt>
882 <a name="L830"></a><tt class="py-lineno">830</tt> <tt class="py-line"><tt class="py-docstring"> '45.565 -84.512'</tt> </tt>
883 <a name="L831"></a><tt class="py-lineno">831</tt> <tt class="py-line"><tt class="py-docstring"> '46.299 -89.279'</tt> </tt>
884 <a name="L832"></a><tt class="py-lineno">832</tt> <tt class="py-line"><tt class="py-docstring"> '46.830 -94.156'</tt> </tt>
885 <a name="L833"></a><tt class="py-lineno">833</tt> <tt class="py-line"><tt class="py-docstring"> '47.149 -99.112'</tt> </tt>
886 <a name="L834"></a><tt class="py-lineno">834</tt> <tt class="py-line"><tt class="py-docstring"> '47.251 -104.106'</tt> </tt>
887 <a name="L835"></a><tt class="py-lineno">835</tt> <tt class="py-line"><tt class="py-docstring"> '47.136 -109.100'</tt> </tt>
888 <a name="L836"></a><tt class="py-lineno">836</tt> <tt class="py-line"><tt class="py-docstring"> '46.805 -114.051'</tt> </tt>
889 <a name="L837"></a><tt class="py-lineno">837</tt> <tt class="py-line"><tt class="py-docstring"> '46.262 -118.924'</tt> </tt>
890 <a name="L838"></a><tt class="py-lineno">838</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # test with radians=True (inputs/outputs in radians, not degrees)</tt> </tt>
891 <a name="L839"></a><tt class="py-lineno">839</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; import math</tt> </tt>
892 <a name="L840"></a><tt class="py-lineno">840</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; dg2rad = math.radians(1.)</tt> </tt>
893 <a name="L841"></a><tt class="py-lineno">841</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; rad2dg = math.degrees(1.)</tt> </tt>
894 <a name="L842"></a><tt class="py-lineno">842</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lonlats = g.npts(dg2rad*boston_lon,dg2rad*boston_lat,dg2rad*portland_lon,dg2rad*portland_lat,10,radians=True)</tt> </tt>
895 <a name="L843"></a><tt class="py-lineno">843</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; for lon,lat in lonlats: '%6.3f %7.3f' % (rad2dg*lat, rad2dg*lon)</tt> </tt>
896 <a name="L844"></a><tt class="py-lineno">844</tt> <tt class="py-line"><tt class="py-docstring"> '43.528 -75.414'</tt> </tt>
897 <a name="L845"></a><tt class="py-lineno">845</tt> <tt class="py-line"><tt class="py-docstring"> '44.637 -79.883'</tt> </tt>
898 <a name="L846"></a><tt class="py-lineno">846</tt> <tt class="py-line"><tt class="py-docstring"> '45.565 -84.512'</tt> </tt>
899 <a name="L847"></a><tt class="py-lineno">847</tt> <tt class="py-line"><tt class="py-docstring"> '46.299 -89.279'</tt> </tt>
900 <a name="L848"></a><tt class="py-lineno">848</tt> <tt class="py-line"><tt class="py-docstring"> '46.830 -94.156'</tt> </tt>
901 <a name="L849"></a><tt class="py-lineno">849</tt> <tt class="py-line"><tt class="py-docstring"> '47.149 -99.112'</tt> </tt>
902 <a name="L850"></a><tt class="py-lineno">850</tt> <tt class="py-line"><tt class="py-docstring"> '47.251 -104.106'</tt> </tt>
903 <a name="L851"></a><tt class="py-lineno">851</tt> <tt class="py-line"><tt class="py-docstring"> '47.136 -109.100'</tt> </tt>
904 <a name="L852"></a><tt class="py-lineno">852</tt> <tt class="py-line"><tt class="py-docstring"> '46.805 -114.051'</tt> </tt>
905 <a name="L853"></a><tt class="py-lineno">853</tt> <tt class="py-line"><tt class="py-docstring"> '46.262 -118.924'</tt> </tt>
906 <a name="L854"></a><tt class="py-lineno">854</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
907 <a name="L855"></a><tt class="py-lineno">855</tt> <tt class="py-line"> <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-19', 'Geod', 'link-15');">Geod</a></tt><tt class="py-op">.</tt><tt class="py-name">_npts</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt><tt class="py-op">,</tt> <tt class="py-name">lon2</tt><tt class="py-op">,</tt> <tt class="py-name">lat2</tt><tt class="py-op">,</tt> <tt id="link-20" class="py-name" targets="Method pyproj.Geod.npts()=pyproj.Geod-class.html#npts"><a title="pyproj.Geod.npts" class="py-name" href="#" onclick="return doclink('link-20', 'npts', 'link-20');">npts</a></tt><tt class="py-op">,</tt> <tt class="py-name">radians</tt><tt class="py-op">=</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
908 <a name="L856"></a><tt class="py-lineno">856</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">zip</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
909 </div></div><a name="L857"></a><tt class="py-lineno">857</tt> <tt class="py-line"> </tt>
910 <a name="test"></a><div id="test-def"><a name="L858"></a><tt class="py-lineno">858</tt> <a class="py-toggle" href="#" id="test-toggle" onclick="return toggle('test');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#test">test</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
911 </div><div id="test-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="test-expanded"><a name="L859"></a><tt class="py-lineno">859</tt> <tt class="py-line"> <tt class="py-docstring">"""run the examples in the docstrings using the doctest module"""</tt> </tt>
912 <a name="L860"></a><tt class="py-lineno">860</tt> <tt class="py-line"> <tt class="py-keyword">import</tt> <tt class="py-name">doctest</tt><tt class="py-op">,</tt> <tt id="link-21" class="py-name"><a title="pyproj" class="py-name" href="#" onclick="return doclink('link-21', 'pyproj', 'link-0');">pyproj</a></tt> </tt>
913 <a name="L861"></a><tt class="py-lineno">861</tt> <tt class="py-line"> <tt class="py-name">doctest</tt><tt class="py-op">.</tt><tt class="py-name">testmod</tt><tt class="py-op">(</tt><tt id="link-22" class="py-name"><a title="pyproj" class="py-name" href="#" onclick="return doclink('link-22', 'pyproj', 'link-0');">pyproj</a></tt><tt class="py-op">,</tt><tt class="py-name">verbose</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
914 </div><a name="L862"></a><tt class="py-lineno">862</tt> <tt class="py-line"> </tt>
915 <a name="L863"></a><tt class="py-lineno">863</tt> <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">"__main__"</tt><tt class="py-op">:</tt> <tt id="link-23" class="py-name" targets="Function pyproj.test()=pyproj-module.html#test"><a title="pyproj.test" class="py-name" href="#" onclick="return doclink('link-23', 'test', 'link-23');">test</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
916 <a name="L864"></a><tt class="py-lineno">864</tt> <tt class="py-line"> </tt><script type="text/javascript">
781 <a name="L730"></a><tt class="py-lineno">730</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
782 <a name="L731"></a><tt class="py-lineno">731</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'rf'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
783 <a name="L732"></a><tt class="py-lineno">732</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt><tt class="py-op">/</tt><tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'rf'</tt><tt class="py-op">]</tt> </tt>
784 <a name="L733"></a><tt class="py-lineno">733</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
785 <a name="L734"></a><tt class="py-lineno">734</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt> <tt class="py-op">*</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">*</tt> <tt class="py-name">a</tt><tt class="py-op">)</tt> </tt>
786 <a name="L735"></a><tt class="py-lineno">735</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'f'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
787 <a name="L736"></a><tt class="py-lineno">736</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'f'</tt><tt class="py-op">]</tt> </tt>
788 <a name="L737"></a><tt class="py-lineno">737</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
789 <a name="L738"></a><tt class="py-lineno">738</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">1.</tt> <tt class="py-op">-</tt> <tt class="py-op">(</tt><tt class="py-name">b</tt><tt class="py-op">/</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> </tt>
790 <a name="L739"></a><tt class="py-lineno">739</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'es'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
791 <a name="L740"></a><tt class="py-lineno">740</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'es'</tt><tt class="py-op">]</tt> </tt>
792 <a name="L741"></a><tt class="py-lineno">741</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">-</tt> <tt class="py-name">es</tt><tt class="py-op">*</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
793 <a name="L742"></a><tt class="py-lineno">742</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
794 <a name="L743"></a><tt class="py-lineno">743</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-string">'e'</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kwargs</tt><tt class="py-op">:</tt> </tt>
795 <a name="L744"></a><tt class="py-lineno">744</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-name">kwargs</tt><tt class="py-op">[</tt><tt class="py-string">'e'</tt><tt class="py-op">]</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> </tt>
796 <a name="L745"></a><tt class="py-lineno">745</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt> <tt class="py-op">-</tt> <tt class="py-name">es</tt><tt class="py-op">*</tt><tt class="py-name">a</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
797 <a name="L746"></a><tt class="py-lineno">746</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt> <tt class="py-op">-</tt> <tt class="py-name">b</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">a</tt> </tt>
798 <a name="L747"></a><tt class="py-lineno">747</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
799 <a name="L748"></a><tt class="py-lineno">748</tt> <tt class="py-line"> <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt> </tt>
800 <a name="L749"></a><tt class="py-lineno">749</tt> <tt class="py-line"> <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-number">0.</tt> </tt>
801 <a name="L750"></a><tt class="py-lineno">750</tt> <tt class="py-line"> <tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-number">0.</tt> </tt>
802 <a name="L751"></a><tt class="py-lineno">751</tt> <tt class="py-line"> <tt class="py-comment">#msg='ellipse name or a, plus one of f,es,b must be given'</tt> </tt>
803 <a name="L752"></a><tt class="py-lineno">752</tt> <tt class="py-line"> <tt class="py-comment">#raise ValueError(msg)</tt> </tt>
804 <a name="L753"></a><tt class="py-lineno">753</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">1.e-8</tt><tt class="py-op">:</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">sphere</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
805 <a name="L754"></a><tt class="py-lineno">754</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-name">a</tt> </tt>
806 <a name="L755"></a><tt class="py-lineno">755</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">b</tt> </tt>
807 <a name="L756"></a><tt class="py-lineno">756</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt> </tt>
808 <a name="L757"></a><tt class="py-lineno">757</tt> <tt class="py-line"> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">es</tt> <tt class="py-op">=</tt> <tt class="py-name">es</tt> </tt>
809 <a name="L758"></a><tt class="py-lineno">758</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Class pyproj.Geod=pyproj.Geod-class.html"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-17', 'Geod', 'link-17');">Geod</a></tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="pyproj.Geod.__new__
810 pyproj.Proj.__new__" class="py-name" href="#" onclick="return doclink('link-18', '__new__', 'link-7');">__new__</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
811 </div><a name="L759"></a><tt class="py-lineno">759</tt> <tt class="py-line"> </tt>
812 <a name="Geod.fwd"></a><div id="Geod.fwd-def"><a name="L760"></a><tt class="py-lineno">760</tt> <a class="py-toggle" href="#" id="Geod.fwd-toggle" onclick="return toggle('Geod.fwd');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#fwd">fwd</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">lons</tt><tt class="py-op">,</tt> <tt class="py-param">lats</tt><tt class="py-op">,</tt> <tt class="py-param">az</tt><tt class="py-op">,</tt> <tt class="py-param">dist</tt><tt class="py-op">,</tt> <tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
813 </div><div id="Geod.fwd-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.fwd-expanded"><a name="L761"></a><tt class="py-lineno">761</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
814 <a name="L762"></a><tt class="py-lineno">762</tt> <tt class="py-line"><tt class="py-docstring"> forward transformation - Returns longitudes, latitudes and back</tt> </tt>
815 <a name="L763"></a><tt class="py-lineno">763</tt> <tt class="py-line"><tt class="py-docstring"> azimuths of terminus points given longitudes (lons) and</tt> </tt>
816 <a name="L764"></a><tt class="py-lineno">764</tt> <tt class="py-line"><tt class="py-docstring"> latitudes (lats) of initial points, plus forward azimuths (az)</tt> </tt>
817 <a name="L765"></a><tt class="py-lineno">765</tt> <tt class="py-line"><tt class="py-docstring"> and distances (dist).</tt> </tt>
818 <a name="L766"></a><tt class="py-lineno">766</tt> <tt class="py-line"><tt class="py-docstring"> latitudes (lats) of initial points, plus forward azimuths (az)</tt> </tt>
819 <a name="L767"></a><tt class="py-lineno">767</tt> <tt class="py-line"><tt class="py-docstring"> and distances (dist).</tt> </tt>
820 <a name="L768"></a><tt class="py-lineno">768</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
821 <a name="L769"></a><tt class="py-lineno">769</tt> <tt class="py-line"><tt class="py-docstring"> Works with numpy and regular python array objects, python</tt> </tt>
822 <a name="L770"></a><tt class="py-lineno">770</tt> <tt class="py-line"><tt class="py-docstring"> sequences and scalars.</tt> </tt>
823 <a name="L771"></a><tt class="py-lineno">771</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
824 <a name="L772"></a><tt class="py-lineno">772</tt> <tt class="py-line"><tt class="py-docstring"> if radians=True, lons/lats and azimuths are radians instead of</tt> </tt>
825 <a name="L773"></a><tt class="py-lineno">773</tt> <tt class="py-line"><tt class="py-docstring"> degrees. Distances are in meters.</tt> </tt>
826 <a name="L774"></a><tt class="py-lineno">774</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
827 <a name="L775"></a><tt class="py-lineno">775</tt> <tt class="py-line"> <tt class="py-comment"># process inputs, making copies that support buffer API.</tt> </tt>
828 <a name="L776"></a><tt class="py-lineno">776</tt> <tt class="py-line"> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">xisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">xislist</tt><tt class="py-op">,</tt> <tt class="py-name">xistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">)</tt> </tt>
829 <a name="L777"></a><tt class="py-lineno">777</tt> <tt class="py-line"> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">yisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">yislist</tt><tt class="py-op">,</tt> <tt class="py-name">yistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lats</tt><tt class="py-op">)</tt> </tt>
830 <a name="L778"></a><tt class="py-lineno">778</tt> <tt class="py-line"> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">zisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">zislist</tt><tt class="py-op">,</tt> <tt class="py-name">zistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">az</tt><tt class="py-op">)</tt> </tt>
831 <a name="L779"></a><tt class="py-lineno">779</tt> <tt class="py-line"> <tt class="py-name">ind</tt><tt class="py-op">,</tt> <tt class="py-name">disfloat</tt><tt class="py-op">,</tt> <tt class="py-name">dislist</tt><tt class="py-op">,</tt> <tt class="py-name">distuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">dist</tt><tt class="py-op">)</tt> </tt>
832 <a name="L780"></a><tt class="py-lineno">780</tt> <tt class="py-line"> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-19', 'Geod', 'link-17');">Geod</a></tt><tt class="py-op">.</tt><tt class="py-name">_fwd</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">ind</tt><tt class="py-op">,</tt> <tt class="py-name">radians</tt><tt class="py-op">=</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
833 <a name="L781"></a><tt class="py-lineno">781</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back.</tt> </tt>
834 <a name="L782"></a><tt class="py-lineno">782</tt> <tt class="py-line"> <tt class="py-name">outx</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">xisfloat</tt><tt class="py-op">,</tt><tt class="py-name">xislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
835 <a name="L783"></a><tt class="py-lineno">783</tt> <tt class="py-line"> <tt class="py-name">outy</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">yisfloat</tt><tt class="py-op">,</tt><tt class="py-name">yislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">)</tt> </tt>
836 <a name="L784"></a><tt class="py-lineno">784</tt> <tt class="py-line"> <tt class="py-name">outz</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">zisfloat</tt><tt class="py-op">,</tt><tt class="py-name">zislist</tt><tt class="py-op">,</tt><tt class="py-name">zistuple</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">)</tt> </tt>
837 <a name="L785"></a><tt class="py-lineno">785</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt><tt class="py-op">,</tt> <tt class="py-name">outz</tt> </tt>
838 </div><a name="L786"></a><tt class="py-lineno">786</tt> <tt class="py-line"> </tt>
839 <a name="Geod.inv"></a><div id="Geod.inv-def"><a name="L787"></a><tt class="py-lineno">787</tt> <a class="py-toggle" href="#" id="Geod.inv-toggle" onclick="return toggle('Geod.inv');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#inv">inv</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">lons1</tt><tt class="py-op">,</tt><tt class="py-param">lats1</tt><tt class="py-op">,</tt><tt class="py-param">lons2</tt><tt class="py-op">,</tt><tt class="py-param">lats2</tt><tt class="py-op">,</tt><tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
840 </div><div id="Geod.inv-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.inv-expanded"><a name="L788"></a><tt class="py-lineno">788</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
841 <a name="L789"></a><tt class="py-lineno">789</tt> <tt class="py-line"><tt class="py-docstring"> inverse transformation - Returns forward and back azimuths, plus</tt> </tt>
842 <a name="L790"></a><tt class="py-lineno">790</tt> <tt class="py-line"><tt class="py-docstring"> distances between initial points (specified by lons1, lats1) and</tt> </tt>
843 <a name="L791"></a><tt class="py-lineno">791</tt> <tt class="py-line"><tt class="py-docstring"> terminus points (specified by lons2, lats2).</tt> </tt>
844 <a name="L792"></a><tt class="py-lineno">792</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
845 <a name="L793"></a><tt class="py-lineno">793</tt> <tt class="py-line"><tt class="py-docstring"> Works with numpy and regular python array objects, python</tt> </tt>
846 <a name="L794"></a><tt class="py-lineno">794</tt> <tt class="py-line"><tt class="py-docstring"> sequences and scalars.</tt> </tt>
847 <a name="L795"></a><tt class="py-lineno">795</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
848 <a name="L796"></a><tt class="py-lineno">796</tt> <tt class="py-line"><tt class="py-docstring"> if radians=True, lons/lats and azimuths are radians instead of</tt> </tt>
849 <a name="L797"></a><tt class="py-lineno">797</tt> <tt class="py-line"><tt class="py-docstring"> degrees. Distances are in meters.</tt> </tt>
850 <a name="L798"></a><tt class="py-lineno">798</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
851 <a name="L799"></a><tt class="py-lineno">799</tt> <tt class="py-line"> <tt class="py-comment"># process inputs, making copies that support buffer API.</tt> </tt>
852 <a name="L800"></a><tt class="py-lineno">800</tt> <tt class="py-line"> <tt class="py-name">inx</tt><tt class="py-op">,</tt> <tt class="py-name">xisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">xislist</tt><tt class="py-op">,</tt> <tt class="py-name">xistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lons1</tt><tt class="py-op">)</tt> </tt>
853 <a name="L801"></a><tt class="py-lineno">801</tt> <tt class="py-line"> <tt class="py-name">iny</tt><tt class="py-op">,</tt> <tt class="py-name">yisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">yislist</tt><tt class="py-op">,</tt> <tt class="py-name">yistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lats1</tt><tt class="py-op">)</tt> </tt>
854 <a name="L802"></a><tt class="py-lineno">802</tt> <tt class="py-line"> <tt class="py-name">inz</tt><tt class="py-op">,</tt> <tt class="py-name">zisfloat</tt><tt class="py-op">,</tt> <tt class="py-name">zislist</tt><tt class="py-op">,</tt> <tt class="py-name">zistuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lons2</tt><tt class="py-op">)</tt> </tt>
855 <a name="L803"></a><tt class="py-lineno">803</tt> <tt class="py-line"> <tt class="py-name">ind</tt><tt class="py-op">,</tt> <tt class="py-name">disfloat</tt><tt class="py-op">,</tt> <tt class="py-name">dislist</tt><tt class="py-op">,</tt> <tt class="py-name">distuple</tt> <tt class="py-op">=</tt> <tt class="py-name">_copytobuffer</tt><tt class="py-op">(</tt><tt class="py-name">lats2</tt><tt class="py-op">)</tt> </tt>
856 <a name="L804"></a><tt class="py-lineno">804</tt> <tt class="py-line"> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-20', 'Geod', 'link-17');">Geod</a></tt><tt class="py-op">.</tt><tt class="py-name">_inv</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">,</tt><tt class="py-name">ind</tt><tt class="py-op">,</tt><tt class="py-name">radians</tt><tt class="py-op">=</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
857 <a name="L805"></a><tt class="py-lineno">805</tt> <tt class="py-line"> <tt class="py-comment"># if inputs were lists, tuples or floats, convert back.</tt> </tt>
858 <a name="L806"></a><tt class="py-lineno">806</tt> <tt class="py-line"> <tt class="py-name">outx</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">xisfloat</tt><tt class="py-op">,</tt><tt class="py-name">xislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">inx</tt><tt class="py-op">)</tt> </tt>
859 <a name="L807"></a><tt class="py-lineno">807</tt> <tt class="py-line"> <tt class="py-name">outy</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">yisfloat</tt><tt class="py-op">,</tt><tt class="py-name">yislist</tt><tt class="py-op">,</tt><tt class="py-name">xistuple</tt><tt class="py-op">,</tt><tt class="py-name">iny</tt><tt class="py-op">)</tt> </tt>
860 <a name="L808"></a><tt class="py-lineno">808</tt> <tt class="py-line"> <tt class="py-name">outz</tt> <tt class="py-op">=</tt> <tt class="py-name">_convertback</tt><tt class="py-op">(</tt><tt class="py-name">zisfloat</tt><tt class="py-op">,</tt><tt class="py-name">zislist</tt><tt class="py-op">,</tt><tt class="py-name">zistuple</tt><tt class="py-op">,</tt><tt class="py-name">inz</tt><tt class="py-op">)</tt> </tt>
861 <a name="L809"></a><tt class="py-lineno">809</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">outx</tt><tt class="py-op">,</tt> <tt class="py-name">outy</tt><tt class="py-op">,</tt> <tt class="py-name">outz</tt> </tt>
862 </div><a name="L810"></a><tt class="py-lineno">810</tt> <tt class="py-line"> </tt>
863 <a name="Geod.npts"></a><div id="Geod.npts-def"><a name="L811"></a><tt class="py-lineno">811</tt> <a class="py-toggle" href="#" id="Geod.npts-toggle" onclick="return toggle('Geod.npts');">-</a><tt class="py-line"> <tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj.Geod-class.html#npts">npts</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">lon1</tt><tt class="py-op">,</tt> <tt class="py-param">lat1</tt><tt class="py-op">,</tt> <tt class="py-param">lon2</tt><tt class="py-op">,</tt> <tt class="py-param">lat2</tt><tt class="py-op">,</tt> <tt class="py-param">npts</tt><tt class="py-op">,</tt> <tt class="py-param">radians</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
864 </div><div id="Geod.npts-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Geod.npts-expanded"><a name="L812"></a><tt class="py-lineno">812</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
865 <a name="L813"></a><tt class="py-lineno">813</tt> <tt class="py-line"><tt class="py-docstring"> Given a single initial point and terminus point (specified by</tt> </tt>
866 <a name="L814"></a><tt class="py-lineno">814</tt> <tt class="py-line"><tt class="py-docstring"> python floats lon1,lat1 and lon2,lat2), returns a list of</tt> </tt>
867 <a name="L815"></a><tt class="py-lineno">815</tt> <tt class="py-line"><tt class="py-docstring"> longitude/latitude pairs describing npts equally spaced</tt> </tt>
868 <a name="L816"></a><tt class="py-lineno">816</tt> <tt class="py-line"><tt class="py-docstring"> intermediate points along the geodesic between the initial and</tt> </tt>
869 <a name="L817"></a><tt class="py-lineno">817</tt> <tt class="py-line"><tt class="py-docstring"> terminus points.</tt> </tt>
870 <a name="L818"></a><tt class="py-lineno">818</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
871 <a name="L819"></a><tt class="py-lineno">819</tt> <tt class="py-line"><tt class="py-docstring"> if radians=True, lons/lats are radians instead of degrees.</tt> </tt>
872 <a name="L820"></a><tt class="py-lineno">820</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
873 <a name="L821"></a><tt class="py-lineno">821</tt> <tt class="py-line"><tt class="py-docstring"> Example usage:</tt> </tt>
874 <a name="L822"></a><tt class="py-lineno">822</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
875 <a name="L823"></a><tt class="py-lineno">823</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; from pyproj import Geod</tt> </tt>
876 <a name="L824"></a><tt class="py-lineno">824</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g = Geod(ellps='clrk66') # Use Clarke 1966 ellipsoid.</tt> </tt>
877 <a name="L825"></a><tt class="py-lineno">825</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # specify the lat/lons of Boston and Portland.</tt> </tt>
878 <a name="L826"></a><tt class="py-lineno">826</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; g = Geod(ellps='clrk66') # Use Clarke 1966 ellipsoid.</tt> </tt>
879 <a name="L827"></a><tt class="py-lineno">827</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # specify the lat/lons of Boston and Portland.</tt> </tt>
880 <a name="L828"></a><tt class="py-lineno">828</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)</tt> </tt>
881 <a name="L829"></a><tt class="py-lineno">829</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)</tt> </tt>
882 <a name="L830"></a><tt class="py-lineno">830</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # find ten equally spaced points between Boston and Portland.</tt> </tt>
883 <a name="L831"></a><tt class="py-lineno">831</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lonlats = g.npts(boston_lon,boston_lat,portland_lon,portland_lat,10)</tt> </tt>
884 <a name="L832"></a><tt class="py-lineno">832</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; for lon,lat in lonlats: '%6.3f %7.3f' % (lat, lon)</tt> </tt>
885 <a name="L833"></a><tt class="py-lineno">833</tt> <tt class="py-line"><tt class="py-docstring"> '43.528 -75.414'</tt> </tt>
886 <a name="L834"></a><tt class="py-lineno">834</tt> <tt class="py-line"><tt class="py-docstring"> '44.637 -79.883'</tt> </tt>
887 <a name="L835"></a><tt class="py-lineno">835</tt> <tt class="py-line"><tt class="py-docstring"> '45.565 -84.512'</tt> </tt>
888 <a name="L836"></a><tt class="py-lineno">836</tt> <tt class="py-line"><tt class="py-docstring"> '46.299 -89.279'</tt> </tt>
889 <a name="L837"></a><tt class="py-lineno">837</tt> <tt class="py-line"><tt class="py-docstring"> '46.830 -94.156'</tt> </tt>
890 <a name="L838"></a><tt class="py-lineno">838</tt> <tt class="py-line"><tt class="py-docstring"> '47.149 -99.112'</tt> </tt>
891 <a name="L839"></a><tt class="py-lineno">839</tt> <tt class="py-line"><tt class="py-docstring"> '47.251 -104.106'</tt> </tt>
892 <a name="L840"></a><tt class="py-lineno">840</tt> <tt class="py-line"><tt class="py-docstring"> '47.136 -109.100'</tt> </tt>
893 <a name="L841"></a><tt class="py-lineno">841</tt> <tt class="py-line"><tt class="py-docstring"> '46.805 -114.051'</tt> </tt>
894 <a name="L842"></a><tt class="py-lineno">842</tt> <tt class="py-line"><tt class="py-docstring"> '46.262 -118.924'</tt> </tt>
895 <a name="L843"></a><tt class="py-lineno">843</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; # test with radians=True (inputs/outputs in radians, not degrees)</tt> </tt>
896 <a name="L844"></a><tt class="py-lineno">844</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; import math</tt> </tt>
897 <a name="L845"></a><tt class="py-lineno">845</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; dg2rad = math.radians(1.)</tt> </tt>
898 <a name="L846"></a><tt class="py-lineno">846</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; rad2dg = math.degrees(1.)</tt> </tt>
899 <a name="L847"></a><tt class="py-lineno">847</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; lonlats = g.npts(dg2rad*boston_lon,dg2rad*boston_lat,dg2rad*portland_lon,dg2rad*portland_lat,10,radians=True)</tt> </tt>
900 <a name="L848"></a><tt class="py-lineno">848</tt> <tt class="py-line"><tt class="py-docstring"> &gt;&gt;&gt; for lon,lat in lonlats: '%6.3f %7.3f' % (rad2dg*lat, rad2dg*lon)</tt> </tt>
901 <a name="L849"></a><tt class="py-lineno">849</tt> <tt class="py-line"><tt class="py-docstring"> '43.528 -75.414'</tt> </tt>
902 <a name="L850"></a><tt class="py-lineno">850</tt> <tt class="py-line"><tt class="py-docstring"> '44.637 -79.883'</tt> </tt>
903 <a name="L851"></a><tt class="py-lineno">851</tt> <tt class="py-line"><tt class="py-docstring"> '45.565 -84.512'</tt> </tt>
904 <a name="L852"></a><tt class="py-lineno">852</tt> <tt class="py-line"><tt class="py-docstring"> '46.299 -89.279'</tt> </tt>
905 <a name="L853"></a><tt class="py-lineno">853</tt> <tt class="py-line"><tt class="py-docstring"> '46.830 -94.156'</tt> </tt>
906 <a name="L854"></a><tt class="py-lineno">854</tt> <tt class="py-line"><tt class="py-docstring"> '47.149 -99.112'</tt> </tt>
907 <a name="L855"></a><tt class="py-lineno">855</tt> <tt class="py-line"><tt class="py-docstring"> '47.251 -104.106'</tt> </tt>
908 <a name="L856"></a><tt class="py-lineno">856</tt> <tt class="py-line"><tt class="py-docstring"> '47.136 -109.100'</tt> </tt>
909 <a name="L857"></a><tt class="py-lineno">857</tt> <tt class="py-line"><tt class="py-docstring"> '46.805 -114.051'</tt> </tt>
910 <a name="L858"></a><tt class="py-lineno">858</tt> <tt class="py-line"><tt class="py-docstring"> '46.262 -118.924'</tt> </tt>
911 <a name="L859"></a><tt class="py-lineno">859</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
912 <a name="L860"></a><tt class="py-lineno">860</tt> <tt class="py-line"> <tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt> <tt class="py-op">=</tt> <tt class="py-name">_proj</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="pyproj.Geod" class="py-name" href="#" onclick="return doclink('link-21', 'Geod', 'link-17');">Geod</a></tt><tt class="py-op">.</tt><tt class="py-name">_npts</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">,</tt> <tt class="py-name">lon1</tt><tt class="py-op">,</tt> <tt class="py-name">lat1</tt><tt class="py-op">,</tt> <tt class="py-name">lon2</tt><tt class="py-op">,</tt> <tt class="py-name">lat2</tt><tt class="py-op">,</tt> <tt id="link-22" class="py-name" targets="Method pyproj.Geod.npts()=pyproj.Geod-class.html#npts"><a title="pyproj.Geod.npts" class="py-name" href="#" onclick="return doclink('link-22', 'npts', 'link-22');">npts</a></tt><tt class="py-op">,</tt> <tt class="py-name">radians</tt><tt class="py-op">=</tt><tt class="py-name">radians</tt><tt class="py-op">)</tt> </tt>
913 <a name="L861"></a><tt class="py-lineno">861</tt> <tt class="py-line"> <tt class="py-keyword">return</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">zip</tt><tt class="py-op">(</tt><tt class="py-name">lons</tt><tt class="py-op">,</tt> <tt class="py-name">lats</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
914 </div></div><a name="L862"></a><tt class="py-lineno">862</tt> <tt class="py-line"> </tt>
915 <a name="test"></a><div id="test-def"><a name="L863"></a><tt class="py-lineno">863</tt> <a class="py-toggle" href="#" id="test-toggle" onclick="return toggle('test');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="pyproj-module.html#test">test</a><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
916 </div><div id="test-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="test-expanded"><a name="L864"></a><tt class="py-lineno">864</tt> <tt class="py-line"> <tt class="py-docstring">"""run the examples in the docstrings using the doctest module"""</tt> </tt>
917 <a name="L865"></a><tt class="py-lineno">865</tt> <tt class="py-line"> <tt class="py-keyword">import</tt> <tt class="py-name">doctest</tt><tt class="py-op">,</tt> <tt id="link-23" class="py-name"><a title="pyproj" class="py-name" href="#" onclick="return doclink('link-23', 'pyproj', 'link-0');">pyproj</a></tt> </tt>
918 <a name="L866"></a><tt class="py-lineno">866</tt> <tt class="py-line"> <tt class="py-name">doctest</tt><tt class="py-op">.</tt><tt class="py-name">testmod</tt><tt class="py-op">(</tt><tt id="link-24" class="py-name"><a title="pyproj" class="py-name" href="#" onclick="return doclink('link-24', 'pyproj', 'link-0');">pyproj</a></tt><tt class="py-op">,</tt><tt class="py-name">verbose</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
919 </div><a name="L867"></a><tt class="py-lineno">867</tt> <tt class="py-line"> </tt>
920 <a name="L868"></a><tt class="py-lineno">868</tt> <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">"__main__"</tt><tt class="py-op">:</tt> <tt id="link-25" class="py-name" targets="Function pyproj.test()=pyproj-module.html#test"><a title="pyproj.test" class="py-name" href="#" onclick="return doclink('link-25', 'test', 'link-25');">test</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
921 <a name="L869"></a><tt class="py-lineno">869</tt> <tt class="py-line"> </tt><script type="text/javascript">
917922 <!--
918923 expandto(location.href);
919924 // -->
946951 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
947952 <tr>
948953 <td align="left" class="footer">
949 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
954 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
950955 </td>
951956 <td align="right" class="footer">
952957 <a target="mainFrame" href="http://epydoc.sourceforge.net"
506506 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
507507 <tr>
508508 <td align="left" class="footer">
509 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
509 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
510510 </td>
511511 <td align="right" class="footer">
512512 <a target="mainFrame" href="http://epydoc.sourceforge.net"
137137 returns True if projection in geographic (lon/lat) coordinates</td>
138138 <td align="right" valign="top">
139139 <span class="codelink"><a href="pyproj-pysrc.html#Proj.is_latlong">source&nbsp;code</a></span>
140
141 </td>
142 </tr>
143 </table>
144
145 </td>
146 </tr>
147 <tr>
148 <td width="15%" align="right" valign="top" class="summary">
149 <span class="summary-type">&nbsp;</span>
150 </td><td class="summary">
151 <table width="100%" cellpadding="0" cellspacing="0" border="0">
152 <tr>
153 <td><span class="summary-sig"><a href="pyproj.Proj-class.html#to_latlong" class="summary-sig-name">to_latlong</a>(<span class="summary-sig-arg">self</span>)</span><br />
154 returns an equivalent Proj in the corresponding lon/lat coordinates.</td>
155 <td align="right" valign="top">
156 <span class="codelink"><a href="pyproj-pysrc.html#Proj.to_latlong">source&nbsp;code</a></span>
140157
141158 </td>
142159 </tr>
367384 </dl>
368385 </td></tr></table>
369386 </div>
387 <a name="to_latlong"></a>
388 <div>
389 <table class="details" border="1" cellpadding="3"
390 cellspacing="0" width="100%" bgcolor="white">
391 <tr><td>
392 <table width="100%" cellpadding="0" cellspacing="0" border="0">
393 <tr valign="top"><td>
394 <h3 class="epydoc"><span class="sig"><span class="sig-name">to_latlong</span>(<span class="sig-arg">self</span>)</span>
395 </h3>
396 </td><td align="right" valign="top"
397 ><span class="codelink"><a href="pyproj-pysrc.html#Proj.to_latlong">source&nbsp;code</a></span>&nbsp;
398 </td>
399 </tr></table>
400
401 <p>returns an equivalent Proj in the corresponding lon/lat coordinates.
402 (see pj_latlong_from_proj() in the Proj.4 C API)</p>
403 <dl class="fields">
404 <dt>Overrides:
405 <i>unreachable</i>.Proj.to_latlong
406 </dt>
407 </dl>
408 </td></tr></table>
409 </div>
370410 <br />
371411 <!-- ==================== NAVIGATION BAR ==================== -->
372412 <table class="navbar" border="0" width="100%" cellpadding="0"
394434 <table border="0" cellpadding="0" cellspacing="0" width="100%%">
395435 <tr>
396436 <td align="left" class="footer">
397 Generated by Epydoc 3.0.1 on Fri Jan 11 09:07:23 2013
437 Generated by Epydoc 3.0.1 on Mon Dec 29 15:13:06 2014
398438 </td>
399439 <td align="right" class="footer">
400440 <a target="mainFrame" href="http://epydoc.sourceforge.net"
2222 that support the Python buffer protocol (regular python and
2323 numpy array objects).
2424
25 Download: http://code.google.com/p/pyproj/downloads/list
25 Download: http://python.org/pypi/pyproj
2626
2727 Requirements: python 2.4 or higher.
2828
390390 outy = _convertback(yisfloat,yislist,xistuple,iny)
391391 return outx, outy
392392
393 def to_latlong(self):
394 """returns an equivalent Proj in the corresponding lon/lat
395 coordinates. (see pj_latlong_from_proj() in the Proj.4 C API)"""
396 return _proj.Proj.to_latlong(self)
397
393398 def is_latlong(self):
394399 """returns True if projection in geographic (lon/lat) coordinates"""
395400 return _proj.Proj.is_latlong(self)
302302 # Carthage
303303 <4223> +proj=longlat +datum=carthage +no_defs <>
304304 # Chua
305 <4224> +proj=longlat +ellps=intl +towgs84=-134,229,-29,0,0,0,0 +no_defs <>
305 <4224> +proj=longlat +ellps=intl +towgs84=-143.87,243.37,-33.52,0,0,0,0 +no_defs <>
306306 # Corrego Alegre 1970-72
307 <4225> +proj=longlat +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +no_defs <>
307 <4225> +proj=longlat +ellps=intl +towgs84=-205.57,168.77,-4.12,0,0,0,0 +no_defs <>
308308 # Cote d'Ivoire
309309 <4226> +proj=longlat +a=6378249.2 +b=6356515 +no_defs <>
310310 # Deir ez Zor
501501 <4470> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
502502 # Cadastre 1997
503503 <4475> +proj=longlat +ellps=intl +towgs84=-381.788,-57.501,-256.673,0,0,0,0 +no_defs <>
504 # Mexican Datum of 1993
504 # Mexico ITRF92
505505 <4483> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
506506 # China Geodetic Coordinate System 2000
507507 <4490> +proj=longlat +ellps=GRS80 +no_defs <>
546546 # NAD83(CSRS)
547547 <4617> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
548548 # SAD69
549 <4618> +proj=longlat +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +no_defs <>
549 <4618> +proj=longlat +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +no_defs <>
550550 # SWEREF99
551551 <4619> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
552552 # Point 58
735735 <4721> +proj=longlat +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0 +no_defs <>
736736 # South Georgia 1968
737737 <4722> +proj=longlat +ellps=intl +towgs84=-794,119,-298,0,0,0,0 +no_defs <>
738 # Grand Cayman 1959
739 <4723> +proj=longlat +ellps=clrk66 +towgs84=67.8,106.1,138.8,0,0,0,0 +no_defs <>
738 # GCGD59
739 <4723> +proj=longlat +ellps=clrk66 +towgs84=-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925 +no_defs <>
740740 # Diego Garcia 1969
741741 <4724> +proj=longlat +ellps=intl +towgs84=208,-435,-229,0,0,0,0 +no_defs <>
742742 # Johnston Island 1961
743743 <4725> +proj=longlat +ellps=intl +towgs84=189,-79,-202,0,0,0,0 +no_defs <>
744 # Little Cayman 1961
745 <4726> +proj=longlat +ellps=clrk66 +towgs84=42,124,147,0,0,0,0 +no_defs <>
744 # SIGD61
745 <4726> +proj=longlat +ellps=clrk66 +towgs84=8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081 +no_defs <>
746746 # Midway 1961
747747 <4727> +proj=longlat +ellps=intl +towgs84=403,-81,277,0,0,0,0 +no_defs <>
748748 # Pico de las Nieves 1984
884884 # SLD99
885885 <5233> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=-0.293,766.95,87.713,0.195704,1.69507,3.47302,-0.039338 +no_defs <>
886886 # GDBD2009
887 <5246> +proj=longlat +ellps=GRS80 +no_defs <>
887 <5246> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
888888 # TUREF
889889 <5252> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
890890 # DRUKREF 03
908908 # SIRGAS_ES2007.8
909909 <5393> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
910910 # Ocotepeque 1935
911 <5451> +proj=longlat +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +no_defs <>
911 <5451> +proj=longlat +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +no_defs <>
912912 # Sibun Gorge 1922
913913 <5464> +proj=longlat +a=6378293.645208759 +b=6356617.987679838 +no_defs <>
914914 # Panama-Colon 1911
918918 # Corrego Alegre 1961
919919 <5524> +proj=longlat +ellps=intl +no_defs <>
920920 # SAD69(96)
921 <5527> +proj=longlat +ellps=aust_SA +no_defs <>
921 <5527> +proj=longlat +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +no_defs <>
922922 # PNG94
923923 <5546> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
924 # Ukraine 2000
924 # UCS-2000
925925 <5561> +proj=longlat +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +no_defs <>
926926 # FEH2010
927927 <5593> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
928928 # DB_REF
929929 <5681> +proj=longlat +ellps=bessel +no_defs <>
930 # TGD2005
931 <5886> +proj=longlat +ellps=GRS80 +no_defs <>
932 # CIGD11
933 <6135> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
934 # Nepal 1981
935 <6207> +proj=longlat +a=6377276.345 +b=6356075.41314024 +towgs84=293.17,726.18,245.36,0,0,0,0 +no_defs <>
936 # NAD83(2011)
937 <6318> +proj=longlat +ellps=GRS80 +no_defs <>
938 # NAD83(PA11)
939 <6322> +proj=longlat +ellps=GRS80 +no_defs <>
940 # NAD83(MA11)
941 <6325> +proj=longlat +ellps=GRS80 +no_defs <>
942 # Mexico ITRF2008
943 <6365> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
944 # JGD2011
945 <6668> +proj=longlat +ellps=GRS80 +no_defs <>
946 # RDN2008
947 <6706> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <>
948 # NAD83(CORS96)
949 <6783> +proj=longlat +ellps=GRS80 +no_defs <>
930950 # Anguilla 1957 / British West Indies Grid
931951 <2000> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs <>
932952 # Antigua 1943 / British West Indies Grid
29082928 <2989> +proj=utm +zone=20 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
29092929 # Reunion 1947 / TM Reunion (deprecated)
29102930 <2990> +proj=tmerc +lat_0=-21.11666666666667 +lon_0=55.53333333333333 +k=1 +x_0=50000 +y_0=160000 +ellps=intl +towgs84=94,-948,-1262,0,0,0,0 +units=m +no_defs <>
2911 # NAD83 / Oregon Lambert
2931 # NAD83 / Oregon LCC (m)
29122932 <2991> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +datum=NAD83 +units=m +no_defs <>
2913 # NAD83 / Oregon Lambert (ft)
2933 # NAD83 / Oregon GIC Lambert (ft)
29142934 <2992> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +datum=NAD83 +units=ft +no_defs <>
2915 # NAD83(HARN) / Oregon Lambert
2935 # NAD83(HARN) / Oregon LCC (m)
29162936 <2993> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
2917 # NAD83(HARN) / Oregon Lambert (ft)
2937 # NAD83(HARN) / Oregon GIC Lambert (ft)
29182938 <2994> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs <>
29192939 # IGN53 Mare / UTM zone 58S
29202940 <2995> +proj=utm +zone=58 +south +ellps=intl +towgs84=287.58,177.78,-135.41,0,0,0,0 +units=m +no_defs <>
36453665 <3354> +proj=utm +zone=32 +south +ellps=intl +units=m +no_defs <>
36463666 # Egypt Gulf of Suez S-650 TL / Red Belt
36473667 <3355> +proj=tmerc +lat_0=30 +lon_0=31 +k=1 +x_0=615000 +y_0=810000 +ellps=helmert +towgs84=-146.21,112.63,4.05,0,0,0,0 +units=m +no_defs <>
3648 # Grand Cayman 1959 / UTM zone 17N
3649 <3356> +proj=utm +zone=17 +ellps=clrk66 +towgs84=67.8,106.1,138.8,0,0,0,0 +units=m +no_defs <>
3650 # Little Cayman 1961 / UTM zone 17N
3651 <3357> +proj=utm +zone=17 +ellps=clrk66 +towgs84=42,124,147,0,0,0,0 +units=m +no_defs <>
3668 # Grand Cayman 1959 / UTM zone 17N (deprecated)
3669 <3356> +proj=utm +zone=17 +ellps=clrk66 +towgs84=-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925 +units=m +no_defs <>
3670 # Little Cayman 1961 / UTM zone 17N (deprecated)
3671 <3357> +proj=utm +zone=17 +ellps=clrk66 +towgs84=8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081 +units=m +no_defs <>
36523672 # NAD83(HARN) / North Carolina
36533673 <3358> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
36543674 # NAD83(HARN) / North Carolina (ftUS) (deprecated)
37673787 <3415> +proj=lcc +lat_1=18 +lat_2=24 +lat_0=21 +lon_0=114 +x_0=500000 +y_0=500000 +ellps=WGS72 +towgs84=0,0,1.9,0,0,0.814,-0.38 +units=m +no_defs <>
37683788 # ETRS89 / Austria Lambert
37693789 <3416> +proj=lcc +lat_1=49 +lat_2=46 +lat_0=47.5 +lon_0=13.33333333333333 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
3770 # NAD83 / Iowa North (ft US)
3790 # NAD83 / Iowa North (ftUS)
37713791 <3417> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +datum=NAD83 +units=us-ft +no_defs <>
3772 # NAD83 / Iowa South (ft US)
3792 # NAD83 / Iowa South (ftUS)
37733793 <3418> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +datum=NAD83 +units=us-ft +no_defs <>
3774 # NAD83 / Kansas North (ft US)
3794 # NAD83 / Kansas North (ftUS)
37753795 <3419> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +datum=NAD83 +units=us-ft +no_defs <>
3776 # NAD83 / Kansas South (ft US)
3796 # NAD83 / Kansas South (ftUS)
37773797 <3420> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +datum=NAD83 +units=us-ft +no_defs <>
3778 # NAD83 / Nevada East (ft US)
3798 # NAD83 / Nevada East (ftUS)
37793799 <3421> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +datum=NAD83 +units=us-ft +no_defs <>
3780 # NAD83 / Nevada Central (ft US)
3800 # NAD83 / Nevada Central (ftUS)
37813801 <3422> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +datum=NAD83 +units=us-ft +no_defs <>
3782 # NAD83 / Nevada West (ft US)
3802 # NAD83 / Nevada West (ftUS)
37833803 <3423> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +datum=NAD83 +units=us-ft +no_defs <>
3784 # NAD83 / New Jersey (ft US)
3804 # NAD83 / New Jersey (ftUS)
37853805 <3424> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +datum=NAD83 +units=us-ft +no_defs <>
3786 # NAD83(HARN) / Iowa North (ft US)
3806 # NAD83(HARN) / Iowa North (ftUS)
37873807 <3425> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
3788 # NAD83(HARN) / Iowa South (ft US)
3808 # NAD83(HARN) / Iowa South (ftUS)
37893809 <3426> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
3790 # NAD83(HARN) / Kansas North (ft US)
3810 # NAD83(HARN) / Kansas North (ftUS)
37913811 <3427> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
3792 # NAD83(HARN) / Kansas South (ft US)
3812 # NAD83(HARN) / Kansas South (ftUS)
37933813 <3428> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
3794 # NAD83(HARN) / Nevada East (ft US)
3814 # NAD83(HARN) / Nevada East (ftUS)
37953815 <3429> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
3796 # NAD83(HARN) / Nevada Central (ft US)
3816 # NAD83(HARN) / Nevada Central (ftUS)
37973817 <3430> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
3798 # NAD83(HARN) / Nevada West (ft US)
3818 # NAD83(HARN) / Nevada West (ftUS)
37993819 <3431> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
3800 # NAD83(HARN) / New Jersey (ft US)
3820 # NAD83(HARN) / New Jersey (ftUS)
38013821 <3432> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
38023822 # NAD83 / Arkansas North (ftUS)
38033823 <3433> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +datum=NAD83 +units=us-ft +no_defs <>
40074027 <3535> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
40084028 # NAD83(NSRS2007) / Iowa North
40094029 <3536> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4010 # NAD83(NSRS2007) / Iowa North (ft US)
4030 # NAD83(NSRS2007) / Iowa North (ftUS)
40114031 <3537> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
40124032 # NAD83(NSRS2007) / Iowa South
40134033 <3538> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4014 # NAD83(NSRS2007) / Iowa South (ft US)
4034 # NAD83(NSRS2007) / Iowa South (ftUS)
40154035 <3539> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
40164036 # NAD83(NSRS2007) / Kansas North
40174037 <3540> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4018 # NAD83(NSRS2007) / Kansas North (ft US)
4038 # NAD83(NSRS2007) / Kansas North (ftUS)
40194039 <3541> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
40204040 # NAD83(NSRS2007) / Kansas South
40214041 <3542> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4022 # NAD83(NSRS2007) / Kansas South (ft US)
4042 # NAD83(NSRS2007) / Kansas South (ftUS)
40234043 <3543> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
40244044 # NAD83(NSRS2007) / Kentucky North
40254045 <3544> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
41494169 <3606> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
41504170 # NAD83(NSRS2007) / Nevada Central
41514171 <3607> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4152 # NAD83(NSRS2007) / Nevada Central (ft US)
4172 # NAD83(NSRS2007) / Nevada Central (ftUS)
41534173 <3608> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
41544174 # NAD83(NSRS2007) / Nevada East
41554175 <3609> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4156 # NAD83(NSRS2007) / Nevada East (ft US)
4176 # NAD83(NSRS2007) / Nevada East (ftUS)
41574177 <3610> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
41584178 # NAD83(NSRS2007) / Nevada West
41594179 <3611> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4160 # NAD83(NSRS2007) / Nevada West (ft US)
4180 # NAD83(NSRS2007) / Nevada West (ftUS)
41614181 <3612> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
41624182 # NAD83(NSRS2007) / New Hampshire
41634183 <3613> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
41654185 <3614> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
41664186 # NAD83(NSRS2007) / New Jersey
41674187 <3615> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4168 # NAD83(NSRS2007) / New Jersey (ft US)
4188 # NAD83(NSRS2007) / New Jersey (ftUS)
41694189 <3616> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
41704190 # NAD83(NSRS2007) / New Mexico Central
41714191 <3617> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
42194239 <3641> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
42204240 # NAD83(NSRS2007) / Oklahoma South (ftUS)
42214241 <3642> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
4222 # NAD83(NSRS2007) / Oregon Lambert
4242 # NAD83(NSRS2007) / Oregon LCC (m)
42234243 <3643> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4224 # NAD83(NSRS2007) / Oregon Lambert (ft)
4244 # NAD83(NSRS2007) / Oregon GIC Lambert (ft)
42254245 <3644> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs <>
42264246 # NAD83(NSRS2007) / Oregon North
42274247 <3645> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
47414761 # RGRDC 2005 / UTM zone 35S
47424762 <4063> +proj=utm +zone=35 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
47434763 # Chua / UTM zone 23S
4744 <4071> +proj=utm +zone=23 +south +ellps=intl +towgs84=-134,229,-29,0,0,0,0 +units=m +no_defs <>
4764 <4071> +proj=utm +zone=23 +south +ellps=intl +towgs84=-143.87,243.37,-33.52,0,0,0,0 +units=m +no_defs <>
47454765 # REGCAN95 / UTM zone 27N
47464766 <4082> +proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
47474767 # REGCAN95 / UTM zone 28N
48484868 <4467> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
48494869 # RGM04 / UTM zone 38S
48504870 <4471> +proj=utm +zone=38 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4851 # Cadastre 1997 / UTM zone 38S
4871 # Cadastre 1997 / UTM zone 38S (deprecated)
48524872 <4474> +proj=utm +zone=38 +south +ellps=intl +towgs84=-382,-59,-262,0,0,0,0 +units=m +no_defs <>
4853 # Mexican Datum of 1993 / UTM zone 11N
4873 # Mexico ITRF92 / UTM zone 11N
48544874 <4484> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4855 # Mexican Datum of 1993 / UTM zone 12N
4875 # Mexico ITRF92 / UTM zone 12N
48564876 <4485> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4857 # Mexican Datum of 1993 / UTM zone 13N
4877 # Mexico ITRF92 / UTM zone 13N
48584878 <4486> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4859 # Mexican Datum of 1993 / UTM zone 14N
4879 # Mexico ITRF92 / UTM zone 14N
48604880 <4487> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4861 # Mexican Datum of 1993 / UTM zone 15N
4881 # Mexico ITRF92 / UTM zone 15N
48624882 <4488> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
4863 # Mexican Datum of 1993 / UTM zone 16N
4883 # Mexico ITRF92 / UTM zone 16N
48644884 <4489> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
48654885 # CGCS2000 / Gauss-Kruger zone 13
48664886 <4491> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
53165336 # ETRS89 / LCC Germany (E-N)
53175337 <5243> +proj=lcc +lat_1=48.66666666666666 +lat_2=53.66666666666666 +lat_0=51 +lon_0=10.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
53185338 # GDBD2009 / Brunei BRSO
5319 <5247> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +units=m +no_defs <>
5339 <5247> +proj=omerc +lat_0=4 +lonc=115 +alpha=53.31580995 +k=0.99984 +x_0=0 +y_0=0 +no_uoff +gamma=53.13010236111111 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
53205340 # TUREF / TM27
53215341 <5253> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
53225342 # TUREF / TM30
54425462 # SIRGAS 2000 / UTM zone 26S
54435463 <5396> +proj=utm +zone=26 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
54445464 # Ocotepeque 1935 / Costa Rica Norte
5445 <5456> +proj=lcc +lat_1=10.46666666666667 +lat_0=10.46666666666667 +lon_0=-84.33333333333333 +k_0=0.99995696 +x_0=500000 +y_0=271820.522 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs <>
5465 <5456> +proj=lcc +lat_1=10.46666666666667 +lat_0=10.46666666666667 +lon_0=-84.33333333333333 +k_0=0.99995696 +x_0=500000 +y_0=271820.522 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs <>
54465466 # Ocotepeque 1935 / Costa Rica Sur
5447 <5457> +proj=lcc +lat_1=9 +lat_0=9 +lon_0=-83.66666666666667 +k_0=0.99995696 +x_0=500000 +y_0=327987.436 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs <>
5467 <5457> +proj=lcc +lat_1=9 +lat_0=9 +lon_0=-83.66666666666667 +k_0=0.99995696 +x_0=500000 +y_0=327987.436 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs <>
54485468 # Ocotepeque 1935 / Guatemala Norte (deprecated)
54495469 <5458> +proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +datum=NAD27 +units=m +no_defs <>
54505470 # Ocotepeque 1935 / Guatemala Sur
5451 <5459> +proj=lcc +lat_1=14.9 +lat_0=14.9 +lon_0=-90.33333333333333 +k_0=0.99989906 +x_0=500000 +y_0=325992.681 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs <>
5471 <5459> +proj=lcc +lat_1=14.9 +lat_0=14.9 +lon_0=-90.33333333333333 +k_0=0.99989906 +x_0=500000 +y_0=325992.681 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs <>
54525472 # Ocotepeque 1935 / El Salvador Lambert
5453 <5460> +proj=lcc +lat_1=13.78333333333333 +lat_0=13.78333333333333 +lon_0=-89 +k_0=0.99996704 +x_0=500000 +y_0=295809.184 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs <>
5473 <5460> +proj=lcc +lat_1=13.78333333333333 +lat_0=13.78333333333333 +lon_0=-89 +k_0=0.99996704 +x_0=500000 +y_0=295809.184 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs <>
54545474 # Ocotepeque 1935 / Nicaragua Norte
5455 <5461> +proj=lcc +lat_1=13.86666666666667 +lat_0=13.86666666666667 +lon_0=-85.5 +k_0=0.99990314 +x_0=500000 +y_0=359891.816 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs <>
5475 <5461> +proj=lcc +lat_1=13.86666666666667 +lat_0=13.86666666666667 +lon_0=-85.5 +k_0=0.99990314 +x_0=500000 +y_0=359891.816 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs <>
54565476 # Ocotepeque 1935 / Nicaragua Sur
5457 <5462> +proj=lcc +lat_1=11.73333333333333 +lat_0=11.73333333333333 +lon_0=-85.5 +k_0=0.9999222800000001 +x_0=500000 +y_0=288876.327 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs <>
5477 <5462> +proj=lcc +lat_1=11.73333333333333 +lat_0=11.73333333333333 +lon_0=-85.5 +k_0=0.9999222800000001 +x_0=500000 +y_0=288876.327 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs <>
54585478 # SAD69 / UTM zone 17N
5459 <5463> +proj=utm +zone=17 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
5479 <5463> +proj=utm +zone=17 +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
54605480 # Sibun Gorge 1922 / Colony Grid (deprecated)
54615481 <5466> +proj=tmerc +lat_0=17.06124194444444 +lon_0=-88.6318575 +k=1 +x_0=66220.02833082761 +y_0=135779.5099885299 +a=6378293.645208759 +b=6356617.987679838 +units=m +no_defs <>
54625482 # Panama-Colon 1911 / Panama Lambert
54925512 # WGS 84 / Gabon TM 2011
54935513 <5523> +proj=tmerc +lat_0=0 +lon_0=11.5 +k=0.9996 +x_0=1500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
54945514 # SAD69(96) / Brazil Polyconic
5495 <5530> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +units=m +no_defs <>
5515 <5530> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
54965516 # SAD69(96) / UTM zone 21S
5497 <5531> +proj=utm +zone=21 +south +ellps=aust_SA +units=m +no_defs <>
5517 <5531> +proj=utm +zone=21 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
54985518 # SAD69(96) / UTM zone 22S (deprecated)
5499 <5532> +proj=utm +zone=22 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
5519 <5532> +proj=utm +zone=22 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
55005520 # SAD69(96) / UTM zone 23S
5501 <5533> +proj=utm +zone=23 +south +ellps=aust_SA +units=m +no_defs <>
5521 <5533> +proj=utm +zone=23 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
55025522 # SAD69(96) / UTM zone 24S
5503 <5534> +proj=utm +zone=24 +south +ellps=aust_SA +units=m +no_defs <>
5523 <5534> +proj=utm +zone=24 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
55045524 # SAD69(96) / UTM zone 25S
5505 <5535> +proj=utm +zone=25 +south +ellps=aust_SA +units=m +no_defs <>
5525 <5535> +proj=utm +zone=25 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
55065526 # Corrego Alegre 1961 / UTM zone 21S
55075527 <5536> +proj=utm +zone=21 +south +ellps=intl +units=m +no_defs <>
55085528 # Corrego Alegre 1961 / UTM zone 22S
55185538 # PNG94 / PNGMG94 zone 56
55195539 <5552> +proj=utm +zone=56 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
55205540 # Ocotepeque 1935 / Guatemala Norte
5521 <5559> +proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +ellps=clrk66 +towgs84=213.11,9.37,-74.95,0,0,0,0 +units=m +no_defs <>
5522 # Ukraine 2000 / Gauss-Kruger zone 4
5541 <5559> +proj=lcc +lat_1=16.81666666666667 +lat_0=16.81666666666667 +lon_0=-90.33333333333333 +k_0=0.99992226 +x_0=500000 +y_0=292209.579 +ellps=clrk66 +towgs84=205,96,-98,0,0,0,0 +units=m +no_defs <>
5542 # UCS-2000 / Gauss-Kruger zone 4
55235543 <5562> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5524 # Ukraine 2000 / Gauss-Kruger zone 5
5544 # UCS-2000 / Gauss-Kruger zone 5
55255545 <5563> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=5500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5526 # Ukraine 2000 / Gauss-Kruger zone 6
5546 # UCS-2000 / Gauss-Kruger zone 6
55275547 <5564> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=6500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5528 # Ukraine 2000 / Gauss-Kruger zone 7
5548 # UCS-2000 / Gauss-Kruger zone 7
55295549 <5565> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5530 # Ukraine 2000 / Gauss-Kruger CM 21E
5550 # UCS-2000 / Gauss-Kruger CM 21E
55315551 <5566> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5532 # Ukraine 2000 / Gauss-Kruger CM 27E
5552 # UCS-2000 / Gauss-Kruger CM 27E
55335553 <5567> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5534 # Ukraine 2000 / Gauss-Kruger CM 33E
5554 # UCS-2000 / Gauss-Kruger CM 33E
55355555 <5568> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5536 # Ukraine 2000 / Gauss-Kruger CM 39E
5556 # UCS-2000 / Gauss-Kruger CM 39E
55375557 <5569> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5538 # Ukraine 2000 / 3-degree Gauss-Kruger zone 7
5558 # UCS-2000 / 3-degree Gauss-Kruger zone 7 (deprecated)
55395559 <5570> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=7500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5540 # Ukraine 2000 / 3-degree Gauss-Kruger zone 8
5560 # UCS-2000 / 3-degree Gauss-Kruger zone 8 (deprecated)
55415561 <5571> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=8500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5542 # Ukraine 2000 / 3-degree Gauss-Kruger zone 9
5562 # UCS-2000 / 3-degree Gauss-Kruger zone 9 (deprecated)
55435563 <5572> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=9500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5544 # Ukraine 2000 / 3-degree Gauss-Kruger zone 10
5564 # UCS-2000 / 3-degree Gauss-Kruger zone 10 (deprecated)
55455565 <5573> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=10500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5546 # Ukraine 2000 / 3-degree Gauss-Kruger zone 11
5566 # UCS-2000 / 3-degree Gauss-Kruger zone 11 (deprecated)
55475567 <5574> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=11500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5548 # Ukraine 2000 / 3-degree Gauss-Kruger zone 12
5568 # UCS-2000 / 3-degree Gauss-Kruger zone 12 (deprecated)
55495569 <5575> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=12500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5550 # Ukraine 2000 / 3-degree Gauss-Kruger zone 13
5570 # UCS-2000 / 3-degree Gauss-Kruger zone 13 (deprecated)
55515571 <5576> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=13500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5552 # Ukraine 2000 / 3-degree Gauss-Kruger CM 21E
5572 # UCS-2000 / 3-degree Gauss-Kruger CM 21E (deprecated)
55535573 <5577> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5554 # Ukraine 2000 / 3-degree Gauss-Kruger CM 24E
5574 # UCS-2000 / 3-degree Gauss-Kruger CM 24E (deprecated)
55555575 <5578> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5556 # Ukraine 2000 / 3-degree Gauss-Kruger CM 27E
5576 # UCS-2000 / 3-degree Gauss-Kruger CM 27E (deprecated)
55575577 <5579> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5558 # Ukraine 2000 / 3-degree Gauss-Kruger CM 30E
5578 # UCS-2000 / 3-degree Gauss-Kruger CM 30E (deprecated)
55595579 <5580> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5560 # Ukraine 2000 / 3-degree Gauss-Kruger CM 33E
5580 # UCS-2000 / 3-degree Gauss-Kruger CM 33E (deprecated)
55615581 <5581> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5562 # Ukraine 2000 / 3-degree Gauss-Kruger CM 36E
5582 # UCS-2000 / 3-degree Gauss-Kruger CM 36E (deprecated)
55635583 <5582> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
5564 # Ukraine 2000 / 3-degree Gauss-Kruger CM 39E
5584 # UCS-2000 / 3-degree Gauss-Kruger CM 39E (deprecated)
55655585 <5583> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=500000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
55665586 # NAD27 / New Brunswick Stereographic (NAD27)
55675587 <5588> +proj=sterea +lat_0=46.5 +lon_0=-66.5 +k=0.999912 +x_0=304800 +y_0=304800 +datum=NAD27 +units=ft +no_defs <>
56895709 # RGRDC 2005 / Congo TM zone 30
56905710 <5844> +proj=tmerc +lat_0=0 +lon_0=30 +k=0.9999 +x_0=500000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
56915711 # SAD69(96) / UTM zone 22S
5692 <5858> +proj=utm +zone=22 +south +ellps=aust_SA +units=m +no_defs <>
5712 <5858> +proj=utm +zone=22 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
5713 # SAD69(96) / UTM zone 18S
5714 <5875> +proj=utm +zone=18 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
5715 # SAD69(96) / UTM zone 19S
5716 <5876> +proj=utm +zone=19 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
5717 # SAD69(96) / UTM zone 20S
5718 <5877> +proj=utm +zone=20 +south +ellps=aust_SA +towgs84=-67.35,3.88,-38.22,0,0,0,0 +units=m +no_defs <>
5719 # Cadastre 1997 / UTM zone 38S
5720 <5879> +proj=utm +zone=38 +south +ellps=intl +towgs84=-381.788,-57.501,-256.673,0,0,0,0 +units=m +no_defs <>
5721 # SIRGAS 2000 / Brazil Polyconic
5722 <5880> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5723 # TGD2005 / Tonga Map Grid
5724 <5887> +proj=tmerc +lat_0=0 +lon_0=-177 +k=0.9996 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +units=m +no_defs <>
5725 # JAXA Snow Depth Polar Stereographic North
5726 <5890> +proj=stere +lat_0=90 +lat_ts=70 +lon_0=90 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.449 +units=m +no_defs <>
5727 # WGS 84 / EPSG Arctic Regional zone A1
5728 <5921> +proj=lcc +lat_1=85 +lat_2=77 +lat_0=81.31722600000001 +lon_0=-111 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5729 # WGS 84 / EPSG Arctic Regional zone A2
5730 <5922> +proj=lcc +lat_1=85 +lat_2=77 +lat_0=81.31722600000001 +lon_0=-39 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5731 # WGS 84 / EPSG Arctic Regional zone A3
5732 <5923> +proj=lcc +lat_1=85 +lat_2=77 +lat_0=81.31722600000001 +lon_0=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5733 # WGS 84 / EPSG Arctic Regional zone A4
5734 <5924> +proj=lcc +lat_1=85 +lat_2=77 +lat_0=81.31722600000001 +lon_0=105 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5735 # WGS 84 / EPSG Arctic Regional zone A5
5736 <5925> +proj=lcc +lat_1=85 +lat_2=77 +lat_0=81.31722600000001 +lon_0=177 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5737 # WGS 84 / EPSG Arctic Regional zone B1
5738 <5926> +proj=lcc +lat_1=77 +lat_2=69 +lat_0=73.15574086111111 +lon_0=-111 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5739 # WGS 84 / EPSG Arctic Regional zone B2
5740 <5927> +proj=lcc +lat_1=77 +lat_2=69 +lat_0=73.15574086111111 +lon_0=-39 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5741 # WGS 84 / EPSG Arctic Regional zone B3
5742 <5928> +proj=lcc +lat_1=77 +lat_2=69 +lat_0=73.15574086111111 +lon_0=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5743 # WGS 84 / EPSG Arctic Regional zone B4
5744 <5929> +proj=lcc +lat_1=77 +lat_2=69 +lat_0=73.15574086111111 +lon_0=105 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5745 # WGS 84 / EPSG Arctic Regional zone B5
5746 <5930> +proj=lcc +lat_1=77 +lat_2=69 +lat_0=73.15574086111111 +lon_0=177 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5747 # WGS 84 / EPSG Arctic Regional zone C1
5748 <5931> +proj=lcc +lat_1=69 +lat_2=61 +lat_0=65.10127088888888 +lon_0=-111 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5749 # WGS 84 / EPSG Arctic Regional zone C2
5750 <5932> +proj=lcc +lat_1=69 +lat_2=61 +lat_0=65.10127088888888 +lon_0=-39 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5751 # WGS 84 / EPSG Arctic Regional zone C3
5752 <5933> +proj=lcc +lat_1=69 +lat_2=61 +lat_0=65.10127088888888 +lon_0=33 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5753 # WGS 84 / EPSG Arctic Regional zone C4
5754 <5934> +proj=lcc +lat_1=69 +lat_2=61 +lat_0=65.10127088888888 +lon_0=105 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5755 # WGS 84 / EPSG Arctic Regional zone C5
5756 <5935> +proj=lcc +lat_1=69 +lat_2=61 +lat_0=65.10127088888888 +lon_0=177 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs <>
5757 # WGS 84 / EPSG Alaska Polar Stereographic
5758 <5936> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=-150 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs <>
5759 # WGS 84 / EPSG Canada Polar Stereographic
5760 <5937> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=-100 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs <>
5761 # WGS 84 / EPSG Greenland Polar Stereographic
5762 <5938> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=-33 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs <>
5763 # WGS 84 / EPSG Norway Polar Stereographic
5764 <5939> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=18 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs <>
5765 # WGS 84 / EPSG Russia Polar Stereographic
5766 <5940> +proj=stere +lat_0=90 +lat_ts=90 +lon_0=105 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs <>
5767 # GR96 / EPSG Arctic zone 1-25
5768 <6050> +proj=lcc +lat_1=87 +lat_2=83.66666666666667 +lat_0=85.43711833333333 +lon_0=-30 +x_0=25500000 +y_0=1500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5769 # GR96 / EPSG Arctic zone 2-18
5770 <6051> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=-52 +x_0=18500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5771 # GR96 / EPSG Arctic zone 2-20
5772 <6052> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=-12 +x_0=20500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5773 # GR96 / EPSG Arctic zone 3-29
5774 <6053> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=-69 +x_0=29500000 +y_0=3500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5775 # GR96 / EPSG Arctic zone 3-31
5776 <6054> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=-39 +x_0=31500000 +y_0=3500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5777 # GR96 / EPSG Arctic zone 3-33
5778 <6055> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=-10 +x_0=33500000 +y_0=3500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5779 # GR96 / EPSG Arctic zone 4-20
5780 <6056> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=-64 +x_0=20500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5781 # GR96 / EPSG Arctic zone 4-22
5782 <6057> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=-39 +x_0=22500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5783 # GR96 / EPSG Arctic zone 4-24
5784 <6058> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=-14 +x_0=24500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5785 # GR96 / EPSG Arctic zone 5-41
5786 <6059> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-62 +x_0=41500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5787 # GR96 / EPSG Arctic zone 5-43
5788 <6060> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-42 +x_0=43500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5789 # GR96 / EPSG Arctic zone 5-45
5790 <6061> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-22 +x_0=45500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5791 # GR96 / EPSG Arctic zone 6-26
5792 <6062> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-56 +x_0=26500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5793 # GR96 / EPSG Arctic zone 6-28
5794 <6063> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-38 +x_0=28500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5795 # GR96 / EPSG Arctic zone 6-30
5796 <6064> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-20 +x_0=30500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5797 # GR96 / EPSG Arctic zone 7-11
5798 <6065> +proj=lcc +lat_1=67 +lat_2=63.66666666666666 +lat_0=65.35103930555555 +lon_0=-51 +x_0=11500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5799 # GR96 / EPSG Arctic zone 7-13
5800 <6066> +proj=lcc +lat_1=67 +lat_2=63.66666666666666 +lat_0=65.35103930555555 +lon_0=-34 +x_0=13500000 +y_0=7500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5801 # GR96 / EPSG Arctic zone 8-20
5802 <6067> +proj=lcc +lat_1=63.66666666666666 +lat_2=60.33333333333334 +lat_0=62.01530688888889 +lon_0=-52 +x_0=20500000 +y_0=8500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5803 # GR96 / EPSG Arctic zone 8-22
5804 <6068> +proj=lcc +lat_1=63.66666666666666 +lat_2=60.33333333333334 +lat_0=62.01530688888889 +lon_0=-37 +x_0=22500000 +y_0=8500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5805 # ETRS89 / EPSG Arctic zone 2-22
5806 <6069> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=16 +x_0=22500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5807 # ETRS89 / EPSG Arctic zone 3-11
5808 <6070> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=21 +x_0=11500000 +y_0=3500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5809 # ETRS89 / EPSG Arctic zone 4-26
5810 <6071> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=10 +x_0=26500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5811 # ETRS89 / EPSG Arctic zone 4-28
5812 <6072> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=34 +x_0=28500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5813 # ETRS89 / EPSG Arctic zone 5-11
5814 <6073> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=14 +x_0=11500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5815 # ETRS89 / EPSG Arctic zone 5-13
5816 <6074> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=34 +x_0=13500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5817 # WGS 84 / EPSG Arctic zone 2-24
5818 <6075> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=53 +x_0=24500000 +y_0=2500000 +datum=WGS84 +units=m +no_defs <>
5819 # WGS 84 / EPSG Arctic zone 2-26
5820 <6076> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=93 +x_0=26500000 +y_0=2500000 +datum=WGS84 +units=m +no_defs <>
5821 # WGS 84 / EPSG Arctic zone 3-13
5822 <6077> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=52 +x_0=13500000 +y_0=3500000 +datum=WGS84 +units=m +no_defs <>
5823 # WGS 84 / EPSG Arctic zone 3-15
5824 <6078> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=83 +x_0=15500000 +y_0=3500000 +datum=WGS84 +units=m +no_defs <>
5825 # WGS 84 / EPSG Arctic zone 3-17
5826 <6079> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=114 +x_0=17500000 +y_0=3500000 +datum=WGS84 +units=m +no_defs <>
5827 # WGS 84 / EPSG Arctic zone 3-19
5828 <6080> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=145 +x_0=19500000 +y_0=3500000 +datum=WGS84 +units=m +no_defs <>
5829 # WGS 84 / EPSG Arctic zone 4-30
5830 <6081> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=58 +x_0=30500000 +y_0=4500000 +datum=WGS84 +units=m +no_defs <>
5831 # WGS 84 / EPSG Arctic zone 4-32
5832 <6082> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=82 +x_0=32500000 +y_0=4500000 +datum=WGS84 +units=m +no_defs <>
5833 # WGS 84 / EPSG Arctic zone 4-34
5834 <6083> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=106 +x_0=34500000 +y_0=4500000 +datum=WGS84 +units=m +no_defs <>
5835 # WGS 84 / EPSG Arctic zone 4-36
5836 <6084> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=130 +x_0=36500000 +y_0=4500000 +datum=WGS84 +units=m +no_defs <>
5837 # WGS 84 / EPSG Arctic zone 4-38
5838 <6085> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=154 +x_0=38500000 +y_0=4500000 +datum=WGS84 +units=m +no_defs <>
5839 # WGS 84 / EPSG Arctic zone 4-40
5840 <6086> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=179 +x_0=40500000 +y_0=4500000 +datum=WGS84 +units=m +no_defs <>
5841 # WGS 84 / EPSG Arctic zone 5-15
5842 <6087> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=54 +x_0=15500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
5843 # WGS 84 / EPSG Arctic zone 5-17
5844 <6088> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=74 +x_0=17500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
5845 # WGS 84 / EPSG Arctic zone 5-19
5846 <6089> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=95 +x_0=19500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
5847 # WGS 84 / EPSG Arctic zone 5-21
5848 <6090> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=116 +x_0=21500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
5849 # WGS 84 / EPSG Arctic zone 5-23
5850 <6091> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=137 +x_0=23500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
5851 # WGS 84 / EPSG Arctic zone 5-25
5852 <6092> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=158 +x_0=25500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
5853 # WGS 84 / EPSG Arctic zone 5-27
5854 <6093> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=179 +x_0=27500000 +y_0=5500000 +datum=WGS84 +units=m +no_defs <>
5855 # NAD83(NSRS2007) / EPSG Arctic zone 5-29
5856 <6094> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-163 +x_0=29500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5857 # NAD83(NSRS2007) / EPSG Arctic zone 5-31
5858 <6095> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-147 +x_0=31500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5859 # NAD83(NSRS2007) / EPSG Arctic zone 6-14
5860 <6096> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-165 +x_0=14500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5861 # NAD83(NSRS2007) / EPSG Arctic zone 6-16
5862 <6097> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-147 +x_0=16500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5863 # NAD83(CSRS) / EPSG Arctic zone 1-23
5864 <6098> +proj=lcc +lat_1=87 +lat_2=83.66666666666667 +lat_0=85.43711833333333 +lon_0=-90 +x_0=23500000 +y_0=1500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5865 # NAD83(CSRS) / EPSG Arctic zone 2-14
5866 <6099> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=-115 +x_0=14500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5867 # NAD83(CSRS) / EPSG Arctic zone 2-16
5868 <6100> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=-75 +x_0=16500000 +y_0=2500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5869 # NAD83(CSRS) / EPSG Arctic zone 3-25
5870 <6101> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=-129 +x_0=25500000 +y_0=3500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5871 # NAD83(CSRS) / EPSG Arctic zone 3-27
5872 <6102> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=-99 +x_0=27500000 +y_0=3500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5873 # NAD83(CSRS) / EPSG Arctic zone 3-29
5874 <6103> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=-69 +x_0=29500000 +y_0=3500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5875 # NAD83(CSRS) / EPSG Arctic zone 4-14
5876 <6104> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=-129 +x_0=14500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5877 # NAD83(CSRS) / EPSG Arctic zone 4-16
5878 <6105> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=-104 +x_0=16500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5879 # NAD83(CSRS) / EPSG Arctic zone 4-18
5880 <6106> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=-79 +x_0=18500000 +y_0=4500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5881 # NAD83(CSRS) / EPSG Arctic zone 5-33
5882 <6107> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-131 +x_0=33500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5883 # NAD83(CSRS) / EPSG Arctic zone 5-35
5884 <6108> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-111 +x_0=35500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5885 # NAD83(CSRS) / EPSG Arctic zone 5-37
5886 <6109> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-91 +x_0=37500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5887 # NAD83(CSRS) / EPSG Arctic zone 5-39
5888 <6110> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-71 +x_0=39500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5889 # NAD83(CSRS) / EPSG Arctic zone 6-18
5890 <6111> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-132 +x_0=18500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5891 # NAD83(CSRS) / EPSG Arctic zone 6-20
5892 <6112> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-113 +x_0=20500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5893 # NAD83(CSRS) / EPSG Arctic zone 6-22
5894 <6113> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-94 +x_0=22500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5895 # NAD83(CSRS) / EPSG Arctic zone 6-24
5896 <6114> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-75 +x_0=24500000 +y_0=6500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5897 # WGS 84 / EPSG Arctic zone 1-27
5898 <6115> +proj=lcc +lat_1=87 +lat_2=83.66666666666667 +lat_0=85.43711833333333 +lon_0=30 +x_0=27500000 +y_0=1500000 +datum=WGS84 +units=m +no_defs <>
5899 # WGS 84 / EPSG Arctic zone 1-29
5900 <6116> +proj=lcc +lat_1=87 +lat_2=83.66666666666667 +lat_0=85.43711833333333 +lon_0=90 +x_0=29500000 +y_0=1500000 +datum=WGS84 +units=m +no_defs <>
5901 # WGS 84 / EPSG Arctic zone 1-31
5902 <6117> +proj=lcc +lat_1=87 +lat_2=83.66666666666667 +lat_0=85.43711833333333 +lon_0=150 +x_0=31500000 +y_0=1500000 +datum=WGS84 +units=m +no_defs <>
5903 # WGS 84 / EPSG Arctic zone 1-21
5904 <6118> +proj=lcc +lat_1=87 +lat_2=83.66666666666667 +lat_0=85.43711833333333 +lon_0=-150 +x_0=21500000 +y_0=1500000 +datum=WGS84 +units=m +no_defs <>
5905 # WGS 84 / EPSG Arctic zone 2-28
5906 <6119> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=133 +x_0=28500000 +y_0=2500000 +datum=WGS84 +units=m +no_defs <>
5907 # WGS 84 / EPSG Arctic zone 2-10
5908 <6120> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=166 +x_0=10500000 +y_0=2500000 +datum=WGS84 +units=m +no_defs <>
5909 # WGS 84 / EPSG Arctic zone 2-12
5910 <6121> +proj=lcc +lat_1=83.66666666666667 +lat_2=80.33333333333333 +lat_0=82.05842488888888 +lon_0=-154 +x_0=12500000 +y_0=2500000 +datum=WGS84 +units=m +no_defs <>
5911 # WGS 84 / EPSG Arctic zone 3-21
5912 <6122> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=176 +x_0=21500000 +y_0=3500000 +datum=WGS84 +units=m +no_defs <>
5913 # WGS 84 / EPSG Arctic zone 3-23
5914 <6123> +proj=lcc +lat_1=80.33333333333333 +lat_2=77 +lat_0=78.70733752777778 +lon_0=-153 +x_0=23500000 +y_0=3500000 +datum=WGS84 +units=m +no_defs <>
5915 # WGS 84 / EPSG Arctic zone 4-12
5916 <6124> +proj=lcc +lat_1=77 +lat_2=73.66666666666667 +lat_0=75.36440330555556 +lon_0=-155 +x_0=12500000 +y_0=4500000 +datum=WGS84 +units=m +no_defs <>
5917 # ETRS89 / EPSG Arctic zone 5-47
5918 <6125> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-5 +x_0=47500000 +y_0=5500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5919 # Grand Cayman National Grid 1959
5920 <6128> +proj=utm +zone=17 +ellps=clrk66 +towgs84=-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925 +units=ft +no_defs <>
5921 # Sister Islands National Grid 1961
5922 <6129> +proj=utm +zone=17 +ellps=clrk66 +towgs84=8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081 +units=ft +no_defs <>
5923 # Cayman Islands National Grid 2011 (deprecated)
5924 <6141> +proj=lcc +lat_1=19.33333333333333 +lat_2=19.7 +lat_0=19.33333333333333 +lon_0=80.56666666666666 +x_0=899160 +y_0=579120 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs <>
5925 # NAD27 / Michigan North
5926 # Unable to translate coordinate system EPSG:6200 into PROJ.4 format.
5927 #
5928 # NAD27 / Michigan Central
5929 # Unable to translate coordinate system EPSG:6201 into PROJ.4 format.
5930 #
5931 # NAD27 / Michigan South
5932 # Unable to translate coordinate system EPSG:6202 into PROJ.4 format.
5933 #
5934 # Macedonian State Coordinate System
5935 <6204> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=500000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs <>
5936 # SIRGAS 2000 / UTM zone 23N
5937 <6210> +proj=utm +zone=23 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5938 # SIRGAS 2000 / UTM zone 24N
5939 <6211> +proj=utm +zone=24 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
5940 # MAGNA-SIRGAS / Arauca urban grid
5941 # Unable to translate coordinate system EPSG:6244 into PROJ.4 format.
5942 #
5943 # MAGNA-SIRGAS / Armenia urban grid
5944 # Unable to translate coordinate system EPSG:6245 into PROJ.4 format.
5945 #
5946 # MAGNA-SIRGAS / Barranquilla urban grid
5947 # Unable to translate coordinate system EPSG:6246 into PROJ.4 format.
5948 #
5949 # MAGNA-SIRGAS / Bogota urban grid
5950 # Unable to translate coordinate system EPSG:6247 into PROJ.4 format.
5951 #
5952 # MAGNA-SIRGAS / Bucaramanga urban grid
5953 # Unable to translate coordinate system EPSG:6248 into PROJ.4 format.
5954 #
5955 # MAGNA-SIRGAS / Cali urban grid
5956 # Unable to translate coordinate system EPSG:6249 into PROJ.4 format.
5957 #
5958 # MAGNA-SIRGAS / Cartagena urban grid
5959 # Unable to translate coordinate system EPSG:6250 into PROJ.4 format.
5960 #
5961 # MAGNA-SIRGAS / Cucuta urban grid
5962 # Unable to translate coordinate system EPSG:6251 into PROJ.4 format.
5963 #
5964 # MAGNA-SIRGAS / Florencia urban grid
5965 # Unable to translate coordinate system EPSG:6252 into PROJ.4 format.
5966 #
5967 # MAGNA-SIRGAS / Ibague urban grid
5968 # Unable to translate coordinate system EPSG:6253 into PROJ.4 format.
5969 #
5970 # MAGNA-SIRGAS / Inirida urban grid
5971 # Unable to translate coordinate system EPSG:6254 into PROJ.4 format.
5972 #
5973 # MAGNA-SIRGAS / Leticia urban grid
5974 # Unable to translate coordinate system EPSG:6255 into PROJ.4 format.
5975 #
5976 # MAGNA-SIRGAS / Manizales urban grid
5977 # Unable to translate coordinate system EPSG:6256 into PROJ.4 format.
5978 #
5979 # MAGNA-SIRGAS / Medellin urban grid
5980 # Unable to translate coordinate system EPSG:6257 into PROJ.4 format.
5981 #
5982 # MAGNA-SIRGAS / Mitu urban grid
5983 # Unable to translate coordinate system EPSG:6258 into PROJ.4 format.
5984 #
5985 # MAGNA-SIRGAS / Mocoa urban grid
5986 # Unable to translate coordinate system EPSG:6259 into PROJ.4 format.
5987 #
5988 # MAGNA-SIRGAS / Monteria urban grid
5989 # Unable to translate coordinate system EPSG:6260 into PROJ.4 format.
5990 #
5991 # MAGNA-SIRGAS / Neiva urban grid
5992 # Unable to translate coordinate system EPSG:6261 into PROJ.4 format.
5993 #
5994 # MAGNA-SIRGAS / Pasto urban grid
5995 # Unable to translate coordinate system EPSG:6262 into PROJ.4 format.
5996 #
5997 # MAGNA-SIRGAS / Pereira urban grid
5998 # Unable to translate coordinate system EPSG:6263 into PROJ.4 format.
5999 #
6000 # MAGNA-SIRGAS / Popayan urban grid
6001 # Unable to translate coordinate system EPSG:6264 into PROJ.4 format.
6002 #
6003 # MAGNA-SIRGAS / Puerto Carreno urban grid
6004 # Unable to translate coordinate system EPSG:6265 into PROJ.4 format.
6005 #
6006 # MAGNA-SIRGAS / Quibdo urban grid
6007 # Unable to translate coordinate system EPSG:6266 into PROJ.4 format.
6008 #
6009 # MAGNA-SIRGAS / Riohacha urban grid
6010 # Unable to translate coordinate system EPSG:6267 into PROJ.4 format.
6011 #
6012 # MAGNA-SIRGAS / San Andres urban grid
6013 # Unable to translate coordinate system EPSG:6268 into PROJ.4 format.
6014 #
6015 # MAGNA-SIRGAS / San Jose del Guaviare urban grid
6016 # Unable to translate coordinate system EPSG:6269 into PROJ.4 format.
6017 #
6018 # MAGNA-SIRGAS / Santa Marta urban grid
6019 # Unable to translate coordinate system EPSG:6270 into PROJ.4 format.
6020 #
6021 # MAGNA-SIRGAS / Sucre urban grid
6022 # Unable to translate coordinate system EPSG:6271 into PROJ.4 format.
6023 #
6024 # MAGNA-SIRGAS / Tunja urban grid
6025 # Unable to translate coordinate system EPSG:6272 into PROJ.4 format.
6026 #
6027 # MAGNA-SIRGAS / Valledupar urban grid
6028 # Unable to translate coordinate system EPSG:6273 into PROJ.4 format.
6029 #
6030 # MAGNA-SIRGAS / Villavicencio urban grid
6031 # Unable to translate coordinate system EPSG:6274 into PROJ.4 format.
6032 #
6033 # MAGNA-SIRGAS / Yopal urban grid
6034 # Unable to translate coordinate system EPSG:6275 into PROJ.4 format.
6035 #
6036 # Macedonia State Coordinate System zone 7
6037 <6316> +proj=tmerc +lat_0=0 +lon_0=21 +k=0.9999 +x_0=7500000 +y_0=0 +ellps=bessel +towgs84=682,-203,480,0,0,0,0 +units=m +no_defs <>
6038 # NAD83(2011) / UTM zone 59N
6039 <6328> +proj=utm +zone=59 +ellps=GRS80 +units=m +no_defs <>
6040 # NAD83(2011) / UTM zone 60N
6041 <6329> +proj=utm +zone=60 +ellps=GRS80 +units=m +no_defs <>
6042 # NAD83(2011) / UTM zone 1N
6043 <6330> +proj=utm +zone=1 +ellps=GRS80 +units=m +no_defs <>
6044 # NAD83(2011) / UTM zone 2N
6045 <6331> +proj=utm +zone=2 +ellps=GRS80 +units=m +no_defs <>
6046 # NAD83(2011) / UTM zone 3N
6047 <6332> +proj=utm +zone=3 +ellps=GRS80 +units=m +no_defs <>
6048 # NAD83(2011) / UTM zone 4N
6049 <6333> +proj=utm +zone=4 +ellps=GRS80 +units=m +no_defs <>
6050 # NAD83(2011) / UTM zone 5N
6051 <6334> +proj=utm +zone=5 +ellps=GRS80 +units=m +no_defs <>
6052 # NAD83(2011) / UTM zone 6N
6053 <6335> +proj=utm +zone=6 +ellps=GRS80 +units=m +no_defs <>
6054 # NAD83(2011) / UTM zone 7N
6055 <6336> +proj=utm +zone=7 +ellps=GRS80 +units=m +no_defs <>
6056 # NAD83(2011) / UTM zone 8N
6057 <6337> +proj=utm +zone=8 +ellps=GRS80 +units=m +no_defs <>
6058 # NAD83(2011) / UTM zone 9N
6059 <6338> +proj=utm +zone=9 +ellps=GRS80 +units=m +no_defs <>
6060 # NAD83(2011) / UTM zone 10N
6061 <6339> +proj=utm +zone=10 +ellps=GRS80 +units=m +no_defs <>
6062 # NAD83(2011) / UTM zone 11N
6063 <6340> +proj=utm +zone=11 +ellps=GRS80 +units=m +no_defs <>
6064 # NAD83(2011) / UTM zone 12N
6065 <6341> +proj=utm +zone=12 +ellps=GRS80 +units=m +no_defs <>
6066 # NAD83(2011) / UTM zone 13N
6067 <6342> +proj=utm +zone=13 +ellps=GRS80 +units=m +no_defs <>
6068 # NAD83(2011) / UTM zone 14N
6069 <6343> +proj=utm +zone=14 +ellps=GRS80 +units=m +no_defs <>
6070 # NAD83(2011) / UTM zone 15N
6071 <6344> +proj=utm +zone=15 +ellps=GRS80 +units=m +no_defs <>
6072 # NAD83(2011) / UTM zone 16N
6073 <6345> +proj=utm +zone=16 +ellps=GRS80 +units=m +no_defs <>
6074 # NAD83(2011) / UTM zone 17N
6075 <6346> +proj=utm +zone=17 +ellps=GRS80 +units=m +no_defs <>
6076 # NAD83(2011) / UTM zone 18N
6077 <6347> +proj=utm +zone=18 +ellps=GRS80 +units=m +no_defs <>
6078 # NAD83(2011) / UTM zone 19N
6079 <6348> +proj=utm +zone=19 +ellps=GRS80 +units=m +no_defs <>
6080 # NAD83(2011) / Conus Albers
6081 <6350> +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6082 # NAD83(2011) / EPSG Arctic zone 5-29
6083 <6351> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-163 +x_0=29500000 +y_0=5500000 +ellps=GRS80 +units=m +no_defs <>
6084 # NAD83(2011) / EPSG Arctic zone 5-31
6085 <6352> +proj=lcc +lat_1=73.66666666666667 +lat_2=70.33333333333333 +lat_0=72.02500919444445 +lon_0=-147 +x_0=31500000 +y_0=5500000 +ellps=GRS80 +units=m +no_defs <>
6086 # NAD83(2011) / EPSG Arctic zone 6-14
6087 <6353> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-165 +x_0=14500000 +y_0=6500000 +ellps=GRS80 +units=m +no_defs <>
6088 # NAD83(2011) / EPSG Arctic zone 6-16
6089 <6354> +proj=lcc +lat_1=70.33333333333333 +lat_2=67 +lat_0=68.68747555555557 +lon_0=-147 +x_0=16500000 +y_0=6500000 +ellps=GRS80 +units=m +no_defs <>
6090 # NAD83(2011) / Alabama East
6091 <6355> +proj=tmerc +lat_0=30.5 +lon_0=-85.83333333333333 +k=0.99996 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6092 # NAD83(2011) / Alabama West
6093 <6356> +proj=tmerc +lat_0=30 +lon_0=-87.5 +k=0.999933333 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6094 # Mexico ITRF92 / LCC
6095 <6362> +proj=lcc +lat_1=17.5 +lat_2=29.5 +lat_0=12 +lon_0=-102 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6096 # Mexico ITRF2008 / UTM zone 11N
6097 <6366> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6098 # Mexico ITRF2008 / UTM zone 12N
6099 <6367> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6100 # Mexico ITRF2008 / UTM zone 13N
6101 <6368> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6102 # Mexico ITRF2008 / UTM zone 14N
6103 <6369> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6104 # Mexico ITRF2008 / UTM zone 15N
6105 <6370> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6106 # Mexico ITRF2008 / UTM zone 16N
6107 <6371> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6108 # Mexico ITRF2008 / LCC
6109 <6372> +proj=lcc +lat_1=17.5 +lat_2=29.5 +lat_0=12 +lon_0=-102 +x_0=2500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6110 # UCS-2000 / Ukraine TM zone 7
6111 <6381> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=300000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
6112 # UCS-2000 / Ukraine TM zone 8
6113 <6382> +proj=tmerc +lat_0=0 +lon_0=24 +k=1 +x_0=300000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
6114 # UCS-2000 / Ukraine TM zone 9
6115 <6383> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=300000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
6116 # UCS-2000 / Ukraine TM zone 10
6117 <6384> +proj=tmerc +lat_0=0 +lon_0=30 +k=1 +x_0=300000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
6118 # UCS-2000 / Ukraine TM zone 11
6119 <6385> +proj=tmerc +lat_0=0 +lon_0=33 +k=1 +x_0=300000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
6120 # UCS-2000 / Ukraine TM zone 12
6121 <6386> +proj=tmerc +lat_0=0 +lon_0=36 +k=1 +x_0=300000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
6122 # UCS-2000 / Ukraine TM zone 13
6123 <6387> +proj=tmerc +lat_0=0 +lon_0=39 +k=1 +x_0=300000 +y_0=0 +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +units=m +no_defs <>
6124 # Cayman Islands National Grid 2011
6125 <6391> +proj=lcc +lat_1=19.33333333333333 +lat_2=19.7 +lat_0=19.33333333333333 +lon_0=-80.56666666666666 +x_0=899160 +y_0=579120 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=ft +no_defs <>
6126 # NAD83(2011) / Alaska Albers
6127 <6393> +proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6128 # NAD83(2011) / Alaska zone 1
6129 <6394> +proj=omerc +lat_0=57 +lonc=-133.6666666666667 +alpha=323.1301023611111 +k=0.9999 +x_0=5000000 +y_0=-5000000 +no_uoff +gamma=323.1301023611111 +ellps=GRS80 +units=m +no_defs <>
6130 # NAD83(2011) / Alaska zone 2
6131 <6395> +proj=tmerc +lat_0=54 +lon_0=-142 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6132 # NAD83(2011) / Alaska zone 3
6133 <6396> +proj=tmerc +lat_0=54 +lon_0=-146 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6134 # NAD83(2011) / Alaska zone 4
6135 <6397> +proj=tmerc +lat_0=54 +lon_0=-150 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6136 # NAD83(2011) / Alaska zone 5
6137 <6398> +proj=tmerc +lat_0=54 +lon_0=-154 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6138 # NAD83(2011) / Alaska zone 6
6139 <6399> +proj=tmerc +lat_0=54 +lon_0=-158 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6140 # NAD83(2011) / Alaska zone 7
6141 <6400> +proj=tmerc +lat_0=54 +lon_0=-162 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6142 # NAD83(2011) / Alaska zone 8
6143 <6401> +proj=tmerc +lat_0=54 +lon_0=-166 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6144 # NAD83(2011) / Alaska zone 9
6145 <6402> +proj=tmerc +lat_0=54 +lon_0=-170 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6146 # NAD83(2011) / Alaska zone 10
6147 <6403> +proj=lcc +lat_1=53.83333333333334 +lat_2=51.83333333333334 +lat_0=51 +lon_0=-176 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6148 # NAD83(2011) / Arizona Central
6149 <6404> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6150 # NAD83(2011) / Arizona Central (ft)
6151 <6405> +proj=tmerc +lat_0=31 +lon_0=-111.9166666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6152 # NAD83(2011) / Arizona East
6153 <6406> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6154 # NAD83(2011) / Arizona East (ft)
6155 <6407> +proj=tmerc +lat_0=31 +lon_0=-110.1666666666667 +k=0.9999 +x_0=213360 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6156 # NAD83(2011) / Arizona West
6157 <6408> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6158 # NAD83(2011) / Arizona West (ft)
6159 <6409> +proj=tmerc +lat_0=31 +lon_0=-113.75 +k=0.999933333 +x_0=213360 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6160 # NAD83(2011) / Arkansas North
6161 <6410> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6162 # NAD83(2011) / Arkansas North (ftUS)
6163 <6411> +proj=lcc +lat_1=36.23333333333333 +lat_2=34.93333333333333 +lat_0=34.33333333333334 +lon_0=-92 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6164 # NAD83(2011) / Arkansas South
6165 <6412> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m +no_defs <>
6166 # NAD83(2011) / Arkansas South (ftUS)
6167 <6413> +proj=lcc +lat_1=34.76666666666667 +lat_2=33.3 +lat_0=32.66666666666666 +lon_0=-92 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +units=us-ft +no_defs <>
6168 # NAD83(2011) / California Albers
6169 <6414> +proj=aea +lat_1=34 +lat_2=40.5 +lat_0=0 +lon_0=-120 +x_0=0 +y_0=-4000000 +ellps=GRS80 +units=m +no_defs <>
6170 # NAD83(2011) / California zone 1
6171 <6415> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m +no_defs <>
6172 # NAD83(2011) / California zone 1 (ftUS)
6173 <6416> +proj=lcc +lat_1=41.66666666666666 +lat_2=40 +lat_0=39.33333333333334 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs <>
6174 # NAD83(2011) / California zone 2
6175 <6417> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m +no_defs <>
6176 # NAD83(2011) / California zone 2 (ftUS)
6177 <6418> +proj=lcc +lat_1=39.83333333333334 +lat_2=38.33333333333334 +lat_0=37.66666666666666 +lon_0=-122 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs <>
6178 # NAD83(2011) / California zone 3
6179 <6419> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m +no_defs <>
6180 # NAD83(2011) / California zone 3 (ftUS)
6181 <6420> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.06666666666667 +lat_0=36.5 +lon_0=-120.5 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs <>
6182 # NAD83(2011) / California zone 4
6183 <6421> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m +no_defs <>
6184 # NAD83(2011) / California zone 4 (ftUS)
6185 <6422> +proj=lcc +lat_1=37.25 +lat_2=36 +lat_0=35.33333333333334 +lon_0=-119 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs <>
6186 # NAD83(2011) / California zone 5
6187 <6423> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m +no_defs <>
6188 # NAD83(2011) / California zone 5 (ftUS)
6189 <6424> +proj=lcc +lat_1=35.46666666666667 +lat_2=34.03333333333333 +lat_0=33.5 +lon_0=-118 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs <>
6190 # NAD83(2011) / California zone 6
6191 <6425> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000 +y_0=500000 +ellps=GRS80 +units=m +no_defs <>
6192 # NAD83(2011) / California zone 6 (ftUS)
6193 <6426> +proj=lcc +lat_1=33.88333333333333 +lat_2=32.78333333333333 +lat_0=32.16666666666666 +lon_0=-116.25 +x_0=2000000.0001016 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs <>
6194 # NAD83(2011) / Colorado Central
6195 <6427> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m +no_defs <>
6196 # NAD83(2011) / Colorado Central (ftUS)
6197 <6428> +proj=lcc +lat_1=39.75 +lat_2=38.45 +lat_0=37.83333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +units=us-ft +no_defs <>
6198 # NAD83(2011) / Colorado North
6199 <6429> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m +no_defs <>
6200 # NAD83(2011) / Colorado North (ftUS)
6201 <6430> +proj=lcc +lat_1=40.78333333333333 +lat_2=39.71666666666667 +lat_0=39.33333333333334 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +units=us-ft +no_defs <>
6202 # NAD83(2011) / Colorado South
6203 <6431> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8289 +y_0=304800.6096 +ellps=GRS80 +units=m +no_defs <>
6204 # NAD83(2011) / Colorado South (ftUS)
6205 <6432> +proj=lcc +lat_1=38.43333333333333 +lat_2=37.23333333333333 +lat_0=36.66666666666666 +lon_0=-105.5 +x_0=914401.8288036576 +y_0=304800.6096012192 +ellps=GRS80 +units=us-ft +no_defs <>
6206 # NAD83(2011) / Connecticut
6207 <6433> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096 +y_0=152400.3048 +ellps=GRS80 +units=m +no_defs <>
6208 # NAD83(2011) / Connecticut (ftUS)
6209 <6434> +proj=lcc +lat_1=41.86666666666667 +lat_2=41.2 +lat_0=40.83333333333334 +lon_0=-72.75 +x_0=304800.6096012192 +y_0=152400.3048006096 +ellps=GRS80 +units=us-ft +no_defs <>
6210 # NAD83(2011) / Delaware
6211 <6435> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6212 # NAD83(2011) / Delaware (ftUS)
6213 <6436> +proj=tmerc +lat_0=38 +lon_0=-75.41666666666667 +k=0.999995 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6214 # NAD83(2011) / Florida East
6215 <6437> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6216 # NAD83(2011) / Florida East (ftUS)
6217 <6438> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-81 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6218 # NAD83(2011) / Florida GDL Albers
6219 <6439> +proj=aea +lat_1=24 +lat_2=31.5 +lat_0=24 +lon_0=-84 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6220 # NAD83(2011) / Florida North
6221 <6440> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6222 # NAD83(2011) / Florida North (ftUS)
6223 <6441> +proj=lcc +lat_1=30.75 +lat_2=29.58333333333333 +lat_0=29 +lon_0=-84.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6224 # NAD83(2011) / Florida West
6225 <6442> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6226 # NAD83(2011) / Florida West (ftUS)
6227 <6443> +proj=tmerc +lat_0=24.33333333333333 +lon_0=-82 +k=0.999941177 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6228 # NAD83(2011) / Georgia East
6229 <6444> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6230 # NAD83(2011) / Georgia East (ftUS)
6231 <6445> +proj=tmerc +lat_0=30 +lon_0=-82.16666666666667 +k=0.9999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6232 # NAD83(2011) / Georgia West
6233 <6446> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6234 # NAD83(2011) / Georgia West (ftUS)
6235 <6447> +proj=tmerc +lat_0=30 +lon_0=-84.16666666666667 +k=0.9999 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6236 # NAD83(2011) / Idaho Central
6237 <6448> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6238 # NAD83(2011) / Idaho Central (ftUS)
6239 <6449> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-114 +k=0.9999473679999999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6240 # NAD83(2011) / Idaho East
6241 <6450> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6242 # NAD83(2011) / Idaho East (ftUS)
6243 <6451> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-112.1666666666667 +k=0.9999473679999999 +x_0=200000.0001016002 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6244 # NAD83(2011) / Idaho West
6245 <6452> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6246 # NAD83(2011) / Idaho West (ftUS)
6247 <6453> +proj=tmerc +lat_0=41.66666666666666 +lon_0=-115.75 +k=0.999933333 +x_0=800000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6248 # NAD83(2011) / Illinois East
6249 <6454> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6250 # NAD83(2011) / Illinois East (ftUS)
6251 <6455> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-88.33333333333333 +k=0.9999749999999999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6252 # NAD83(2011) / Illinois West
6253 <6456> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6254 # NAD83(2011) / Illinois West (ftUS)
6255 <6457> +proj=tmerc +lat_0=36.66666666666666 +lon_0=-90.16666666666667 +k=0.999941177 +x_0=699999.9999898402 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6256 # NAD83(2011) / Indiana East
6257 <6458> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=100000 +y_0=250000 +ellps=GRS80 +units=m +no_defs <>
6258 # NAD83(2011) / Indiana East (ftUS)
6259 <6459> +proj=tmerc +lat_0=37.5 +lon_0=-85.66666666666667 +k=0.999966667 +x_0=99999.99989839978 +y_0=249999.9998983998 +ellps=GRS80 +units=us-ft +no_defs <>
6260 # NAD83(2011) / Indiana West
6261 <6460> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=250000 +ellps=GRS80 +units=m +no_defs <>
6262 # NAD83(2011) / Indiana West (ftUS)
6263 <6461> +proj=tmerc +lat_0=37.5 +lon_0=-87.08333333333333 +k=0.999966667 +x_0=900000 +y_0=249999.9998983998 +ellps=GRS80 +units=us-ft +no_defs <>
6264 # NAD83(2011) / Iowa North
6265 <6462> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +units=m +no_defs <>
6266 # NAD83(2011) / Iowa North (ftUS)
6267 <6463> +proj=lcc +lat_1=43.26666666666667 +lat_2=42.06666666666667 +lat_0=41.5 +lon_0=-93.5 +x_0=1500000 +y_0=999999.9999898402 +ellps=GRS80 +units=us-ft +no_defs <>
6268 # NAD83(2011) / Iowa South
6269 <6464> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6270 # NAD83(2011) / Iowa South (ftUS)
6271 <6465> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.61666666666667 +lat_0=40 +lon_0=-93.5 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6272 # NAD83(2011) / Kansas North
6273 <6466> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6274 # NAD83(2011) / Kansas North (ftUS)
6275 <6467> +proj=lcc +lat_1=39.78333333333333 +lat_2=38.71666666666667 +lat_0=38.33333333333334 +lon_0=-98 +x_0=399999.99998984 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6276 # NAD83(2011) / Kansas South
6277 <6468> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=400000 +y_0=400000 +ellps=GRS80 +units=m +no_defs <>
6278 # NAD83(2011) / Kansas South (ftUS)
6279 <6469> +proj=lcc +lat_1=38.56666666666667 +lat_2=37.26666666666667 +lat_0=36.66666666666666 +lon_0=-98.5 +x_0=399999.99998984 +y_0=399999.99998984 +ellps=GRS80 +units=us-ft +no_defs <>
6280 # NAD83(2011) / Kentucky North
6281 <6470> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6282 # NAD83(2011) / Kentucky North (ftUS)
6283 <6471> +proj=lcc +lat_1=37.96666666666667 +lat_2=38.96666666666667 +lat_0=37.5 +lon_0=-84.25 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6284 # NAD83(2011) / Kentucky Single Zone
6285 <6472> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=1000000 +ellps=GRS80 +units=m +no_defs <>
6286 # NAD83(2011) / Kentucky Single Zone (ftUS)
6287 <6473> +proj=lcc +lat_1=37.08333333333334 +lat_2=38.66666666666666 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=1500000 +y_0=999999.9998983998 +ellps=GRS80 +units=us-ft +no_defs <>
6288 # NAD83(2011) / Kentucky South
6289 <6474> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000 +y_0=500000 +ellps=GRS80 +units=m +no_defs <>
6290 # NAD83(2011) / Kentucky South (ftUS)
6291 <6475> +proj=lcc +lat_1=37.93333333333333 +lat_2=36.73333333333333 +lat_0=36.33333333333334 +lon_0=-85.75 +x_0=500000.0001016001 +y_0=500000.0001016001 +ellps=GRS80 +units=us-ft +no_defs <>
6292 # NAD83(2011) / Louisiana North
6293 <6476> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6294 # NAD83(2011) / Louisiana North (ftUS)
6295 <6477> +proj=lcc +lat_1=32.66666666666666 +lat_2=31.16666666666667 +lat_0=30.5 +lon_0=-92.5 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6296 # NAD83(2011) / Louisiana South
6297 <6478> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6298 # NAD83(2011) / Louisiana South (ftUS)
6299 <6479> +proj=lcc +lat_1=30.7 +lat_2=29.3 +lat_0=28.5 +lon_0=-91.33333333333333 +x_0=999999.9999898402 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6300 # NAD83(2011) / Maine CS2000 Central
6301 <6480> +proj=tmerc +lat_0=43.5 +lon_0=-69.125 +k=0.99998 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6302 # NAD83(2011) / Maine CS2000 East
6303 <6481> +proj=tmerc +lat_0=43.83333333333334 +lon_0=-67.875 +k=0.99998 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6304 # NAD83(2011) / Maine CS2000 West
6305 <6482> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.375 +k=0.99998 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6306 # NAD83(2011) / Maine East
6307 <6483> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6308 # NAD83(2011) / Maine East (ftUS)
6309 <6484> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6310 # NAD83(2011) / Maine West
6311 <6485> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6312 # NAD83(2011) / Maine West (ftUS)
6313 <6486> +proj=tmerc +lat_0=42.83333333333334 +lon_0=-70.16666666666667 +k=0.999966667 +x_0=900000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6314 # NAD83(2011) / Maryland
6315 <6487> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6316 # NAD83(2011) / Maryland (ftUS)
6317 <6488> +proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9998983998 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6318 # NAD83(2011) / Massachusetts Island
6319 <6489> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6320 # NAD83(2011) / Massachusetts Island (ftUS)
6321 <6490> +proj=lcc +lat_1=41.48333333333333 +lat_2=41.28333333333333 +lat_0=41 +lon_0=-70.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6322 # NAD83(2011) / Massachusetts Mainland
6323 <6491> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000 +y_0=750000 +ellps=GRS80 +units=m +no_defs <>
6324 # NAD83(2011) / Massachusetts Mainland (ftUS)
6325 <6492> +proj=lcc +lat_1=42.68333333333333 +lat_2=41.71666666666667 +lat_0=41 +lon_0=-71.5 +x_0=200000.0001016002 +y_0=750000 +ellps=GRS80 +units=us-ft +no_defs <>
6326 # NAD83(2011) / Michigan Central
6327 <6493> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=6000000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6328 # NAD83(2011) / Michigan Central (ft)
6329 <6494> +proj=lcc +lat_1=45.7 +lat_2=44.18333333333333 +lat_0=43.31666666666667 +lon_0=-84.36666666666666 +x_0=5999999.999976001 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6330 # NAD83(2011) / Michigan North
6331 <6495> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=8000000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6332 # NAD83(2011) / Michigan North (ft)
6333 <6496> +proj=lcc +lat_1=47.08333333333334 +lat_2=45.48333333333333 +lat_0=44.78333333333333 +lon_0=-87 +x_0=7999999.999968001 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6334 # NAD83(2011) / Michigan Oblique Mercator
6335 <6497> +proj=omerc +lat_0=45.30916666666666 +lonc=-86 +alpha=337.25556 +k=0.9996 +x_0=2546731.496 +y_0=-4354009.816 +no_uoff +gamma=337.25556 +ellps=GRS80 +units=m +no_defs <>
6336 # NAD83(2011) / Michigan South
6337 <6498> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6338 # NAD83(2011) / Michigan South (ft)
6339 <6499> +proj=lcc +lat_1=43.66666666666666 +lat_2=42.1 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=3999999.999984 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6340 # NAD83(2011) / Minnesota Central
6341 <6500> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m +no_defs <>
6342 # NAD83(2011) / Minnesota Central (ftUS)
6343 <6501> +proj=lcc +lat_1=47.05 +lat_2=45.61666666666667 +lat_0=45 +lon_0=-94.25 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +units=us-ft +no_defs <>
6344 # NAD83(2011) / Minnesota North
6345 <6502> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m +no_defs <>
6346 # NAD83(2011) / Minnesota North (ftUS)
6347 <6503> +proj=lcc +lat_1=48.63333333333333 +lat_2=47.03333333333333 +lat_0=46.5 +lon_0=-93.09999999999999 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +units=us-ft +no_defs <>
6348 # NAD83(2011) / Minnesota South
6349 <6504> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m +no_defs <>
6350 # NAD83(2011) / Minnesota South (ftUS)
6351 <6505> +proj=lcc +lat_1=45.21666666666667 +lat_2=43.78333333333333 +lat_0=43 +lon_0=-94 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +units=us-ft +no_defs <>
6352 # NAD83(2011) / Mississippi East
6353 <6506> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6354 # NAD83(2011) / Mississippi East (ftUS)
6355 <6507> +proj=tmerc +lat_0=29.5 +lon_0=-88.83333333333333 +k=0.99995 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6356 # NAD83(2011) / Mississippi TM
6357 <6508> +proj=tmerc +lat_0=32.5 +lon_0=-89.75 +k=0.9998335 +x_0=500000 +y_0=1300000 +ellps=GRS80 +units=m +no_defs <>
6358 # NAD83(2011) / Mississippi West
6359 <6509> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=700000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6360 # NAD83(2011) / Mississippi West (ftUS)
6361 <6510> +proj=tmerc +lat_0=29.5 +lon_0=-90.33333333333333 +k=0.99995 +x_0=699999.9998983998 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6362 # NAD83(2011) / Missouri Central
6363 <6511> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-92.5 +k=0.999933333 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6364 # NAD83(2011) / Missouri East
6365 <6512> +proj=tmerc +lat_0=35.83333333333334 +lon_0=-90.5 +k=0.999933333 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6366 # NAD83(2011) / Missouri West
6367 <6513> +proj=tmerc +lat_0=36.16666666666666 +lon_0=-94.5 +k=0.999941177 +x_0=850000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6368 # NAD83(2011) / Montana
6369 <6514> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6370 # NAD83(2011) / Montana (ft)
6371 <6515> +proj=lcc +lat_1=49 +lat_2=45 +lat_0=44.25 +lon_0=-109.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6372 # NAD83(2011) / Nebraska
6373 <6516> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6374 # NAD83(2011) / Nebraska (ftUS) (deprecated)
6375 <6517> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=us-ft +no_defs <>
6376 # NAD83(2011) / Nevada Central
6377 <6518> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000 +y_0=6000000 +ellps=GRS80 +units=m +no_defs <>
6378 # NAD83(2011) / Nevada Central (ftUS)
6379 <6519> +proj=tmerc +lat_0=34.75 +lon_0=-116.6666666666667 +k=0.9999 +x_0=500000.00001016 +y_0=6000000 +ellps=GRS80 +units=us-ft +no_defs <>
6380 # NAD83(2011) / Nevada East
6381 <6520> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000 +y_0=8000000 +ellps=GRS80 +units=m +no_defs <>
6382 # NAD83(2011) / Nevada East (ftUS)
6383 <6521> +proj=tmerc +lat_0=34.75 +lon_0=-115.5833333333333 +k=0.9999 +x_0=200000.00001016 +y_0=8000000.000010163 +ellps=GRS80 +units=us-ft +no_defs <>
6384 # NAD83(2011) / Nevada West
6385 <6522> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000 +y_0=4000000 +ellps=GRS80 +units=m +no_defs <>
6386 # NAD83(2011) / Nevada West (ftUS)
6387 <6523> +proj=tmerc +lat_0=34.75 +lon_0=-118.5833333333333 +k=0.9999 +x_0=800000.0000101599 +y_0=3999999.99998984 +ellps=GRS80 +units=us-ft +no_defs <>
6388 # NAD83(2011) / New Hampshire
6389 <6524> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6390 # NAD83(2011) / New Hampshire (ftUS)
6391 <6525> +proj=tmerc +lat_0=42.5 +lon_0=-71.66666666666667 +k=0.999966667 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6392 # NAD83(2011) / New Jersey
6393 <6526> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6394 # NAD83(2011) / New Jersey (ftUS)
6395 <6527> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6396 # NAD83(2011) / New Mexico Central
6397 <6528> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6398 # NAD83(2011) / New Mexico Central (ftUS)
6399 <6529> +proj=tmerc +lat_0=31 +lon_0=-106.25 +k=0.9999 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6400 # NAD83(2011) / New Mexico East
6401 <6530> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6402 # NAD83(2011) / New Mexico East (ftUS)
6403 <6531> +proj=tmerc +lat_0=31 +lon_0=-104.3333333333333 +k=0.999909091 +x_0=165000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6404 # NAD83(2011) / New Mexico West
6405 <6532> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6406 # NAD83(2011) / New Mexico West (ftUS)
6407 <6533> +proj=tmerc +lat_0=31 +lon_0=-107.8333333333333 +k=0.999916667 +x_0=830000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6408 # NAD83(2011) / New York Central
6409 <6534> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=250000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6410 # NAD83(2011) / New York Central (ftUS)
6411 <6535> +proj=tmerc +lat_0=40 +lon_0=-76.58333333333333 +k=0.9999375 +x_0=249999.9998983998 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6412 # NAD83(2011) / New York East
6413 <6536> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6414 # NAD83(2011) / New York East (ftUS)
6415 <6537> +proj=tmerc +lat_0=38.83333333333334 +lon_0=-74.5 +k=0.9999 +x_0=150000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6416 # NAD83(2011) / New York Long Island
6417 <6538> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6418 # NAD83(2011) / New York Long Island (ftUS)
6419 <6539> +proj=lcc +lat_1=41.03333333333333 +lat_2=40.66666666666666 +lat_0=40.16666666666666 +lon_0=-74 +x_0=300000.0000000001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6420 # NAD83(2011) / New York West
6421 <6540> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6422 # NAD83(2011) / New York West (ftUS)
6423 <6541> +proj=tmerc +lat_0=40 +lon_0=-78.58333333333333 +k=0.9999375 +x_0=350000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6424 # NAD83(2011) / North Carolina
6425 <6542> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.22 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6426 # NAD83(2011) / North Carolina (ftUS)
6427 <6543> +proj=lcc +lat_1=36.16666666666666 +lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79 +x_0=609601.2192024384 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6428 # NAD83(2011) / North Dakota North
6429 <6544> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6430 # NAD83(2011) / North Dakota North (ft)
6431 <6545> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.43333333333333 +lat_0=47 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6432 # NAD83(2011) / North Dakota South
6433 <6546> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6434 # NAD83(2011) / North Dakota South (ft)
6435 <6547> +proj=lcc +lat_1=47.48333333333333 +lat_2=46.18333333333333 +lat_0=45.66666666666666 +lon_0=-100.5 +x_0=599999.9999976 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6436 # NAD83(2011) / Ohio North
6437 <6548> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6438 # NAD83(2011) / Ohio North (ftUS)
6439 <6549> +proj=lcc +lat_1=41.7 +lat_2=40.43333333333333 +lat_0=39.66666666666666 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6440 # NAD83(2011) / Ohio South
6441 <6550> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6442 # NAD83(2011) / Ohio South (ftUS)
6443 <6551> +proj=lcc +lat_1=40.03333333333333 +lat_2=38.73333333333333 +lat_0=38 +lon_0=-82.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6444 # NAD83(2011) / Oklahoma North
6445 <6552> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6446 # NAD83(2011) / Oklahoma North (ftUS)
6447 <6553> +proj=lcc +lat_1=36.76666666666667 +lat_2=35.56666666666667 +lat_0=35 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6448 # NAD83(2011) / Oklahoma South
6449 <6554> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6450 # NAD83(2011) / Oklahoma South (ftUS)
6451 <6555> +proj=lcc +lat_1=35.23333333333333 +lat_2=33.93333333333333 +lat_0=33.33333333333334 +lon_0=-98 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6452 # NAD83(2011) / Oregon LCC (m)
6453 <6556> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6454 # NAD83(2011) / Oregon GIC Lambert (ft)
6455 <6557> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6456 # NAD83(2011) / Oregon North
6457 <6558> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6458 # NAD83(2011) / Oregon North (ft)
6459 <6559> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6460 # NAD83(2011) / Oregon South
6461 <6560> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6462 # NAD83(2011) / Oregon South (ft)
6463 <6561> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6464 # NAD83(2011) / Pennsylvania North
6465 <6562> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6466 # NAD83(2011) / Pennsylvania North (ftUS)
6467 <6563> +proj=lcc +lat_1=41.95 +lat_2=40.88333333333333 +lat_0=40.16666666666666 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6468 # NAD83(2011) / Pennsylvania South
6469 <6564> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6470 # NAD83(2011) / Pennsylvania South (ftUS)
6471 <6565> +proj=lcc +lat_1=40.96666666666667 +lat_2=39.93333333333333 +lat_0=39.33333333333334 +lon_0=-77.75 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6472 # NAD83(2011) / Puerto Rico and Virgin Is.
6473 <6566> +proj=lcc +lat_1=18.43333333333333 +lat_2=18.03333333333333 +lat_0=17.83333333333333 +lon_0=-66.43333333333334 +x_0=200000 +y_0=200000 +ellps=GRS80 +units=m +no_defs <>
6474 # NAD83(2011) / Rhode Island
6475 <6567> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=100000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6476 # NAD83(2011) / Rhode Island (ftUS)
6477 <6568> +proj=tmerc +lat_0=41.08333333333334 +lon_0=-71.5 +k=0.99999375 +x_0=99999.99998983997 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6478 # NAD83(2011) / South Carolina
6479 <6569> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6480 # NAD83(2011) / South Carolina (ft)
6481 <6570> +proj=lcc +lat_1=34.83333333333334 +lat_2=32.5 +lat_0=31.83333333333333 +lon_0=-81 +x_0=609600 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6482 # NAD83(2011) / South Dakota North
6483 <6571> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6484 # NAD83(2011) / South Dakota North (ftUS)
6485 <6572> +proj=lcc +lat_1=45.68333333333333 +lat_2=44.41666666666666 +lat_0=43.83333333333334 +lon_0=-100 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6486 # NAD83(2011) / South Dakota South
6487 <6573> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6488 # NAD83(2011) / South Dakota South (ftUS)
6489 <6574> +proj=lcc +lat_1=44.4 +lat_2=42.83333333333334 +lat_0=42.33333333333334 +lon_0=-100.3333333333333 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6490 # NAD83(2011) / Tennessee
6491 <6575> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6492 # NAD83(2011) / Tennessee (ftUS)
6493 <6576> +proj=lcc +lat_1=36.41666666666666 +lat_2=35.25 +lat_0=34.33333333333334 +lon_0=-86 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6494 # NAD83(2011) / Texas Central
6495 <6577> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=700000 +y_0=3000000 +ellps=GRS80 +units=m +no_defs <>
6496 # NAD83(2011) / Texas Central (ftUS)
6497 <6578> +proj=lcc +lat_1=31.88333333333333 +lat_2=30.11666666666667 +lat_0=29.66666666666667 +lon_0=-100.3333333333333 +x_0=699999.9998983998 +y_0=3000000 +ellps=GRS80 +units=us-ft +no_defs <>
6498 # NAD83(2011) / Texas Centric Albers Equal Area
6499 <6579> +proj=aea +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=6000000 +ellps=GRS80 +units=m +no_defs <>
6500 # NAD83(2011) / Texas Centric Lambert Conformal
6501 <6580> +proj=lcc +lat_1=27.5 +lat_2=35 +lat_0=18 +lon_0=-100 +x_0=1500000 +y_0=5000000 +ellps=GRS80 +units=m +no_defs <>
6502 # NAD83(2011) / Texas North
6503 <6581> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000 +y_0=1000000 +ellps=GRS80 +units=m +no_defs <>
6504 # NAD83(2011) / Texas North (ftUS)
6505 <6582> +proj=lcc +lat_1=36.18333333333333 +lat_2=34.65 +lat_0=34 +lon_0=-101.5 +x_0=200000.0001016002 +y_0=999999.9998983998 +ellps=GRS80 +units=us-ft +no_defs <>
6506 # NAD83(2011) / Texas North Central
6507 <6583> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000 +ellps=GRS80 +units=m +no_defs <>
6508 # NAD83(2011) / Texas North Central (ftUS)
6509 <6584> +proj=lcc +lat_1=33.96666666666667 +lat_2=32.13333333333333 +lat_0=31.66666666666667 +lon_0=-98.5 +x_0=600000 +y_0=2000000.0001016 +ellps=GRS80 +units=us-ft +no_defs <>
6510 # NAD83(2011) / Texas South
6511 <6585> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000 +y_0=5000000 +ellps=GRS80 +units=m +no_defs <>
6512 # NAD83(2011) / Texas South (ftUS)
6513 <6586> +proj=lcc +lat_1=27.83333333333333 +lat_2=26.16666666666667 +lat_0=25.66666666666667 +lon_0=-98.5 +x_0=300000.0000000001 +y_0=5000000.0001016 +ellps=GRS80 +units=us-ft +no_defs <>
6514 # NAD83(2011) / Texas South Central
6515 <6587> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=4000000 +ellps=GRS80 +units=m +no_defs <>
6516 # NAD83(2011) / Texas South Central (ftUS)
6517 <6588> +proj=lcc +lat_1=30.28333333333333 +lat_2=28.38333333333333 +lat_0=27.83333333333333 +lon_0=-99 +x_0=600000 +y_0=3999999.9998984 +ellps=GRS80 +units=us-ft +no_defs <>
6518 # NAD83(2011) / Vermont
6519 <6589> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6520 # NAD83(2011) / Vermont (ftUS)
6521 <6590> +proj=tmerc +lat_0=42.5 +lon_0=-72.5 +k=0.999964286 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6522 # NAD83(2011) / Virginia Lambert
6523 <6591> +proj=lcc +lat_1=37 +lat_2=39.5 +lat_0=36 +lon_0=-79.5 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6524 # NAD83(2011) / Virginia North
6525 <6592> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000 +y_0=2000000 +ellps=GRS80 +units=m +no_defs <>
6526 # NAD83(2011) / Virginia North (ftUS)
6527 <6593> +proj=lcc +lat_1=39.2 +lat_2=38.03333333333333 +lat_0=37.66666666666666 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=2000000.0001016 +ellps=GRS80 +units=us-ft +no_defs <>
6528 # NAD83(2011) / Virginia South
6529 <6594> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000 +y_0=1000000 +ellps=GRS80 +units=m +no_defs <>
6530 # NAD83(2011) / Virginia South (ftUS)
6531 <6595> +proj=lcc +lat_1=37.96666666666667 +lat_2=36.76666666666667 +lat_0=36.33333333333334 +lon_0=-78.5 +x_0=3500000.0001016 +y_0=999999.9998983998 +ellps=GRS80 +units=us-ft +no_defs <>
6532 # NAD83(2011) / Washington North
6533 <6596> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6534 # NAD83(2011) / Washington North (ftUS)
6535 <6597> +proj=lcc +lat_1=48.73333333333333 +lat_2=47.5 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6536 # NAD83(2011) / Washington South
6537 <6598> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6538 # NAD83(2011) / Washington South (ftUS)
6539 <6599> +proj=lcc +lat_1=47.33333333333334 +lat_2=45.83333333333334 +lat_0=45.33333333333334 +lon_0=-120.5 +x_0=500000.0001016001 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6540 # NAD83(2011) / West Virginia North
6541 <6600> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6542 # NAD83(2011) / West Virginia North (ftUS)
6543 <6601> +proj=lcc +lat_1=40.25 +lat_2=39 +lat_0=38.5 +lon_0=-79.5 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6544 # NAD83(2011) / West Virginia South
6545 <6602> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6546 # NAD83(2011) / West Virginia South (ftUS)
6547 <6603> +proj=lcc +lat_1=38.88333333333333 +lat_2=37.48333333333333 +lat_0=37 +lon_0=-81 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6548 # NAD83(2011) / Wisconsin Central (deprecated)
6549 <6604> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6550 # NAD83(2011) / Wisconsin Central (ftUS)
6551 <6605> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6552 # NAD83(2011) / Wisconsin North
6553 <6606> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6554 # NAD83(2011) / Wisconsin North (ftUS)
6555 <6607> +proj=lcc +lat_1=46.76666666666667 +lat_2=45.56666666666667 +lat_0=45.16666666666666 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6556 # NAD83(2011) / Wisconsin South
6557 <6608> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6558 # NAD83(2011) / Wisconsin South (ftUS)
6559 <6609> +proj=lcc +lat_1=44.06666666666667 +lat_2=42.73333333333333 +lat_0=42 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6560 # NAD83(2011) / Wisconsin Transverse Mercator
6561 <6610> +proj=tmerc +lat_0=0 +lon_0=-90 +k=0.9996 +x_0=520000 +y_0=-4480000 +ellps=GRS80 +units=m +no_defs <>
6562 # NAD83(2011) / Wyoming East
6563 <6611> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6564 # NAD83(2011) / Wyoming East (ftUS)
6565 <6612> +proj=tmerc +lat_0=40.5 +lon_0=-105.1666666666667 +k=0.9999375 +x_0=200000.00001016 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6566 # NAD83(2011) / Wyoming East Central
6567 <6613> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=400000 +y_0=100000 +ellps=GRS80 +units=m +no_defs <>
6568 # NAD83(2011) / Wyoming East Central (ftUS)
6569 <6614> +proj=tmerc +lat_0=40.5 +lon_0=-107.3333333333333 +k=0.9999375 +x_0=399999.99998984 +y_0=99999.99998983997 +ellps=GRS80 +units=us-ft +no_defs <>
6570 # NAD83(2011) / Wyoming West
6571 <6615> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000 +y_0=100000 +ellps=GRS80 +units=m +no_defs <>
6572 # NAD83(2011) / Wyoming West (ftUS)
6573 <6616> +proj=tmerc +lat_0=40.5 +lon_0=-110.0833333333333 +k=0.9999375 +x_0=800000.0000101599 +y_0=99999.99998983997 +ellps=GRS80 +units=us-ft +no_defs <>
6574 # NAD83(2011) / Wyoming West Central
6575 <6617> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6576 # NAD83(2011) / Wyoming West Central (ftUS)
6577 <6618> +proj=tmerc +lat_0=40.5 +lon_0=-108.75 +k=0.9999375 +x_0=600000 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6578 # NAD83(2011) / Utah Central
6579 <6619> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=2000000 +ellps=GRS80 +units=m +no_defs <>
6580 # NAD83(2011) / Utah North
6581 <6620> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000 +y_0=1000000 +ellps=GRS80 +units=m +no_defs <>
6582 # NAD83(2011) / Utah South
6583 <6621> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000 +y_0=3000000 +ellps=GRS80 +units=m +no_defs <>
6584 # NAD83(CSRS) / Quebec Lambert
6585 <6622> +proj=lcc +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6586 # NAD83 / Quebec Albers
6587 <6623> +proj=aea +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs <>
6588 # NAD83(CSRS) / Quebec Albers
6589 <6624> +proj=aea +lat_1=60 +lat_2=46 +lat_0=44 +lon_0=-68.5 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6590 # NAD83(2011) / Utah Central (ftUS)
6591 <6625> +proj=lcc +lat_1=40.65 +lat_2=39.01666666666667 +lat_0=38.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=2000000.00001016 +ellps=GRS80 +units=us-ft +no_defs <>
6592 # NAD83(2011) / Utah North (ftUS)
6593 <6626> +proj=lcc +lat_1=41.78333333333333 +lat_2=40.71666666666667 +lat_0=40.33333333333334 +lon_0=-111.5 +x_0=500000.00001016 +y_0=999999.9999898402 +ellps=GRS80 +units=us-ft +no_defs <>
6594 # NAD83(2011) / Utah South (ftUS)
6595 <6627> +proj=lcc +lat_1=38.35 +lat_2=37.21666666666667 +lat_0=36.66666666666666 +lon_0=-111.5 +x_0=500000.00001016 +y_0=3000000 +ellps=GRS80 +units=us-ft +no_defs <>
6596 # NAD83(PA11) / Hawaii zone 1
6597 <6628> +proj=tmerc +lat_0=18.83333333333333 +lon_0=-155.5 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6598 # NAD83(PA11) / Hawaii zone 2
6599 <6629> +proj=tmerc +lat_0=20.33333333333333 +lon_0=-156.6666666666667 +k=0.999966667 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6600 # NAD83(PA11) / Hawaii zone 3
6601 <6630> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6602 # NAD83(PA11) / Hawaii zone 4
6603 <6631> +proj=tmerc +lat_0=21.83333333333333 +lon_0=-159.5 +k=0.99999 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6604 # NAD83(PA11) / Hawaii zone 5
6605 <6632> +proj=tmerc +lat_0=21.66666666666667 +lon_0=-160.1666666666667 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6606 # NAD83(PA11) / Hawaii zone 3 (ftUS)
6607 <6633> +proj=tmerc +lat_0=21.16666666666667 +lon_0=-158 +k=0.99999 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6608 # NAD83(PA11) / UTM zone 4N
6609 <6634> +proj=utm +zone=4 +ellps=GRS80 +units=m +no_defs <>
6610 # NAD83(PA11) / UTM zone 5N
6611 <6635> +proj=utm +zone=5 +ellps=GRS80 +units=m +no_defs <>
6612 # NAD83(PA11) / UTM zone 2S
6613 <6636> +proj=utm +zone=2 +south +ellps=GRS80 +units=m +no_defs <>
6614 # NAD83(MA11) / Guam Map Grid
6615 <6637> +proj=tmerc +lat_0=13.5 +lon_0=144.75 +k=1 +x_0=100000 +y_0=200000 +ellps=GRS80 +units=m +no_defs <>
6616 # Karbala 1979 / Iraq National Grid
6617 <6646> +proj=tmerc +lat_0=29.02626833333333 +lon_0=46.5 +k=0.9994 +x_0=800000 +y_0=0 +ellps=clrk80 +towgs84=70.995,-335.916,262.898,0,0,0,0 +units=m +no_defs <>
6618 # JGD2011 / Japan Plane Rectangular CS I
6619 <6669> +proj=tmerc +lat_0=33 +lon_0=129.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6620 # JGD2011 / Japan Plane Rectangular CS II
6621 <6670> +proj=tmerc +lat_0=33 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6622 # JGD2011 / Japan Plane Rectangular CS III
6623 <6671> +proj=tmerc +lat_0=36 +lon_0=132.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6624 # JGD2011 / Japan Plane Rectangular CS IV
6625 <6672> +proj=tmerc +lat_0=33 +lon_0=133.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6626 # JGD2011 / Japan Plane Rectangular CS V
6627 <6673> +proj=tmerc +lat_0=36 +lon_0=134.3333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6628 # JGD2011 / Japan Plane Rectangular CS VI
6629 <6674> +proj=tmerc +lat_0=36 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6630 # JGD2011 / Japan Plane Rectangular CS VII
6631 <6675> +proj=tmerc +lat_0=36 +lon_0=137.1666666666667 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6632 # JGD2011 / Japan Plane Rectangular CS VIII
6633 <6676> +proj=tmerc +lat_0=36 +lon_0=138.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6634 # JGD2011 / Japan Plane Rectangular CS IX
6635 <6677> +proj=tmerc +lat_0=36 +lon_0=139.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6636 # JGD2011 / Japan Plane Rectangular CS X
6637 <6678> +proj=tmerc +lat_0=40 +lon_0=140.8333333333333 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6638 # JGD2011 / Japan Plane Rectangular CS XI
6639 <6679> +proj=tmerc +lat_0=44 +lon_0=140.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6640 # JGD2011 / Japan Plane Rectangular CS XII
6641 <6680> +proj=tmerc +lat_0=44 +lon_0=142.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6642 # JGD2011 / Japan Plane Rectangular CS XIII
6643 <6681> +proj=tmerc +lat_0=44 +lon_0=144.25 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6644 # JGD2011 / Japan Plane Rectangular CS XIV
6645 <6682> +proj=tmerc +lat_0=26 +lon_0=142 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6646 # JGD2011 / Japan Plane Rectangular CS XV
6647 <6683> +proj=tmerc +lat_0=26 +lon_0=127.5 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6648 # JGD2011 / Japan Plane Rectangular CS XVI
6649 <6684> +proj=tmerc +lat_0=26 +lon_0=124 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6650 # JGD2011 / Japan Plane Rectangular CS XVII
6651 <6685> +proj=tmerc +lat_0=26 +lon_0=131 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6652 # JGD2011 / Japan Plane Rectangular CS XVIII
6653 <6686> +proj=tmerc +lat_0=20 +lon_0=136 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6654 # JGD2011 / Japan Plane Rectangular CS XIX
6655 <6687> +proj=tmerc +lat_0=26 +lon_0=154 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6656 # JGD2011 / UTM zone 51N
6657 <6688> +proj=utm +zone=51 +ellps=GRS80 +units=m +no_defs <>
6658 # JGD2011 / UTM zone 52N
6659 <6689> +proj=utm +zone=52 +ellps=GRS80 +units=m +no_defs <>
6660 # JGD2011 / UTM zone 53N
6661 <6690> +proj=utm +zone=53 +ellps=GRS80 +units=m +no_defs <>
6662 # JGD2011 / UTM zone 54N
6663 <6691> +proj=utm +zone=54 +ellps=GRS80 +units=m +no_defs <>
6664 # JGD2011 / UTM zone 55N
6665 <6692> +proj=utm +zone=55 +ellps=GRS80 +units=m +no_defs <>
6666 # WGS 84 / TM 60 SW
6667 <6703> +proj=tmerc +lat_0=0 +lon_0=-60 +k=0.9996 +x_0=500000 +y_0=10000000 +datum=WGS84 +units=m +no_defs <>
6668 # RDN2008 / TM32
6669 <6707> +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6670 # RDN2008 / TM33
6671 <6708> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6672 # RDN2008 / TM34
6673 <6709> +proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6674 # WGS 84 / CIG92
6675 <6720> +proj=tmerc +lat_0=0 +lon_0=105.625 +k=1.000024 +x_0=50000 +y_0=1300000 +datum=WGS84 +units=m +no_defs <>
6676 # GDA94 / CIG94
6677 <6721> +proj=tmerc +lat_0=0 +lon_0=105.625 +k=1.00002514 +x_0=50000 +y_0=1300000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6678 # WGS 84 / CKIG92
6679 <6722> +proj=tmerc +lat_0=0 +lon_0=96.875 +k=1 +x_0=50000 +y_0=1400000 +datum=WGS84 +units=m +no_defs <>
6680 # GDA94 / CKIG94
6681 <6723> +proj=tmerc +lat_0=0 +lon_0=96.875 +k=0.99999387 +x_0=50000 +y_0=1500000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6682 # GDA94 / MGA zone 41
6683 <6732> +proj=utm +zone=41 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6684 # GDA94 / MGA zone 42
6685 <6733> +proj=utm +zone=42 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6686 # GDA94 / MGA zone 43
6687 <6734> +proj=utm +zone=43 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6688 # GDA94 / MGA zone 44
6689 <6735> +proj=utm +zone=44 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6690 # GDA94 / MGA zone 46
6691 <6736> +proj=utm +zone=46 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6692 # GDA94 / MGA zone 47
6693 <6737> +proj=utm +zone=47 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6694 # GDA94 / MGA zone 59
6695 <6738> +proj=utm +zone=59 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6696 # NAD83(CORS96) / Oregon LCC (m)
6697 <6867> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=400000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6698 # NAD83(CORS96) / Oregon GIC Lambert (ft)
6699 <6868> +proj=lcc +lat_1=43 +lat_2=45.5 +lat_0=41.75 +lon_0=-120.5 +x_0=399999.9999984 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6700 # ETRS89 / Albania 2010
6701 <6870> +proj=tmerc +lat_0=0 +lon_0=20 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6702 # RDN2008 / Italy zone
6703 <6875> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.9985000000000001 +x_0=7000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6704 # RDN2008 / Zone 12
6705 <6876> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=3000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
6706 # NAD83(2011) / Wisconsin Central
6707 <6879> +proj=lcc +lat_1=45.5 +lat_2=44.25 +lat_0=43.83333333333334 +lon_0=-90 +x_0=600000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6708 # NAD83(2011) / Nebraska (ftUS)
6709 <6880> +proj=lcc +lat_1=43 +lat_2=40 +lat_0=39.83333333333334 +lon_0=-100 +x_0=500000.00001016 +y_0=0 +ellps=GRS80 +units=us-ft +no_defs <>
6710 # NAD83(CORS96) / Oregon North
6711 <6884> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6712 # NAD83(CORS96) / Oregon North (ft)
6713 <6885> +proj=lcc +lat_1=46 +lat_2=44.33333333333334 +lat_0=43.66666666666666 +lon_0=-120.5 +x_0=2500000.0001424 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
6714 # NAD83(CORS96) / Oregon South
6715 <6886> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <>
6716 # NAD83(CORS96) / Oregon South (ft)
6717 <6887> +proj=lcc +lat_1=44 +lat_2=42.33333333333334 +lat_0=41.66666666666666 +lon_0=-120.5 +x_0=1500000.0001464 +y_0=0 +ellps=GRS80 +units=ft +no_defs <>
56936718 # Pulkovo 1995 / Gauss-Kruger zone 4
56946719 <20004> +proj=tmerc +lat_0=0 +lon_0=21 +k=1 +x_0=4500000 +y_0=0 +ellps=krass +towgs84=24.47,-130.89,-81.56,-0,-0,0.13,-0.22 +units=m +no_defs <>
56956720 # Pulkovo 1995 / Gauss-Kruger zone 5
60947119 # Carthage / Sud Tunisie
60957120 <22392> +proj=lcc +lat_1=33.3 +lat_0=33.3 +lon_0=9.9 +k_0=0.999625769 +x_0=500000 +y_0=300000 +datum=carthage +units=m +no_defs <>
60967121 # Corrego Alegre 1970-72 / UTM zone 21S
6097 <22521> +proj=utm +zone=21 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs <>
7122 <22521> +proj=utm +zone=21 +south +ellps=intl +towgs84=-205.57,168.77,-4.12,0,0,0,0 +units=m +no_defs <>
60987123 # Corrego Alegre 1970-72 / UTM zone 22S
6099 <22522> +proj=utm +zone=22 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs <>
7124 <22522> +proj=utm +zone=22 +south +ellps=intl +towgs84=-205.57,168.77,-4.12,0,0,0,0 +units=m +no_defs <>
61007125 # Corrego Alegre 1970-72 / UTM zone 23S
6101 <22523> +proj=utm +zone=23 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs <>
7126 <22523> +proj=utm +zone=23 +south +ellps=intl +towgs84=-205.57,168.77,-4.12,0,0,0,0 +units=m +no_defs <>
61027127 # Corrego Alegre 1970-72 / UTM zone 24S
6103 <22524> +proj=utm +zone=24 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs <>
7128 <22524> +proj=utm +zone=24 +south +ellps=intl +towgs84=-205.57,168.77,-4.12,0,0,0,0 +units=m +no_defs <>
61047129 # Corrego Alegre 1970-72 / UTM zone 25S
6105 <22525> +proj=utm +zone=25 +south +ellps=intl +towgs84=-206,172,-6,0,0,0,0 +units=m +no_defs <>
7130 <22525> +proj=utm +zone=25 +south +ellps=intl +towgs84=-205.57,168.77,-4.12,0,0,0,0 +units=m +no_defs <>
61067131 # Deir ez Zor / Levant Zone
61077132 <22700> +proj=lcc +lat_1=34.65 +lat_0=34.65 +lon_0=37.35 +k_0=0.9996256 +x_0=300000 +y_0=300000 +a=6378249.2 +b=6356515 +towgs84=-190.421,8.532,238.69,0,0,0,0 +units=m +no_defs <>
61087133 # Deir ez Zor / Syria Lambert
66077632 <26802> +proj=tmerc +lat_0=41.5 +lon_0=-85.75 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs <>
66087633 # NAD Michigan / Michigan West (deprecated)
66097634 <26803> +proj=tmerc +lat_0=41.5 +lon_0=-88.75 +k=0.999909091 +x_0=152400.3048006096 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs <>
6610 # NAD Michigan / Michigan North
7635 # NAD Michigan / Michigan North (deprecated)
66117636 <26811> +proj=lcc +lat_1=45.48333333333333 +lat_2=47.08333333333334 +lat_0=44.78333333333333 +lon_0=-87 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs <>
6612 # NAD Michigan / Michigan Central
7637 # NAD Michigan / Michigan Central (deprecated)
66137638 <26812> +proj=lcc +lat_1=44.18333333333333 +lat_2=45.7 +lat_0=43.31666666666667 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs <>
6614 # NAD Michigan / Michigan South
7639 # NAD Michigan / Michigan South (deprecated)
66157640 <26813> +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.33333333333333 +x_0=609601.2192024384 +y_0=0 +a=6378450.047548896 +b=6356826.621488444 +units=us-ft +no_defs <>
66167641 # NAD83 / Maine East (ftUS) (deprecated)
66177642 <26814> +proj=tmerc +lat_0=43.66666666666666 +lon_0=-68.5 +k=0.9999 +x_0=300000 +y_0=0 +datum=NAD83 +units=m +no_defs <>
70558080 <28193> +proj=cass +lat_0=31.73409694444445 +lon_0=35.21208055555556 +x_0=170251.555 +y_0=1126867.909 +a=6378300.789 +b=6356566.435 +towgs84=-275.722,94.7824,340.894,-8.001,-4.42,-11.821,1 +units=m +no_defs <>
70568081 # Pointe Noire / UTM zone 32S
70578082 <28232> +proj=utm +zone=32 +south +a=6378249.2 +b=6356515 +towgs84=-148,51,-291,0,0,0,0 +units=m +no_defs <>
7058 # GDA94 / MGA zone 48 (deprecated)
8083 # GDA94 / MGA zone 48
70598084 <28348> +proj=utm +zone=48 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
70608085 # GDA94 / MGA zone 49
70618086 <28349> +proj=utm +zone=49 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <>
72108235 # SAD69 / Brazil Polyconic (deprecated)
72118236 <29100> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
72128237 # SAD69 / Brazil Polyconic
7213 <29101> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8238 <29101> +proj=poly +lat_0=0 +lon_0=-54 +x_0=5000000 +y_0=10000000 +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72148239 # SAD69 / UTM zone 18N (deprecated)
72158240 <29118> +proj=utm +zone=18 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
72168241 # SAD69 / UTM zone 19N (deprecated)
72228247 # SAD69 / UTM zone 22N (deprecated)
72238248 <29122> +proj=utm +zone=22 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
72248249 # SAD69 / UTM zone 18N
7225 <29168> +proj=utm +zone=18 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8250 <29168> +proj=utm +zone=18 +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72268251 # SAD69 / UTM zone 19N
7227 <29169> +proj=utm +zone=19 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8252 <29169> +proj=utm +zone=19 +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72288253 # SAD69 / UTM zone 20N
7229 <29170> +proj=utm +zone=20 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8254 <29170> +proj=utm +zone=20 +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72308255 # SAD69 / UTM zone 21N
7231 <29171> +proj=utm +zone=21 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8256 <29171> +proj=utm +zone=21 +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72328257 # SAD69 / UTM zone 22N
7233 <29172> +proj=utm +zone=22 +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8258 <29172> +proj=utm +zone=22 +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72348259 # SAD69 / UTM zone 17S (deprecated)
72358260 <29177> +proj=utm +zone=17 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
72368261 # SAD69 / UTM zone 18S (deprecated)
72508275 # SAD69 / UTM zone 25S (deprecated)
72518276 <29185> +proj=utm +zone=25 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
72528277 # SAD69 / UTM zone 17S
7253 <29187> +proj=utm +zone=17 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8278 <29187> +proj=utm +zone=17 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72548279 # SAD69 / UTM zone 18S
7255 <29188> +proj=utm +zone=18 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8280 <29188> +proj=utm +zone=18 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72568281 # SAD69 / UTM zone 19S
7257 <29189> +proj=utm +zone=19 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8282 <29189> +proj=utm +zone=19 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72588283 # SAD69 / UTM zone 20S
7259 <29190> +proj=utm +zone=20 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8284 <29190> +proj=utm +zone=20 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72608285 # SAD69 / UTM zone 21S
7261 <29191> +proj=utm +zone=21 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8286 <29191> +proj=utm +zone=21 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72628287 # SAD69 / UTM zone 22S
7263 <29192> +proj=utm +zone=22 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8288 <29192> +proj=utm +zone=22 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72648289 # SAD69 / UTM zone 23S
7265 <29193> +proj=utm +zone=23 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8290 <29193> +proj=utm +zone=23 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72668291 # SAD69 / UTM zone 24S
7267 <29194> +proj=utm +zone=24 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8292 <29194> +proj=utm +zone=24 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72688293 # SAD69 / UTM zone 25S
7269 <29195> +proj=utm +zone=25 +south +ellps=aust_SA +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <>
8294 <29195> +proj=utm +zone=25 +south +ellps=aust_SA +towgs84=-66.87,4.37,-38.52,0,0,0,0 +units=m +no_defs <>
72708295 # Sapper Hill 1943 / UTM zone 20S
72718296 <29220> +proj=utm +zone=20 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m +no_defs <>
72728297 # Sapper Hill 1943 / UTM zone 21S
86259650 <32761> +proj=stere +lat_0=-90 +lat_ts=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m +no_defs <>
86269651 # WGS 84 / TM 36 SE
86279652 <32766> +proj=tmerc +lat_0=0 +lon_0=36 +k=0.9996 +x_0=500000 +y_0=10000000 +datum=WGS84 +units=m +no_defs <>
9653 # TWD97
9654 <3822> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9655 # IGRS
9656 <3887> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9657 # MOLDREF99
9658 <4000> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9659 # RGRDC 2005
9660 <4039> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9661 # SREF98
9662 <4073> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9663 # REGCAN95
9664 <4079> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9665 # WGS 84 (geocentric)
9666 <4328> +proj=geocent +datum=WGS84 +units=m +no_defs <>
9667 # ITRF88 (geocentric)
9668 <4330> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9669 # ITRF89 (geocentric)
9670 <4331> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9671 # ITRF90 (geocentric)
9672 <4332> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9673 # ITRF91 (geocentric)
9674 <4333> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9675 # ITRF92 (geocentric)
9676 <4334> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9677 # ITRF93 (geocentric)
9678 <4335> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9679 # ITRF94 (geocentric)
9680 <4336> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9681 # ITRF96 (geocentric)
9682 <4337> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9683 # ITRF97 (geocentric)
9684 <4338> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9685 # Australian Antarctic (geocentric)
9686 <4340> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9687 # EST97 (geocentric)
9688 <4342> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9689 # CHTRF95 (geocentric)
9690 <4344> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9691 # ETRS89 (geocentric)
9692 <4346> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9693 # GDA94 (geocentric)
9694 <4348> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9695 # Hartebeesthoek94 (geocentric)
9696 <4350> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9697 # IRENET95 (geocentric)
9698 <4352> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9699 # JGD2000 (geocentric)
9700 <4354> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9701 # LKS94 (ETRS89) (geocentric)
9702 <4356> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9703 # Moznet (geocentric)
9704 <4358> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9705 # NAD83(CSRS) (geocentric)
9706 <4360> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9707 # NAD83(HARN) (geocentric)
9708 <4362> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9709 # NZGD2000 (geocentric)
9710 <4364> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9711 # POSGAR 98 (geocentric)
9712 <4366> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9713 # REGVEN (geocentric)
9714 <4368> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9715 # RGF93 (geocentric)
9716 <4370> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9717 # RGFG95 (geocentric)
9718 <4372> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9719 # RGR92 (geocentric)
9720 <4374> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9721 # SIRGAS (geocentric)
9722 <4376> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9723 # SWEREF99 (geocentric)
9724 <4378> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9725 # Yemen NGN96 (geocentric)
9726 <4380> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9727 # RGNC 1991 (geocentric)
9728 <4382> +proj=geocent +ellps=intl +units=m +no_defs <>
9729 # RRAF 1991 (geocentric)
9730 <4384> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9731 # ITRF2000 (geocentric)
9732 <4385> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9733 # ISN93 (geocentric)
9734 <4387> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9735 # LKS92 (geocentric)
9736 <4389> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9737 # RGSPM06
9738 <4465> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9739 # RGM04
9740 <4468> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9741 # Cadastre 1997
9742 <4473> +proj=geocent +ellps=intl +units=m +no_defs <>
9743 # China Geodetic Coordinate System 2000
9744 <4479> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9745 # Mexico ITRF92
9746 <4481> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9747 # RRAF 1991
9748 <4556> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9749 # Slovenia 1996
9750 <4882> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9751 # RSRGD2000
9752 <4884> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9753 # BDA2000
9754 <4886> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9755 # HTRS96
9756 <4888> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9757 # WGS 66
9758 <4890> +proj=geocent +ellps=WGS66 +units=m +no_defs <>
9759 # NAD83(NSRS2007)
9760 <4892> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9761 # JAD2001
9762 <4894> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9763 # ITRF2005
9764 <4896> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9765 # DGN95
9766 <4897> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9767 # LGD2006
9768 <4899> +proj=geocent +ellps=intl +units=m +no_defs <>
9769 # RGNC91-93
9770 <4906> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9771 # GR96
9772 <4908> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9773 # ITRF88
9774 <4910> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9775 # ITRF89
9776 <4911> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9777 # ITRF90
9778 <4912> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9779 # ITRF91
9780 <4913> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9781 # ITRF92
9782 <4914> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9783 # ITRF93
9784 <4915> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9785 # ITRF94
9786 <4916> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9787 # ITRF96
9788 <4917> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9789 # ITRF97
9790 <4918> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9791 # ITRF2000
9792 <4919> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9793 # GDM2000
9794 <4920> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9795 # PZ-90
9796 <4922> +proj=geocent +a=6378136 +b=6356751.361745712 +units=m +no_defs <>
9797 # Mauritania 1999
9798 <4924> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9799 # Korea 2000
9800 <4926> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9801 # POSGAR 94
9802 <4928> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9803 # Australian Antarctic
9804 <4930> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9805 # CHTRF95
9806 <4932> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9807 # EST97
9808 <4934> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9809 # ETRS89
9810 <4936> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9811 # GDA94
9812 <4938> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9813 # Hartebeesthoek94
9814 <4940> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9815 # IRENET95
9816 <4942> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9817 # ISN93
9818 <4944> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9819 # JGD2000
9820 <4946> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9821 # LKS92
9822 <4948> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9823 # LKS94
9824 <4950> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9825 # Moznet
9826 <4952> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9827 # NAD83(CSRS)
9828 <4954> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9829 # NAD83(HARN)
9830 <4956> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9831 # NZGD2000
9832 <4958> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9833 # POSGAR 98
9834 <4960> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9835 # REGVEN
9836 <4962> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9837 # RGF93
9838 <4964> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9839 # RGFG95
9840 <4966> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9841 # RGNC 1991
9842 <4968> +proj=geocent +ellps=intl +units=m +no_defs <>
9843 # RGR92
9844 <4970> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9845 # RRAF 1991
9846 <4972> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9847 # SIRGAS 1995
9848 <4974> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9849 # SWEREF99
9850 <4976> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9851 # WGS 84
9852 <4978> +proj=geocent +datum=WGS84 +units=m +no_defs <>
9853 # Yemen NGN96
9854 <4980> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9855 # IGM95
9856 <4982> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9857 # WGS 72
9858 <4984> +proj=geocent +ellps=WGS72 +units=m +no_defs <>
9859 # WGS 72BE
9860 <4986> +proj=geocent +ellps=WGS72 +units=m +no_defs <>
9861 # SIRGAS 2000
9862 <4988> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9863 # Lao 1993
9864 <4990> +proj=geocent +ellps=krass +units=m +no_defs <>
9865 # Lao 1997
9866 <4992> +proj=geocent +ellps=krass +units=m +no_defs <>
9867 # PRS92
9868 <4994> +proj=geocent +ellps=clrk66 +units=m +no_defs <>
9869 # MAGNA-SIRGAS
9870 <4996> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9871 # RGPF
9872 <4998> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9873 # PTRA08
9874 <5011> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9875 # GDBD2009
9876 <5244> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9877 # TUREF
9878 <5250> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9879 # DRUKREF 03
9880 <5262> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9881 # ISN2004
9882 <5322> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9883 # ITRF2008
9884 <5332> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9885 # POSGAR 2007
9886 <5341> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9887 # MARGEN
9888 <5352> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9889 # SIRGAS-Chile
9890 <5358> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9891 # CR05
9892 <5363> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9893 # MACARIO SOLIS
9894 <5368> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9895 # Peru96
9896 <5369> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9897 # SIRGAS-ROU98
9898 <5379> +proj=geocent +ellps=WGS84 +units=m +no_defs <>
9899 # SIRGAS_ES2007.8
9900 <5391> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9901 # RGAF09
9902 <5487> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9903 # PNG94
9904 <5544> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9905 # UCS-2000
9906 <5558> +proj=geocent +ellps=krass +units=m +no_defs <>
9907 # FEH2010
9908 <5591> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9909 # DB_REF
9910 <5828> +proj=geocent +ellps=bessel +units=m +no_defs <>
9911 # TGD2005
9912 <5884> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9913 # CIGD11
9914 <6133> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9915 # NAD83(2011)
9916 <6317> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9917 # NAD83(PA11)
9918 <6320> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9919 # NAD83(MA11)
9920 <6323> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9921 # Mexico ITRF2008
9922 <6363> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9923 # JGD2011
9924 <6666> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9925 # RDN2008
9926 <6704> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9927 # NAD83(CORS96)
9928 <6781> +proj=geocent +ellps=GRS80 +units=m +no_defs <>
9929 # KKJ / Finland Uniform Coordinate System + N60 height
9930 <3901> +proj=tmerc +lat_0=0 +lon_0=27 +k=1 +x_0=3500000 +y_0=0 +ellps=intl +towgs84=-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496 +units=m +vunits=m +no_defs <>
9931 # ETRS89 / TM35FIN(N,E) + N60 height
9932 <3902> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9933 # ETRS89 / TM35FIN(N,E) + N2000 height
9934 <3903> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9935 # ETRS89 / DKTM1 + DVR90 height
9936 <4097> +proj=tmerc +lat_0=0 +lon_0=9 +k=0.99998 +x_0=200000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9937 # ETRS89 / DKTM2 + DVR90 height
9938 <4098> +proj=tmerc +lat_0=0 +lon_0=10 +k=0.99998 +x_0=400000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9939 # ETRS89 / DKTM3 + DVR90 height
9940 <4099> +proj=tmerc +lat_0=0 +lon_0=11.75 +k=0.99998 +x_0=600000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9941 # ETRS89 / DKTM4 + DVR90 height
9942 <4100> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=800000 +y_0=-5000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9943 # ETRS89 / Faroe TM + FVR09 height
9944 <5318> +proj=tmerc +lat_0=0 +lon_0=-7 +k=0.999997 +x_0=200000 +y_0=-6000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9945 # NAD83 + NAVD88 height
9946 <5498> +proj=longlat +datum=NAD83 +geoidgrids=g2012a_conus.gtx,g2012a_alaska.gtx,g2012a_guam.gtx,g2012a_hawaii.gtx,g2012a_puertorico.gtx,g2012a_samoa.gtx +vunits=m +no_defs <>
9947 # NAD83(HARN) + NAVD88 height
9948 <5499> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +geoidgrids=g2012a_conus.gtx,g2012a_alaska.gtx,g2012a_guam.gtx,g2012a_hawaii.gtx,g2012a_puertorico.gtx,g2012a_samoa.gtx +vunits=m +no_defs <>
9949 # NAD83(NSRS2007) + NAVD88 height
9950 <5500> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +geoidgrids=g2012a_conus.gtx,g2012a_alaska.gtx,g2012a_guam.gtx,g2012a_hawaii.gtx,g2012a_puertorico.gtx,g2012a_samoa.gtx +vunits=m +no_defs <>
9951 # ETRS89 / UTM zone 31N + DHHN92 height
9952 <5554> +proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9953 # ETRS89 / UTM zone 32N + DHHN92 height
9954 <5555> +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9955 # ETRS89 / UTM zone 33N + DHHN92 height
9956 <5556> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9957 # FEH2010 / Fehmarnbelt TM + FCSVR10 height
9958 <5598> +proj=tmerc +lat_0=0 +lon_0=11.33333333333333 +k=1 +x_0=1000000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9959 # SWEREF99 + RH2000 height
9960 <5628> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +vunits=m +no_defs <>
9961 # RGF93 / Lambert-93 + NGF-IGN69 height
9962 <5698> +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9963 # RGF93 / Lambert-93 + NGF-IGN78 height
9964 <5699> +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9965 # NTF (Paris) / Lambert zone I + NGF-IGN69 height
9966 <5707> +proj=lcc +lat_1=49.50000000000001 +lat_0=49.50000000000001 +lon_0=0 +k_0=0.999877341 +x_0=600000 +y_0=1200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
9967 # NTF (Paris) / Lambert zone IV + NGF-IGN78 height
9968 <5708> +proj=lcc +lat_1=42.16500000000001 +lat_0=42.16500000000001 +lon_0=0 +k_0=0.99994471 +x_0=234.358 +y_0=4185861.369 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
9969 # DB_REF / 3-degree Gauss-Kruger zone 2 (E-N) + DHHN92 height
9970 <5832> +proj=tmerc +lat_0=0 +lon_0=6 +k=1 +x_0=2500000 +y_0=0 +ellps=bessel +units=m +vunits=m +no_defs <>
9971 # DB_REF / 3-degree Gauss-Kruger zone 3 (E-N) + DHHN92 height
9972 <5833> +proj=tmerc +lat_0=0 +lon_0=9 +k=1 +x_0=3500000 +y_0=0 +ellps=bessel +units=m +vunits=m +no_defs <>
9973 # DB_REF / 3-degree Gauss-Kruger zone 4 (E-N) + DHHN92 height
9974 <5834> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=4500000 +y_0=0 +ellps=bessel +units=m +vunits=m +no_defs <>
9975 # DB_REF / 3-degree Gauss-Kruger zone 5 (E-N) + DHHN92 height
9976 <5835> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=5500000 +y_0=0 +ellps=bessel +units=m +vunits=m +no_defs <>
9977 # SWEREF99 TM + RH2000 height
9978 <5845> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9979 # SWEREF99 12 00 + RH2000 height
9980 <5846> +proj=tmerc +lat_0=0 +lon_0=12 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9981 # SWEREF99 13 30 + RH2000 height
9982 <5847> +proj=tmerc +lat_0=0 +lon_0=13.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9983 # SWEREF99 15 00 + RH2000 height
9984 <5848> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9985 # SWEREF99 16 30 + RH2000 height
9986 <5849> +proj=tmerc +lat_0=0 +lon_0=16.5 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9987 # SWEREF99 18 00 + RH2000 height
9988 <5850> +proj=tmerc +lat_0=0 +lon_0=18 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9989 # SWEREF99 14 15 + RH2000 height
9990 <5851> +proj=tmerc +lat_0=0 +lon_0=14.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9991 # SWEREF99 15 45 + RH2000 height
9992 <5852> +proj=tmerc +lat_0=0 +lon_0=15.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9993 # SWEREF99 17 15 + RH2000 height
9994 <5853> +proj=tmerc +lat_0=0 +lon_0=17.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9995 # SWEREF99 18 45 + RH2000 height
9996 <5854> +proj=tmerc +lat_0=0 +lon_0=18.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9997 # SWEREF99 20 15 + RH2000 height
9998 <5855> +proj=tmerc +lat_0=0 +lon_0=20.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
9999 # SWEREF99 21 45 + RH2000 height
10000 <5856> +proj=tmerc +lat_0=0 +lon_0=21.75 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10001 # SWEREF99 23 15 + RH2000 height
10002 <5857> +proj=tmerc +lat_0=0 +lon_0=23.25 +k=1 +x_0=150000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10003 # ETRS89 + NN2000 height
10004 <5942> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +vunits=m +no_defs <>
10005 # ETRS89 / NTM zone 5 + NN2000 height
10006 <5945> +proj=tmerc +lat_0=58 +lon_0=5.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10007 # ETRS89 / NTM zone 6 + NN2000 height
10008 <5946> +proj=tmerc +lat_0=58 +lon_0=6.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10009 # ETRS89 / NTM zone 7 + NN2000 height
10010 <5947> +proj=tmerc +lat_0=58 +lon_0=7.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10011 # ETRS89 / NTM zone 8 + NN2000 height
10012 <5948> +proj=tmerc +lat_0=58 +lon_0=8.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10013 # ETRS89 / NTM zone 9 + NN2000 height
10014 <5949> +proj=tmerc +lat_0=58 +lon_0=9.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10015 # ETRS89 / NTM zone 10 + NN2000 height
10016 <5950> +proj=tmerc +lat_0=58 +lon_0=10.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10017 # ETRS89 / NTM zone 11 + NN2000 height
10018 <5951> +proj=tmerc +lat_0=58 +lon_0=11.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10019 # ETRS89 / NTM zone 12 + NN2000 height
10020 <5952> +proj=tmerc +lat_0=58 +lon_0=12.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10021 # ETRS89 / NTM zone 13 + NN2000 height
10022 <5953> +proj=tmerc +lat_0=58 +lon_0=13.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10023 # ETRS89 / NTM zone 14 + NN2000 height
10024 <5954> +proj=tmerc +lat_0=58 +lon_0=14.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10025 # ETRS89 / NTM zone 15 + NN2000 height
10026 <5955> +proj=tmerc +lat_0=58 +lon_0=15.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10027 # ETRS89 / NTM zone 16 + NN2000 height
10028 <5956> +proj=tmerc +lat_0=58 +lon_0=16.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10029 # ETRS89 / NTM zone 17 + NN2000 height
10030 <5957> +proj=tmerc +lat_0=58 +lon_0=17.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10031 # ETRS89 / NTM zone 18 + NN2000 height
10032 <5958> +proj=tmerc +lat_0=58 +lon_0=18.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10033 # ETRS89 / NTM zone 19 + NN2000 height
10034 <5959> +proj=tmerc +lat_0=58 +lon_0=19.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10035 # ETRS89 / NTM zone 20 + NN2000 height
10036 <5960> +proj=tmerc +lat_0=58 +lon_0=20.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10037 # ETRS89 / NTM zone 21 + NN2000 height
10038 <5961> +proj=tmerc +lat_0=58 +lon_0=21.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10039 # ETRS89 / NTM zone 22 + NN2000 height
10040 <5962> +proj=tmerc +lat_0=58 +lon_0=22.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10041 # ETRS89 / NTM zone 23 + NN2000 height
10042 <5963> +proj=tmerc +lat_0=58 +lon_0=23.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10043 # ETRS89 / NTM zone 24 + NN2000 height
10044 <5964> +proj=tmerc +lat_0=58 +lon_0=24.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10045 # ETRS89 / NTM zone 25 + NN2000 height
10046 <5965> +proj=tmerc +lat_0=58 +lon_0=25.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10047 # ETRS89 / NTM zone 26 + NN2000 height
10048 <5966> +proj=tmerc +lat_0=58 +lon_0=26.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10049 # ETRS89 / NTM zone 27 + NN2000 height
10050 <5967> +proj=tmerc +lat_0=58 +lon_0=27.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10051 # ETRS89 / NTM zone 28 + NN2000 height
10052 <5968> +proj=tmerc +lat_0=58 +lon_0=28.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10053 # ETRS89 / NTM zone 29 + NN2000 height
10054 <5969> +proj=tmerc +lat_0=58 +lon_0=29.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10055 # ETRS89 / NTM zone 30 + NN2000 height
10056 <5970> +proj=tmerc +lat_0=58 +lon_0=30.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10057 # ETRS89 / UTM zone 31 + NN2000 height
10058 <5971> +proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10059 # ETRS89 / UTM zone 32 + NN2000 height
10060 <5972> +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10061 # ETRS89 / UTM zone 33 + NN2000 height
10062 <5973> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10063 # ETRS89 / UTM zone 34 + NN2000 height
10064 <5974> +proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10065 # ETRS89 / UTM zone 35 + NN2000 height
10066 <5975> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10067 # ETRS89 / UTM zone 36 + NN2000 height
10068 <5976> +proj=utm +zone=36 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10069 # ETRS89 + NN54 height
10070 <6144> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +vunits=m +no_defs <>
10071 # ETRS89 / NTM zone 5 + NN54 height
10072 <6145> +proj=tmerc +lat_0=58 +lon_0=5.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10073 # ETRS89 / NTM zone 6 + NN54 height
10074 <6146> +proj=tmerc +lat_0=58 +lon_0=6.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10075 # ETRS89 / NTM zone 7 + NN54 height
10076 <6147> +proj=tmerc +lat_0=58 +lon_0=7.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10077 # ETRS89 / NTM zone 8 + NN54 height
10078 <6148> +proj=tmerc +lat_0=58 +lon_0=8.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10079 # ETRS89 / NTM zone 9 + NN54 height
10080 <6149> +proj=tmerc +lat_0=58 +lon_0=9.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10081 # ETRS89 / NTM zone 10 + NN54 height
10082 <6150> +proj=tmerc +lat_0=58 +lon_0=10.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10083 # ETRS89 / NTM zone 11 + NN54 height
10084 <6151> +proj=tmerc +lat_0=58 +lon_0=11.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10085 # ETRS89 / NTM zone 12 + NN54 height
10086 <6152> +proj=tmerc +lat_0=58 +lon_0=12.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10087 # ETRS89 / NTM zone 13 + NN54 height
10088 <6153> +proj=tmerc +lat_0=58 +lon_0=13.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10089 # ETRS89 / NTM zone 14 + NN54 height
10090 <6154> +proj=tmerc +lat_0=58 +lon_0=14.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10091 # ETRS89 / NTM zone 15 + NN54 height
10092 <6155> +proj=tmerc +lat_0=58 +lon_0=15.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10093 # ETRS89 / NTM zone 16 + NN54 height
10094 <6156> +proj=tmerc +lat_0=58 +lon_0=16.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10095 # ETRS89 / NTM zone 17 + NN54 height
10096 <6157> +proj=tmerc +lat_0=58 +lon_0=17.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10097 # ETRS89 / NTM zone 18 + NN54 height
10098 <6158> +proj=tmerc +lat_0=58 +lon_0=18.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10099 # ETRS89 / NTM zone 19 + NN54 height
10100 <6159> +proj=tmerc +lat_0=58 +lon_0=19.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10101 # ETRS89 / NTM zone 20 + NN54 height
10102 <6160> +proj=tmerc +lat_0=58 +lon_0=20.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10103 # ETRS89 / NTM zone 21 + NN54 height
10104 <6161> +proj=tmerc +lat_0=58 +lon_0=21.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10105 # ETRS89 / NTM zone 22 + NN54 height
10106 <6162> +proj=tmerc +lat_0=58 +lon_0=22.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10107 # ETRS89 / NTM zone 23 + NN54 height
10108 <6163> +proj=tmerc +lat_0=58 +lon_0=23.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10109 # ETRS89 / NTM zone 24 + NN54 height
10110 <6164> +proj=tmerc +lat_0=58 +lon_0=24.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10111 # ETRS89 / NTM zone 25 + NN54 height
10112 <6165> +proj=tmerc +lat_0=58 +lon_0=25.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10113 # ETRS89 / NTM zone 26 + NN54 height
10114 <6166> +proj=tmerc +lat_0=58 +lon_0=26.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10115 # ETRS89 / NTM zone 27 + NN54 height
10116 <6167> +proj=tmerc +lat_0=58 +lon_0=27.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10117 # ETRS89 / NTM zone 28 + NN54 height
10118 <6168> +proj=tmerc +lat_0=58 +lon_0=28.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10119 # ETRS89 / NTM zone 29 + NN54 height
10120 <6169> +proj=tmerc +lat_0=58 +lon_0=29.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10121 # ETRS89 / NTM zone 30 + NN54 height
10122 <6170> +proj=tmerc +lat_0=58 +lon_0=30.5 +k=1 +x_0=100000 +y_0=1000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10123 # ETRS89 / UTM zone 31 + NN54 height
10124 <6171> +proj=utm +zone=31 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10125 # ETRS89 / UTM zone 32 + NN54 height
10126 <6172> +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10127 # ETRS89 / UTM zone 33 + NN54 height
10128 <6173> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10129 # ETRS89 / UTM zone 34 + NN54 height
10130 <6174> +proj=utm +zone=34 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10131 # ETRS89 / UTM zone 35 + NN54 height
10132 <6175> +proj=utm +zone=35 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10133 # ETRS89 / UTM zone 36 + NN54 height
10134 <6176> +proj=utm +zone=36 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10135 # Belge 1972 / Belgian Lambert 72 + Ostend height
10136 <6190> +proj=lcc +lat_1=51.16666723333333 +lat_2=49.8333339 +lat_0=90 +lon_0=4.367486666666666 +x_0=150000.013 +y_0=5400088.438 +ellps=intl +towgs84=-106.869,52.2978,-103.724,0.3366,-0.457,1.8422,-1.2747 +units=m +vunits=m +no_defs <>
10137 # NAD83(2011) + NAVD88 height
10138 <6349> +proj=longlat +ellps=GRS80 +geoidgrids=g2012a_conus.gtx,g2012a_alaska.gtx,g2012a_guam.gtx,g2012a_hawaii.gtx,g2012a_puertorico.gtx,g2012a_samoa.gtx +vunits=m +no_defs <>
10139 # NAD83(CSRS) + CGVD2013 height
10140 <6649> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +vunits=m +no_defs <>
10141 # NAD83(CSRS) / UTM zone 7N + CGVD2013 height
10142 <6650> +proj=utm +zone=7 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10143 # NAD83(CSRS) / UTM zone 8N + CGVD2013 height
10144 <6651> +proj=utm +zone=8 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10145 # NAD83(CSRS) / UTM zone 9N + CGVD2013 height
10146 <6652> +proj=utm +zone=9 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10147 # NAD83(CSRS) / UTM zone 10N + CGVD2013 height
10148 <6653> +proj=utm +zone=10 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10149 # NAD83(CSRS) / UTM zone 11N + CGVD2013 height
10150 <6654> +proj=utm +zone=11 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10151 # NAD83(CSRS) / UTM zone 12N + CGVD2013 height
10152 <6655> +proj=utm +zone=12 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10153 # NAD83(CSRS) / UTM zone 13N + CGVD2013 height
10154 <6656> +proj=utm +zone=13 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10155 # NAD83(CSRS) / UTM zone 14N + CGVD2013 height
10156 <6657> +proj=utm +zone=14 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10157 # NAD83(CSRS) / UTM zone 15N + CGVD2013 height
10158 <6658> +proj=utm +zone=15 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10159 # NAD83(CSRS) / UTM zone 16N + CGVD2013 height
10160 <6659> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10161 # NAD83(CSRS) / UTM zone 17N + CGVD2013 height
10162 <6660> +proj=utm +zone=17 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10163 # NAD83(CSRS) / UTM zone 18N + CGVD2013 height
10164 <6661> +proj=utm +zone=18 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10165 # NAD83(CSRS) / UTM zone 19N + CGVD2013 height
10166 <6662> +proj=utm +zone=19 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10167 # NAD83(CSRS) / UTM zone 20N + CGVD2013 height
10168 <6663> +proj=utm +zone=20 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10169 # NAD83(CSRS) / UTM zone 21N + CGVD2013 height
10170 <6664> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10171 # NAD83(CSRS) / UTM zone 22N + CGVD2013 height
10172 <6665> +proj=utm +zone=22 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10173 # JGD2000 + JGD2000 (vertical) height
10174 <6696> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +vunits=m +no_defs <>
10175 # JGD2011 + JGD2011 (vertical) height
10176 <6697> +proj=longlat +ellps=GRS80 +vunits=m +no_defs <>
10177 # Tokyo + JSLD72 height
10178 <6700> +proj=longlat +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +vunits=m +no_defs <>
10179 # WGS 84 / Pseudo-Mercator + EGM2008 geoid height
10180 <6871> +proj=merc +lon_0=0 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm08_25.gtx +vunits=m +no_defs <>
10181 # NTF (Paris) + NGF IGN69 height
10182 <7400> +proj=longlat +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +vunits=m +no_defs <>
10183 # NTF (Paris) / France II + NGF Lallemand
10184 <7401> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10185 # NTF (Paris) / France II + NGF IGN69
10186 <7402> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10187 # NTF (Paris) / France III + NGF IGN69
10188 <7403> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10189 # RT90 + RH70 height
10190 <7404> +proj=longlat +ellps=bessel +towgs84=414.1,41.3,603.1,-0.855,2.141,-7.023,0 +vunits=m +no_defs <>
10191 # OSGB 1936 / British National Grid + ODN height
10192 <7405> +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +datum=OSGB36 +units=m +vunits=m +no_defs <>
10193 # NAD27 + NGVD29 height
10194 <7406> +proj=longlat +datum=NAD27 +vunits=us-ft +no_defs <>
10195 # NAD27 / Texas North + NGVD29 height
10196 <7407> +proj=lcc +lat_1=34.65 +lat_2=36.18333333333333 +lat_0=34 +lon_0=-101.5 +x_0=609601.2192024384 +y_0=0 +datum=NAD27 +units=us-ft +vunits=us-ft +no_defs <>
10197 # RD/NAP
10198 <7408> +proj=longlat +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +vunits=m +no_defs <>
10199 # ETRS89 + EVRF2000 height
10200 <7409> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +vunits=m +no_defs <>
10201 # PSHD93
10202 <7410> +proj=longlat +ellps=clrk80 +towgs84=-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.7101 +vunits=m +no_defs <>
10203 # NTF (Paris) / Lambert zone II + NGF Lallemand height
10204 <7411> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10205 # NTF (Paris) / Lambert zone II + NGF IGN69
10206 <7412> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10207 # NTF (Paris) / Lambert zone III + NGF IGN69
10208 <7413> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10209 # Tokyo + JSLD69 height
10210 <7414> +proj=longlat +ellps=bessel +towgs84=-146.414,507.337,680.507,0,0,0,0 +vunits=m +no_defs <>
10211 # Amersfoort / RD New + NAP height
10212 <7415> +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725 +units=m +vunits=m +no_defs <>
10213 # ETRS89 / UTM zone 32N + DVR90 height
10214 <7416> +proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10215 # ETRS89 / UTM zone 33N + DVR90 height
10216 <7417> +proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10217 # ETRS89 / Kp2000 Jutland + DVR90 height
10218 <7418> +proj=tmerc +lat_0=0 +lon_0=9.5 +k=0.99995 +x_0=200000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10219 # ETRS89 / Kp2000 Zealand + DVR90 height
10220 <7419> +proj=tmerc +lat_0=0 +lon_0=12 +k=0.99995 +x_0=500000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10221 # ETRS89 / Kp2000 Bornholm + DVR90 height
10222 <7420> +proj=tmerc +lat_0=0 +lon_0=15 +k=1 +x_0=900000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +vunits=m +no_defs <>
10223 # NTF (Paris) / Lambert zone II + NGF-IGN69 height
10224 <7421> +proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=0 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10225 # NTF (Paris) / Lambert zone III + NGF-IGN69 height
10226 <7422> +proj=lcc +lat_1=44.10000000000001 +lat_0=44.10000000000001 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=3200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +vunits=m +no_defs <>
10227 # ETRS89 + EVRF2007 height
10228 <7423> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +vunits=m +no_defs <>
00 ##############################################################
11 Point in the ONwinsor subgrid.
2 82d00'00.000"W 42d00'00.000"N 0.0 81d59'59.61037"W 42d0'0.1602"N 0.000
3 82d00'01.000"W 42d00'00.000"N 0.0 82d0'0.610403"W 42d0'0.160204"N 0.000
4 82d00'02.000"W 42d00'00.000"N 0.0 82d0'1.610436"W 42d0'0.160209"N 0.000
5 84d00'00.000"W 42d00'00.000"N 0.0 83d59'59.85928"W 42d0'0.18003"N 0.000
2 82d00'00.000"W 42d00'00.000"N 0.0 81d59'59.6104"W 42d0'0.1602"N 0.000
3 82d00'01.000"W 42d00'00.000"N 0.0 82d0'0.6104"W 42d0'0.1602"N 0.000
4 82d00'02.000"W 42d00'00.000"N 0.0 82d0'1.6104"W 42d0'0.1602"N 0.000
5 84d00'00.000"W 42d00'00.000"N 0.0 83d59'59.8593"W 42d0'0.18"N 0.000
66 ##############################################################
77 Try with NTv2 and NTv1 together ... falls back to NTv1
8 99d00'00.000"W 65d00'00.000"N 0.0 99d0'1.58847"W 65d0'1.34815"N 0.000
9 111d00'00.000"W 46d00'00.000"N 0.0 111d0'3.15487"W 45d59'59.75279"N 0.000
8 99d00'00.000"W 65d00'00.000"N 0.0 99d0'1.5885"W 65d0'1.3482"N 0.000
9 111d00'00.000"W 46d00'00.000"N 0.0 111d0'3.1549"W 45d59'59.7528"N 0.000
1010 111d00'00.000"W 47d30'00.000"N 0.0 111d0'2.7989"W 47d29'59.9896"N 0.000
3434 echo Point in the ONwinsor subgrid. >> ${OUT}
3535 #
3636 $EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv2_0.gsb \
37 +to +proj=latlong +datum=NAD83 -E -w6 >>${OUT} <<EOF
37 +to +proj=latlong +datum=NAD83 -E -w4 >>${OUT} <<EOF
3838 82d00'00.000"W 42d00'00.000"N 0.0
3939 82d00'01.000"W 42d00'00.000"N 0.0
4040 82d00'02.000"W 42d00'00.000"N 0.0
4545 echo Try with NTv2 and NTv1 together ... falls back to NTv1 >> ${OUT}
4646 #
4747 $EXE +proj=latlong +ellps=clrk66 +nadgrids=ntv2_0.gsb,ntv1_can.dat,conus \
48 +to +proj=latlong +datum=NAD83 -E -w6 >>${OUT} <<EOF
48 +to +proj=latlong +datum=NAD83 -E -w4 >>${OUT} <<EOF
4949 99d00'00.000"W 65d00'00.000"N 0.0
5050 111d00'00.000"W 46d00'00.000"N 0.0
5151 111d00'00.000"W 47d30'00.000"N 0.0
66
77 usage()
88 {
9 echo "Usage: ${0} <path to 'cs2cs' program>"
9 echo "Usage: ${0} <path to 'cs2cs' program>"
1010 echo
1111 exit 1
1212 }
130130 #echo "#############################################################" >> ${OUT}
131131 #echo Test conversion between geocentric latlong and geodetic latlong >> ${OUT}
132132 #
133 # The +geoc flag does not currently work with pj_transform() so this is
134 # disabled.
133 # The +geoc flag does not currently work with pj_transform() so this is
134 # disabled.
135135 #
136136 #$EXE +proj=latlong +datum=WGS84 +geoc \
137137 # +to +proj=latlong +datum=WGS84 \
191191 +to +proj=latlong +datum=WGS84 \
192192 -E >>${OUT} <<EOF
193193 10000 20000
194 500000 2000000
195 1000000 2000000
196 2000000 2000000
197 4000000 2000000
194 500000 2000000
195 1000000 2000000
196 2000000 2000000
197 4000000 2000000
198198 EOF
199199 #
200200 echo "##############################################################" >> ${OUT}
204204 +to +proj=etmerc +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \
205205 -E >>${OUT} <<EOF
206206 0dN 0.000
207 15d22'16.108"W 17d52'53.478"N 0.000
208 10d40'55.532"W 17d42'48.526"N 0.000
209 1d32'21.33"W 17d3'47.233"N 0.000
210 15d4'42.357"E 14d48'56.372"N 0.000
207 15d22'16.108"W 17d52'53.478"N 0.000
208 10d40'55.532"W 17d42'48.526"N 0.000
209 1d32'21.33"W 17d3'47.233"N 0.000
210 15d4'42.357"E 14d48'56.372"N 0.000
211211 EOF
212212 #
213213 echo "##############################################################" >> ${OUT}
217217 +to +proj=latlong +datum=WGS84 \
218218 -E >>${OUT} <<EOF
219219 10000 20000
220 500000 2000000
221 1000000 2000000
222 2000000 2000000
223 4000000 2000000
220 500000 2000000
221 1000000 2000000
222 2000000 2000000
223 4000000 2000000
224224 EOF
225225 #
226226 echo "##############################################################" >> ${OUT}
230230 +to +proj=tmerc +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \
231231 -E >>${OUT} <<EOF
232232 0dN 0.000
233 15d22'16.108"W 17d52'53.478"N 0.000
234 10d40'55.532"W 17d42'48.526"N 0.000
235 1d32'21.33"W 17d3'47.233"N 0.000
236 15d4'42.357"E 14d48'56.372"N 0.000
233 15d22'16.108"W 17d52'53.478"N 0.000
234 10d40'55.532"W 17d42'48.526"N 0.000
235 1d32'21.33"W 17d3'47.233"N 0.000
236 15d4'42.357"E 14d48'56.372"N 0.000
237237 EOF
238238 #
239239 echo "##############################################################" >> ${OUT}
242242 $EXE +proj=latlong +datum=WGS84 \
243243 +to +proj=robin +datum=WGS84 \
244244 -E >>${OUT} <<EOF
245 -30 40
245 -30 40
246246 -35 45
247 EOF
248 echo "##############################################################" >> ${OUT}
249 echo "Test forward projection on sphere" >> ${OUT}
247 20 40
248 EOF
249 $EXE +proj=robin +datum=WGS84 \
250 +to +proj=latlong +datum=WGS84 \
251 -E >>${OUT} <<EOF
252 -2612095.95 4276351.58 0.00
253 -2963455.42 4805073.65 0.00
254 1741397.30 4276351.58 0.00
255 EOF
256 echo "##############################################################" >> ${OUT}
257 echo "Test healpix forward projection on sphere" >> ${OUT}
250258 $EXE +proj=latlong +a=1 +lon_0=0 \
251259 +to +proj=healpix +a=1 +lon_0=0 -f '%.'5'f' \
252260 -E >>${OUT} <<EOF
253261 0 41.81031
254262 -90 0
255263 EOF
256 echo "Test inverse projection on sphere" >> ${OUT}
264 $EXE +proj=latlong +R=5 \
265 +to +proj=healpix +R=5 -f '%.'5'f' \
266 -E >>${OUT} <<EOF
267 0 0
268 0 41.810314895778596
269 0 -41.810314895778596
270 90.0 0
271 -90.0 0
272 -180 0
273 -180 90.0
274 -180 -90.0
275 0 60.0
276 0 -60.0
277 EOF
278 echo "Test healpix inverse projection on sphere" >> ${OUT}
257279 $EXE +proj=latlong +a=1 +lon_0=0 \
258280 +to +proj=healpix +a=1 +lon_0=0 -f '%.'5'f' -I\
259281 -E >>${OUT} <<EOF
260282 0 0.7853981633974483
261283 -1.5707963267948966 0
262284 EOF
263 echo "Test forward projection on ellipsoid" >> ${OUT}
285 $EXE +proj=latlong +a=5 \
286 +to +proj=healpix +a=5 -f '%.'5'f' -I\
287 -E >>${OUT} <<EOF
288 0.0 0.0
289 0.0 3.9269908169872414
290 0.0 -3.9269908169872414
291 7.853981633974483 0.0
292 -7.853981633974483 0.0
293 -15.707963267948966 0.0
294 -11.780972450961723 7.853981633974483
295 -11.780972450961723 -7.853981633974483
296 1.437378399445537 5.364369216432778
297 1.437378399445537 -5.364369216432778
298 EOF
299 echo "Test healpix forward projection on ellipsoid" >> ${OUT}
264300 $EXE +proj=latlong +a=1 +lon_0=0 +ellps=WGS84 \
265301 +to +proj=healpix +a=1 +lon_0=0 +ellps=WGS84 -f '%.'5'f' \
266302 -E >>${OUT} <<EOF
267303 0 41.937853904844985
268304 -90 0
269305 EOF
270 echo "Test inverse projection on ellipsoid" >> ${OUT}
306 $EXE +proj=latlong +a=5 +e=0.8 +r_a=4.3220011711888882\
307 +to +proj=healpix +a=5 +e=0.8 +r_a=4.3220011711888882 -f '%.'5'f' \
308 -E >>${OUT} <<EOF
309 0 0
310 0 41.810314895778596
311 0 -41.810314895778596
312 90.0 0
313 -90.0 0
314 -180 0
315 -180 90.0
316 -180 -90.0
317 0 60.0
318 0 -60.0
319 EOF
320 echo "Test healpix inverse projection on ellipsoid" >> ${OUT}
271321 $EXE +proj=latlong +a=1 +lon_0=0 +ellps=WGS84 \
272322 +to +proj=healpix +a=1 +lon_0=0 +ellps=WGS84 -f '%.'5'f' -I\
273323 -E >>${OUT} <<EOF
274324 0 0.7853981633974483
275325 -1.5707963267948966 0
276326 EOF
277 echo "##############################################################" >> ${OUT}
278 echo "Test forward projection on sphere" >> ${OUT}
279 $EXE +proj=latlong +a=1 +lon_0=0 \
280 +to +proj=rhealpix +a=1 +lon_0=0 +npole=0 +spole=0 -f '%.'5'f' \
281 -E >>${OUT} <<EOF
282 0 41.81031
283 -90 0
284 EOF
285 echo "Test inverse projection on sphere" >> ${OUT}
286 $EXE +proj=latlong +a=1 +lon_0=0 \
287 +to +proj=rhealpix +a=1 +lon_0=0 +npole=0 +spole=0 -f '%.'5'f' -I\
288 -E >>${OUT} <<EOF
289 0 0.7853981633974483
290 -1.5707963267948966 0
291 EOF
292 echo "Test forward projection on ellipsoid" >> ${OUT}
293 $EXE +proj=latlong +a=1 +lon_0=0 +ellps=WGS84 \
294 +to +proj=rhealpix +a=1 +lon_0=0 +ellps=WGS84 +npole=0 +spole=0 -f '%.'5'f' \
295 -E >>${OUT} <<EOF
296 0 41.937853904844985
297 -90 0
298 EOF
299 echo "Test inverse projection on ellipsoid" >> ${OUT}
300 $EXE +proj=latlong +a=1 +lon_0=0 +ellps=WGS84 \
301 +to +proj=rhealpix +a=1 +lon_0=0 -I +ellps=WGS84 +npole=0 +spole=0 -f '%.'5'f'\
302 -E >>${OUT} <<EOF
303 0 0.7853981633974483
304 -1.5707963267948966 0
305 EOF
327 $EXE +proj=latlong +a=5 +e=0.8 +r_a=4.3220011711888882\
328 +to +proj=healpix +a=5 +e=0.8 +r_a=4.3220011711888882 -f '%.'5'f' -I\
329 -E >>${OUT} <<EOF
330 0.0 0.0
331 0.0 2.0547874222147415
332 0.0 -2.0547874222147415
333 6.788983564106746 0.0
334 -6.788983564106746 0.0
335 -13.577967128213492 0.0
336 -10.183475346160119 6.788983564106746
337 -10.183475346160119 -6.788983564106746
338 0.0 3.351278550178025
339 0.0 -3.351278550178025
340 EOF
341
342 echo "##############################################################" >> ${OUT}
343 echo "Test rHEALPix forward projection on sphere north=0 south=0" >> ${OUT}
344 $EXE +proj=latlong +R=5 \
345 +to +proj=rhealpix +R=5 +north_square=0 +south_square=0 -f '%.'5'f' \
346 -E >>${OUT} <<EOF
347 -180 30.0
348 -180 -25.714285714285715
349 0 0
350 60.0 41.809314895778598
351 EOF
352
353 echo "##############################################################" >> ${OUT}
354 echo "Test rHEALPix forward projection on sphere north=1 south=1" >> ${OUT}
355 $EXE +proj=latlong +R=5 \
356 +to +proj=rhealpix +R=5 +north_square=1 +south_square=1 -f '%.'5'f' \
357 -E >>${OUT} <<EOF
358 -180 30.0
359 -180 -25.714285714285715
360 0 0
361 60.0 41.809314895778598
362 EOF
363
364 echo "##############################################################" >> ${OUT}
365 echo "Test rHEALPix inverse projection on sphere north=0 south=0" >> ${OUT}
366 $EXE +proj=latlong +R=5 \
367 +to +proj=rhealpix +R=5 +north_square=0 +south_square=0 -f '%.'5'f' -I\
368 -E >>${OUT} <<EOF
369 0.0 0.0
370 0.0 3.9269908169872414
371 0.0 -3.9269908169872414
372 7.853981633974483 0.0
373 -7.853981633974483 0.0
374 EOF
375
376 echo "##############################################################" >> ${OUT}
377 echo "Test rHEALPix inverse projection on sphere north=1 south=1" >> ${OUT}
378 $EXE +proj=latlong +R=5 \
379 +to +proj=rhealpix +R=5 +north_square=1 +south_square=1 -f '%.'5'f' -I\
380 -E >>${OUT} <<EOF
381 0.0 0.0
382 0.0 3.9269908169872414
383 0.0 -3.9269908169872414
384 7.853981633974483 0.0
385 -7.853981633974483 0.0
386 EOF
387
388 echo "##############################################################" >> ${OUT}
389 echo "Test rHEALPix forward projection on ellipsoid north=0 south=0" >> ${OUT}
390 $EXE +proj=latlong +a=5 +e=0.8 +r_a=4.3220011711888882\
391 +to +proj=rhealpix +a=5 +e=0.8 +r_a=4.3220011711888882 +north_square=0 +south_square=0 -f '%.'5'f' \
392 -E >>${OUT} <<EOF
393 0 0
394 0 41.810314895778596
395 0 -41.810314895778596
396 90.0 0
397 -90.0 0
398 EOF
399
400 echo "##############################################################" >> ${OUT}
401 echo "Test rHEALPix forward projection on ellipsoid north=1 south=1" >> ${OUT}
402 $EXE +proj=latlong +a=5 +e=0.8 +r_a=4.3220011711888882\
403 +to +proj=rhealpix +a=5 +e=0.8 +r_a=4.3220011711888882 +north_square=1 +south_square=1 -f '%.'5'f' \
404 -E >>${OUT} <<EOF
405 0 0
406 0 41.810314895778596
407 0 -41.810314895778596
408 90.0 0
409 -90.0 0
410 EOF
411
412 echo "##############################################################" >> ${OUT}
413 echo "Test rHEALPix inverse projection on ellipsoid north=0 south=0" >> ${OUT}
414 $EXE +proj=latlong +a=5 +e=0.8 +r_a=4.3220011711888882\
415 +to +proj=rhealpix +a=5 -I +e=0.8 +r_a=4.3220011711888882 +north_square=0 +south_square=0 -f '%.'5'f'\
416 -E >>${OUT} <<EOF
417 0.0 0.0
418 0.0 2.0547874222147415
419 0.0 -2.0547874222147415
420 6.788983564106746 0.0
421 -6.788983564106746 0.0
422 EOF
423
424 echo "##############################################################" >> ${OUT}
425 echo "Test rHEALPix inverse projection on ellipsoid north=1 south=1" >> ${OUT}
426 $EXE +proj=latlong +a=5 +e=0.8 +r_a=4.3220011711888882\
427 +to +proj=rhealpix +a=5 -I +e=0.8 +r_a=4.3220011711888882 +north_square=1 +south_square=1 -f '%.'5'f'\
428 -E >>${OUT} <<EOF
429 0.0 0.0
430 0.0 2.0547874222147415
431 0.0 -2.0547874222147415
432 6.788983564106746 0.0
433 -6.788983564106746 0.0
434 EOF
435
306436 echo "##############################################################" >> ${OUT}
307437 echo "Test geos projection" >> ${OUT}
308438 echo "Test geos on a sphere" >> ${OUT}
339469 EOF
340470 echo "Test geos on a sphere with alternate sweep" >> ${OUT}
341471 $EXE +proj=latlong +ellps=sphere \
342 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=sphere +sweep=y -E >>${OUT} <<EOF
472 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=sphere +sweep=x -E >>${OUT} <<EOF
343473 16d11'8" 58d35'31"
344474 -43d11'47" -22d54'30"
345475 18d25'26" -33d55'31"
347477 EOF
348478 echo "Test geos on a ellipsoid with alternate sweep" >> ${OUT}
349479 $EXE +proj=latlong +ellps=sphere \
350 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=WGS84 +sweep=y -E >>${OUT} <<EOF
480 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=WGS84 +sweep=x -E >>${OUT} <<EOF
351481 16d11'8" 58d35'31"
352482 -43d11'47" -22d54'30"
353483 18d25'26" -33d55'31"
355485 EOF
356486 echo "Test inv geos on a sphere with alternate sweep" >> ${OUT}
357487 $EXE +proj=latlong +ellps=sphere \
358 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=sphere +sweep=y -I -E >>${OUT} <<EOF
488 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=sphere +sweep=x -I -E >>${OUT} <<EOF
359489 841586.28 4961396.21
360490 -3772913.22 -2339604.71
361491 1601377.77 -3415545.15
363493 EOF
364494 echo "Test inv geos on a ellipsoid with alternate sweep" >> ${OUT}
365495 $EXE +proj=latlong +ellps=sphere \
366 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=WGS84 +sweep=y -I -E >>${OUT} <<EOF
496 +to +proj=geos +h=35785831.0 +lon_0=0 +ellps=WGS84 +sweep=x -I -E >>${OUT} <<EOF
367497 844731.03 4946509.59
368498 -3779077.27 -2327750.87
369499 1605067.15 -3400461.47
414544 -E >>${OUT} <<EOF
415545 -2240096.40 -6940342.15
416546 EOF
547 echo "##############################################################" >> ${OUT}
548 echo "Test laea" >> ${OUT}
549 #
550 $EXE -f '%.12f' \
551 +proj=laea +lat_0=45 +lon_0=-100 +units=m +datum=WGS84 +no_defs \
552 +to +proj=latlong +datum=WGS84 \
553 -E >>${OUT} <<EOF
554 -6086629.0 4488761.0
555 EOF
556 echo "##############################################################" >> ${OUT}
557 echo "Test forward calcofi projection" >> ${OUT}
558 $EXE +proj=latlong +ellps=clrk66 \
559 +to +proj=calcofi +ellps=clrk66 \
560 -E >>${OUT} <<EOF
561 120d40'42.273"W 38d56'50.766"N
562 121d9'W 34d9'N
563 123d59'56.066"W 30d25'4.617"N
564 EOF
565 echo "Test inverse calcofi projection" >> ${OUT}
566 $EXE +proj=calcofi +ellps=clrk66 \
567 +to +proj=longlat +ellps=clrk66 \
568 -E >>${OUT} <<EOF
569 60 20
570 80 60
571 90 120
572 EOF
573 echo "##############################################################" >> ${OUT}
574 echo "Check inverse error handling with ob_tran (#225)" >> ${OUT}
575 $EXE +proj=ob_tran \
576 +o_proj=moll +o_lon_p=LON_POLE +o_lat_p=LAT_POLE +lon_0=180 +ellps=WGS84 \
577 -E >>${OUT} <<EOF
578 300000 400000
579 20000000 30000000
580 EOF
581 echo "Test inverse handling" >> ${OUT}
582 $EXE -I +proj=ob_tran \
583 +o_proj=moll +o_lon_p=LON_POLE +o_lat_p=LAT_POLE +lon_0=180 +ellps=WGS84 \
584 -E >>${OUT} <<EOF
585 10 20
586 EOF
587 echo "##############################################################" >> ${OUT}
588 echo "Test MGI datum gives expected results (#207)" >> ${OUT}
589 #
590 $EXE -f '%.14f' \
591 +proj=latlong +datum=WGS84 \
592 +to +init=epsg:31284 \
593 -E >>${OUT} <<EOF
594 16.33 48.20
595 EOF
596 echo "##############################################################" >> ${OUT}
597 echo "Test omerc sensitivity with locations 90d from origin(#114)" >> ${OUT}
598 #
599 $EXE -f '%.14f' \
600 +proj=latlong +ellps=WGS84 \
601 +to +proj=omerc +ellps=WGS84 +lon_1=62.581150 +lat_1=74.856102 \
602 +lon_2=53.942810 +lat_2=74.905884 +units=km +no_rot +no_defs \
603 -E >>${OUT} <<EOF
604 56.958381652832 72.8798
605 56.9584 72.8798
606 EOF
607 echo "##############################################################" >> ${OUT}
608 echo "Test omerc differences between poles (#190)" >> ${OUT}
609 # First, north pole.
610 $EXE -f '%.3f' \
611 +proj=latlong +ellps=WGS84 \
612 +to +proj=omerc +ellps=WGS84 +datum=WGS84 +no_rot \
613 +lon_1=-27 +lat_1=70 +lon_2=-38 +lat_2=80 +lat_0=70 \
614 -E >>${OUT} <<EOF
615 -27 70
616 -27 80
617 -27 89.9
618 163 89.9
619 163 80
620 EOF
621 # Again, for the south pole.
622 $EXE -f '%.3f' \
623 +proj=latlong +ellps=WGS84 \
624 +to +proj=omerc +ellps=WGS84 +datum=WGS84 +no_rot \
625 +lon_1=-27 +lat_1=-70 +lon_2=-38 +lat_2=-80 +lat_0=-70 \
626 -E >>${OUT} <<EOF
627 -27 -70
628 -27 -80
629 -27 -89.9
630 163 -89.9
631 163 -80
632 EOF
633 echo "##############################################################" >> ${OUT}
634 echo "Test qsc" >> ${OUT}
635 #
636 $EXE -f '%.13f' \
637 +proj=latlong +datum=WGS84 \
638 +to +proj=qsc +datum=WGS84 +no_defs \
639 -E >>${OUT} <<EOF
640 13 -10
641 EOF
642 $EXE -f '%.13f' \
643 +proj=qsc +datum=WGS84 +no_defs \
644 +to +proj=latlong +datum=WGS84 \
645 -E >>${OUT} <<EOF
646 2073986.94908809568733 -1680858.27222427958623
647 EOF
648 echo "##############################################################" >> ${OUT}
649 echo "Test bug 229" >> ${OUT}
650 #
651 $EXE -f '%.13f' \
652 +init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0 \
653 +to +proj=latlong +datum=WGS84 +no_defs \
654 -E >>${OUT} <<EOF
655 13 -10
656 EOF
657 echo "##############################################################" >> ${OUT}
658 echo "Test bug 229 (2)" >> ${OUT}
659 #
660 $EXE -f '%.13f' \
661 +init=epsg:4326 +to +init=epsg:4326 \
662 -E >>${OUT} <<EOF
663 13 -10
664 EOF
665 echo "##############################################################" >> ${OUT}
666 echo "Test bug 244 " >> ${OUT}
667 #
668 $EXE -f '%.12f' \
669 +init=epsg:4326 \
670 +to +proj=aeqd +lon_0=130.0 +lat_0=40.0 +a=6378137 +b=6378137 +units=m +no_defs \
671 -E >>${OUT} <<EOF
672 -140.100000 -87.000000
673 EOF
674 echo "##############################################################" >> ${OUT}
675 echo "Test bug 244 (2)" >> ${OUT}
676 #
677 $EXE -f '%.12f' \
678 +proj=aeqd +lon_0=130.0 +lat_0=40.0 +a=6378137 +b=6378137 +units=m +no_defs \
679 +to +init=epsg:4326 \
680 -E >>${OUT} <<EOF
681 987122.4183302754536 -14429896.5395309105515
682 EOF
683 echo "##############################################################" >> ${OUT}
684 echo "Test bug 245 (use +datum=carthage)" >> ${OUT}
685 #
686 $EXE -f '%.12f' \
687 +proj=longlat +datum=WGS84 +nodefs +to +proj=utm +zone=32 +datum=carthage +nodefs \
688 -E >>${OUT} <<EOF
689 10 34
690 EOF
691 echo "##############################################################" >> ${OUT}
692 echo "Test bug 245 (use expension of +datum=carthage)" >> ${OUT}
693 #
694 $EXE -f '%.12f' \
695 +proj=longlat +datum=WGS84 +nodefs +to +proj=utm +zone=32 +a=6378249.2 +b=6356515 +towgs84=-263.0,6.0,431.0 +nodefs \
696 -E >>${OUT} <<EOF
697 10 34
698 EOF
417699 ##############################################################################
418 # Done!
700 # Done!
419701 # do 'diff' with distribution results
420702 echo "diff ${OUT} with ${OUT}.dist"
421703 diff -b ${OUT} ${OUT}.dist
5757 ##############################################################
5858 Test extended transverse mercator (#97)
5959 10000 20000 20dW 0dN 0.000
60 500000 2000000 15d22'16.108"W 17d52'53.478"N 0.000
61 1000000 2000000 10d40'55.532"W 17d42'48.526"N 0.000
62 2000000 2000000 1d32'21.33"W 17d3'47.233"N 0.000
63 4000000 2000000 15d4'42.357"E 14d48'56.372"N 0.000
60 500000 2000000 15d22'16.108"W 17d52'53.478"N 0.000
61 1000000 2000000 10d40'55.532"W 17d42'48.526"N 0.000
62 2000000 2000000 1d32'21.33"W 17d3'47.233"N 0.000
63 4000000 2000000 15d4'42.357"E 14d48'56.372"N 0.000
6464 ##############################################################
6565 Test extended transverse mercator inverse (#97)
6666 0dN 0.000 2278817.00 20000.00 0.00
67 15d22'16.108"W 17d52'53.478"N 0.000 499999.99 2000000.01 0.00
68 10d40'55.532"W 17d42'48.526"N 0.000 999999.99 1999999.99 0.00
69 1d32'21.33"W 17d3'47.233"N 0.000 2000000.00 1999999.99 0.00
70 15d4'42.357"E 14d48'56.372"N 0.000 4000000.00 2000000.01 0.00
67 15d22'16.108"W 17d52'53.478"N 0.000 499999.99 2000000.01 0.00
68 10d40'55.532"W 17d42'48.526"N 0.000 999999.99 1999999.99 0.00
69 1d32'21.33"W 17d3'47.233"N 0.000 2000000.00 1999999.99 0.00
70 15d4'42.357"E 14d48'56.372"N 0.000 4000000.00 2000000.01 0.00
7171 ##############################################################
7272 Test transverse mercator (#97)
7373 10000 20000 20dW 0dN 0.000
74 500000 2000000 15d22'16.108"W 17d52'53.478"N 0.000
75 1000000 2000000 10d40'55.532"W 17d42'48.526"N 0.000
76 2000000 2000000 1d32'21.399"W 17d3'47.244"N 0.000
77 4000000 2000000 15d4'6.539"E 14d49'7.331"N 0.000
74 500000 2000000 15d22'16.108"W 17d52'53.478"N 0.000
75 1000000 2000000 10d40'55.532"W 17d42'48.526"N 0.000
76 2000000 2000000 1d32'21.399"W 17d3'47.244"N 0.000
77 4000000 2000000 15d4'6.539"E 14d49'7.331"N 0.000
7878 ##############################################################
7979 Test transverse mercator inverse (#97)
8080 0dN 0.000 2278812.96 20000.00 0.00
81 15d22'16.108"W 17d52'53.478"N 0.000 499999.99 2000000.01 0.00
82 10d40'55.532"W 17d42'48.526"N 0.000 999999.99 1999999.99 0.00
83 1d32'21.33"W 17d3'47.233"N 0.000 2000000.03 1999999.62 0.00
84 15d4'42.357"E 14d48'56.372"N 0.000 3999967.33 1999855.31 0.00
81 15d22'16.108"W 17d52'53.478"N 0.000 499999.99 2000000.01 0.00
82 10d40'55.532"W 17d42'48.526"N 0.000 999999.99 1999999.99 0.00
83 1d32'21.33"W 17d3'47.233"N 0.000 2000000.03 1999999.62 0.00
84 15d4'42.357"E 14d48'56.372"N 0.000 3999967.33 1999855.31 0.00
8585 ##############################################################
8686 Test robinson projection (#113)
87 -30 40 -2612095.95 4276351.58 0.00
87 -30 40 -2612095.95 4276351.58 0.00
8888 -35 45 -2963455.42 4805073.65 0.00
89 ##############################################################
90 Test forward projection on sphere
89 20 40 1741397.30 4276351.58 0.00
90 -2612095.95 4276351.58 0.00 30d0'0.004"W 40d0'0.066"N 0.000
91 -2963455.42 4805073.65 0.00 35dW 45dN 0.000
92 1741397.30 4276351.58 0.00 20d0'0.002"E 40d0'0.066"N 0.000
93 ##############################################################
94 Test healpix forward projection on sphere
9195 0 41.81031 0.00000 0.78540 0.00000
9296 -90 0 -1.57080 0.00000 0.00000
93 Test inverse projection on sphere
97 0 0 0.00000 0.00000 0.00000
98 0 41.810314895778596 0.00000 3.92699 0.00000
99 0 -41.810314895778596 0.00000 -3.92699 0.00000
100 90.0 0 7.85398 0.00000 0.00000
101 -90.0 0 -7.85398 0.00000 0.00000
102 -180 0 -15.70796 0.00000 0.00000
103 -180 90.0 -19.63495 7.85398 0.00000
104 -180 -90.0 -19.63495 -7.85398 0.00000
105 0 60.0 1.43738 5.36437 0.00000
106 0 -60.0 1.43738 -5.36437 0.00000
107 Test healpix inverse projection on sphere
94108 0 0.7853981633974483 0.00000 41.81031 0.00000
95109 -1.5707963267948966 0 -90.00000 0.00000 0.00000
96 Test forward projection on ellipsoid
97 0 41.937853904844985 0.00000 0.78540 0.00000
98 -90 0 -1.57080 0.00000 0.00000
99 Test inverse projection on ellipsoid
100 0 0.7853981633974483 0.00000 41.93785 0.00000
101 -1.5707963267948966 0 -90.00000 0.00000 0.00000
102 ##############################################################
103 Test forward projection on sphere
104 0 41.81031 0.00000 0.78540 0.00000
105 -90 0 -1.57080 0.00000 0.00000
106 Test inverse projection on sphere
107 0 0.7853981633974483 0.00000 41.81031 0.00000
108 -1.5707963267948966 0 -90.00000 0.00000 0.00000
109 Test forward projection on ellipsoid
110 0 41.937853904844985 0.00000 0.78540 0.00000
111 -90 0 -1.57080 0.00000 0.00000
112 Test inverse projection on ellipsoid
113 0 0.7853981633974483 0.00000 41.93785 0.00000
114 -1.5707963267948966 0 -90.00000 0.00000 0.00000
110 0.0 0.0 0.00000 0.00000 0.00000
111 0.0 3.9269908169872414 0.00000 41.81031 0.00000
112 0.0 -3.9269908169872414 0.00000 -41.81031 0.00000
113 7.853981633974483 0.0 90.00000 0.00000 0.00000
114 -7.853981633974483 0.0 -90.00000 0.00000 0.00000
115 -15.707963267948966 0.0 -180.00000 0.00000 0.00000
116 -11.780972450961723 7.853981633974483 -180.00000 90.00000 0.00000
117 -11.780972450961723 -7.853981633974483 -180.00000 -90.00000 0.00000
118 1.437378399445537 5.364369216432778 0.00000 60.00000 0.00000
119 1.437378399445537 -5.364369216432778 0.00000 -60.00000 0.00000
120 Test healpix forward projection on ellipsoid
121 0 41.937853904844985 0.00000 0.78452 0.00000
122 -90 0 -1.56904 0.00000 0.00000
123 0 0 0.00000 0.00000 0.00000
124 0 41.810314895778596 0.00000 2.05479 0.00000
125 0 -41.810314895778596 0.00000 -2.05479 0.00000
126 90.0 0 6.78898 0.00000 0.00000
127 -90.0 0 -6.78898 0.00000 0.00000
128 -180 0 -13.57797 0.00000 0.00000
129 -180 90.0 -16.97246 6.78898 0.00000
130 -180 -90.0 -16.97246 -6.78898 0.00000
131 0 60.0 0.00000 3.35128 0.00000
132 0 -60.0 0.00000 -3.35128 0.00000
133 Test healpix inverse projection on ellipsoid
134 0 0.7853981633974483 * * 0.00000
135 -1.5707963267948966 0 -90.10072 0.00000 0.00000
136 0.0 0.0 0.00000 0.00000 0.00000
137 0.0 2.0547874222147415 0.00000 39.58811 0.00000
138 0.0 -2.0547874222147415 0.00000 -39.58811 0.00000
139 6.788983564106746 0.0 90.00000 0.00000 0.00000
140 -6.788983564106746 0.0 -90.00000 0.00000 0.00000
141 -13.577967128213492 0.0 -180.00000 0.00000 0.00000
142 -10.183475346160119 6.788983564106746 -180.00000 90.00000 0.00000
143 -10.183475346160119 -6.788983564106746 -180.00000 -90.00000 0.00000
144 0.0 3.351278550178025 0.00000 59.23640 0.00000
145 0.0 -3.351278550178025 0.00000 -59.23640 0.00000
146 ##############################################################
147 Test rHEALPix forward projection on sphere north=0 south=0
148 -180 30.0 -15.70796 2.94524 0.00000
149 -180 -25.714285714285715 -15.70796 -2.55579 0.00000
150 0 0 0.00000 0.00000 0.00000
151 60.0 41.809314895778598 5.23599 3.92691 0.00000
152 ##############################################################
153 Test rHEALPix forward projection on sphere north=1 south=1
154 -180 30.0 -15.70796 2.94524 0.00000
155 -180 -25.714285714285715 -15.70796 -2.55579 0.00000
156 0 0 0.00000 0.00000 0.00000
157 60.0 41.809314895778598 5.23599 3.92691 0.00000
158 ##############################################################
159 Test rHEALPix inverse projection on sphere north=0 south=0
160 0.0 0.0 0.00000 0.00000 0.00000
161 0.0 3.9269908169872414 0.00000 41.81031 0.00000
162 0.0 -3.9269908169872414 0.00000 -41.81031 0.00000
163 7.853981633974483 0.0 90.00000 0.00000 0.00000
164 -7.853981633974483 0.0 -90.00000 0.00000 0.00000
165 ##############################################################
166 Test rHEALPix inverse projection on sphere north=1 south=1
167 0.0 0.0 0.00000 0.00000 0.00000
168 0.0 3.9269908169872414 0.00000 41.81031 0.00000
169 0.0 -3.9269908169872414 0.00000 -41.81031 0.00000
170 7.853981633974483 0.0 90.00000 0.00000 0.00000
171 -7.853981633974483 0.0 -90.00000 0.00000 0.00000
172 ##############################################################
173 Test rHEALPix forward projection on ellipsoid north=0 south=0
174 0 0 0.00000 0.00000 0.00000
175 0 41.810314895778596 0.00000 2.05479 0.00000
176 0 -41.810314895778596 0.00000 -2.05479 0.00000
177 90.0 0 6.78898 0.00000 0.00000
178 -90.0 0 -6.78898 0.00000 0.00000
179 ##############################################################
180 Test rHEALPix forward projection on ellipsoid north=1 south=1
181 0 0 0.00000 0.00000 0.00000
182 0 41.810314895778596 0.00000 2.05479 0.00000
183 0 -41.810314895778596 0.00000 -2.05479 0.00000
184 90.0 0 6.78898 0.00000 0.00000
185 -90.0 0 -6.78898 0.00000 0.00000
186 ##############################################################
187 Test rHEALPix inverse projection on ellipsoid north=0 south=0
188 0.0 0.0 0.00000 0.00000 0.00000
189 0.0 2.0547874222147415 0.00000 39.58811 0.00000
190 0.0 -2.0547874222147415 0.00000 -39.58811 0.00000
191 6.788983564106746 0.0 90.00000 0.00000 0.00000
192 -6.788983564106746 0.0 -90.00000 0.00000 0.00000
193 ##############################################################
194 Test rHEALPix inverse projection on ellipsoid north=1 south=1
195 0.0 0.0 0.00000 0.00000 0.00000
196 0.0 2.0547874222147415 0.00000 39.58811 0.00000
197 0.0 -2.0547874222147415 0.00000 -39.58811 0.00000
198 6.788983564106746 0.0 90.00000 0.00000 0.00000
199 -6.788983564106746 0.0 -90.00000 0.00000 0.00000
115200 ##############################################################
116201 Test geos projection
117202 Test geos on a sphere
185270 Test pconic (#148)
186271 -70.4 -23.65 -2240096.40 -6940342.15 0.00
187272 -2240096.40 -6940342.15 70d24'W 23d39'S 0.000
273 ##############################################################
274 Test laea
275 -6086629.0 4488761.0 156.058637988599 37.765458298678 0.000000000000
276 ##############################################################
277 Test forward calcofi projection
278 120d40'42.273"W 38d56'50.766"N 60.00 20.00 0.00
279 121d9'W 34d9'N 80.00 60.00 0.00
280 123d59'56.066"W 30d25'4.617"N 90.00 120.00 0.00
281 Test inverse calcofi projection
282 60 20 120d40'42.273"W 38d56'50.766"N 0.000
283 80 60 121d9'W 34d9'N 0.000
284 90 120 123d59'56.066"W 30d25'4.617"N 0.000
285 ##############################################################
286 Check inverse error handling with ob_tran (#225)
287 300000 400000 42d45'22.377"W 85d35'28.083"N 0.000
288 20000000 30000000 * * 0.000
289 Test inverse handling
290 10 20 -1384841.19 7581707.88 0.00
291 ##############################################################
292 Test MGI datum gives expected results (#207)
293 16.33 48.20 595710.37321015028283 5357598.46457545924932 -44.49510847218335
294 ##############################################################
295 Test omerc sensitivity with locations 90d from origin(#114)
296 56.958381652832 72.8798 -9985.16336452572614 -227.67701050320997 0.00000000000000
297 56.9584 72.8798 9985.16263662453457 -227.67701050313340 0.00000000000000
298 ##############################################################
299 Test omerc differences between poles (#190)
300 -27 70 7846957.203 0.000 0.000
301 -27 80 8944338.041 204911.652 0.000
302 -27 89.9 10033520.737 402158.063 0.000
303 163 89.9 10055728.173 404099.799 0.000
304 163 80 11163496.121 397796.828 0.000
305 -27 -70 -7846957.203 0.000 0.000
306 -27 -80 -8944338.041 204911.652 0.000
307 -27 -89.9 -10033520.737 402158.063 0.000
308 163 -89.9 -10055728.173 404099.799 0.000
309 163 -80 -11163496.121 397796.828 0.000
310 ##############################################################
311 Test qsc
312 13 -10 2073986.9490880956873 -1680858.2722242795862 0.0000000000000
313 2073986.94908809568733 -1680858.27222427958623 13.0000000000000 -10.0000000000000 0.0000000000000
314 ##############################################################
315 Test bug 229
316 13 -10 13.0000000000000 -10.0000000000000 0.0000000000000
317 ##############################################################
318 Test bug 229 (2)
319 13 -10 13.0000000000000 -10.0000000000000 0.0000000000000
320 ##############################################################
321 Test bug 244
322 -140.100000 -87.000000 987122.418330275454 -14429896.539530910552 0.000000000000
323 ##############################################################
324 Test bug 244 (2)
325 987122.4183302754536 -14429896.5395309105515 -140.100000000000 -87.000000000000 0.000000000000
326 ##############################################################
327 Test bug 245 (use +datum=carthage)
328 10 34 592302.981946153101 3762148.734061029274 -30.311017032713
329 ##############################################################
330 Test bug 245 (use expension of +datum=carthage)
331 10 34 592302.981946153101 3762148.734061030205 -30.311017032713
1717 incdirs.append(os.path.join(proj_dir,'include'))
1818
1919 pyprojext =\
20 Extension("pyproj._proj",["_proj.c"],include_dirs=incdirs,library_dirs=libdirs,libraries=libraries)
20 Extension("pyproj._proj",["_proj.c"],include_dirs=incdirs,library_dirs=libdirs,\
21 runtime_library_dirs=libdirs,libraries=libraries)
2122
2223 # over-write default data directory.
2324 pyproj_datadir = os.path.join(os.path.join(proj_dir,'share'),'proj')
3031 package_dirs = {'':'lib'}
3132
3233 setup(name = "pyproj",
33 version = "1.9.3",
34 version = "1.9.4",
3435 description = "Python interface to PROJ.4 library",
3536 long_description = """
3637 Performs cartographic transformations between geographic (lat/lon)
3839 from one map projection coordinate system to another.
3940 Coordinates can be given as numpy arrays, python arrays, lists or scalars.
4041 Optimized for numpy arrays.""",
41 url = "http://code.google.com/p/pyproj",
42 url = "https://github.com/jswhit/pyproj",
4243 download_url = "http://python.org/pypi/pyproj",
4344 author = "Jeff Whitaker",
4445 author_email = "jeffrey.s.whitaker@noaa.gov",
88 pathout = os.path.join('lib',os.path.join('pyproj','data'))
99 if sys.argv[1] != 'sdist':
1010 cc = ccompiler.new_compiler()
11 #sysconfig.customize_compiler(cc) # doesn't work in python 3.3
11 sysconfig.get_config_vars()
12 sysconfig.customize_compiler(cc)
1213 cc.set_include_dirs(['src'])
1314 objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c'])
1415 execname = 'nad2bin'
3031 package_data = {'pyproj':datafiles}
3132
3233 setup(name = "pyproj",
33 version = "1.9.3",
34 version = "1.9.4",
3435 description = "Python interface to PROJ.4 library",
3536 long_description = """
3637 Performs cartographic transformations between geographic (lat/lon)
3839 from one map projection coordinate system to another.
3940 Coordinates can be given as numpy arrays, python arrays, lists or scalars.
4041 Optimized for numpy arrays.""",
41 url = "http://code.google.com/p/pyproj",
42 url = "https://github.com/jswhit/pyproj",
4243 download_url = "http://python.org/pypi/pyproj",
4344 author = "Jeff Whitaker",
4445 author_email = "jeffrey.s.whitaker@noaa.gov",
4647 license = "OSI Approved",
4748 keywords = ["python","map projections","GIS","mapping","maps"],
4849 classifiers = ["Development Status :: 4 - Beta",
49 "Intended Audience :: Science/Research",
50 "License :: OSI Approved",
50 "Intended Audience :: Science/Research",
51 "License :: OSI Approved",
5152 "Topic :: Software Development :: Libraries :: Python Modules",
5253 "Topic :: Scientific/Engineering :: GIS",
5354 "Topic :: Scientific/Engineering :: Mathematics",
00 /******************************************************************************
1 * $Id: PJ_aeqd.c 1856 2010-06-11 03:26:04Z warmerdam $
1 * $Id: PJ_aeqd.c 2520 2014-09-13 20:19:37Z hobu $
22 *
33 * Project: PROJ.4
44 * Purpose: Implementation of the aeqd (Azimuthal Equidistant) projection.
3939 #define PJ_LIB__
4040 #include <projects.h>
4141
42 PJ_CVSID("$Id: PJ_aeqd.c 1856 2010-06-11 03:26:04Z warmerdam $");
42 PJ_CVSID("$Id: PJ_aeqd.c 2520 2014-09-13 20:19:37Z hobu $");
4343
4444 PROJ_HEAD(aeqd, "Azimuthal Equidistant") "\n\tAzi, Sph&Ell\n\tlat_0 guam";
4545
209209 xy.y = (cosc - P->sinph0 * sin(lp.phi)) * c_rh;
210210 xy.x *= sinc * P->cosph0;
211211 }
212 lp.lam = xy.y == 0. ? 0. : atan2(xy.x, xy.y);
212 lp.lam = atan2(xy.x, xy.y);
213213 } else if (P->mode == N_POLE) {
214214 lp.phi = HALFPI - c_rh;
215215 lp.lam = atan2(xy.x, -xy.y);
00 /******************************************************************************
1 * $Id: PJ_aitoff.c 1856 2010-06-11 03:26:04Z warmerdam $
1 * $Id: PJ_aitoff.c 2369 2013-06-26 05:54:00Z warmerdam $
22 *
33 * Project: PROJ.4
44 * Purpose: Implementation of the aitoff (Aitoff) and wintri (Winkel Tripel)
3333 #define PJ_LIB__
3434 #include <projects.h>
3535
36 PJ_CVSID("$Id: PJ_aitoff.c 1856 2010-06-11 03:26:04Z warmerdam $");
36 PJ_CVSID("$Id: PJ_aitoff.c 2369 2013-06-26 05:54:00Z warmerdam $");
3737
38 PROJ_HEAD(aitoff, "Aitoff") "\n\tMisc Sph";
39 PROJ_HEAD(wintri, "Winkel Tripel") "\n\tMisc Sph\n\tlat_1";
38 PROJ_HEAD(aitoff, "Aitoff") "\n\tMisc Sph, no inv.";
39 PROJ_HEAD(wintri, "Winkel Tripel") "\n\tMisc Sph, no inv.\n\tlat_1";
4040
4141 FORWARD(s_forward); /* spheroid */
4242 double c, d;
0 #define PJ_LIB__
1 #include <projects.h>
2 #include <string.h>
3 #include <stdio.h>
4 #include <math.h>
5 #include <proj_api.h>
6 #include <errno.h>
7
8 /* Conversions for the California Cooperative Oceanic Fisheries Investigations
9 Line/Station coordinate system following the algorithm of:
10 Eber, L.E., and R.P. Hewitt. 1979. Conversion algorithms for the CALCOFI
11 station grid. California Cooperative Oceanic Fisheries Investigations Reports
12 20:135-137. (corrected for typographical errors).
13 http://www.calcofi.org/publications/calcofireports/v20/Vol_20_Eber___Hewitt.pdf
14 They assume 1 unit of CalCOFI Line == 1/5 degree in longitude or
15 meridional units at reference point O, and similarly 1 unit of CalCOFI
16 Station == 1/15 of a degree at O.
17 By convention, CalCOFI Line/Station conversions use Clarke 1866 but we use
18 whatever ellipsoid is provided. */
19
20 PROJ_HEAD(calcofi,
21 "Cal Coop Ocean Fish Invest Lines/Stations") "\n\tCyl, Sph&Ell";
22
23 #define EPS10 1.e-10
24 #define DEG_TO_LINE 5
25 #define DEG_TO_STATION 15
26 #define LINE_TO_RAD 0.0034906585039886592
27 #define STATION_TO_RAD 0.0011635528346628863
28 #define PT_O_LINE 80 /* reference point O is at line 80, */
29 #define PT_O_STATION 60 /* station 60, */
30 #define PT_O_LAMBDA -2.1144663887911301 /* lon -121.15 and */
31 #define PT_O_PHI 0.59602993955606354 /* lat 34.15 */
32 #define ROTATION_ANGLE 0.52359877559829882 /*CalCOFI angle of 30 deg in rad */
33 FORWARD(e_forward); /* ellipsoid */
34 double oy; /* pt O y value in Mercator */
35 double l1; /* l1 and l2 are distances calculated using trig that sum
36 to the east/west distance between point O and point xy */
37 double l2;
38 double ry; /* r is the point on the same station as o (60) and the same
39 line as xy xy, r, o form a right triangle */
40 /* if the user has specified +lon_0 or +k0 for some reason,
41 we're going to ignore it so that xy is consistent with point O */
42 lp.lam = lp.lam + P->lam0;
43 if (fabs(fabs(lp.phi) - HALFPI) <= EPS10) F_ERROR;
44 xy.x = lp.lam;
45 xy.y = -log(pj_tsfn(lp.phi, sin(lp.phi), P->e)); /* Mercator transform xy*/
46 oy = -log(pj_tsfn(PT_O_PHI, sin(PT_O_PHI), P->e));
47 l1 = (xy.y - oy) * tan(ROTATION_ANGLE);
48 l2 = -xy.x - l1 + PT_O_LAMBDA;
49 ry = l2 * cos(ROTATION_ANGLE) * sin(ROTATION_ANGLE) + xy.y;
50 ry = pj_phi2(P->ctx, exp(-ry), P->e); /*inverse Mercator*/
51 xy.x = PT_O_LINE - RAD_TO_DEG *
52 (ry - PT_O_PHI) * DEG_TO_LINE / cos(ROTATION_ANGLE);
53 xy.y = PT_O_STATION + RAD_TO_DEG *
54 (ry - lp.phi) * DEG_TO_STATION / sin(ROTATION_ANGLE);
55 /* set a = 1, x0 = 0, and y0 = 0 so that no further unit adjustments
56 are done */
57 P->a = 1;
58 P->x0 = 0;
59 P->y0 = 0;
60 return (xy);
61 }
62 FORWARD(s_forward); /* spheroid */
63 double oy;
64 double l1;
65 double l2;
66 double ry;
67 lp.lam = lp.lam + P->lam0;
68 if (fabs(fabs(lp.phi) - HALFPI) <= EPS10) F_ERROR;
69 xy.x = lp.lam;
70 xy.y = log(tan(FORTPI + .5 * lp.phi));
71 oy = log(tan(FORTPI + .5 * PT_O_PHI));
72 l1 = (xy.y - oy) * tan(ROTATION_ANGLE);
73 l2 = -xy.x - l1 + PT_O_LAMBDA;
74 ry = l2 * cos(ROTATION_ANGLE) * sin(ROTATION_ANGLE) + xy.y;
75 ry = HALFPI - 2. * atan(exp(-ry));
76 xy.x = PT_O_LINE - RAD_TO_DEG *
77 (ry - PT_O_PHI) * DEG_TO_LINE / cos(ROTATION_ANGLE);
78 xy.y = PT_O_STATION + RAD_TO_DEG *
79 (ry - lp.phi) * DEG_TO_STATION / sin(ROTATION_ANGLE);
80 P->a = 1;
81 P->x0 = 0;
82 P->y0 = 0;
83 return (xy);
84 }
85 INVERSE(e_inverse); /* ellipsoid */
86 double ry; /* y value of point r */
87 double oymctr; /* Mercator-transformed y value of point O */
88 double rymctr; /* Mercator-transformed ry */
89 double xymctr; /* Mercator-transformed xy.y */
90 double l1;
91 double l2;
92 /* turn x and y back into Line/Station */
93 xy.x /= P->ra;
94 xy.y /= P->ra;
95 ry = PT_O_PHI - LINE_TO_RAD * (xy.x - PT_O_LINE) *
96 cos(ROTATION_ANGLE);
97 lp.phi = ry - STATION_TO_RAD * (xy.y - PT_O_STATION) * sin(ROTATION_ANGLE);
98 oymctr = -log(pj_tsfn(PT_O_PHI, sin(PT_O_PHI), P->e));
99 rymctr = -log(pj_tsfn(ry, sin(ry), P->e));
100 xymctr = -log(pj_tsfn(lp.phi, sin(lp.phi), P->e));
101 l1 = (xymctr - oymctr) * tan(ROTATION_ANGLE);
102 l2 = (rymctr - xymctr) / (cos(ROTATION_ANGLE) * sin(ROTATION_ANGLE));
103 lp.lam = PT_O_LAMBDA - (l1 + l2);
104 P->over = 1;
105 return (lp);
106 }
107 INVERSE(s_inverse); /* spheroid */
108 double ry;
109 double oymctr;
110 double rymctr;
111 double xymctr;
112 double l1;
113 double l2;
114 xy.x /= P->ra;
115 xy.y /= P->ra;
116 ry = PT_O_PHI - LINE_TO_RAD * (xy.x - PT_O_LINE) *
117 cos(ROTATION_ANGLE);
118 lp.phi = ry - STATION_TO_RAD * (xy.y - PT_O_STATION) * sin(ROTATION_ANGLE);
119 oymctr = log(tan(FORTPI + .5 * PT_O_PHI));
120 rymctr = log(tan(FORTPI + .5 * ry));
121 xymctr = log(tan(FORTPI + .5 * lp.phi));
122 l1 = (xymctr - oymctr) * tan(ROTATION_ANGLE);
123 l2 = (rymctr - xymctr) / (cos(ROTATION_ANGLE) * sin(ROTATION_ANGLE));
124 lp.lam = PT_O_LAMBDA - (l1 + l2);
125 P->over = 1;
126 return (lp);
127 }
128 FREEUP; if (P) pj_dalloc(P); }
129 ENTRY0(calcofi)
130 if (P->es) { /* ellipsoid */
131 P->inv = e_inverse;
132 P->fwd = e_forward;
133 } else { /* sphere */
134 P->inv = s_inverse;
135 P->fwd = s_forward;
136 }
137 ENDENTRY(P)
44 ** Copyright (c) 2012 Martin Raspaud
55 */
66 static const char
7 LIBPROJ_ID[] = "$Id: PJ_geos.c 2176 2012-02-27 07:56:32Z warmerdam $";
7 LIBPROJ_ID[] = "$Id: PJ_geos.c 2411 2013-12-09 18:13:15Z warmerdam $";
88 /*
99 ** See also (section 4.4.3.2):
1010 ** http://www.eumetsat.int/en/area4/msg/news/us_doc/cgms_03_26.pdf
169169 (P->sweep_axis[0] != 'x' &&
170170 P->sweep_axis[0] != 'y'))
171171 E_ERROR(-49);
172 if (P->sweep_axis[0] == 'y')
172 if (P->sweep_axis[0] == 'x')
173173 P->flip_axis = 1;
174174 else
175175 P->flip_axis = 0;
11 double w; \
22 double m, rm;
33 #define PJ_LIB__
4 # define EPS 1.0e-10
54 # include <projects.h>
65 PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff")
7 "\n\tMisc Sph, \n\tW= M=";
6 "\n\tMisc Sph, no inv.\n\tW= M=";
87 FORWARD(s_forward); /* spheroid */
98 double cosphi, d;
109
1211 xy.x = P->m * d * cosphi * sin(lp.lam);
1312 xy.y = P->rm * d * sin(lp.phi);
1413 return (xy);
15 }
16 INVERSE(s_inverse); /* spheroid */
17 double z;
18 z = sqrt(1. - 0.25*P->w*P->w*xy.x*xy.x - 0.25*xy.y*xy.y);
19 if (fabs(2.*z*z-1.) < EPS) {
20 lp.lam = HUGE_VAL;
21 lp.phi = HUGE_VAL;
22 pj_errno = -14;
23 } else {
24 lp.lam = aatan2(P->w * xy.x * z,2. * z * z - 1)/P->w;
25 lp.phi = aasin(P->ctx,z * xy.y);
26 }
27 return (lp);
2814 }
2915 FREEUP; if (P) pj_dalloc(P); }
3016 ENTRY0(hammer)
3824 P->m = 1.;
3925 P->rm = 1. / P->m;
4026 P->m /= P->w;
41 P->es = 0.; P->fwd = s_forward; P->inv = s_inverse;
27 P->es = 0.; P->fwd = s_forward;
4228 ENDENTRY(P)
0 --- ../../proj/src/PJ_hammer.c 2011-12-15 09:24:19.000000000 -0700
1 +++ PJ_hammer.c 2012-04-02 15:37:13.000000000 -0600
2 @@ -2,9 +2,10 @@
3 double w; \
4 double m, rm;
5 #define PJ_LIB__
6 +# define EPS 1.0e-10
7 # include <projects.h>
8 PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff")
9 - "\n\tMisc Sph, no inv.\n\tW= M=";
10 + "\n\tMisc Sph, \n\tW= M=";
11 FORWARD(s_forward); /* spheroid */
12 double cosphi, d;
13
14 @@ -13,6 +14,19 @@
15 xy.y = P->rm * d * sin(lp.phi);
16 return (xy);
17 }
18 +INVERSE(s_inverse); /* spheroid */
19 + double z;
20 + z = sqrt(1. - 0.25*P->w*P->w*xy.x*xy.x - 0.25*xy.y*xy.y);
21 + if (fabs(2.*z*z-1.) < EPS) {
22 + lp.lam = HUGE_VAL;
23 + lp.phi = HUGE_VAL;
24 + pj_errno = -14;
25 + } else {
26 + lp.lam = aatan2(P->w * xy.x * z,2. * z * z - 1)/P->w;
27 + lp.phi = aasin(P->ctx,z * xy.y);
28 + }
29 + return (lp);
30 +}
31 FREEUP; if (P) pj_dalloc(P); }
32 ENTRY0(hammer)
33 if (pj_param(P->ctx, P->params, "tW").i) {
34 @@ -25,5 +39,5 @@
35 P->m = 1.;
36 P->rm = 1. / P->m;
37 P->m /= P->w;
38 - P->es = 0.; P->fwd = s_forward;
39 + P->es = 0.; P->fwd = s_forward; P->inv = s_inverse;
40 ENDENTRY(P)
00 /******************************************************************************
11 * $Id: PJ_healpix.c 1504 2011-10-18 14:58:57Z landcare $
22 *
3 * Project: PROJ.4
4 * Purpose: Implementation of the healpix projection.
5 * Definition: http://code.scenzgrid.org/index.php/p/scenzgrid-py/source/tree/master/docs/scenzgrid.pdf
6 * Author: Alex Raichev & Michael Speth , spethm@landcareresearch.co.nz
7 *
3 * Project: PROJ.4
4 * Purpose: Implementation of the HEALPix and rHEALPix projections.
5 * For background see <http://code.scenzgrid.org/index.php/p/scenzgrid-py/source/tree/master/docs/rhealpix_dggs.pdf>.
6 * Authors: Alex Raichev (raichev@cs.auckland.ac.nz)
7 * Michael Speth (spethm@landcareresearch.co.nz)
8 * Notes: Raichev implemented these projections in Python and
9 * Speth translated them into C here.
810 ******************************************************************************
911 * Copyright (c) 2001, Thomas Flemming, tf@ttqv.com
1012 *
1618 * Software is furnished to do so, subject to the following conditions:
1719 *
1820 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
21 * in all copies or substcounteral portions of the Software.
2022 *
2123 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
2224 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2729 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2830 * SOFTWARE.
2931 *****************************************************************************/
30
31 #define PROJ_PARMS__ \
32 int npole;\
33 int spole;
34
35 #define PJ_LIB__
32 # define PROJ_PARMS__ \
33 int north_square; \
34 int south_square; \
35 double qp; \
36 double *apa;
37 # define PJ_LIB__
3638 # include <projects.h>
3739 PROJ_HEAD(healpix, "HEALPix") "\n\tSph., Ellps.";
38 PROJ_HEAD(rhealpix, "rHEALPix") "\n\tSph., Ellps.\n\tnpole= spole=";
40 PROJ_HEAD(rhealpix, "rHEALPix") "\n\tSph., Ellps.\n\tnorth_square= south_square=";
3941 # include <stdio.h>
40 # define R1 {{ 0,-1},{ 1, 0}} /** Matrix for anticlockwise rotation by pi/2 **/
41 # define R2 {{-1, 0},{ 0,-1}} /** Matrix for anticlockwise rotation by pi (R1 X R1) X = dot product **/
42 # define R3 {{ 0, 1},{-1, 0}} /** Matrix for anticlockwise rotation by 3*pi/2 (R2 X R1) **/
43 # define IDENT {{1,0},{0,1}}
44 /**
45 * 0 - Identity matrix<br>
46 * 1 - Counter-clockwise rotation by PI/2<br>
47 * 2 - Counter-clockwise rotation by PI<br>
48 * 3 - Counter-clockwise rotation by 3*PI/2<br>
49 * 4 - Counter-clockwise rotation by 3*PI/2<br>
50 * 5 - Counter-clockwise rotation by PI<br>
51 * 6 - Counter-clockwise rotation by PI/2<br>
52 **/
53 # define ROT { IDENT, R1, R2, R3, R3, R2, R1}
54 # define RFACTOR 3 /** Used for returning the rotation matrix **/
55 /** Used for calculating if a point is within the HEALPix projection for sphere. **/
56 # define EPS 1e-12
42 /* Matrix for counterclockwise rotation by pi/2: */
43 # define R1 {{ 0,-1},{ 1, 0}}
44 /* Matrix for counterclockwise rotation by pi: */
45 # define R2 {{-1, 0},{ 0,-1}}
46 /* Matrix for counterclockwise rotation by 3*pi/2: */
47 # define R3 {{ 0, 1},{-1, 0}}
48 /* Identity matrix */
49 # define IDENT {{1, 0},{0, 1}}
50 /* IDENT, R1, R2, R3, R1 inverse, R2 inverse, R3 inverse:*/
51 # define ROT {IDENT, R1, R2, R3, R3, R2, R1}
52 /* Fuzz to handle rounding errors: */
53 # define EPS 1e-15
5754 typedef struct {
58 int cn; // the number 0 -> 4 indicating the position of the polar cap.
59 double x,y; // the coordinates of the pole points (point of most extreme latitude on the polar caps).
60 enum Region { north, south, equatorial } region;
55 int cn; /* An integer 0--3 indicating the position of the polar cap. */
56 double x, y; /* Coordinates of the pole point (point of most extreme latitude on the polar caps). */
57 enum Region {north, south, equatorial} region;
6158 } CapMap;
6259 typedef struct {
63 double x,y;
60 double x, y;
6461 } Point;
6562 double rot[7][2][2] = ROT;
6663
6764 /**
68 NOTES: Alex Raichev implemented the math in python and this is a port of his work.
69 The healpix projection is a Lambert cylindrical equal-area projection for
70 equaltorial latitudes and an interrupted Colignon projection for polar
71 latitudes.
72 **/
73
74 /**
7565 * Returns the sign of the double.
7666 * @param v the parameter whose sign is returned.
7767 * @return 1 for positive number, -1 for negative, and 0 for zero.
7868 **/
79 double sign (double v) {
69 double pj_sign (double v) {
8070 return v > 0 ? 1 : (v < 0 ? -1 : 0);
8171 }
8272 /**
83 * Scales the number by a factor.
84 * @param num the number to be scaled.
85 * @param factor the factor to scale the number by.
86 * @param isInverse 1 for scaling the number by 1 / factor and 0 for scaling by the factor.
87 * @return the scaled number.
88 **/
89 double scale_number(double num, double factor, int isInverse){
90 if(isInverse == 1){
91 return num * 1.0/factor;
92 }
93 return num * factor;
94 }
95 /**
96 * Scales all the items of the array by a factor.
97 * @param xy
98 **/
99 void scale_array(XY *array, double k, int inverse){
100 double c = 0;
101 if (inverse == 1) {
102 c = 1.0/k;
103 }else{
104 c = k;
105 }
106 array->x *= c;
107 array->y *= c;
108 }
109 /**
110 * Given an angle return its equivalent angle.
111 * @param x the angle to convert
112 * @return the equivalent angle such that -PI <= the angle returend <= PI
113 **/
114 double standardize_lon(double x){
115 if(x < -1*PI || x >= PI){
116 x = x - 2*PI*floor(x/(2*PI));
117 if(x >= PI){
118 x = x - 2*PI;
119 }
120 }
121 return x;
122 }
123 /**
124 * Given an angle, return its unit-circle equivalent angle.
125 * @param x the angel to convert.
126 * @return the equivalent angle such that -PI/2 <= the angle returned <= PI/2.
127 **/
128 double standardize_lat(double x){
129 if( x < -PI/2.0 || x > PI/2){
130 x = x-2.0*PI*floor(x/(2.0*PI));
131 if(x > PI/2.0 && x <= 3.0*PI/2){
132 x = PI - x;
133 }else{
134 x = x - 2*PI;
135 }
136 }
137 return x;
138 }
139 /**
140 * Returns the index of the 2d array in rot.
141 * @param index range from -3 to 3.
142 * @return the index into the rot 3d array.
73 * Return the index of the matrix in ROT.
74 * @param index ranges from -3 to 3.
14375 */
144 static int get_rotate_index(int index){
145 switch(index){
76 static int get_rotate_index(int index) {
77 switch(index) {
14678 case 0:
14779 return 0;
14880 case 1:
16193 return 0;
16294 }
16395 /**
164 * Calculates if the point lies on or within the polygon.
165 * Very good explination of how this works: http://paulbourke.net/geometry/insidepoly/
96 * Return 1 if point (testx, testy) lies in the interior of the polygon
97 * determined by the vertices in vert, and return 0 otherwise.
98 * See http://paulbourke.net/geometry/polygonmesh/ for more details.
16699 * @param nvert the number of vertices in the polygon.
167 * @param vert the x,y-coordinates of the polygon's vertices
168 * @param testx the x-coordinate of the test point.
169 * @param testy the y-coordinate of the test point.
170 * @return 1 if on or within the bounds of the polygon, and 0 otherwise.
171 **/
172 static
173 int pnpoly(int nvert, double vert[][2], double testx, double testy){
174
175 int i,j,c = 0;
100 * @param vert the (x, y)-coordinates of the polygon's vertices
101 **/
102 static int pnpoly(int nvert, double vert[][2], double testx, double testy) {
103 int i, c = 0;
176104 int counter = 0;
177105 double xinters;
178 Point p1,p2;
179
180 // check for boundrary cases
181 for(i = 0; i < nvert; i++){
182 if(testx == vert[i][0] && testy == vert[i][1]){
183 return 1;
184 }
185 }
186
187 // initialize p1
106 Point p1, p2;
107 /* Check for boundrary cases */
108 for (i = 0; i < nvert; i++) {
109 if (testx == vert[i][0] && testy == vert[i][1]) {
110 return 1;
111 }
112 }
188113 p1.x = vert[0][0];
189114 p1.y = vert[0][1];
190
191 for(i = 1; i < nvert; i++){
192 p2.x = vert[i % nvert][0];
193 p2.y = vert[i % nvert][1];
194
195 if(testy > MIN(p1.y,p2.y)){
196 if (testy <= MAX(p1.y,p2.y)) {
197 if (testx <= MAX(p1.x,p2.x)) {
198 if (p1.y != p2.y) {
199 xinters = (testy-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x;
200 if (p1.x == p2.x || testx <= xinters){
201 counter++;
202 }
203 }
204 }
115 for (i = 1; i < nvert; i++) {
116 p2.x = vert[i % nvert][0];
117 p2.y = vert[i % nvert][1];
118 if (testy > MIN(p1.y, p2.y)) {
119 if (testy <= MAX(p1.y, p2.y)) {
120 if (testx <= MAX(p1.x, p2.x)) {
121 if (p1.y != p2.y) {
122 xinters = (testy-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x;
123 if (p1.x == p2.x || testx <= xinters) {
124 counter++;
125 }
126 }
127 }
128 }
129 }
130 p1 = p2;
131 }
132 if (counter % 2 == 0) {
133 return 0;
134 } else {
135 return 1;
136 }
137 return c;
138 }
139 /**
140 * Return 1 if (x, y) lies in (the interior or boundary of) the image of the
141 * HEALPix projection (in case proj=0) or in the image the rHEALPix projection
142 * (in case proj=1), and return 0 otherwise.
143 * @param north_square the position of the north polar square (rHEALPix only)
144 * @param south_square the position of the south polar square (rHEALPix only)
145 **/
146 int in_image(double x, double y, int proj, int north_square, int south_square) {
147 if (proj == 0) {
148 double healpixVertsJit[][2] = {
149 {-1.0*PI- EPS, PI/4.0},
150 {-3.0*PI/4.0, PI/2.0 + EPS},
151 {-1.0*PI/2.0, PI/4.0 + EPS},
152 {-1.0*PI/4.0, PI/2.0 + EPS},
153 {0.0, PI/4.0 + EPS},
154 {PI/4.0, PI/2.0 + EPS},
155 {PI/2.0, PI/4.0 + EPS},
156 {3.0*PI/4.0, PI/2.0 + EPS},
157 {PI+ EPS, PI/4.0},
158 {PI+ EPS, -1.0*PI/4.0},
159 {3.0*PI/4.0, -1.0*PI/2.0 - EPS},
160 {PI/2.0, -1.0*PI/4.0 - EPS},
161 {PI/4.0, -1.0*PI/2.0 - EPS},
162 {0.0, -1.0*PI/4.0 - EPS},
163 {-1.0*PI/4.0, -1.0*PI/2.0 - EPS},
164 {-1.0*PI/2.0, -1.0*PI/4.0 - EPS},
165 {-3.0*PI/4.0, -1.0*PI/2.0 - EPS},
166 {-1.0*PI - EPS, -1.0*PI/4.0}
167 };
168 return pnpoly((int)sizeof(healpixVertsJit)/
169 sizeof(healpixVertsJit[0]), healpixVertsJit, x, y);
170 } else {
171 double rhealpixVertsJit[][2] = {
172 {-1.0*PI - EPS, PI/4.0 + EPS},
173 {-1.0*PI + north_square*PI/2.0- EPS, PI/4.0 + EPS},
174 {-1.0*PI + north_square*PI/2.0- EPS, 3*PI/4.0 + EPS},
175 {-1.0*PI + (north_square + 1.0)*PI/2.0 + EPS, 3*PI/4.0 + EPS},
176 {-1.0*PI + (north_square + 1.0)*PI/2.0 + EPS, PI/4.0 + EPS},
177 {PI + EPS, PI/4.0 + EPS},
178 {PI + EPS, -1.0*PI/4.0 - EPS},
179 {-1.0*PI + (south_square + 1.0)*PI/2.0 + EPS, -1.0*PI/4.0 - EPS},
180 {-1.0*PI + (south_square + 1.0)*PI/2.0 + EPS, -3.0*PI/4.0 - EPS},
181 {-1.0*PI + south_square*PI/2.0 - EPS, -3.0*PI/4.0 - EPS},
182 {-1.0*PI + south_square*PI/2.0 - EPS, -1.0*PI/4.0 - EPS},
183 {-1.0*PI - EPS, -1.0*PI/4.0 - EPS}};
184 return pnpoly((int)sizeof(rhealpixVertsJit)/
185 sizeof(rhealpixVertsJit[0]), rhealpixVertsJit, x, y);
186 }
187 }
188 /**
189 * Return the authalic latitude of latitude alpha (if inverse=0) or
190 * return the approximate latitude of authalic latitude alpha (if inverse=1).
191 * P contains the relavent ellipsoid parameters.
192 **/
193 double auth_lat(PJ *P, double alpha, int inverse) {
194 if (inverse == 0) {
195 /* Authalic latitude. */
196 double q = pj_qsfn(sin(alpha), P->e, 1.0 - P->es);
197 double qp = P->qp;
198 double ratio = q/qp;
199 if (fabsl(ratio) > 1) {
200 /* Rounding error. */
201 ratio = pj_sign(ratio);
205202 }
206 }
207 p1 = p2;
208 }
209 if(counter % 2 == 0){
210 return 0;
211 }else{
212 return 1;
213 }
214 return c;
215 }
216 /**
217 * Calculates if the coordinates are within the image of projection.
218 * @param x the x-coordinate to check.
219 * @param y the y-coordinate to check.
220 * @param proj 0 for healpix and 1 for rhealpix.
221 * @param npole the positions of the polar squares, only used for rhealpix.
222 * @param spole the positions of the polar squares, only used for rhealpix.
223 * @return 1 if the coordinate is within the projection and 0 otherwise.
224 **/
225 int in_image(double x, double y, int proj, int npole, int spole){
226 if(proj == 0){
227 double healpixVertsJit[][2] = {
228 {-1.0*PI-EPS ,PI/4.0},
229 {-3.0*PI/4.0 ,PI/2.0+EPS},
230 {-1.0*PI/2.0 ,PI/4.0+EPS},
231 {-1.0*PI/4.0 ,PI/2.0+EPS},
232 {0.0 ,PI/4.0+EPS},
233 {PI/4.0 ,PI/2.0+EPS},
234 {PI/2.0 ,PI/4.0+EPS},
235 {3.0*PI/4.0 ,PI/2.0+EPS},
236 {PI+EPS ,PI/4.0},
237 {PI+EPS ,-1.0*PI/4.0},
238 {3.0*PI/4.0 ,-1.0*PI/2.0-EPS},
239 {PI/2.0 ,-1.0*PI/4.0-EPS},
240 {PI/4.0 ,-1.0*PI/2.0-EPS},
241 {0.0 ,-1.0*PI/4.0-EPS},
242 {-1.0*PI/4.0 ,-1.0*PI/2.0-EPS},
243 {-1.0*PI/2.0 ,-1.0*PI/4.0-EPS},
244 {-3.0*PI/4.0 ,-1.0*PI/2.0-EPS},
245 {-1.0*PI-EPS ,-1.0*PI/4.0}};
246 return pnpoly((int)sizeof(healpixVertsJit)/sizeof(healpixVertsJit[0]),
247 healpixVertsJit,x,y);
248 }else{
249 // Used for calculating if a point is within the rHEALPix projection for sphere.
250 double rhealpixVertsJit[][2] = {
251 {-1.0*PI-EPS ,PI/4.0+EPS},
252 {-1.0*PI + npole*PI/2.0-EPS ,PI/4.0+EPS},
253 {-1.0*PI + npole*PI/2.0-EPS ,3*PI/4.0+EPS},
254 {-1.0*PI + (npole + 1.0)*PI/2.0+EPS ,3*PI/4.0+EPS},
255 {-1.0*PI + (npole + 1.0)*PI/2.0+EPS ,PI/4.0+EPS},
256 {PI+EPS ,PI/4.0+EPS},
257 {PI+EPS ,-1.0*PI/4.0-EPS},
258 {-1.0*PI + (spole + 1.0)*PI/2.0+EPS ,-1.0*PI/4.0-EPS},
259 {-1.0*PI + (spole + 1.0)*PI/2.0+EPS ,-3.0*PI/4.0-EPS},
260 {-1.0*PI + spole*PI/2.0-EPS ,-3.0*PI/4.0-EPS},
261 {-1.0*PI + spole*PI/2.0-EPS ,-1.0*PI/4.0-EPS},
262 {-1.0*PI-EPS ,-1.0*PI/4.0-EPS}};
263 return pnpoly((int)sizeof(rhealpixVertsJit)/sizeof(rhealpixVertsJit[0]),
264 rhealpixVertsJit,x,y);
265 }
266 }
267 /**
268 * Returns an authalic latitude of the point given a point of geographic
269 * latitude phi on an ellipse of eccentricity e.
270 * pj_authlat is the inverse of the alex's auth_lat.
271 * @param phi
272 * @param e
273 * @param inverse 1 for inverse or 0 otherwise.
274 * @return the authalic latitude of the point.
275 **/
276 double auth_lat(double phi, double e, int inverse){
277 if(inverse == 0){
278 double q_numerator = ((1.0 - pow(e,2.0)) * sin(phi));
279 double q_demonitor = (1.0 - (pow(e*sin(phi),2.0)));
280 double q_subtractor = - (1.0 - pow(e,2.0)) / (2.0*e) * log((1.0 - e*sin(phi)) / (1.0+e*sin(phi)));
281 double q = ((1.0 - pow(e,2.0)) * sin(phi)) / (1.0 - (pow(e*sin(phi),2.0))) -
282 (1.0 - pow(e,2.0)) / (2.0*e) * log((1.0 - e*sin(phi)) / (1.0+e*sin(phi)));
283
284 double qp = 1.0 - (1.0-pow(e,2.0)) / (2.0*e)*log((1.0 - e) / (1.0 + e));
285 double ratio = q/qp;
286 // Rounding errors
287 if( fabsl(ratio) > 1){
288 ratio = sign(ratio);
289 }
290 return asin(ratio);
291 }
292 return phi + (pow(e,2) / 3.0 + 31*pow(e,4) / 180.0 + 517.0*pow(e,6)/5040.0) * sin(2.0*phi)
293 + (23.0*pow(e,4)/360.0 + 251.0*pow(e,6)/3780.0)*sin(4.0*phi)
294 + 761.0*pow(e,6)/45360.0 * sin(6.0*phi);
295 }
296 /**
297 * Compute the forward signature functions of the HEALPix
298 * projection of a sphere with radius `R` and central meridian `lon0`.
203 return asin(ratio);
204 } else {
205 /* Approximation to inverse authalic latitude. */
206 return pj_authlat(alpha, P->apa);
207 }
208 }
209 /**
210 * Return the HEALPix projection of the longitude-latitude point lp on
211 * the unit sphere.
299212 **/
300 XY healpix_sphere(LP lp, PJ *P){
301 double lam = standardize_lon(lp.lam);
302 double phi = standardize_lat(lp.phi);
303 double phi0 = aasin(P->ctx, 2.0/3.0);
213 XY healpix_sphere(LP lp) {
214 double lam = lp.lam;
215 double phi = lp.phi;
216 double phi0 = asin(2.0/3.0);
304217 XY xy;
305 // equatorial region
306 if( fabsl(phi) <= phi0) {
307 xy.x = lam;
308 xy.y = 3.0*PI/8.0*sin(phi);
309 } else {
310 double lamc;
311 double sigma = sqrt(3.0 * (1 - fabsl(sin(phi))));
312 double cn = floor(2 * lam / PI + 2);
313 if (cn >= 4) {
314 cn = 3;
315 }
316 lamc = -3*PI/4 + (PI/2)*cn;
317 xy.x = lamc + (lam - lamc) * sigma;
318 xy.y = sign(phi)*PI/4 * (2 - sigma);
319 }
320 xy.x = scale_number(xy.x,P->a,0);
321 xy.y = scale_number(xy.y,P->a,0);
218 /* equatorial region */
219 if ( fabsl(phi) <= phi0) {
220 xy.x = lam;
221 xy.y = 3.0*PI/8.0*sin(phi);
222 } else {
223 double lamc;
224 double sigma = sqrt(3.0*(1 - fabsl(sin(phi))));
225 double cn = floor(2*lam / PI + 2);
226 if (cn >= 4) {
227 cn = 3;
228 }
229 lamc = -3*PI/4 + (PI/2)*cn;
230 xy.x = lamc + (lam - lamc)*sigma;
231 xy.y = pj_sign(phi)*PI/4*(2 - sigma);
232 }
322233 return xy;
323234 }
324235 /**
325 * Compute the inverse signature functions of the HEALPix
326 * projection of a sphere with radius `R` and central meridian `lon0`.
236 * Return the inverse of healpix_sphere().
327237 **/
328 LP healpix_sphere_inv(XY xy, PJ *P){
329 double x,y,y0;
330 double cn;
331 double xc;
332 double tau;
238 LP healpix_sphere_inverse(XY xy) {
333239 LP lp;
334 // Scale down to radius 1 sphere
335 x = scale_number(xy.x,P->a,1);
336 y = scale_number(xy.y,P->a,1);
337 y0 = PI/4.0;
338 // Equatorial region.
339 if(fabsl(y) <= y0){
340 lp.lam = x;
341 lp.phi = asin(8.0*y/(3.0*PI));
342 } else if(fabsl(y) < PI/2.0){
343 cn = floor(2.0 * x/PI + 2.0);
344 if(cn >= 4){
345 cn = 3;
346 }
347 xc = -3.0 * PI/4.0 + (PI/2.0)*cn;
348 tau = 2.0 - 4.0*fabsl(y)/PI;
349 lp.lam = xc + (x - xc)/tau;
350 lp.phi = sign(y)*asin(1.0 - pow(tau , 2.0)/3.0);
351 } else {
352 lp.lam = -1.0*PI - P->lam0;
353 lp.phi = sign(y)*PI/2.0;
240 double x = xy.x;
241 double y = xy.y;
242 double y0 = PI/4.0;
243 /* Equatorial region. */
244 if (fabsl(y) <= y0) {
245 lp.lam = x;
246 lp.phi = asin(8.0*y/(3.0*PI));
247 } else if (fabsl(y) < PI/2.0) {
248 double cn = floor(2.0*x/PI + 2.0);
249 double xc, tau;
250 if (cn >= 4) {
251 cn = 3;
252 }
253 xc = -3.0*PI/4.0 + (PI/2.0)*cn;
254 tau = 2.0 - 4.0*fabsl(y)/PI;
255 lp.lam = xc + (x - xc)/tau;
256 lp.phi = pj_sign(y)*asin(1.0 - pow(tau , 2.0)/3.0);
257 } else {
258 lp.lam = -1.0*PI;
259 lp.phi = pj_sign(y)*PI/2.0;
354260 }
355261 return (lp);
356262 }
357263 /**
358 * Adds one vector to another of length 2.
359 * @param a the first term.
360 * @param b the second term.
361 * @param ret holds the summation of the vectors.
362 **/
363 static void vector_add(double a[], double b[],double * ret){
264 * Return the vector sum a + b, where a and b are 2-dimensional vectors.
265 * @param ret holds a + b.
266 **/
267 static void vector_add(double a[2], double b[2], double *ret) {
364268 int i;
365 for(i = 0; i < 2; i++){
366 ret[i] = a[i] + b[i];
367 }
368 }
369 /**
370 * Subs tracts one vector from another of length 2.
371 * @param a the minuend.
372 * @param b the subtrahend.
373 * @param ret the difference of the vectors where the difference is the result of a minus b.
374 **/
375 static void vector_sub(double a[], double b[], double * ret){
269 for(i = 0; i < 2; i++) {
270 ret[i] = a[i] + b[i];
271 }
272 }
273 /**
274 * Return the vector difference a - b, where a and b are 2-dimensional vectors.
275 * @param ret holds a - b.
276 **/
277 static void vector_sub(double a[2], double b[2], double*ret) {
376278 int i;
377 for(i = 0; i < 2; i++){
378 ret[i] = a[i] - b[i];
379 }
380 }
381 /**
382 * Calculates the dot product of the arrays.
383 * @param a the array that will be used to calculate the dot product.
384 * Must contain the same number of columns as b's rows. Must be a matrix with equal lengthed rows and columns.
385 * @param b the array that will be used to calculate the dot product; must contain the same number of rows as a's columns.
386 * @param length the size of the b array. Note, a's column size must equal b's length.
387 * @param ret the dot product of a and b.
388 **/
389 static void dot_product(double a[2][2], double b[], double * ret){
390 int i,j;
279 for(i = 0; i < 2; i++) {
280 ret[i] = a[i] - b[i];
281 }
282 }
283 /**
284 * Return the 2 x 1 matrix product a*b, where a is a 2 x 2 matrix and
285 * b is a 2 x 1 matrix.
286 * @param ret holds a*b.
287 **/
288 static void dot_product(double a[2][2], double b[2], double *ret) {
289 int i, j;
391290 int length = 2;
392 for(i = 0; i < length; i++){
393 ret[i] = 0;
394 for(j = 0; j < length; j++){
395 ret[i] += a[i][j]*b[j];
396 }
397 }
398 }
399 /**
400 * Returns the polar cap number, pole point coordinates, and region
401 * for x,y in the HEALPix projection of the sphere of radius R.
402 * @param x coordinate in the HEALPix or rHEALPix.
403 * @param y coordinate in the HEALPix or rHEALPix.
404 * @param npole integer between 0 and 3 indicating the position of the north pole.
405 * @param spole integer between 0 and 3 indicating teh position of the south pole.
406 * @param inverse 1 computes the rHEALPix projection and 0 computes forward.
407 * @return a structure containing the cap poles.
408 **/
409 static CapMap get_cap(double x, double y, double R, int npole, int spole, int inverse){
291 for(i = 0; i < length; i++) {
292 ret[i] = 0;
293 for(j = 0; j < length; j++) {
294 ret[i] += a[i][j]*b[j];
295 }
296 }
297 }
298 /**
299 * Return the number of the polar cap, the pole point coordinates, and
300 * the region that (x, y) lies in.
301 * If inverse=0, then assume (x,y) lies in the image of the HEALPix
302 * projection of the unit sphere.
303 * If inverse=1, then assume (x,y) lies in the image of the
304 * (north_square, south_square)-rHEALPix projection of the unit sphere.
305 **/
306 static CapMap get_cap(double x, double y, int north_square, int south_square,
307 int inverse) {
410308 CapMap capmap;
411309 double c;
412
413310 capmap.x = x;
414311 capmap.y = y;
415
416 if(inverse == 0){
417 if(y > R*PI/4.0){
418 capmap.region = north;
419 c = R*PI/2.0;
420 }else if(y < -1*R*PI/4.0){
421 capmap.region = south;
422 c = -1*R*PI/2.0;
423 }else{
424 capmap.region = equatorial;
425 capmap.cn = 0;
426 return capmap;
427 }
428 // polar region
429 if(x < -1*R*PI/2.0){
430 capmap.cn = 0;
431 capmap.x = (-1*R*3.0*PI/4.0);
432 capmap.y = c;
433 }else if(x >= -1*R*PI/2.0 && x < 0){
434 capmap.cn = 1;
435 capmap.x = -1*R*PI/4.0;
436 capmap.y = c;
437 }else if(x >= 0 && x < R*PI/2.0){
438 capmap.cn = 2;
439 capmap.x = R*PI/4.0;
440 capmap.y = c;
441 }else{
442 capmap.cn = 3;
443 capmap.x = R*3.0*PI/4.0;
444 capmap.y = c;
445 }
446 return capmap;
447 }else{
448 double c;
449 double eps;
450 if(y > R*PI/4.0){
451 capmap.region = north;
452 capmap.x = R*(-3.0*PI/4.0 + npole*PI/2.0);
453 capmap.y = R*PI/2.0;
454 x = x - npole*R*PI/2.0;
455 }else if(y < -1*R*PI/4.0){
456 capmap.region = south;
457 capmap.x = R*(-3.0*PI/4.0 + spole*PI/2);
458 capmap.y = -1*R*PI/2.0;
459 x = x - spole*R*PI/2.0;
460 }else{
461 capmap.region = equatorial;
462 capmap.cn = 0;
463 return capmap;
464 }
465 // Polar Region, find # of HEALPix polar cap number that
466 // x,y moves to when rHEALPix polar square is disassembled.
467 eps = R*1e-15; // Kludge. Fuzz to avoid some rounding errors.
468 if(capmap.region == north){
469 if(y >= -1*x - R*PI/4.0 - eps && y < x + R*5.0*PI/4.0 - eps){
470 capmap.cn = (npole + 1) % 4;
471 }else if(y > -1*x -1*R*PI/4.0 + eps && y >= x + R*5.0*PI/4.0 - eps){
472 capmap.cn = (npole + 2) % 4;
473 }else if(y <= -1*x -1*R*PI/4.0 + eps && y > x + R*5.0*PI/4.0 + eps){
474 capmap.cn = (npole + 3) % 4;
475 }else{
476 capmap.cn = npole;
477 }
478 }else if(capmap.region == south){
479 if(y <= x + R*PI/4.0 + eps && y > -1*x - R*5.0*PI/4 + eps){
480 capmap.cn = (spole + 1) % 4;
481 }else if(y < x + R*PI/4.0 - eps && y <= -1*x - R*5.0*PI/4.0 + eps){
482 capmap.cn = (spole + 2) % 4;
483 }else if(y >= x + R*PI/4.0 - eps && y < -1*x - R*5.0*PI/4.0 - eps){
484 capmap.cn = (spole + 3) % 4;
485 }else {
486 capmap.cn = spole;
487 }
488 }
489 return capmap;
490 }
491 }
492 /**
493 * Rearrange point x,y in the HEALPix projection by
312 if (inverse == 0) {
313 if (y > PI/4.0) {
314 capmap.region = north;
315 c = PI/2.0;
316 } else if (y < -1*PI/4.0) {
317 capmap.region = south;
318 c = -1*PI/2.0;
319 } else {
320 capmap.region = equatorial;
321 capmap.cn = 0;
322 return capmap;
323 }
324 /* polar region */
325 if (x < -1*PI/2.0) {
326 capmap.cn = 0;
327 capmap.x = (-1*3.0*PI/4.0);
328 capmap.y = c;
329 } else if (x >= -1*PI/2.0 && x < 0) {
330 capmap.cn = 1;
331 capmap.x = -1*PI/4.0;
332 capmap.y = c;
333 } else if (x >= 0 && x < PI/2.0) {
334 capmap.cn = 2;
335 capmap.x = PI/4.0;
336 capmap.y = c;
337 } else {
338 capmap.cn = 3;
339 capmap.x = 3.0*PI/4.0;
340 capmap.y = c;
341 }
342 return capmap;
343 } else {
344 double eps;
345 if (y > PI/4.0) {
346 capmap.region = north;
347 capmap.x = (-3.0*PI/4.0 + north_square*PI/2.0);
348 capmap.y = PI/2.0;
349 x = x - north_square*PI/2.0;
350 } else if (y < -1*PI/4.0) {
351 capmap.region = south;
352 capmap.x = (-3.0*PI/4.0 + south_square*PI/2);
353 capmap.y = -1*PI/2.0;
354 x = x - south_square*PI/2.0;
355 } else {
356 capmap.region = equatorial;
357 capmap.cn = 0;
358 return capmap;
359 }
360 /* Polar Region, find the HEALPix polar cap number that
361 x, y moves to when rHEALPix polar square is disassembled. */
362 eps = 1e-15; /* Kludge. Fuzz to avoid some rounding errors. */
363 if (capmap.region == north) {
364 if (y >= -1*x - PI/4.0 - eps && y < x + 5.0*PI/4.0 - eps) {
365 capmap.cn = (north_square + 1) % 4;
366 } else if (y > -1*x -1*PI/4.0 + eps && y >= x + 5.0*PI/4.0 - eps) {
367 capmap.cn = (north_square + 2) % 4;
368 } else if (y <= -1*x -1*PI/4.0 + eps && y > x + 5.0*PI/4.0 + eps) {
369 capmap.cn = (north_square + 3) % 4;
370 } else {
371 capmap.cn = north_square;
372 }
373 } else if (capmap.region == south) {
374 if (y <= x + PI/4.0 + eps && y > -1*x - 5.0*PI/4 + eps) {
375 capmap.cn = (south_square + 1) % 4;
376 } else if (y < x + PI/4.0 - eps && y <= -1*x - 5.0*PI/4.0 + eps) {
377 capmap.cn = (south_square + 2) % 4;
378 } else if (y >= x + PI/4.0 - eps && y < -1*x - 5.0*PI/4.0 - eps) {
379 capmap.cn = (south_square + 3) % 4;
380 } else {
381 capmap.cn = south_square;
382 }
383 }
384 return capmap;
385 }
386 }
387 /**
388 * Rearrange point (x, y) in the HEALPix projection by
494389 * combining the polar caps into two polar squares.
495 * Put the north polar square in position npole and
496 * the south polar square in position spole.
497 * @param x coordinate in the HEALPix projection of the sphere.
498 * @param y coordinate in the HEALPix projection of the sphere.
499 * @param R - the Sphere's radius.
500 * @param npole integer between 0 and 3 indicating the position
501 * of the north polar square.
502 * @param spole integer between 0 and 3 indicating the position
503 * of the south polar square.
504 * @param inverse 1 to uncombine the polar caps and 0 to combine.
505 **/
506 static XY combine_caps(double x, double y, double R, int npole, int spole, int inverse){
390 * Put the north polar square in position north_square and
391 * the south polar square in position south_square.
392 * If inverse=1, then uncombine the polar caps.
393 * @param north_square integer between 0 and 3.
394 * @param south_square integer between 0 and 3.
395 **/
396 static XY combine_caps(double x, double y, int north_square, int south_square,
397 int inverse) {
507398 XY xy;
508399 double v[2];
509400 double a[2];
510401 double vector[2];
511 double tmpVect[2];
512402 double v_min_c[2];
513403 double ret_dot[2];
514 double ret_add[2];
515 CapMap capmap = get_cap(x,y,R,npole,spole,inverse);
516
517 if(capmap.region == equatorial){
518 xy.x = capmap.x;
519 xy.y = capmap.y;
520 return xy;
404 CapMap capmap = get_cap(x, y, north_square, south_square, inverse);
405 if (capmap.region == equatorial) {
406 xy.x = capmap.x;
407 xy.y = capmap.y;
408 return xy;
521409 }
522410 v[0] = x;
523411 v[1] = y;
524 if(inverse == 0){
525 // compute forward function by rotating, translating, and shifting xy.
526 int pole = 0;
527 double (*tmpRot)[2];
528 double c[2] = {capmap.x,capmap.y};
529 if(capmap.region == north){
530 pole = npole;
531 a[0] = R * (-3.0*PI/4.0 + pole * PI/2);
532 a[1] = R * (PI/2.0 + pole * 0);
533
534 tmpRot = rot[get_rotate_index(capmap.cn - pole)];
535 vector_sub(v,c,v_min_c);
536 dot_product(tmpRot,v_min_c,ret_dot);
537 vector_add(ret_dot, a, vector);
538
539 }else {
540 pole = spole;
541 a[0] = R * (-3.0*PI/4.0 + pole * PI/2);
542 a[1] = R * (PI/-2.0 + pole * 0);
543
544 tmpRot = rot[get_rotate_index(-1*(capmap.cn - pole))];
545 vector_sub(v,c,v_min_c);
546 dot_product(tmpRot,v_min_c,ret_dot);
547
548 vector_add(ret_dot, a, vector);
412 if (inverse == 0) {
413 /* Rotate (x, y) about its polar cap tip and then translate it to
414 north_square or south_square. */
415 int pole = 0;
416 double (*tmpRot)[2];
417 double c[2] = {capmap.x, capmap.y};
418 if (capmap.region == north) {
419 pole = north_square;
420 a[0] = (-3.0*PI/4.0 + pole*PI/2);
421 a[1] = (PI/2.0 + pole*0);
422 tmpRot = rot[get_rotate_index(capmap.cn - pole)];
423 vector_sub(v, c, v_min_c);
424 dot_product(tmpRot, v_min_c, ret_dot);
425 vector_add(ret_dot, a, vector);
426 } else {
427 pole = south_square;
428 a[0] = (-3.0*PI/4.0 + pole*PI/2);
429 a[1] = (PI/-2.0 + pole*0);
430 tmpRot = rot[get_rotate_index(-1*(capmap.cn - pole))];
431 vector_sub(v, c, v_min_c);
432 dot_product(tmpRot, v_min_c, ret_dot);
433 vector_add(ret_dot, a, vector);
434 }
435 xy.x = vector[0];
436 xy.y = vector[1];
437 return xy;
438 } else {
439 /* Inverse function.
440 Unrotate (x, y) and then translate it back. */
441 int pole = 0;
442 double (*tmpRot)[2];
443 double c[2] = {capmap.x, capmap.y};
444 /* disassemble */
445 if (capmap.region == north) {
446 pole = north_square;
447 a[0] = (-3.0*PI/4.0 + capmap.cn*PI/2);
448 a[1] = (PI/2.0 + capmap.cn*0);
449 tmpRot = rot[get_rotate_index(-1*(capmap.cn - pole))];
450 vector_sub(v, c, v_min_c);
451 dot_product(tmpRot, v_min_c, ret_dot);
452 vector_add(ret_dot, a, vector);
453 } else {
454 pole = south_square;
455 a[0] = (-3.0*PI/4.0 + capmap.cn*PI/2);
456 a[1] = (PI/-2.0 + capmap.cn*0);
457 tmpRot = rot[get_rotate_index(capmap.cn - pole)];
458 vector_sub(v, c, v_min_c);
459 dot_product(tmpRot, v_min_c, ret_dot);
460 vector_add(ret_dot, a, vector);
461 }
462 xy.x = vector[0];
463 xy.y = vector[1];
464 return xy;
465 }
466 }
467 FORWARD(s_healpix_forward); /* sphere */
468 (void) xy;
469 return healpix_sphere(lp);
470 }
471 FORWARD(e_healpix_forward); /* ellipsoid */
472 (void) xy;
473 lp.phi = auth_lat(P, lp.phi, 0);
474 return healpix_sphere(lp);
475 }
476 INVERSE(s_healpix_inverse); /* sphere */
477 /* Check whether (x, y) lies in the HEALPix image */
478 if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
479 lp.lam = HUGE_VAL;
480 lp.phi = HUGE_VAL;
481 pj_ctx_set_errno(P->ctx, -15);
482 return lp;
483 }
484 return healpix_sphere_inverse(xy);
485 }
486 INVERSE(e_healpix_inverse); /* ellipsoid */
487 /* Check whether (x, y) lies in the HEALPix image. */
488 if (in_image(xy.x, xy.y, 0, 0, 0) == 0) {
489 lp.lam = HUGE_VAL;
490 lp.phi = HUGE_VAL;
491 pj_ctx_set_errno(P->ctx, -15);
492 return lp;
493 }
494 lp = healpix_sphere_inverse(xy);
495 lp.phi = auth_lat(P, lp.phi, 1);
496 return (lp);
497 }
498 FORWARD(s_rhealpix_forward); /* sphere */
499 xy = healpix_sphere(lp);
500 return combine_caps(xy.x, xy.y, P->north_square, P->south_square, 0);
501 }
502 FORWARD(e_rhealpix_forward); /* ellipsoid */
503 lp.phi = auth_lat(P, lp.phi, 0);
504 xy = healpix_sphere(lp);
505 return combine_caps(xy.x, xy.y, P->north_square, P->south_square, 0);
506 }
507 INVERSE(s_rhealpix_inverse); /* sphere */
508 /* Check whether (x, y) lies in the rHEALPix image. */
509 if (in_image(xy.x, xy.y, 1, P->north_square, P->south_square) == 0) {
510 lp.lam = HUGE_VAL;
511 lp.phi = HUGE_VAL;
512 pj_ctx_set_errno(P->ctx, -15);
513 return lp;
514 }
515 xy = combine_caps(xy.x, xy.y, P->north_square, P->south_square, 1);
516 return healpix_sphere_inverse(xy);
517 }
518 INVERSE(e_rhealpix_inverse); /* ellipsoid */
519 /* Check whether (x, y) lies in the rHEALPix image. */
520 if (in_image(xy.x, xy.y, 1, P->north_square, P->south_square) == 0) {
521 lp.lam = HUGE_VAL;
522 lp.phi = HUGE_VAL;
523 pj_ctx_set_errno(P->ctx, -15);
524 return lp;
525 }
526 xy = combine_caps(xy.x, xy.y, P->north_square, P->south_square, 1);
527 lp = healpix_sphere_inverse(xy);
528 lp.phi = auth_lat(P, lp.phi, 1);
529 return lp;
530 }
531 FREEUP;
532 if (P) {
533 if (P->apa)
534 pj_dalloc(P->apa);
535 pj_dalloc(P);
549536 }
550
551 xy.x = vector[0];
552 xy.y = vector[1];
553 return xy;
554 }else{
555 // compute inverse function.
556 // get the current position of rHEALPix polar squares
557 int cn;
558 int pole = 0;
559 double (*tmpRot)[2];
560 double c[2] = {capmap.x,capmap.y};
561 // disassemble
562 if(capmap.region == north){
563 pole = npole;
564 a[0] = R * (-3.0*PI/4.0 + capmap.cn * PI/2);
565 a[1] = R * (PI/2.0 + capmap.cn * 0);
566
567 tmpRot = rot[get_rotate_index(-1*(capmap.cn - pole))];
568 vector_sub(v,c,v_min_c);
569 dot_product(tmpRot,v_min_c,ret_dot);
570 vector_add(ret_dot, a, vector);
571
572 }else{
573 pole = spole;
574 a[0] = R * (-3.0*PI/4.0 + capmap.cn * PI/2);
575 a[1] = R * (PI/-2.0 + capmap.cn * 0);
576
577 tmpRot = rot[get_rotate_index(capmap.cn - pole)];
578 vector_sub(v,c,v_min_c);
579 dot_product(tmpRot,v_min_c,ret_dot);
580 vector_add(ret_dot, a, vector);
581 }
582 xy.x = vector[0];
583 xy.y = vector[1];
584 return xy;
585 }
586 }
587 FORWARD(e_healpix_forward); /* ellipsoidal */
588 //int r1[][2] = R1;
589 double bet = auth_lat(lp.phi, P->e, 0);
590 lp.phi = bet;
591 P->a = P->ra;
592 return healpix_sphere(lp,P);
593 }
594 FORWARD(s_healpix_forward); /* spheroid */
595 return healpix_sphere(lp, P);
596 }
597 INVERSE(e_healpix_inverse); /* ellipsoidal */
598 double bet, x, y;
599 P->a = P->ra;
600
601 // Scale down to radius 1 sphere before checking x,y
602 x = scale_number(xy.x,P->a,1);
603 y = scale_number(xy.y,P->a,1);
604 // check if the point is in the image
605 if(in_image(x,y,0,0,0) == 0){
606 lp.lam = HUGE_VAL;
607 lp.phi = HUGE_VAL;
608 pj_ctx_set_errno( P->ctx, -15);
609 return lp;
610 }
611
612 lp = healpix_sphere_inv(xy, P);
613
614 lp.phi = auth_lat(lp.phi,P->e,1);
615
616 return (lp);
617 }
618 INVERSE(s_healpix_inverse); /* spheroid */
619 double x = xy.x;
620 double y = xy.y;
621 // Scale down to radius 1 sphere before checking x,y
622 x = scale_number(x,P->a,1);
623 y = scale_number(y,P->a,1);
624 // check if the point is in the image
625 if(in_image(x,y,0,0,0) == 0){
626 lp.lam = HUGE_VAL;
627 lp.phi = HUGE_VAL;
628 pj_ctx_set_errno( P->ctx, -15);
629 return lp;
630 }
631 return healpix_sphere_inv(xy, P);
632 }
633 FORWARD(e_rhealpix_forward); /* ellipsoidal */
634 double bet = auth_lat(lp.phi,P->e,0);
635 lp.phi = bet;
636 xy = healpix_sphere(lp,P);
637 return combine_caps(xy.x, xy.y, P->a, P->npole, P->spole, 0);
638 }
639 FORWARD(s_rhealpix_forward); /* spheroid */
640 // Compute forward function.
641 xy = healpix_sphere(lp,P);
642 return combine_caps(xy.x, xy.y, P->a, P->npole, P->spole, 0);
643 }
644 INVERSE(e_rhealpix_inverse); /* ellipsoidal */
645 double x = scale_number(xy.x,P->a,1);
646 double y = scale_number(xy.y,P->a,1);
647 // check for out of bounds coordinates
648 if(in_image(x,y,1,P->npole,P->spole) == 0){
649 lp.lam = HUGE_VAL;
650 lp.phi = HUGE_VAL;
651 pj_ctx_set_errno( P->ctx, -15);
652 return lp;
653 }
654
655 xy = combine_caps(xy.x,xy.y,P->a,P->npole,P->spole,1);
656 lp = healpix_sphere_inv(xy, P);
657 lp.phi = auth_lat(lp.phi,P->e,1);
658 return lp;
659 }
660 INVERSE(s_rhealpix_inverse); /* spheroid */
661 double x = scale_number(xy.x,P->a,1);
662 double y = scale_number(xy.y,P->a,1);
663 // check for out of bounds coordinates
664 if(in_image(x,y,1,P->npole,P->spole) == 0){
665 lp.lam = HUGE_VAL;
666 lp.phi = HUGE_VAL;
667 pj_ctx_set_errno( P->ctx, -15);
668 return lp;
669 }
670 xy = combine_caps(xy.x,xy.y,P->a,P->npole,P->spole,1);
671 return healpix_sphere_inv(xy, P);
672 }
673 FREEUP;
674 if (P) {
675 pj_dalloc(P);
676 }
677 }
678 ENTRY0(healpix)
679 if(P->es){
680 P->inv = e_healpix_inverse; P->fwd = e_healpix_forward;
681 }else{
682 P->inv = s_healpix_inverse; P->fwd = s_healpix_forward;
537 }
538 ENTRY1(healpix, apa)
539 if (P->es) {
540 P->apa = pj_authset(P->es); /* For auth_lat(). */
541 P->qp = pj_qsfn(1.0, P->e, P->one_es); /* For auth_lat(). */
542 P->a = P->a*sqrt(0.5*P->qp); /* Set P->a to authalic radius. */
543 P->ra = 1.0/P->a;
544 P->fwd = e_healpix_forward;
545 P->inv = e_healpix_inverse;
546 } else {
547 P->fwd = s_healpix_forward;
548 P->inv = s_healpix_inverse;
683549 }
684550 ENDENTRY(P)
685 ENTRY0(rhealpix)
686 P->npole = pj_param(P->ctx, P->params,"inpole").i;
687 P->spole = pj_param(P->ctx,P->params,"ispole").i;
688
689 // check for valid npole and spole inputs
690 if(P->npole < 0 || P->npole > 3){
691 E_ERROR(-47);
692 }
693 if(P->spole < 0 || P->spole > 3){
694 E_ERROR(-47);
695 }
696
697 if(P->es){
698 P->inv = e_rhealpix_inverse; P->fwd = e_rhealpix_forward;
699 }else{
700 P->inv = s_rhealpix_inverse; P->fwd = s_rhealpix_forward;
551 ENTRY1(rhealpix, apa)
552 P->north_square = pj_param(P->ctx, P->params,"inorth_square").i;
553 P->south_square = pj_param(P->ctx, P->params,"isouth_square").i;
554 /* Check for valid north_square and south_square inputs. */
555 if (P->north_square < 0 || P->north_square > 3) {
556 E_ERROR(-47);
557 }
558 if (P->south_square < 0 || P->south_square > 3) {
559 E_ERROR(-47);
560 }
561 if (P->es) {
562 P->apa = pj_authset(P->es); /* For auth_lat(). */
563 P->qp = pj_qsfn(1.0, P->e, P->one_es); /* For auth_lat(). */
564 P->a = P->a*sqrt(0.5*P->qp); /* Set P->a to authalic radius. */
565 P->ra = 1.0/P->a;
566 P->fwd = e_rhealpix_forward;
567 P->inv = e_rhealpix_inverse;
568 } else {
569 P->fwd = s_rhealpix_forward;
570 P->inv = s_rhealpix_inverse;
701571 }
702572 ENDENTRY(P)
918918 struct isea_pt v;
919919 int sidelength;
920920 int d, i, x, y, quad;
921 double oddsl;
922921
923922 quad = isea_ptdi(g, tri, pt, &v);
924923
933932 /* Aperture 3 odd resolutions */
934933 if (g->aperture == 3 && g->resolution % 2 != 0) {
935934 int offset = (int)(pow(3.0, g->resolution - 1) + 0.5);
936
937 oddsl = (pow(2.0, g->resolution) + 1.0) / 2.0;
938935
939936 d += offset * ((g->quad-1) % 5);
940937 i += offset * ((g->quad-1) % 5);
978975 struct isea_pt
979976 isea_forward(struct isea_dgg *g, struct isea_geo *in)
980977 {
981 int tri, downtri, quad;
978 int tri, downtri;
982979 struct isea_pt out, coord;
983980
984981 tri = isea_transform(g, in, &out);
985982
986983 downtri = (((tri - 1) / 5) % 2 == 1);
987 quad = ((tri - 1) % 5) + ((tri - 1) / 10) * 5 + 1;
988984
989985 if (g->output == ISEA_PLANE) {
990986 isea_tri_plane(tri, &out, g->radius);
7979 /* copy existing header into new */
8080 P->es = 0.; /* force to spherical */
8181 P->link->params = P->params;
82 P->link->ctx = P->ctx;
8283 P->link->over = P->over;
8384 P->link->geoc = P->geoc;
8485 P->link->a = P->a;
4747 F_ERROR;
4848 v = 0.5 * P->ArB * log((1. - U)/(1. + U));
4949 temp = cos(P->B * lp.lam);
50 u = (fabs(temp) < TOL) ? P->AB * lp.lam :
51 P->ArB * atan2((S * P->cosgam + V * P->singam) , temp);
50 if(fabs(temp) < TOL) {
51 u = P->A * lp.lam;
52 } else {
53 u = P->ArB * atan2((S * P->cosgam + V * P->singam), temp);
54 }
5255 } else {
5356 v = lp.phi > 0 ? P->v_pole_n : P->v_pole_s;
5457 u = P->ArB * lp.phi;
9295 }
9396 FREEUP; if (P) pj_dalloc(P); }
9497 ENTRY0(omerc)
95 double con, com, cosph0, D, F, H, L, sinph0, p, J, gamma,
96 gamma0, lamc, lam1, lam2, phi1, phi2, alpha_c;
98 double con, com, cosph0, D, F, H, L, sinph0, p, J, gamma=0,
99 gamma0, lamc=0, lam1=0, lam2=0, phi1=0, phi2=0, alpha_c;
97100 int alp, gam, no_off = 0;
98101
99102 P->no_rot = pj_param(P->ctx, P->params, "tno_rot").i;
108111 pj_param(P->ctx, P->params, "tno_off").i
109112 /* for backward compatibility */
110113 || pj_param(P->ctx, P->params, "tno_uoff").i;
114 if( no_off )
115 {
116 /* Mark the parameter as used, so that the pj_get_def() return them */
117 pj_param(P->ctx, P->params, "sno_uoff");
118 pj_param(P->ctx, P->params, "sno_off");
119 }
111120 } else {
112121 lam1 = pj_param(P->ctx, P->params, "rlon_1").f;
113122 phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
22 #define PJ_LIB__
33 # include <projects.h>
44 PROJ_HEAD(putp3, "Putnins P3") "\n\tPCyl., Sph.";
5 PROJ_HEAD(putp3p, "Putnins P3'") "\n\tPCyl., no inv., Sph.";
5 PROJ_HEAD(putp3p, "Putnins P3'") "\n\tPCyl., Sph.";
66 #define C 0.79788456
77 #define RPISQ 0.1013211836
88 FORWARD(s_forward); /* spheroid */
0 /*
1 * This implements the Quadrilateralized Spherical Cube (QSC) projection.
2 *
3 * Copyright (c) 2011, 2012 Martin Lambers <marlam@marlam.de>
4 *
5 * The QSC projection was introduced in:
6 * [OL76]
7 * E.M. O'Neill and R.E. Laubscher, "Extended Studies of a Quadrilateralized
8 * Spherical Cube Earth Data Base", Naval Environmental Prediction Research
9 * Facility Tech. Report NEPRF 3-76 (CSC), May 1976.
10 *
11 * The preceding shift from an ellipsoid to a sphere, which allows to apply
12 * this projection to ellipsoids as used in the Ellipsoidal Cube Map model,
13 * is described in
14 * [LK12]
15 * M. Lambers and A. Kolb, "Ellipsoidal Cube Maps for Accurate Rendering of
16 * Planetary-Scale Terrain Data", Proc. Pacfic Graphics (Short Papers), Sep.
17 * 2012
18 *
19 * You have to choose one of the following projection centers,
20 * corresponding to the centers of the six cube faces:
21 * phi0 = 0.0, lam0 = 0.0 ("front" face)
22 * phi0 = 0.0, lam0 = 90.0 ("right" face)
23 * phi0 = 0.0, lam0 = 180.0 ("back" face)
24 * phi0 = 0.0, lam0 = -90.0 ("left" face)
25 * phi0 = 90.0 ("top" face)
26 * phi0 = -90.0 ("bottom" face)
27 * Other projection centers will not work!
28 *
29 * In the projection code below, each cube face is handled differently.
30 * See the computation of the face parameter in the ENTRY0(qsc) function
31 * and the handling of different face values (FACE_*) in the forward and
32 * inverse projections.
33 *
34 * Furthermore, the projection is originally only defined for theta angles
35 * between (-1/4 * PI) and (+1/4 * PI) on the current cube face. This area
36 * of definition is named AREA_0 in the projection code below. The other
37 * three areas of a cube face are handled by rotation of AREA_0.
38 */
39
40 #define PROJ_PARMS__ \
41 int face; \
42 double a_squared; \
43 double b; \
44 double one_minus_f; \
45 double one_minus_f_squared;
46 #define PJ_LIB__
47 #include <projects.h>
48 PROJ_HEAD(qsc, "Quadrilateralized Spherical Cube") "\n\tAzi, Sph.";
49 #define EPS10 1.e-10
50
51 /* The six cube faces. */
52 #define FACE_FRONT 0
53 #define FACE_RIGHT 1
54 #define FACE_BACK 2
55 #define FACE_LEFT 3
56 #define FACE_TOP 4
57 #define FACE_BOTTOM 5
58
59 /* The four areas on a cube face. AREA_0 is the area of definition,
60 * the other three areas are counted counterclockwise. */
61 #define AREA_0 0
62 #define AREA_1 1
63 #define AREA_2 2
64 #define AREA_3 3
65
66 /* Helper function for forward projection: compute the theta angle
67 * and determine the area number. */
68 static double
69 qsc_fwd_equat_face_theta(double phi, double y, double x, int *area) {
70 double theta;
71 if (phi < EPS10) {
72 *area = AREA_0;
73 theta = 0.0;
74 } else {
75 theta = atan2(y, x);
76 if (fabs(theta) <= FORTPI) {
77 *area = AREA_0;
78 } else if (theta > FORTPI && theta <= HALFPI + FORTPI) {
79 *area = AREA_1;
80 theta -= HALFPI;
81 } else if (theta > HALFPI + FORTPI || theta <= -(HALFPI + FORTPI)) {
82 *area = AREA_2;
83 theta = (theta >= 0.0 ? theta - PI : theta + PI);
84 } else {
85 *area = AREA_3;
86 theta += HALFPI;
87 }
88 }
89 return (theta);
90 }
91
92 /* Helper function: shift the longitude. */
93 static double
94 qsc_shift_lon_origin(double lon, double offset) {
95 double slon = lon + offset;
96 if (slon < -PI) {
97 slon += TWOPI;
98 } else if (slon > +PI) {
99 slon -= TWOPI;
100 }
101 return slon;
102 }
103
104 /* Forward projection, ellipsoid */
105 FORWARD(e_forward);
106 double lat, lon;
107 double sinlat, coslat;
108 double sinlon, coslon;
109 double q, r, s;
110 double theta, phi;
111 double t, mu, nu;
112 int area;
113
114 /* Convert the geodetic latitude to a geocentric latitude.
115 * This corresponds to the shift from the ellipsoid to the sphere
116 * described in [LK12]. */
117 if (P->es) {
118 lat = atan(P->one_minus_f_squared * tan(lp.phi));
119 } else {
120 lat = lp.phi;
121 }
122
123 /* Convert the input lat, lon into theta, phi as used by QSC.
124 * This depends on the cube face and the area on it.
125 * For the top and bottom face, we can compute theta and phi
126 * directly from phi, lam. For the other faces, we must use
127 * unit sphere cartesian coordinates as an intermediate step. */
128 lon = lp.lam;
129 if (P->face != FACE_TOP && P->face != FACE_BOTTOM) {
130 if (P->face == FACE_RIGHT) {
131 lon = qsc_shift_lon_origin(lon, +HALFPI);
132 } else if (P->face == FACE_BACK) {
133 lon = qsc_shift_lon_origin(lon, +PI);
134 } else if (P->face == FACE_LEFT) {
135 lon = qsc_shift_lon_origin(lon, -HALFPI);
136 }
137 sinlat = sin(lat);
138 coslat = cos(lat);
139 sinlon = sin(lon);
140 coslon = cos(lon);
141 q = coslat * coslon;
142 r = coslat * sinlon;
143 s = sinlat;
144 }
145 if (P->face == FACE_FRONT) {
146 phi = acos(q);
147 theta = qsc_fwd_equat_face_theta(phi, s, r, &area);
148 } else if (P->face == FACE_RIGHT) {
149 phi = acos(r);
150 theta = qsc_fwd_equat_face_theta(phi, s, -q, &area);
151 } else if (P->face == FACE_BACK) {
152 phi = acos(-q);
153 theta = qsc_fwd_equat_face_theta(phi, s, -r, &area);
154 } else if (P->face == FACE_LEFT) {
155 phi = acos(-r);
156 theta = qsc_fwd_equat_face_theta(phi, s, q, &area);
157 } else if (P->face == FACE_TOP) {
158 phi = HALFPI - lat;
159 if (lon >= FORTPI && lon <= HALFPI + FORTPI) {
160 area = AREA_0;
161 theta = lon - HALFPI;
162 } else if (lon > HALFPI + FORTPI || lon <= -(HALFPI + FORTPI)) {
163 area = AREA_1;
164 theta = (lon > 0.0 ? lon - PI : lon + PI);
165 } else if (lon > -(HALFPI + FORTPI) && lon <= -FORTPI) {
166 area = AREA_2;
167 theta = lon + HALFPI;
168 } else {
169 area = AREA_3;
170 theta = lon;
171 }
172 } else /* P->face == FACE_BOTTOM */ {
173 phi = HALFPI + lat;
174 if (lon >= FORTPI && lon <= HALFPI + FORTPI) {
175 area = AREA_0;
176 theta = -lon + HALFPI;
177 } else if (lon < FORTPI && lon >= -FORTPI) {
178 area = AREA_1;
179 theta = -lon;
180 } else if (lon < -FORTPI && lon >= -(HALFPI + FORTPI)) {
181 area = AREA_2;
182 theta = -lon - HALFPI;
183 } else {
184 area = AREA_3;
185 theta = (lon > 0.0 ? -lon + PI : -lon - PI);
186 }
187 }
188
189 /* Compute mu and nu for the area of definition.
190 * For mu, see Eq. (3-21) in [OL76], but note the typos:
191 * compare with Eq. (3-14). For nu, see Eq. (3-38). */
192 mu = atan((12.0 / PI) * (theta + acos(sin(theta) * cos(FORTPI)) - HALFPI));
193 t = sqrt((1.0 - cos(phi)) / (cos(mu) * cos(mu)) / (1.0 - cos(atan(1.0 / cos(theta)))));
194 /* nu = atan(t); We don't really need nu, just t, see below. */
195
196 /* Apply the result to the real area. */
197 if (area == AREA_1) {
198 mu += HALFPI;
199 } else if (area == AREA_2) {
200 mu += PI;
201 } else if (area == AREA_3) {
202 mu += HALFPI + PI;
203 }
204
205 /* Now compute x, y from mu and nu */
206 /* t = tan(nu); */
207 xy.x = t * cos(mu);
208 xy.y = t * sin(mu);
209 return (xy);
210 }
211
212 /* Inverse projection, ellipsoid */
213 INVERSE(e_inverse);
214 double mu, nu, cosmu, tannu;
215 double tantheta, theta, cosphi, phi;
216 double t;
217 int area;
218
219 /* Convert the input x, y to the mu and nu angles as used by QSC.
220 * This depends on the area of the cube face. */
221 nu = atan(sqrt(xy.x * xy.x + xy.y * xy.y));
222 mu = atan2(xy.y, xy.x);
223 if (xy.x >= 0.0 && xy.x >= fabs(xy.y)) {
224 area = AREA_0;
225 } else if (xy.y >= 0.0 && xy.y >= fabs(xy.x)) {
226 area = AREA_1;
227 mu -= HALFPI;
228 } else if (xy.x < 0.0 && -xy.x >= fabs(xy.y)) {
229 area = AREA_2;
230 mu = (mu < 0.0 ? mu + PI : mu - PI);
231 } else {
232 area = AREA_3;
233 mu += HALFPI;
234 }
235
236 /* Compute phi and theta for the area of definition.
237 * The inverse projection is not described in the original paper, but some
238 * good hints can be found here (as of 2011-12-14):
239 * http://fits.gsfc.nasa.gov/fitsbits/saf.93/saf.9302
240 * (search for "Message-Id: <9302181759.AA25477 at fits.cv.nrao.edu>") */
241 t = (PI / 12.0) * tan(mu);
242 tantheta = sin(t) / (cos(t) - (1.0 / sqrt(2.0)));
243 theta = atan(tantheta);
244 cosmu = cos(mu);
245 tannu = tan(nu);
246 cosphi = 1.0 - cosmu * cosmu * tannu * tannu * (1.0 - cos(atan(1.0 / cos(theta))));
247 if (cosphi < -1.0) {
248 cosphi = -1.0;
249 } else if (cosphi > +1.0) {
250 cosphi = +1.0;
251 }
252
253 /* Apply the result to the real area on the cube face.
254 * For the top and bottom face, we can compute phi and lam directly.
255 * For the other faces, we must use unit sphere cartesian coordinates
256 * as an intermediate step. */
257 if (P->face == FACE_TOP) {
258 phi = acos(cosphi);
259 lp.phi = HALFPI - phi;
260 if (area == AREA_0) {
261 lp.lam = theta + HALFPI;
262 } else if (area == AREA_1) {
263 lp.lam = (theta < 0.0 ? theta + PI : theta - PI);
264 } else if (area == AREA_2) {
265 lp.lam = theta - HALFPI;
266 } else /* area == AREA_3 */ {
267 lp.lam = theta;
268 }
269 } else if (P->face == FACE_BOTTOM) {
270 phi = acos(cosphi);
271 lp.phi = phi - HALFPI;
272 if (area == AREA_0) {
273 lp.lam = -theta + HALFPI;
274 } else if (area == AREA_1) {
275 lp.lam = -theta;
276 } else if (area == AREA_2) {
277 lp.lam = -theta - HALFPI;
278 } else /* area == AREA_3 */ {
279 lp.lam = (theta < 0.0 ? -theta - PI : -theta + PI);
280 }
281 } else {
282 /* Compute phi and lam via cartesian unit sphere coordinates. */
283 double q, r, s, t;
284 q = cosphi;
285 t = q * q;
286 if (t >= 1.0) {
287 s = 0.0;
288 } else {
289 s = sqrt(1.0 - t) * sin(theta);
290 }
291 t += s * s;
292 if (t >= 1.0) {
293 r = 0.0;
294 } else {
295 r = sqrt(1.0 - t);
296 }
297 /* Rotate q,r,s into the correct area. */
298 if (area == AREA_1) {
299 t = r;
300 r = -s;
301 s = t;
302 } else if (area == AREA_2) {
303 r = -r;
304 s = -s;
305 } else if (area == AREA_3) {
306 t = r;
307 r = s;
308 s = -t;
309 }
310 /* Rotate q,r,s into the correct cube face. */
311 if (P->face == FACE_RIGHT) {
312 t = q;
313 q = -r;
314 r = t;
315 } else if (P->face == FACE_BACK) {
316 q = -q;
317 r = -r;
318 } else if (P->face == FACE_LEFT) {
319 t = q;
320 q = r;
321 r = -t;
322 }
323 /* Now compute phi and lam from the unit sphere coordinates. */
324 lp.phi = acos(-s) - HALFPI;
325 lp.lam = atan2(r, q);
326 if (P->face == FACE_RIGHT) {
327 lp.lam = qsc_shift_lon_origin(lp.lam, -HALFPI);
328 } else if (P->face == FACE_BACK) {
329 lp.lam = qsc_shift_lon_origin(lp.lam, -PI);
330 } else if (P->face == FACE_LEFT) {
331 lp.lam = qsc_shift_lon_origin(lp.lam, +HALFPI);
332 }
333 }
334
335 /* Apply the shift from the sphere to the ellipsoid as described
336 * in [LK12]. */
337 if (P->es) {
338 int invert_sign;
339 double tanphi, xa;
340 invert_sign = (lp.phi < 0.0 ? 1 : 0);
341 tanphi = tan(lp.phi);
342 xa = P->b / sqrt(tanphi * tanphi + P->one_minus_f_squared);
343 lp.phi = atan(sqrt(P->a * P->a - xa * xa) / (P->one_minus_f * xa));
344 if (invert_sign) {
345 lp.phi = -lp.phi;
346 }
347 }
348 return (lp);
349 }
350 FREEUP; if (P) pj_dalloc(P); }
351 ENTRY0(qsc)
352 P->inv = e_inverse;
353 P->fwd = e_forward;
354 /* Determine the cube face from the center of projection. */
355 if (P->phi0 >= HALFPI - FORTPI / 2.0) {
356 P->face = FACE_TOP;
357 } else if (P->phi0 <= -(HALFPI - FORTPI / 2.0)) {
358 P->face = FACE_BOTTOM;
359 } else if (fabs(P->lam0) <= FORTPI) {
360 P->face = FACE_FRONT;
361 } else if (fabs(P->lam0) <= HALFPI + FORTPI) {
362 P->face = (P->lam0 > 0.0 ? FACE_RIGHT : FACE_LEFT);
363 } else {
364 P->face = FACE_BACK;
365 }
366 /* Fill in useful values for the ellipsoid <-> sphere shift
367 * described in [LK12]. */
368 if (P->es) {
369 P->a_squared = P->a * P->a;
370 P->b = P->a * sqrt(1.0 - P->es);
371 P->one_minus_f = 1.0 - (P->a - P->b) / P->a;
372 P->one_minus_f_squared = P->one_minus_f * P->one_minus_f;
373 }
374 ENDENTRY(P)
22 PROJ_HEAD(robin, "Robinson") "\n\tPCyl., Sph.";
33 #define V(C,z) (C.c0 + z * (C.c1 + z * (C.c2 + z * C.c3)))
44 #define DV(C,z) (C.c1 + z * (C.c2 + C.c2 + z * 3. * C.c3))
5 /* note: following terms based upon 5 deg. intervals in degrees. */
6 static struct COEFS {
5
6 /*
7 note: following terms based upon 5 deg. intervals in degrees.
8
9 Some background on these coefficients is available at:
10
11 http://article.gmane.org/gmane.comp.gis.proj-4.devel/6039
12 http://trac.osgeo.org/proj/ticket/113
13 */
14
15 struct COEFS {
716 float c0, c1, c2, c3;
8 } X[] = {
9 {1, -5.67239e-12, -7.15511e-05, 3.11028e-06},
10 {0.9986, -0.000482241, -2.4897e-05, -1.33094e-06},
11 {0.9954, -0.000831031, -4.4861e-05, -9.86588e-07},
12 {0.99, -0.00135363, -5.96598e-05, 3.67749e-06},
13 {0.9822, -0.00167442, -4.4975e-06, -5.72394e-06},
14 {0.973, -0.00214869, -9.03565e-05, 1.88767e-08},
15 {0.96, -0.00305084, -9.00732e-05, 1.64869e-06},
16 {0.9427, -0.00382792, -6.53428e-05, -2.61493e-06},
17 {0.9216, -0.00467747, -0.000104566, 4.8122e-06},
18 {0.8962, -0.00536222, -3.23834e-05, -5.43445e-06},
19 {0.8679, -0.00609364, -0.0001139, 3.32521e-06},
20 {0.835, -0.00698325, -6.40219e-05, 9.34582e-07},
21 {0.7986, -0.00755337, -5.00038e-05, 9.35532e-07},
22 {0.7597, -0.00798325, -3.59716e-05, -2.27604e-06},
23 {0.7186, -0.00851366, -7.0112e-05, -8.63072e-06},
24 {0.6732, -0.00986209, -0.000199572, 1.91978e-05},
25 {0.6213, -0.010418, 8.83948e-05, 6.24031e-06},
26 {0.5722, -0.00906601, 0.000181999, 6.24033e-06},
27 {0.5322, 0.,0.,0.} },
28 Y[] = {
29 {0, 0.0124, 3.72529e-10, 1.15484e-09},
30 {0.062, 0.0124001, 1.76951e-08, -5.92321e-09},
31 {0.124, 0.0123998, -7.09668e-08, 2.25753e-08},
32 {0.186, 0.0124008, 2.66917e-07, -8.44523e-08},
33 {0.248, 0.0123971, -9.99682e-07, 3.15569e-07},
34 {0.31, 0.0124108, 3.73349e-06, -1.1779e-06},
35 {0.372, 0.0123598, -1.3935e-05, 4.39588e-06},
36 {0.434, 0.0125501, 5.20034e-05, -1.00051e-05},
37 {0.4958, 0.0123198, -9.80735e-05, 9.22397e-06},
38 {0.5571, 0.0120308, 4.02857e-05, -5.2901e-06},
39 {0.6176, 0.0120369, -3.90662e-05, 7.36117e-07},
40 {0.6769, 0.0117015, -2.80246e-05, -8.54283e-07},
41 {0.7346, 0.0113572, -4.08389e-05, -5.18524e-07},
42 {0.7903, 0.0109099, -4.86169e-05, -1.0718e-06},
43 {0.8435, 0.0103433, -6.46934e-05, 5.36384e-09},
44 {0.8936, 0.00969679, -6.46129e-05, -8.54894e-06},
45 {0.9394, 0.00840949, -0.000192847, -4.21023e-06},
46 {0.9761, 0.00616525, -0.000256001, -4.21021e-06},
47 {1., 0.,0.,0} };
17 };
18
19 static const struct COEFS X[] = {
20 {1, 2.2199e-17, -7.15515e-05, 3.1103e-06},
21 {0.9986, -0.000482243, -2.4897e-05, -1.3309e-06},
22 {0.9954, -0.00083103, -4.48605e-05, -9.86701e-07},
23 {0.99, -0.00135364, -5.9661e-05, 3.6777e-06},
24 {0.9822, -0.00167442, -4.49547e-06, -5.72411e-06},
25 {0.973, -0.00214868, -9.03571e-05, 1.8736e-08},
26 {0.96, -0.00305085, -9.00761e-05, 1.64917e-06},
27 {0.9427, -0.00382792, -6.53386e-05, -2.6154e-06},
28 {0.9216, -0.00467746, -0.00010457, 4.81243e-06},
29 {0.8962, -0.00536223, -3.23831e-05, -5.43432e-06},
30 {0.8679, -0.00609363, -0.000113898, 3.32484e-06},
31 {0.835, -0.00698325, -6.40253e-05, 9.34959e-07},
32 {0.7986, -0.00755338, -5.00009e-05, 9.35324e-07},
33 {0.7597, -0.00798324, -3.5971e-05, -2.27626e-06},
34 {0.7186, -0.00851367, -7.01149e-05, -8.6303e-06},
35 {0.6732, -0.00986209, -0.000199569, 1.91974e-05},
36 {0.6213, -0.010418, 8.83923e-05, 6.24051e-06},
37 {0.5722, -0.00906601, 0.000182, 6.24051e-06},
38 {0.5322, -0.00677797, 0.000275608, 6.24051e-06}
39 };
40 static const struct COEFS Y[] = {
41 {-5.20417e-18, 0.0124, 1.21431e-18, -8.45284e-11},
42 {0.062, 0.0124, -1.26793e-09, 4.22642e-10},
43 {0.124, 0.0124, 5.07171e-09, -1.60604e-09},
44 {0.186, 0.0123999, -1.90189e-08, 6.00152e-09},
45 {0.248, 0.0124002, 7.10039e-08, -2.24e-08},
46 {0.31, 0.0123992, -2.64997e-07, 8.35986e-08},
47 {0.372, 0.0124029, 9.88983e-07, -3.11994e-07},
48 {0.434, 0.0123893, -3.69093e-06, -4.35621e-07},
49 {0.4958, 0.0123198, -1.02252e-05, -3.45523e-07},
50 {0.5571, 0.0121916, -1.54081e-05, -5.82288e-07},
51 {0.6176, 0.0119938, -2.41424e-05, -5.25327e-07},
52 {0.6769, 0.011713, -3.20223e-05, -5.16405e-07},
53 {0.7346, 0.0113541, -3.97684e-05, -6.09052e-07},
54 {0.7903, 0.0109107, -4.89042e-05, -1.04739e-06},
55 {0.8435, 0.0103431, -6.4615e-05, -1.40374e-09},
56 {0.8936, 0.00969686, -6.4636e-05, -8.547e-06},
57 {0.9394, 0.00840947, -0.000192841, -4.2106e-06},
58 {0.9761, 0.00616527, -0.000256, -4.2106e-06},
59 {1, 0.00328947, -0.000319159, -4.2106e-06}
60 };
4861 #define FXC 0.8487
4962 #define FYC 1.3523
5063 #define C1 11.45915590261646417544
11 double m, rmn, q3, n;
22 #define PJ_LIB__
33 # include <projects.h>
4 PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl., Sph.\n\tn= q= alphi=";
4 PROJ_HEAD(urm5, "Urmaev V") "\n\tPCyl., Sph., no inv.\n\tn= q= alpha=";
55 FORWARD(s_forward); /* spheroid */
66 double t;
77
0 all the files here are directly copied from proj svn, except for PJ_hammer.c
1 which is patched to enable the inverse transform.
2
3 Currently up-to-date with r2406 proj svn (20131105).
11 #include "geod_interface.h"
22
33 void geod_ini(void) {
4 GeodesicInit(&GlobalGeodesic, geod_a, geod_f);
4 geod_init(&GlobalGeodesic, geod_a, geod_f);
55 }
66
77 void geod_pre(void) {
88 double
99 degree = PI/180,
1010 lat1 = phi1 / degree, lon1 = lam1 /degree, azi1 = al12 / degree;
11 GeodesicLineInit(&GlobalGeodesicLine, &GlobalGeodesic,
11 geod_lineinit(&GlobalGeodesicLine, &GlobalGeodesic,
1212 lat1, lon1, azi1, 0U);
1313 }
1414
1515 void geod_for(void) {
1616 double degree = PI/180, s12 = geod_S, lat2, lon2, azi2;
17 Position(&GlobalGeodesicLine, s12, &lat2, &lon2, &azi2);
17 geod_position(&GlobalGeodesicLine, s12, &lat2, &lon2, &azi2);
1818 azi2 += azi2 >= 0 ? -180 : 180; /* Compute back azimuth */
1919 phi2 = lat2 * degree;
2020 lam2 = lon2 * degree;
2727 lat1 = phi1 / degree, lon1 = lam1 / degree,
2828 lat2 = phi2 / degree, lon2 = lam2 / degree,
2929 azi1, azi2, s12;
30 Inverse(&GlobalGeodesic, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2);
30 geod_inverse(&GlobalGeodesic, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2);
3131 azi2 += azi2 >= 0 ? -180 : 180; /* Compute back azimuth */
3232 al12 = azi1 * degree; al21 = azi2 * degree; geod_S = s12;
3333 }
2626 # define al21 GEODESIC.ALPHA21
2727 # define geod_S GEODESIC.DIST
2828
29 GEOD_EXTERN struct Geodesic GlobalGeodesic;
30 GEOD_EXTERN struct GeodesicLine GlobalGeodesicLine;
29 GEOD_EXTERN struct geod_geodesic GlobalGeodesic;
30 GEOD_EXTERN struct geod_geodesicline GlobalGeodesicLine;
3131 GEOD_EXTERN int n_alpha, n_S;
3232 GEOD_EXTERN double to_meter, fr_meter, del_alpha;
3333
0 /**
1 * \file geodesic.c
2 * \brief Implementation of the geodesic routines in C
3 *
4 * For the full documentation see geodesic.h.
5 **********************************************************************/
6
7 /** @cond SKIP */
8
09 /*
110 * This is a C implementation of the geodesic algorithms described in
211 *
3 * C. F. F. Karney
4 * Algorithms for geodesics
5 * J. Geodesy (2012)
12 * C. F. F. Karney,
13 * Algorithms for geodesics,
14 * J. Geodesy <b>87</b>, 43--55 (2013);
615 * http://dx.doi.org/10.1007/s00190-012-0578-z
716 * Addenda: http://geographiclib.sf.net/geod-addenda.html
817 *
918 * See the comments in geodesic.h for documentation.
1019 *
11 * Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed
20 * Copyright (c) Charles Karney (2012-2013) <charles@karney.com> and licensed
1221 * under the MIT/X11 License. For more information, see
1322 * http://geographiclib.sourceforge.net/
14 *
15 * This file was distributed with GeographicLib 1.27.
1623 */
1724
1825 #include "geodesic.h"
116123 return x < 0 ? -y : y;
117124 }
118125
126 static real sumx(real u, real v, real* t) {
127 volatile real s = u + v;
128 volatile real up = s - v;
129 volatile real vpp = s - up;
130 up -= u;
131 vpp -= v;
132 *t = -(up + vpp);
133 /* error-free sum:
134 * u + v = s + t
135 * = round(u + v) + t */
136 return s;
137 }
138
119139 static real minx(real x, real y)
120140 { return x < y ? x : y; }
121141
136156 static real AngNormalize2(real x)
137157 { return AngNormalize(fmod(x, (real)(360))); }
138158
159 static real AngDiff(real x, real y) {
160 real t, d = sumx(-x, y, &t);
161 if ((d - (real)(180)) + t > (real)(0)) /* y - x > 180 */
162 d -= (real)(360); /* exact */
163 else if ((d + (real)(180)) + t <= (real)(0)) /* y - x <= -180 */
164 d += (real)(360); /* exact */
165 return d + t;
166 }
167
139168 static real AngRound(real x) {
140 const real z = (real)(0.0625); /* 1/16 */
169 const real z = 1/(real)(16);
141170 volatile real y = fabs(x);
142171 /* The compiler mustn't "simplify" z - (z - y) to y */
143172 y = y < z ? z - (z - y) : y;
144173 return x < 0 ? -y : y;
145174 }
146175
147 static void A3coeff(struct Geodesic* g);
148 static void C3coeff(struct Geodesic* g);
149 static void C4coeff(struct Geodesic* g);
176 static void A3coeff(struct geod_geodesic* g);
177 static void C3coeff(struct geod_geodesic* g);
178 static void C4coeff(struct geod_geodesic* g);
150179 static real SinCosSeries(boolx sinp,
151180 real sinx, real cosx,
152181 const real c[], int n);
153 static void Lengths(const struct Geodesic* g,
182 static void Lengths(const struct geod_geodesic* g,
154183 real eps, real sig12,
155184 real ssig1, real csig1, real dn1,
156185 real ssig2, real csig2, real dn2,
160189 /* Scratch areas of the right size */
161190 real C1a[], real C2a[]);
162191 static real Astroid(real x, real y);
163 static real InverseStart(const struct Geodesic* g,
192 static real InverseStart(const struct geod_geodesic* g,
164193 real sbet1, real cbet1, real dn1,
165194 real sbet2, real cbet2, real dn2,
166195 real lam12,
167196 real* psalp1, real* pcalp1,
168197 /* Only updated if return val >= 0 */
169198 real* psalp2, real* pcalp2,
199 /* Only updated for short lines */
200 real* pdnm,
170201 /* Scratch areas of the right size */
171202 real C1a[], real C2a[]);
172 static real Lambda12(const struct Geodesic* g,
203 static real Lambda12(const struct geod_geodesic* g,
173204 real sbet1, real cbet1, real dn1,
174205 real sbet2, real cbet2, real dn2,
175206 real salp1, real calp1,
181212 boolx diffp, real* pdlam12,
182213 /* Scratch areas of the right size */
183214 real C1a[], real C2a[], real C3a[]);
184 static real A3f(const struct Geodesic* g, real eps);
185 static void C3f(const struct Geodesic* g, real eps, real c[]);
186 static void C4f(const struct Geodesic* g, real eps, real c[]);
215 static real A3f(const struct geod_geodesic* g, real eps);
216 static void C3f(const struct geod_geodesic* g, real eps, real c[]);
217 static void C4f(const struct geod_geodesic* g, real eps, real c[]);
187218 static real A1m1f(real eps);
188219 static void C1f(real eps, real c[]);
189220 static void C1pf(real eps, real c[]);
190221 static real A2m1f(real eps);
191222 static void C2f(real eps, real c[]);
192
193 void GeodesicInit(struct Geodesic* g, real a, real f) {
223 static int transit(real lon1, real lon2);
224 static void accini(real s[]);
225 static void acccopy(const real s[], real t[]);
226 static void accadd(real s[], real y);
227 static real accsum(const real s[], real y);
228 static void accneg(real s[]);
229
230 void geod_init(struct geod_geodesic* g, real a, real f) {
194231 if (!init) Init();
195232 g->a = a;
196233 g->f = f <= 1 ? f : 1/f;
203240 (g->e2 == 0 ? 1 :
204241 (g->e2 > 0 ? atanhx(sqrt(g->e2)) : atan(sqrt(-g->e2))) /
205242 sqrt(fabs(g->e2))))/2; /* authalic radius squared */
206 /* The sig12 threshold for "really short" */
207 g->etol2 = 0.01 * tol2 / maxx((real)(0.1), sqrt(fabs(g->e2)));
243 /* The sig12 threshold for "really short". Using the auxiliary sphere
244 * solution with dnm computed at (bet1 + bet2) / 2, the relative error in the
245 * azimuth consistency check is sig12^2 * abs(f) * min(1, 1-f/2) / 2. (Error
246 * measured for 1/100 < b/a < 100 and abs(f) >= 1/1000. For a given f and
247 * sig12, the max error occurs for lines near the pole. If the old rule for
248 * computing dnm = (dn1 + dn2)/2 is used, then the error increases by a
249 * factor of 2.) Setting this equal to epsilon gives sig12 = etol2. Here
250 * 0.1 is a safety factor (error decreased by 100) and max(0.001, abs(f))
251 * stops etol2 getting too large in the nearly spherical case. */
252 g->etol2 = 0.1 * tol2 /
253 sqrt( maxx((real)(0.001), fabs(g->f)) * minx((real)(1), 1 - g->f/2) / 2 );
254
208255 A3coeff(g);
209256 C3coeff(g);
210257 C4coeff(g);
211258 }
212259
213 void GeodesicLineInit(struct GeodesicLine* l,
214 const struct Geodesic* g,
215 real lat1, real lon1, real azi1, unsigned caps) {
260 void geod_lineinit(struct geod_geodesicline* l,
261 const struct geod_geodesic* g,
262 real lat1, real lon1, real azi1, unsigned caps) {
216263 real alp1, cbet1, sbet1, phi, eps;
217264 l->a = g->a;
218265 l->f = g->f;
220267 l->c2 = g->c2;
221268 l->f1 = g->f1;
222269 /* If caps is 0 assume the standard direct calculation */
223 l->caps = (caps ? caps : DISTANCE_IN | LONGITUDE) |
224 LATITUDE | AZIMUTH; /* Always allow latitude and azimuth */
225
226 azi1 = AngNormalize(azi1);
270 l->caps = (caps ? caps : GEOD_DISTANCE_IN | GEOD_LONGITUDE) |
271 GEOD_LATITUDE | GEOD_AZIMUTH; /* Always allow latitude and azimuth */
272
273 /* Guard against underflow in salp0 */
274 azi1 = AngRound(AngNormalize(azi1));
227275 lon1 = AngNormalize(lon1);
228 if (lat1 == 90) {
229 lon1 += lon1 < 0 ? 180 : -180;
230 lon1 = AngNormalize(lon1 - azi1);
231 azi1 = -180;
232 } else if (lat1 == -90) {
233 lon1 = AngNormalize(lon1 + azi1);
234 azi1 = 0;
235 } else {
236 /* Guard against underflow in salp0 */
237 azi1 = AngRound(azi1);
238 }
239
240276 l->lat1 = lat1;
241277 l->lon1 = lon1;
242278 l->azi1 = azi1;
244280 alp1 = azi1 * degree;
245281 /* Enforce sin(pi) == 0 and cos(pi/2) == 0. Better to face the ensuing
246282 * problems directly than to skirt them. */
247 l->salp1 = azi1 == -180 ? 0 : sin(alp1);
283 l->salp1 = azi1 == -180 ? 0 : sin(alp1);
248284 l->calp1 = fabs(azi1) == 90 ? 0 : cos(alp1);
249285 phi = lat1 * degree;
250286 /* Ensure cbet1 = +epsilon at poles */
311347 }
312348 }
313349
314 real GenPosition(const struct GeodesicLine* l,
315 boolx arcmode, real s12_a12,
316 real* plat2, real* plon2, real* pazi2,
317 real* ps12, real* pm12,
318 real* pM12, real* pM21,
319 real* pS12) {
350 real geod_genposition(const struct geod_geodesicline* l,
351 boolx arcmode, real s12_a12,
352 real* plat2, real* plon2, real* pazi2,
353 real* ps12, real* pm12,
354 real* pM12, real* pM21,
355 real* pS12) {
320356 real lat2 = 0, lon2 = 0, azi2 = 0, s12 = 0,
321357 m12 = 0, M12 = 0, M21 = 0, S12 = 0;
322358 /* Avoid warning about uninitialized B12. */
324360 real omg12, lam12, lon12;
325361 real ssig2, csig2, sbet2, cbet2, somg2, comg2, salp2, calp2, dn2;
326362 unsigned outmask =
327 (plat2 ? LATITUDE : 0U) |
328 (plon2 ? LONGITUDE : 0U) |
329 (pazi2 ? AZIMUTH : 0U) |
330 (ps12 ? DISTANCE : 0U) |
331 (pm12 ? REDUCEDLENGTH : 0U) |
332 (pM12 || pM21 ? GEODESICSCALE : 0U) |
333 (pS12 ? AREA : 0U);
363 (plat2 ? GEOD_LATITUDE : 0U) |
364 (plon2 ? GEOD_LONGITUDE : 0U) |
365 (pazi2 ? GEOD_AZIMUTH : 0U) |
366 (ps12 ? GEOD_DISTANCE : 0U) |
367 (pm12 ? GEOD_REDUCEDLENGTH : 0U) |
368 (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) |
369 (pS12 ? GEOD_AREA : 0U);
334370
335371 outmask &= l->caps & OUT_ALL;
336 if (!( TRUE /*Init()*/ && (arcmode || (l->caps & DISTANCE_IN & OUT_ALL)) ))
372 if (!( TRUE /*Init()*/ &&
373 (arcmode || (l->caps & GEOD_DISTANCE_IN & OUT_ALL)) ))
337374 /* Uninitialized or impossible distance calculation requested */
338375 return NaN;
339376
396433 ssig2 = l->ssig1 * csig12 + l->csig1 * ssig12;
397434 csig2 = l->csig1 * csig12 - l->ssig1 * ssig12;
398435 dn2 = sqrt(1 + l->k2 * sq(ssig2));
399 if (outmask & (DISTANCE | REDUCEDLENGTH | GEODESICSCALE)) {
436 if (outmask & (GEOD_DISTANCE | GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) {
400437 if (arcmode || fabs(l->f) > 0.01)
401438 B12 = SinCosSeries(TRUE, ssig2, csig2, l->C1a, nC1);
402439 AB1 = (1 + l->A1m1) * (B12 - l->B11);
416453 omg12 = atan2(somg2 * l->comg1 - comg2 * l->somg1,
417454 comg2 * l->comg1 + somg2 * l->somg1);
418455
419 if (outmask & DISTANCE)
456 if (outmask & GEOD_DISTANCE)
420457 s12 = arcmode ? l->b * ((1 + l->A1m1) * sig12 + AB1) : s12_a12;
421458
422 if (outmask & LONGITUDE) {
459 if (outmask & GEOD_LONGITUDE) {
423460 lam12 = omg12 + l->A3c *
424461 ( sig12 + (SinCosSeries(TRUE, ssig2, csig2, l->C3a, nC3-1)
425462 - l->B31));
430467 lon2 = AngNormalize(l->lon1 + lon12);
431468 }
432469
433 if (outmask & LATITUDE)
470 if (outmask & GEOD_LATITUDE)
434471 lat2 = atan2(sbet2, l->f1 * cbet2) / degree;
435472
436 if (outmask & AZIMUTH)
473 if (outmask & GEOD_AZIMUTH)
437474 /* minus signs give range [-180, 180). 0- converts -0 to +0. */
438475 azi2 = 0 - atan2(-salp2, calp2) / degree;
439476
440 if (outmask & (REDUCEDLENGTH | GEODESICSCALE)) {
477 if (outmask & (GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) {
441478 real
442479 B22 = SinCosSeries(TRUE, ssig2, csig2, l->C2a, nC2),
443480 AB2 = (1 + l->A2m1) * (B22 - l->B21),
444481 J12 = (l->A1m1 - l->A2m1) * sig12 + (AB1 - AB2);
445 if (outmask & REDUCEDLENGTH)
482 if (outmask & GEOD_REDUCEDLENGTH)
446483 /* Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure
447484 * accurate cancellation in the case of coincident points. */
448485 m12 = l->b * ((dn2 * (l->csig1 * ssig2) - l->dn1 * (l->ssig1 * csig2))
449486 - l->csig1 * csig2 * J12);
450 if (outmask & GEODESICSCALE) {
487 if (outmask & GEOD_GEODESICSCALE) {
451488 real t = l->k2 * (ssig2 - l->ssig1) * (ssig2 + l->ssig1) / (l->dn1 + dn2);
452489 M12 = csig12 + (t * ssig2 - csig2 * J12) * l->ssig1 / l->dn1;
453490 M21 = csig12 - (t * l->ssig1 - l->csig1 * J12) * ssig2 / dn2;
454491 }
455492 }
456493
457 if (outmask & AREA) {
494 if (outmask & GEOD_AREA) {
458495 real
459496 B42 = SinCosSeries(FALSE, ssig2, csig2, l->C4a, nC4);
460497 real salp12, calp12;
487524 S12 = l->c2 * atan2(salp12, calp12) + l->A4 * (B42 - l->B41);
488525 }
489526
490 if (outmask & LATITUDE)
527 if (outmask & GEOD_LATITUDE)
491528 *plat2 = lat2;
492 if (outmask & LONGITUDE)
529 if (outmask & GEOD_LONGITUDE)
493530 *plon2 = lon2;
494 if (outmask & AZIMUTH)
531 if (outmask & GEOD_AZIMUTH)
495532 *pazi2 = azi2;
496 if (outmask & DISTANCE)
533 if (outmask & GEOD_DISTANCE)
497534 *ps12 = s12;
498 if (outmask & REDUCEDLENGTH)
535 if (outmask & GEOD_REDUCEDLENGTH)
499536 *pm12 = m12;
500 if (outmask & GEODESICSCALE) {
537 if (outmask & GEOD_GEODESICSCALE) {
501538 if (pM12) *pM12 = M12;
502539 if (pM21) *pM21 = M21;
503540 }
504 if (outmask & AREA)
541 if (outmask & GEOD_AREA)
505542 *pS12 = S12;
506543
507544 return arcmode ? s12_a12 : sig12 / degree;
508545 }
509546
510 void Position(const struct GeodesicLine* l, real s12,
511 real* plat2, real* plon2, real* pazi2) {
512 GenPosition(l, FALSE, s12, plat2, plon2, pazi2, 0, 0, 0, 0, 0);
513 }
514
515 real GenDirect(const struct Geodesic* g,
516 real lat1, real lon1, real azi1,
517 boolx arcmode, real s12_a12,
518 real* plat2, real* plon2, real* pazi2,
519 real* ps12, real* pm12, real* pM12, real* pM21,
520 real* pS12) {
521 struct GeodesicLine l;
547 void geod_position(const struct geod_geodesicline* l, real s12,
548 real* plat2, real* plon2, real* pazi2) {
549 geod_genposition(l, FALSE, s12, plat2, plon2, pazi2, 0, 0, 0, 0, 0);
550 }
551
552 real geod_gendirect(const struct geod_geodesic* g,
553 real lat1, real lon1, real azi1,
554 boolx arcmode, real s12_a12,
555 real* plat2, real* plon2, real* pazi2,
556 real* ps12, real* pm12, real* pM12, real* pM21,
557 real* pS12) {
558 struct geod_geodesicline l;
522559 unsigned outmask =
523 (plat2 ? LATITUDE : 0U) |
524 (plon2 ? LONGITUDE : 0U) |
525 (pazi2 ? AZIMUTH : 0U) |
526 (ps12 ? DISTANCE : 0U) |
527 (pm12 ? REDUCEDLENGTH : 0U) |
528 (pM12 || pM21 ? GEODESICSCALE : 0U) |
529 (pS12 ? AREA : 0U);
530
531 GeodesicLineInit(&l, g, lat1, lon1, azi1,
532 /* Automatically supply DISTANCE_IN if necessary */
533 outmask | (arcmode ? NONE : DISTANCE_IN));
534 return GenPosition(&l, arcmode, s12_a12,
535 plat2, plon2, pazi2, ps12, pm12, pM12, pM21, pS12);
536 }
537
538 void Direct(const struct Geodesic* g,
539 real lat1, real lon1, real azi1,
540 real s12,
541 real* plat2, real* plon2, real* pazi2) {
542 GenDirect(g, lat1, lon1, azi1, FALSE, s12, plat2, plon2, pazi2,
543 0, 0, 0, 0, 0);
544 }
545
546 real GenInverse(const struct Geodesic* g,
547 real lat1, real lon1, real lat2, real lon2,
548 real* ps12, real* pazi1, real* pazi2,
549 real* pm12, real* pM12, real* pM21, real* pS12) {
560 (plat2 ? GEOD_LATITUDE : 0U) |
561 (plon2 ? GEOD_LONGITUDE : 0U) |
562 (pazi2 ? GEOD_AZIMUTH : 0U) |
563 (ps12 ? GEOD_DISTANCE : 0U) |
564 (pm12 ? GEOD_REDUCEDLENGTH : 0U) |
565 (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) |
566 (pS12 ? GEOD_AREA : 0U);
567
568 geod_lineinit(&l, g, lat1, lon1, azi1,
569 /* Automatically supply GEOD_DISTANCE_IN if necessary */
570 outmask | (arcmode ? GEOD_NONE : GEOD_DISTANCE_IN));
571 return geod_genposition(&l, arcmode, s12_a12,
572 plat2, plon2, pazi2, ps12, pm12, pM12, pM21, pS12);
573 }
574
575 void geod_direct(const struct geod_geodesic* g,
576 real lat1, real lon1, real azi1,
577 real s12,
578 real* plat2, real* plon2, real* pazi2) {
579 geod_gendirect(g, lat1, lon1, azi1, FALSE, s12, plat2, plon2, pazi2,
580 0, 0, 0, 0, 0);
581 }
582
583 real geod_geninverse(const struct geod_geodesic* g,
584 real lat1, real lon1, real lat2, real lon2,
585 real* ps12, real* pazi1, real* pazi2,
586 real* pm12, real* pM12, real* pM21, real* pS12) {
550587 real s12 = 0, azi1 = 0, azi2 = 0, m12 = 0, M12 = 0, M21 = 0, S12 = 0;
551588 real lon12;
552589 int latsign, lonsign, swapp;
559596 real omg12 = 0;
560597
561598 unsigned outmask =
562 (ps12 ? DISTANCE : 0U) |
563 (pazi1 || pazi2 ? AZIMUTH : 0U) |
564 (pm12 ? REDUCEDLENGTH : 0U) |
565 (pM12 || pM21 ? GEODESICSCALE : 0U) |
566 (pS12 ? AREA : 0U);
599 (ps12 ? GEOD_DISTANCE : 0U) |
600 (pazi1 || pazi2 ? GEOD_AZIMUTH : 0U) |
601 (pm12 ? GEOD_REDUCEDLENGTH : 0U) |
602 (pM12 || pM21 ? GEOD_GEODESICSCALE : 0U) |
603 (pS12 ? GEOD_AREA : 0U);
567604
568605 outmask &= OUT_ALL;
569 lon12 = AngNormalize(AngNormalize(lon2) -
570 AngNormalize(lon1));
571 /* If very close to being on the same meridian, then make it so.
572 * Not sure this is necessary... */
606 /* Compute longitude difference (AngDiff does this carefully). Result is
607 * in [-180, 180] but -180 is only for west-going geodesics. 180 is for
608 * east-going and meridional geodesics. */
609 lon12 = AngDiff(AngNormalize(lon1), AngNormalize(lon2));
610 /* If very close to being on the same half-meridian, then make it so. */
573611 lon12 = AngRound(lon12);
574612 /* Make longitude difference positive. */
575613 lonsign = lon12 >= 0 ? 1 : -1;
576614 lon12 *= lonsign;
577 if (lon12 == 180)
578 lonsign = 1;
579615 /* If really close to the equator, treat as on equator. */
580616 lat1 = AngRound(lat1);
581617 lat2 = AngRound(lat2);
636672 slam12 = lon12 == 180 ? 0 : sin(lam12);
637673 clam12 = cos(lam12); /* lon12 == 90 isn't interesting */
638674
639
640675 meridian = lat1 == -90 || slam12 == 0;
641676
642677 if (meridian) {
659694 real dummy;
660695 Lengths(g, g->n, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2,
661696 cbet1, cbet2, &s12x, &m12x, &dummy,
662 (outmask & GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a);
697 (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a);
663698 }
664699 /* Add the check for sig12 since zero length geodesics might yield m12 <
665700 * 0. Test case was
687722 s12x = g->a * lam12;
688723 sig12 = omg12 = lam12 / g->f1;
689724 m12x = g->b * sin(sig12);
690 if (outmask & GEODESICSCALE)
725 if (outmask & GEOD_GEODESICSCALE)
691726 M12 = M21 = cos(sig12);
692727 a12 = lon12 / g->f1;
693728
697732 * meridian and geodesic is neither meridional or equatorial. */
698733
699734 /* Figure a starting point for Newton's method */
735 real dnm = 0;
700736 sig12 = InverseStart(g, sbet1, cbet1, dn1, sbet2, cbet2, dn2,
701737 lam12,
702 &salp1, &calp1, &salp2, &calp2,
738 &salp1, &calp1, &salp2, &calp2, &dnm,
703739 C1a, C2a);
704740
705741 if (sig12 >= 0) {
706 /* Short lines (InverseStart sets salp2, calp2) */
707 real dnm = (dn1 + dn2) / 2;
742 /* Short lines (InverseStart sets salp2, calp2, dnm) */
708743 s12x = sig12 * g->b * dnm;
709744 m12x = sq(dnm) * g->b * sin(sig12 / dnm);
710 if (outmask & GEODESICSCALE)
745 if (outmask & GEOD_GEODESICSCALE)
711746 M12 = M21 = cos(sig12 / dnm);
712747 a12 = sig12 / degree;
713748 omg12 = lam12 / (g->f1 * dnm);
738773 &eps, &omg12, numit < maxit1, &dv, C1a, C2a, C3a)
739774 - lam12);
740775 /* 2 * tol0 is approximately 1 ulp for a number in [0, pi]. */
741 if (tripb || fabs(v) < (tripn ? 8 : 2) * tol0) break;
776 /* Reversed test to allow escape with NaNs */
777 if (tripb || !(fabs(v) >= (tripn ? 8 : 2) * tol0)) break;
742778 /* Update bracketing values */
743 if (v > 0 && (numit > maxit1 || calp1/salp1 > calp1b/salp1b)) {
744 salp1b = salp1; calp1b = calp1;
745 } else if (numit > maxit1 || calp1/salp1 < calp1a/salp1a) {
746 salp1a = salp1; calp1a = calp1;
747 }
779 if (v > 0 && (numit > maxit1 || calp1/salp1 > calp1b/salp1b))
780 { salp1b = salp1; calp1b = calp1; }
781 else if (v < 0 && (numit > maxit1 || calp1/salp1 < calp1a/salp1a))
782 { salp1a = salp1; calp1a = calp1; }
748783 if (numit < maxit1 && dv > 0) {
749784 real
750785 dalp1 = -v/dv;
781816 real dummy;
782817 Lengths(g, eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2,
783818 cbet1, cbet2, &s12x, &m12x, &dummy,
784 (outmask & GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a);
819 (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a);
785820 }
786821 m12x *= g->b;
787822 s12x *= g->b;
790825 }
791826 }
792827
793 if (outmask & DISTANCE)
828 if (outmask & GEOD_DISTANCE)
794829 s12 = 0 + s12x; /* Convert -0 to 0 */
795830
796 if (outmask & REDUCEDLENGTH)
831 if (outmask & GEOD_REDUCEDLENGTH)
797832 m12 = 0 + m12x; /* Convert -0 to 0 */
798833
799 if (outmask & AREA) {
834 if (outmask & GEOD_AREA) {
800835 real
801836 /* From Lambda12: sin(alp1) * cos(bet1) = sin(alp0) */
802837 salp0 = salp1 * cbet1,
859894 if (swapp < 0) {
860895 swapx(&salp1, &salp2);
861896 swapx(&calp1, &calp2);
862 if (outmask & GEODESICSCALE)
897 if (outmask & GEOD_GEODESICSCALE)
863898 swapx(&M12, &M21);
864899 }
865900
866901 salp1 *= swapp * lonsign; calp1 *= swapp * latsign;
867902 salp2 *= swapp * lonsign; calp2 *= swapp * latsign;
868903
869 if (outmask & AZIMUTH) {
904 if (outmask & GEOD_AZIMUTH) {
870905 /* minus signs give range [-180, 180). 0- converts -0 to +0. */
871906 azi1 = 0 - atan2(-salp1, calp1) / degree;
872907 azi2 = 0 - atan2(-salp2, calp2) / degree;
873908 }
874909
875 if (outmask & DISTANCE)
910 if (outmask & GEOD_DISTANCE)
876911 *ps12 = s12;
877 if (outmask & AZIMUTH) {
912 if (outmask & GEOD_AZIMUTH) {
878913 if (pazi1) *pazi1 = azi1;
879914 if (pazi2) *pazi2 = azi2;
880915 }
881 if (outmask & REDUCEDLENGTH)
916 if (outmask & GEOD_REDUCEDLENGTH)
882917 *pm12 = m12;
883 if (outmask & GEODESICSCALE) {
918 if (outmask & GEOD_GEODESICSCALE) {
884919 if (pM12) *pM12 = M12;
885920 if (pM21) *pM21 = M21;
886921 }
887 if (outmask & AREA)
922 if (outmask & GEOD_AREA)
888923 *pS12 = S12;
889924
890925 /* Returned value in [0, 180] */
891926 return a12;
892927 }
893928
894 void Inverse(const struct Geodesic* g,
895 double lat1, double lon1, double lat2, double lon2,
896 double* ps12, double* pazi1, double* pazi2) {
897 GenInverse(g, lat1, lon1, lat2, lon2, ps12, pazi1, pazi2, 0, 0, 0, 0);
898 }
899
900 real SinCosSeries(boolx sinp,
901 real sinx, real cosx,
902 const real c[], int n) {
929 void geod_inverse(const struct geod_geodesic* g,
930 real lat1, real lon1, real lat2, real lon2,
931 real* ps12, real* pazi1, real* pazi2) {
932 geod_geninverse(g, lat1, lon1, lat2, lon2, ps12, pazi1, pazi2, 0, 0, 0, 0);
933 }
934
935 real SinCosSeries(boolx sinp, real sinx, real cosx, const real c[], int n) {
903936 /* Evaluate
904937 * y = sinp ? sum(c[i] * sin( 2*i * x), i, 1, n) :
905938 * sum(c[i] * cos((2*i+1) * x), i, 0, n-1)
921954 : cosx * (y0 - y1); /* cos(x) * (y0 - y1) */
922955 }
923956
924 void Lengths(const struct Geodesic* g,
957 void Lengths(const struct geod_geodesic* g,
925958 real eps, real sig12,
926959 real ssig1, real csig1, real dn1,
927960 real ssig2, real csig2, real dn2,
10181051 return k;
10191052 }
10201053
1021 real InverseStart(const struct Geodesic* g,
1054 real InverseStart(const struct geod_geodesic* g,
10221055 real sbet1, real cbet1, real dn1,
10231056 real sbet2, real cbet2, real dn2,
10241057 real lam12,
10251058 real* psalp1, real* pcalp1,
10261059 /* Only updated if return val >= 0 */
10271060 real* psalp2, real* pcalp2,
1061 /* Only updated for short lines */
1062 real* pdnm,
10281063 /* Scratch areas of the right size */
10291064 real C1a[], real C2a[]) {
1030 real salp1 = 0, calp1 = 0, salp2 = 0, calp2 = 0;
1065 real salp1 = 0, calp1 = 0, salp2 = 0, calp2 = 0, dnm = 0;
10311066
10321067 /* Return a starting point for Newton's method in salp1 and calp1 (function
10331068 * value is -1). If Newton's method doesn't need to be used, return also
10551090 real sbet12a = sbet2 * cbet1 + cbet2 * sbet1;
10561091 #endif
10571092 boolx shortline = cbet12 >= 0 && sbet12 < (real)(0.5) &&
1058 lam12 <= pi / 6;
1059 real
1060 omg12 = !shortline ? lam12 : lam12 / (g->f1 * (dn1 + dn2) / 2),
1061 somg12 = sin(omg12), comg12 = cos(omg12);
1062 real ssig12, csig12;
1093 cbet2 * lam12 < (real)(0.5);
1094 real omg12 = lam12, somg12, comg12, ssig12, csig12;
1095 if (shortline) {
1096 real sbetm2 = sq(sbet1 + sbet2);
1097 /* sin((bet1+bet2)/2)^2
1098 * = (sbet1 + sbet2)^2 / ((sbet1 + sbet2)^2 + (cbet1 + cbet2)^2) */
1099 sbetm2 /= sbetm2 + sq(cbet1 + cbet2);
1100 dnm = sqrt(1 + g->ep2 * sbetm2);
1101 omg12 /= g->f1 * dnm;
1102 }
1103 somg12 = sin(omg12); comg12 = cos(omg12);
10631104
10641105 salp1 = cbet2 * somg12;
10651106 calp1 = comg12 >= 0 ?
10721113 if (shortline && ssig12 < g->etol2) {
10731114 /* really short lines */
10741115 salp2 = cbet1 * somg12;
1075 calp2 = sbet12 - cbet1 * sbet2 * sq(somg12) / (1 + comg12);
1116 calp2 = sbet12 - cbet1 * sbet2 *
1117 (comg12 >= 0 ? sq(somg12) / (1 + comg12) : 1 - comg12);
10761118 SinCosNorm(&salp2, &calp2);
10771119 /* Set return value */
10781120 sig12 = atan2(ssig12, csig12);
11791221
11801222 *psalp1 = salp1;
11811223 *pcalp1 = calp1;
1224 if (shortline)
1225 *pdnm = dnm;
11821226 if (sig12 >= 0) {
11831227 *psalp2 = salp2;
11841228 *pcalp2 = calp2;
11861230 return sig12;
11871231 }
11881232
1189 real Lambda12(const struct Geodesic* g,
1233 real Lambda12(const struct geod_geodesic* g,
11901234 real sbet1, real cbet1, real dn1,
11911235 real sbet2, real cbet2, real dn2,
11921236 real salp1, real calp1,
12851329 return lam12;
12861330 }
12871331
1288 real A3f(const struct Geodesic* g, real eps) {
1332 real A3f(const struct geod_geodesic* g, real eps) {
12891333 /* Evaluate sum(A3x[k] * eps^k, k, 0, nA3x-1) by Horner's method */
12901334 real v = 0;
12911335 int i;
12941338 return v;
12951339 }
12961340
1297 void C3f(const struct Geodesic* g, real eps, real c[]) {
1341 void C3f(const struct geod_geodesic* g, real eps, real c[]) {
12981342 /* Evaluate C3 coeffs by Horner's method
12991343 * Elements c[1] thru c[nC3 - 1] are set */
13001344 int i, j, k;
13121356 }
13131357 }
13141358
1315 void C4f(const struct Geodesic* g, real eps, real c[]) {
1359 void C4f(const struct geod_geodesic* g, real eps, real c[]) {
13161360 /* Evaluate C4 coeffs by Horner's method
13171361 * Elements c[0] thru c[nC4 - 1] are set */
13181362 int i, j, k;
14031447 }
14041448
14051449 /* The scale factor A3 = mean value of (d/dsigma)I3 */
1406 void A3coeff(struct Geodesic* g) {
1450 void A3coeff(struct geod_geodesic* g) {
14071451 g->A3x[0] = 1;
14081452 g->A3x[1] = (g->n-1)/2;
14091453 g->A3x[2] = (g->n*(3*g->n-1)-2)/8;
14131457 }
14141458
14151459 /* The coefficients C3[l] in the Fourier expansion of B3 */
1416 void C3coeff(struct Geodesic* g) {
1460 void C3coeff(struct geod_geodesic* g) {
14171461 g->C3x[0] = (1-g->n)/4;
14181462 g->C3x[1] = (1-g->n*g->n)/8;
14191463 g->C3x[2] = ((3-g->n)*g->n+3)/64;
14341478 /* Generated by Maxima on 2012-10-19 08:02:34-04:00 */
14351479
14361480 /* The coefficients C4[l] in the Fourier expansion of I4 */
1437 void C4coeff(struct Geodesic* g) {
1481 void C4coeff(struct geod_geodesic* g) {
14381482 g->C4x[0] = (g->n*(g->n*(g->n*(g->n*(100*g->n+208)+572)+3432)-12012)+30030)/
14391483 45045;
14401484 g->C4x[1] = (g->n*(g->n*(g->n*(64*g->n+624)-4576)+6864)-3003)/15015;
14581502 g->C4x[19] = -128/(real)(135135);
14591503 g->C4x[20] = 128/(real)(99099);
14601504 }
1505
1506 int transit(real lon1, real lon2) {
1507 real lon12;
1508 /* Return 1 or -1 if crossing prime meridian in east or west direction.
1509 * Otherwise return zero. */
1510 /* Compute lon12 the same way as Geodesic::Inverse. */
1511 lon1 = AngNormalize(lon1);
1512 lon2 = AngNormalize(lon2);
1513 lon12 = AngDiff(lon1, lon2);
1514 return lon1 < 0 && lon2 >= 0 && lon12 > 0 ? 1 :
1515 (lon2 < 0 && lon1 >= 0 && lon12 < 0 ? -1 : 0);
1516 }
1517
1518 void accini(real s[]) {
1519 /* Initialize an accumulator; this is an array with two elements. */
1520 s[0] = s[1] = 0;
1521 }
1522
1523 void acccopy(const real s[], real t[]) {
1524 /* Copy an accumulator; t = s. */
1525 t[0] = s[0]; t[1] = s[1];
1526 }
1527
1528 void accadd(real s[], real y) {
1529 /* Add y to an accumulator. */
1530 real u, z = sumx(y, s[1], &u);
1531 s[0] = sumx(z, s[0], &s[1]);
1532 if (s[0] == 0)
1533 s[0] = u;
1534 else
1535 s[1] = s[1] + u;
1536 }
1537
1538 real accsum(const real s[], real y) {
1539 /* Return accumulator + y (but don't add to accumulator). */
1540 real t[2];
1541 acccopy(s, t);
1542 accadd(t, y);
1543 return t[0];
1544 }
1545
1546 void accneg(real s[]) {
1547 /* Negate an accumulator. */
1548 s[0] = -s[0]; s[1] = -s[1];
1549 }
1550
1551 void geod_polygon_init(struct geod_polygon* p, boolx polylinep) {
1552 p->lat0 = p->lon0 = p->lat = p->lon = NaN;
1553 p->polyline = (polylinep != 0);
1554 accini(p->P);
1555 accini(p->A);
1556 p->num = p->crossings = 0;
1557 }
1558
1559 void geod_polygon_addpoint(const struct geod_geodesic* g,
1560 struct geod_polygon* p,
1561 real lat, real lon) {
1562 lon = AngNormalize(lon);
1563 if (p->num == 0) {
1564 p->lat0 = p->lat = lat;
1565 p->lon0 = p->lon = lon;
1566 } else {
1567 real s12, S12;
1568 geod_geninverse(g, p->lat, p->lon, lat, lon,
1569 &s12, 0, 0, 0, 0, 0, p->polyline ? 0 : &S12);
1570 accadd(p->P, s12);
1571 if (!p->polyline) {
1572 accadd(p->A, S12);
1573 p->crossings += transit(p->lon, lon);
1574 }
1575 p->lat = lat; p->lon = lon;
1576 }
1577 ++p->num;
1578 }
1579
1580 void geod_polygon_addedge(const struct geod_geodesic* g,
1581 struct geod_polygon* p,
1582 real azi, real s) {
1583 if (p->num) { /* Do nothing is num is zero */
1584 real lat, lon, S12;
1585 geod_gendirect(g, p->lat, p->lon, azi, FALSE, s,
1586 &lat, &lon, 0,
1587 0, 0, 0, 0, p->polyline ? 0 : &S12);
1588 accadd(p->P, s);
1589 if (!p->polyline) {
1590 accadd(p->A, S12);
1591 p->crossings += transit(p->lon, lon);
1592 }
1593 p->lat = lat; p->lon = lon;
1594 ++p->num;
1595 }
1596 }
1597
1598 unsigned geod_polygon_compute(const struct geod_geodesic* g,
1599 const struct geod_polygon* p,
1600 boolx reverse, boolx sign,
1601 real* pA, real* pP) {
1602 real s12, S12, t[2], area0;
1603 int crossings;
1604 if (p->num < 2) {
1605 if (pP) *pP = 0;
1606 if (!p->polyline && pA) *pA = 0;
1607 return p->num;
1608 }
1609 if (p->polyline) {
1610 if (pP) *pP = p->P[0];
1611 return p->num;
1612 }
1613 geod_geninverse(g, p->lat, p->lon, p->lat0, p->lon0,
1614 &s12, 0, 0, 0, 0, 0, &S12);
1615 if (pP) *pP = accsum(p->P, s12);
1616 acccopy(p->A, t);
1617 accadd(t, S12);
1618 crossings = p->crossings + transit(p->lon, p->lon0);
1619 area0 = 4 * pi * g->c2;
1620 if (crossings & 1)
1621 accadd(t, (t[0] < 0 ? 1 : -1) * area0/2);
1622 /* area is with the clockwise sense. If !reverse convert to
1623 * counter-clockwise convention. */
1624 if (!reverse)
1625 accneg(t);
1626 /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */
1627 if (sign) {
1628 if (t[0] > area0/2)
1629 accadd(t, -area0);
1630 else if (t[0] <= -area0/2)
1631 accadd(t, +area0);
1632 } else {
1633 if (t[0] >= area0)
1634 accadd(t, -area0);
1635 else if (t[0] < 0)
1636 accadd(t, +area0);
1637 }
1638 if (pA) *pA = 0 + t[0];
1639 return p->num;
1640 }
1641
1642 unsigned geod_polygon_testpoint(const struct geod_geodesic* g,
1643 const struct geod_polygon* p,
1644 real lat, real lon,
1645 boolx reverse, boolx sign,
1646 real* pA, real* pP) {
1647 real perimeter, tempsum, area0;
1648 int crossings, i;
1649 unsigned num = p->num + 1;
1650 if (num == 1) {
1651 if (pP) *pP = 0;
1652 if (!p->polyline && pA) *pA = 0;
1653 return num;
1654 }
1655 perimeter = p->P[0];
1656 tempsum = p->polyline ? 0 : p->A[0];
1657 crossings = p->crossings;
1658 for (i = 0; i < (p->polyline ? 1 : 2); ++i) {
1659 real s12, S12;
1660 geod_geninverse(g,
1661 i == 0 ? p->lat : lat, i == 0 ? p->lon : lon,
1662 i != 0 ? p->lat0 : lat, i != 0 ? p->lon0 : lon,
1663 &s12, 0, 0, 0, 0, 0, p->polyline ? 0 : &S12);
1664 perimeter += s12;
1665 if (!p->polyline) {
1666 tempsum += S12;
1667 crossings += transit(i == 0 ? p->lon : lon,
1668 i != 0 ? p->lon0 : lon);
1669 }
1670 }
1671
1672 if (pP) *pP = perimeter;
1673 if (p->polyline)
1674 return num;
1675
1676 area0 = 4 * pi * g->c2;
1677 if (crossings & 1)
1678 tempsum += (tempsum < 0 ? 1 : -1) * area0/2;
1679 /* area is with the clockwise sense. If !reverse convert to
1680 * counter-clockwise convention. */
1681 if (!reverse)
1682 tempsum *= -1;
1683 /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */
1684 if (sign) {
1685 if (tempsum > area0/2)
1686 tempsum -= area0;
1687 else if (tempsum <= -area0/2)
1688 tempsum += area0;
1689 } else {
1690 if (tempsum >= area0)
1691 tempsum -= area0;
1692 else if (tempsum < 0)
1693 tempsum += area0;
1694 }
1695 if (pA) *pA = 0 + tempsum;
1696 return num;
1697 }
1698
1699 unsigned geod_polygon_testedge(const struct geod_geodesic* g,
1700 const struct geod_polygon* p,
1701 real azi, real s,
1702 boolx reverse, boolx sign,
1703 real* pA, real* pP) {
1704 real perimeter, tempsum, area0;
1705 int crossings;
1706 unsigned num = p->num + 1;
1707 if (num == 1) { /* we don't have a starting point! */
1708 if (pP) *pP = NaN;
1709 if (!p->polyline && pA) *pA = NaN;
1710 return 0;
1711 }
1712 perimeter = p->P[0] + s;
1713 if (p->polyline) {
1714 if (pP) *pP = perimeter;
1715 return num;
1716 }
1717
1718 tempsum = p->A[0];
1719 crossings = p->crossings;
1720 {
1721 real lat, lon, s12, S12;
1722 geod_gendirect(g, p->lat, p->lon, azi, FALSE, s,
1723 &lat, &lon, 0,
1724 0, 0, 0, 0, &S12);
1725 tempsum += S12;
1726 crossings += transit(p->lon, lon);
1727 geod_geninverse(g, lat, lon, p->lat0, p->lon0,
1728 &s12, 0, 0, 0, 0, 0, &S12);
1729 perimeter += s12;
1730 tempsum += S12;
1731 crossings += transit(lon, p->lon0);
1732 }
1733
1734 area0 = 4 * pi * g->c2;
1735 if (crossings & 1)
1736 tempsum += (tempsum < 0 ? 1 : -1) * area0/2;
1737 /* area is with the clockwise sense. If !reverse convert to
1738 * counter-clockwise convention. */
1739 if (!reverse)
1740 tempsum *= -1;
1741 /* If sign put area in (-area0/2, area0/2], else put area in [0, area0) */
1742 if (sign) {
1743 if (tempsum > area0/2)
1744 tempsum -= area0;
1745 else if (tempsum <= -area0/2)
1746 tempsum += area0;
1747 } else {
1748 if (tempsum >= area0)
1749 tempsum -= area0;
1750 else if (tempsum < 0)
1751 tempsum += area0;
1752 }
1753 if (pP) *pP = perimeter;
1754 if (pA) *pA = 0 + tempsum;
1755 return num;
1756 }
1757
1758 void geod_polygonarea(const struct geod_geodesic* g,
1759 real lats[], real lons[], int n,
1760 real* pA, real* pP) {
1761 int i;
1762 struct geod_polygon p;
1763 geod_polygon_init(&p, FALSE);
1764 for (i = 0; i < n; ++i)
1765 geod_polygon_addpoint(g, &p, lats[i], lons[i]);
1766 geod_polygon_compute(g, &p, FALSE, TRUE, pA, pP);
1767 }
1768
1769 /** @endcond */
0 /*
1 * This is a C implementation of the geodesic algorithms described in
2 *
3 * C. F. F. Karney,
4 * Algorithms for geodesics,
5 * J. Geodesy (2012);
6 * http://dx.doi.org/10.1007/s00190-012-0578-z
7 * Addenda: http://geographiclib.sf.net/geod-addenda.html
8 *
0 /**
1 * \file geodesic.h
2 * \brief Header for the geodesic routines in C
3 *
4 * This an implementation in C of the geodesic algorithms described in
5 * - C. F. F. Karney,
6 * <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
7 * Algorithms for geodesics</a>,
8 * J. Geodesy <b>87</b>, 43--55 (2013);
9 * DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
10 * 10.1007/s00190-012-0578-z</a>;
11 * addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
12 * geod-addenda.html</a>.
13 * .
914 * The principal advantages of these algorithms over previous ones (e.g.,
1015 * Vincenty, 1975) are
11 * * accurate to round off for abs(f) < 1/50;
12 * * the solution of the inverse problem is always found;
13 * * differential and integral properties of geodesics are computed.
14 *
15 * The shortest path between two points on the ellipsoid at (lat1, lon1) and
16 * (lat2, lon2) is called the geodesic. Its length is s12 and the geodesic
17 * from point 1 to point 2 has forward azimuths azi1 and azi2 at the two end
18 * points.
16 * - accurate to round off for |<i>f</i>| &lt; 1/50;
17 * - the solution of the inverse problem is always found;
18 * - differential and integral properties of geodesics are computed.
19 *
20 * The shortest path between two points on the ellipsoid at (\e lat1, \e
21 * lon1) and (\e lat2, \e lon2) is called the geodesic. Its length is
22 * \e s12 and the geodesic from point 1 to point 2 has forward azimuths
23 * \e azi1 and \e azi2 at the two end points.
1924 *
2025 * Traditionally two geodesic problems are considered:
21 * * the direct problem -- given lat1, lon1, s12, and azi1, determine
22 * lat2, lon2, and azi2.
23 * * the inverse problem -- given lat1, lon1, lat2, lon2, determine
24 * s12, azi1, and azi2.
25 *
26 * The ellipsoid is specified by its equatorial radius a (typically in meters)
27 * and flattening f. The routines are accurate to round off with double
28 * precision arithmetic provided that abs(f) < 1/50; for the WGS84 ellipsoid,
29 * the errors are less than 15 nanometers. (Reasonably accurate results are
30 * obtained for abs(f) < 1/5.) Latitudes, longitudes, and azimuths are in
31 * degrees. Latitudes must lie in [-90,90] and longitudes and azimuths must
32 * lie in [-540,540). The returned values for longitude and azimuths are in
33 * [-180,180). The distance s12 is measured in meters (more precisely the same
34 * units as a).
26 * - the direct problem -- given \e lat1, \e lon1, \e s12, and \e azi1,
27 * determine \e lat2, \e lon2, and \e azi2. This is solved by the function
28 * geod_direct().
29 * - the inverse problem -- given \e lat1, \e lon1, and \e lat2, \e lon2,
30 * determine \e s12, \e azi1, and \e azi2. This is solved by the function
31 * geod_inverse().
32 *
33 * The ellipsoid is specified by its equatorial radius \e a (typically in
34 * meters) and flattening \e f. The routines are accurate to round off with
35 * double precision arithmetic provided that |<i>f</i>| &lt; 1/50; for the
36 * WGS84 ellipsoid, the errors are less than 15 nanometers. (Reasonably
37 * accurate results are obtained for |<i>f</i>| &lt; 1/5.) For a prolate
38 * ellipsoid, specify \e f &lt; 0.
3539 *
3640 * The routines also calculate several other quantities of interest
37 * * SS12 is the area between the geodesic from point 1 to point 2 and the
38 * equator; i.e., it is the area, measured counter-clockwise, of the
39 * quadrilateral with corners (lat1,lon1), (0,lon1), (0,lon2), and
40 * (lat2,lon2). It is given in meters^2.
41 * * m12, the reduced length of the geodesic is defined such that if the
42 * initial azimuth is perturbed by dazi1 (radians) then the second point is
43 * displaced by m12 dazi1 in the direction perpendicular to the geodesic.
44 * m12 is given in meters. On a curved surface the reduced length obeys a
45 * symmetry relation, m12 + m21 = 0. On a flat surface, we have m12 = s12.
46 * * MM12 and MM21 are geodesic scales. If two geodesics are parallel at
47 * point 1 and separated by a small distance dt, then they are separated by
48 * a distance MM12 dt at point 2. MM21 is defined similarly (with the
49 * geodesics being parallel to one another at point 2). MM12 and MM21 are
50 * dimensionless quantities. On a flat surface, we have MM12 = MM21 = 1.
51 * * a12 is the arc length on the auxiliary sphere. This is a construct for
52 * converting the problem to one in spherical trigonometry. a12 is
53 * measured in degrees. The spherical arc length from one equator crossing
54 * to the next is always 180 degrees.
55 *
56 * Simple interface
57 *
58 * #include "geodesic.h"
59 *
60 * double a, f, lat1, lon1, azi1, lat2, lon2, azi2, s12;
61 * struct Geodesic g;
62 *
63 * GeodesicInit(&g, a, f);
64 * Direct(&g, lat1, lon1, azi1, s12, &lat2, &lon2, &azi2);
65 * Inverse(&g, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2);
66 *
67 * GeodesicInit initalizes g for the ellipsoid. Subsequent calls to Direct and
68 * Inverse solve the direct and inverse geodesic problems.
69 *
70 * Returning auxiliary quantities (continued from the previous example):
71 *
72 * double a12, s12_a12, m12, M12, M21, S12;
73 * a12 = GenDirect(&g, lat1, lon1, azi1, 0, s12,
74 * &lat1, &lat2, &azi2, 0, &m12, &M12, &M21, &S21);
75 * GenDirect(&g, lat1, lon1, azi1, 1, a12,
76 * &lat1, &lat2, &azi2, &s12, &m12, &M12, &M21, &S21);
77 * a12 = GenInverse(&g, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2,
78 * &m12, &M12, &M21, &S12);
79 *
80 * GenDirect is a generalized version of Direct allowing the return of the
81 * auxiliary quantities. With the first variant (arcmode = 0), the length of
82 * the geodesic is specified by the true length s12 and the arc length a12 is
83 * returned as the function value. In the second variant (arcmode = 1), the
84 * length is specified by the arc length a12 (in degrees), and the true length
85 * is returned via &s12.
86 *
87 * a12 = GenInverse(&g, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2,
88 * &m12, &M12, &M21, &S12);
89 *
90 * GenInverse is a generalized version of Inverse allowing the return of the
91 * auxiliary quantities.
92 *
93 * Any of the "return" arguments &s12, etc. in these routines may be replaced
94 * by 0, if you do not need some quantities computed.
95 *
96 * Computing multiple points on a geodesic. This may be accomplished by
97 * repeated invocations of Direct varying s12. However, it is more efficient
98 * to create a GeodesicLine object, as follows.
99 *
100 * struct GeodesicLine l;
101 * int caps = 0;
102 *
103 * GeodesicLineInit(&l, &g, a, f, lat1, lon1, azi1, caps);
104 * Position(l, s12, &lat2, &lon2, &azi2)
105 *
106 * caps is a bit mask specifying the capabilities of the GeodesicLine object.
107 * It should be an or'ed combination of
108 *
109 * LATITUDE compute lat2 (in effect this is always set)
110 * LONGITUDE compute lon2
111 * AZIMUTH compute azi2 (in effect this is always set)
112 * DISTANCE compute s12
113 * DISTANCE_IN allow the length to be specified in terms of distance
114 * REDUCEDLENGTH compute m12
115 * GEODESICSCALE compute M12 and M21
116 * AREA compute S12
117 * ALL all of the above
118 *
119 * caps = 0 is treated as LATITUDE | LONGITUDE | AZIMUTH | DISTANCE_IN (to
120 * support the solution "standard" direct problem).
121 *
122 * There's also a generalized version of Position
123 *
124 * a12 = GenPosition(&l, arcmode, s12_a12,
125 * &lat2, &lon2, &azi2, &s12, &m12, &M12, &M21, &S12);
126 *
127 * See the documentation on GenDirect for the meaning of arcmode.
128 *
129 * Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed
41 * - \e S12 is the area between the geodesic from point 1 to point 2 and the
42 * equator; i.e., it is the area, measured counter-clockwise, of the
43 * quadrilateral with corners (\e lat1,\e lon1), (0,\e lon1), (0,\e lon2),
44 * and (\e lat2,\e lon2).
45 * - \e m12, the reduced length of the geodesic is defined such that if
46 * the initial azimuth is perturbed by \e dazi1 (radians) then the
47 * second point is displaced by \e m12 \e dazi1 in the direction
48 * perpendicular to the geodesic. On a curved surface the reduced
49 * length obeys a symmetry relation, \e m12 + \e m21 = 0. On a flat
50 * surface, we have \e m12 = \e s12.
51 * - \e M12 and \e M21 are geodesic scales. If two geodesics are
52 * parallel at point 1 and separated by a small distance \e dt, then
53 * they are separated by a distance \e M12 \e dt at point 2. \e M21
54 * is defined similarly (with the geodesics being parallel to one
55 * another at point 2). On a flat surface, we have \e M12 = \e M21
56 * = 1.
57 * - \e a12 is the arc length on the auxiliary sphere. This is a
58 * construct for converting the problem to one in spherical
59 * trigonometry. \e a12 is measured in degrees. The spherical arc
60 * length from one equator crossing to the next is always 180&deg;.
61 *
62 * If points 1, 2, and 3 lie on a single geodesic, then the following
63 * addition rules hold:
64 * - \e s13 = \e s12 + \e s23
65 * - \e a13 = \e a12 + \e a23
66 * - \e S13 = \e S12 + \e S23
67 * - \e m13 = \e m12 \e M23 + \e m23 \e M21
68 * - \e M13 = \e M12 \e M23 &minus; (1 &minus; \e M12 \e M21) \e
69 * m23 / \e m12
70 * - \e M31 = \e M32 \e M21 &minus; (1 &minus; \e M23 \e M32) \e
71 * m12 / \e m23
72 *
73 * The shortest distance returned by the solution of the inverse problem is
74 * (obviously) uniquely defined. However, in a few special cases there are
75 * multiple azimuths which yield the same shortest distance. Here is a
76 * catalog of those cases:
77 * - \e lat1 = &minus;\e lat2 (with neither at a pole). If \e azi1 = \e
78 * azi2, the geodesic is unique. Otherwise there are two geodesics
79 * and the second one is obtained by setting [\e azi1, \e azi2] = [\e
80 * azi2, \e azi1], [\e M12, \e M21] = [\e M21, \e M12], \e S12 =
81 * &minus;\e S12. (This occurs when the longitude difference is near
82 * &plusmn;180&deg; for oblate ellipsoids.)
83 * - \e lon2 = \e lon1 &plusmn; 180&deg; (with neither at a pole). If
84 * \e azi1 = 0&deg; or &plusmn;180&deg;, the geodesic is unique.
85 * Otherwise there are two geodesics and the second one is obtained by
86 * setting [\e azi1, \e azi2] = [&minus;\e azi1, &minus;\e azi2], \e
87 * S12 = &minus;\e S12. (This occurs when the \e lat2 is near
88 * &minus;\e lat1 for prolate ellipsoids.)
89 * - Points 1 and 2 at opposite poles. There are infinitely many
90 * geodesics which can be generated by setting [\e azi1, \e azi2] =
91 * [\e azi1, \e azi2] + [\e d, &minus;\e d], for arbitrary \e d. (For
92 * spheres, this prescription applies when points 1 and 2 are
93 * antipodal.)
94 * - \e s12 = 0 (coincident points). There are infinitely many geodesics
95 * which can be generated by setting [\e azi1, \e azi2] = [\e azi1, \e
96 * azi2] + [\e d, \e d], for arbitrary \e d.
97 *
98 * These routines are a simple transcription of the corresponding C++ classes
99 * in <a href="http://geographiclib.sf.net"> GeographicLib</a>. The "class
100 * data" is represented by the structs geod_geodesic, geod_geodesicline,
101 * geod_polygon and pointers to these objects are passed as initial arguments
102 * to the member functions. Most of the internal comments have been retained.
103 * However, in the process of transcription some documentation has been lost
104 * and the documentation for the C++ classes, GeographicLib::Geodesic,
105 * GeographicLib::GeodesicLine, and GeographicLib::PolygonArea, should be
106 * consulted. The C++ code remains the "reference implementation". Think
107 * twice about restructuring the internals of the C code since this may make
108 * porting fixes from the C++ code more difficult.
109 *
110 * Copyright (c) Charles Karney (2012-2013) <charles@karney.com> and licensed
130111 * under the MIT/X11 License. For more information, see
131112 * http://geographiclib.sourceforge.net/
132113 *
133 * This file was distributed with GeographicLib 1.27.
134 */
114 * This library was distributed with
115 * <a href="../index.html">GeographicLib</a> 1.32.
116 **********************************************************************/
135117
136118 #if !defined(GEODESIC_H)
137119 #define GEODESIC_H 1
120
121 /**
122 * The major version of the geodesic library. (This tracks the version of
123 * GeographicLib.)
124 **********************************************************************/
125 #define GEODESIC_VERSION_MAJOR 1
126 /**
127 * The minor version of the geodesic library. (This tracks the version of
128 * GeographicLib.)
129 **********************************************************************/
130 #define GEODESIC_VERSION_MINOR 32
131 /**
132 * The patch level of the geodesic library. (This tracks the version of
133 * GeographicLib.)
134 **********************************************************************/
135 #define GEODESIC_VERSION_PATCH 0
138136
139137 #if defined(__cplusplus)
140138 extern "C" {
141139 #endif
142140
143 struct Geodesic {
144 double a, f, f1, e2, ep2, n, b, c2, etol2;
141 /**
142 * The struct containing information about the ellipsoid. This must be
143 * initialized by geod_init() before use.
144 **********************************************************************/
145 struct geod_geodesic {
146 double a; /**< the equatorial radius */
147 double f; /**< the flattening */
148 /**< @cond SKIP */
149 double f1, e2, ep2, n, b, c2, etol2;
145150 double A3x[6], C3x[15], C4x[21];
151 /**< @endcond */
146152 };
147153
148 struct GeodesicLine {
149 double lat1, lon1, azi1;
150 double a, f, b, c2, f1, salp0, calp0, k2,
154 /**
155 * The struct containing information about a single geodesic. This must be
156 * initialized by geod_lineinit() before use.
157 **********************************************************************/
158 struct geod_geodesicline {
159 double lat1; /**< the starting latitude */
160 double lon1; /**< the starting longitude */
161 double azi1; /**< the starting azimuth */
162 double a; /**< the equatorial radius */
163 double f; /**< the flattening */
164 /**< @cond SKIP */
165 double b, c2, f1, salp0, calp0, k2,
151166 salp1, calp1, ssig1, csig1, dn1, stau1, ctau1, somg1, comg1,
152167 A1m1, A2m1, A3c, B11, B21, B31, A4, B41;
153168 double C1a[6+1], C1pa[6+1], C2a[6+1], C3a[6], C4a[6];
154 unsigned caps;
169 /**< @endcond */
170 unsigned caps; /**< the capabilities */
155171 };
156172
157 void GeodesicInit(struct Geodesic* g, double a, double f);
158 void GeodesicLineInit(struct GeodesicLine* l,
159 const struct Geodesic* g,
160 double lat1, double lon1, double azi1, unsigned caps);
161
162 void Direct(const struct Geodesic* g,
163 double lat1, double lon1, double azi1, double s12,
164 double* plat2, double* plon2, double* pazi2);
165 void Inverse(const struct Geodesic* g,
166 double lat1, double lon1, double lat2, double lon2,
167 double* ps12, double* pazi1, double* pazi2);
168 void Position(const struct GeodesicLine* l, double s12,
169 double* plat2, double* plon2, double* pazi2);
170
171 double GenDirect(const struct Geodesic* g,
172 double lat1, double lon1, double azi1,
173 int arcmode, double s12_a12,
174 double* plat2, double* plon2, double* pazi2,
175 double* ps12, double* pm12, double* pM12, double* pM21,
176 double* pS12);
177 double GenInverse(const struct Geodesic* g,
173 /**
174 * The struct for accumulating information about a geodesic polygon. This is
175 * used for computing the perimeter and area of a polygon. This must be
176 * initialized by geod_polygon_init() before use.
177 **********************************************************************/
178 struct geod_polygon {
179 double lat; /**< the current latitude */
180 double lon; /**< the current longitude */
181 /**< @cond SKIP */
182 double lat0;
183 double lon0;
184 double A[2];
185 double P[2];
186 int polyline;
187 int crossings;
188 /**< @endcond */
189 unsigned num; /**< the number of points so far */
190 };
191
192 /**
193 * Initialize a geod_geodesic object.
194 *
195 * @param[out] g a pointer to the object to be initialized.
196 * @param[in] a the equatorial radius (meters).
197 * @param[in] f the flattening.
198 **********************************************************************/
199 void geod_init(struct geod_geodesic* g, double a, double f);
200
201 /**
202 * Initialize a geod_geodesicline object.
203 *
204 * @param[out] l a pointer to the object to be initialized.
205 * @param[in] g a pointer to the geod_geodesic object specifying the
206 * ellipsoid.
207 * @param[in] lat1 latitude of point 1 (degrees).
208 * @param[in] lon1 longitude of point 1 (degrees).
209 * @param[in] azi1 azimuth at point 1 (degrees).
210 * @param[in] caps bitor'ed combination of geod_mask() values specifying the
211 * capabilities the geod_geodesicline object should possess, i.e., which
212 * quantities can be returned in calls to geod_position() and
213 * geod_genposition().
214 *
215 * \e g must have been initialized with a call to geod_init(). \e lat1
216 * should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e azi1
217 * should be in the range [&minus;540&deg;, 540&deg;).
218 *
219 * The geod_mask values are [see geod_mask()]:
220 * - \e caps |= GEOD_LATITUDE for the latitude \e lat2; this is
221 * added automatically,
222 * - \e caps |= GEOD_LONGITUDE for the latitude \e lon2,
223 * - \e caps |= GEOD_AZIMUTH for the latitude \e azi2; this is
224 * added automatically,
225 * - \e caps |= GEOD_DISTANCE for the distance \e s12,
226 * - \e caps |= GEOD_REDUCEDLENGTH for the reduced length \e m12,
227 * - \e caps |= GEOD_GEODESICSCALE for the geodesic scales \e M12
228 * and \e M21,
229 * - \e caps |= GEOD_AREA for the area \e S12,
230 * - \e caps |= GEOD_DISTANCE_IN permits the length of the
231 * geodesic to be given in terms of \e s12; without this capability the
232 * length can only be specified in terms of arc length.
233 * .
234 * A value of \e caps = 0 is treated as GEOD_LATITUDE | GEOD_LONGITUDE |
235 * GEOD_AZIMUTH | GEOD_DISTANCE_IN (to support the solution of the "standard"
236 * direct problem).
237 **********************************************************************/
238 void geod_lineinit(struct geod_geodesicline* l,
239 const struct geod_geodesic* g,
240 double lat1, double lon1, double azi1, unsigned caps);
241
242 /**
243 * Solve the direct geodesic problem.
244 *
245 * @param[in] g a pointer to the geod_geodesic object specifying the
246 * ellipsoid.
247 * @param[in] lat1 latitude of point 1 (degrees).
248 * @param[in] lon1 longitude of point 1 (degrees).
249 * @param[in] azi1 azimuth at point 1 (degrees).
250 * @param[in] s12 distance between point 1 and point 2 (meters); it can be
251 * negative.
252 * @param[out] plat2 pointer to the latitude of point 2 (degrees).
253 * @param[out] plon2 pointer to the longitude of point 2 (degrees).
254 * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
255 *
256 * \e g must have been initialized with a call to geod_init(). \e lat1
257 * should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e azi1
258 * should be in the range [&minus;540&deg;, 540&deg;). The values of \e lon2
259 * and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;). Any of
260 * the "return" arguments \e plat2, etc., may be replaced by 0, if you do not
261 * need some quantities computed.
262 *
263 * If either point is at a pole, the azimuth is defined by keeping the
264 * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and
265 * taking the limit &epsilon; &rarr; 0+. An arc length greater that 180&deg;
266 * signifies a geodesic which is not a shortest path. (For a prolate
267 * ellipsoid, an additional condition is necessary for a shortest path: the
268 * longitudinal extent must not exceed of 180&deg;.)
269 *
270 * Example, determine the point 10000 km NE of JFK:
271 @code
272 struct geod_geodesic g;
273 double lat, lon;
274 geod_init(&g, 6378137, 1/298.257223563);
275 geod_direct(&g, 40.64, -73.78, 45.0, 10e6, &lat, &lon, 0);
276 printf("%.5f %.5f\n", lat, lon);
277 @endcode
278 **********************************************************************/
279 void geod_direct(const struct geod_geodesic* g,
280 double lat1, double lon1, double azi1, double s12,
281 double* plat2, double* plon2, double* pazi2);
282
283 /**
284 * Solve the inverse geodesic problem.
285 *
286 * @param[in] g a pointer to the geod_geodesic object specifying the
287 * ellipsoid.
288 * @param[in] lat1 latitude of point 1 (degrees).
289 * @param[in] lon1 longitude of point 1 (degrees).
290 * @param[in] lat2 latitude of point 2 (degrees).
291 * @param[in] lon2 longitude of point 2 (degrees).
292 * @param[out] ps12 pointer to the distance between point 1 and point 2
293 * (meters).
294 * @param[out] pazi1 pointer to the azimuth at point 1 (degrees).
295 * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
296 *
297 * \e g must have been initialized with a call to geod_init(). \e lat1
298 * and \e lat2 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and
299 * \e lon2 should be in the range [&minus;540&deg;, 540&deg;). The values of
300 * \e azi1 and \e azi2 returned are in the range [&minus;180&deg;, 180&deg;).
301 * Any of the "return" arguments \e ps12, etc., may be replaced by 0, if you
302 * do not need some quantities computed.
303 *
304 * If either point is at a pole, the azimuth is defined by keeping the
305 * longitude fixed, writing \e lat = &plusmn;(90&deg; &minus; &epsilon;), and
306 * taking the limit &epsilon; &rarr; 0+.
307 *
308 * The solution to the inverse problem is found using Newton's method. If
309 * this fails to converge (this is very unlikely in geodetic applications
310 * but does occur for very eccentric ellipsoids), then the bisection method
311 * is used to refine the solution.
312 *
313 * Example, determine the distance between JFK and Singapore Changi Airport:
314 @code
315 struct geod_geodesic g;
316 double s12;
317 geod_init(&g, 6378137, 1/298.257223563);
318 geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, 0, 0);
319 printf("%.3f\n", s12);
320 @endcode
321 **********************************************************************/
322 void geod_inverse(const struct geod_geodesic* g,
178323 double lat1, double lon1, double lat2, double lon2,
179 double* ps12, double* pazi1, double* pazi2,
180 double* pm12, double* pM12, double* pM21, double* pS12);
181 double GenPosition(const struct GeodesicLine* l,
182 int arcmode, double s12_a12,
183 double* plat2, double* plon2, double* pazi2,
184 double* ps12, double* pm12,
185 double* pM12, double* pM21,
186 double* pS12);
187
188 enum mask {
189 NONE = 0U,
190 LATITUDE = 1U<<7 | 0U,
191 LONGITUDE = 1U<<8 | 1U<<3,
192 AZIMUTH = 1U<<9 | 0U,
193 DISTANCE = 1U<<10 | 1U<<0,
194 DISTANCE_IN = 1U<<11 | 1U<<0 | 1U<<1,
195 REDUCEDLENGTH = 1U<<12 | 1U<<0 | 1U<<2,
196 GEODESICSCALE = 1U<<13 | 1U<<0 | 1U<<2,
197 AREA = 1U<<14 | 1U<<4,
198 ALL = 0x7F80U| 0x1FU
324 double* ps12, double* pazi1, double* pazi2);
325
326 /**
327 * Compute the position along a geod_geodesicline.
328 *
329 * @param[in] l a pointer to the geod_geodesicline object specifying the
330 * geodesic line.
331 * @param[in] s12 distance between point 1 and point 2 (meters); it can be
332 * negative.
333 * @param[out] plat2 pointer to the latitude of point 2 (degrees).
334 * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires
335 * that \e l was initialized with \e caps |= GEOD_LONGITUDE.
336 * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
337 *
338 * \e l must have been initialized with a call to geod_lineinit() with \e
339 * caps |= GEOD_DISTANCE_IN. The values of \e lon2 and \e azi2 returned are
340 * in the range [&minus;180&deg;, 180&deg;). Any of the "return" arguments
341 * \e plat2, etc., may be replaced by 0, if you do not need some quantities
342 * computed.
343 *
344 * Example, compute way points between JFK and Singapore Changi Airport
345 * the "obvious" way using geod_direct():
346 @code
347 struct geod_geodesic g;
348 double s12, azi1, lat[101],lon[101];
349 int i;
350 geod_init(&g, 6378137, 1/298.257223563);
351 geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0);
352 for (i = 0; i < 101; ++i) {
353 geod_direct(&g, 40.64, -73.78, azi1, i * s12 * 0.01, lat + i, lon + i, 0);
354 printf("%.5f %.5f\n", lat[i], lon[i]);
355 }
356 @endcode
357 * A faster way using geod_position():
358 @code
359 struct geod_geodesic g;
360 struct geod_geodesicline l;
361 double s12, azi1, lat[101],lon[101];
362 int i;
363 geod_init(&g, 6378137, 1/298.257223563);
364 geod_inverse(&g, 40.64, -73.78, 1.36, 103.99, &s12, &azi1, 0);
365 geod_lineinit(&l, &g, 40.64, -73.78, azi1, 0);
366 for (i = 0; i < 101; ++i) {
367 geod_position(&l, i * s12 * 0.01, lat + i, lon + i, 0);
368 printf("%.5f %.5f\n", lat[i], lon[i]);
369 }
370 @endcode
371 **********************************************************************/
372 void geod_position(const struct geod_geodesicline* l, double s12,
373 double* plat2, double* plon2, double* pazi2);
374
375 /**
376 * The general direct geodesic problem.
377 *
378 * @param[in] g a pointer to the geod_geodesic object specifying the
379 * ellipsoid.
380 * @param[in] lat1 latitude of point 1 (degrees).
381 * @param[in] lon1 longitude of point 1 (degrees).
382 * @param[in] azi1 azimuth at point 1 (degrees).
383 * @param[in] arcmode flag determining the meaning of the \e
384 * s12_a12.
385 * @param[in] s12_a12 if \e arcmode is 0, this is the distance between
386 * point 1 and point 2 (meters); otherwise it is the arc length between
387 * point 1 and point 2 (degrees); it can be negative.
388 * @param[out] plat2 pointer to the latitude of point 2 (degrees).
389 * @param[out] plon2 pointer to the longitude of point 2 (degrees).
390 * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
391 * @param[out] ps12 pointer to the distance between point 1 and point 2
392 * (meters).
393 * @param[out] pm12 pointer to the reduced length of geodesic (meters).
394 * @param[out] pM12 pointer to the geodesic scale of point 2 relative to
395 * point 1 (dimensionless).
396 * @param[out] pM21 pointer to the geodesic scale of point 1 relative to
397 * point 2 (dimensionless).
398 * @param[out] pS12 pointer to the area under the geodesic
399 * (meters<sup>2</sup>).
400 * @return \e a12 arc length of between point 1 and point 2 (degrees).
401 *
402 * \e g must have been initialized with a call to geod_init(). \e lat1
403 * should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and \e azi1
404 * should be in the range [&minus;540&deg;, 540&deg;). The function value \e
405 * a12 equals \e s12_a12 is \e arcmode is non-zero. Any of the "return"
406 * arguments \e plat2, etc., may be replaced by 0, if you do not need some
407 * quantities computed.
408 **********************************************************************/
409 double geod_gendirect(const struct geod_geodesic* g,
410 double lat1, double lon1, double azi1,
411 int arcmode, double s12_a12,
412 double* plat2, double* plon2, double* pazi2,
413 double* ps12, double* pm12, double* pM12, double* pM21,
414 double* pS12);
415
416 /**
417 * The general inverse geodesic calculation.
418 *
419 * @param[in] g a pointer to the geod_geodesic object specifying the
420 * ellipsoid.
421 * @param[in] lat1 latitude of point 1 (degrees).
422 * @param[in] lon1 longitude of point 1 (degrees).
423 * @param[in] lat2 latitude of point 2 (degrees).
424 * @param[in] lon2 longitude of point 2 (degrees).
425 * @param[out] ps12 pointer to the distance between point 1 and point 2
426 * (meters).
427 * @param[out] pazi1 pointer to the azimuth at point 1 (degrees).
428 * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
429 * @param[out] pm12 pointer to the reduced length of geodesic (meters).
430 * @param[out] pM12 pointer to the geodesic scale of point 2 relative to
431 * point 1 (dimensionless).
432 * @param[out] pM21 pointer to the geodesic scale of point 1 relative to
433 * point 2 (dimensionless).
434 * @param[out] pS12 pointer to the area under the geodesic
435 * (meters<sup>2</sup>).
436 * @return \e a12 arc length of between point 1 and point 2 (degrees).
437 *
438 * \e g must have been initialized with a call to geod_init(). \e lat1
439 * and \e lat2 should be in the range [&minus;90&deg;, 90&deg;]; \e lon1 and
440 * \e lon2 should be in the range [&minus;540&deg;, 540&deg;). Any of the
441 * "return" arguments \e ps12, etc., may be replaced by 0, if you do not need
442 * some quantities computed.
443 **********************************************************************/
444 double geod_geninverse(const struct geod_geodesic* g,
445 double lat1, double lon1, double lat2, double lon2,
446 double* ps12, double* pazi1, double* pazi2,
447 double* pm12, double* pM12, double* pM21,
448 double* pS12);
449
450 /**
451 * The general position function.
452 *
453 * @param[in] l a pointer to the geod_geodesicline object specifying the
454 * geodesic line.
455 * @param[in] arcmode flag determining the meaning of the second parameter;
456 * if arcmode is 0, then \e l must have been initialized with \e caps |=
457 * GEOD_DISTANCE_IN.
458 * @param[in] s12_a12 if \e arcmode is 0, this is the distance between
459 * point 1 and point 2 (meters); otherwise it is the arc length between
460 * point 1 and point 2 (degrees); it can be negative.
461 * @param[out] plat2 pointer to the latitude of point 2 (degrees).
462 * @param[out] plon2 pointer to the longitude of point 2 (degrees); requires
463 * that \e l was initialized with \e caps |= GEOD_LONGITUDE.
464 * @param[out] pazi2 pointer to the (forward) azimuth at point 2 (degrees).
465 * @param[out] ps12 pointer to the distance between point 1 and point 2
466 * (meters); requires that \e l was initialized with \e caps |=
467 * GEOD_DISTANCE.
468 * @param[out] pm12 pointer to the reduced length of geodesic (meters);
469 * requires that \e l was initialized with \e caps |= GEOD_REDUCEDLENGTH.
470 * @param[out] pM12 pointer to the geodesic scale of point 2 relative to
471 * point 1 (dimensionless); requires that \e l was initialized with \e caps
472 * |= GEOD_GEODESICSCALE.
473 * @param[out] pM21 pointer to the geodesic scale of point 1 relative to
474 * point 2 (dimensionless); requires that \e l was initialized with \e caps
475 * |= GEOD_GEODESICSCALE.
476 * @param[out] pS12 pointer to the area under the geodesic
477 * (meters<sup>2</sup>); requires that \e l was initialized with \e caps |=
478 * GEOD_AREA.
479 * @return \e a12 arc length of between point 1 and point 2 (degrees).
480 *
481 * \e l must have been initialized with a call to geod_lineinit() with \e
482 * caps |= GEOD_DISTANCE_IN. The values of \e lon2 and \e azi2 returned are
483 * in the range [&minus;180&deg;, 180&deg;). Any of the "return" arguments
484 * \e plat2, etc., may be replaced by 0, if you do not need some quantities
485 * computed. Requesting a value which \e l is not capable of computing is
486 * not an error; the corresponding argument will not be altered.
487 *
488 * Example, compute way points between JFK and Singapore Changi Airport
489 * using geod_genposition(). In this example, the points are evenly space in
490 * arc length (and so only approximately equally space in distance). This is
491 * faster than using geod_position() would be appropriate if drawing the path
492 * on a map.
493 @code
494 struct geod_geodesic g;
495 struct geod_geodesicline l;
496 double a12, azi1, lat[101],lon[101];
497 int i;
498 geod_init(&g, 6378137, 1/298.257223563);
499 a12 = geod_geninverse(&g, 40.64, -73.78, 1.36, 103.99,
500 0, &azi1, 0, 0, 0, 0, 0);
501 geod_lineinit(&l, &g, 40.64, -73.78, azi1, GEOD_LATITUDE | GEOD_LONGITUDE);
502 for (i = 0; i < 101; ++i) {
503 geod_genposition(&l, 1, i * a12 * 0.01,
504 lat + i, lon + i, 0, 0, 0, 0, 0, 0);
505 printf("%.5f %.5f\n", lat[i], lon[i]);
506 }
507 @endcode
508 **********************************************************************/
509 double geod_genposition(const struct geod_geodesicline* l,
510 int arcmode, double s12_a12,
511 double* plat2, double* plon2, double* pazi2,
512 double* ps12, double* pm12,
513 double* pM12, double* pM21,
514 double* pS12);
515
516 /**
517 * Initialize a geod_polygon object.
518 *
519 * @param[out] p a pointer to the object to be initialized.
520 * @param[in] polylinep non-zero if a polyline instead of a polygon.
521 *
522 * If \e polylinep is zero, then the sequence of vertices and edges added by
523 * geod_polygon_addpoint() and geod_polygon_addedge() define a polygon and
524 * the perimeter and area are returned by geod_polygon_compute(). If \e
525 * polylinep is non-zero, then the vertices and edges define a polyline and
526 * only the perimeter is returned by geod_polygon_compute().
527 *
528 * An example of the use of this function is given in the documentation for
529 * geod_polygon_compute().
530 **********************************************************************/
531 void geod_polygon_init(struct geod_polygon* p, int polylinep);
532
533 /**
534 * Add a point to the polygon or polyline.
535 *
536 * @param[in] g a pointer to the geod_geodesic object specifying the
537 * ellipsoid.
538 * @param[in,out] p a pointer to the geod_polygon object specifying the
539 * polygon.
540 * @param[in] lat the latitude of the point (degrees).
541 * @param[in] lon the longitude of the point (degrees).
542 *
543 * \e g and \e p must have been initialized with calls to geod_init() and
544 * geod_polygon_init(), respectively. The same \e g must be used for all the
545 * points and edges in a polygon. \e lat should be in the range
546 * [&minus;90&deg;, 90&deg;] and \e lon should be in the range
547 * [&minus;540&deg;, 540&deg;).
548 *
549 * An example of the use of this function is given in the documentation for
550 * geod_polygon_compute().
551 **********************************************************************/
552 void geod_polygon_addpoint(const struct geod_geodesic* g,
553 struct geod_polygon* p,
554 double lat, double lon);
555
556 /**
557 * Add an edge to the polygon or polyline.
558 *
559 * @param[in] g a pointer to the geod_geodesic object specifying the
560 * ellipsoid.
561 * @param[in,out] p a pointer to the geod_polygon object specifying the
562 * polygon.
563 * @param[in] azi azimuth at current point (degrees).
564 * @param[in] s distance from current point to next point (meters).
565 *
566 * \e g and \e p must have been initialized with calls to geod_init() and
567 * geod_polygon_init(), respectively. The same \e g must be used for all the
568 * points and edges in a polygon. \e azi should be in the range
569 * [&minus;540&deg;, 540&deg;). This does nothing if no points have been
570 * added yet. The \e lat and \e lon fields of \e p give the location of
571 * the new vertex.
572 **********************************************************************/
573 void geod_polygon_addedge(const struct geod_geodesic* g,
574 struct geod_polygon* p,
575 double azi, double s);
576
577 /**
578 * Return the results for a polygon.
579 *
580 * @param[in] g a pointer to the geod_geodesic object specifying the
581 * ellipsoid.
582 * @param[in] p a pointer to the geod_polygon object specifying the polygon.
583 * @param[in] reverse if non-zero then clockwise (instead of
584 * counter-clockwise) traversal counts as a positive area.
585 * @param[in] sign if non-zero then return a signed result for the area if
586 * the polygon is traversed in the "wrong" direction instead of returning
587 * the area for the rest of the earth.
588 * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>);
589 * only set if \e polyline is non-zero in the call to geod_polygon_init().
590 * @param[out] pP pointer to the perimeter of the polygon or length of the
591 * polyline (meters).
592 * @return the number of points.
593 *
594 * Only simple polygons (which are not self-intersecting) are allowed.
595 * There's no need to "close" the polygon by repeating the first vertex. Set
596 * \e pA or \e pP to zero, if you do not want the corresponding quantity
597 * returned.
598 *
599 * Example, compute the perimeter and area of the geodesic triangle with
600 * vertices (0&deg;N,0&deg;E), (0&deg;N,90&deg;E), (90&deg;N,0&deg;E).
601 @code
602 double A, P;
603 int n;
604 struct geod_geodesic g;
605 struct geod_polygon p;
606 geod_init(&g, 6378137, 1/298.257223563);
607 geod_polygon_init(&p, 0);
608
609 geod_polygon_addpoint(&g, &p, 0, 0);
610 geod_polygon_addpoint(&g, &p, 0, 90);
611 geod_polygon_addpoint(&g, &p, 90, 0);
612 n = geod_polygon_compute(&g, &p, 0, 1, &A, &P);
613 printf("%d %.8f %.3f\n", n, P, A);
614 @endcode
615 **********************************************************************/
616 unsigned geod_polygon_compute(const struct geod_geodesic* g,
617 const struct geod_polygon* p,
618 int reverse, int sign,
619 double* pA, double* pP);
620
621 /**
622 * Return the results assuming a tentative final test point is added;
623 * however, the data for the test point is not saved. This lets you report a
624 * running result for the perimeter and area as the user moves the mouse
625 * cursor. Ordinary floating point arithmetic is used to accumulate the data
626 * for the test point; thus the area and perimeter returned are less accurate
627 * than if geod_polygon_addpoint() and geod_polygon_compute() are used.
628 *
629 * @param[in] g a pointer to the geod_geodesic object specifying the
630 * ellipsoid.
631 * @param[in] p a pointer to the geod_polygon object specifying the polygon.
632 * @param[in] lat the latitude of the test point (degrees).
633 * @param[in] lon the longitude of the test point (degrees).
634 * @param[in] reverse if non-zero then clockwise (instead of
635 * counter-clockwise) traversal counts as a positive area.
636 * @param[in] sign if non-zero then return a signed result for the area if
637 * the polygon is traversed in the "wrong" direction instead of returning
638 * the area for the rest of the earth.
639 * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>);
640 * only set if \e polyline is non-zero in the call to geod_polygon_init().
641 * @param[out] pP pointer to the perimeter of the polygon or length of the
642 * polyline (meters).
643 * @return the number of points.
644 *
645 * \e lat should be in the range [&minus;90&deg;, 90&deg;] and \e
646 * lon should be in the range [&minus;540&deg;, 540&deg;).
647 **********************************************************************/
648 unsigned geod_polygon_testpoint(const struct geod_geodesic* g,
649 const struct geod_polygon* p,
650 double lat, double lon,
651 int reverse, int sign,
652 double* pA, double* pP);
653
654 /**
655 * Return the results assuming a tentative final test point is added via an
656 * azimuth and distance; however, the data for the test point is not saved.
657 * This lets you report a running result for the perimeter and area as the
658 * user moves the mouse cursor. Ordinary floating point arithmetic is used
659 * to accumulate the data for the test point; thus the area and perimeter
660 * returned are less accurate than if geod_polygon_addedge() and
661 * geod_polygon_compute() are used.
662 *
663 * @param[in] g a pointer to the geod_geodesic object specifying the
664 * ellipsoid.
665 * @param[in] p a pointer to the geod_polygon object specifying the polygon.
666 * @param[in] azi azimuth at current point (degrees).
667 * @param[in] s distance from current point to final test point (meters).
668 * @param[in] reverse if non-zero then clockwise (instead of
669 * counter-clockwise) traversal counts as a positive area.
670 * @param[in] sign if non-zero then return a signed result for the area if
671 * the polygon is traversed in the "wrong" direction instead of returning
672 * the area for the rest of the earth.
673 * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>);
674 * only set if \e polyline is non-zero in the call to geod_polygon_init().
675 * @param[out] pP pointer to the perimeter of the polygon or length of the
676 * polyline (meters).
677 * @return the number of points.
678 *
679 * \e azi should be in the range [&minus;540&deg;, 540&deg;).
680 **********************************************************************/
681 unsigned geod_polygon_testedge(const struct geod_geodesic* g,
682 const struct geod_polygon* p,
683 double azi, double s,
684 int reverse, int sign,
685 double* pA, double* pP);
686
687 /**
688 * A simple interface for computing the area of a geodesic polygon.
689 *
690 * @param[in] g a pointer to the geod_geodesic object specifying the
691 * ellipsoid.
692 * @param[in] lats an array of latitudes of the polygon vertices (degrees).
693 * @param[in] lons an array of longitudes of the polygon vertices (degrees).
694 * @param[in] n the number of vertices.
695 * @param[out] pA pointer to the area of the polygon (meters<sup>2</sup>).
696 * @param[out] pP pointer to the perimeter of the polygon (meters).
697 *
698 * \e lats should be in the range [&minus;90&deg;, 90&deg;]; \e lons should
699 * be in the range [&minus;540&deg;, 540&deg;).
700 *
701 * Only simple polygons (which are not self-intersecting) are allowed.
702 * There's no need to "close" the polygon by repeating the first vertex. The
703 * area returned is signed with counter-clockwise traversal being treated as
704 * positive.
705 *
706 * Example, compute the area of Antarctic:
707 @code
708 double
709 lats[] = {-72.9, -71.9, -74.9, -74.3, -77.5, -77.4, -71.7, -65.9, -65.7,
710 -66.6, -66.9, -69.8, -70.0, -71.0, -77.3, -77.9, -74.7},
711 lons[] = {-74, -102, -102, -131, -163, 163, 172, 140, 113,
712 88, 59, 25, -4, -14, -33, -46, -61};
713 struct geod_geodesic g;
714 double A, P;
715 geod_init(&g, 6378137, 1/298.257223563);
716 geod_polygonarea(&g, lats, lons, (sizeof lats) / (sizeof lats[0]), &A, &P);
717 printf("%.0f %.2f\n", A, P);
718 @endcode
719 **********************************************************************/
720 void geod_polygonarea(const struct geod_geodesic* g,
721 double lats[], double lons[], int n,
722 double* pA, double* pP);
723
724 /**
725 * mask values for the the \e caps argument to geod_lineinit().
726 **********************************************************************/
727 enum geod_mask {
728 GEOD_NONE = 0U, /**< Calculate nothing */
729 GEOD_LATITUDE = 1U<<7 | 0U, /**< Calculate latitude */
730 GEOD_LONGITUDE = 1U<<8 | 1U<<3, /**< Calculate longitude */
731 GEOD_AZIMUTH = 1U<<9 | 0U, /**< Calculate azimuth */
732 GEOD_DISTANCE = 1U<<10 | 1U<<0, /**< Calculate distance */
733 GEOD_DISTANCE_IN = 1U<<11 | 1U<<0 | 1U<<1, /**< Allow distance as input */
734 GEOD_REDUCEDLENGTH= 1U<<12 | 1U<<0 | 1U<<2, /**< Calculate reduced length */
735 GEOD_GEODESICSCALE= 1U<<13 | 1U<<0 | 1U<<2, /**< Calculate geodesic scale */
736 GEOD_AREA = 1U<<14 | 1U<<4, /**< Calculate reduced length */
737 GEOD_ALL = 0x7F80U| 0x1FU /**< Calculate everything */
199738 };
200739
201740 #if defined(__cplusplus)
00 #include <projects.h>
1 static void /* sum coefficients less than res */
1 static void /* sum coefficients less than res */
22 eval(projUV **w, int nu, int nv, double res, projUV *resid) {
3 int i, j;
4 double ab;
5 projUV *s;
3 int i, j;
4 double ab;
5 projUV *s;
66
7 resid->u = resid->v = 0.;
8 for (i = 0; i < nu; ++i)
9 for (s = w[i], j = 0; j < nv; ++j, ++s) {
10 if ((ab = fabs(s->u)) < res)
11 resid->u += ab;
12 if ((ab = fabs(s->v)) < res)
13 resid->v += ab;
14 }
7 resid->u = resid->v = 0.;
8 for (i = 0; i < nu; ++i)
9 for (s = w[i], j = 0; j < nv; ++j, ++s) {
10 if ((ab = fabs(s->u)) < res)
11 resid->u += ab;
12 if ((ab = fabs(s->v)) < res)
13 resid->v += ab;
14 }
1515 }
16 static Tseries * /* create power series structure */
16 static Tseries * /* create power series structure */
1717 makeT(int nru, int nrv) {
18 Tseries *T;
19 int i;
18 Tseries *T;
19 int i;
2020
21 if ((T = (Tseries *)pj_malloc(sizeof(Tseries))) &&
22 (T->cu = (struct PW_COEF *)pj_malloc(
23 sizeof(struct PW_COEF) * nru)) &&
24 (T->cv = (struct PW_COEF *)pj_malloc(
25 sizeof(struct PW_COEF) * nrv))) {
26 for (i = 0; i < nru; ++i)
27 T->cu[i].c = 0;
28 for (i = 0; i < nrv; ++i)
29 T->cv[i].c = 0;
30 return T;
31 } else
32 return 0;
21 if ((T = (Tseries *)pj_malloc(sizeof(Tseries))) &&
22 (T->cu = (struct PW_COEF *)pj_malloc(
23 sizeof(struct PW_COEF) * nru)) &&
24 (T->cv = (struct PW_COEF *)pj_malloc(
25 sizeof(struct PW_COEF) * nrv))) {
26 for (i = 0; i < nru; ++i)
27 T->cu[i].c = 0;
28 for (i = 0; i < nrv; ++i)
29 T->cv[i].c = 0;
30 return T;
31 } else
32 return 0;
3333 }
34 Tseries *
34 Tseries *
3535 mk_cheby(projUV a, projUV b, double res, projUV *resid, projUV (*func)(projUV),
36 int nu, int nv, int power) {
37 int j, i, nru, nrv, *ncu, *ncv;
38 Tseries *T;
39 projUV **w;
40 double cutres;
36 int nu, int nv, int power) {
37 int j, i, nru, nrv, *ncu, *ncv;
38 Tseries *T;
39 projUV **w;
40 double cutres;
4141
42 if (!(w = (projUV **)vector2(nu, nv, sizeof(projUV))) ||
43 !(ncu = (int *)vector1(nu + nv, sizeof(int))))
44 return 0;
45 ncv = ncu + nu;
46 if (!bchgen(a, b, nu, nv, w, func)) {
47 projUV *s;
48 double ab, *p;
42 if (!(w = (projUV **)vector2(nu, nv, sizeof(projUV))) ||
43 !(ncu = (int *)vector1(nu + nv, sizeof(int))))
44 return 0;
45 ncv = ncu + nu;
46 if (!bchgen(a, b, nu, nv, w, func)) {
47 projUV *s;
48 double ab, *p;
4949
50 /* analyse coefficients and adjust until residual OK */
51 cutres = res;
52 for (i = 4; i ; --i) {
53 eval(w, nu, nv, cutres, resid);
54 if (resid->u < res && resid->v < res)
55 break;
56 cutres *= 0.5;
57 }
58 if (i <= 0) /* warn of too many tries */
59 resid->u = - resid->u;
60 /* apply cut resolution and set pointers */
61 nru = nrv = 0;
62 for (j = 0; j < nu; ++j) {
63 ncu[j] = ncv[j] = 0; /* clear column maxes */
64 for (s = w[j], i = 0; i < nv; ++i, ++s) {
65 if ((ab = fabs(s->u)) < cutres) /* < resolution ? */
66 s->u = 0.; /* clear coefficient */
67 else
68 ncu[j] = i + 1; /* update column max */
69 if ((ab = fabs(s->v)) < cutres) /* same for v coef's */
70 s->v = 0.;
71 else
72 ncv[j] = i + 1;
73 }
74 if (ncu[j]) nru = j + 1; /* update row max */
75 if (ncv[j]) nrv = j + 1;
76 }
77 if (power) { /* convert to bivariate power series */
78 if (!bch2bps(a, b, w, nu, nv))
79 goto error;
80 /* possible change in some row counts, so readjust */
81 nru = nrv = 0;
82 for (j = 0; j < nu; ++j) {
83 ncu[j] = ncv[j] = 0; /* clear column maxes */
84 for (s = w[j], i = 0; i < nv; ++i, ++s) {
85 if (s->u)
86 ncu[j] = i + 1; /* update column max */
87 if (s->v)
88 ncv[j] = i + 1;
89 }
90 if (ncu[j]) nru = j + 1; /* update row max */
91 if (ncv[j]) nrv = j + 1;
92 }
93 if ((T = makeT(nru, nrv)) != NULL ) {
94 T->a = a;
95 T->b = b;
96 T->mu = nru - 1;
97 T->mv = nrv - 1;
98 T->power = 1;
99 for (i = 0; i < nru; ++i) /* store coefficient rows for u */
100 if ((T->cu[i].m = ncu[i]) != 0)
101 if ((p = T->cu[i].c =
102 (double *)pj_malloc(sizeof(double) * ncu[i])))
103 for (j = 0; j < ncu[i]; ++j)
104 *p++ = (w[i] + j)->u;
105 else
106 goto error;
107 for (i = 0; i < nrv; ++i) /* same for v */
108 if ((T->cv[i].m = ncv[i]) != 0)
109 if ((p = T->cv[i].c =
110 (double *)pj_malloc(sizeof(double) * ncv[i])))
111 for (j = 0; j < ncv[i]; ++j)
112 *p++ = (w[i] + j)->v;
113 else
114 goto error;
115 }
116 } else if ((T = makeT(nru, nrv)) != NULL) {
117 /* else make returned Chebyshev coefficient structure */
118 T->mu = nru - 1; /* save row degree */
119 T->mv = nrv - 1;
120 T->a.u = a.u + b.u; /* set argument scaling */
121 T->a.v = a.v + b.v;
122 T->b.u = 1. / (b.u - a.u);
123 T->b.v = 1. / (b.v - a.v);
124 T->power = 0;
125 for (i = 0; i < nru; ++i) /* store coefficient rows for u */
126 if ((T->cu[i].m = ncu[i]) != 0)
127 if ((p = T->cu[i].c =
128 (double *)pj_malloc(sizeof(double) * ncu[i])))
129 for (j = 0; j < ncu[i]; ++j)
130 *p++ = (w[i] + j)->u;
131 else
132 goto error;
133 for (i = 0; i < nrv; ++i) /* same for v */
134 if ((T->cv[i].m = ncv[i]) != 0)
135 if ((p = T->cv[i].c =
136 (double *)pj_malloc(sizeof(double) * ncv[i])))
137 for (j = 0; j < ncv[i]; ++j)
138 *p++ = (w[i] + j)->v;
139 else
140 goto error;
141 } else
142 goto error;
143 }
144 goto gohome;
145 error:
146 if (T) { /* pj_dalloc up possible allocations */
147 for (i = 0; i <= T->mu; ++i)
148 if (T->cu[i].c)
149 pj_dalloc(T->cu[i].c);
150 for (i = 0; i <= T->mv; ++i)
151 if (T->cv[i].c)
152 pj_dalloc(T->cv[i].c);
153 pj_dalloc(T);
154 }
155 T = 0;
156 gohome:
157 freev2((void **) w, nu);
158 pj_dalloc(ncu);
159 return T;
50 /* analyse coefficients and adjust until residual OK */
51 cutres = res;
52 for (i = 4; i ; --i) {
53 eval(w, nu, nv, cutres, resid);
54 if (resid->u < res && resid->v < res)
55 break;
56 cutres *= 0.5;
57 }
58 if (i <= 0) /* warn of too many tries */
59 resid->u = - resid->u;
60 /* apply cut resolution and set pointers */
61 nru = nrv = 0;
62 for (j = 0; j < nu; ++j) {
63 ncu[j] = ncv[j] = 0; /* clear column maxes */
64 for (s = w[j], i = 0; i < nv; ++i, ++s) {
65 if ((ab = fabs(s->u)) < cutres) /* < resolution ? */
66 s->u = 0.; /* clear coefficient */
67 else
68 ncu[j] = i + 1; /* update column max */
69 if ((ab = fabs(s->v)) < cutres) /* same for v coef's */
70 s->v = 0.;
71 else
72 ncv[j] = i + 1;
73 }
74 if (ncu[j]) nru = j + 1; /* update row max */
75 if (ncv[j]) nrv = j + 1;
76 }
77 if (power) { /* convert to bivariate power series */
78 if (!bch2bps(a, b, w, nu, nv))
79 goto error;
80 /* possible change in some row counts, so readjust */
81 nru = nrv = 0;
82 for (j = 0; j < nu; ++j) {
83 ncu[j] = ncv[j] = 0; /* clear column maxes */
84 for (s = w[j], i = 0; i < nv; ++i, ++s) {
85 if (s->u)
86 ncu[j] = i + 1; /* update column max */
87 if (s->v)
88 ncv[j] = i + 1;
89 }
90 if (ncu[j]) nru = j + 1; /* update row max */
91 if (ncv[j]) nrv = j + 1;
92 }
93 if ((T = makeT(nru, nrv)) != NULL ) {
94 T->a = a;
95 T->b = b;
96 T->mu = nru - 1;
97 T->mv = nrv - 1;
98 T->power = 1;
99 for (i = 0; i < nru; ++i) /* store coefficient rows for u */
100 {
101 if ((T->cu[i].m = ncu[i]) != 0)
102 {
103 if ((p = T->cu[i].c =
104 (double *)pj_malloc(sizeof(double) * ncu[i])))
105 for (j = 0; j < ncu[i]; ++j)
106 *p++ = (w[i] + j)->u;
107 else
108 goto error;
109 }
110 }
111 for (i = 0; i < nrv; ++i) /* same for v */
112 {
113 if ((T->cv[i].m = ncv[i]) != 0)
114 {
115 if ((p = T->cv[i].c =
116 (double *)pj_malloc(sizeof(double) * ncv[i])))
117 for (j = 0; j < ncv[i]; ++j)
118 *p++ = (w[i] + j)->v;
119 else
120 goto error;
121 }
122 }
123 }
124 } else if ((T = makeT(nru, nrv)) != NULL) {
125 /* else make returned Chebyshev coefficient structure */
126 T->mu = nru - 1; /* save row degree */
127 T->mv = nrv - 1;
128 T->a.u = a.u + b.u; /* set argument scaling */
129 T->a.v = a.v + b.v;
130 T->b.u = 1. / (b.u - a.u);
131 T->b.v = 1. / (b.v - a.v);
132 T->power = 0;
133 for (i = 0; i < nru; ++i) /* store coefficient rows for u */
134 {
135 if ((T->cu[i].m = ncu[i]) != 0)
136 {
137 if ((p = T->cu[i].c =
138 (double *)pj_malloc(sizeof(double) * ncu[i])))
139 for (j = 0; j < ncu[i]; ++j)
140 *p++ = (w[i] + j)->u;
141 else
142 goto error;
143 }
144 }
145 for (i = 0; i < nrv; ++i) /* same for v */
146 {
147 if ((T->cv[i].m = ncv[i]) != 0)
148 {
149 if ((p = T->cv[i].c =
150 (double *)pj_malloc(sizeof(double) * ncv[i])))
151 for (j = 0; j < ncv[i]; ++j)
152 *p++ = (w[i] + j)->v;
153 else
154 goto error;
155 }
156 }
157 } else
158 goto error;
159 }
160 goto gohome;
161 error:
162 if (T) { /* pj_dalloc up possible allocations */
163 for (i = 0; i <= T->mu; ++i)
164 if (T->cu[i].c)
165 pj_dalloc(T->cu[i].c);
166 for (i = 0; i <= T->mv; ++i)
167 if (T->cv[i].c)
168 pj_dalloc(T->cv[i].c);
169 pj_dalloc(T);
170 }
171 T = 0;
172 gohome:
173 freev2((void **) w, nu);
174 pj_dalloc(ncu);
175 return T;
160176 }
00 /******************************************************************************
1 * $Id: nad_init.c 2142 2012-01-25 19:23:31Z warmerdam $
1 * $Id: nad_init.c 2345 2013-06-22 07:54:57Z warmerdam $
22 *
33 * Project: PROJ.4
44 * Purpose: Load datum shift files into memory.
8181 /* Load the data portion of a ctable formatted grid. */
8282 /************************************************************************/
8383
84 int nad_ctable_load( projCtx ctx, struct CTABLE *ct, FILE *fid )
84 int nad_ctable_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
8585
8686 {
8787 int a_size;
8888
89 fseek( fid, sizeof(struct CTABLE), SEEK_SET );
89 pj_ctx_fseek( ctx, fid, sizeof(struct CTABLE), SEEK_SET );
9090
9191 /* read all the actual shift values */
9292 a_size = ct->lim.lam * ct->lim.phi;
9393 ct->cvs = (FLP *) pj_malloc(sizeof(FLP) * a_size);
9494 if( ct->cvs == NULL
95 || fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size )
95 || pj_ctx_fread(ctx, ct->cvs, sizeof(FLP), a_size, fid) != a_size )
9696 {
9797 pj_dalloc( ct->cvs );
9898 ct->cvs = NULL;
112112 /* Read the header portion of a "ctable" format grid. */
113113 /************************************************************************/
114114
115 struct CTABLE *nad_ctable_init( projCtx ctx, FILE * fid )
115 struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid )
116116 {
117117 struct CTABLE *ct;
118118 int id_end;
120120 /* read the table header */
121121 ct = (struct CTABLE *) pj_malloc(sizeof(struct CTABLE));
122122 if( ct == NULL
123 || fread( ct, sizeof(struct CTABLE), 1, fid ) != 1 )
123 || pj_ctx_fread( ctx, ct, sizeof(struct CTABLE), 1, fid ) != 1 )
124124 {
125125 pj_ctx_set_errno( ctx, -38 );
126126 return NULL;
154154 /* Load the data portion of a ctable2 formatted grid. */
155155 /************************************************************************/
156156
157 int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, FILE *fid )
157 int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, PAFile fid )
158158
159159 {
160160 int a_size;
161161
162 fseek( fid, 160, SEEK_SET );
162 pj_ctx_fseek( ctx, fid, 160, SEEK_SET );
163163
164164 /* read all the actual shift values */
165165 a_size = ct->lim.lam * ct->lim.phi;
166166 ct->cvs = (FLP *) pj_malloc(sizeof(FLP) * a_size);
167167 if( ct->cvs == NULL
168 || fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size )
168 || pj_ctx_fread(ctx, ct->cvs, sizeof(FLP), a_size, fid) != a_size )
169169 {
170170 pj_dalloc( ct->cvs );
171171 ct->cvs = NULL;
194194 /* Read the header portion of a "ctable2" format grid. */
195195 /************************************************************************/
196196
197 struct CTABLE *nad_ctable2_init( projCtx ctx, FILE * fid )
197 struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid )
198198 {
199199 struct CTABLE *ct;
200200 int id_end;
201201 char header[160];
202202
203 if( fread( header, sizeof(header), 1, fid ) != 1 )
203 if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
204204 {
205205 pj_ctx_set_errno( ctx, -38 );
206206 return NULL;
267267 {
268268 char fname[MAX_PATH_FILENAME+1];
269269 struct CTABLE *ct;
270 FILE *fid;
270 PAFile fid;
271271
272272 ctx->last_errno = 0;
273273
289289 }
290290 }
291291
292 fclose(fid);
292 pj_ctx_fclose(ctx, fid);
293293 return ct;
294294 }
295295
00 /******************************************************************************
1 * $Id: pj_apply_gridshift.c 2219 2012-06-19 04:18:00Z warmerdam $
1 * $Id: pj_apply_gridshift.c 2548 2014-09-17 06:21:09Z warmerdam $
22 *
33 * Project: PROJ.4
44 * Purpose: Apply datum shifts based on grid shift files (normally NAD27 to
155155 continue;
156156
157157 /* If we have child nodes, check to see if any of them apply. */
158 if( gi->child != NULL )
158 while( gi->child )
159159 {
160160 PJ_GRIDINFO *child;
161161
176176 break;
177177 }
178178
179 /* we found a more refined child node to use */
180 if( child != NULL )
181 {
182 gi = child;
183 ct = child->ct;
184 }
179 /* If we didn't find a child then nothing more to do */
180
181 if( child == NULL ) break;
182
183 /* Otherwise use the child, first checking it's children */
184
185 gi = child;
186 ct = child->ct;
185187 }
186188
187189 /* load the grid shift info if we don't have it. */
100100 continue;
101101
102102 /* If we have child nodes, check to see if any of them apply. */
103 if( gi->child != NULL )
103 while( gi->child != NULL )
104104 {
105105 PJ_GRIDINFO *child;
106106
116116 break;
117117 }
118118
119 /* we found a more refined child node to use */
120 if( child != NULL )
119 /* we didn't find a more refined child node to use, so go with current grid */
120 if( child == NULL )
121121 {
122 gi = child;
123 ct = child->ct;
122 break;
124123 }
124
125 /* Otherwise let's try for childrens children .. */
126 gi = child;
127 ct = child->ct;
125128 }
126129
127130 /* load the grid shift info if we don't have it. */
3232 PJ_CVSID("$Id$");
3333
3434 static projCtx_t default_context;
35 static int default_context_initialized = 0;
35 static volatile int default_context_initialized = 0;
3636
3737 /************************************************************************/
3838 /* pj_get_ctx() */
6767
6868 if( !default_context_initialized )
6969 {
70 default_context_initialized = 1;
7170 default_context.last_errno = 0;
7271 default_context.debug_level = PJ_LOG_NONE;
7372 default_context.logger = pj_stderr_logger;
7473 default_context.app_data = NULL;
74 default_context.fileapi = pj_get_default_fileapi();
7575
7676 if( getenv("PROJ_DEBUG") != NULL )
7777 {
8080 else
8181 default_context.debug_level = PJ_LOG_DEBUG_MINOR;
8282 }
83 default_context_initialized = 1;
8384 }
8485
8586 pj_release_lock();
175176 return ctx->app_data;
176177 }
177178
178
179 /************************************************************************/
180 /* pj_ctx_set_fileapi() */
181 /************************************************************************/
182
183 void pj_ctx_set_fileapi( projCtx ctx, projFileAPI *fileapi )
184
185 {
186 ctx->fileapi = fileapi;
187 }
188
189 /************************************************************************/
190 /* pj_ctx_get_fileapi() */
191 /************************************************************************/
192
193 projFileAPI *pj_ctx_get_fileapi( projCtx ctx )
194
195 {
196 return ctx->fileapi;
197 }
198
199
00 /******************************************************************************
1 * $Id: pj_datums.c 2085 2011-08-07 22:17:18Z warmerdam $
1 * $Id: pj_datums.c 2553 2014-09-17 09:07:29Z rouault $
22 *
33 * Project: PROJ.4
44 * Purpose: Built in datum list.
4848 "clrk66",
4949 "North_American_Datum_1927",
5050 "potsdam", "towgs84=598.1,73.7,418.2,0.202,0.045,-2.455,6.7", "bessel", "Potsdam Rauenberg 1950 DHDN",
51 "carthage", "towgs84=-263.0,6.0,431.0", "clark80", "Carthage 1934 Tunisia",
52 "hermannskogel", "towgs84=653.0,-212.0,449.0", "bessel", "Hermannskogel",
51 "carthage", "towgs84=-263.0,6.0,431.0", "clrk80ign", "Carthage 1934 Tunisia",
52 "hermannskogel", "towgs84=577.326,90.129,463.919,5.137,1.474,5.297,2.4232", "bessel", "Hermannskogel",
5353 "ire65", "towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", "mod_airy", "Ireland 1965",
5454 "nzgd49", "towgs84=59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", "intl", "New Zealand Geodetic Datum 1949",
5555 "OSGB36", "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "airy", "Airy 1830",
1818 /* check for varying forms of ellipsoid input */
1919 *a = *es = 0.;
2020 /* R takes precedence */
21 if (pj_param(NULL, pl, "tR").i)
22 *a = pj_param(NULL,pl, "dR").f;
21 if (pj_param(ctx, pl, "tR").i)
22 *a = pj_param(ctx,pl, "dR").f;
2323 else { /* probable elliptical figure */
2424
2525 /* check if ellps present and temporarily append its values to pl */
26 if ((name = pj_param(NULL,pl, "sellps").s) != NULL) {
26 if ((name = pj_param(ctx,pl, "sellps").s) != NULL) {
2727 char *s;
2828
2929 for (start = pl; start && start->next ; start = start->next) ;
3333 curr = curr->next = pj_mkparam(pj_ellps[i].major);
3434 curr = curr->next = pj_mkparam(pj_ellps[i].ell);
3535 }
36 *a = pj_param(NULL,pl, "da").f;
37 if (pj_param(NULL,pl, "tes").i) /* eccentricity squared */
38 *es = pj_param(NULL,pl, "des").f;
39 else if (pj_param(NULL,pl, "te").i) { /* eccentricity */
40 e = pj_param(NULL,pl, "de").f;
36 *a = pj_param(ctx,pl, "da").f;
37 if (pj_param(ctx,pl, "tes").i) /* eccentricity squared */
38 *es = pj_param(ctx,pl, "des").f;
39 else if (pj_param(ctx,pl, "te").i) { /* eccentricity */
40 e = pj_param(ctx,pl, "de").f;
4141 *es = e * e;
42 } else if (pj_param(NULL,pl, "trf").i) { /* recip flattening */
43 *es = pj_param(NULL,pl, "drf").f;
42 } else if (pj_param(ctx,pl, "trf").i) { /* recip flattening */
43 *es = pj_param(ctx,pl, "drf").f;
4444 if (!*es) {
4545 pj_ctx_set_errno( ctx, -10);
4646 goto bomb;
4747 }
4848 *es = 1./ *es;
4949 *es = *es * (2. - *es);
50 } else if (pj_param(NULL,pl, "tf").i) { /* flattening */
51 *es = pj_param(NULL,pl, "df").f;
50 } else if (pj_param(ctx,pl, "tf").i) { /* flattening */
51 *es = pj_param(ctx,pl, "df").f;
5252 *es = *es * (2. - *es);
53 } else if (pj_param(NULL,pl, "tb").i) { /* minor axis */
54 b = pj_param(NULL,pl, "db").f;
53 } else if (pj_param(ctx,pl, "tb").i) { /* minor axis */
54 b = pj_param(ctx,pl, "db").f;
5555 *es = 1. - (b * b) / (*a * *a);
5656 } /* else *es == 0. and sphere of radius *a */
5757 if (!b)
5858 b = *a * sqrt(1. - *es);
5959 /* following options turn ellipsoid into equivalent sphere */
60 if (pj_param(NULL,pl, "bR_A").i) { /* sphere--area of ellipsoid */
60 if (pj_param(ctx,pl, "bR_A").i) { /* sphere--area of ellipsoid */
6161 *a *= 1. - *es * (SIXTH + *es * (RA4 + *es * RA6));
6262 *es = 0.;
63 } else if (pj_param(NULL,pl, "bR_V").i) { /* sphere--vol. of ellipsoid */
63 } else if (pj_param(ctx,pl, "bR_V").i) { /* sphere--vol. of ellipsoid */
6464 *a *= 1. - *es * (SIXTH + *es * (RV4 + *es * RV6));
6565 *es = 0.;
66 } else if (pj_param(NULL,pl, "bR_a").i) { /* sphere--arithmetic mean */
66 } else if (pj_param(ctx,pl, "bR_a").i) { /* sphere--arithmetic mean */
6767 *a = .5 * (*a + b);
6868 *es = 0.;
69 } else if (pj_param(NULL,pl, "bR_g").i) { /* sphere--geometric mean */
69 } else if (pj_param(ctx,pl, "bR_g").i) { /* sphere--geometric mean */
7070 *a = sqrt(*a * b);
7171 *es = 0.;
72 } else if (pj_param(NULL,pl, "bR_h").i) { /* sphere--harmonic mean */
72 } else if (pj_param(ctx,pl, "bR_h").i) { /* sphere--harmonic mean */
7373 *a = 2. * *a * b / (*a + b);
7474 *es = 0.;
75 } else if ((i = pj_param(NULL,pl, "tR_lat_a").i) || /* sphere--arith. */
76 pj_param(NULL,pl, "tR_lat_g").i) { /* or geom. mean at latitude */
75 } else if ((i = pj_param(ctx,pl, "tR_lat_a").i) || /* sphere--arith. */
76 pj_param(ctx,pl, "tR_lat_g").i) { /* or geom. mean at latitude */
7777 double tmp;
7878
79 tmp = sin(pj_param(NULL,pl, i ? "rR_lat_a" : "rR_lat_g").f);
79 tmp = sin(pj_param(ctx,pl, i ? "rR_lat_a" : "rR_lat_g").f);
8080 if (fabs(tmp) > HALFPI) {
8181 pj_ctx_set_errno(ctx,-11);
8282 goto bomb;
1818 "bess_nam", "a=6377483.865", "rf=299.1528128", "Bessel 1841 (Namibia)",
1919 "clrk66", "a=6378206.4", "b=6356583.8", "Clarke 1866",
2020 "clrk80", "a=6378249.145", "rf=293.4663", "Clarke 1880 mod.",
21 "clrk80ign","a=6378249.2", "rf=293.4660212936269", "Clarke 1880 (IGN).",
2122 "CPM", "a=6375738.7", "rf=334.29", "Comm. des Poids et Mesures 1799",
2223 "delmbr", "a=6376428.", "rf=311.5", "Delambre 1810 (Belgium)",
2324 "engelis", "a=6378136.05", "rf=298.2566", "Engelis 1985",
0 /******************************************************************************
1 * $Id$
2 *
3 * Project: PROJ.4
4 * Purpose: Implementation of the pj_ctx_* file api, and the default stdio
5 * based implementation.
6 * Author: Frank Warmerdam, warmerdam@pobox.com
7 *
8 ******************************************************************************
9 * Copyright (c) 2013, Frank Warmerdam
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the "Software"),
13 * to deal in the Software without restriction, including without limitation
14 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 * and/or sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 * DEALINGS IN THE SOFTWARE.
28 *****************************************************************************/
29
30 #include <projects.h>
31 #include <string.h>
32
33 PJ_CVSID("$Id$");
34
35 static PAFile pj_stdio_fopen(projCtx ctx, const char *filename,
36 const char *access);
37 static size_t pj_stdio_fread(void *buffer, size_t size, size_t nmemb,
38 PAFile file);
39 static int pj_stdio_fseek(PAFile file, long offset, int whence);
40 static long pj_stdio_ftell(PAFile file);
41 static void pj_stdio_fclose(PAFile file);
42
43 static projFileAPI default_fileapi = {
44 pj_stdio_fopen,
45 pj_stdio_fread,
46 pj_stdio_fseek,
47 pj_stdio_ftell,
48 pj_stdio_fclose
49 };
50
51 typedef struct {
52 projCtx ctx;
53 FILE *fp;
54 } stdio_pafile;
55
56 /************************************************************************/
57 /* pj_get_default_fileapi() */
58 /************************************************************************/
59
60 projFileAPI *pj_get_default_fileapi()
61 {
62 return &default_fileapi;
63 }
64
65 /************************************************************************/
66 /* pj_stdio_fopen() */
67 /************************************************************************/
68
69 static PAFile pj_stdio_fopen(projCtx ctx, const char *filename,
70 const char *access)
71 {
72 stdio_pafile *pafile;
73 FILE *fp;
74
75 fp = fopen(filename, access);
76 if (fp == NULL)
77 {
78 return NULL;
79 }
80
81 pafile = (stdio_pafile *) malloc(sizeof(stdio_pafile));
82 pafile->fp = fp;
83 pafile->ctx = ctx;
84 return (PAFile) pafile;
85 }
86
87 /************************************************************************/
88 /* pj_stdio_fread() */
89 /************************************************************************/
90
91 static size_t pj_stdio_fread(void *buffer, size_t size, size_t nmemb,
92 PAFile file)
93 {
94 stdio_pafile *pafile = (stdio_pafile *) file;
95 return fread(buffer, size, nmemb, pafile->fp);
96 }
97
98 /************************************************************************/
99 /* pj_stdio_fseek() */
100 /************************************************************************/
101 static int pj_stdio_fseek(PAFile file, long offset, int whence)
102 {
103 stdio_pafile *pafile = (stdio_pafile *) file;
104 return fseek(pafile->fp, offset, whence);
105 }
106
107 /************************************************************************/
108 /* pj_stdio_ftell() */
109 /************************************************************************/
110 static long pj_stdio_ftell(PAFile file)
111 {
112 stdio_pafile *pafile = (stdio_pafile *) file;
113 return ftell(pafile->fp);
114 }
115
116 /************************************************************************/
117 /* pj_stdio_fclose() */
118 /************************************************************************/
119 static void pj_stdio_fclose(PAFile file)
120 {
121 stdio_pafile *pafile = (stdio_pafile *) file;
122 fclose(pafile->fp);
123 free(pafile);
124 }
125
126 /************************************************************************/
127 /* pj_ctx_fopen() */
128 /* */
129 /* Open a file using the provided file io hooks. */
130 /************************************************************************/
131
132 PAFile pj_ctx_fopen(projCtx ctx, const char *filename, const char *access)
133 {
134 return ctx->fileapi->FOpen(ctx, filename, access);
135 }
136
137 /************************************************************************/
138 /* pj_ctx_fread() */
139 /************************************************************************/
140 size_t pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file)
141 {
142 return ctx->fileapi->FRead(buffer, size, nmemb, file);
143 }
144
145 /************************************************************************/
146 /* pj_ctx_fseek() */
147 /************************************************************************/
148 int pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence)
149 {
150 return ctx->fileapi->FSeek(file, offset, whence);
151 }
152
153 /************************************************************************/
154 /* pj_ctx_ftell() */
155 /************************************************************************/
156 long pj_ctx_ftell(projCtx ctx, PAFile file)
157 {
158 return ctx->fileapi->FTell(file);
159 }
160
161 /************************************************************************/
162 /* pj_ctx_fclose() */
163 /************************************************************************/
164 void pj_ctx_fclose(projCtx ctx, PAFile file)
165 {
166 ctx->fileapi->FClose(file);
167 }
168
169 /************************************************************************/
170 /* pj_ctx_fgets() */
171 /* */
172 /* A not very optimal implementation of fgets on top of */
173 /* fread(). If we end up using this a lot more care should be */
174 /* taken. */
175 /************************************************************************/
176
177 char *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file)
178 {
179 long start = pj_ctx_ftell(ctx, file);
180 size_t bytes_read;
181 int i;
182
183 line[size-1] = '\0';
184 bytes_read = pj_ctx_fread(ctx, line, 1, size-1, file);
185 if(bytes_read == 0)
186 return NULL;
187 if(bytes_read < size)
188 {
189 line[bytes_read] = '\0';
190 }
191
192 for( i = 0; i < size-2; i++)
193 {
194 if (line[i] == '\n')
195 {
196 line[i+1] = '\0';
197 pj_ctx_fseek(ctx, file, start + i + 1, SEEK_SET);
198 break;
199 }
200 }
201 return line;
202 }
3030
3131 #include <projects.h>
3232 #include <string.h>
33
34 static int pj_gc_readentry( projCtx ctx, FILE *fp, PJ_GridCatalogEntry *entry );
33 #include <ctype.h>
34
35 static int pj_gc_readentry(projCtx ctx, PAFile fid, PJ_GridCatalogEntry *entry);
3536 static void pj_gc_sortcatalog( projCtx ctx, PJ_GridCatalog *catalog );
3637
3738 /************************************************************************/
4243
4344 PJ_GridCatalog *pj_gc_readcatalog( projCtx ctx, const char *catalog_name )
4445 {
45 FILE *fp;
46 PAFile fid;
4647 PJ_GridCatalog *catalog;
47 int entry_max, err;
48 int entry_max;
4849 char line[302];
4950
50 fp = pj_open_lib( ctx, (char *) catalog_name, "r" );
51 if (fp == NULL)
51 fid = pj_open_lib( ctx, (char *) catalog_name, "r" );
52 if (fid == NULL)
5253 return NULL;
5354
5455 /* discard title line */
55 fgets(line, sizeof(line)-1, fp);
56 pj_ctx_fgets(ctx, line, sizeof(line)-1, fid);
5657
5758 catalog = (PJ_GridCatalog *) calloc(1,sizeof(PJ_GridCatalog));
5859 if( !catalog )
6465 catalog->entries = (PJ_GridCatalogEntry *)
6566 malloc(entry_max * sizeof(PJ_GridCatalogEntry));
6667
67 while( pj_gc_readentry( ctx, fp,
68 while( pj_gc_readentry( ctx, fid,
6869 catalog->entries+catalog->entry_count) == 0)
6970 {
7071 catalog->entry_count++;
104105 /* token count. */
105106 /************************************************************************/
106107
107 static int pj_gc_read_csv_line( projCtx ctx, FILE *fp,
108 static int pj_gc_read_csv_line( projCtx ctx, PAFile fid,
108109 char **tokens, int max_tokens )
109110 {
110111 char line[302];
111112
112 while( fgets(line, sizeof(line)-1, fp) != NULL )
113 while( pj_ctx_fgets(ctx, line, sizeof(line)-1, fid) != NULL )
113114 {
114115 char *next = line;
115116 int token_count = 0;
179180 /* gridname,ll_long,ll_lat,ur_long,ur_lat,priority,date */
180181 /************************************************************************/
181182
182 static int pj_gc_readentry( projCtx ctx, FILE *fp, PJ_GridCatalogEntry *entry )
183 static int pj_gc_readentry(projCtx ctx, PAFile fid, PJ_GridCatalogEntry *entry)
183184 {
184185 #define MAX_TOKENS 30
185186 char *tokens[MAX_TOKENS];
188189
189190 memset( entry, 0, sizeof(PJ_GridCatalogEntry) );
190191
191 token_count = pj_gc_read_csv_line( ctx, fp, tokens, MAX_TOKENS );
192 token_count = pj_gc_read_csv_line( ctx, fid, tokens, MAX_TOKENS );
192193 if( token_count < 5 )
193194 {
194195 error = 1; /* TODO: need real error codes */
118118 {
119119 long io = i * point_offset;
120120 LP input, output_after, output_before;
121 int itable;
122121 double mix_ratio;
123122 PJ_GRIDINFO *gi;
124123
00 /******************************************************************************
1 * $Id: pj_gridinfo.c 2142 2012-01-25 19:23:31Z warmerdam $
1 * $Id: pj_gridinfo.c 2548 2014-09-17 06:21:09Z warmerdam $
22 *
33 * Project: PROJ.4
44 * Purpose: Functions for handling individual PJ_GRIDINFO's. Includes
4040 * TODO - mloskot: re-implement porting friendly assert
4141 */
4242 # define assert(exp) ((void)0)
43 #else
43 #else/
4444 # include <assert.h>
4545 #endif /* _WIN32_WCE */
4646
6161 for( word = 0; word < word_count; word++ )
6262 {
6363 int i;
64
64
6565 for( i = 0; i < word_size/2; i++ )
6666 {
6767 int t;
68
68
6969 t = data[i];
7070 data[i] = data[word_size-i-1];
7171 data[word_size-i-1] = t;
7272 }
73
73
7474 data += word_size;
7575 }
7676 }
9898
9999 if( gi->ct != NULL )
100100 nad_free( gi->ct );
101
101
102102 free( gi->gridname );
103103 if( gi->filename != NULL )
104104 free( gi->filename );
117117 int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi )
118118
119119 {
120 struct CTABLE ct_tmp;
121
120122 if( gi == NULL || gi->ct == NULL )
121123 return 0;
122124
125 pj_acquire_lock();
126 if( gi->ct->cvs != NULL )
127 {
128 pj_release_lock();
129 return 1;
130 }
131
132 memcpy(&ct_tmp, gi->ct, sizeof(struct CTABLE));
133
123134 /* -------------------------------------------------------------------- */
124135 /* Original platform specific CTable format. */
125136 /* -------------------------------------------------------------------- */
126137 if( strcmp(gi->format,"ctable") == 0 )
127138 {
128 FILE *fid;
139 PAFile fid;
129140 int result;
130141
131142 fid = pj_open_lib( ctx, gi->filename, "rb" );
132
143
133144 if( fid == NULL )
134145 {
135146 pj_ctx_set_errno( ctx, -38 );
136 return 0;
137 }
138
139 result = nad_ctable_load( ctx, gi->ct, fid );
140
141 fclose( fid );
147 pj_release_lock();
148 return 0;
149 }
150
151 result = nad_ctable_load( ctx, &ct_tmp, fid );
152
153 pj_ctx_fclose( ctx, fid );
154
155 gi->ct->cvs = ct_tmp.cvs;
156 pj_release_lock();
142157
143158 return result;
144159 }
148163 /* -------------------------------------------------------------------- */
149164 else if( strcmp(gi->format,"ctable2") == 0 )
150165 {
151 FILE *fid;
166 PAFile fid;
152167 int result;
153168
154169 fid = pj_open_lib( ctx, gi->filename, "rb" );
155
170
156171 if( fid == NULL )
157172 {
158173 pj_ctx_set_errno( ctx, -38 );
159 return 0;
160 }
161
162 result = nad_ctable2_load( ctx, gi->ct, fid );
163
164 fclose( fid );
165
174 pj_release_lock();
175 return 0;
176 }
177
178 result = nad_ctable2_load( ctx, &ct_tmp, fid );
179
180 pj_ctx_fclose( ctx, fid );
181
182 gi->ct->cvs = ct_tmp.cvs;
183
184 pj_release_lock();
166185 return result;
167186 }
168187
177196 {
178197 double *row_buf;
179198 int row;
180 FILE *fid;
199 PAFile fid;
181200
182201 fid = pj_open_lib( ctx, gi->filename, "rb" );
183
202
184203 if( fid == NULL )
185204 {
186205 pj_ctx_set_errno( ctx, -38 );
187 return 0;
188 }
189
190 fseek( fid, gi->grid_offset, SEEK_SET );
206 pj_release_lock();
207 return 0;
208 }
209
210 pj_ctx_fseek( ctx, fid, gi->grid_offset, SEEK_SET );
191211
192212 row_buf = (double *) pj_malloc(gi->ct->lim.lam * sizeof(double) * 2);
193 gi->ct->cvs = (FLP *) pj_malloc(gi->ct->lim.lam*gi->ct->lim.phi*sizeof(FLP));
194 if( row_buf == NULL || gi->ct->cvs == NULL )
195 {
196 pj_ctx_set_errno( ctx, -38 );
197 return 0;
198 }
199
213 ct_tmp.cvs = (FLP *) pj_malloc(gi->ct->lim.lam*gi->ct->lim.phi*sizeof(FLP));
214 if( row_buf == NULL || ct_tmp.cvs == NULL )
215 {
216 pj_ctx_set_errno( ctx, -38 );
217 pj_release_lock();
218 return 0;
219 }
220
200221 for( row = 0; row < gi->ct->lim.phi; row++ )
201222 {
202223 int i;
203224 FLP *cvs;
204225 double *diff_seconds;
205226
206 if( fread( row_buf, sizeof(double), gi->ct->lim.lam * 2, fid )
227 if( pj_ctx_fread( ctx, row_buf,
228 sizeof(double), gi->ct->lim.lam * 2, fid )
207229 != 2 * gi->ct->lim.lam )
208230 {
209231 pj_dalloc( row_buf );
210 pj_dalloc( gi->ct->cvs );
232 pj_dalloc( ct_tmp.cvs );
211233 pj_ctx_set_errno( ctx, -38 );
212234 return 0;
213235 }
220242
221243 for( i = 0; i < gi->ct->lim.lam; i++ )
222244 {
223 cvs = gi->ct->cvs + (row) * gi->ct->lim.lam
245 cvs = ct_tmp.cvs + (row) * gi->ct->lim.lam
224246 + (gi->ct->lim.lam - i - 1);
225247
226248 cvs->phi = *(diff_seconds++) * ((PI/180.0) / 3600.0);
230252
231253 pj_dalloc( row_buf );
232254
233 fclose( fid );
255 pj_ctx_fclose( ctx, fid );
256
257 gi->ct->cvs = ct_tmp.cvs;
258 pj_release_lock();
234259
235260 return 1;
236261 }
246271 {
247272 float *row_buf;
248273 int row;
249 FILE *fid;
250
251 pj_log( ctx, PJ_LOG_DEBUG_MINOR,
274 PAFile fid;
275
276 pj_log( ctx, PJ_LOG_DEBUG_MINOR,
252277 "NTv2 - loading grid %s", gi->ct->id );
253278
254279 fid = pj_open_lib( ctx, gi->filename, "rb" );
255
280
256281 if( fid == NULL )
257282 {
258283 pj_ctx_set_errno( ctx, -38 );
259 return 0;
260 }
261
262 fseek( fid, gi->grid_offset, SEEK_SET );
284 pj_release_lock();
285 return 0;
286 }
287
288 pj_ctx_fseek( ctx, fid, gi->grid_offset, SEEK_SET );
263289
264290 row_buf = (float *) pj_malloc(gi->ct->lim.lam * sizeof(float) * 4);
265 gi->ct->cvs = (FLP *) pj_malloc(gi->ct->lim.lam*gi->ct->lim.phi*sizeof(FLP));
266 if( row_buf == NULL || gi->ct->cvs == NULL )
267 {
268 pj_ctx_set_errno( ctx, -38 );
269 return 0;
270 }
271
291 ct_tmp.cvs = (FLP *) pj_malloc(gi->ct->lim.lam*gi->ct->lim.phi*sizeof(FLP));
292 if( row_buf == NULL || ct_tmp.cvs == NULL )
293 {
294 pj_ctx_set_errno( ctx, -38 );
295 pj_release_lock();
296 return 0;
297 }
298
272299 for( row = 0; row < gi->ct->lim.phi; row++ )
273300 {
274301 int i;
275302 FLP *cvs;
276303 float *diff_seconds;
277304
278 if( fread( row_buf, sizeof(float), gi->ct->lim.lam*4, fid )
305 if( pj_ctx_fread( ctx, row_buf, sizeof(float),
306 gi->ct->lim.lam*4, fid )
279307 != 4 * gi->ct->lim.lam )
280308 {
281309 pj_dalloc( row_buf );
282 pj_dalloc( gi->ct->cvs );
283 gi->ct->cvs = NULL;
310 pj_dalloc( ct_tmp.cvs );
284311 pj_ctx_set_errno( ctx, -38 );
312 pj_release_lock();
285313 return 0;
286314 }
287315
288316 if( !IS_LSB )
289 swap_words( (unsigned char *) row_buf, 4,
317 swap_words( (unsigned char *) row_buf, 4,
290318 gi->ct->lim.lam*4 );
291319
292320 /* convert seconds to radians */
294322
295323 for( i = 0; i < gi->ct->lim.lam; i++ )
296324 {
297 cvs = gi->ct->cvs + (row) * gi->ct->lim.lam
325 cvs = ct_tmp.cvs + (row) * gi->ct->lim.lam
298326 + (gi->ct->lim.lam - i - 1);
299327
300328 cvs->phi = *(diff_seconds++) * ((PI/180.0) / 3600.0);
305333
306334 pj_dalloc( row_buf );
307335
308 fclose( fid );
309
336 pj_ctx_fclose( ctx, fid );
337
338 gi->ct->cvs = ct_tmp.cvs;
339
340 pj_release_lock();
310341 return 1;
311342 }
312343
316347 else if( strcmp(gi->format,"gtx") == 0 )
317348 {
318349 int words = gi->ct->lim.lam * gi->ct->lim.phi;
319 FILE *fid;
350 PAFile fid;
320351
321352 fid = pj_open_lib( ctx, gi->filename, "rb" );
322
353
323354 if( fid == NULL )
324355 {
325356 pj_ctx_set_errno( ctx, -38 );
326 return 0;
327 }
328
329 fseek( fid, gi->grid_offset, SEEK_SET );
330
331 gi->ct->cvs = (FLP *) pj_malloc(words*sizeof(float));
332 if( gi->ct->cvs == NULL )
333 {
334 pj_ctx_set_errno( ctx, -38 );
335 return 0;
336 }
337
338 if( fread( gi->ct->cvs, sizeof(float), words, fid ) != words )
339 {
340 pj_dalloc( gi->ct->cvs );
341 gi->ct->cvs = NULL;
357 pj_release_lock();
358 return 0;
359 }
360
361 pj_ctx_fseek( ctx, fid, gi->grid_offset, SEEK_SET );
362
363 ct_tmp.cvs = (FLP *) pj_malloc(words*sizeof(float));
364 if( ct_tmp.cvs == NULL )
365 {
366 pj_ctx_set_errno( ctx, -38 );
367 pj_release_lock();
368 return 0;
369 }
370
371 if( pj_ctx_fread( ctx, ct_tmp.cvs, sizeof(float), words, fid )
372 != words )
373 {
374 pj_dalloc( ct_tmp.cvs );
375 pj_release_lock();
342376 return 0;
343377 }
344378
345379 if( IS_LSB )
346 swap_words( (unsigned char *) gi->ct->cvs, 4, words );
347
348 fclose( fid );
380 swap_words( (unsigned char *) ct_tmp.cvs, 4, words );
381
382 pj_ctx_fclose( ctx, fid );
383 gi->ct->cvs = ct_tmp.cvs;
384 pj_release_lock();
349385 return 1;
350386 }
351387
352388 else
353389 {
390 pj_release_lock();
354391 return 0;
355392 }
393 }
394
395 /************************************************************************/
396 /* pj_gridinfo_init_ntv2() */
397 /* */
398 /* Seek a parent grid file by name from a grid list */
399 /************************************************************************/
400
401 static PJ_GRIDINFO* pj_gridinfo_parent( PJ_GRIDINFO *gilist,
402 const char *name, int length )
403 {
404 while( gilist )
405 {
406 if( strncmp(gilist->ct->id,name,length) == 0 ) return gilist;
407 if( gilist->child )
408 {
409 PJ_GRIDINFO *parent=pj_gridinfo_parent( gilist->child, name, length );
410 if( parent ) return parent;
411 }
412 gilist=gilist->next;
413 }
414 return gilist;
356415 }
357416
358417 /************************************************************************/
361420 /* Load a ntv2 (.gsb) file. */
362421 /************************************************************************/
363422
364 static int pj_gridinfo_init_ntv2( projCtx ctx, FILE *fid, PJ_GRIDINFO *gilist )
365
423 static int pj_gridinfo_init_ntv2( projCtx ctx, PAFile fid, PJ_GRIDINFO *gilist )
366424 {
367425 unsigned char header[11*16];
368426 int num_subfiles, subfile;
380438 /* -------------------------------------------------------------------- */
381439 /* Read the overview header. */
382440 /* -------------------------------------------------------------------- */
383 if( fread( header, sizeof(header), 1, fid ) != 1 )
441 if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
384442 {
385443 pj_ctx_set_errno( ctx, -38 );
386444 return 0;
418476 /* -------------------------------------------------------------------- */
419477 /* Read header. */
420478 /* -------------------------------------------------------------------- */
421 if( fread( header, sizeof(header), 1, fid ) != 1 )
479 if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
422480 {
423481 pj_ctx_set_errno( ctx, -38 );
424482 return 0;
429487 pj_ctx_set_errno( ctx, -38 );
430488 return 0;
431489 }
432
490
433491 /* -------------------------------------------------------------------- */
434492 /* Byte swap interesting fields if needed. */
435493 /* -------------------------------------------------------------------- */
443501 swap_words( header+8+16*9, 8, 1 );
444502 swap_words( header+8+16*10, 4, 1 );
445503 }
446
504
447505 /* -------------------------------------------------------------------- */
448506 /* Initialize a corresponding "ct" structure. */
449507 /* -------------------------------------------------------------------- */
465523
466524 pj_log( ctx, PJ_LOG_DEBUG_MINOR,
467525 "NTv2 %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n",
468 ct->id,
526 ct->id,
469527 ct->lim.lam, ct->lim.phi,
470528 ct->ll.lam/3600.0, ct->ll.phi/3600.0,
471529 ur.lam/3600.0, ur.phi/3600.0 );
472
530
473531 ct->ll.lam *= DEG_TO_RAD/3600.0;
474532 ct->ll.phi *= DEG_TO_RAD/3600.0;
475533 ct->del.lam *= DEG_TO_RAD/3600.0;
480538 {
481539 pj_log( ctx, PJ_LOG_ERROR,
482540 "GS_COUNT(%d) does not match expected cells (%dx%d=%d)\n",
483 gs_count, ct->lim.lam, ct->lim.phi,
541 gs_count, ct->lim.lam, ct->lim.phi,
484542 ct->lim.lam * ct->lim.phi );
485543 pj_ctx_set_errno( ctx, -38 );
486544 return 0;
498556 {
499557 gi = (PJ_GRIDINFO *) pj_malloc(sizeof(PJ_GRIDINFO));
500558 memset( gi, 0, sizeof(PJ_GRIDINFO) );
501
559
502560 gi->gridname = strdup( gilist->gridname );
503561 gi->filename = strdup( gilist->filename );
504562 gi->next = NULL;
506564
507565 gi->ct = ct;
508566 gi->format = "ntv2";
509 gi->grid_offset = ftell( fid );
567 gi->grid_offset = pj_ctx_ftell( ctx, fid );
510568
511569 /* -------------------------------------------------------------------- */
512570 /* Attach to the correct list or sublist. */
525583 else
526584 {
527585 PJ_GRIDINFO *lnk;
528 PJ_GRIDINFO *gp = gilist;
529
530 while( gp != NULL
531 && strncmp(gp->ct->id,(const char*)header+24,8) != 0 )
532 gp = gp->next;
586 PJ_GRIDINFO *gp = pj_gridinfo_parent(gilist,
587 (const char*)header+24,8);
533588
534589 if( gp == NULL )
535590 {
536591 pj_log( ctx, PJ_LOG_ERROR,
537592 "pj_gridinfo_init_ntv2(): "
538 "failed to find parent %8.8s for %s.\n",
593 "failed to find parent %8.8s for %s.\n",
539594 (const char *) header+24, gi->ct->id );
540595
541 for( lnk = gp; lnk->next != NULL; lnk = lnk->next ) {}
596 for( lnk = gilist; lnk->next != NULL; lnk = lnk->next ) {}
542597 lnk->next = gi;
543 }
544 else if( gp->child == NULL )
545 {
546 gp->child = gi;
547598 }
548599 else
549600 {
550 for( lnk = gp->child; lnk->next != NULL; lnk = lnk->next ) {}
551 lnk->next = gi;
601 if( gp->child == NULL )
602 {
603 gp->child = gi;
604 }
605 else
606 {
607 for( lnk = gp->child; lnk->next != NULL; lnk = lnk->next ) {}
608 lnk->next = gi;
609 }
552610 }
553611 }
554612
555613 /* -------------------------------------------------------------------- */
556614 /* Seek past the data. */
557615 /* -------------------------------------------------------------------- */
558 fseek( fid, gs_count * 16, SEEK_CUR );
616 pj_ctx_fseek( ctx, fid, gs_count * 16, SEEK_CUR );
559617 }
560618
561619 return 1;
567625 /* Load an NTv1 style Canadian grid shift file. */
568626 /************************************************************************/
569627
570 static int pj_gridinfo_init_ntv1( projCtx ctx, FILE * fid, PJ_GRIDINFO *gi )
628 static int pj_gridinfo_init_ntv1( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
571629
572630 {
573631 unsigned char header[176];
574632 struct CTABLE *ct;
575633 LP ur;
576
634
577635 assert( sizeof(int) == 4 );
578636 assert( sizeof(double) == 8 );
579637 if( sizeof(int) != 4 || sizeof(double) != 8 )
587645 /* -------------------------------------------------------------------- */
588646 /* Read the header. */
589647 /* -------------------------------------------------------------------- */
590 if( fread( header, sizeof(header), 1, fid ) != 1 )
648 if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
591649 {
592650 pj_ctx_set_errno( ctx, -38 );
593651 return 0;
609667
610668 if( *((int *) (header+8)) != 12 )
611669 {
612 pj_log( ctx, PJ_LOG_ERROR,
670 pj_log( ctx, PJ_LOG_ERROR,
613671 "NTv1 grid shift file has wrong record count, corrupt?" );
614672 pj_ctx_set_errno( ctx, -38 );
615673 return 0;
642700 ct->cvs = NULL;
643701
644702 gi->ct = ct;
645 gi->grid_offset = ftell( fid );
703 gi->grid_offset = pj_ctx_ftell( ctx, fid );
646704 gi->format = "ntv1";
647705
648706 return 1;
654712 /* Load a NOAA .gtx vertical datum shift file. */
655713 /************************************************************************/
656714
657 static int pj_gridinfo_init_gtx( projCtx ctx, FILE * fid, PJ_GRIDINFO *gi )
715 static int pj_gridinfo_init_gtx( projCtx ctx, PAFile fid, PJ_GRIDINFO *gi )
658716
659717 {
660718 unsigned char header[40];
675733 /* -------------------------------------------------------------------- */
676734 /* Read the header. */
677735 /* -------------------------------------------------------------------- */
678 if( fread( header, sizeof(header), 1, fid ) != 1 )
736 if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 )
679737 {
680738 pj_ctx_set_errno( ctx, -38 );
681739 return 0;
698756 memcpy( &rows, header+32, 4 );
699757 memcpy( &columns, header+36, 4 );
700758
701 if( xorigin < -360 || xorigin > 360
759 if( xorigin < -360 || xorigin > 360
702760 || yorigin < -90 || yorigin > 90 )
703761 {
704 pj_log( ctx, PJ_LOG_ERROR,
762 pj_log( ctx, PJ_LOG_ERROR,
705763 "gtx file header has invalid extents, corrupt?");
706764 pj_ctx_set_errno( ctx, -38 );
707765 return 0;
721779 ct->lim.phi = rows;
722780
723781 /* some GTX files come in 0-360 and we shift them back into the
724 expected -180 to 180 range if possible. This does not solve
782 expected -180 to 180 range if possible. This does not solve
725783 problems with grids spanning the dateline. */
726784 if( ct->ll.lam >= 180.0 )
727785 ct->ll.lam -= 360.0;
735793 pj_log( ctx, PJ_LOG_DEBUG_MINOR,
736794 "GTX %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)",
737795 ct->lim.lam, ct->lim.phi,
738 ct->ll.lam, ct->ll.phi,
796 ct->ll.lam, ct->ll.phi,
739797 ct->ll.lam + (columns-1)*xstep, ct->ll.phi + (rows-1)*ystep);
740
798
741799 ct->ll.lam *= DEG_TO_RAD;
742800 ct->ll.phi *= DEG_TO_RAD;
743801 ct->del.lam *= DEG_TO_RAD;
765823 {
766824 char fname[MAX_PATH_FILENAME+1];
767825 PJ_GRIDINFO *gilist;
768 FILE *fp;
826 PAFile fp;
769827 char header[160];
770828
771829 errno = pj_errno = 0;
777835 /* -------------------------------------------------------------------- */
778836 gilist = (PJ_GRIDINFO *) pj_malloc(sizeof(PJ_GRIDINFO));
779837 memset( gilist, 0, sizeof(PJ_GRIDINFO) );
780
838
781839 gilist->gridname = strdup( gridname );
782840 gilist->filename = NULL;
783841 gilist->format = "missing";
795853 }
796854
797855 gilist->filename = strdup(fname);
798
856
799857 /* -------------------------------------------------------------------- */
800858 /* Load a header, to determine the file type. */
801859 /* -------------------------------------------------------------------- */
802 if( fread( header, sizeof(header), 1, fp ) != 1 )
803 {
804 fclose( fp );
860 if( pj_ctx_fread( ctx, header, sizeof(header), 1, fp ) != 1 )
861 {
862 pj_ctx_fclose( ctx, fp );
805863 pj_ctx_set_errno( ctx, -38 );
806864 return gilist;
807865 }
808866
809 fseek( fp, SEEK_SET, 0 );
867 pj_ctx_fseek( ctx, fp, SEEK_SET, 0 );
810868
811869 /* -------------------------------------------------------------------- */
812870 /* Determine file type. */
813871 /* -------------------------------------------------------------------- */
814 if( strncmp(header + 0, "HEADER", 6) == 0
815 && strncmp(header + 96, "W GRID", 6) == 0
872 if( strncmp(header + 0, "HEADER", 6) == 0
873 && strncmp(header + 96, "W GRID", 6) == 0
816874 && strncmp(header + 144, "TO NAD83 ", 16) == 0 )
817875 {
818876 pj_gridinfo_init_ntv1( ctx, fp, gilist );
819877 }
820
821 else if( strncmp(header + 0, "NUM_OREC", 8) == 0
878
879 else if( strncmp(header + 0, "NUM_OREC", 8) == 0
822880 && strncmp(header + 48, "GS_TYPE", 7) == 0 )
823881 {
824882 pj_gridinfo_init_ntv2( ctx, fp, gilist );
825883 }
826884
827 else if( strlen(gridname) > 4
828 && (strcmp(gridname+strlen(gridname)-3,"gtx") == 0
885 else if( strlen(gridname) > 4
886 && (strcmp(gridname+strlen(gridname)-3,"gtx") == 0
829887 || strcmp(gridname+strlen(gridname)-3,"GTX") == 0) )
830888 {
831889 pj_gridinfo_init_gtx( ctx, fp, gilist );
838896 gilist->format = "ctable2";
839897 gilist->ct = ct;
840898
841 pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
899 pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
842900 "Ctable2 %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n",
843 ct->id,
901 ct->id,
844902 ct->lim.lam, ct->lim.phi,
845903 ct->ll.lam * RAD_TO_DEG, ct->ll.phi * RAD_TO_DEG,
846 (ct->ll.lam + (ct->lim.lam-1)*ct->del.lam) * RAD_TO_DEG,
904 (ct->ll.lam + (ct->lim.lam-1)*ct->del.lam) * RAD_TO_DEG,
847905 (ct->ll.phi + (ct->lim.phi-1)*ct->del.phi) * RAD_TO_DEG );
848906 }
849907
850908 else
851909 {
852910 struct CTABLE *ct = nad_ctable_init( ctx, fp );
853
854 gilist->format = "ctable";
855 gilist->ct = ct;
856
857 pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
858 "Ctable %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n",
859 ct->id,
860 ct->lim.lam, ct->lim.phi,
861 ct->ll.lam * RAD_TO_DEG, ct->ll.phi * RAD_TO_DEG,
862 (ct->ll.lam + (ct->lim.lam-1)*ct->del.lam) * RAD_TO_DEG,
863 (ct->ll.phi + (ct->lim.phi-1)*ct->del.phi) * RAD_TO_DEG );
864 }
865
866 fclose(fp);
911 if (ct == NULL)
912 {
913 pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
914 "CTABLE ct is NULL.");
915 } else
916 {
917 gilist->format = "ctable";
918 gilist->ct = ct;
919
920 pj_log( ctx, PJ_LOG_DEBUG_MAJOR,
921 "Ctable %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n",
922 ct->id,
923 ct->lim.lam, ct->lim.phi,
924 ct->ll.lam * RAD_TO_DEG, ct->ll.phi * RAD_TO_DEG,
925 (ct->ll.lam + (ct->lim.lam-1)*ct->del.lam) * RAD_TO_DEG,
926 (ct->ll.phi + (ct->lim.phi-1)*ct->del.phi) * RAD_TO_DEG );
927 }
928 }
929
930 pj_ctx_fclose(ctx, fp);
867931
868932 return gilist;
869933 }
00 /******************************************************************************
1 * $Id: pj_init.c 2305 2012-12-18 00:31:55Z warmerdam $
1 * $Id: pj_init.c 2482 2014-08-18 22:43:04Z hobu $
22 *
33 * Project: PROJ.4
44 * Purpose: Initialize projection object from string definition. Includes
3434 #include <string.h>
3535 #include <errno.h>
3636 #include <locale.h>
37
38 PJ_CVSID("$Id: pj_init.c 2305 2012-12-18 00:31:55Z warmerdam $");
37 #include <ctype.h>
38
39 PJ_CVSID("$Id: pj_init.c 2482 2014-08-18 22:43:04Z hobu $");
40
41 typedef struct {
42 projCtx ctx;
43 PAFile fid;
44 char buffer[8193];
45 int buffer_filled;
46 int at_eof;
47 } pj_read_state;
48
49 /************************************************************************/
50 /* fill_buffer() */
51 /************************************************************************/
52
53 static const char *fill_buffer(pj_read_state *state, const char *last_char)
54 {
55 size_t bytes_read;
56 int char_remaining, char_requested;
57
58 /* -------------------------------------------------------------------- */
59 /* Don't bother trying to read more if we are at eof, or if the */
60 /* buffer is still over half full. */
61 /* -------------------------------------------------------------------- */
62 if (last_char == NULL)
63 last_char = state->buffer;
64
65 if (state->at_eof)
66 return last_char;
67
68 char_remaining = state->buffer_filled - (last_char - state->buffer);
69 if (char_remaining >= sizeof(state->buffer) / 2)
70 return last_char;
71
72 /* -------------------------------------------------------------------- */
73 /* Move the existing data to the start of the buffer. */
74 /* -------------------------------------------------------------------- */
75 memmove(state->buffer, last_char, char_remaining);
76 state->buffer_filled = char_remaining;
77 last_char = state->buffer;
78
79 /* -------------------------------------------------------------------- */
80 /* Refill. */
81 /* -------------------------------------------------------------------- */
82 char_requested = sizeof(state->buffer) - state->buffer_filled - 1;
83 bytes_read = pj_ctx_fread( state->ctx, state->buffer + state->buffer_filled,
84 1, char_requested, state->fid );
85 if (bytes_read < char_requested)
86 {
87 state->at_eof = 1;
88 state->buffer[state->buffer_filled + bytes_read] = '\0';
89 }
90
91 state->buffer_filled += bytes_read;
92 return last_char;
93 }
3994
4095 /************************************************************************/
4196 /* get_opt() */
4297 /************************************************************************/
4398 static paralist *
44 get_opt(projCtx ctx, paralist **start, FILE *fid, char *name, paralist *next) {
45 char sword[302], *word = sword+1;
46 int first = 1, len, c;
99 get_opt(projCtx ctx, paralist **start, PAFile fid, char *name, paralist *next,
100 int *found_def) {
101 pj_read_state *state = (pj_read_state*) calloc(1,sizeof(pj_read_state));
102 char sword[302];
103 int len;
104 int in_target = 0;
105 const char *next_char = NULL;
106
107 state->fid = fid;
108 state->ctx = ctx;
109 next_char = fill_buffer(state, NULL);
110 if(found_def)
111 *found_def = 0;
47112
48113 len = strlen(name);
49114 *sword = 't';
50 while (fscanf(fid, "%300s", word) == 1) {
51 if (*word == '#') /* skip comments */
52 while((c = fgetc(fid)) != EOF && c != '\n') ;
53 else if (*word == '<') { /* control name */
54 if (first && !strncmp(name, word + 1, len)
55 && word[len + 1] == '>')
56 first = 0;
57 else if (!first && *word == '<') {
58 while((c = fgetc(fid)) != EOF && c != '\n') ;
115
116 /* loop till we find our target keyword */
117 while (*next_char)
118 {
119 next_char = fill_buffer(state, next_char);
120
121 /* Skip white space. */
122 while( isspace(*next_char) )
123 next_char++;
124
125 next_char = fill_buffer(state, next_char);
126
127 /* for comments, skip past end of line. */
128 if( *next_char == '#' )
129 {
130 while( *next_char && *next_char != '\n' )
131 next_char++;
132
133 next_char = fill_buffer(state, next_char);
134 if (*next_char == '\n')
135 next_char++;
136 if (*next_char == '\r')
137 next_char++;
138
139 }
140
141 /* Is this our target? */
142 else if( *next_char == '<' )
143 {
144 /* terminate processing target on the next block definition */
145 if (in_target)
59146 break;
60 }
61 } else if (!first && !pj_param(ctx, *start, sword).i) {
62 /* don't default ellipse if datum, ellps or any earth model
63 information is set. */
64 if( strncmp(word,"ellps=",6) != 0
65 || (!pj_param(ctx, *start, "tdatum").i
66 && !pj_param(ctx, *start, "tellps").i
67 && !pj_param(ctx, *start, "ta").i
68 && !pj_param(ctx, *start, "tb").i
69 && !pj_param(ctx, *start, "trf").i
70 && !pj_param(ctx, *start, "tf").i) )
147
148 next_char++;
149 if (strncmp(name, next_char, len) == 0
150 && next_char[len] == '>')
71151 {
72 next = next->next = pj_mkparam(word);
73 }
74 }
75 }
152 /* skip past target word */
153 next_char += len + 1;
154 in_target = 1;
155 if(found_def)
156 *found_def = 1;
157 }
158 else
159 {
160 /* skip past end of line */
161 while( *next_char && *next_char != '\n' )
162 next_char++;
163 }
164 }
165 else if (in_target)
166 {
167 const char *start_of_word = next_char;
168 int word_len = 0;
169
170 if (*start_of_word == '+')
171 {
172 start_of_word++;
173 next_char++;
174 }
175
176 /* capture parameter */
177 while( *next_char && !isspace(*next_char) )
178 {
179 next_char++;
180 word_len++;
181 }
182
183 strncpy(sword+1, start_of_word, word_len);
184 sword[word_len+1] = '\0';
185
186 /* do not override existing parameter value of same name */
187 if (!pj_param(ctx, *start, sword).i) {
188 /* don't default ellipse if datum, ellps or any earth model
189 information is set. */
190 if( strncmp(sword+1,"ellps=",6) != 0
191 || (!pj_param(ctx, *start, "tdatum").i
192 && !pj_param(ctx, *start, "tellps").i
193 && !pj_param(ctx, *start, "ta").i
194 && !pj_param(ctx, *start, "tb").i
195 && !pj_param(ctx, *start, "trf").i
196 && !pj_param(ctx, *start, "tf").i) )
197 {
198 next = next->next = pj_mkparam(sword+1);
199 }
200 }
201
202 }
203 else
204 {
205 /* skip past word */
206 while( *next_char && !isspace(*next_char) )
207 next_char++;
208
209 }
210 }
76211
77212 if (errno == 25)
78213 errno = 0;
214
215 free(state);
216
79217 return next;
80218 }
81219
84222 /************************************************************************/
85223 static paralist *
86224 get_defaults(projCtx ctx, paralist **start, paralist *next, char *name) {
87 FILE *fid;
225 PAFile fid;
88226
89227 if ( (fid = pj_open_lib(ctx,"proj_def.dat", "rt")) != NULL) {
90 next = get_opt(ctx, start, fid, "general", next);
91 rewind(fid);
92 next = get_opt(ctx, start, fid, name, next);
93 (void)fclose(fid);
228 next = get_opt(ctx, start, fid, "general", next, NULL);
229 pj_ctx_fseek(ctx, fid, 0, SEEK_SET);
230 next = get_opt(ctx, start, fid, name, next, NULL);
231 pj_ctx_fclose(ctx, fid);
94232 }
95233 if (errno)
96234 errno = 0; /* don't care if can't open file */
103241 /* get_init() */
104242 /************************************************************************/
105243 static paralist *
106 get_init(projCtx ctx, paralist **start, paralist *next, char *name) {
244 get_init(projCtx ctx, paralist **start, paralist *next, char *name,
245 int *found_def) {
107246 char fname[MAX_PATH_FILENAME+ID_TAG_MAX+3], *opt;
108 FILE *fid;
247 PAFile fid;
109248 paralist *init_items = NULL;
110249 const paralist *orig_next = next;
111250
121260 next->next = init_items;
122261 while( next->next != NULL )
123262 next = next->next;
263 *found_def = 1;
124264 return next;
125265 }
126266
132272 else { pj_ctx_set_errno(ctx,-3); return NULL; }
133273
134274 if ( (fid = pj_open_lib(ctx,fname, "rt")) != NULL)
135 next = get_opt(ctx, start, fid, opt, next);
275 next = get_opt(ctx, start, fid, opt, next, found_def);
136276 else
137277 return NULL;
138 (void)fclose(fid);
278 pj_ctx_fclose(ctx, fid);
139279 if (errno == 25)
140280 errno = 0; /* unknown problem with some sys errno<-25 */
141281
256396 ctx->last_errno = 0;
257397 start = NULL;
258398
399 /*
400 ** MS Visual Studio 2012+ may have problems in multithreaded cases
401 ** as discussed in this ticket:
402 ** http://trac.osgeo.org/proj/ticket/226
403 */
259404 old_locale = setlocale(LC_NUMERIC, NULL);
260405 if (old_locale != NULL) {
261406 if (strcmp(old_locale,"C") != 0) {
277422 /* check if +init present */
278423 if (pj_param(ctx, start, "tinit").i) {
279424 paralist *last = curr;
280
281 if (!(curr = get_init(ctx,&start, curr, pj_param(ctx, start, "sinit").s)))
425 int found_def = 0;
426
427 if (!(curr = get_init(ctx,&start, curr,
428 pj_param(ctx, start, "sinit").s,
429 &found_def)))
282430 goto bum_call;
283 if (curr == last) { pj_ctx_set_errno( ctx, -2); goto bum_call; }
431 if (!found_def) { pj_ctx_set_errno( ctx, -2); goto bum_call; }
284432 }
285433
286434 /* find projection selection */
1515 PROJ_HEAD(bipc, "Bipolar conic of western hemisphere")
1616 PROJ_HEAD(boggs, "Boggs Eumorphic")
1717 PROJ_HEAD(bonne, "Bonne (Werner lat_1=90)")
18 PROJ_HEAD(calcofi, "Cal Coop Ocean Fish Invest Lines/Stations")
1819 PROJ_HEAD(cass, "Cassini")
1920 PROJ_HEAD(cc, "Central Cylindrical")
2021 PROJ_HEAD(cea, "Equal Area Cylindrical")
105106 PROJ_HEAD(putp6, "Putnins P6")
106107 PROJ_HEAD(putp6p, "Putnins P6'")
107108 PROJ_HEAD(qua_aut, "Quartic Authalic")
109 PROJ_HEAD(qsc, "Quadrilateralized Spherical Cube")
108110 PROJ_HEAD(robin, "Robinson")
109111 PROJ_HEAD(rouss, "Roussilhe Stereographic")
110112 PROJ_HEAD(rpoly, "Rectangular Polyconic")
4646 # define MUTEX_stub
4747 #endif
4848
49 static void pj_init_lock();
50
5149 /************************************************************************/
5250 /* ==================================================================== */
5351 /* stub mutex implementation */
9593
9694 #include "pthread.h"
9795
98 static pthread_mutex_t pj_core_lock = PTHREAD_MUTEX_INITIALIZER;
96 static pthread_mutex_t pj_precreated_lock = PTHREAD_MUTEX_INITIALIZER;
97 static pthread_mutex_t pj_core_lock;
98 static int pj_core_lock_created = 0;
9999
100100 /************************************************************************/
101101 /* pj_acquire_lock() */
105105
106106 void pj_acquire_lock()
107107 {
108 if (!pj_core_lock_created) {
109 /*
110 ** We need to ensure the core mutex is created in recursive mode
111 ** and there is no portable way of doing that using automatic
112 ** initialization so we have pj_precreated_lock only for the purpose
113 ** of protecting the creation of the core lock.
114 */
115 pthread_mutexattr_t mutex_attr;
116
117 pthread_mutex_lock( &pj_precreated_lock);
118
119 pthread_mutexattr_init(&mutex_attr);
120 #ifndef PTHREAD_MUTEX_RECURSIVE
121 pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE_NP);
122 #else
123 pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE);
124 #endif
125 pthread_mutex_init(&pj_core_lock, &mutex_attr);
126 pj_core_lock_created = 1;
127
128 pthread_mutex_unlock( &pj_precreated_lock );
129 }
130
108131 pthread_mutex_lock( &pj_core_lock);
109132 }
110133
139162 #include <windows.h>
140163
141164 static HANDLE mutex_lock = NULL;
165
166 /************************************************************************/
167 /* pj_init_lock() */
168 /************************************************************************/
169
170 static void pj_init_lock()
171
172 {
173 if( mutex_lock == NULL )
174 mutex_lock = CreateMutex( NULL, FALSE, NULL );
175 }
142176
143177 /************************************************************************/
144178 /* pj_acquire_lock() */
180214 }
181215 }
182216
183 /************************************************************************/
184 /* pj_init_lock() */
185 /************************************************************************/
186
187 static void pj_init_lock()
188
189 {
190 if( mutex_lock == NULL )
191 mutex_lock = CreateMutex( NULL, FALSE, NULL );
192 }
193
194217 #endif // def MUTEX_win32
195
00 /******************************************************************************
1 * $Id: pj_open_lib.c 2130 2011-12-15 01:20:23Z warmerdam $
1 * $Id: pj_open_lib.c 2372 2013-06-26 21:44:00Z warmerdam $
22 *
33 * Project: PROJ.4
44 * Purpose: Implementation of pj_open_lib(), and pj_set_finder(). These
3535 #include <string.h>
3636 #include <errno.h>
3737
38 PJ_CVSID("$Id: pj_open_lib.c 2130 2011-12-15 01:20:23Z warmerdam $");
38 PJ_CVSID("$Id: pj_open_lib.c 2372 2013-06-26 21:44:00Z warmerdam $");
3939
4040 static const char *(*pj_finder)(const char *) = NULL;
4141 static int path_count = 0;
9797 /* pj_open_lib() */
9898 /************************************************************************/
9999
100 FILE *
101 pj_open_lib(projCtx ctx, char *name, char *mode) {
100 PAFile
101 pj_open_lib(projCtx ctx, const char *name, const char *mode) {
102102 char fname[MAX_PATH_FILENAME+1];
103103 const char *sysname;
104 FILE *fid;
104 PAFile fid;
105105 int n = 0;
106106 int i;
107107 #ifdef WIN32
144144 } else /* just try it bare bones */
145145 sysname = name;
146146
147 if ((fid = fopen(sysname, mode)) != NULL)
147 if ((fid = pj_ctx_fopen(ctx, sysname, mode)) != NULL)
148148 errno = 0;
149149
150150 /* If none of those work and we have a search path, try it */
154154 {
155155 sprintf(fname, "%s%c%s", search_path[i], DIR_CHAR, name);
156156 sysname = fname;
157 fid = fopen (sysname, mode);
157 fid = pj_ctx_fopen(ctx, sysname, mode);
158158 }
159159 if (fid)
160160 errno = 0;
11
22 #include <projects.h>
33
4 char const pj_release[]="Rel. 4.8.0, 6 March 2012";
4 char const pj_release[]="Rel. 4.9.0, 13 September 2014";
55
66 const char *pj_get_release()
77
0 VERSION 1.2
1 EXPORTS
2 pj_init @1
3 pj_fwd @2
4 pj_inv @3
5 pj_free @4
6 pj_transform @5
7 pj_geocentric_to_geodetic @6
8 pj_geodetic_to_geocentric @7
9 pj_deallocate_grids @8
10 pj_init_plus @9
11 pj_latlong_from_proj @10
12 pj_is_latlong @11
13 pj_get_errno_ref @12
14 pj_set_finder @13
15 pj_strerrno @14
16 pj_errno @15
17 pj_get_def @16
18 pj_dalloc @17
19 pj_is_geocent @18
20 pj_get_release @19
21 pj_malloc @20
22 pj_pr_list @21
23 pj_compare_datums @22
24 pj_apply_gridshift @23
25 pj_datum_transform @24
26 pj_set_searchpath @25
27 dmstor @26
28 pj_get_ellps_ref @27
29 pj_get_datums_ref @28
30 pj_get_units_ref @29
31 pj_get_list_ref @30
32 pj_get_prime_meridians_ref @31
33 rtodms @32
34 set_rtodms @33
35 pj_factors @34
36 mk_cheby @35
37 adjlon @36
38 pj_param @37
39 pj_ell_set @38
40 pj_mkparam @39
41 pj_init_ctx @40
42 pj_init_plus_ctx @41
43 pj_get_default_ctx @42
44 pj_get_ctx @43
45 pj_set_ctx @44
46 pj_ctx_alloc @45
47 pj_ctx_free @46
48 pj_ctx_get_errno @47
49 pj_ctx_set_errno @48
50 pj_ctx_set_debug @49
51 pj_ctx_set_logger @50
52 pj_ctx_set_app_data @51
53 pj_ctx_get_app_data @52
54 pj_log @53
55 pj_clear_initcache @54
00 /******************************************************************************
1 * $Id: proj_api.h 2160 2012-02-15 23:51:45Z warmerdam $
1 * $Id: proj_api.h 2372 2013-06-26 21:44:00Z warmerdam $
22 *
33 * Project: PROJ.4
44 * Purpose: Public (application) include file for PROJ.4 API, and constants.
3939 #endif
4040
4141 /* Try to update this every version! */
42 #define PJ_VERSION 480
42 #define PJ_VERSION 490
4343
4444 extern char const pj_release[]; /* global release id string */
4545
6161 # define projXY XY
6262 # define projLP LP
6363 #endif
64
65 /* file reading api, like stdio */
66 typedef int *PAFile;
67 typedef struct projFileAPI_t {
68 PAFile (*FOpen)(projCtx ctx, const char *filename, const char *access);
69 size_t (*FRead)(void *buffer, size_t size, size_t nmemb, PAFile file);
70 int (*FSeek)(PAFile file, long offset, int whence);
71 long (*FTell)(PAFile file);
72 void (*FClose)(PAFile);
73 } projFileAPI;
6474
6575 /* procedure prototypes */
6676
116126 void pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) );
117127 void pj_ctx_set_app_data( projCtx, void * );
118128 void *pj_ctx_get_app_data( projCtx );
129 void pj_ctx_set_fileapi( projCtx, projFileAPI *);
130 projFileAPI *pj_ctx_get_fileapi( projCtx );
119131
120132 void pj_log( projCtx ctx, int level, const char *fmt, ... );
121133 void pj_stderr_logger( void *, int, const char * );
134
135 /* file api */
136 projFileAPI *pj_get_default_fileapi();
137
138 PAFile pj_ctx_fopen(projCtx ctx, const char *filename, const char *access);
139 size_t pj_ctx_fread(projCtx ctx, void *buffer, size_t size, size_t nmemb, PAFile file);
140 int pj_ctx_fseek(projCtx ctx, PAFile file, long offset, int whence);
141 long pj_ctx_ftell(projCtx ctx, PAFile file);
142 void pj_ctx_fclose(projCtx ctx, PAFile file);
143 char *pj_ctx_fgets(projCtx ctx, char *line, int size, PAFile file);
144
145 PAFile pj_open_lib(projCtx, const char *, const char *);
122146
123147 #define PJ_LOG_NONE 0
124148 #define PJ_LOG_ERROR 1
3636 * Division, Kort og Matrikelstyrelsen (KMS), Copenhagen, Denmark
3737 */
3838
39
4039 #define PROJ_PARMS__ \
41 double Qn; /* Merid. quad., scaled to the projection */ \
42 double Zb; /* Radius vector in polar coord. systems */ \
43 double cgb[5]; /* Constants for Gauss -> Geo lat */ \
44 double cbg[5]; /* Constants for Geo lat -> Gauss */ \
45 double utg[5]; /* Constants for transv. merc. -> geo */ \
46 double gtu[5]; /* Constants for geo -> transv. merc. */
40 double Qn; /* Merid. quad., scaled to the projection */ \
41 double Zb; /* Radius vector in polar coord. systems */ \
42 double cgb[6]; /* Constants for Gauss -> Geo lat */ \
43 double cbg[6]; /* Constants for Geo lat -> Gauss */ \
44 double utg[6]; /* Constants for transv. merc. -> geo */ \
45 double gtu[6]; /* Constants for geo -> transv. merc. */
4746
4847 #define PROJ_LIB__
4948 #define PJ_LIB__
5352 PROJ_HEAD(etmerc, "Extended Transverse Mercator")
5453 "\n\tCyl, Sph\n\tlat_ts=(0)\nlat_0=(0)";
5554
56 #define FABS(x) ((x)<0?-(x):(x))
57
58 #ifdef _GNU_SOURCE
59 inline
60 #endif
61 static double
55 #define PROJ_ETMERC_ORDER 6
56
57 #ifdef _GNU_SOURCE
58 inline
59 #endif
60 static double
61 log1py(double x) { /* Compute log(1+x) accurately */
62 volatile double
63 y = 1 + x,
64 z = y - 1;
65 /* Here's the explanation for this magic: y = 1 + z, exactly, and z
66 * approx x, thus log(y)/z (which is nearly constant near z = 0) returns
67 * a good approximation to the true log(1 + x)/x. The multiplication x *
68 * (log(y)/z) introduces little additional error. */
69 return z == 0 ? x : x * log(y) / z;
70 }
71
72 #ifdef _GNU_SOURCE
73 inline
74 #endif
75 static double
76 asinhy(double x) { /* Compute asinh(x) accurately */
77 double y = fabs(x); /* Enforce odd parity */
78 y = log1py(y * (1 + y/(hypot(1.0, y) + 1)));
79 return x < 0 ? -y : y;
80 }
81
82 #ifdef _GNU_SOURCE
83 inline
84 #endif
85 static double
6286 gatg(double *p1, int len_p1, double B) {
63 double *p;
64 double h = 0., h1, h2 = 0., cos_2B;
65
66 cos_2B = 2.*cos(2.0*B);
67 for (p = p1 + len_p1, h1 = *--p; p - p1; h2 = h1, h1 = h)
68 h = -h2 + cos_2B*h1 + *--p;
69 return (B + h*sin(2.0*B));
70 }
71
72 #ifdef _GNU_SOURCE
73 inline
74 #endif
75 static double
87 double *p;
88 double h = 0, h1, h2 = 0, cos_2B;
89
90 cos_2B = 2*cos(2*B);
91 for (p = p1 + len_p1, h1 = *--p; p - p1; h2 = h1, h1 = h)
92 h = -h2 + cos_2B*h1 + *--p;
93 return (B + h*sin(2*B));
94 }
95
96 #ifdef _GNU_SOURCE
97 inline
98 #endif
99 static double
76100 clenS(double *a, int size, double arg_r, double arg_i, double *R, double *I) {
77 double *p, r, i, hr, hr1, hr2, hi, hi1, hi2;
78 double sin_arg_r, cos_arg_r, sinh_arg_i, cosh_arg_i;
79 double exp_arg_i, pxe_arg_i;
80
81 /* arguments */
82 p = a + size;
83 #ifdef _GNU_SOURCE
84 sincos(arg_r, &sin_arg_r, &cos_arg_r);
101 double *p, r, i, hr, hr1, hr2, hi, hi1, hi2;
102 double sin_arg_r, cos_arg_r, sinh_arg_i, cosh_arg_i;
103
104 /* arguments */
105 p = a + size;
106 #ifdef _GNU_SOURCE
107 sincos(arg_r, &sin_arg_r, &cos_arg_r);
85108 #else
86 sin_arg_r = sin(arg_r);
87 cos_arg_r = cos(arg_r);
88 #endif
89 exp_arg_i = exp( arg_i);
90 pxe_arg_i = exp(-arg_i);
91 sinh_arg_i = (exp_arg_i-pxe_arg_i)/2;
92 cosh_arg_i = (exp_arg_i+pxe_arg_i)/2;
93 r = 2.0*cos_arg_r*cosh_arg_i;
94 i = -2.0*sin_arg_r*sinh_arg_i;
95 /* summation loop */
96 for (hi1 = hr1 = hi = 0.0, hr = *--p; a - p;) {
97 hr2 = hr1;
98 hi2 = hi1;
99 hr1 = hr;
100 hi1 = hi;
101 hr = -hr2 + r*hr1 - i*hi1 + *--p;
102 hi = -hi2 + i*hr1 + r*hi1;
103 }
104 r = sin_arg_r*cosh_arg_i;
105 i = cos_arg_r*sinh_arg_i;
106 *R = r*hr - i*hi;
107 *I = r*hi + i*hr;
108 return(*R);
109 }
110 static double
109 sin_arg_r = sin(arg_r);
110 cos_arg_r = cos(arg_r);
111 #endif
112 sinh_arg_i = sinh(arg_i);
113 cosh_arg_i = cosh(arg_i);
114 r = 2*cos_arg_r*cosh_arg_i;
115 i = -2*sin_arg_r*sinh_arg_i;
116 /* summation loop */
117 for (hi1 = hr1 = hi = 0, hr = *--p; a - p;) {
118 hr2 = hr1;
119 hi2 = hi1;
120 hr1 = hr;
121 hi1 = hi;
122 hr = -hr2 + r*hr1 - i*hi1 + *--p;
123 hi = -hi2 + i*hr1 + r*hi1;
124 }
125 r = sin_arg_r*cosh_arg_i;
126 i = cos_arg_r*sinh_arg_i;
127 *R = r*hr - i*hi;
128 *I = r*hi + i*hr;
129 return(*R);
130 }
131 static double
111132 clens(double *a, int size, double arg_r) {
112 double *p, r, hr, hr1, hr2, cos_arg_r;
113
114 p = a + size;
115 cos_arg_r = cos(arg_r);
116 r = 2.0*cos_arg_r;
117 /* summation loop */
118 for (hr1 = 0.0, hr = *--p; a - p;) {
119 hr2 = hr1;
120 hr1 = hr;
121 hr = -hr2 + r*hr1 + *--p;
122 }
123 return(sin(arg_r)*hr);
124 }
125
133 double *p, r, hr, hr1, hr2, cos_arg_r;
134
135 p = a + size;
136 cos_arg_r = cos(arg_r);
137 r = 2*cos_arg_r;
138 /* summation loop */
139 for (hr1 = 0, hr = *--p; a - p;) {
140 hr2 = hr1;
141 hr1 = hr;
142 hr = -hr2 + r*hr1 + *--p;
143 }
144 return(sin(arg_r)*hr);
145 }
126146
127147 FORWARD(e_forward); /* ellipsoid */
128 double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
129 double Cn = lp.phi, Ce = lp.lam;
130
131 /* ell. LAT, LNG -> Gaussian LAT, LNG */
132 Cn = gatg(P->cbg, 5, Cn);
133 /* Gaussian LAT, LNG -> compl. sph. LAT */
134 #ifdef _GNU_SOURCE
135 sincos(Cn, &sin_Cn, &cos_Cn);
136 sincos(Ce, &sin_Ce, &cos_Ce);
148 double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
149 double Cn = lp.phi, Ce = lp.lam;
150
151 /* ell. LAT, LNG -> Gaussian LAT, LNG */
152 Cn = gatg(P->cbg, PROJ_ETMERC_ORDER, Cn);
153 /* Gaussian LAT, LNG -> compl. sph. LAT */
154 #ifdef _GNU_SOURCE
155 sincos(Cn, &sin_Cn, &cos_Cn);
156 sincos(Ce, &sin_Ce, &cos_Ce);
137157 #else
138 sin_Cn = sin(Cn);
139 cos_Cn = cos(Cn);
140 sin_Ce = sin(Ce);
141 cos_Ce = cos(Ce);
142 #endif
143
144 Cn = atan2(sin_Cn, cos_Ce*cos_Cn);
145 Ce = atan2(sin_Ce*cos_Cn, hypot(sin_Cn, cos_Cn*cos_Ce));
146 /* compl. sph. N, E -> ell. norm. N, E */
147 Ce = log(tan(FORTPI + Ce*0.5));
148 Cn += clenS(P->gtu, 5, 2.*Cn, 2.*Ce, &dCn, &dCe);
149 Ce += dCe;
150 if (FABS(Ce) <= 2.623395162778) {
151 xy.y = P->Qn * Cn + P->Zb; /* Northing */
152 xy.x = P->Qn * Ce; /* Easting */
153 } else
154 xy.x = xy.y = HUGE_VAL;
155 return (xy);
156 }
157
158 sin_Cn = sin(Cn);
159 cos_Cn = cos(Cn);
160 sin_Ce = sin(Ce);
161 cos_Ce = cos(Ce);
162 #endif
163
164 Cn = atan2(sin_Cn, cos_Ce*cos_Cn);
165 Ce = atan2(sin_Ce*cos_Cn, hypot(sin_Cn, cos_Cn*cos_Ce));
166 /* compl. sph. N, E -> ell. norm. N, E */
167 Ce = asinhy(tan(Ce)); /* Replaces: Ce = log(tan(FORTPI + Ce*0.5)); */
168 Cn += clenS(P->gtu, PROJ_ETMERC_ORDER, 2*Cn, 2*Ce, &dCn, &dCe);
169 Ce += dCe;
170 if (fabs(Ce) <= 2.623395162778) {
171 xy.y = P->Qn * Cn + P->Zb; /* Northing */
172 xy.x = P->Qn * Ce; /* Easting */
173 } else
174 xy.x = xy.y = HUGE_VAL;
175 return (xy);
176 }
158177
159178 INVERSE(e_inverse); /* ellipsoid */
160 double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
161 double Cn = xy.y, Ce = xy.x;
162
163 /* normalize N, E */
164 Cn = (Cn - P->Zb)/P->Qn;
165 Ce = Ce/P->Qn;
166 if (FABS(Ce) <= 2.623395162778) { /* 150 degrees */
167 /* norm. N, E -> compl. sph. LAT, LNG */
168 Cn += clenS(P->utg, 5, 2.*Cn, 2.*Ce, &dCn, &dCe);
169 Ce += dCe;
170 Ce = 2.0*(atan(exp(Ce)) - FORTPI);
171 /* compl. sph. LAT -> Gaussian LAT, LNG */
172 #ifdef _GNU_SOURCE
173 sincos(Cn, &sin_Cn, &cos_Cn);
174 sincos(Ce, &sin_Ce, &cos_Ce);
179 double sin_Cn, cos_Cn, cos_Ce, sin_Ce, dCn, dCe;
180 double Cn = xy.y, Ce = xy.x;
181
182 /* normalize N, E */
183 Cn = (Cn - P->Zb)/P->Qn;
184 Ce = Ce/P->Qn;
185 if (fabs(Ce) <= 2.623395162778) { /* 150 degrees */
186 /* norm. N, E -> compl. sph. LAT, LNG */
187 Cn += clenS(P->utg, PROJ_ETMERC_ORDER, 2*Cn, 2*Ce, &dCn, &dCe);
188 Ce += dCe;
189 Ce = atan(sinh(Ce)); /* Replaces: Ce = 2*(atan(exp(Ce)) - FORTPI); */
190 /* compl. sph. LAT -> Gaussian LAT, LNG */
191 #ifdef _GNU_SOURCE
192 sincos(Cn, &sin_Cn, &cos_Cn);
193 sincos(Ce, &sin_Ce, &cos_Ce);
175194 #else
176 sin_Cn = sin(Cn);
177 cos_Cn = cos(Cn);
178 sin_Ce = sin(Ce);
179 cos_Ce = cos(Ce);
180 #endif
181 Ce = atan2(sin_Ce, cos_Ce*cos_Cn);
182 Cn = atan2(sin_Cn*cos_Ce, hypot(sin_Ce, cos_Ce*cos_Cn));
183 /* Gaussian LAT, LNG -> ell. LAT, LNG */
184 lp.phi = gatg(P->cgb, 5, Cn);
185 lp.lam = Ce;
186 }
187 else
188 lp.phi = lp.lam = HUGE_VAL;
189 return (lp);
190 }
191
195 sin_Cn = sin(Cn);
196 cos_Cn = cos(Cn);
197 sin_Ce = sin(Ce);
198 cos_Ce = cos(Ce);
199 #endif
200 Ce = atan2(sin_Ce, cos_Ce*cos_Cn);
201 Cn = atan2(sin_Cn*cos_Ce, hypot(sin_Ce, cos_Ce*cos_Cn));
202 /* Gaussian LAT, LNG -> ell. LAT, LNG */
203 lp.phi = gatg(P->cgb, PROJ_ETMERC_ORDER, Cn);
204 lp.lam = Ce;
205 }
206 else
207 lp.phi = lp.lam = HUGE_VAL;
208 return (lp);
209 }
192210
193211 FREEUP; if (P) free(P); }
194212
195
196213 ENTRY0(etmerc)
197 double f, n, np, Z;
198
199 if (P->es <= 0.) E_ERROR(-34);
200 f = 1. - sqrt(1. - P->es);
201 /* third flattening */
202 np = n = f/(2.0 - f);
203
204 /* COEF. OF TRIG SERIES GEO <-> GAUSS */
205 /* cgb := Gaussian -> Geodetic, KW p190 - 191 (61) - (62) */
206 /* cbg := Geodetic -> Gaussian, KW p186 - 187 (51) - (52) */
207 /* 5 degree : Engsager and Poder: ICC2007 */
208 P->cgb[0] = n*( 2.0 + n*(-2.0/3.0 + n*(-2.0 + n*(116.0/45.0 + n*(26.0/45.0)))));
209 P->cbg[0] = n*(-2.0 + n*( 2.0/3.0 + n*( 4.0/3.0 + n*(-82.0/45.0 + n*(32.0/45.0)))));
210 np *= n;
211 P->cgb[1] = np*(7.0/3.0 + n*( -8.0/5.0 + n*(-227.0/45.0 + n*(2704.0/315.0))));
212 P->cbg[1] = np*(5.0/3.0 + n*(-16.0/15.0 + n*( -13.0/ 9.0 + n*( 904.0/315.0))));
213 np *= n;
214 P->cgb[2] = np*( 56.0/15.0 + n*(-136.0/35.0 + n*(1262.0/105.0)));
215 P->cbg[2] = np*(-26.0/15.0 + n*( 34.0/21.0 + n*( 8.0/ 5.0)));
216 np *= n;
217 P->cgb[3] = np*(4279.0/630.0 + n*(-322.0/35.0));
218 P->cbg[3] = np*(1237.0/630.0 + n*( -12.0/ 5.0));
219 np *= n;
220 P->cgb[4] = np*(4174.0/315.0);
221 P->cbg[4] = np*(-734.0/315.0);
222
223 /* Constants of the projections */
224 /* Transverse Mercator (UTM, ITM, etc) */
225 np = n*n;
226 /* Norm. mer. quad, K&W p.50 (96), p.19 (38b), p.5 (2) */
227 P->Qn = P->k0/(1 + n) * (1. + np*(1./4.0 + np*(1./64.0 + np/256.0)));
228 /* coef of trig series */
229 /* utg := ell. N, E -> sph. N, E, KW p194 (65) */
230 /* gtu := sph. N, E -> ell. N, E, KW p196 (69) */
231 P->utg[0] = n*(-0.5 + n*( 2.0/3.0 + n*(-37.0/96.0 + n*( 1.0/360.0 + n*( 81.0/512.0)))));
232 P->gtu[0] = n*( 0.5 + n*(-2.0/3.0 + n*( 5.0/16.0 + n*(41.0/180.0 + n*(-127.0/288.0)))));
233 P->utg[1] = np*(-1.0/48.0 + n*(-1.0/15.0 + n*(437.0/1440.0 + n*(-46.0/105.0))));
234 P->gtu[1] = np*(13.0/48.0 + n*(-3.0/5.0 + n*(557.0/1440.0 + n*(281.0/630.0))));
235 np *= n;
236 P->utg[2] = np*(-17.0/480.0 + n*( 37.0/840.0 + n*( 209.0/ 4480.0)));
237 P->gtu[2] = np*( 61.0/240.0 + n*(-103.0/140.0 + n*(15061.0/26880.0)));
238 np *= n;
239 P->utg[3] = np*(-4397.0/161280.0 + n*( 11.0/504.0));
240 P->gtu[3] = np*(49561.0/161280.0 + n*(-179.0/168.0));
241 np *= n;
242 P->utg[4] = np*(-4583.0/161280.0);
243 P->gtu[4] = np*(34729.0/ 80640.0);
244 /* Gaussian latitude value of the origin latitude */
245 Z = gatg(P->cbg, 5, P->phi0);
246 /* Origin northing minus true northing at the origin latitude */
247 /* i.e. true northing = N - P->Zb */
248 P->Zb = - P->Qn*(Z + clens(P->gtu, 5, 2.0*Z));
249 P->inv = e_inverse;
250 P->fwd = e_forward;
214 double f, n, np, Z;
215
216 if (P->es <= 0) E_ERROR(-34);
217 f = P->es / (1 + sqrt(1 - P->es)); /* Replaces: f = 1 - sqrt(1-P->es); */
218 /* third flattening */
219 np = n = f/(2 - f);
220
221 /* COEF. OF TRIG SERIES GEO <-> GAUSS */
222 /* cgb := Gaussian -> Geodetic, KW p190 - 191 (61) - (62) */
223 /* cbg := Geodetic -> Gaussian, KW p186 - 187 (51) - (52) */
224 /* PROJ_ETMERC_ORDER = 6th degree : Engsager and Poder: ICC2007 */
225 P->cgb[0] = n*( 2 + n*(-2/3.0 + n*(-2 + n*(116/45.0 + n*(26/45.0 +
226 n*(-2854/675.0 ))))));
227 P->cbg[0] = n*(-2 + n*( 2/3.0 + n*( 4/3.0 + n*(-82/45.0 + n*(32/45.0 +
228 n*( 4642/4725.0))))));
229 np *= n;
230 P->cgb[1] = np*(7/3.0 + n*( -8/5.0 + n*(-227/45.0 + n*(2704/315.0 +
231 n*( 2323/945.0)))));
232 P->cbg[1] = np*(5/3.0 + n*(-16/15.0 + n*( -13/9.0 + n*( 904/315.0 +
233 n*(-1522/945.0)))));
234 np *= n;
235 /* n^5 coeff corrected from 1262/105 -> -1262/105 */
236 P->cgb[2] = np*( 56/15.0 + n*(-136/35.0 + n*(-1262/105.0 +
237 n*( 73814/2835.0))));
238 P->cbg[2] = np*(-26/15.0 + n*( 34/21.0 + n*( 8/5.0 +
239 n*(-12686/2835.0))));
240 np *= n;
241 /* n^5 coeff corrected from 322/35 -> 332/35 */
242 P->cgb[3] = np*(4279/630.0 + n*(-332/35.0 + n*(-399572/14175.0)));
243 P->cbg[3] = np*(1237/630.0 + n*( -12/5.0 + n*( -24832/14175.0)));
244 np *= n;
245 P->cgb[4] = np*(4174/315.0 + n*(-144838/6237.0 ));
246 P->cbg[4] = np*(-734/315.0 + n*( 109598/31185.0));
247 np *= n;
248 P->cgb[5] = np*(601676/22275.0 );
249 P->cbg[5] = np*(444337/155925.0);
250
251 /* Constants of the projections */
252 /* Transverse Mercator (UTM, ITM, etc) */
253 np = n*n;
254 /* Norm. mer. quad, K&W p.50 (96), p.19 (38b), p.5 (2) */
255 P->Qn = P->k0/(1 + n) * (1 + np*(1/4.0 + np*(1/64.0 + np/256.0)));
256 /* coef of trig series */
257 /* utg := ell. N, E -> sph. N, E, KW p194 (65) */
258 /* gtu := sph. N, E -> ell. N, E, KW p196 (69) */
259 P->utg[0] = n*(-0.5 + n*( 2/3.0 + n*(-37/96.0 + n*( 1/360.0 +
260 n*( 81/512.0 + n*(-96199/604800.0))))));
261 P->gtu[0] = n*( 0.5 + n*(-2/3.0 + n*( 5/16.0 + n*(41/180.0 +
262 n*(-127/288.0 + n*( 7891/37800.0 ))))));
263 P->utg[1] = np*(-1/48.0 + n*(-1/15.0 + n*(437/1440.0 + n*(-46/105.0 +
264 n*( 1118711/3870720.0)))));
265 P->gtu[1] = np*(13/48.0 + n*(-3/5.0 + n*(557/1440.0 + n*(281/630.0 +
266 n*(-1983433/1935360.0)))));
267 np *= n;
268 P->utg[2] = np*(-17/480.0 + n*( 37/840.0 + n*( 209/4480.0 +
269 n*( -5569/90720.0 ))));
270 P->gtu[2] = np*( 61/240.0 + n*(-103/140.0 + n*(15061/26880.0 +
271 n*(167603/181440.0))));
272 np *= n;
273 P->utg[3] = np*(-4397/161280.0 + n*( 11/504.0 + n*( 830251/7257600.0)));
274 P->gtu[3] = np*(49561/161280.0 + n*(-179/168.0 + n*(6601661/7257600.0)));
275 np *= n;
276 P->utg[4] = np*(-4583/161280.0 + n*( 108847/3991680.0));
277 P->gtu[4] = np*(34729/80640.0 + n*(-3418889/1995840.0));
278 np *= n;
279 P->utg[5] = np*(-20648693/638668800.0);
280 P->gtu[5] = np*(212378941/319334400.0);
281 /* Gaussian latitude value of the origin latitude */
282 Z = gatg(P->cbg, PROJ_ETMERC_ORDER, P->phi0);
283 /* Origin northing minus true northing at the origin latitude */
284 /* i.e. true northing = N - P->Zb */
285 P->Zb = - P->Qn*(Z + clens(P->gtu, PROJ_ETMERC_ORDER, 2*Z));
286 P->inv = e_inverse;
287 P->fwd = e_forward;
251288 ENDENTRY(P)
00 /******************************************************************************
1 * $Id: projects.h 2219 2012-06-19 04:18:00Z warmerdam $
1 * $Id: projects.h 2356 2013-06-25 01:02:23Z warmerdam $
22 *
33 * Project: PROJ.4
44 * Purpose: Primary (private) include file for PROJ.4 library.
9999 #define PI 3.14159265358979323846
100100 #define TWOPI 6.2831853071795864769
101101
102 /* environment parameter name */
103 #ifndef PROJ_LIB
104 #define PROJ_LIB "PROJ_LIB"
105 #endif
106102 /* maximum tag id length for +init and default files */
107103 #ifndef ID_TAG_MAX
108104 #define ID_TAG_MAX 50
123119 #else
124120 #define DIR_CHAR '/'
125121 #endif
122
123 struct projFileAPI_t;
126124
127125 /* proj thread context */
128126 typedef struct {
130128 int debug_level;
131129 void (*logger)(void *, int, const char *);
132130 void *app_data;
131 struct projFileAPI_t *fileapi;
133132 } projCtx_t;
134133
135134 /* datum_type values */
420419 double pj_authlat(double, double *);
421420 COMPLEX pj_zpoly1(COMPLEX, COMPLEX *, int);
422421 COMPLEX pj_zpolyd1(COMPLEX, COMPLEX *, int, COMPLEX *);
423 FILE *pj_open_lib(projCtx, char *, char *);
424422
425423 int pj_deriv(LP, double, PJ *, struct DERIVS *);
426424 int pj_factors(LP, PJ *, double, struct FACTORS *);
451449 LP nad_intr(LP, struct CTABLE *);
452450 LP nad_cvt(LP, int, struct CTABLE *);
453451 struct CTABLE *nad_init(projCtx ctx, char *);
454 struct CTABLE *nad_ctable_init( projCtx ctx, FILE * fid );
455 int nad_ctable_load( projCtx ctx, struct CTABLE *, FILE * fid );
456 struct CTABLE *nad_ctable2_init( projCtx ctx, FILE * fid );
457 int nad_ctable2_load( projCtx ctx, struct CTABLE *, FILE * fid );
452 struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid );
453 int nad_ctable_load( projCtx ctx, struct CTABLE *, PAFile fid );
454 struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid );
455 int nad_ctable2_load( projCtx ctx, struct CTABLE *, PAFile fid );
458456 void nad_free(struct CTABLE *);
459457
460458 /* higher level handling of datum grid shift files */
0 """Rewrite part of test.py in pyproj in the form of unittests."""
1 import unittest
2 from pyproj import Proj
3
4
5 class BasicTest(unittest.TestCase):
6
7 def testProj4Version(self):
8 awips221 = Proj(proj='lcc',R=6371200,lat_1=50,lat_2=50,lon_0=-107)
9 #self.assertEqual(awips221.proj_version, 4.9)
10
11 def testProjAwips221(self):
12 # AWIPS is Advanced Weather Interactive Processing System
13 params = {'proj': 'lcc', 'R': 6371200, 'lat_1': 50, 'lat_2': 50,
14 'lon_0': -107}
15 nx = 349
16 ny = 277
17 awips221 = Proj(proj=params['proj'], R=params['R'],
18 lat_1=params['lat_1'], lat_2=params['lat_2'],
19 lon_0=params['lon_0'])
20 awips221_from_dict = Proj(params)
21
22 items = sorted([val for val in awips221.srs.split() if val])
23 items_dict = sorted([val for val in awips221_from_dict.srs.split() if val])
24 self.assertEqual(items, items_dict)
25
26 expected = sorted(('+units=m', '+proj=lcc', '+lat_2=50', '+lat_1=50',
27 '+lon_0=-107','+R=6371200'))
28 self.assertEqual(items, expected)
29
30 point = awips221(-145.5,1.)
31 x, y = -5632642.22547495, 1636571.4883145525
32 self.assertAlmostEqual(point[0], x)
33 self.assertAlmostEqual(point[1], y)
34
35 pairs = [
36 [(-45,45), (4351601.20766915, 7606948.029327129)],
37 [(45,45), (5285389.07739382, 14223336.17467613)],
38 [(45,-45), (20394982.466924712, 21736546.456803113)],
39 [(-45,-45), (16791730.756976362, -3794425.4816524936)]
40 ]
41 for point_geog, expected in pairs:
42 point = awips221(*point_geog)
43 self.assertAlmostEqual(point[0], expected[0])
44 self.assertAlmostEqual(point[1], expected[1])
45 point_geog2 = awips221(*point, inverse=True)
46 self.assertAlmostEqual(point_geog[0], point_geog2[0])
47 self.assertAlmostEqual(point_geog[1], point_geog2[1])
48
49
50 if __name__ == '__main__':
51 unittest.main()