Imported Upstream version 1.9.4
Bas Couwenberg
9 years ago
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. | |
0 | 6 | 1.9.3 (svn revision 327) |
1 | 7 | * Geod now uses C code adapted from geographiclib now included in proj4 source, |
2 | 8 | 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 | 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 | |
1 | 1 | include MANIFEST.in |
2 | 2 | include LICENSE_proj4 |
3 | include LICENSE_geographiclib | |
3 | include LICENSE | |
4 | 4 | include Changelog |
5 | 5 | include create_docs.sh |
6 | 6 | include _proj.pyx |
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 | 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. |
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 */ | |
1 | 1 | |
2 | 2 | #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 | |
3 | 15 | #include "Python.h" |
4 | 16 | #ifndef Py_PYTHON_H |
5 | 17 | #error Python headers needed to compile C extensions, please install development version of Python. |
115 | 127 | #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) |
116 | 128 | #define Py_TPFLAGS_HAVE_NEWBUFFER 0 |
117 | 129 | #endif |
130 | #if PY_VERSION_HEX < 0x02060000 | |
131 | #define Py_TPFLAGS_HAVE_VERSION_TAG 0 | |
132 | #endif | |
118 | 133 | #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) |
119 | 134 | #define CYTHON_PEP393_ENABLED 1 |
120 | 135 | #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ |
154 | 169 | #define PyBytes_Concat PyString_Concat |
155 | 170 | #define PyBytes_ConcatAndDel PyString_ConcatAndDel |
156 | 171 | #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 | |
157 | 180 | #if PY_VERSION_HEX < 0x02060000 |
158 | 181 | #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) |
159 | 182 | #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) |
226 | 249 | #define __Pyx_NAMESTR(n) (n) |
227 | 250 | #define __Pyx_DOCSTR(n) (n) |
228 | 251 | #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 */ | |
266 | 252 | #ifndef CYTHON_INLINE |
267 | 253 | #if defined(__GNUC__) |
268 | 254 | #define CYTHON_INLINE __inline__ |
274 | 260 | #define CYTHON_INLINE |
275 | 261 | #endif |
276 | 262 | #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 | ||
279 | 321 | #ifndef CYTHON_UNUSED |
280 | 322 | # if defined(__GNUC__) |
281 | 323 | # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) |
289 | 331 | # define CYTHON_UNUSED |
290 | 332 | # endif |
291 | 333 | #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 | |
301 | 372 | #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) |
302 | 373 | #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) |
303 | 374 | static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); |
304 | 375 | static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); |
305 | ||
306 | 376 | static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); |
307 | 377 | static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); |
308 | 378 | static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*); |
309 | ||
310 | 379 | #if CYTHON_COMPILING_IN_CPYTHON |
311 | 380 | #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) |
312 | 381 | #else |
313 | 382 | #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) |
314 | 383 | #endif |
315 | 384 | #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 | ||
316 | 458 | |
317 | 459 | #ifdef __GNUC__ |
318 | 460 | /* Test for GCC > 2.95 */ |
327 | 469 | #define likely(x) (x) |
328 | 470 | #define unlikely(x) (x) |
329 | 471 | #endif /* __GNUC__ */ |
330 | ||
472 | ||
331 | 473 | static PyObject *__pyx_m; |
474 | static PyObject *__pyx_d; | |
332 | 475 | static PyObject *__pyx_b; |
333 | 476 | static PyObject *__pyx_empty_tuple; |
334 | 477 | static PyObject *__pyx_empty_bytes; |
347 | 490 | struct __pyx_obj_5_proj_Geod; |
348 | 491 | struct __pyx_opt_args_5_proj__strencode; |
349 | 492 | |
350 | /* "_proj.pyx":346 | |
493 | /* "_proj.pyx":359 | |
351 | 494 | * yy[i] = yy[i]*_rad2dg |
352 | 495 | * |
353 | 496 | * cdef _strencode(pystr,encoding='ascii'): # <<<<<<<<<<<<<< |
359 | 502 | PyObject *encoding; |
360 | 503 | }; |
361 | 504 | |
362 | /* "_proj.pyx":62 | |
363 | * pj_set_searchpath(1, &searchpath) | |
505 | /* "_proj.pyx":66 | |
506 | * return Proj(projstring) | |
364 | 507 | * |
365 | 508 | * cdef class Proj: # <<<<<<<<<<<<<< |
366 | 509 | * cdef projPJ projpj |
376 | 519 | }; |
377 | 520 | |
378 | 521 | |
379 | /* "_proj.pyx":353 | |
522 | /* "_proj.pyx":366 | |
380 | 523 | * return pystr # already bytes? |
381 | 524 | * |
382 | 525 | * cdef class Geod: # <<<<<<<<<<<<<< |
383 | * cdef Geodesic _Geodesic | |
526 | * cdef geod_geodesic _geod_geodesic | |
384 | 527 | * cdef public object initstring |
385 | 528 | */ |
386 | 529 | struct __pyx_obj_5_proj_Geod { |
387 | 530 | PyObject_HEAD |
388 | struct Geodesic _Geodesic; | |
531 | struct geod_geodesic _geod_geodesic; | |
389 | 532 | PyObject *initstring; |
390 | 533 | }; |
391 | 534 | |
443 | 586 | #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) |
444 | 587 | #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) |
445 | 588 | |
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*/ | |
447 | 605 | |
448 | 606 | static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ |
449 | 607 | |
459 | 617 | |
460 | 618 | static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ |
461 | 619 | |
620 | static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ | |
621 | ||
462 | 622 | static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, |
463 | 623 | const char *name, int exact); /*proto*/ |
464 | 624 | |
466 | 626 | |
467 | 627 | static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ |
468 | 628 | |
629 | #ifndef __PYX_FORCE_INIT_THREADS | |
630 | #define __PYX_FORCE_INIT_THREADS 0 | |
631 | #endif | |
632 | ||
469 | 633 | static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ |
470 | 634 | static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ |
471 | 635 | |
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*/ | |
473 | 637 | |
474 | 638 | static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *); |
475 | 639 | |
539 | 703 | static PyObject *__pyx_builtin_AttributeError; |
540 | 704 | static PyObject *__pyx_builtin_ValueError; |
541 | 705 | 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 */ | |
542 | 707 | static int __pyx_pf_5_proj_4Proj___cinit__(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_projstring); /* proto */ |
543 | 708 | 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 */ | |
549 | 715 | static PyObject *__pyx_pf_5_proj_4Proj_12proj_version___get__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */ |
550 | 716 | 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 */ |
551 | 717 | static int __pyx_pf_5_proj_4Proj_12proj_version_4__del__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */ |
552 | 718 | static PyObject *__pyx_pf_5_proj_4Proj_3srs___get__(struct __pyx_obj_5_proj_Proj *__pyx_v_self); /* proto */ |
553 | 719 | static int __pyx_pf_5_proj_4Proj_3srs_2__set__(struct __pyx_obj_5_proj_Proj *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ |
554 | 720 | 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 */ | |
556 | 722 | 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 */ |
557 | 723 | static PyObject *__pyx_pf_5_proj_4Geod_2__reduce__(struct __pyx_obj_5_proj_Geod *__pyx_v_self); /* proto */ |
558 | 724 | 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 */ |
561 | 727 | static PyObject *__pyx_pf_5_proj_4Geod_10initstring___get__(struct __pyx_obj_5_proj_Geod *__pyx_v_self); /* proto */ |
562 | 728 | static int __pyx_pf_5_proj_4Geod_10initstring_2__set__(struct __pyx_obj_5_proj_Geod *__pyx_v_self, PyObject *__pyx_v_value); /* proto */ |
563 | 729 | 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*/ | |
564 | 732 | static char __pyx_k_3[] = "Buffer lengths not the same"; |
565 | 733 | static char __pyx_k_5[] = "projection undefined"; |
566 | 734 | static char __pyx_k_15[] = "x,y and z must be same size"; |
567 | 735 | static char __pyx_k_17[] = "+a=%s +f=%s"; |
568 | 736 | 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"; | |
571 | 739 | static char __pyx_k__a[] = "a"; |
572 | 740 | static char __pyx_k__f[] = "f"; |
573 | 741 | static char __pyx_k__i[] = "i"; |
614 | 782 | static char __pyx_k__errcheck[] = "errcheck"; |
615 | 783 | static char __pyx_k____class__[] = "__class__"; |
616 | 784 | static char __pyx_k__ValueError[] = "ValueError"; |
785 | static char __pyx_k____import__[] = "__import__"; | |
617 | 786 | static char __pyx_k___transform[] = "_transform"; |
618 | 787 | static char __pyx_k__is_latlong[] = "is_latlong"; |
619 | 788 | static char __pyx_k__projstring[] = "projstring"; |
620 | 789 | static char __pyx_k__searchpath[] = "searchpath"; |
621 | 790 | static char __pyx_k____version__[] = "__version__"; |
791 | static char __pyx_k___createproj[] = "_createproj"; | |
622 | 792 | static char __pyx_k___doublesize[] = "_doublesize"; |
623 | 793 | static char __pyx_k__RuntimeError[] = "RuntimeError"; |
624 | 794 | static char __pyx_k__set_datapath[] = "set_datapath"; |
634 | 804 | static PyObject *__pyx_n_s__RuntimeError; |
635 | 805 | static PyObject *__pyx_n_s__ValueError; |
636 | 806 | static PyObject *__pyx_n_s____class__; |
807 | static PyObject *__pyx_n_s____import__; | |
637 | 808 | static PyObject *__pyx_n_s____main__; |
638 | 809 | static PyObject *__pyx_n_s____test__; |
639 | 810 | static PyObject *__pyx_n_s____version__; |
811 | static PyObject *__pyx_n_s___createproj; | |
640 | 812 | static PyObject *__pyx_n_s___doublesize; |
641 | 813 | static PyObject *__pyx_n_s___proj; |
642 | 814 | static PyObject *__pyx_n_s___transform; |
707 | 879 | static PyObject *__pyx_k_tuple_24; |
708 | 880 | static PyObject *__pyx_k_tuple_27; |
709 | 881 | static PyObject *__pyx_k_tuple_30; |
882 | static PyObject *__pyx_k_tuple_32; | |
710 | 883 | static PyObject *__pyx_k_codeobj_28; |
711 | 884 | static PyObject *__pyx_k_codeobj_31; |
885 | static PyObject *__pyx_k_codeobj_33; | |
712 | 886 | |
713 | 887 | /* Python wrapper */ |
714 | 888 | static PyObject *__pyx_pw_5_proj_1set_datapath(PyObject *__pyx_self, PyObject *__pyx_v_datapath); /*proto*/ |
722 | 896 | return __pyx_r; |
723 | 897 | } |
724 | 898 | |
725 | /* "_proj.pyx":56 | |
899 | /* "_proj.pyx":58 | |
726 | 900 | * int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len) |
727 | 901 | * |
728 | 902 | * def set_datapath(datapath): # <<<<<<<<<<<<<< |
729 | * cdef char *searchpath | |
730 | 903 | * bytestr = _strencode(datapath) |
904 | * cdef const char *searchpath = bytestr | |
731 | 905 | */ |
732 | 906 | |
733 | 907 | static PyObject *__pyx_pf_5_proj_set_datapath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_datapath) { |
734 | char *__pyx_v_searchpath; | |
735 | 908 | PyObject *__pyx_v_bytestr = NULL; |
909 | char const *__pyx_v_searchpath; | |
736 | 910 | PyObject *__pyx_r = NULL; |
737 | 911 | __Pyx_RefNannyDeclarations |
738 | 912 | PyObject *__pyx_t_1 = NULL; |
739 | char *__pyx_t_2; | |
913 | char const *__pyx_t_2; | |
740 | 914 | int __pyx_lineno = 0; |
741 | 915 | const char *__pyx_filename = NULL; |
742 | 916 | int __pyx_clineno = 0; |
743 | 917 | __Pyx_RefNannySetupContext("set_datapath", 0); |
744 | 918 | |
745 | /* "_proj.pyx":58 | |
919 | /* "_proj.pyx":59 | |
920 | * | |
746 | 921 | * def set_datapath(datapath): |
747 | * cdef char *searchpath | |
748 | 922 | * bytestr = _strencode(datapath) # <<<<<<<<<<<<<< |
749 | * searchpath = bytestr | |
923 | * cdef const char *searchpath = bytestr | |
750 | 924 | * pj_set_searchpath(1, &searchpath) |
751 | 925 | */ |
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;} | |
753 | 927 | __Pyx_GOTREF(__pyx_t_1); |
754 | 928 | __pyx_v_bytestr = __pyx_t_1; |
755 | 929 | __pyx_t_1 = 0; |
756 | 930 | |
757 | /* "_proj.pyx":59 | |
758 | * cdef char *searchpath | |
931 | /* "_proj.pyx":60 | |
932 | * def set_datapath(datapath): | |
759 | 933 | * bytestr = _strencode(datapath) |
760 | * searchpath = bytestr # <<<<<<<<<<<<<< | |
934 | * cdef const char *searchpath = bytestr # <<<<<<<<<<<<<< | |
761 | 935 | * pj_set_searchpath(1, &searchpath) |
762 | 936 | * |
763 | 937 | */ |
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;} | |
765 | 939 | __pyx_v_searchpath = __pyx_t_2; |
766 | 940 | |
767 | /* "_proj.pyx":60 | |
941 | /* "_proj.pyx":61 | |
768 | 942 | * bytestr = _strencode(datapath) |
769 | * searchpath = bytestr | |
943 | * cdef const char *searchpath = bytestr | |
770 | 944 | * pj_set_searchpath(1, &searchpath) # <<<<<<<<<<<<<< |
771 | 945 | * |
772 | * cdef class Proj: | |
946 | * def _createproj(projstring): | |
773 | 947 | */ |
774 | 948 | pj_set_searchpath(1, (&__pyx_v_searchpath)); |
775 | 949 | |
787 | 961 | } |
788 | 962 | |
789 | 963 | /* 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 */ | |
790 | 1027 | static int __pyx_pw_5_proj_4Proj_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ |
791 | 1028 | static int __pyx_pw_5_proj_4Proj_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
792 | 1029 | PyObject *__pyx_v_projstring = 0; |
1030 | int __pyx_lineno = 0; | |
1031 | const char *__pyx_filename = NULL; | |
1032 | int __pyx_clineno = 0; | |
793 | 1033 | int __pyx_r; |
794 | 1034 | __Pyx_RefNannyDeclarations |
795 | 1035 | __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); |
811 | 1051 | else goto __pyx_L5_argtuple_error; |
812 | 1052 | } |
813 | 1053 | 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;} | |
815 | 1055 | } |
816 | 1056 | } else if (PyTuple_GET_SIZE(__pyx_args) != 1) { |
817 | 1057 | goto __pyx_L5_argtuple_error; |
822 | 1062 | } |
823 | 1063 | goto __pyx_L4_argument_unpacking_done; |
824 | 1064 | __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;} | |
826 | 1066 | __pyx_L3_error:; |
827 | 1067 | __Pyx_AddTraceback("_proj.Proj.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); |
828 | 1068 | __Pyx_RefNannyFinishContext(); |
833 | 1073 | return __pyx_r; |
834 | 1074 | } |
835 | 1075 | |
836 | /* "_proj.pyx":69 | |
1076 | /* "_proj.pyx":73 | |
837 | 1077 | * cdef public object srs |
838 | 1078 | * |
839 | 1079 | * def __cinit__(self, projstring): # <<<<<<<<<<<<<< |
855 | 1095 | int __pyx_clineno = 0; |
856 | 1096 | __Pyx_RefNannySetupContext("__cinit__", 0); |
857 | 1097 | |
858 | /* "_proj.pyx":72 | |
1098 | /* "_proj.pyx":76 | |
859 | 1099 | * # setup proj initialization string. |
860 | 1100 | * cdef int err |
861 | 1101 | * self.srs = projstring # <<<<<<<<<<<<<< |
868 | 1108 | __Pyx_DECREF(__pyx_v_self->srs); |
869 | 1109 | __pyx_v_self->srs = __pyx_v_projstring; |
870 | 1110 | |
871 | /* "_proj.pyx":73 | |
1111 | /* "_proj.pyx":77 | |
872 | 1112 | * cdef int err |
873 | 1113 | * self.srs = projstring |
874 | 1114 | * bytestr = _strencode(projstring) # <<<<<<<<<<<<<< |
875 | 1115 | * self.pjinitstring = bytestr |
876 | 1116 | * # initialize projection |
877 | 1117 | */ |
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;} | |
879 | 1119 | __Pyx_GOTREF(__pyx_t_1); |
880 | 1120 | __pyx_v_bytestr = __pyx_t_1; |
881 | 1121 | __pyx_t_1 = 0; |
882 | 1122 | |
883 | /* "_proj.pyx":74 | |
1123 | /* "_proj.pyx":78 | |
884 | 1124 | * self.srs = projstring |
885 | 1125 | * bytestr = _strencode(projstring) |
886 | 1126 | * self.pjinitstring = bytestr # <<<<<<<<<<<<<< |
887 | 1127 | * # initialize projection |
888 | 1128 | * self.projctx = pj_ctx_alloc() |
889 | 1129 | */ |
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;} | |
891 | 1131 | __pyx_v_self->pjinitstring = __pyx_t_2; |
892 | 1132 | |
893 | /* "_proj.pyx":76 | |
1133 | /* "_proj.pyx":80 | |
894 | 1134 | * self.pjinitstring = bytestr |
895 | 1135 | * # initialize projection |
896 | 1136 | * self.projctx = pj_ctx_alloc() # <<<<<<<<<<<<<< |
899 | 1139 | */ |
900 | 1140 | __pyx_v_self->projctx = pj_ctx_alloc(); |
901 | 1141 | |
902 | /* "_proj.pyx":77 | |
1142 | /* "_proj.pyx":81 | |
903 | 1143 | * # initialize projection |
904 | 1144 | * self.projctx = pj_ctx_alloc() |
905 | 1145 | * self.projpj = pj_init_plus_ctx(self.projctx, self.pjinitstring) # <<<<<<<<<<<<<< |
908 | 1148 | */ |
909 | 1149 | __pyx_v_self->projpj = pj_init_plus_ctx(__pyx_v_self->projctx, __pyx_v_self->pjinitstring); |
910 | 1150 | |
911 | /* "_proj.pyx":78 | |
1151 | /* "_proj.pyx":82 | |
912 | 1152 | * self.projctx = pj_ctx_alloc() |
913 | 1153 | * self.projpj = pj_init_plus_ctx(self.projctx, self.pjinitstring) |
914 | 1154 | * err = pj_ctx_get_errno(self.projctx) # <<<<<<<<<<<<<< |
917 | 1157 | */ |
918 | 1158 | __pyx_v_err = pj_ctx_get_errno(__pyx_v_self->projctx); |
919 | 1159 | |
920 | /* "_proj.pyx":79 | |
1160 | /* "_proj.pyx":83 | |
921 | 1161 | * self.projpj = pj_init_plus_ctx(self.projctx, self.pjinitstring) |
922 | 1162 | * err = pj_ctx_get_errno(self.projctx) |
923 | 1163 | * if err != 0: # <<<<<<<<<<<<<< |
924 | 1164 | * raise RuntimeError(pj_strerrno(err)) |
925 | 1165 | * self.proj_version = PJ_VERSION/100. |
926 | 1166 | */ |
927 | __pyx_t_3 = (__pyx_v_err != 0); | |
1167 | __pyx_t_3 = ((__pyx_v_err != 0) != 0); | |
928 | 1168 | if (__pyx_t_3) { |
929 | 1169 | |
930 | /* "_proj.pyx":80 | |
1170 | /* "_proj.pyx":84 | |
931 | 1171 | * err = pj_ctx_get_errno(self.projctx) |
932 | 1172 | * if err != 0: |
933 | 1173 | * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<< |
934 | 1174 | * self.proj_version = PJ_VERSION/100. |
935 | 1175 | * |
936 | 1176 | */ |
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;} | |
938 | 1178 | __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;} | |
940 | 1180 | __Pyx_GOTREF(__pyx_t_4); |
941 | 1181 | PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_1)); |
942 | 1182 | __Pyx_GIVEREF(((PyObject *)__pyx_t_1)); |
943 | 1183 | __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;} | |
945 | 1185 | __Pyx_GOTREF(__pyx_t_1); |
946 | 1186 | __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; |
947 | 1187 | __Pyx_Raise(__pyx_t_1, 0, 0, 0); |
948 | 1188 | __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;} | |
950 | 1190 | goto __pyx_L3; |
951 | 1191 | } |
952 | 1192 | __pyx_L3:; |
953 | 1193 | |
954 | /* "_proj.pyx":81 | |
1194 | /* "_proj.pyx":85 | |
955 | 1195 | * if err != 0: |
956 | 1196 | * raise RuntimeError(pj_strerrno(err)) |
957 | 1197 | * self.proj_version = PJ_VERSION/100. # <<<<<<<<<<<<<< |
958 | 1198 | * |
959 | 1199 | * def __dealloc__(self): |
960 | 1200 | */ |
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;} | |
962 | 1202 | __Pyx_GOTREF(__pyx_t_1); |
963 | 1203 | __Pyx_GIVEREF(__pyx_t_1); |
964 | 1204 | __Pyx_GOTREF(__pyx_v_self->proj_version); |
988 | 1228 | __Pyx_RefNannyFinishContext(); |
989 | 1229 | } |
990 | 1230 | |
991 | /* "_proj.pyx":83 | |
1231 | /* "_proj.pyx":87 | |
992 | 1232 | * self.proj_version = PJ_VERSION/100. |
993 | 1233 | * |
994 | 1234 | * def __dealloc__(self): # <<<<<<<<<<<<<< |
1000 | 1240 | __Pyx_RefNannyDeclarations |
1001 | 1241 | __Pyx_RefNannySetupContext("__dealloc__", 0); |
1002 | 1242 | |
1003 | /* "_proj.pyx":85 | |
1243 | /* "_proj.pyx":89 | |
1004 | 1244 | * def __dealloc__(self): |
1005 | 1245 | * """destroy projection definition""" |
1006 | 1246 | * pj_free(self.projpj) # <<<<<<<<<<<<<< |
1009 | 1249 | */ |
1010 | 1250 | pj_free(__pyx_v_self->projpj); |
1011 | 1251 | |
1012 | /* "_proj.pyx":86 | |
1252 | /* "_proj.pyx":90 | |
1013 | 1253 | * """destroy projection definition""" |
1014 | 1254 | * pj_free(self.projpj) |
1015 | 1255 | * pj_ctx_free(self.projctx) # <<<<<<<<<<<<<< |
1016 | 1256 | * |
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 | * | |
1017 | 1329 | * def __reduce__(self): |
1018 | 1330 | */ |
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); | |
1021 | 1359 | __Pyx_RefNannyFinishContext(); |
1360 | return __pyx_r; | |
1022 | 1361 | } |
1023 | 1362 | |
1024 | 1363 | /* 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) { | |
1028 | 1367 | PyObject *__pyx_r = 0; |
1029 | 1368 | __Pyx_RefNannyDeclarations |
1030 | 1369 | __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)); | |
1032 | 1371 | __Pyx_RefNannyFinishContext(); |
1033 | 1372 | return __pyx_r; |
1034 | 1373 | } |
1035 | 1374 | |
1036 | /* "_proj.pyx":88 | |
1037 | * pj_ctx_free(self.projctx) | |
1375 | /* "_proj.pyx":101 | |
1376 | * return _createproj(initstring) | |
1038 | 1377 | * |
1039 | 1378 | * def __reduce__(self): # <<<<<<<<<<<<<< |
1040 | 1379 | * """special method that allows pyproj.Proj instance to be pickled""" |
1041 | 1380 | * return (self.__class__,(self.srs,)) |
1042 | 1381 | */ |
1043 | 1382 | |
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) { | |
1045 | 1384 | PyObject *__pyx_r = NULL; |
1046 | 1385 | __Pyx_RefNannyDeclarations |
1047 | 1386 | PyObject *__pyx_t_1 = NULL; |
1052 | 1391 | int __pyx_clineno = 0; |
1053 | 1392 | __Pyx_RefNannySetupContext("__reduce__", 0); |
1054 | 1393 | |
1055 | /* "_proj.pyx":90 | |
1394 | /* "_proj.pyx":103 | |
1056 | 1395 | * def __reduce__(self): |
1057 | 1396 | * """special method that allows pyproj.Proj instance to be pickled""" |
1058 | 1397 | * return (self.__class__,(self.srs,)) # <<<<<<<<<<<<<< |
1060 | 1399 | * def _fwd(self, object lons, object lats, radians=False, errcheck=False): |
1061 | 1400 | */ |
1062 | 1401 | __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;} | |
1064 | 1403 | __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;} | |
1066 | 1405 | __Pyx_GOTREF(__pyx_t_2); |
1067 | 1406 | __Pyx_INCREF(__pyx_v_self->srs); |
1068 | 1407 | PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->srs); |
1069 | 1408 | __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;} | |
1071 | 1410 | __Pyx_GOTREF(__pyx_t_3); |
1072 | 1411 | PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); |
1073 | 1412 | __Pyx_GIVEREF(__pyx_t_1); |
1094 | 1433 | } |
1095 | 1434 | |
1096 | 1435 | /* 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) { | |
1100 | 1439 | PyObject *__pyx_v_lons = 0; |
1101 | 1440 | PyObject *__pyx_v_lats = 0; |
1102 | 1441 | PyObject *__pyx_v_radians = 0; |
1103 | 1442 | PyObject *__pyx_v_errcheck = 0; |
1443 | int __pyx_lineno = 0; | |
1444 | const char *__pyx_filename = NULL; | |
1445 | int __pyx_clineno = 0; | |
1104 | 1446 | PyObject *__pyx_r = 0; |
1105 | 1447 | __Pyx_RefNannyDeclarations |
1106 | 1448 | __Pyx_RefNannySetupContext("_fwd (wrapper)", 0); |
1128 | 1470 | case 1: |
1129 | 1471 | if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats)) != 0)) kw_args--; |
1130 | 1472 | 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;} | |
1132 | 1474 | } |
1133 | 1475 | case 2: |
1134 | 1476 | if (kw_args > 0) { |
1142 | 1484 | } |
1143 | 1485 | } |
1144 | 1486 | 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;} | |
1146 | 1488 | } |
1147 | 1489 | } else { |
1148 | 1490 | switch (PyTuple_GET_SIZE(__pyx_args)) { |
1161 | 1503 | } |
1162 | 1504 | goto __pyx_L4_argument_unpacking_done; |
1163 | 1505 | __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;} | |
1165 | 1507 | __pyx_L3_error:; |
1166 | 1508 | __Pyx_AddTraceback("_proj.Proj._fwd", __pyx_clineno, __pyx_lineno, __pyx_filename); |
1167 | 1509 | __Pyx_RefNannyFinishContext(); |
1168 | 1510 | return NULL; |
1169 | 1511 | __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); | |
1171 | 1513 | __Pyx_RefNannyFinishContext(); |
1172 | 1514 | return __pyx_r; |
1173 | 1515 | } |
1174 | 1516 | |
1175 | /* "_proj.pyx":92 | |
1517 | /* "_proj.pyx":105 | |
1176 | 1518 | * return (self.__class__,(self.srs,)) |
1177 | 1519 | * |
1178 | 1520 | * def _fwd(self, object lons, object lats, radians=False, errcheck=False): # <<<<<<<<<<<<<< |
1180 | 1522 | * forward transformation - lons,lats to x,y (done in place). |
1181 | 1523 | */ |
1182 | 1524 | |
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) { | |
1184 | 1526 | projUV __pyx_v_projxyout; |
1185 | 1527 | projUV __pyx_v_projlonlatin; |
1186 | 1528 | Py_ssize_t __pyx_v_buflenx; |
1207 | 1549 | int __pyx_clineno = 0; |
1208 | 1550 | __Pyx_RefNannySetupContext("_fwd", 0); |
1209 | 1551 | |
1210 | /* "_proj.pyx":107 | |
1552 | /* "_proj.pyx":120 | |
1211 | 1553 | * cdef int err |
1212 | 1554 | * # if buffer api is supported, get pointer to data buffers. |
1213 | 1555 | * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0: # <<<<<<<<<<<<<< |
1214 | 1556 | * raise RuntimeError |
1215 | 1557 | * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0: |
1216 | 1558 | */ |
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); | |
1218 | 1560 | if (__pyx_t_1) { |
1219 | 1561 | |
1220 | /* "_proj.pyx":108 | |
1562 | /* "_proj.pyx":121 | |
1221 | 1563 | * # if buffer api is supported, get pointer to data buffers. |
1222 | 1564 | * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0: |
1223 | 1565 | * raise RuntimeError # <<<<<<<<<<<<<< |
1225 | 1567 | * raise RuntimeError |
1226 | 1568 | */ |
1227 | 1569 | __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;} | |
1229 | 1571 | goto __pyx_L3; |
1230 | 1572 | } |
1231 | 1573 | __pyx_L3:; |
1232 | 1574 | |
1233 | /* "_proj.pyx":109 | |
1575 | /* "_proj.pyx":122 | |
1234 | 1576 | * if PyObject_AsWriteBuffer(lons, &londata, &buflenx) <> 0: |
1235 | 1577 | * raise RuntimeError |
1236 | 1578 | * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0: # <<<<<<<<<<<<<< |
1237 | 1579 | * raise RuntimeError |
1238 | 1580 | * # process data in buffer |
1239 | 1581 | */ |
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); | |
1241 | 1583 | if (__pyx_t_1) { |
1242 | 1584 | |
1243 | /* "_proj.pyx":110 | |
1585 | /* "_proj.pyx":123 | |
1244 | 1586 | * raise RuntimeError |
1245 | 1587 | * if PyObject_AsWriteBuffer(lats, &latdata, &bufleny) <> 0: |
1246 | 1588 | * raise RuntimeError # <<<<<<<<<<<<<< |
1248 | 1590 | * if buflenx != bufleny: |
1249 | 1591 | */ |
1250 | 1592 | __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;} | |
1252 | 1594 | goto __pyx_L4; |
1253 | 1595 | } |
1254 | 1596 | __pyx_L4:; |
1255 | 1597 | |
1256 | /* "_proj.pyx":112 | |
1598 | /* "_proj.pyx":125 | |
1257 | 1599 | * raise RuntimeError |
1258 | 1600 | * # process data in buffer |
1259 | 1601 | * if buflenx != bufleny: # <<<<<<<<<<<<<< |
1260 | 1602 | * raise RuntimeError("Buffer lengths not the same") |
1261 | 1603 | * ndim = buflenx//_doublesize |
1262 | 1604 | */ |
1263 | __pyx_t_1 = (__pyx_v_buflenx != __pyx_v_bufleny); | |
1605 | __pyx_t_1 = ((__pyx_v_buflenx != __pyx_v_bufleny) != 0); | |
1264 | 1606 | if (__pyx_t_1) { |
1265 | 1607 | |
1266 | /* "_proj.pyx":113 | |
1608 | /* "_proj.pyx":126 | |
1267 | 1609 | * # process data in buffer |
1268 | 1610 | * if buflenx != bufleny: |
1269 | 1611 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
1270 | 1612 | * ndim = buflenx//_doublesize |
1271 | 1613 | * lonsdata = <double *>londata |
1272 | 1614 | */ |
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;} | |
1274 | 1616 | __Pyx_GOTREF(__pyx_t_2); |
1275 | 1617 | __Pyx_Raise(__pyx_t_2, 0, 0, 0); |
1276 | 1618 | __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;} | |
1278 | 1620 | goto __pyx_L5; |
1279 | 1621 | } |
1280 | 1622 | __pyx_L5:; |
1281 | 1623 | |
1282 | /* "_proj.pyx":114 | |
1624 | /* "_proj.pyx":127 | |
1283 | 1625 | * if buflenx != bufleny: |
1284 | 1626 | * raise RuntimeError("Buffer lengths not the same") |
1285 | 1627 | * ndim = buflenx//_doublesize # <<<<<<<<<<<<<< |
1286 | 1628 | * lonsdata = <double *>londata |
1287 | 1629 | * latsdata = <double *>latdata |
1288 | 1630 | */ |
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;} | |
1290 | 1632 | __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;} | |
1292 | 1634 | __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;} | |
1294 | 1636 | __Pyx_GOTREF(__pyx_t_4); |
1295 | 1637 | __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; |
1296 | 1638 | __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;} | |
1298 | 1640 | __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; |
1299 | 1641 | __pyx_v_ndim = __pyx_t_5; |
1300 | 1642 | |
1301 | /* "_proj.pyx":115 | |
1643 | /* "_proj.pyx":128 | |
1302 | 1644 | * raise RuntimeError("Buffer lengths not the same") |
1303 | 1645 | * ndim = buflenx//_doublesize |
1304 | 1646 | * lonsdata = <double *>londata # <<<<<<<<<<<<<< |
1307 | 1649 | */ |
1308 | 1650 | __pyx_v_lonsdata = ((double *)__pyx_v_londata); |
1309 | 1651 | |
1310 | /* "_proj.pyx":116 | |
1652 | /* "_proj.pyx":129 | |
1311 | 1653 | * ndim = buflenx//_doublesize |
1312 | 1654 | * lonsdata = <double *>londata |
1313 | 1655 | * latsdata = <double *>latdata # <<<<<<<<<<<<<< |
1316 | 1658 | */ |
1317 | 1659 | __pyx_v_latsdata = ((double *)__pyx_v_latdata); |
1318 | 1660 | |
1319 | /* "_proj.pyx":117 | |
1661 | /* "_proj.pyx":130 | |
1320 | 1662 | * lonsdata = <double *>londata |
1321 | 1663 | * latsdata = <double *>latdata |
1322 | 1664 | * for i from 0 <= i < ndim: # <<<<<<<<<<<<<< |
1326 | 1668 | __pyx_t_5 = __pyx_v_ndim; |
1327 | 1669 | for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { |
1328 | 1670 | |
1329 | /* "_proj.pyx":119 | |
1671 | /* "_proj.pyx":132 | |
1330 | 1672 | * for i from 0 <= i < ndim: |
1331 | 1673 | * # if inputs are nan's, return big number. |
1332 | 1674 | * if lonsdata[i] != lonsdata[i] or latsdata[i] != latsdata[i]: # <<<<<<<<<<<<<< |
1333 | 1675 | * lonsdata[i]=1.e30; latsdata[i]=1.e30 |
1334 | 1676 | * if errcheck: |
1335 | 1677 | */ |
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); | |
1337 | 1679 | 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); | |
1339 | 1681 | __pyx_t_7 = __pyx_t_6; |
1340 | 1682 | } else { |
1341 | 1683 | __pyx_t_7 = __pyx_t_1; |
1342 | 1684 | } |
1343 | 1685 | if (__pyx_t_7) { |
1344 | 1686 | |
1345 | /* "_proj.pyx":120 | |
1687 | /* "_proj.pyx":133 | |
1346 | 1688 | * # if inputs are nan's, return big number. |
1347 | 1689 | * if lonsdata[i] != lonsdata[i] or latsdata[i] != latsdata[i]: |
1348 | 1690 | * lonsdata[i]=1.e30; latsdata[i]=1.e30 # <<<<<<<<<<<<<< |
1352 | 1694 | (__pyx_v_lonsdata[__pyx_v_i]) = 1.e30; |
1353 | 1695 | (__pyx_v_latsdata[__pyx_v_i]) = 1.e30; |
1354 | 1696 | |
1355 | /* "_proj.pyx":121 | |
1697 | /* "_proj.pyx":134 | |
1356 | 1698 | * if lonsdata[i] != lonsdata[i] or latsdata[i] != latsdata[i]: |
1357 | 1699 | * lonsdata[i]=1.e30; latsdata[i]=1.e30 |
1358 | 1700 | * if errcheck: # <<<<<<<<<<<<<< |
1359 | 1701 | * raise RuntimeError('projection undefined') |
1360 | 1702 | * continue |
1361 | 1703 | */ |
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;} | |
1363 | 1705 | if (__pyx_t_7) { |
1364 | 1706 | |
1365 | /* "_proj.pyx":122 | |
1707 | /* "_proj.pyx":135 | |
1366 | 1708 | * lonsdata[i]=1.e30; latsdata[i]=1.e30 |
1367 | 1709 | * if errcheck: |
1368 | 1710 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
1369 | 1711 | * continue |
1370 | 1712 | * if radians: |
1371 | 1713 | */ |
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;} | |
1373 | 1715 | __Pyx_GOTREF(__pyx_t_4); |
1374 | 1716 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
1375 | 1717 | __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;} | |
1377 | 1719 | goto __pyx_L9; |
1378 | 1720 | } |
1379 | 1721 | __pyx_L9:; |
1380 | 1722 | |
1381 | /* "_proj.pyx":123 | |
1723 | /* "_proj.pyx":136 | |
1382 | 1724 | * if errcheck: |
1383 | 1725 | * raise RuntimeError('projection undefined') |
1384 | 1726 | * continue # <<<<<<<<<<<<<< |
1390 | 1732 | } |
1391 | 1733 | __pyx_L8:; |
1392 | 1734 | |
1393 | /* "_proj.pyx":124 | |
1735 | /* "_proj.pyx":137 | |
1394 | 1736 | * raise RuntimeError('projection undefined') |
1395 | 1737 | * continue |
1396 | 1738 | * if radians: # <<<<<<<<<<<<<< |
1397 | 1739 | * projlonlatin.u = lonsdata[i] |
1398 | 1740 | * projlonlatin.v = latsdata[i] |
1399 | 1741 | */ |
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;} | |
1401 | 1743 | if (__pyx_t_7) { |
1402 | 1744 | |
1403 | /* "_proj.pyx":125 | |
1745 | /* "_proj.pyx":138 | |
1404 | 1746 | * continue |
1405 | 1747 | * if radians: |
1406 | 1748 | * projlonlatin.u = lonsdata[i] # <<<<<<<<<<<<<< |
1409 | 1751 | */ |
1410 | 1752 | __pyx_v_projlonlatin.u = (__pyx_v_lonsdata[__pyx_v_i]); |
1411 | 1753 | |
1412 | /* "_proj.pyx":126 | |
1754 | /* "_proj.pyx":139 | |
1413 | 1755 | * if radians: |
1414 | 1756 | * projlonlatin.u = lonsdata[i] |
1415 | 1757 | * projlonlatin.v = latsdata[i] # <<<<<<<<<<<<<< |
1421 | 1763 | } |
1422 | 1764 | /*else*/ { |
1423 | 1765 | |
1424 | /* "_proj.pyx":128 | |
1766 | /* "_proj.pyx":141 | |
1425 | 1767 | * projlonlatin.v = latsdata[i] |
1426 | 1768 | * else: |
1427 | 1769 | * projlonlatin.u = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<< |
1430 | 1772 | */ |
1431 | 1773 | __pyx_v_projlonlatin.u = (__pyx_v_5_proj__dg2rad * (__pyx_v_lonsdata[__pyx_v_i])); |
1432 | 1774 | |
1433 | /* "_proj.pyx":129 | |
1775 | /* "_proj.pyx":142 | |
1434 | 1776 | * else: |
1435 | 1777 | * projlonlatin.u = _dg2rad*lonsdata[i] |
1436 | 1778 | * projlonlatin.v = _dg2rad*latsdata[i] # <<<<<<<<<<<<<< |
1441 | 1783 | } |
1442 | 1784 | __pyx_L10:; |
1443 | 1785 | |
1444 | /* "_proj.pyx":130 | |
1786 | /* "_proj.pyx":143 | |
1445 | 1787 | * projlonlatin.u = _dg2rad*lonsdata[i] |
1446 | 1788 | * projlonlatin.v = _dg2rad*latsdata[i] |
1447 | 1789 | * projxyout = pj_fwd(projlonlatin,self.projpj) # <<<<<<<<<<<<<< |
1450 | 1792 | */ |
1451 | 1793 | __pyx_v_projxyout = pj_fwd(__pyx_v_projlonlatin, __pyx_v_self->projpj); |
1452 | 1794 | |
1453 | /* "_proj.pyx":131 | |
1795 | /* "_proj.pyx":144 | |
1454 | 1796 | * projlonlatin.v = _dg2rad*latsdata[i] |
1455 | 1797 | * projxyout = pj_fwd(projlonlatin,self.projpj) |
1456 | 1798 | * if errcheck: # <<<<<<<<<<<<<< |
1457 | 1799 | * err = pj_ctx_get_errno(self.projctx) |
1458 | 1800 | * if err != 0: |
1459 | 1801 | */ |
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;} | |
1461 | 1803 | if (__pyx_t_7) { |
1462 | 1804 | |
1463 | /* "_proj.pyx":132 | |
1805 | /* "_proj.pyx":145 | |
1464 | 1806 | * projxyout = pj_fwd(projlonlatin,self.projpj) |
1465 | 1807 | * if errcheck: |
1466 | 1808 | * err = pj_ctx_get_errno(self.projctx) # <<<<<<<<<<<<<< |
1469 | 1811 | */ |
1470 | 1812 | __pyx_v_err = pj_ctx_get_errno(__pyx_v_self->projctx); |
1471 | 1813 | |
1472 | /* "_proj.pyx":133 | |
1814 | /* "_proj.pyx":146 | |
1473 | 1815 | * if errcheck: |
1474 | 1816 | * err = pj_ctx_get_errno(self.projctx) |
1475 | 1817 | * if err != 0: # <<<<<<<<<<<<<< |
1476 | 1818 | * raise RuntimeError(pj_strerrno(err)) |
1477 | 1819 | * # since HUGE_VAL can be 'inf', |
1478 | 1820 | */ |
1479 | __pyx_t_7 = (__pyx_v_err != 0); | |
1821 | __pyx_t_7 = ((__pyx_v_err != 0) != 0); | |
1480 | 1822 | if (__pyx_t_7) { |
1481 | 1823 | |
1482 | /* "_proj.pyx":134 | |
1824 | /* "_proj.pyx":147 | |
1483 | 1825 | * err = pj_ctx_get_errno(self.projctx) |
1484 | 1826 | * if err != 0: |
1485 | 1827 | * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<< |
1486 | 1828 | * # since HUGE_VAL can be 'inf', |
1487 | 1829 | * # change it to a real (but very large) number. |
1488 | 1830 | */ |
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;} | |
1490 | 1832 | __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;} | |
1492 | 1834 | __Pyx_GOTREF(__pyx_t_3); |
1493 | 1835 | PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); |
1494 | 1836 | __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); |
1495 | 1837 | __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;} | |
1497 | 1839 | __Pyx_GOTREF(__pyx_t_4); |
1498 | 1840 | __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; |
1499 | 1841 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
1500 | 1842 | __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;} | |
1502 | 1844 | goto __pyx_L12; |
1503 | 1845 | } |
1504 | 1846 | __pyx_L12:; |
1506 | 1848 | } |
1507 | 1849 | __pyx_L11:; |
1508 | 1850 | |
1509 | /* "_proj.pyx":138 | |
1851 | /* "_proj.pyx":151 | |
1510 | 1852 | * # change it to a real (but very large) number. |
1511 | 1853 | * # also check for NaNs. |
1512 | 1854 | * if projxyout.u == HUGE_VAL or\ # <<<<<<<<<<<<<< |
1513 | 1855 | * projxyout.u != projxyout.u: |
1514 | 1856 | * if errcheck: |
1515 | 1857 | */ |
1516 | __pyx_t_7 = (__pyx_v_projxyout.u == HUGE_VAL); | |
1858 | __pyx_t_7 = ((__pyx_v_projxyout.u == HUGE_VAL) != 0); | |
1517 | 1859 | if (!__pyx_t_7) { |
1518 | 1860 | |
1519 | /* "_proj.pyx":139 | |
1861 | /* "_proj.pyx":152 | |
1520 | 1862 | * # also check for NaNs. |
1521 | 1863 | * if projxyout.u == HUGE_VAL or\ |
1522 | 1864 | * projxyout.u != projxyout.u: # <<<<<<<<<<<<<< |
1523 | 1865 | * if errcheck: |
1524 | 1866 | * raise RuntimeError('projection undefined') |
1525 | 1867 | */ |
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); | |
1527 | 1869 | __pyx_t_6 = __pyx_t_1; |
1528 | 1870 | } else { |
1529 | 1871 | __pyx_t_6 = __pyx_t_7; |
1530 | 1872 | } |
1531 | 1873 | if (__pyx_t_6) { |
1532 | 1874 | |
1533 | /* "_proj.pyx":140 | |
1875 | /* "_proj.pyx":153 | |
1534 | 1876 | * if projxyout.u == HUGE_VAL or\ |
1535 | 1877 | * projxyout.u != projxyout.u: |
1536 | 1878 | * if errcheck: # <<<<<<<<<<<<<< |
1537 | 1879 | * raise RuntimeError('projection undefined') |
1538 | 1880 | * lonsdata[i] = 1.e30 |
1539 | 1881 | */ |
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;} | |
1541 | 1883 | if (__pyx_t_6) { |
1542 | 1884 | |
1543 | /* "_proj.pyx":141 | |
1885 | /* "_proj.pyx":154 | |
1544 | 1886 | * projxyout.u != projxyout.u: |
1545 | 1887 | * if errcheck: |
1546 | 1888 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
1547 | 1889 | * lonsdata[i] = 1.e30 |
1548 | 1890 | * else: |
1549 | 1891 | */ |
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;} | |
1551 | 1893 | __Pyx_GOTREF(__pyx_t_4); |
1552 | 1894 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
1553 | 1895 | __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;} | |
1555 | 1897 | goto __pyx_L14; |
1556 | 1898 | } |
1557 | 1899 | __pyx_L14:; |
1558 | 1900 | |
1559 | /* "_proj.pyx":142 | |
1901 | /* "_proj.pyx":155 | |
1560 | 1902 | * if errcheck: |
1561 | 1903 | * raise RuntimeError('projection undefined') |
1562 | 1904 | * lonsdata[i] = 1.e30 # <<<<<<<<<<<<<< |
1568 | 1910 | } |
1569 | 1911 | /*else*/ { |
1570 | 1912 | |
1571 | /* "_proj.pyx":144 | |
1913 | /* "_proj.pyx":157 | |
1572 | 1914 | * lonsdata[i] = 1.e30 |
1573 | 1915 | * else: |
1574 | 1916 | * lonsdata[i] = projxyout.u # <<<<<<<<<<<<<< |
1580 | 1922 | } |
1581 | 1923 | __pyx_L13:; |
1582 | 1924 | |
1583 | /* "_proj.pyx":145 | |
1925 | /* "_proj.pyx":158 | |
1584 | 1926 | * else: |
1585 | 1927 | * lonsdata[i] = projxyout.u |
1586 | 1928 | * if projxyout.v == HUGE_VAL or\ # <<<<<<<<<<<<<< |
1587 | 1929 | * projxyout.u != projxyout.u: |
1588 | 1930 | * if errcheck: |
1589 | 1931 | */ |
1590 | __pyx_t_6 = (__pyx_v_projxyout.v == HUGE_VAL); | |
1932 | __pyx_t_6 = ((__pyx_v_projxyout.v == HUGE_VAL) != 0); | |
1591 | 1933 | if (!__pyx_t_6) { |
1592 | 1934 | |
1593 | /* "_proj.pyx":146 | |
1935 | /* "_proj.pyx":159 | |
1594 | 1936 | * lonsdata[i] = projxyout.u |
1595 | 1937 | * if projxyout.v == HUGE_VAL or\ |
1596 | 1938 | * projxyout.u != projxyout.u: # <<<<<<<<<<<<<< |
1597 | 1939 | * if errcheck: |
1598 | 1940 | * raise RuntimeError('projection undefined') |
1599 | 1941 | */ |
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); | |
1601 | 1943 | __pyx_t_1 = __pyx_t_7; |
1602 | 1944 | } else { |
1603 | 1945 | __pyx_t_1 = __pyx_t_6; |
1604 | 1946 | } |
1605 | 1947 | if (__pyx_t_1) { |
1606 | 1948 | |
1607 | /* "_proj.pyx":147 | |
1949 | /* "_proj.pyx":160 | |
1608 | 1950 | * if projxyout.v == HUGE_VAL or\ |
1609 | 1951 | * projxyout.u != projxyout.u: |
1610 | 1952 | * if errcheck: # <<<<<<<<<<<<<< |
1611 | 1953 | * raise RuntimeError('projection undefined') |
1612 | 1954 | * latsdata[i] = 1.e30 |
1613 | 1955 | */ |
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;} | |
1615 | 1957 | if (__pyx_t_1) { |
1616 | 1958 | |
1617 | /* "_proj.pyx":148 | |
1959 | /* "_proj.pyx":161 | |
1618 | 1960 | * projxyout.u != projxyout.u: |
1619 | 1961 | * if errcheck: |
1620 | 1962 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
1621 | 1963 | * latsdata[i] = 1.e30 |
1622 | 1964 | * else: |
1623 | 1965 | */ |
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;} | |
1625 | 1967 | __Pyx_GOTREF(__pyx_t_4); |
1626 | 1968 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
1627 | 1969 | __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;} | |
1629 | 1971 | goto __pyx_L16; |
1630 | 1972 | } |
1631 | 1973 | __pyx_L16:; |
1632 | 1974 | |
1633 | /* "_proj.pyx":149 | |
1975 | /* "_proj.pyx":162 | |
1634 | 1976 | * if errcheck: |
1635 | 1977 | * raise RuntimeError('projection undefined') |
1636 | 1978 | * latsdata[i] = 1.e30 # <<<<<<<<<<<<<< |
1642 | 1984 | } |
1643 | 1985 | /*else*/ { |
1644 | 1986 | |
1645 | /* "_proj.pyx":151 | |
1987 | /* "_proj.pyx":164 | |
1646 | 1988 | * latsdata[i] = 1.e30 |
1647 | 1989 | * else: |
1648 | 1990 | * latsdata[i] = projxyout.v # <<<<<<<<<<<<<< |
1671 | 2013 | } |
1672 | 2014 | |
1673 | 2015 | /* 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) { | |
1677 | 2019 | PyObject *__pyx_v_x = 0; |
1678 | 2020 | PyObject *__pyx_v_y = 0; |
1679 | 2021 | PyObject *__pyx_v_radians = 0; |
1680 | 2022 | PyObject *__pyx_v_errcheck = 0; |
2023 | int __pyx_lineno = 0; | |
2024 | const char *__pyx_filename = NULL; | |
2025 | int __pyx_clineno = 0; | |
1681 | 2026 | PyObject *__pyx_r = 0; |
1682 | 2027 | __Pyx_RefNannyDeclarations |
1683 | 2028 | __Pyx_RefNannySetupContext("_inv (wrapper)", 0); |
1705 | 2050 | case 1: |
1706 | 2051 | if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--; |
1707 | 2052 | 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;} | |
1709 | 2054 | } |
1710 | 2055 | case 2: |
1711 | 2056 | if (kw_args > 0) { |
1719 | 2064 | } |
1720 | 2065 | } |
1721 | 2066 | 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;} | |
1723 | 2068 | } |
1724 | 2069 | } else { |
1725 | 2070 | switch (PyTuple_GET_SIZE(__pyx_args)) { |
1738 | 2083 | } |
1739 | 2084 | goto __pyx_L4_argument_unpacking_done; |
1740 | 2085 | __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;} | |
1742 | 2087 | __pyx_L3_error:; |
1743 | 2088 | __Pyx_AddTraceback("_proj.Proj._inv", __pyx_clineno, __pyx_lineno, __pyx_filename); |
1744 | 2089 | __Pyx_RefNannyFinishContext(); |
1745 | 2090 | return NULL; |
1746 | 2091 | __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); | |
1748 | 2093 | __Pyx_RefNannyFinishContext(); |
1749 | 2094 | return __pyx_r; |
1750 | 2095 | } |
1751 | 2096 | |
1752 | /* "_proj.pyx":153 | |
2097 | /* "_proj.pyx":166 | |
1753 | 2098 | * latsdata[i] = projxyout.v |
1754 | 2099 | * |
1755 | 2100 | * def _inv(self, object x, object y, radians=False, errcheck=False): # <<<<<<<<<<<<<< |
1757 | 2102 | * inverse transformation - x,y to lons,lats (done in place). |
1758 | 2103 | */ |
1759 | 2104 | |
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) { | |
1761 | 2106 | projUV __pyx_v_projxyin; |
1762 | 2107 | projUV __pyx_v_projlonlatout; |
1763 | 2108 | Py_ssize_t __pyx_v_buflenx; |
1784 | 2129 | int __pyx_clineno = 0; |
1785 | 2130 | __Pyx_RefNannySetupContext("_inv", 0); |
1786 | 2131 | |
1787 | /* "_proj.pyx":167 | |
2132 | /* "_proj.pyx":180 | |
1788 | 2133 | * cdef double *xdatab, *ydatab |
1789 | 2134 | * # if buffer api is supported, get pointer to data buffers. |
1790 | 2135 | * if PyObject_AsWriteBuffer(x, &xdata, &buflenx) <> 0: # <<<<<<<<<<<<<< |
1791 | 2136 | * raise RuntimeError |
1792 | 2137 | * if PyObject_AsWriteBuffer(y, &ydata, &bufleny) <> 0: |
1793 | 2138 | */ |
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); | |
1795 | 2140 | if (__pyx_t_1) { |
1796 | 2141 | |
1797 | /* "_proj.pyx":168 | |
2142 | /* "_proj.pyx":181 | |
1798 | 2143 | * # if buffer api is supported, get pointer to data buffers. |
1799 | 2144 | * if PyObject_AsWriteBuffer(x, &xdata, &buflenx) <> 0: |
1800 | 2145 | * raise RuntimeError # <<<<<<<<<<<<<< |
1802 | 2147 | * raise RuntimeError |
1803 | 2148 | */ |
1804 | 2149 | __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;} | |
1806 | 2151 | goto __pyx_L3; |
1807 | 2152 | } |
1808 | 2153 | __pyx_L3:; |
1809 | 2154 | |
1810 | /* "_proj.pyx":169 | |
2155 | /* "_proj.pyx":182 | |
1811 | 2156 | * if PyObject_AsWriteBuffer(x, &xdata, &buflenx) <> 0: |
1812 | 2157 | * raise RuntimeError |
1813 | 2158 | * if PyObject_AsWriteBuffer(y, &ydata, &bufleny) <> 0: # <<<<<<<<<<<<<< |
1814 | 2159 | * raise RuntimeError |
1815 | 2160 | * # process data in buffer |
1816 | 2161 | */ |
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); | |
1818 | 2163 | if (__pyx_t_1) { |
1819 | 2164 | |
1820 | /* "_proj.pyx":170 | |
2165 | /* "_proj.pyx":183 | |
1821 | 2166 | * raise RuntimeError |
1822 | 2167 | * if PyObject_AsWriteBuffer(y, &ydata, &bufleny) <> 0: |
1823 | 2168 | * raise RuntimeError # <<<<<<<<<<<<<< |
1825 | 2170 | * # (for numpy/regular python arrays). |
1826 | 2171 | */ |
1827 | 2172 | __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;} | |
1829 | 2174 | goto __pyx_L4; |
1830 | 2175 | } |
1831 | 2176 | __pyx_L4:; |
1832 | 2177 | |
1833 | /* "_proj.pyx":173 | |
2178 | /* "_proj.pyx":186 | |
1834 | 2179 | * # process data in buffer |
1835 | 2180 | * # (for numpy/regular python arrays). |
1836 | 2181 | * if buflenx != bufleny: # <<<<<<<<<<<<<< |
1837 | 2182 | * raise RuntimeError("Buffer lengths not the same") |
1838 | 2183 | * ndim = buflenx//_doublesize |
1839 | 2184 | */ |
1840 | __pyx_t_1 = (__pyx_v_buflenx != __pyx_v_bufleny); | |
2185 | __pyx_t_1 = ((__pyx_v_buflenx != __pyx_v_bufleny) != 0); | |
1841 | 2186 | if (__pyx_t_1) { |
1842 | 2187 | |
1843 | /* "_proj.pyx":174 | |
2188 | /* "_proj.pyx":187 | |
1844 | 2189 | * # (for numpy/regular python arrays). |
1845 | 2190 | * if buflenx != bufleny: |
1846 | 2191 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
1847 | 2192 | * ndim = buflenx//_doublesize |
1848 | 2193 | * xdatab = <double *>xdata |
1849 | 2194 | */ |
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;} | |
1851 | 2196 | __Pyx_GOTREF(__pyx_t_2); |
1852 | 2197 | __Pyx_Raise(__pyx_t_2, 0, 0, 0); |
1853 | 2198 | __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;} | |
1855 | 2200 | goto __pyx_L5; |
1856 | 2201 | } |
1857 | 2202 | __pyx_L5:; |
1858 | 2203 | |
1859 | /* "_proj.pyx":175 | |
2204 | /* "_proj.pyx":188 | |
1860 | 2205 | * if buflenx != bufleny: |
1861 | 2206 | * raise RuntimeError("Buffer lengths not the same") |
1862 | 2207 | * ndim = buflenx//_doublesize # <<<<<<<<<<<<<< |
1863 | 2208 | * xdatab = <double *>xdata |
1864 | 2209 | * ydatab = <double *>ydata |
1865 | 2210 | */ |
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;} | |
1867 | 2212 | __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;} | |
1869 | 2214 | __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;} | |
1871 | 2216 | __Pyx_GOTREF(__pyx_t_4); |
1872 | 2217 | __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; |
1873 | 2218 | __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;} | |
1875 | 2220 | __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; |
1876 | 2221 | __pyx_v_ndim = __pyx_t_5; |
1877 | 2222 | |
1878 | /* "_proj.pyx":176 | |
2223 | /* "_proj.pyx":189 | |
1879 | 2224 | * raise RuntimeError("Buffer lengths not the same") |
1880 | 2225 | * ndim = buflenx//_doublesize |
1881 | 2226 | * xdatab = <double *>xdata # <<<<<<<<<<<<<< |
1884 | 2229 | */ |
1885 | 2230 | __pyx_v_xdatab = ((double *)__pyx_v_xdata); |
1886 | 2231 | |
1887 | /* "_proj.pyx":177 | |
2232 | /* "_proj.pyx":190 | |
1888 | 2233 | * ndim = buflenx//_doublesize |
1889 | 2234 | * xdatab = <double *>xdata |
1890 | 2235 | * ydatab = <double *>ydata # <<<<<<<<<<<<<< |
1893 | 2238 | */ |
1894 | 2239 | __pyx_v_ydatab = ((double *)__pyx_v_ydata); |
1895 | 2240 | |
1896 | /* "_proj.pyx":178 | |
2241 | /* "_proj.pyx":191 | |
1897 | 2242 | * xdatab = <double *>xdata |
1898 | 2243 | * ydatab = <double *>ydata |
1899 | 2244 | * for i from 0 <= i < ndim: # <<<<<<<<<<<<<< |
1903 | 2248 | __pyx_t_5 = __pyx_v_ndim; |
1904 | 2249 | for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) { |
1905 | 2250 | |
1906 | /* "_proj.pyx":180 | |
2251 | /* "_proj.pyx":193 | |
1907 | 2252 | * for i from 0 <= i < ndim: |
1908 | 2253 | * # if inputs are nan's, return big number. |
1909 | 2254 | * if xdatab[i] != xdatab[i] or ydatab[i] != ydatab[i]: # <<<<<<<<<<<<<< |
1910 | 2255 | * xdatab[i]=1.e30; ydatab[i]=1.e30 |
1911 | 2256 | * if errcheck: |
1912 | 2257 | */ |
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); | |
1914 | 2259 | 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); | |
1916 | 2261 | __pyx_t_7 = __pyx_t_6; |
1917 | 2262 | } else { |
1918 | 2263 | __pyx_t_7 = __pyx_t_1; |
1919 | 2264 | } |
1920 | 2265 | if (__pyx_t_7) { |
1921 | 2266 | |
1922 | /* "_proj.pyx":181 | |
2267 | /* "_proj.pyx":194 | |
1923 | 2268 | * # if inputs are nan's, return big number. |
1924 | 2269 | * if xdatab[i] != xdatab[i] or ydatab[i] != ydatab[i]: |
1925 | 2270 | * xdatab[i]=1.e30; ydatab[i]=1.e30 # <<<<<<<<<<<<<< |
1929 | 2274 | (__pyx_v_xdatab[__pyx_v_i]) = 1.e30; |
1930 | 2275 | (__pyx_v_ydatab[__pyx_v_i]) = 1.e30; |
1931 | 2276 | |
1932 | /* "_proj.pyx":182 | |
2277 | /* "_proj.pyx":195 | |
1933 | 2278 | * if xdatab[i] != xdatab[i] or ydatab[i] != ydatab[i]: |
1934 | 2279 | * xdatab[i]=1.e30; ydatab[i]=1.e30 |
1935 | 2280 | * if errcheck: # <<<<<<<<<<<<<< |
1936 | 2281 | * raise RuntimeError('projection undefined') |
1937 | 2282 | * continue |
1938 | 2283 | */ |
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;} | |
1940 | 2285 | if (__pyx_t_7) { |
1941 | 2286 | |
1942 | /* "_proj.pyx":183 | |
2287 | /* "_proj.pyx":196 | |
1943 | 2288 | * xdatab[i]=1.e30; ydatab[i]=1.e30 |
1944 | 2289 | * if errcheck: |
1945 | 2290 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
1946 | 2291 | * continue |
1947 | 2292 | * projxyin.u = xdatab[i] |
1948 | 2293 | */ |
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;} | |
1950 | 2295 | __Pyx_GOTREF(__pyx_t_4); |
1951 | 2296 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
1952 | 2297 | __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;} | |
1954 | 2299 | goto __pyx_L9; |
1955 | 2300 | } |
1956 | 2301 | __pyx_L9:; |
1957 | 2302 | |
1958 | /* "_proj.pyx":184 | |
2303 | /* "_proj.pyx":197 | |
1959 | 2304 | * if errcheck: |
1960 | 2305 | * raise RuntimeError('projection undefined') |
1961 | 2306 | * continue # <<<<<<<<<<<<<< |
1967 | 2312 | } |
1968 | 2313 | __pyx_L8:; |
1969 | 2314 | |
1970 | /* "_proj.pyx":185 | |
2315 | /* "_proj.pyx":198 | |
1971 | 2316 | * raise RuntimeError('projection undefined') |
1972 | 2317 | * continue |
1973 | 2318 | * projxyin.u = xdatab[i] # <<<<<<<<<<<<<< |
1976 | 2321 | */ |
1977 | 2322 | __pyx_v_projxyin.u = (__pyx_v_xdatab[__pyx_v_i]); |
1978 | 2323 | |
1979 | /* "_proj.pyx":186 | |
2324 | /* "_proj.pyx":199 | |
1980 | 2325 | * continue |
1981 | 2326 | * projxyin.u = xdatab[i] |
1982 | 2327 | * projxyin.v = ydatab[i] # <<<<<<<<<<<<<< |
1985 | 2330 | */ |
1986 | 2331 | __pyx_v_projxyin.v = (__pyx_v_ydatab[__pyx_v_i]); |
1987 | 2332 | |
1988 | /* "_proj.pyx":187 | |
2333 | /* "_proj.pyx":200 | |
1989 | 2334 | * projxyin.u = xdatab[i] |
1990 | 2335 | * projxyin.v = ydatab[i] |
1991 | 2336 | * projlonlatout = pj_inv(projxyin,self.projpj) # <<<<<<<<<<<<<< |
1994 | 2339 | */ |
1995 | 2340 | __pyx_v_projlonlatout = pj_inv(__pyx_v_projxyin, __pyx_v_self->projpj); |
1996 | 2341 | |
1997 | /* "_proj.pyx":188 | |
2342 | /* "_proj.pyx":201 | |
1998 | 2343 | * projxyin.v = ydatab[i] |
1999 | 2344 | * projlonlatout = pj_inv(projxyin,self.projpj) |
2000 | 2345 | * if errcheck: # <<<<<<<<<<<<<< |
2001 | 2346 | * err = pj_ctx_get_errno(self.projctx) |
2002 | 2347 | * if err != 0: |
2003 | 2348 | */ |
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;} | |
2005 | 2350 | if (__pyx_t_7) { |
2006 | 2351 | |
2007 | /* "_proj.pyx":189 | |
2352 | /* "_proj.pyx":202 | |
2008 | 2353 | * projlonlatout = pj_inv(projxyin,self.projpj) |
2009 | 2354 | * if errcheck: |
2010 | 2355 | * err = pj_ctx_get_errno(self.projctx) # <<<<<<<<<<<<<< |
2013 | 2358 | */ |
2014 | 2359 | __pyx_v_err = pj_ctx_get_errno(__pyx_v_self->projctx); |
2015 | 2360 | |
2016 | /* "_proj.pyx":190 | |
2361 | /* "_proj.pyx":203 | |
2017 | 2362 | * if errcheck: |
2018 | 2363 | * err = pj_ctx_get_errno(self.projctx) |
2019 | 2364 | * if err != 0: # <<<<<<<<<<<<<< |
2020 | 2365 | * raise RuntimeError(pj_strerrno(err)) |
2021 | 2366 | * # since HUGE_VAL can be 'inf', |
2022 | 2367 | */ |
2023 | __pyx_t_7 = (__pyx_v_err != 0); | |
2368 | __pyx_t_7 = ((__pyx_v_err != 0) != 0); | |
2024 | 2369 | if (__pyx_t_7) { |
2025 | 2370 | |
2026 | /* "_proj.pyx":191 | |
2371 | /* "_proj.pyx":204 | |
2027 | 2372 | * err = pj_ctx_get_errno(self.projctx) |
2028 | 2373 | * if err != 0: |
2029 | 2374 | * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<< |
2030 | 2375 | * # since HUGE_VAL can be 'inf', |
2031 | 2376 | * # change it to a real (but very large) number. |
2032 | 2377 | */ |
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;} | |
2034 | 2379 | __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;} | |
2036 | 2381 | __Pyx_GOTREF(__pyx_t_3); |
2037 | 2382 | PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); |
2038 | 2383 | __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); |
2039 | 2384 | __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;} | |
2041 | 2386 | __Pyx_GOTREF(__pyx_t_4); |
2042 | 2387 | __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; |
2043 | 2388 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
2044 | 2389 | __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;} | |
2046 | 2391 | goto __pyx_L11; |
2047 | 2392 | } |
2048 | 2393 | __pyx_L11:; |
2050 | 2395 | } |
2051 | 2396 | __pyx_L10:; |
2052 | 2397 | |
2053 | /* "_proj.pyx":195 | |
2398 | /* "_proj.pyx":208 | |
2054 | 2399 | * # change it to a real (but very large) number. |
2055 | 2400 | * # also check for NaNs. |
2056 | 2401 | * if projlonlatout.u == HUGE_VAL or \ # <<<<<<<<<<<<<< |
2057 | 2402 | * projlonlatout.u != projlonlatout.u: |
2058 | 2403 | * if errcheck: |
2059 | 2404 | */ |
2060 | __pyx_t_7 = (__pyx_v_projlonlatout.u == HUGE_VAL); | |
2405 | __pyx_t_7 = ((__pyx_v_projlonlatout.u == HUGE_VAL) != 0); | |
2061 | 2406 | if (!__pyx_t_7) { |
2062 | 2407 | |
2063 | /* "_proj.pyx":196 | |
2408 | /* "_proj.pyx":209 | |
2064 | 2409 | * # also check for NaNs. |
2065 | 2410 | * if projlonlatout.u == HUGE_VAL or \ |
2066 | 2411 | * projlonlatout.u != projlonlatout.u: # <<<<<<<<<<<<<< |
2067 | 2412 | * if errcheck: |
2068 | 2413 | * raise RuntimeError('projection undefined') |
2069 | 2414 | */ |
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); | |
2071 | 2416 | __pyx_t_6 = __pyx_t_1; |
2072 | 2417 | } else { |
2073 | 2418 | __pyx_t_6 = __pyx_t_7; |
2074 | 2419 | } |
2075 | 2420 | if (__pyx_t_6) { |
2076 | 2421 | |
2077 | /* "_proj.pyx":197 | |
2422 | /* "_proj.pyx":210 | |
2078 | 2423 | * if projlonlatout.u == HUGE_VAL or \ |
2079 | 2424 | * projlonlatout.u != projlonlatout.u: |
2080 | 2425 | * if errcheck: # <<<<<<<<<<<<<< |
2081 | 2426 | * raise RuntimeError('projection undefined') |
2082 | 2427 | * xdatab[i] = 1.e30 |
2083 | 2428 | */ |
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;} | |
2085 | 2430 | if (__pyx_t_6) { |
2086 | 2431 | |
2087 | /* "_proj.pyx":198 | |
2432 | /* "_proj.pyx":211 | |
2088 | 2433 | * projlonlatout.u != projlonlatout.u: |
2089 | 2434 | * if errcheck: |
2090 | 2435 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
2091 | 2436 | * xdatab[i] = 1.e30 |
2092 | 2437 | * elif radians: |
2093 | 2438 | */ |
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;} | |
2095 | 2440 | __Pyx_GOTREF(__pyx_t_4); |
2096 | 2441 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
2097 | 2442 | __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;} | |
2099 | 2444 | goto __pyx_L13; |
2100 | 2445 | } |
2101 | 2446 | __pyx_L13:; |
2102 | 2447 | |
2103 | /* "_proj.pyx":199 | |
2448 | /* "_proj.pyx":212 | |
2104 | 2449 | * if errcheck: |
2105 | 2450 | * raise RuntimeError('projection undefined') |
2106 | 2451 | * xdatab[i] = 1.e30 # <<<<<<<<<<<<<< |
2111 | 2456 | goto __pyx_L12; |
2112 | 2457 | } |
2113 | 2458 | |
2114 | /* "_proj.pyx":200 | |
2459 | /* "_proj.pyx":213 | |
2115 | 2460 | * raise RuntimeError('projection undefined') |
2116 | 2461 | * xdatab[i] = 1.e30 |
2117 | 2462 | * elif radians: # <<<<<<<<<<<<<< |
2118 | 2463 | * xdatab[i] = projlonlatout.u |
2119 | 2464 | * else: |
2120 | 2465 | */ |
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;} | |
2122 | 2467 | if (__pyx_t_6) { |
2123 | 2468 | |
2124 | /* "_proj.pyx":201 | |
2469 | /* "_proj.pyx":214 | |
2125 | 2470 | * xdatab[i] = 1.e30 |
2126 | 2471 | * elif radians: |
2127 | 2472 | * xdatab[i] = projlonlatout.u # <<<<<<<<<<<<<< |
2134 | 2479 | } |
2135 | 2480 | /*else*/ { |
2136 | 2481 | |
2137 | /* "_proj.pyx":203 | |
2482 | /* "_proj.pyx":216 | |
2138 | 2483 | * xdatab[i] = projlonlatout.u |
2139 | 2484 | * else: |
2140 | 2485 | * xdatab[i] = _rad2dg*projlonlatout.u # <<<<<<<<<<<<<< |
2145 | 2490 | } |
2146 | 2491 | __pyx_L12:; |
2147 | 2492 | |
2148 | /* "_proj.pyx":204 | |
2493 | /* "_proj.pyx":217 | |
2149 | 2494 | * else: |
2150 | 2495 | * xdatab[i] = _rad2dg*projlonlatout.u |
2151 | 2496 | * if projlonlatout.v == HUGE_VAL or \ # <<<<<<<<<<<<<< |
2152 | 2497 | * projlonlatout.v != projlonlatout.v: |
2153 | 2498 | * if errcheck: |
2154 | 2499 | */ |
2155 | __pyx_t_6 = (__pyx_v_projlonlatout.v == HUGE_VAL); | |
2500 | __pyx_t_6 = ((__pyx_v_projlonlatout.v == HUGE_VAL) != 0); | |
2156 | 2501 | if (!__pyx_t_6) { |
2157 | 2502 | |
2158 | /* "_proj.pyx":205 | |
2503 | /* "_proj.pyx":218 | |
2159 | 2504 | * xdatab[i] = _rad2dg*projlonlatout.u |
2160 | 2505 | * if projlonlatout.v == HUGE_VAL or \ |
2161 | 2506 | * projlonlatout.v != projlonlatout.v: # <<<<<<<<<<<<<< |
2162 | 2507 | * if errcheck: |
2163 | 2508 | * raise RuntimeError('projection undefined') |
2164 | 2509 | */ |
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); | |
2166 | 2511 | __pyx_t_1 = __pyx_t_7; |
2167 | 2512 | } else { |
2168 | 2513 | __pyx_t_1 = __pyx_t_6; |
2169 | 2514 | } |
2170 | 2515 | if (__pyx_t_1) { |
2171 | 2516 | |
2172 | /* "_proj.pyx":206 | |
2517 | /* "_proj.pyx":219 | |
2173 | 2518 | * if projlonlatout.v == HUGE_VAL or \ |
2174 | 2519 | * projlonlatout.v != projlonlatout.v: |
2175 | 2520 | * if errcheck: # <<<<<<<<<<<<<< |
2176 | 2521 | * raise RuntimeError('projection undefined') |
2177 | 2522 | * ydatab[i] = 1.e30 |
2178 | 2523 | */ |
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;} | |
2180 | 2525 | if (__pyx_t_1) { |
2181 | 2526 | |
2182 | /* "_proj.pyx":207 | |
2527 | /* "_proj.pyx":220 | |
2183 | 2528 | * projlonlatout.v != projlonlatout.v: |
2184 | 2529 | * if errcheck: |
2185 | 2530 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
2186 | 2531 | * ydatab[i] = 1.e30 |
2187 | 2532 | * elif radians: |
2188 | 2533 | */ |
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;} | |
2190 | 2535 | __Pyx_GOTREF(__pyx_t_4); |
2191 | 2536 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
2192 | 2537 | __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;} | |
2194 | 2539 | goto __pyx_L15; |
2195 | 2540 | } |
2196 | 2541 | __pyx_L15:; |
2197 | 2542 | |
2198 | /* "_proj.pyx":208 | |
2543 | /* "_proj.pyx":221 | |
2199 | 2544 | * if errcheck: |
2200 | 2545 | * raise RuntimeError('projection undefined') |
2201 | 2546 | * ydatab[i] = 1.e30 # <<<<<<<<<<<<<< |
2206 | 2551 | goto __pyx_L14; |
2207 | 2552 | } |
2208 | 2553 | |
2209 | /* "_proj.pyx":209 | |
2554 | /* "_proj.pyx":222 | |
2210 | 2555 | * raise RuntimeError('projection undefined') |
2211 | 2556 | * ydatab[i] = 1.e30 |
2212 | 2557 | * elif radians: # <<<<<<<<<<<<<< |
2213 | 2558 | * ydatab[i] = projlonlatout.v |
2214 | 2559 | * else: |
2215 | 2560 | */ |
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;} | |
2217 | 2562 | if (__pyx_t_1) { |
2218 | 2563 | |
2219 | /* "_proj.pyx":210 | |
2564 | /* "_proj.pyx":223 | |
2220 | 2565 | * ydatab[i] = 1.e30 |
2221 | 2566 | * elif radians: |
2222 | 2567 | * ydatab[i] = projlonlatout.v # <<<<<<<<<<<<<< |
2229 | 2574 | } |
2230 | 2575 | /*else*/ { |
2231 | 2576 | |
2232 | /* "_proj.pyx":212 | |
2577 | /* "_proj.pyx":225 | |
2233 | 2578 | * ydatab[i] = projlonlatout.v |
2234 | 2579 | * else: |
2235 | 2580 | * ydatab[i] = _rad2dg*projlonlatout.v # <<<<<<<<<<<<<< |
2257 | 2602 | } |
2258 | 2603 | |
2259 | 2604 | /* 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) { | |
2262 | 2607 | PyObject *__pyx_r = 0; |
2263 | 2608 | __Pyx_RefNannyDeclarations |
2264 | 2609 | __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)); | |
2266 | 2611 | __Pyx_RefNannyFinishContext(); |
2267 | 2612 | return __pyx_r; |
2268 | 2613 | } |
2269 | 2614 | |
2270 | /* "_proj.pyx":291 | |
2615 | /* "_proj.pyx":304 | |
2271 | 2616 | * # llptr[i].v = _rad2dg*projlonlatout.v |
2272 | 2617 | * |
2273 | 2618 | * def is_latlong(self): # <<<<<<<<<<<<<< |
2275 | 2620 | * cdef int i |
2276 | 2621 | */ |
2277 | 2622 | |
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) { | |
2279 | 2624 | int __pyx_v_i; |
2280 | 2625 | PyObject *__pyx_r = NULL; |
2281 | 2626 | __Pyx_RefNannyDeclarations |
2282 | PyObject *__pyx_t_1 = NULL; | |
2627 | int __pyx_t_1; | |
2628 | PyObject *__pyx_t_2 = NULL; | |
2283 | 2629 | int __pyx_lineno = 0; |
2284 | 2630 | const char *__pyx_filename = NULL; |
2285 | 2631 | int __pyx_clineno = 0; |
2286 | 2632 | __Pyx_RefNannySetupContext("is_latlong", 0); |
2287 | 2633 | |
2288 | /* "_proj.pyx":294 | |
2634 | /* "_proj.pyx":307 | |
2289 | 2635 | * # returns True if projection in geographic (lon/lat) coordinates |
2290 | 2636 | * cdef int i |
2291 | 2637 | * i = pj_is_latlong(self.projpj) # <<<<<<<<<<<<<< |
2294 | 2640 | */ |
2295 | 2641 | __pyx_v_i = pj_is_latlong(__pyx_v_self->projpj); |
2296 | 2642 | |
2297 | /* "_proj.pyx":295 | |
2643 | /* "_proj.pyx":308 | |
2298 | 2644 | * cdef int i |
2299 | 2645 | * i = pj_is_latlong(self.projpj) |
2300 | 2646 | * if i: # <<<<<<<<<<<<<< |
2301 | 2647 | * return True |
2302 | 2648 | * else: |
2303 | 2649 | */ |
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 | |
2307 | 2654 | * i = pj_is_latlong(self.projpj) |
2308 | 2655 | * if i: |
2309 | 2656 | * return True # <<<<<<<<<<<<<< |
2311 | 2658 | * return False |
2312 | 2659 | */ |
2313 | 2660 | __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; | |
2318 | 2665 | goto __pyx_L0; |
2319 | 2666 | goto __pyx_L3; |
2320 | 2667 | } |
2321 | 2668 | /*else*/ { |
2322 | 2669 | |
2323 | /* "_proj.pyx":298 | |
2670 | /* "_proj.pyx":311 | |
2324 | 2671 | * return True |
2325 | 2672 | * else: |
2326 | 2673 | * return False # <<<<<<<<<<<<<< |
2328 | 2675 | * def is_geocent(self): |
2329 | 2676 | */ |
2330 | 2677 | __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; | |
2335 | 2682 | goto __pyx_L0; |
2336 | 2683 | } |
2337 | 2684 | __pyx_L3:; |
2339 | 2686 | __pyx_r = Py_None; __Pyx_INCREF(Py_None); |
2340 | 2687 | goto __pyx_L0; |
2341 | 2688 | __pyx_L1_error:; |
2342 | __Pyx_XDECREF(__pyx_t_1); | |
2689 | __Pyx_XDECREF(__pyx_t_2); | |
2343 | 2690 | __Pyx_AddTraceback("_proj.Proj.is_latlong", __pyx_clineno, __pyx_lineno, __pyx_filename); |
2344 | 2691 | __pyx_r = NULL; |
2345 | 2692 | __pyx_L0:; |
2349 | 2696 | } |
2350 | 2697 | |
2351 | 2698 | /* 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) { | |
2354 | 2701 | PyObject *__pyx_r = 0; |
2355 | 2702 | __Pyx_RefNannyDeclarations |
2356 | 2703 | __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)); | |
2358 | 2705 | __Pyx_RefNannyFinishContext(); |
2359 | 2706 | return __pyx_r; |
2360 | 2707 | } |
2361 | 2708 | |
2362 | /* "_proj.pyx":300 | |
2709 | /* "_proj.pyx":313 | |
2363 | 2710 | * return False |
2364 | 2711 | * |
2365 | 2712 | * def is_geocent(self): # <<<<<<<<<<<<<< |
2367 | 2714 | * cdef int i |
2368 | 2715 | */ |
2369 | 2716 | |
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) { | |
2371 | 2718 | int __pyx_v_i; |
2372 | 2719 | PyObject *__pyx_r = NULL; |
2373 | 2720 | __Pyx_RefNannyDeclarations |
2374 | PyObject *__pyx_t_1 = NULL; | |
2721 | int __pyx_t_1; | |
2722 | PyObject *__pyx_t_2 = NULL; | |
2375 | 2723 | int __pyx_lineno = 0; |
2376 | 2724 | const char *__pyx_filename = NULL; |
2377 | 2725 | int __pyx_clineno = 0; |
2378 | 2726 | __Pyx_RefNannySetupContext("is_geocent", 0); |
2379 | 2727 | |
2380 | /* "_proj.pyx":303 | |
2728 | /* "_proj.pyx":316 | |
2381 | 2729 | * # returns True if projection in geocentric (x/y) coordinates |
2382 | 2730 | * cdef int i |
2383 | 2731 | * i = pj_is_geocent(self.projpj) # <<<<<<<<<<<<<< |
2386 | 2734 | */ |
2387 | 2735 | __pyx_v_i = pj_is_geocent(__pyx_v_self->projpj); |
2388 | 2736 | |
2389 | /* "_proj.pyx":304 | |
2737 | /* "_proj.pyx":317 | |
2390 | 2738 | * cdef int i |
2391 | 2739 | * i = pj_is_geocent(self.projpj) |
2392 | 2740 | * if i: # <<<<<<<<<<<<<< |
2393 | 2741 | * return True |
2394 | 2742 | * else: |
2395 | 2743 | */ |
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 | |
2399 | 2748 | * i = pj_is_geocent(self.projpj) |
2400 | 2749 | * if i: |
2401 | 2750 | * return True # <<<<<<<<<<<<<< |
2403 | 2752 | * return False |
2404 | 2753 | */ |
2405 | 2754 | __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; | |
2410 | 2759 | goto __pyx_L0; |
2411 | 2760 | goto __pyx_L3; |
2412 | 2761 | } |
2413 | 2762 | /*else*/ { |
2414 | 2763 | |
2415 | /* "_proj.pyx":307 | |
2764 | /* "_proj.pyx":320 | |
2416 | 2765 | * return True |
2417 | 2766 | * else: |
2418 | 2767 | * return False # <<<<<<<<<<<<<< |
2420 | 2769 | * def _transform(Proj p1, Proj p2, inx, iny, inz, radians): |
2421 | 2770 | */ |
2422 | 2771 | __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; | |
2427 | 2776 | goto __pyx_L0; |
2428 | 2777 | } |
2429 | 2778 | __pyx_L3:; |
2431 | 2780 | __pyx_r = Py_None; __Pyx_INCREF(Py_None); |
2432 | 2781 | goto __pyx_L0; |
2433 | 2782 | __pyx_L1_error:; |
2434 | __Pyx_XDECREF(__pyx_t_1); | |
2783 | __Pyx_XDECREF(__pyx_t_2); | |
2435 | 2784 | __Pyx_AddTraceback("_proj.Proj.is_geocent", __pyx_clineno, __pyx_lineno, __pyx_filename); |
2436 | 2785 | __pyx_r = NULL; |
2437 | 2786 | __pyx_L0:; |
2451 | 2800 | return __pyx_r; |
2452 | 2801 | } |
2453 | 2802 | |
2454 | /* "_proj.pyx":65 | |
2803 | /* "_proj.pyx":69 | |
2455 | 2804 | * cdef projPJ projpj |
2456 | 2805 | * cdef projCtx projctx |
2457 | 2806 | * cdef public object proj_version # <<<<<<<<<<<<<< |
2538 | 2887 | return __pyx_r; |
2539 | 2888 | } |
2540 | 2889 | |
2541 | /* "_proj.pyx":67 | |
2890 | /* "_proj.pyx":71 | |
2542 | 2891 | * cdef public object proj_version |
2543 | 2892 | * cdef char *pjinitstring |
2544 | 2893 | * cdef public object srs # <<<<<<<<<<<<<< |
2615 | 2964 | } |
2616 | 2965 | |
2617 | 2966 | /* 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) { | |
2621 | 2970 | struct __pyx_obj_5_proj_Proj *__pyx_v_p1 = 0; |
2622 | 2971 | struct __pyx_obj_5_proj_Proj *__pyx_v_p2 = 0; |
2623 | 2972 | PyObject *__pyx_v_inx = 0; |
2624 | 2973 | PyObject *__pyx_v_iny = 0; |
2625 | 2974 | PyObject *__pyx_v_inz = 0; |
2626 | 2975 | PyObject *__pyx_v_radians = 0; |
2976 | int __pyx_lineno = 0; | |
2977 | const char *__pyx_filename = NULL; | |
2978 | int __pyx_clineno = 0; | |
2627 | 2979 | PyObject *__pyx_r = 0; |
2628 | 2980 | __Pyx_RefNannyDeclarations |
2629 | 2981 | __Pyx_RefNannySetupContext("_transform (wrapper)", 0); |
2651 | 3003 | case 1: |
2652 | 3004 | if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p2)) != 0)) kw_args--; |
2653 | 3005 | 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;} | |
2655 | 3007 | } |
2656 | 3008 | case 2: |
2657 | 3009 | if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__inx)) != 0)) kw_args--; |
2658 | 3010 | 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;} | |
2660 | 3012 | } |
2661 | 3013 | case 3: |
2662 | 3014 | if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__iny)) != 0)) kw_args--; |
2663 | 3015 | 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;} | |
2665 | 3017 | } |
2666 | 3018 | case 4: |
2667 | 3019 | if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__inz)) != 0)) kw_args--; |
2668 | 3020 | 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;} | |
2670 | 3022 | } |
2671 | 3023 | case 5: |
2672 | 3024 | if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__radians)) != 0)) kw_args--; |
2673 | 3025 | 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;} | |
2675 | 3027 | } |
2676 | 3028 | } |
2677 | 3029 | 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;} | |
2679 | 3031 | } |
2680 | 3032 | } else if (PyTuple_GET_SIZE(__pyx_args) != 6) { |
2681 | 3033 | goto __pyx_L5_argtuple_error; |
2696 | 3048 | } |
2697 | 3049 | goto __pyx_L4_argument_unpacking_done; |
2698 | 3050 | __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;} | |
2700 | 3052 | __pyx_L3_error:; |
2701 | 3053 | __Pyx_AddTraceback("_proj._transform", __pyx_clineno, __pyx_lineno, __pyx_filename); |
2702 | 3054 | __Pyx_RefNannyFinishContext(); |
2703 | 3055 | return NULL; |
2704 | 3056 | __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); | |
2708 | 3060 | goto __pyx_L0; |
2709 | 3061 | __pyx_L1_error:; |
2710 | 3062 | __pyx_r = NULL; |
2713 | 3065 | return __pyx_r; |
2714 | 3066 | } |
2715 | 3067 | |
2716 | /* "_proj.pyx":309 | |
3068 | /* "_proj.pyx":322 | |
2717 | 3069 | * return False |
2718 | 3070 | * |
2719 | 3071 | * def _transform(Proj p1, Proj p2, inx, iny, inz, radians): # <<<<<<<<<<<<<< |
2721 | 3073 | * cdef void *xdata, *ydata, *zdata |
2722 | 3074 | */ |
2723 | 3075 | |
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) { | |
2725 | 3077 | void *__pyx_v_xdata; |
2726 | 3078 | void *__pyx_v_ydata; |
2727 | 3079 | void *__pyx_v_zdata; |
2747 | 3099 | int __pyx_clineno = 0; |
2748 | 3100 | __Pyx_RefNannySetupContext("_transform", 0); |
2749 | 3101 | |
2750 | /* "_proj.pyx":315 | |
3102 | /* "_proj.pyx":328 | |
2751 | 3103 | * cdef Py_ssize_t buflenx, bufleny, buflenz, npts, i |
2752 | 3104 | * cdef int err |
2753 | 3105 | * if PyObject_AsWriteBuffer(inx, &xdata, &buflenx) <> 0: # <<<<<<<<<<<<<< |
2754 | 3106 | * raise RuntimeError |
2755 | 3107 | * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0: |
2756 | 3108 | */ |
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); | |
2758 | 3110 | if (__pyx_t_1) { |
2759 | 3111 | |
2760 | /* "_proj.pyx":316 | |
3112 | /* "_proj.pyx":329 | |
2761 | 3113 | * cdef int err |
2762 | 3114 | * if PyObject_AsWriteBuffer(inx, &xdata, &buflenx) <> 0: |
2763 | 3115 | * raise RuntimeError # <<<<<<<<<<<<<< |
2765 | 3117 | * raise RuntimeError |
2766 | 3118 | */ |
2767 | 3119 | __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;} | |
2769 | 3121 | goto __pyx_L3; |
2770 | 3122 | } |
2771 | 3123 | __pyx_L3:; |
2772 | 3124 | |
2773 | /* "_proj.pyx":317 | |
3125 | /* "_proj.pyx":330 | |
2774 | 3126 | * if PyObject_AsWriteBuffer(inx, &xdata, &buflenx) <> 0: |
2775 | 3127 | * raise RuntimeError |
2776 | 3128 | * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0: # <<<<<<<<<<<<<< |
2777 | 3129 | * raise RuntimeError |
2778 | 3130 | * if inz is not None: |
2779 | 3131 | */ |
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); | |
2781 | 3133 | if (__pyx_t_1) { |
2782 | 3134 | |
2783 | /* "_proj.pyx":318 | |
3135 | /* "_proj.pyx":331 | |
2784 | 3136 | * raise RuntimeError |
2785 | 3137 | * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0: |
2786 | 3138 | * raise RuntimeError # <<<<<<<<<<<<<< |
2788 | 3140 | * if PyObject_AsWriteBuffer(inz, &zdata, &buflenz) <> 0: |
2789 | 3141 | */ |
2790 | 3142 | __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;} | |
2792 | 3144 | goto __pyx_L4; |
2793 | 3145 | } |
2794 | 3146 | __pyx_L4:; |
2795 | 3147 | |
2796 | /* "_proj.pyx":319 | |
3148 | /* "_proj.pyx":332 | |
2797 | 3149 | * if PyObject_AsWriteBuffer(iny, &ydata, &bufleny) <> 0: |
2798 | 3150 | * raise RuntimeError |
2799 | 3151 | * if inz is not None: # <<<<<<<<<<<<<< |
2801 | 3153 | * raise RuntimeError |
2802 | 3154 | */ |
2803 | 3155 | __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 | |
2807 | 3160 | * raise RuntimeError |
2808 | 3161 | * if inz is not None: |
2809 | 3162 | * if PyObject_AsWriteBuffer(inz, &zdata, &buflenz) <> 0: # <<<<<<<<<<<<<< |
2810 | 3163 | * raise RuntimeError |
2811 | 3164 | * else: |
2812 | 3165 | */ |
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 | |
2817 | 3170 | * if inz is not None: |
2818 | 3171 | * if PyObject_AsWriteBuffer(inz, &zdata, &buflenz) <> 0: |
2819 | 3172 | * raise RuntimeError # <<<<<<<<<<<<<< |
2821 | 3174 | * buflenz = bufleny |
2822 | 3175 | */ |
2823 | 3176 | __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;} | |
2825 | 3178 | goto __pyx_L6; |
2826 | 3179 | } |
2827 | 3180 | __pyx_L6:; |
2829 | 3182 | } |
2830 | 3183 | /*else*/ { |
2831 | 3184 | |
2832 | /* "_proj.pyx":323 | |
3185 | /* "_proj.pyx":336 | |
2833 | 3186 | * raise RuntimeError |
2834 | 3187 | * else: |
2835 | 3188 | * buflenz = bufleny # <<<<<<<<<<<<<< |
2840 | 3193 | } |
2841 | 3194 | __pyx_L5:; |
2842 | 3195 | |
2843 | /* "_proj.pyx":324 | |
3196 | /* "_proj.pyx":337 | |
2844 | 3197 | * else: |
2845 | 3198 | * buflenz = bufleny |
2846 | 3199 | * if not (buflenx == bufleny == buflenz): # <<<<<<<<<<<<<< |
2847 | 3200 | * raise RuntimeError('x,y and z must be same size') |
2848 | 3201 | * xx = <double *>xdata |
2849 | 3202 | */ |
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); | |
2851 | 3208 | 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 | |
2858 | 3211 | * buflenz = bufleny |
2859 | 3212 | * if not (buflenx == bufleny == buflenz): |
2860 | 3213 | * raise RuntimeError('x,y and z must be same size') # <<<<<<<<<<<<<< |
2861 | 3214 | * xx = <double *>xdata |
2862 | 3215 | * yy = <double *>ydata |
2863 | 3216 | */ |
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;} | |
2865 | 3218 | __Pyx_GOTREF(__pyx_t_3); |
2866 | 3219 | __Pyx_Raise(__pyx_t_3, 0, 0, 0); |
2867 | 3220 | __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;} | |
2869 | 3222 | goto __pyx_L7; |
2870 | 3223 | } |
2871 | 3224 | __pyx_L7:; |
2872 | 3225 | |
2873 | /* "_proj.pyx":326 | |
3226 | /* "_proj.pyx":339 | |
2874 | 3227 | * if not (buflenx == bufleny == buflenz): |
2875 | 3228 | * raise RuntimeError('x,y and z must be same size') |
2876 | 3229 | * xx = <double *>xdata # <<<<<<<<<<<<<< |
2879 | 3232 | */ |
2880 | 3233 | __pyx_v_xx = ((double *)__pyx_v_xdata); |
2881 | 3234 | |
2882 | /* "_proj.pyx":327 | |
3235 | /* "_proj.pyx":340 | |
2883 | 3236 | * raise RuntimeError('x,y and z must be same size') |
2884 | 3237 | * xx = <double *>xdata |
2885 | 3238 | * yy = <double *>ydata # <<<<<<<<<<<<<< |
2888 | 3241 | */ |
2889 | 3242 | __pyx_v_yy = ((double *)__pyx_v_ydata); |
2890 | 3243 | |
2891 | /* "_proj.pyx":328 | |
3244 | /* "_proj.pyx":341 | |
2892 | 3245 | * xx = <double *>xdata |
2893 | 3246 | * yy = <double *>ydata |
2894 | 3247 | * if inz is not None: # <<<<<<<<<<<<<< |
2895 | 3248 | * zz = <double *>zdata |
2896 | 3249 | * npts = buflenx/8 |
2897 | 3250 | */ |
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); | |
2899 | 3253 | if (__pyx_t_2) { |
2900 | 3254 | |
2901 | /* "_proj.pyx":329 | |
3255 | /* "_proj.pyx":342 | |
2902 | 3256 | * yy = <double *>ydata |
2903 | 3257 | * if inz is not None: |
2904 | 3258 | * zz = <double *>zdata # <<<<<<<<<<<<<< |
2910 | 3264 | } |
2911 | 3265 | __pyx_L8:; |
2912 | 3266 | |
2913 | /* "_proj.pyx":330 | |
3267 | /* "_proj.pyx":343 | |
2914 | 3268 | * if inz is not None: |
2915 | 3269 | * zz = <double *>zdata |
2916 | 3270 | * npts = buflenx/8 # <<<<<<<<<<<<<< |
2919 | 3273 | */ |
2920 | 3274 | __pyx_v_npts = __Pyx_div_Py_ssize_t(__pyx_v_buflenx, 8); |
2921 | 3275 | |
2922 | /* "_proj.pyx":331 | |
3276 | /* "_proj.pyx":344 | |
2923 | 3277 | * zz = <double *>zdata |
2924 | 3278 | * npts = buflenx/8 |
2925 | 3279 | * if not radians and p1.is_latlong(): # <<<<<<<<<<<<<< |
2926 | 3280 | * for i from 0 <= i < npts: |
2927 | 3281 | * xx[i] = xx[i]*_dg2rad |
2928 | 3282 | */ |
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;} | |
2930 | 3284 | __pyx_t_1 = (!__pyx_t_2); |
2931 | 3285 | 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;} | |
2933 | 3287 | __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;} | |
2935 | 3289 | __Pyx_GOTREF(__pyx_t_4); |
2936 | 3290 | __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;} | |
2938 | 3292 | __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; |
2939 | 3293 | __pyx_t_5 = __pyx_t_2; |
2940 | 3294 | } else { |
2942 | 3296 | } |
2943 | 3297 | if (__pyx_t_5) { |
2944 | 3298 | |
2945 | /* "_proj.pyx":332 | |
3299 | /* "_proj.pyx":345 | |
2946 | 3300 | * npts = buflenx/8 |
2947 | 3301 | * if not radians and p1.is_latlong(): |
2948 | 3302 | * for i from 0 <= i < npts: # <<<<<<<<<<<<<< |
2952 | 3306 | __pyx_t_6 = __pyx_v_npts; |
2953 | 3307 | for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { |
2954 | 3308 | |
2955 | /* "_proj.pyx":333 | |
3309 | /* "_proj.pyx":346 | |
2956 | 3310 | * if not radians and p1.is_latlong(): |
2957 | 3311 | * for i from 0 <= i < npts: |
2958 | 3312 | * xx[i] = xx[i]*_dg2rad # <<<<<<<<<<<<<< |
2961 | 3315 | */ |
2962 | 3316 | (__pyx_v_xx[__pyx_v_i]) = ((__pyx_v_xx[__pyx_v_i]) * __pyx_v_5_proj__dg2rad); |
2963 | 3317 | |
2964 | /* "_proj.pyx":334 | |
3318 | /* "_proj.pyx":347 | |
2965 | 3319 | * for i from 0 <= i < npts: |
2966 | 3320 | * xx[i] = xx[i]*_dg2rad |
2967 | 3321 | * yy[i] = yy[i]*_dg2rad # <<<<<<<<<<<<<< |
2974 | 3328 | } |
2975 | 3329 | __pyx_L9:; |
2976 | 3330 | |
2977 | /* "_proj.pyx":335 | |
3331 | /* "_proj.pyx":348 | |
2978 | 3332 | * xx[i] = xx[i]*_dg2rad |
2979 | 3333 | * yy[i] = yy[i]*_dg2rad |
2980 | 3334 | * if inz is not None: # <<<<<<<<<<<<<< |
2982 | 3336 | * else: |
2983 | 3337 | */ |
2984 | 3338 | __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 | |
2988 | 3343 | * yy[i] = yy[i]*_dg2rad |
2989 | 3344 | * if inz is not None: |
2990 | 3345 | * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, zz) # <<<<<<<<<<<<<< |
2996 | 3351 | } |
2997 | 3352 | /*else*/ { |
2998 | 3353 | |
2999 | /* "_proj.pyx":338 | |
3354 | /* "_proj.pyx":351 | |
3000 | 3355 | * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, zz) |
3001 | 3356 | * else: |
3002 | 3357 | * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, NULL) # <<<<<<<<<<<<<< |
3007 | 3362 | } |
3008 | 3363 | __pyx_L12:; |
3009 | 3364 | |
3010 | /* "_proj.pyx":339 | |
3365 | /* "_proj.pyx":352 | |
3011 | 3366 | * else: |
3012 | 3367 | * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, NULL) |
3013 | 3368 | * if err != 0: # <<<<<<<<<<<<<< |
3014 | 3369 | * raise RuntimeError(pj_strerrno(err)) |
3015 | 3370 | * if not radians and p2.is_latlong(): |
3016 | 3371 | */ |
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 | |
3021 | 3376 | * err = pj_transform(p1.projpj, p2.projpj, npts, 0, xx, yy, NULL) |
3022 | 3377 | * if err != 0: |
3023 | 3378 | * raise RuntimeError(pj_strerrno(err)) # <<<<<<<<<<<<<< |
3024 | 3379 | * if not radians and p2.is_latlong(): |
3025 | 3380 | * for i from 0 <= i < npts: |
3026 | 3381 | */ |
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;} | |
3028 | 3383 | __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;} | |
3030 | 3385 | __Pyx_GOTREF(__pyx_t_3); |
3031 | 3386 | PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4)); |
3032 | 3387 | __Pyx_GIVEREF(((PyObject *)__pyx_t_4)); |
3033 | 3388 | __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;} | |
3035 | 3390 | __Pyx_GOTREF(__pyx_t_4); |
3036 | 3391 | __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; |
3037 | 3392 | __Pyx_Raise(__pyx_t_4, 0, 0, 0); |
3038 | 3393 | __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;} | |
3040 | 3395 | goto __pyx_L13; |
3041 | 3396 | } |
3042 | 3397 | __pyx_L13:; |
3043 | 3398 | |
3044 | /* "_proj.pyx":341 | |
3399 | /* "_proj.pyx":354 | |
3045 | 3400 | * if err != 0: |
3046 | 3401 | * raise RuntimeError(pj_strerrno(err)) |
3047 | 3402 | * if not radians and p2.is_latlong(): # <<<<<<<<<<<<<< |
3048 | 3403 | * for i from 0 <= i < npts: |
3049 | 3404 | * xx[i] = xx[i]*_rad2dg |
3050 | 3405 | */ |
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;} | |
3055 | 3410 | __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;} | |
3057 | 3412 | __Pyx_GOTREF(__pyx_t_3); |
3058 | 3413 | __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;} | |
3060 | 3415 | __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; |
3416 | __pyx_t_2 = __pyx_t_1; | |
3417 | } else { | |
3061 | 3418 | __pyx_t_2 = __pyx_t_5; |
3062 | } else { | |
3063 | __pyx_t_2 = __pyx_t_1; | |
3064 | 3419 | } |
3065 | 3420 | if (__pyx_t_2) { |
3066 | 3421 | |
3067 | /* "_proj.pyx":342 | |
3422 | /* "_proj.pyx":355 | |
3068 | 3423 | * raise RuntimeError(pj_strerrno(err)) |
3069 | 3424 | * if not radians and p2.is_latlong(): |
3070 | 3425 | * for i from 0 <= i < npts: # <<<<<<<<<<<<<< |
3074 | 3429 | __pyx_t_6 = __pyx_v_npts; |
3075 | 3430 | for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { |
3076 | 3431 | |
3077 | /* "_proj.pyx":343 | |
3432 | /* "_proj.pyx":356 | |
3078 | 3433 | * if not radians and p2.is_latlong(): |
3079 | 3434 | * for i from 0 <= i < npts: |
3080 | 3435 | * xx[i] = xx[i]*_rad2dg # <<<<<<<<<<<<<< |
3083 | 3438 | */ |
3084 | 3439 | (__pyx_v_xx[__pyx_v_i]) = ((__pyx_v_xx[__pyx_v_i]) * __pyx_v_5_proj__rad2dg); |
3085 | 3440 | |
3086 | /* "_proj.pyx":344 | |
3441 | /* "_proj.pyx":357 | |
3087 | 3442 | * for i from 0 <= i < npts: |
3088 | 3443 | * xx[i] = xx[i]*_rad2dg |
3089 | 3444 | * yy[i] = yy[i]*_rad2dg # <<<<<<<<<<<<<< |
3109 | 3464 | return __pyx_r; |
3110 | 3465 | } |
3111 | 3466 | |
3112 | /* "_proj.pyx":346 | |
3467 | /* "_proj.pyx":359 | |
3113 | 3468 | * yy[i] = yy[i]*_rad2dg |
3114 | 3469 | * |
3115 | 3470 | * cdef _strencode(pystr,encoding='ascii'): # <<<<<<<<<<<<<< |
3138 | 3493 | } |
3139 | 3494 | } |
3140 | 3495 | |
3141 | /* "_proj.pyx":348 | |
3496 | /* "_proj.pyx":361 | |
3142 | 3497 | * cdef _strencode(pystr,encoding='ascii'): |
3143 | 3498 | * # encode a string into bytes. If already bytes, do nothing. |
3144 | 3499 | * try: # <<<<<<<<<<<<<< |
3152 | 3507 | __Pyx_XGOTREF(__pyx_t_3); |
3153 | 3508 | /*try:*/ { |
3154 | 3509 | |
3155 | /* "_proj.pyx":349 | |
3510 | /* "_proj.pyx":362 | |
3156 | 3511 | * # encode a string into bytes. If already bytes, do nothing. |
3157 | 3512 | * try: |
3158 | 3513 | * return pystr.encode(encoding) # <<<<<<<<<<<<<< |
3160 | 3515 | * return pystr # already bytes? |
3161 | 3516 | */ |
3162 | 3517 | __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;} | |
3164 | 3519 | __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;} | |
3166 | 3521 | __Pyx_GOTREF(__pyx_t_5); |
3167 | 3522 | __Pyx_INCREF(__pyx_v_encoding); |
3168 | 3523 | PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_encoding); |
3169 | 3524 | __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;} | |
3171 | 3526 | __Pyx_GOTREF(__pyx_t_6); |
3172 | 3527 | __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; |
3173 | 3528 | __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0; |
3190 | 3545 | __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; |
3191 | 3546 | __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; |
3192 | 3547 | |
3193 | /* "_proj.pyx":350 | |
3548 | /* "_proj.pyx":363 | |
3194 | 3549 | * try: |
3195 | 3550 | * return pystr.encode(encoding) |
3196 | 3551 | * except AttributeError: # <<<<<<<<<<<<<< |
3200 | 3555 | __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError); |
3201 | 3556 | if (__pyx_t_7) { |
3202 | 3557 | __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;} | |
3204 | 3559 | __Pyx_GOTREF(__pyx_t_6); |
3205 | 3560 | __Pyx_GOTREF(__pyx_t_5); |
3206 | 3561 | __Pyx_GOTREF(__pyx_t_4); |
3207 | 3562 | |
3208 | /* "_proj.pyx":351 | |
3563 | /* "_proj.pyx":364 | |
3209 | 3564 | * return pystr.encode(encoding) |
3210 | 3565 | * except AttributeError: |
3211 | 3566 | * return pystr # already bytes? # <<<<<<<<<<<<<< |
3263 | 3618 | static int __pyx_pw_5_proj_4Geod_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { |
3264 | 3619 | PyObject *__pyx_v_a = 0; |
3265 | 3620 | PyObject *__pyx_v_f = 0; |
3621 | int __pyx_lineno = 0; | |
3622 | const char *__pyx_filename = NULL; | |
3623 | int __pyx_clineno = 0; | |
3266 | 3624 | int __pyx_r; |
3267 | 3625 | __Pyx_RefNannyDeclarations |
3268 | 3626 | __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0); |
3286 | 3644 | case 1: |
3287 | 3645 | if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__f)) != 0)) kw_args--; |
3288 | 3646 | 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;} | |
3290 | 3648 | } |
3291 | 3649 | } |
3292 | 3650 | 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;} | |
3294 | 3652 | } |
3295 | 3653 | } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { |
3296 | 3654 | goto __pyx_L5_argtuple_error; |
3303 | 3661 | } |
3304 | 3662 | goto __pyx_L4_argument_unpacking_done; |
3305 | 3663 | __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;} | |
3307 | 3665 | __pyx_L3_error:; |
3308 | 3666 | __Pyx_AddTraceback("_proj.Geod.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename); |
3309 | 3667 | __Pyx_RefNannyFinishContext(); |
3314 | 3672 | return __pyx_r; |
3315 | 3673 | } |
3316 | 3674 | |
3317 | /* "_proj.pyx":357 | |
3675 | /* "_proj.pyx":370 | |
3318 | 3676 | * cdef public object initstring |
3319 | 3677 | * |
3320 | 3678 | * def __cinit__(self, a, f): # <<<<<<<<<<<<<< |
3321 | 3679 | * 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) | |
3323 | 3681 | */ |
3324 | 3682 | |
3325 | 3683 | 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) { |
3334 | 3692 | int __pyx_clineno = 0; |
3335 | 3693 | __Pyx_RefNannySetupContext("__cinit__", 0); |
3336 | 3694 | |
3337 | /* "_proj.pyx":358 | |
3695 | /* "_proj.pyx":371 | |
3338 | 3696 | * |
3339 | 3697 | * def __cinit__(self, a, f): |
3340 | 3698 | * 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) | |
3342 | 3700 | * |
3343 | 3701 | */ |
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;} | |
3345 | 3703 | __Pyx_GOTREF(__pyx_t_1); |
3346 | 3704 | __Pyx_INCREF(__pyx_v_a); |
3347 | 3705 | PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_a); |
3349 | 3707 | __Pyx_INCREF(__pyx_v_f); |
3350 | 3708 | PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_f); |
3351 | 3709 | __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;} | |
3353 | 3711 | __Pyx_GOTREF(((PyObject *)__pyx_t_2)); |
3354 | 3712 | __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; |
3355 | 3713 | __Pyx_GIVEREF(((PyObject *)__pyx_t_2)); |
3358 | 3716 | __pyx_v_self->initstring = ((PyObject *)__pyx_t_2); |
3359 | 3717 | __pyx_t_2 = 0; |
3360 | 3718 | |
3361 | /* "_proj.pyx":359 | |
3719 | /* "_proj.pyx":372 | |
3362 | 3720 | * def __cinit__(self, a, f): |
3363 | 3721 | * 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) # <<<<<<<<<<<<<< | |
3365 | 3723 | * |
3366 | 3724 | * def __reduce__(self): |
3367 | 3725 | */ |
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)); | |
3371 | 3729 | |
3372 | 3730 | __pyx_r = 0; |
3373 | 3731 | goto __pyx_L0; |
3393 | 3751 | return __pyx_r; |
3394 | 3752 | } |
3395 | 3753 | |
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) | |
3398 | 3756 | * |
3399 | 3757 | * def __reduce__(self): # <<<<<<<<<<<<<< |
3400 | 3758 | * """special method that allows pyproj.Geod instance to be pickled""" |
3412 | 3770 | int __pyx_clineno = 0; |
3413 | 3771 | __Pyx_RefNannySetupContext("__reduce__", 0); |
3414 | 3772 | |
3415 | /* "_proj.pyx":363 | |
3773 | /* "_proj.pyx":376 | |
3416 | 3774 | * def __reduce__(self): |
3417 | 3775 | * """special method that allows pyproj.Geod instance to be pickled""" |
3418 | 3776 | * return (self.__class__,(self.initstring,)) # <<<<<<<<<<<<<< |
3420 | 3778 | * def _fwd(self, object lons, object lats, object az, object dist, radians=False): |
3421 | 3779 | */ |
3422 | 3780 | __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;} | |
3424 | 3782 | __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;} | |
3426 | 3784 | __Pyx_GOTREF(__pyx_t_2); |
3427 | 3785 | __Pyx_INCREF(__pyx_v_self->initstring); |
3428 | 3786 | PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->initstring); |
3429 | 3787 | __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;} | |
3431 | 3789 | __Pyx_GOTREF(__pyx_t_3); |
3432 | 3790 | PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); |
3433 | 3791 | __Pyx_GIVEREF(__pyx_t_1); |
3462 | 3820 | PyObject *__pyx_v_az = 0; |
3463 | 3821 | PyObject *__pyx_v_dist = 0; |
3464 | 3822 | PyObject *__pyx_v_radians = 0; |
3823 | int __pyx_lineno = 0; | |
3824 | const char *__pyx_filename = NULL; | |
3825 | int __pyx_clineno = 0; | |
3465 | 3826 | PyObject *__pyx_r = 0; |
3466 | 3827 | __Pyx_RefNannyDeclarations |
3467 | 3828 | __Pyx_RefNannySetupContext("_fwd (wrapper)", 0); |
3489 | 3850 | case 1: |
3490 | 3851 | if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats)) != 0)) kw_args--; |
3491 | 3852 | 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;} | |
3493 | 3854 | } |
3494 | 3855 | case 2: |
3495 | 3856 | if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__az)) != 0)) kw_args--; |
3496 | 3857 | 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;} | |
3498 | 3859 | } |
3499 | 3860 | case 3: |
3500 | 3861 | if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dist)) != 0)) kw_args--; |
3501 | 3862 | 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;} | |
3503 | 3864 | } |
3504 | 3865 | case 4: |
3505 | 3866 | if (kw_args > 0) { |
3508 | 3869 | } |
3509 | 3870 | } |
3510 | 3871 | 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;} | |
3512 | 3873 | } |
3513 | 3874 | } else { |
3514 | 3875 | switch (PyTuple_GET_SIZE(__pyx_args)) { |
3529 | 3890 | } |
3530 | 3891 | goto __pyx_L4_argument_unpacking_done; |
3531 | 3892 | __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;} | |
3533 | 3894 | __pyx_L3_error:; |
3534 | 3895 | __Pyx_AddTraceback("_proj.Geod._fwd", __pyx_clineno, __pyx_lineno, __pyx_filename); |
3535 | 3896 | __Pyx_RefNannyFinishContext(); |
3540 | 3901 | return __pyx_r; |
3541 | 3902 | } |
3542 | 3903 | |
3543 | /* "_proj.pyx":365 | |
3904 | /* "_proj.pyx":378 | |
3544 | 3905 | * return (self.__class__,(self.initstring,)) |
3545 | 3906 | * |
3546 | 3907 | * def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<< |
3583 | 3944 | int __pyx_clineno = 0; |
3584 | 3945 | __Pyx_RefNannySetupContext("_fwd", 0); |
3585 | 3946 | |
3586 | /* "_proj.pyx":377 | |
3947 | /* "_proj.pyx":390 | |
3587 | 3948 | * cdef void *londata, *latdata, *azdat, *distdat |
3588 | 3949 | * # if buffer api is supported, get pointer to data buffers. |
3589 | 3950 | * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<< |
3590 | 3951 | * raise RuntimeError |
3591 | 3952 | * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: |
3592 | 3953 | */ |
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); | |
3594 | 3955 | if (__pyx_t_1) { |
3595 | 3956 | |
3596 | /* "_proj.pyx":378 | |
3957 | /* "_proj.pyx":391 | |
3597 | 3958 | * # if buffer api is supported, get pointer to data buffers. |
3598 | 3959 | * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: |
3599 | 3960 | * raise RuntimeError # <<<<<<<<<<<<<< |
3601 | 3962 | * raise RuntimeError |
3602 | 3963 | */ |
3603 | 3964 | __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;} | |
3605 | 3966 | goto __pyx_L3; |
3606 | 3967 | } |
3607 | 3968 | __pyx_L3:; |
3608 | 3969 | |
3609 | /* "_proj.pyx":379 | |
3970 | /* "_proj.pyx":392 | |
3610 | 3971 | * if PyObject_AsWriteBuffer(lons, &londata, &buflenlons) <> 0: |
3611 | 3972 | * raise RuntimeError |
3612 | 3973 | * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<< |
3613 | 3974 | * raise RuntimeError |
3614 | 3975 | * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: |
3615 | 3976 | */ |
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); | |
3617 | 3978 | if (__pyx_t_1) { |
3618 | 3979 | |
3619 | /* "_proj.pyx":380 | |
3980 | /* "_proj.pyx":393 | |
3620 | 3981 | * raise RuntimeError |
3621 | 3982 | * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: |
3622 | 3983 | * raise RuntimeError # <<<<<<<<<<<<<< |
3624 | 3985 | * raise RuntimeError |
3625 | 3986 | */ |
3626 | 3987 | __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;} | |
3628 | 3989 | goto __pyx_L4; |
3629 | 3990 | } |
3630 | 3991 | __pyx_L4:; |
3631 | 3992 | |
3632 | /* "_proj.pyx":381 | |
3993 | /* "_proj.pyx":394 | |
3633 | 3994 | * if PyObject_AsWriteBuffer(lats, &latdata, &buflenlats) <> 0: |
3634 | 3995 | * raise RuntimeError |
3635 | 3996 | * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<< |
3636 | 3997 | * raise RuntimeError |
3637 | 3998 | * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: |
3638 | 3999 | */ |
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); | |
3640 | 4001 | if (__pyx_t_1) { |
3641 | 4002 | |
3642 | /* "_proj.pyx":382 | |
4003 | /* "_proj.pyx":395 | |
3643 | 4004 | * raise RuntimeError |
3644 | 4005 | * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: |
3645 | 4006 | * raise RuntimeError # <<<<<<<<<<<<<< |
3647 | 4008 | * raise RuntimeError |
3648 | 4009 | */ |
3649 | 4010 | __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;} | |
3651 | 4012 | goto __pyx_L5; |
3652 | 4013 | } |
3653 | 4014 | __pyx_L5:; |
3654 | 4015 | |
3655 | /* "_proj.pyx":383 | |
4016 | /* "_proj.pyx":396 | |
3656 | 4017 | * if PyObject_AsWriteBuffer(az, &azdat, &buflenaz) <> 0: |
3657 | 4018 | * raise RuntimeError |
3658 | 4019 | * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<< |
3659 | 4020 | * raise RuntimeError |
3660 | 4021 | * # process data in buffer |
3661 | 4022 | */ |
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); | |
3663 | 4024 | if (__pyx_t_1) { |
3664 | 4025 | |
3665 | /* "_proj.pyx":384 | |
4026 | /* "_proj.pyx":397 | |
3666 | 4027 | * raise RuntimeError |
3667 | 4028 | * if PyObject_AsWriteBuffer(dist, &distdat, &buflend) <> 0: |
3668 | 4029 | * raise RuntimeError # <<<<<<<<<<<<<< |
3670 | 4031 | * if not buflenlons == buflenlats == buflenaz == buflend: |
3671 | 4032 | */ |
3672 | 4033 | __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;} | |
3674 | 4035 | goto __pyx_L6; |
3675 | 4036 | } |
3676 | 4037 | __pyx_L6:; |
3677 | 4038 | |
3678 | /* "_proj.pyx":386 | |
4039 | /* "_proj.pyx":399 | |
3679 | 4040 | * raise RuntimeError |
3680 | 4041 | * # process data in buffer |
3681 | 4042 | * if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<< |
3689 | 4050 | __pyx_t_1 = (__pyx_v_buflenaz == __pyx_v_buflend); |
3690 | 4051 | } |
3691 | 4052 | } |
3692 | __pyx_t_2 = (!__pyx_t_1); | |
4053 | __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); | |
3693 | 4054 | if (__pyx_t_2) { |
3694 | 4055 | |
3695 | /* "_proj.pyx":387 | |
4056 | /* "_proj.pyx":400 | |
3696 | 4057 | * # process data in buffer |
3697 | 4058 | * if not buflenlons == buflenlats == buflenaz == buflend: |
3698 | 4059 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
3699 | 4060 | * ndim = buflenlons//_doublesize |
3700 | 4061 | * lonsdata = <double *>londata |
3701 | 4062 | */ |
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;} | |
3703 | 4064 | __Pyx_GOTREF(__pyx_t_3); |
3704 | 4065 | __Pyx_Raise(__pyx_t_3, 0, 0, 0); |
3705 | 4066 | __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;} | |
3707 | 4068 | goto __pyx_L7; |
3708 | 4069 | } |
3709 | 4070 | __pyx_L7:; |
3710 | 4071 | |
3711 | /* "_proj.pyx":388 | |
4072 | /* "_proj.pyx":401 | |
3712 | 4073 | * if not buflenlons == buflenlats == buflenaz == buflend: |
3713 | 4074 | * raise RuntimeError("Buffer lengths not the same") |
3714 | 4075 | * ndim = buflenlons//_doublesize # <<<<<<<<<<<<<< |
3715 | 4076 | * lonsdata = <double *>londata |
3716 | 4077 | * latsdata = <double *>latdata |
3717 | 4078 | */ |
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;} | |
3719 | 4080 | __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;} | |
3721 | 4082 | __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;} | |
3723 | 4084 | __Pyx_GOTREF(__pyx_t_5); |
3724 | 4085 | __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; |
3725 | 4086 | __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;} | |
3727 | 4088 | __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; |
3728 | 4089 | __pyx_v_ndim = __pyx_t_6; |
3729 | 4090 | |
3730 | /* "_proj.pyx":389 | |
4091 | /* "_proj.pyx":402 | |
3731 | 4092 | * raise RuntimeError("Buffer lengths not the same") |
3732 | 4093 | * ndim = buflenlons//_doublesize |
3733 | 4094 | * lonsdata = <double *>londata # <<<<<<<<<<<<<< |
3736 | 4097 | */ |
3737 | 4098 | __pyx_v_lonsdata = ((double *)__pyx_v_londata); |
3738 | 4099 | |
3739 | /* "_proj.pyx":390 | |
4100 | /* "_proj.pyx":403 | |
3740 | 4101 | * ndim = buflenlons//_doublesize |
3741 | 4102 | * lonsdata = <double *>londata |
3742 | 4103 | * latsdata = <double *>latdata # <<<<<<<<<<<<<< |
3745 | 4106 | */ |
3746 | 4107 | __pyx_v_latsdata = ((double *)__pyx_v_latdata); |
3747 | 4108 | |
3748 | /* "_proj.pyx":391 | |
4109 | /* "_proj.pyx":404 | |
3749 | 4110 | * lonsdata = <double *>londata |
3750 | 4111 | * latsdata = <double *>latdata |
3751 | 4112 | * azdata = <double *>azdat # <<<<<<<<<<<<<< |
3754 | 4115 | */ |
3755 | 4116 | __pyx_v_azdata = ((double *)__pyx_v_azdat); |
3756 | 4117 | |
3757 | /* "_proj.pyx":392 | |
4118 | /* "_proj.pyx":405 | |
3758 | 4119 | * latsdata = <double *>latdata |
3759 | 4120 | * azdata = <double *>azdat |
3760 | 4121 | * distdata = <double *>distdat # <<<<<<<<<<<<<< |
3763 | 4124 | */ |
3764 | 4125 | __pyx_v_distdata = ((double *)__pyx_v_distdat); |
3765 | 4126 | |
3766 | /* "_proj.pyx":393 | |
4127 | /* "_proj.pyx":406 | |
3767 | 4128 | * azdata = <double *>azdat |
3768 | 4129 | * distdata = <double *>distdat |
3769 | 4130 | * for i from 0 <= i < ndim: # <<<<<<<<<<<<<< |
3773 | 4134 | __pyx_t_6 = __pyx_v_ndim; |
3774 | 4135 | for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { |
3775 | 4136 | |
3776 | /* "_proj.pyx":394 | |
4137 | /* "_proj.pyx":407 | |
3777 | 4138 | * distdata = <double *>distdat |
3778 | 4139 | * for i from 0 <= i < ndim: |
3779 | 4140 | * if not radians: # <<<<<<<<<<<<<< |
3780 | 4141 | * lon1 = lonsdata[i] |
3781 | 4142 | * lat1 = latsdata[i] |
3782 | 4143 | */ |
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); | |
3785 | 4146 | if (__pyx_t_1) { |
3786 | 4147 | |
3787 | /* "_proj.pyx":395 | |
4148 | /* "_proj.pyx":408 | |
3788 | 4149 | * for i from 0 <= i < ndim: |
3789 | 4150 | * if not radians: |
3790 | 4151 | * lon1 = lonsdata[i] # <<<<<<<<<<<<<< |
3793 | 4154 | */ |
3794 | 4155 | __pyx_v_lon1 = (__pyx_v_lonsdata[__pyx_v_i]); |
3795 | 4156 | |
3796 | /* "_proj.pyx":396 | |
4157 | /* "_proj.pyx":409 | |
3797 | 4158 | * if not radians: |
3798 | 4159 | * lon1 = lonsdata[i] |
3799 | 4160 | * lat1 = latsdata[i] # <<<<<<<<<<<<<< |
3802 | 4163 | */ |
3803 | 4164 | __pyx_v_lat1 = (__pyx_v_latsdata[__pyx_v_i]); |
3804 | 4165 | |
3805 | /* "_proj.pyx":397 | |
4166 | /* "_proj.pyx":410 | |
3806 | 4167 | * lon1 = lonsdata[i] |
3807 | 4168 | * lat1 = latsdata[i] |
3808 | 4169 | * az1 = azdata[i] # <<<<<<<<<<<<<< |
3811 | 4172 | */ |
3812 | 4173 | __pyx_v_az1 = (__pyx_v_azdata[__pyx_v_i]); |
3813 | 4174 | |
3814 | /* "_proj.pyx":398 | |
4175 | /* "_proj.pyx":411 | |
3815 | 4176 | * lat1 = latsdata[i] |
3816 | 4177 | * az1 = azdata[i] |
3817 | 4178 | * s12 = distdata[i] # <<<<<<<<<<<<<< |
3823 | 4184 | } |
3824 | 4185 | /*else*/ { |
3825 | 4186 | |
3826 | /* "_proj.pyx":400 | |
4187 | /* "_proj.pyx":413 | |
3827 | 4188 | * s12 = distdata[i] |
3828 | 4189 | * else: |
3829 | 4190 | * lon1 = _dg2rad*lonsdata[i] # <<<<<<<<<<<<<< |
3832 | 4193 | */ |
3833 | 4194 | __pyx_v_lon1 = (__pyx_v_5_proj__dg2rad * (__pyx_v_lonsdata[__pyx_v_i])); |
3834 | 4195 | |
3835 | /* "_proj.pyx":401 | |
4196 | /* "_proj.pyx":414 | |
3836 | 4197 | * else: |
3837 | 4198 | * lon1 = _dg2rad*lonsdata[i] |
3838 | 4199 | * lat1 = _dg2rad*latsdata[i] # <<<<<<<<<<<<<< |
3841 | 4202 | */ |
3842 | 4203 | __pyx_v_lat1 = (__pyx_v_5_proj__dg2rad * (__pyx_v_latsdata[__pyx_v_i])); |
3843 | 4204 | |
3844 | /* "_proj.pyx":402 | |
4205 | /* "_proj.pyx":415 | |
3845 | 4206 | * lon1 = _dg2rad*lonsdata[i] |
3846 | 4207 | * lat1 = _dg2rad*latsdata[i] |
3847 | 4208 | * az1 = _dg2rad*azdata[i] # <<<<<<<<<<<<<< |
3848 | 4209 | * s12 = distdata[i] |
3849 | * Direct(&self._Geodesic, lat1, lon1, az1, s12,\ | |
4210 | * geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\ | |
3850 | 4211 | */ |
3851 | 4212 | __pyx_v_az1 = (__pyx_v_5_proj__dg2rad * (__pyx_v_azdata[__pyx_v_i])); |
3852 | 4213 | |
3853 | /* "_proj.pyx":403 | |
4214 | /* "_proj.pyx":416 | |
3854 | 4215 | * lat1 = _dg2rad*latsdata[i] |
3855 | 4216 | * az1 = _dg2rad*azdata[i] |
3856 | 4217 | * s12 = distdata[i] # <<<<<<<<<<<<<< |
3857 | * Direct(&self._Geodesic, lat1, lon1, az1, s12,\ | |
4218 | * geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\ | |
3858 | 4219 | * &plat2, &plon2, &pazi2) |
3859 | 4220 | */ |
3860 | 4221 | __pyx_v_s12 = (__pyx_v_distdata[__pyx_v_i]); |
3861 | 4222 | } |
3862 | 4223 | __pyx_L10:; |
3863 | 4224 | |
3864 | /* "_proj.pyx":405 | |
4225 | /* "_proj.pyx":418 | |
3865 | 4226 | * s12 = distdata[i] |
3866 | * Direct(&self._Geodesic, lat1, lon1, az1, s12,\ | |
4227 | * geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\ | |
3867 | 4228 | * &plat2, &plon2, &pazi2) # <<<<<<<<<<<<<< |
3868 | 4229 | * # back azimuth needs to be flipped 180 degrees |
3869 | 4230 | * # to match what proj4 geod utility produces. |
3870 | 4231 | */ |
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 | |
3874 | 4235 | * # back azimuth needs to be flipped 180 degrees |
3875 | 4236 | * # to match what proj4 geod utility produces. |
3876 | 4237 | * if pazi2 > 0: # <<<<<<<<<<<<<< |
3877 | 4238 | * 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); | |
3881 | 4242 | if (__pyx_t_1) { |
3882 | 4243 | |
3883 | /* "_proj.pyx":409 | |
4244 | /* "_proj.pyx":422 | |
3884 | 4245 | * # to match what proj4 geod utility produces. |
3885 | 4246 | * if pazi2 > 0: |
3886 | 4247 | * pazi2 = pazi2-180. # <<<<<<<<<<<<<< |
3887 | * elif pazi2 < 0: | |
4248 | * elif pazi2 <= 0: | |
3888 | 4249 | * pazi2 = pazi2+180. |
3889 | 4250 | */ |
3890 | 4251 | __pyx_v_pazi2 = (__pyx_v_pazi2 - 180.); |
3891 | 4252 | goto __pyx_L11; |
3892 | 4253 | } |
3893 | 4254 | |
3894 | /* "_proj.pyx":410 | |
4255 | /* "_proj.pyx":423 | |
3895 | 4256 | * if pazi2 > 0: |
3896 | 4257 | * pazi2 = pazi2-180. |
3897 | * elif pazi2 < 0: # <<<<<<<<<<<<<< | |
4258 | * elif pazi2 <= 0: # <<<<<<<<<<<<<< | |
3898 | 4259 | * pazi2 = pazi2+180. |
3899 | 4260 | * # check for NaN. |
3900 | 4261 | */ |
3901 | __pyx_t_1 = (__pyx_v_pazi2 < 0.0); | |
4262 | __pyx_t_1 = ((__pyx_v_pazi2 <= 0.0) != 0); | |
3902 | 4263 | if (__pyx_t_1) { |
3903 | 4264 | |
3904 | /* "_proj.pyx":411 | |
4265 | /* "_proj.pyx":424 | |
3905 | 4266 | * pazi2 = pazi2-180. |
3906 | * elif pazi2 < 0: | |
4267 | * elif pazi2 <= 0: | |
3907 | 4268 | * pazi2 = pazi2+180. # <<<<<<<<<<<<<< |
3908 | 4269 | * # check for NaN. |
3909 | 4270 | * if pazi2 != pazi2: |
3913 | 4274 | } |
3914 | 4275 | __pyx_L11:; |
3915 | 4276 | |
3916 | /* "_proj.pyx":413 | |
4277 | /* "_proj.pyx":426 | |
3917 | 4278 | * pazi2 = pazi2+180. |
3918 | 4279 | * # check for NaN. |
3919 | 4280 | * if pazi2 != pazi2: # <<<<<<<<<<<<<< |
3920 | 4281 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
3921 | 4282 | * if not radians: |
3922 | 4283 | */ |
3923 | __pyx_t_1 = (__pyx_v_pazi2 != __pyx_v_pazi2); | |
4284 | __pyx_t_1 = ((__pyx_v_pazi2 != __pyx_v_pazi2) != 0); | |
3924 | 4285 | if (__pyx_t_1) { |
3925 | 4286 | |
3926 | /* "_proj.pyx":414 | |
4287 | /* "_proj.pyx":427 | |
3927 | 4288 | * # check for NaN. |
3928 | 4289 | * if pazi2 != pazi2: |
3929 | 4290 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<< |
3930 | 4291 | * if not radians: |
3931 | 4292 | * lonsdata[i] = plon2 |
3932 | 4293 | */ |
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;} | |
3934 | 4295 | __Pyx_GOTREF(__pyx_t_5); |
3935 | 4296 | __Pyx_Raise(__pyx_t_5, 0, 0, 0); |
3936 | 4297 | __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;} | |
3938 | 4299 | goto __pyx_L12; |
3939 | 4300 | } |
3940 | 4301 | __pyx_L12:; |
3941 | 4302 | |
3942 | /* "_proj.pyx":415 | |
4303 | /* "_proj.pyx":428 | |
3943 | 4304 | * if pazi2 != pazi2: |
3944 | 4305 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
3945 | 4306 | * if not radians: # <<<<<<<<<<<<<< |
3946 | 4307 | * lonsdata[i] = plon2 |
3947 | 4308 | * latsdata[i] = plat2 |
3948 | 4309 | */ |
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); | |
3951 | 4312 | if (__pyx_t_2) { |
3952 | 4313 | |
3953 | /* "_proj.pyx":416 | |
4314 | /* "_proj.pyx":429 | |
3954 | 4315 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
3955 | 4316 | * if not radians: |
3956 | 4317 | * lonsdata[i] = plon2 # <<<<<<<<<<<<<< |
3959 | 4320 | */ |
3960 | 4321 | (__pyx_v_lonsdata[__pyx_v_i]) = __pyx_v_plon2; |
3961 | 4322 | |
3962 | /* "_proj.pyx":417 | |
4323 | /* "_proj.pyx":430 | |
3963 | 4324 | * if not radians: |
3964 | 4325 | * lonsdata[i] = plon2 |
3965 | 4326 | * latsdata[i] = plat2 # <<<<<<<<<<<<<< |
3968 | 4329 | */ |
3969 | 4330 | (__pyx_v_latsdata[__pyx_v_i]) = __pyx_v_plat2; |
3970 | 4331 | |
3971 | /* "_proj.pyx":418 | |
4332 | /* "_proj.pyx":431 | |
3972 | 4333 | * lonsdata[i] = plon2 |
3973 | 4334 | * latsdata[i] = plat2 |
3974 | 4335 | * azdata[i] = pazi2 # <<<<<<<<<<<<<< |
3980 | 4341 | } |
3981 | 4342 | /*else*/ { |
3982 | 4343 | |
3983 | /* "_proj.pyx":420 | |
4344 | /* "_proj.pyx":433 | |
3984 | 4345 | * azdata[i] = pazi2 |
3985 | 4346 | * else: |
3986 | 4347 | * lonsdata[i] = _rad2dg*plon2 # <<<<<<<<<<<<<< |
3989 | 4350 | */ |
3990 | 4351 | (__pyx_v_lonsdata[__pyx_v_i]) = (__pyx_v_5_proj__rad2dg * __pyx_v_plon2); |
3991 | 4352 | |
3992 | /* "_proj.pyx":421 | |
4353 | /* "_proj.pyx":434 | |
3993 | 4354 | * else: |
3994 | 4355 | * lonsdata[i] = _rad2dg*plon2 |
3995 | 4356 | * latsdata[i] = _rad2dg*plat2 # <<<<<<<<<<<<<< |
3998 | 4359 | */ |
3999 | 4360 | (__pyx_v_latsdata[__pyx_v_i]) = (__pyx_v_5_proj__rad2dg * __pyx_v_plat2); |
4000 | 4361 | |
4001 | /* "_proj.pyx":422 | |
4362 | /* "_proj.pyx":435 | |
4002 | 4363 | * lonsdata[i] = _rad2dg*plon2 |
4003 | 4364 | * latsdata[i] = _rad2dg*plat2 |
4004 | 4365 | * azdata[i] = _rad2dg*pazi2 # <<<<<<<<<<<<<< |
4033 | 4394 | PyObject *__pyx_v_lons2 = 0; |
4034 | 4395 | PyObject *__pyx_v_lats2 = 0; |
4035 | 4396 | PyObject *__pyx_v_radians = 0; |
4397 | int __pyx_lineno = 0; | |
4398 | const char *__pyx_filename = NULL; | |
4399 | int __pyx_clineno = 0; | |
4036 | 4400 | PyObject *__pyx_r = 0; |
4037 | 4401 | __Pyx_RefNannyDeclarations |
4038 | 4402 | __Pyx_RefNannySetupContext("_inv (wrapper)", 0); |
4060 | 4424 | case 1: |
4061 | 4425 | if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats1)) != 0)) kw_args--; |
4062 | 4426 | 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;} | |
4064 | 4428 | } |
4065 | 4429 | case 2: |
4066 | 4430 | if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lons2)) != 0)) kw_args--; |
4067 | 4431 | 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;} | |
4069 | 4433 | } |
4070 | 4434 | case 3: |
4071 | 4435 | if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lats2)) != 0)) kw_args--; |
4072 | 4436 | 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;} | |
4074 | 4438 | } |
4075 | 4439 | case 4: |
4076 | 4440 | if (kw_args > 0) { |
4079 | 4443 | } |
4080 | 4444 | } |
4081 | 4445 | 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;} | |
4083 | 4447 | } |
4084 | 4448 | } else { |
4085 | 4449 | switch (PyTuple_GET_SIZE(__pyx_args)) { |
4100 | 4464 | } |
4101 | 4465 | goto __pyx_L4_argument_unpacking_done; |
4102 | 4466 | __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;} | |
4104 | 4468 | __pyx_L3_error:; |
4105 | 4469 | __Pyx_AddTraceback("_proj.Geod._inv", __pyx_clineno, __pyx_lineno, __pyx_filename); |
4106 | 4470 | __Pyx_RefNannyFinishContext(); |
4111 | 4475 | return __pyx_r; |
4112 | 4476 | } |
4113 | 4477 | |
4114 | /* "_proj.pyx":424 | |
4478 | /* "_proj.pyx":437 | |
4115 | 4479 | * azdata[i] = _rad2dg*pazi2 |
4116 | 4480 | * |
4117 | 4481 | * def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False): # <<<<<<<<<<<<<< |
4155 | 4519 | int __pyx_clineno = 0; |
4156 | 4520 | __Pyx_RefNannySetupContext("_inv", 0); |
4157 | 4521 | |
4158 | /* "_proj.pyx":435 | |
4522 | /* "_proj.pyx":448 | |
4159 | 4523 | * cdef void *londata, *latdata, *azdat, *distdat |
4160 | 4524 | * # if buffer api is supported, get pointer to data buffers. |
4161 | 4525 | * if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0: # <<<<<<<<<<<<<< |
4162 | 4526 | * raise RuntimeError |
4163 | 4527 | * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0: |
4164 | 4528 | */ |
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); | |
4166 | 4530 | if (__pyx_t_1) { |
4167 | 4531 | |
4168 | /* "_proj.pyx":436 | |
4532 | /* "_proj.pyx":449 | |
4169 | 4533 | * # if buffer api is supported, get pointer to data buffers. |
4170 | 4534 | * if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0: |
4171 | 4535 | * raise RuntimeError # <<<<<<<<<<<<<< |
4173 | 4537 | * raise RuntimeError |
4174 | 4538 | */ |
4175 | 4539 | __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;} | |
4177 | 4541 | goto __pyx_L3; |
4178 | 4542 | } |
4179 | 4543 | __pyx_L3:; |
4180 | 4544 | |
4181 | /* "_proj.pyx":437 | |
4545 | /* "_proj.pyx":450 | |
4182 | 4546 | * if PyObject_AsWriteBuffer(lons1, &londata, &buflenlons) <> 0: |
4183 | 4547 | * raise RuntimeError |
4184 | 4548 | * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0: # <<<<<<<<<<<<<< |
4185 | 4549 | * raise RuntimeError |
4186 | 4550 | * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0: |
4187 | 4551 | */ |
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); | |
4189 | 4553 | if (__pyx_t_1) { |
4190 | 4554 | |
4191 | /* "_proj.pyx":438 | |
4555 | /* "_proj.pyx":451 | |
4192 | 4556 | * raise RuntimeError |
4193 | 4557 | * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0: |
4194 | 4558 | * raise RuntimeError # <<<<<<<<<<<<<< |
4196 | 4560 | * raise RuntimeError |
4197 | 4561 | */ |
4198 | 4562 | __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;} | |
4200 | 4564 | goto __pyx_L4; |
4201 | 4565 | } |
4202 | 4566 | __pyx_L4:; |
4203 | 4567 | |
4204 | /* "_proj.pyx":439 | |
4568 | /* "_proj.pyx":452 | |
4205 | 4569 | * if PyObject_AsWriteBuffer(lats1, &latdata, &buflenlats) <> 0: |
4206 | 4570 | * raise RuntimeError |
4207 | 4571 | * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0: # <<<<<<<<<<<<<< |
4208 | 4572 | * raise RuntimeError |
4209 | 4573 | * if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0: |
4210 | 4574 | */ |
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); | |
4212 | 4576 | if (__pyx_t_1) { |
4213 | 4577 | |
4214 | /* "_proj.pyx":440 | |
4578 | /* "_proj.pyx":453 | |
4215 | 4579 | * raise RuntimeError |
4216 | 4580 | * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0: |
4217 | 4581 | * raise RuntimeError # <<<<<<<<<<<<<< |
4219 | 4583 | * raise RuntimeError |
4220 | 4584 | */ |
4221 | 4585 | __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;} | |
4223 | 4587 | goto __pyx_L5; |
4224 | 4588 | } |
4225 | 4589 | __pyx_L5:; |
4226 | 4590 | |
4227 | /* "_proj.pyx":441 | |
4591 | /* "_proj.pyx":454 | |
4228 | 4592 | * if PyObject_AsWriteBuffer(lons2, &azdat, &buflenaz) <> 0: |
4229 | 4593 | * raise RuntimeError |
4230 | 4594 | * if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0: # <<<<<<<<<<<<<< |
4231 | 4595 | * raise RuntimeError |
4232 | 4596 | * # process data in buffer |
4233 | 4597 | */ |
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); | |
4235 | 4599 | if (__pyx_t_1) { |
4236 | 4600 | |
4237 | /* "_proj.pyx":442 | |
4601 | /* "_proj.pyx":455 | |
4238 | 4602 | * raise RuntimeError |
4239 | 4603 | * if PyObject_AsWriteBuffer(lats2, &distdat, &buflend) <> 0: |
4240 | 4604 | * raise RuntimeError # <<<<<<<<<<<<<< |
4242 | 4606 | * if not buflenlons == buflenlats == buflenaz == buflend: |
4243 | 4607 | */ |
4244 | 4608 | __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;} | |
4246 | 4610 | goto __pyx_L6; |
4247 | 4611 | } |
4248 | 4612 | __pyx_L6:; |
4249 | 4613 | |
4250 | /* "_proj.pyx":444 | |
4614 | /* "_proj.pyx":457 | |
4251 | 4615 | * raise RuntimeError |
4252 | 4616 | * # process data in buffer |
4253 | 4617 | * if not buflenlons == buflenlats == buflenaz == buflend: # <<<<<<<<<<<<<< |
4261 | 4625 | __pyx_t_1 = (__pyx_v_buflenaz == __pyx_v_buflend); |
4262 | 4626 | } |
4263 | 4627 | } |
4264 | __pyx_t_2 = (!__pyx_t_1); | |
4628 | __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0); | |
4265 | 4629 | if (__pyx_t_2) { |
4266 | 4630 | |
4267 | /* "_proj.pyx":445 | |
4631 | /* "_proj.pyx":458 | |
4268 | 4632 | * # process data in buffer |
4269 | 4633 | * if not buflenlons == buflenlats == buflenaz == buflend: |
4270 | 4634 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
4271 | 4635 | * ndim = buflenlons//_doublesize |
4272 | 4636 | * lonsdata = <double *>londata |
4273 | 4637 | */ |
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;} | |
4275 | 4639 | __Pyx_GOTREF(__pyx_t_3); |
4276 | 4640 | __Pyx_Raise(__pyx_t_3, 0, 0, 0); |
4277 | 4641 | __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;} | |
4279 | 4643 | goto __pyx_L7; |
4280 | 4644 | } |
4281 | 4645 | __pyx_L7:; |
4282 | 4646 | |
4283 | /* "_proj.pyx":446 | |
4647 | /* "_proj.pyx":459 | |
4284 | 4648 | * if not buflenlons == buflenlats == buflenaz == buflend: |
4285 | 4649 | * raise RuntimeError("Buffer lengths not the same") |
4286 | 4650 | * ndim = buflenlons//_doublesize # <<<<<<<<<<<<<< |
4287 | 4651 | * lonsdata = <double *>londata |
4288 | 4652 | * latsdata = <double *>latdata |
4289 | 4653 | */ |
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;} | |
4291 | 4655 | __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;} | |
4293 | 4657 | __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;} | |
4295 | 4659 | __Pyx_GOTREF(__pyx_t_5); |
4296 | 4660 | __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; |
4297 | 4661 | __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;} | |
4299 | 4663 | __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; |
4300 | 4664 | __pyx_v_ndim = __pyx_t_6; |
4301 | 4665 | |
4302 | /* "_proj.pyx":447 | |
4666 | /* "_proj.pyx":460 | |
4303 | 4667 | * raise RuntimeError("Buffer lengths not the same") |
4304 | 4668 | * ndim = buflenlons//_doublesize |
4305 | 4669 | * lonsdata = <double *>londata # <<<<<<<<<<<<<< |
4308 | 4672 | */ |
4309 | 4673 | __pyx_v_lonsdata = ((double *)__pyx_v_londata); |
4310 | 4674 | |
4311 | /* "_proj.pyx":448 | |
4675 | /* "_proj.pyx":461 | |
4312 | 4676 | * ndim = buflenlons//_doublesize |
4313 | 4677 | * lonsdata = <double *>londata |
4314 | 4678 | * latsdata = <double *>latdata # <<<<<<<<<<<<<< |
4317 | 4681 | */ |
4318 | 4682 | __pyx_v_latsdata = ((double *)__pyx_v_latdata); |
4319 | 4683 | |
4320 | /* "_proj.pyx":449 | |
4684 | /* "_proj.pyx":462 | |
4321 | 4685 | * lonsdata = <double *>londata |
4322 | 4686 | * latsdata = <double *>latdata |
4323 | 4687 | * azdata = <double *>azdat # <<<<<<<<<<<<<< |
4326 | 4690 | */ |
4327 | 4691 | __pyx_v_azdata = ((double *)__pyx_v_azdat); |
4328 | 4692 | |
4329 | /* "_proj.pyx":450 | |
4693 | /* "_proj.pyx":463 | |
4330 | 4694 | * latsdata = <double *>latdata |
4331 | 4695 | * azdata = <double *>azdat |
4332 | 4696 | * distdata = <double *>distdat # <<<<<<<<<<<<<< |
4335 | 4699 | */ |
4336 | 4700 | __pyx_v_distdata = ((double *)__pyx_v_distdat); |
4337 | 4701 | |
4338 | /* "_proj.pyx":451 | |
4702 | /* "_proj.pyx":464 | |
4339 | 4703 | * azdata = <double *>azdat |
4340 | 4704 | * distdata = <double *>distdat |
4341 | 4705 | * errmsg = 'undefined inverse geodesic (may be an antipodal point)' # <<<<<<<<<<<<<< |
4345 | 4709 | __Pyx_INCREF(((PyObject *)__pyx_kp_s_20)); |
4346 | 4710 | __pyx_v_errmsg = ((PyObject *)__pyx_kp_s_20); |
4347 | 4711 | |
4348 | /* "_proj.pyx":452 | |
4712 | /* "_proj.pyx":465 | |
4349 | 4713 | * distdata = <double *>distdat |
4350 | 4714 | * errmsg = 'undefined inverse geodesic (may be an antipodal point)' |
4351 | 4715 | * for i from 0 <= i < ndim: # <<<<<<<<<<<<<< |
4355 | 4719 | __pyx_t_6 = __pyx_v_ndim; |
4356 | 4720 | for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) { |
4357 | 4721 | |
4358 | /* "_proj.pyx":453 | |
4722 | /* "_proj.pyx":466 | |
4359 | 4723 | * errmsg = 'undefined inverse geodesic (may be an antipodal point)' |
4360 | 4724 | * for i from 0 <= i < ndim: |
4361 | 4725 | * if radians: # <<<<<<<<<<<<<< |
4362 | 4726 | * lon1 = _rad2dg*lonsdata[i] |
4363 | 4727 | * lat1 = _rad2dg*latsdata[i] |
4364 | 4728 | */ |
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;} | |
4366 | 4730 | if (__pyx_t_2) { |
4367 | 4731 | |
4368 | /* "_proj.pyx":454 | |
4732 | /* "_proj.pyx":467 | |
4369 | 4733 | * for i from 0 <= i < ndim: |
4370 | 4734 | * if radians: |
4371 | 4735 | * lon1 = _rad2dg*lonsdata[i] # <<<<<<<<<<<<<< |
4374 | 4738 | */ |
4375 | 4739 | __pyx_v_lon1 = (__pyx_v_5_proj__rad2dg * (__pyx_v_lonsdata[__pyx_v_i])); |
4376 | 4740 | |
4377 | /* "_proj.pyx":455 | |
4741 | /* "_proj.pyx":468 | |
4378 | 4742 | * if radians: |
4379 | 4743 | * lon1 = _rad2dg*lonsdata[i] |
4380 | 4744 | * lat1 = _rad2dg*latsdata[i] # <<<<<<<<<<<<<< |
4383 | 4747 | */ |
4384 | 4748 | __pyx_v_lat1 = (__pyx_v_5_proj__rad2dg * (__pyx_v_latsdata[__pyx_v_i])); |
4385 | 4749 | |
4386 | /* "_proj.pyx":456 | |
4750 | /* "_proj.pyx":469 | |
4387 | 4751 | * lon1 = _rad2dg*lonsdata[i] |
4388 | 4752 | * lat1 = _rad2dg*latsdata[i] |
4389 | 4753 | * lon2 = _rad2dg*azdata[i] # <<<<<<<<<<<<<< |
4392 | 4756 | */ |
4393 | 4757 | __pyx_v_lon2 = (__pyx_v_5_proj__rad2dg * (__pyx_v_azdata[__pyx_v_i])); |
4394 | 4758 | |
4395 | /* "_proj.pyx":457 | |
4759 | /* "_proj.pyx":470 | |
4396 | 4760 | * lat1 = _rad2dg*latsdata[i] |
4397 | 4761 | * lon2 = _rad2dg*azdata[i] |
4398 | 4762 | * lat2 = _rad2dg*distdata[i] # <<<<<<<<<<<<<< |
4404 | 4768 | } |
4405 | 4769 | /*else*/ { |
4406 | 4770 | |
4407 | /* "_proj.pyx":459 | |
4771 | /* "_proj.pyx":472 | |
4408 | 4772 | * lat2 = _rad2dg*distdata[i] |
4409 | 4773 | * else: |
4410 | 4774 | * lon1 = lonsdata[i] # <<<<<<<<<<<<<< |
4413 | 4777 | */ |
4414 | 4778 | __pyx_v_lon1 = (__pyx_v_lonsdata[__pyx_v_i]); |
4415 | 4779 | |
4416 | /* "_proj.pyx":460 | |
4780 | /* "_proj.pyx":473 | |
4417 | 4781 | * else: |
4418 | 4782 | * lon1 = lonsdata[i] |
4419 | 4783 | * lat1 = latsdata[i] # <<<<<<<<<<<<<< |
4422 | 4786 | */ |
4423 | 4787 | __pyx_v_lat1 = (__pyx_v_latsdata[__pyx_v_i]); |
4424 | 4788 | |
4425 | /* "_proj.pyx":461 | |
4789 | /* "_proj.pyx":474 | |
4426 | 4790 | * lon1 = lonsdata[i] |
4427 | 4791 | * lat1 = latsdata[i] |
4428 | 4792 | * lon2 = azdata[i] # <<<<<<<<<<<<<< |
4429 | 4793 | * lat2 = distdata[i] |
4430 | * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2, | |
4794 | * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2, | |
4431 | 4795 | */ |
4432 | 4796 | __pyx_v_lon2 = (__pyx_v_azdata[__pyx_v_i]); |
4433 | 4797 | |
4434 | /* "_proj.pyx":462 | |
4798 | /* "_proj.pyx":475 | |
4435 | 4799 | * lat1 = latsdata[i] |
4436 | 4800 | * lon2 = azdata[i] |
4437 | 4801 | * lat2 = distdata[i] # <<<<<<<<<<<<<< |
4438 | * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2, | |
4802 | * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2, | |
4439 | 4803 | * &ps12, &pazi1, &pazi2) |
4440 | 4804 | */ |
4441 | 4805 | __pyx_v_lat2 = (__pyx_v_distdata[__pyx_v_i]); |
4442 | 4806 | } |
4443 | 4807 | __pyx_L10:; |
4444 | 4808 | |
4445 | /* "_proj.pyx":464 | |
4809 | /* "_proj.pyx":477 | |
4446 | 4810 | * lat2 = distdata[i] |
4447 | * Inverse(&self._Geodesic, lat1, lon1, lat2, lon2, | |
4811 | * geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2, | |
4448 | 4812 | * &ps12, &pazi1, &pazi2) # <<<<<<<<<<<<<< |
4449 | 4813 | * # back azimuth needs to be flipped 180 degrees |
4450 | 4814 | * # to match what proj4 geod utility produces. |
4451 | 4815 | */ |
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 | |
4455 | 4819 | * # back azimuth needs to be flipped 180 degrees |
4456 | 4820 | * # to match what proj4 geod utility produces. |
4457 | 4821 | * if pazi2 > 0: # <<<<<<<<<<<<<< |
4458 | 4822 | * 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); | |
4462 | 4826 | if (__pyx_t_2) { |
4463 | 4827 | |
4464 | /* "_proj.pyx":468 | |
4828 | /* "_proj.pyx":481 | |
4465 | 4829 | * # to match what proj4 geod utility produces. |
4466 | 4830 | * if pazi2 > 0: |
4467 | 4831 | * pazi2 = pazi2-180. # <<<<<<<<<<<<<< |
4468 | * elif pazi2 < 0: | |
4832 | * elif pazi2 <= 0: | |
4469 | 4833 | * pazi2 = pazi2+180. |
4470 | 4834 | */ |
4471 | 4835 | __pyx_v_pazi2 = (__pyx_v_pazi2 - 180.); |
4472 | 4836 | goto __pyx_L11; |
4473 | 4837 | } |
4474 | 4838 | |
4475 | /* "_proj.pyx":469 | |
4839 | /* "_proj.pyx":482 | |
4476 | 4840 | * if pazi2 > 0: |
4477 | 4841 | * pazi2 = pazi2-180. |
4478 | * elif pazi2 < 0: # <<<<<<<<<<<<<< | |
4842 | * elif pazi2 <= 0: # <<<<<<<<<<<<<< | |
4479 | 4843 | * pazi2 = pazi2+180. |
4480 | 4844 | * if ps12 != ps12: # check for NaN |
4481 | 4845 | */ |
4482 | __pyx_t_2 = (__pyx_v_pazi2 < 0.0); | |
4846 | __pyx_t_2 = ((__pyx_v_pazi2 <= 0.0) != 0); | |
4483 | 4847 | if (__pyx_t_2) { |
4484 | 4848 | |
4485 | /* "_proj.pyx":470 | |
4849 | /* "_proj.pyx":483 | |
4486 | 4850 | * pazi2 = pazi2-180. |
4487 | * elif pazi2 < 0: | |
4851 | * elif pazi2 <= 0: | |
4488 | 4852 | * pazi2 = pazi2+180. # <<<<<<<<<<<<<< |
4489 | 4853 | * if ps12 != ps12: # check for NaN |
4490 | 4854 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
4494 | 4858 | } |
4495 | 4859 | __pyx_L11:; |
4496 | 4860 | |
4497 | /* "_proj.pyx":471 | |
4498 | * elif pazi2 < 0: | |
4861 | /* "_proj.pyx":484 | |
4862 | * elif pazi2 <= 0: | |
4499 | 4863 | * pazi2 = pazi2+180. |
4500 | 4864 | * if ps12 != ps12: # check for NaN # <<<<<<<<<<<<<< |
4501 | 4865 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
4502 | 4866 | * if radians: |
4503 | 4867 | */ |
4504 | __pyx_t_2 = (__pyx_v_ps12 != __pyx_v_ps12); | |
4868 | __pyx_t_2 = ((__pyx_v_ps12 != __pyx_v_ps12) != 0); | |
4505 | 4869 | if (__pyx_t_2) { |
4506 | 4870 | |
4507 | /* "_proj.pyx":472 | |
4871 | /* "_proj.pyx":485 | |
4508 | 4872 | * pazi2 = pazi2+180. |
4509 | 4873 | * if ps12 != ps12: # check for NaN |
4510 | 4874 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<< |
4511 | 4875 | * if radians: |
4512 | 4876 | * lonsdata[i] = _rad2dg*pazi1 |
4513 | 4877 | */ |
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;} | |
4515 | 4879 | __Pyx_GOTREF(__pyx_t_5); |
4516 | 4880 | __Pyx_Raise(__pyx_t_5, 0, 0, 0); |
4517 | 4881 | __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;} | |
4519 | 4883 | goto __pyx_L12; |
4520 | 4884 | } |
4521 | 4885 | __pyx_L12:; |
4522 | 4886 | |
4523 | /* "_proj.pyx":473 | |
4887 | /* "_proj.pyx":486 | |
4524 | 4888 | * if ps12 != ps12: # check for NaN |
4525 | 4889 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
4526 | 4890 | * if radians: # <<<<<<<<<<<<<< |
4527 | 4891 | * lonsdata[i] = _rad2dg*pazi1 |
4528 | 4892 | * latsdata[i] = _rad2dg*pazi2 |
4529 | 4893 | */ |
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;} | |
4531 | 4895 | if (__pyx_t_2) { |
4532 | 4896 | |
4533 | /* "_proj.pyx":474 | |
4897 | /* "_proj.pyx":487 | |
4534 | 4898 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
4535 | 4899 | * if radians: |
4536 | 4900 | * lonsdata[i] = _rad2dg*pazi1 # <<<<<<<<<<<<<< |
4539 | 4903 | */ |
4540 | 4904 | (__pyx_v_lonsdata[__pyx_v_i]) = (__pyx_v_5_proj__rad2dg * __pyx_v_pazi1); |
4541 | 4905 | |
4542 | /* "_proj.pyx":475 | |
4906 | /* "_proj.pyx":488 | |
4543 | 4907 | * if radians: |
4544 | 4908 | * lonsdata[i] = _rad2dg*pazi1 |
4545 | 4909 | * latsdata[i] = _rad2dg*pazi2 # <<<<<<<<<<<<<< |
4551 | 4915 | } |
4552 | 4916 | /*else*/ { |
4553 | 4917 | |
4554 | /* "_proj.pyx":477 | |
4918 | /* "_proj.pyx":490 | |
4555 | 4919 | * latsdata[i] = _rad2dg*pazi2 |
4556 | 4920 | * else: |
4557 | 4921 | * lonsdata[i] = pazi1 # <<<<<<<<<<<<<< |
4560 | 4924 | */ |
4561 | 4925 | (__pyx_v_lonsdata[__pyx_v_i]) = __pyx_v_pazi1; |
4562 | 4926 | |
4563 | /* "_proj.pyx":478 | |
4927 | /* "_proj.pyx":491 | |
4564 | 4928 | * else: |
4565 | 4929 | * lonsdata[i] = pazi1 |
4566 | 4930 | * latsdata[i] = pazi2 # <<<<<<<<<<<<<< |
4571 | 4935 | } |
4572 | 4936 | __pyx_L13:; |
4573 | 4937 | |
4574 | /* "_proj.pyx":479 | |
4938 | /* "_proj.pyx":492 | |
4575 | 4939 | * lonsdata[i] = pazi1 |
4576 | 4940 | * latsdata[i] = pazi2 |
4577 | 4941 | * azdata[i] = ps12 # <<<<<<<<<<<<<< |
4606 | 4970 | double __pyx_v_lat2; |
4607 | 4971 | int __pyx_v_npts; |
4608 | 4972 | PyObject *__pyx_v_radians = 0; |
4973 | int __pyx_lineno = 0; | |
4974 | const char *__pyx_filename = NULL; | |
4975 | int __pyx_clineno = 0; | |
4609 | 4976 | PyObject *__pyx_r = 0; |
4610 | 4977 | __Pyx_RefNannyDeclarations |
4611 | 4978 | __Pyx_RefNannySetupContext("_npts (wrapper)", 0); |
4634 | 5001 | case 1: |
4635 | 5002 | if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lat1)) != 0)) kw_args--; |
4636 | 5003 | 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;} | |
4638 | 5005 | } |
4639 | 5006 | case 2: |
4640 | 5007 | if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lon2)) != 0)) kw_args--; |
4641 | 5008 | 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;} | |
4643 | 5010 | } |
4644 | 5011 | case 3: |
4645 | 5012 | if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lat2)) != 0)) kw_args--; |
4646 | 5013 | 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;} | |
4648 | 5015 | } |
4649 | 5016 | case 4: |
4650 | 5017 | if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__npts)) != 0)) kw_args--; |
4651 | 5018 | 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;} | |
4653 | 5020 | } |
4654 | 5021 | case 5: |
4655 | 5022 | if (kw_args > 0) { |
4658 | 5025 | } |
4659 | 5026 | } |
4660 | 5027 | 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;} | |
4662 | 5029 | } |
4663 | 5030 | } else { |
4664 | 5031 | switch (PyTuple_GET_SIZE(__pyx_args)) { |
4672 | 5039 | default: goto __pyx_L5_argtuple_error; |
4673 | 5040 | } |
4674 | 5041 | } |
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;} | |
4680 | 5047 | __pyx_v_radians = values[5]; |
4681 | 5048 | } |
4682 | 5049 | goto __pyx_L4_argument_unpacking_done; |
4683 | 5050 | __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;} | |
4685 | 5052 | __pyx_L3_error:; |
4686 | 5053 | __Pyx_AddTraceback("_proj.Geod._npts", __pyx_clineno, __pyx_lineno, __pyx_filename); |
4687 | 5054 | __Pyx_RefNannyFinishContext(); |
4692 | 5059 | return __pyx_r; |
4693 | 5060 | } |
4694 | 5061 | |
4695 | /* "_proj.pyx":481 | |
5062 | /* "_proj.pyx":494 | |
4696 | 5063 | * azdata[i] = ps12 |
4697 | 5064 | * |
4698 | 5065 | * def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False): # <<<<<<<<<<<<<< |
4722 | 5089 | int __pyx_clineno = 0; |
4723 | 5090 | __Pyx_RefNannySetupContext("_npts", 0); |
4724 | 5091 | |
4725 | /* "_proj.pyx":486 | |
5092 | /* "_proj.pyx":499 | |
4726 | 5093 | * cdef int i |
4727 | 5094 | * cdef double del_s,ps12,pazi1,pazi2,s12,plon2,plat2 |
4728 | 5095 | * if radians: # <<<<<<<<<<<<<< |
4729 | 5096 | * lon1 = _rad2dg*lon1 |
4730 | 5097 | * lat1 = _rad2dg*lat1 |
4731 | 5098 | */ |
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;} | |
4733 | 5100 | if (__pyx_t_1) { |
4734 | 5101 | |
4735 | /* "_proj.pyx":487 | |
5102 | /* "_proj.pyx":500 | |
4736 | 5103 | * cdef double del_s,ps12,pazi1,pazi2,s12,plon2,plat2 |
4737 | 5104 | * if radians: |
4738 | 5105 | * lon1 = _rad2dg*lon1 # <<<<<<<<<<<<<< |
4741 | 5108 | */ |
4742 | 5109 | __pyx_v_lon1 = (__pyx_v_5_proj__rad2dg * __pyx_v_lon1); |
4743 | 5110 | |
4744 | /* "_proj.pyx":488 | |
5111 | /* "_proj.pyx":501 | |
4745 | 5112 | * if radians: |
4746 | 5113 | * lon1 = _rad2dg*lon1 |
4747 | 5114 | * lat1 = _rad2dg*lat1 # <<<<<<<<<<<<<< |
4750 | 5117 | */ |
4751 | 5118 | __pyx_v_lat1 = (__pyx_v_5_proj__rad2dg * __pyx_v_lat1); |
4752 | 5119 | |
4753 | /* "_proj.pyx":489 | |
5120 | /* "_proj.pyx":502 | |
4754 | 5121 | * lon1 = _rad2dg*lon1 |
4755 | 5122 | * lat1 = _rad2dg*lat1 |
4756 | 5123 | * lon2 = _rad2dg*lon2 # <<<<<<<<<<<<<< |
4759 | 5126 | */ |
4760 | 5127 | __pyx_v_lon2 = (__pyx_v_5_proj__rad2dg * __pyx_v_lon2); |
4761 | 5128 | |
4762 | /* "_proj.pyx":490 | |
5129 | /* "_proj.pyx":503 | |
4763 | 5130 | * lat1 = _rad2dg*lat1 |
4764 | 5131 | * lon2 = _rad2dg*lon2 |
4765 | 5132 | * lat2 = _rad2dg*lat2 # <<<<<<<<<<<<<< |
4766 | 5133 | * # 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, | |
4768 | 5135 | */ |
4769 | 5136 | __pyx_v_lat2 = (__pyx_v_5_proj__rad2dg * __pyx_v_lat2); |
4770 | 5137 | goto __pyx_L3; |
4771 | 5138 | } |
4772 | 5139 | __pyx_L3:; |
4773 | 5140 | |
4774 | /* "_proj.pyx":493 | |
5141 | /* "_proj.pyx":506 | |
4775 | 5142 | * # 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, | |
4777 | 5144 | * &ps12, &pazi1, &pazi2) # <<<<<<<<<<<<<< |
4778 | 5145 | * # distance increment. |
4779 | 5146 | * del_s = ps12/(npts+1) |
4780 | 5147 | */ |
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 | |
4784 | 5151 | * &ps12, &pazi1, &pazi2) |
4785 | 5152 | * # distance increment. |
4786 | 5153 | * del_s = ps12/(npts+1) # <<<<<<<<<<<<<< |
4789 | 5156 | */ |
4790 | 5157 | __pyx_t_2 = (__pyx_v_npts + 1); |
4791 | 5158 | if (unlikely(__pyx_t_2 == 0)) { |
5159 | #ifdef WITH_THREAD | |
5160 | PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); | |
5161 | #endif | |
4792 | 5162 | 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;} | |
4794 | 5167 | } |
4795 | 5168 | __pyx_v_del_s = (__pyx_v_ps12 / __pyx_t_2); |
4796 | 5169 | |
4797 | /* "_proj.pyx":497 | |
5170 | /* "_proj.pyx":510 | |
4798 | 5171 | * del_s = ps12/(npts+1) |
4799 | 5172 | * # initialize output tuples. |
4800 | 5173 | * lats = () # <<<<<<<<<<<<<< |
4804 | 5177 | __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); |
4805 | 5178 | __pyx_v_lats = __pyx_empty_tuple; |
4806 | 5179 | |
4807 | /* "_proj.pyx":498 | |
5180 | /* "_proj.pyx":511 | |
4808 | 5181 | * # initialize output tuples. |
4809 | 5182 | * lats = () |
4810 | 5183 | * lons = () # <<<<<<<<<<<<<< |
4814 | 5187 | __Pyx_INCREF(((PyObject *)__pyx_empty_tuple)); |
4815 | 5188 | __pyx_v_lons = __pyx_empty_tuple; |
4816 | 5189 | |
4817 | /* "_proj.pyx":500 | |
5190 | /* "_proj.pyx":513 | |
4818 | 5191 | * lons = () |
4819 | 5192 | * # loop over intermediate points, compute lat/lons. |
4820 | 5193 | * for i from 1 <= i < npts+1: # <<<<<<<<<<<<<< |
4821 | 5194 | * s12 = i*del_s |
4822 | * Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\ | |
5195 | * geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\ | |
4823 | 5196 | */ |
4824 | 5197 | __pyx_t_2 = (__pyx_v_npts + 1); |
4825 | 5198 | for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_2; __pyx_v_i++) { |
4826 | 5199 | |
4827 | /* "_proj.pyx":501 | |
5200 | /* "_proj.pyx":514 | |
4828 | 5201 | * # loop over intermediate points, compute lat/lons. |
4829 | 5202 | * for i from 1 <= i < npts+1: |
4830 | 5203 | * s12 = i*del_s # <<<<<<<<<<<<<< |
4831 | * Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\ | |
5204 | * geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\ | |
4832 | 5205 | * &plat2, &plon2, &pazi2) |
4833 | 5206 | */ |
4834 | 5207 | __pyx_v_s12 = (__pyx_v_i * __pyx_v_del_s); |
4835 | 5208 | |
4836 | /* "_proj.pyx":503 | |
5209 | /* "_proj.pyx":516 | |
4837 | 5210 | * s12 = i*del_s |
4838 | * Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\ | |
5211 | * geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\ | |
4839 | 5212 | * &plat2, &plon2, &pazi2) # <<<<<<<<<<<<<< |
4840 | 5213 | * if radians: |
4841 | 5214 | * lats = lats + (_dg2rad*plat2,) |
4842 | 5215 | */ |
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,\ | |
4847 | 5220 | * &plat2, &plon2, &pazi2) |
4848 | 5221 | * if radians: # <<<<<<<<<<<<<< |
4849 | 5222 | * lats = lats + (_dg2rad*plat2,) |
4850 | 5223 | * lons = lons + (_dg2rad*plon2,) |
4851 | 5224 | */ |
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;} | |
4853 | 5226 | if (__pyx_t_1) { |
4854 | 5227 | |
4855 | /* "_proj.pyx":505 | |
5228 | /* "_proj.pyx":518 | |
4856 | 5229 | * &plat2, &plon2, &pazi2) |
4857 | 5230 | * if radians: |
4858 | 5231 | * lats = lats + (_dg2rad*plat2,) # <<<<<<<<<<<<<< |
4859 | 5232 | * lons = lons + (_dg2rad*plon2,) |
4860 | 5233 | * else: |
4861 | 5234 | */ |
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;} | |
4863 | 5236 | __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;} | |
4865 | 5238 | __Pyx_GOTREF(__pyx_t_4); |
4866 | 5239 | PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); |
4867 | 5240 | __Pyx_GIVEREF(__pyx_t_3); |
4868 | 5241 | __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;} | |
4870 | 5243 | __Pyx_GOTREF(((PyObject *)__pyx_t_3)); |
4871 | 5244 | __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; |
4872 | 5245 | __Pyx_DECREF(((PyObject *)__pyx_v_lats)); |
4873 | __pyx_v_lats = __pyx_t_3; | |
5246 | __pyx_v_lats = ((PyObject*)__pyx_t_3); | |
4874 | 5247 | __pyx_t_3 = 0; |
4875 | 5248 | |
4876 | /* "_proj.pyx":506 | |
5249 | /* "_proj.pyx":519 | |
4877 | 5250 | * if radians: |
4878 | 5251 | * lats = lats + (_dg2rad*plat2,) |
4879 | 5252 | * lons = lons + (_dg2rad*plon2,) # <<<<<<<<<<<<<< |
4880 | 5253 | * else: |
4881 | 5254 | * lats = lats + (plat2,) |
4882 | 5255 | */ |
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;} | |
4884 | 5257 | __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;} | |
4886 | 5259 | __Pyx_GOTREF(__pyx_t_4); |
4887 | 5260 | PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); |
4888 | 5261 | __Pyx_GIVEREF(__pyx_t_3); |
4889 | 5262 | __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;} | |
4891 | 5264 | __Pyx_GOTREF(((PyObject *)__pyx_t_3)); |
4892 | 5265 | __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; |
4893 | 5266 | __Pyx_DECREF(((PyObject *)__pyx_v_lons)); |
4894 | __pyx_v_lons = __pyx_t_3; | |
5267 | __pyx_v_lons = ((PyObject*)__pyx_t_3); | |
4895 | 5268 | __pyx_t_3 = 0; |
4896 | 5269 | goto __pyx_L6; |
4897 | 5270 | } |
4898 | 5271 | /*else*/ { |
4899 | 5272 | |
4900 | /* "_proj.pyx":508 | |
5273 | /* "_proj.pyx":521 | |
4901 | 5274 | * lons = lons + (_dg2rad*plon2,) |
4902 | 5275 | * else: |
4903 | 5276 | * lats = lats + (plat2,) # <<<<<<<<<<<<<< |
4904 | 5277 | * lons = lons + (plon2,) |
4905 | 5278 | * return lons, lats |
4906 | 5279 | */ |
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;} | |
4908 | 5281 | __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;} | |
4910 | 5283 | __Pyx_GOTREF(__pyx_t_4); |
4911 | 5284 | PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); |
4912 | 5285 | __Pyx_GIVEREF(__pyx_t_3); |
4913 | 5286 | __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;} | |
4915 | 5288 | __Pyx_GOTREF(((PyObject *)__pyx_t_3)); |
4916 | 5289 | __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; |
4917 | 5290 | __Pyx_DECREF(((PyObject *)__pyx_v_lats)); |
4918 | __pyx_v_lats = __pyx_t_3; | |
5291 | __pyx_v_lats = ((PyObject*)__pyx_t_3); | |
4919 | 5292 | __pyx_t_3 = 0; |
4920 | 5293 | |
4921 | /* "_proj.pyx":509 | |
5294 | /* "_proj.pyx":522 | |
4922 | 5295 | * else: |
4923 | 5296 | * lats = lats + (plat2,) |
4924 | 5297 | * lons = lons + (plon2,) # <<<<<<<<<<<<<< |
4925 | 5298 | * return lons, lats |
4926 | 5299 | */ |
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;} | |
4928 | 5301 | __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;} | |
4930 | 5303 | __Pyx_GOTREF(__pyx_t_4); |
4931 | 5304 | PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); |
4932 | 5305 | __Pyx_GIVEREF(__pyx_t_3); |
4933 | 5306 | __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;} | |
4935 | 5308 | __Pyx_GOTREF(((PyObject *)__pyx_t_3)); |
4936 | 5309 | __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; |
4937 | 5310 | __Pyx_DECREF(((PyObject *)__pyx_v_lons)); |
4938 | __pyx_v_lons = __pyx_t_3; | |
5311 | __pyx_v_lons = ((PyObject*)__pyx_t_3); | |
4939 | 5312 | __pyx_t_3 = 0; |
4940 | 5313 | } |
4941 | 5314 | __pyx_L6:; |
4942 | 5315 | } |
4943 | 5316 | |
4944 | /* "_proj.pyx":510 | |
5317 | /* "_proj.pyx":523 | |
4945 | 5318 | * lats = lats + (plat2,) |
4946 | 5319 | * lons = lons + (plon2,) |
4947 | 5320 | * return lons, lats # <<<<<<<<<<<<<< |
4948 | 5321 | */ |
4949 | 5322 | __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;} | |
4951 | 5324 | __Pyx_GOTREF(__pyx_t_3); |
4952 | 5325 | __Pyx_INCREF(((PyObject *)__pyx_v_lons)); |
4953 | 5326 | PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_lons)); |
4985 | 5358 | return __pyx_r; |
4986 | 5359 | } |
4987 | 5360 | |
4988 | /* "_proj.pyx":355 | |
5361 | /* "_proj.pyx":368 | |
4989 | 5362 | * cdef class Geod: |
4990 | * cdef Geodesic _Geodesic | |
5363 | * cdef geod_geodesic _geod_geodesic | |
4991 | 5364 | * cdef public object initstring # <<<<<<<<<<<<<< |
4992 | 5365 | * |
4993 | 5366 | * def __cinit__(self, a, f): |
5063 | 5436 | |
5064 | 5437 | static PyObject *__pyx_tp_new_5_proj_Proj(PyTypeObject *t, PyObject *a, PyObject *k) { |
5065 | 5438 | 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; | |
5068 | 5442 | p = ((struct __pyx_obj_5_proj_Proj *)o); |
5069 | 5443 | p->proj_version = Py_None; Py_INCREF(Py_None); |
5070 | 5444 | 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)) { | |
5072 | 5446 | Py_DECREF(o); o = 0; |
5073 | 5447 | } |
5074 | 5448 | return o; |
5088 | 5462 | } |
5089 | 5463 | Py_CLEAR(p->proj_version); |
5090 | 5464 | Py_CLEAR(p->srs); |
5091 | PyObject_GC_Track(o); | |
5092 | 5465 | (*Py_TYPE(o)->tp_free)(o); |
5093 | 5466 | } |
5094 | 5467 | |
5143 | 5516 | } |
5144 | 5517 | |
5145 | 5518 | 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)}, | |
5151 | 5525 | {0, 0, 0, 0} |
5152 | 5526 | }; |
5153 | 5527 | |
5155 | 5529 | {(char *)"proj_version", __pyx_getprop_5_proj_4Proj_proj_version, __pyx_setprop_5_proj_4Proj_proj_version, 0, 0}, |
5156 | 5530 | {(char *)"srs", __pyx_getprop_5_proj_4Proj_srs, __pyx_setprop_5_proj_4Proj_srs, 0, 0}, |
5157 | 5531 | {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 | |
5256 | 5532 | }; |
5257 | 5533 | |
5258 | 5534 | static PyTypeObject __pyx_type_5_proj_Proj = { |
5270 | 5546 | 0, /*reserved*/ |
5271 | 5547 | #endif |
5272 | 5548 | 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*/ | |
5276 | 5552 | 0, /*tp_hash*/ |
5277 | 5553 | 0, /*tp_call*/ |
5278 | 5554 | 0, /*tp_str*/ |
5279 | 5555 | 0, /*tp_getattro*/ |
5280 | 5556 | 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*/ | |
5283 | 5559 | 0, /*tp_doc*/ |
5284 | 5560 | __pyx_tp_traverse_5_proj_Proj, /*tp_traverse*/ |
5285 | 5561 | __pyx_tp_clear_5_proj_Proj, /*tp_clear*/ |
5313 | 5589 | |
5314 | 5590 | static PyObject *__pyx_tp_new_5_proj_Geod(PyTypeObject *t, PyObject *a, PyObject *k) { |
5315 | 5591 | 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; | |
5318 | 5595 | p = ((struct __pyx_obj_5_proj_Geod *)o); |
5319 | 5596 | 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)) { | |
5321 | 5598 | Py_DECREF(o); o = 0; |
5322 | 5599 | } |
5323 | 5600 | return o; |
5327 | 5604 | struct __pyx_obj_5_proj_Geod *p = (struct __pyx_obj_5_proj_Geod *)o; |
5328 | 5605 | PyObject_GC_UnTrack(o); |
5329 | 5606 | Py_CLEAR(p->initstring); |
5330 | PyObject_GC_Track(o); | |
5331 | 5607 | (*Py_TYPE(o)->tp_free)(o); |
5332 | 5608 | } |
5333 | 5609 | |
5373 | 5649 | static struct PyGetSetDef __pyx_getsets_5_proj_Geod[] = { |
5374 | 5650 | {(char *)"initstring", __pyx_getprop_5_proj_4Geod_initstring, __pyx_setprop_5_proj_4Geod_initstring, 0, 0}, |
5375 | 5651 | {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 | |
5474 | 5652 | }; |
5475 | 5653 | |
5476 | 5654 | static PyTypeObject __pyx_type_5_proj_Geod = { |
5488 | 5666 | 0, /*reserved*/ |
5489 | 5667 | #endif |
5490 | 5668 | 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*/ | |
5494 | 5672 | 0, /*tp_hash*/ |
5495 | 5673 | 0, /*tp_call*/ |
5496 | 5674 | 0, /*tp_str*/ |
5497 | 5675 | 0, /*tp_getattro*/ |
5498 | 5676 | 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*/ | |
5501 | 5679 | 0, /*tp_doc*/ |
5502 | 5680 | __pyx_tp_traverse_5_proj_Geod, /*tp_traverse*/ |
5503 | 5681 | __pyx_tp_clear_5_proj_Geod, /*tp_clear*/ |
5535 | 5713 | |
5536 | 5714 | #if PY_MAJOR_VERSION >= 3 |
5537 | 5715 | static struct PyModuleDef __pyx_moduledef = { |
5716 | #if PY_VERSION_HEX < 0x03020000 | |
5717 | { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, | |
5718 | #else | |
5538 | 5719 | PyModuleDef_HEAD_INIT, |
5720 | #endif | |
5539 | 5721 | __Pyx_NAMESTR("_proj"), |
5540 | 5722 | 0, /* m_doc */ |
5541 | 5723 | -1, /* m_size */ |
5559 | 5741 | {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1}, |
5560 | 5742 | {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1}, |
5561 | 5743 | {&__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}, | |
5562 | 5745 | {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1}, |
5563 | 5746 | {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1}, |
5564 | 5747 | {&__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}, | |
5565 | 5749 | {&__pyx_n_s___doublesize, __pyx_k___doublesize, sizeof(__pyx_k___doublesize), 0, 0, 1, 1}, |
5566 | 5750 | {&__pyx_n_s___proj, __pyx_k___proj, sizeof(__pyx_k___proj), 0, 0, 1, 1}, |
5567 | 5751 | {&__pyx_n_s___transform, __pyx_k___transform, sizeof(__pyx_k___transform), 0, 0, 1, 1}, |
5613 | 5797 | {0, 0, 0, 0, 0, 0, 0} |
5614 | 5798 | }; |
5615 | 5799 | 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;} | |
5619 | 5803 | return 0; |
5620 | 5804 | __pyx_L1_error:; |
5621 | 5805 | return -1; |
5625 | 5809 | __Pyx_RefNannyDeclarations |
5626 | 5810 | __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); |
5627 | 5811 | |
5628 | /* "_proj.pyx":113 | |
5812 | /* "_proj.pyx":126 | |
5629 | 5813 | * # process data in buffer |
5630 | 5814 | * if buflenx != bufleny: |
5631 | 5815 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
5632 | 5816 | * ndim = buflenx//_doublesize |
5633 | 5817 | * lonsdata = <double *>londata |
5634 | 5818 | */ |
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;} | |
5636 | 5820 | __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)); | |
5640 | 5821 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4)); |
5641 | 5822 | |
5642 | /* "_proj.pyx":122 | |
5823 | /* "_proj.pyx":135 | |
5643 | 5824 | * lonsdata[i]=1.e30; latsdata[i]=1.e30 |
5644 | 5825 | * if errcheck: |
5645 | 5826 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
5646 | 5827 | * continue |
5647 | 5828 | * if radians: |
5648 | 5829 | */ |
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;} | |
5650 | 5831 | __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)); | |
5654 | 5832 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6)); |
5655 | 5833 | |
5656 | /* "_proj.pyx":141 | |
5834 | /* "_proj.pyx":154 | |
5657 | 5835 | * projxyout.u != projxyout.u: |
5658 | 5836 | * if errcheck: |
5659 | 5837 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
5660 | 5838 | * lonsdata[i] = 1.e30 |
5661 | 5839 | * else: |
5662 | 5840 | */ |
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;} | |
5664 | 5842 | __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)); | |
5668 | 5843 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7)); |
5669 | 5844 | |
5670 | /* "_proj.pyx":148 | |
5845 | /* "_proj.pyx":161 | |
5671 | 5846 | * projxyout.u != projxyout.u: |
5672 | 5847 | * if errcheck: |
5673 | 5848 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
5674 | 5849 | * latsdata[i] = 1.e30 |
5675 | 5850 | * else: |
5676 | 5851 | */ |
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;} | |
5678 | 5853 | __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)); | |
5682 | 5854 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8)); |
5683 | 5855 | |
5684 | /* "_proj.pyx":174 | |
5856 | /* "_proj.pyx":187 | |
5685 | 5857 | * # (for numpy/regular python arrays). |
5686 | 5858 | * if buflenx != bufleny: |
5687 | 5859 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
5688 | 5860 | * ndim = buflenx//_doublesize |
5689 | 5861 | * xdatab = <double *>xdata |
5690 | 5862 | */ |
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;} | |
5692 | 5864 | __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)); | |
5696 | 5865 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11)); |
5697 | 5866 | |
5698 | /* "_proj.pyx":183 | |
5867 | /* "_proj.pyx":196 | |
5699 | 5868 | * xdatab[i]=1.e30; ydatab[i]=1.e30 |
5700 | 5869 | * if errcheck: |
5701 | 5870 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
5702 | 5871 | * continue |
5703 | 5872 | * projxyin.u = xdatab[i] |
5704 | 5873 | */ |
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;} | |
5706 | 5875 | __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)); | |
5710 | 5876 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12)); |
5711 | 5877 | |
5712 | /* "_proj.pyx":198 | |
5878 | /* "_proj.pyx":211 | |
5713 | 5879 | * projlonlatout.u != projlonlatout.u: |
5714 | 5880 | * if errcheck: |
5715 | 5881 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
5716 | 5882 | * xdatab[i] = 1.e30 |
5717 | 5883 | * elif radians: |
5718 | 5884 | */ |
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;} | |
5720 | 5886 | __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)); | |
5724 | 5887 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13)); |
5725 | 5888 | |
5726 | /* "_proj.pyx":207 | |
5889 | /* "_proj.pyx":220 | |
5727 | 5890 | * projlonlatout.v != projlonlatout.v: |
5728 | 5891 | * if errcheck: |
5729 | 5892 | * raise RuntimeError('projection undefined') # <<<<<<<<<<<<<< |
5730 | 5893 | * ydatab[i] = 1.e30 |
5731 | 5894 | * elif radians: |
5732 | 5895 | */ |
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;} | |
5734 | 5897 | __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)); | |
5738 | 5898 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14)); |
5739 | 5899 | |
5740 | /* "_proj.pyx":325 | |
5900 | /* "_proj.pyx":338 | |
5741 | 5901 | * buflenz = bufleny |
5742 | 5902 | * if not (buflenx == bufleny == buflenz): |
5743 | 5903 | * raise RuntimeError('x,y and z must be same size') # <<<<<<<<<<<<<< |
5744 | 5904 | * xx = <double *>xdata |
5745 | 5905 | * yy = <double *>ydata |
5746 | 5906 | */ |
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;} | |
5748 | 5908 | __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)); | |
5752 | 5909 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16)); |
5753 | 5910 | |
5754 | /* "_proj.pyx":387 | |
5911 | /* "_proj.pyx":400 | |
5755 | 5912 | * # process data in buffer |
5756 | 5913 | * if not buflenlons == buflenlats == buflenaz == buflend: |
5757 | 5914 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
5758 | 5915 | * ndim = buflenlons//_doublesize |
5759 | 5916 | * lonsdata = <double *>londata |
5760 | 5917 | */ |
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;} | |
5762 | 5919 | __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)); | |
5766 | 5920 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19)); |
5767 | 5921 | |
5768 | /* "_proj.pyx":414 | |
5922 | /* "_proj.pyx":427 | |
5769 | 5923 | * # check for NaN. |
5770 | 5924 | * if pazi2 != pazi2: |
5771 | 5925 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<< |
5772 | 5926 | * if not radians: |
5773 | 5927 | * lonsdata[i] = plon2 |
5774 | 5928 | */ |
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;} | |
5776 | 5930 | __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)); | |
5780 | 5931 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21)); |
5781 | 5932 | |
5782 | /* "_proj.pyx":445 | |
5933 | /* "_proj.pyx":458 | |
5783 | 5934 | * # process data in buffer |
5784 | 5935 | * if not buflenlons == buflenlats == buflenaz == buflend: |
5785 | 5936 | * raise RuntimeError("Buffer lengths not the same") # <<<<<<<<<<<<<< |
5786 | 5937 | * ndim = buflenlons//_doublesize |
5787 | 5938 | * lonsdata = <double *>londata |
5788 | 5939 | */ |
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;} | |
5790 | 5941 | __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)); | |
5794 | 5942 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23)); |
5795 | 5943 | |
5796 | /* "_proj.pyx":472 | |
5944 | /* "_proj.pyx":485 | |
5797 | 5945 | * pazi2 = pazi2+180. |
5798 | 5946 | * if ps12 != ps12: # check for NaN |
5799 | 5947 | * raise ValueError('undefined inverse geodesic (may be an antipodal point)') # <<<<<<<<<<<<<< |
5800 | 5948 | * if radians: |
5801 | 5949 | * lonsdata[i] = _rad2dg*pazi1 |
5802 | 5950 | */ |
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;} | |
5804 | 5952 | __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)); | |
5808 | 5953 | __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24)); |
5809 | 5954 | |
5810 | /* "_proj.pyx":56 | |
5955 | /* "_proj.pyx":58 | |
5811 | 5956 | * int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len) |
5812 | 5957 | * |
5813 | 5958 | * def set_datapath(datapath): # <<<<<<<<<<<<<< |
5814 | * cdef char *searchpath | |
5815 | 5959 | * 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;} | |
5818 | 5963 | __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)); | |
5828 | 5964 | __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 | |
5832 | 5980 | * return False |
5833 | 5981 | * |
5834 | 5982 | * def _transform(Proj p1, Proj p2, inx, iny, inz, radians): # <<<<<<<<<<<<<< |
5835 | 5983 | * # private function to call pj_transform |
5836 | 5984 | * cdef void *xdata, *ydata, *zdata |
5837 | 5985 | */ |
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;} | |
5896 | 5990 | __Pyx_RefNannyFinishContext(); |
5897 | 5991 | return 0; |
5898 | 5992 | __pyx_L1_error:; |
5919 | 6013 | PyObject *__pyx_t_2 = NULL; |
5920 | 6014 | PyObject *__pyx_t_3 = NULL; |
5921 | 6015 | double __pyx_t_4; |
6016 | int __pyx_lineno = 0; | |
6017 | const char *__pyx_filename = NULL; | |
6018 | int __pyx_clineno = 0; | |
5922 | 6019 | __Pyx_RefNannyDeclarations |
5923 | 6020 | #if CYTHON_REFNANNY |
5924 | 6021 | __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); |
5956 | 6053 | __pyx_m = PyModule_Create(&__pyx_moduledef); |
5957 | 6054 | #endif |
5958 | 6055 | 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); | |
5959 | 6058 | #if PY_MAJOR_VERSION >= 3 |
5960 | 6059 | { |
5961 | 6060 | PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} |
5971 | 6070 | if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; |
5972 | 6071 | /*--- Initialize various global constants etc. ---*/ |
5973 | 6072 | 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 | |
5974 | 6076 | if (__pyx_module_is_main__proj) { |
5975 | 6077 | 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;}; |
5976 | 6078 | } |
5982 | 6084 | /*--- Variable export code ---*/ |
5983 | 6085 | /*--- Function export code ---*/ |
5984 | 6086 | /*--- 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;} | |
5987 | 6089 | __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;} | |
5990 | 6092 | __pyx_ptype_5_proj_Geod = &__pyx_type_5_proj_Geod; |
5991 | 6093 | /*--- Type import code ---*/ |
5992 | 6094 | /*--- Variable import code ---*/ |
6002 | 6104 | */ |
6003 | 6105 | __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;} |
6004 | 6106 | __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;} | |
6006 | 6108 | __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; |
6007 | 6109 | |
6008 | 6110 | /* "_proj.pyx":8 |
6012 | 6114 | * _rad2dg = math.degrees(1.) |
6013 | 6115 | * _doublesize = sizeof(double) |
6014 | 6116 | */ |
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;} | |
6016 | 6118 | __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;} | |
6018 | 6120 | __Pyx_GOTREF(__pyx_t_2); |
6019 | 6121 | __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; |
6020 | 6122 | __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;} |
6037 | 6139 | * _dg2rad = math.radians(1.) |
6038 | 6140 | * _rad2dg = math.degrees(1.) # <<<<<<<<<<<<<< |
6039 | 6141 | * _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;} | |
6043 | 6145 | __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;} | |
6045 | 6147 | __Pyx_GOTREF(__pyx_t_3); |
6046 | 6148 | __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; |
6047 | 6149 | __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;} |
6063 | 6165 | * _dg2rad = math.radians(1.) |
6064 | 6166 | * _rad2dg = math.degrees(1.) |
6065 | 6167 | * _doublesize = sizeof(double) # <<<<<<<<<<<<<< |
6066 | * __version__ = "1.9.3" | |
6168 | * __version__ = "1.9.4" | |
6067 | 6169 | * |
6068 | 6170 | */ |
6069 | 6171 | __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;} |
6070 | 6172 | __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;} | |
6072 | 6174 | __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; |
6073 | 6175 | |
6074 | 6176 | /* "_proj.pyx":11 |
6075 | 6177 | * _rad2dg = math.degrees(1.) |
6076 | 6178 | * _doublesize = sizeof(double) |
6077 | * __version__ = "1.9.3" # <<<<<<<<<<<<<< | |
6179 | * __version__ = "1.9.4" # <<<<<<<<<<<<<< | |
6078 | 6180 | * |
6079 | 6181 | * cdef extern from "math.h": |
6080 | 6182 | */ |
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 | |
6084 | 6186 | * int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len) |
6085 | 6187 | * |
6086 | 6188 | * def set_datapath(datapath): # <<<<<<<<<<<<<< |
6087 | * cdef char *searchpath | |
6088 | 6189 | * 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;} | |
6091 | 6193 | __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;} | |
6093 | 6195 | __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; |
6094 | 6196 | |
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 | |
6096 | 6210 | * return (self.__class__,(self.srs,)) |
6097 | 6211 | * |
6098 | 6212 | * def _fwd(self, object lons, object lats, radians=False, errcheck=False): # <<<<<<<<<<<<<< |
6099 | 6213 | * """ |
6100 | 6214 | * forward transformation - lons,lats to x,y (done in place). |
6101 | 6215 | */ |
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;} | |
6103 | 6217 | __Pyx_GOTREF(__pyx_t_1); |
6104 | 6218 | __pyx_k_1 = __pyx_t_1; |
6105 | 6219 | __Pyx_GIVEREF(__pyx_t_1); |
6106 | 6220 | __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;} | |
6108 | 6222 | __Pyx_GOTREF(__pyx_t_1); |
6109 | 6223 | __pyx_k_2 = __pyx_t_1; |
6110 | 6224 | __Pyx_GIVEREF(__pyx_t_1); |
6111 | 6225 | __pyx_t_1 = 0; |
6112 | 6226 | |
6113 | /* "_proj.pyx":153 | |
6227 | /* "_proj.pyx":166 | |
6114 | 6228 | * latsdata[i] = projxyout.v |
6115 | 6229 | * |
6116 | 6230 | * def _inv(self, object x, object y, radians=False, errcheck=False): # <<<<<<<<<<<<<< |
6117 | 6231 | * """ |
6118 | 6232 | * inverse transformation - x,y to lons,lats (done in place). |
6119 | 6233 | */ |
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;} | |
6121 | 6235 | __Pyx_GOTREF(__pyx_t_1); |
6122 | 6236 | __pyx_k_9 = __pyx_t_1; |
6123 | 6237 | __Pyx_GIVEREF(__pyx_t_1); |
6124 | 6238 | __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;} | |
6126 | 6240 | __Pyx_GOTREF(__pyx_t_1); |
6127 | 6241 | __pyx_k_10 = __pyx_t_1; |
6128 | 6242 | __Pyx_GIVEREF(__pyx_t_1); |
6129 | 6243 | __pyx_t_1 = 0; |
6130 | 6244 | |
6131 | /* "_proj.pyx":309 | |
6245 | /* "_proj.pyx":322 | |
6132 | 6246 | * return False |
6133 | 6247 | * |
6134 | 6248 | * def _transform(Proj p1, Proj p2, inx, iny, inz, radians): # <<<<<<<<<<<<<< |
6135 | 6249 | * # private function to call pj_transform |
6136 | 6250 | * cdef void *xdata, *ydata, *zdata |
6137 | 6251 | */ |
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;} | |
6139 | 6253 | __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;} | |
6141 | 6255 | __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; |
6142 | 6256 | |
6143 | /* "_proj.pyx":365 | |
6257 | /* "_proj.pyx":378 | |
6144 | 6258 | * return (self.__class__,(self.initstring,)) |
6145 | 6259 | * |
6146 | 6260 | * def _fwd(self, object lons, object lats, object az, object dist, radians=False): # <<<<<<<<<<<<<< |
6147 | 6261 | * """ |
6148 | 6262 | * forward transformation - determine longitude, latitude and back azimuth |
6149 | 6263 | */ |
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;} | |
6151 | 6265 | __Pyx_GOTREF(__pyx_t_1); |
6152 | 6266 | __pyx_k_18 = __pyx_t_1; |
6153 | 6267 | __Pyx_GIVEREF(__pyx_t_1); |
6154 | 6268 | __pyx_t_1 = 0; |
6155 | 6269 | |
6156 | /* "_proj.pyx":424 | |
6270 | /* "_proj.pyx":437 | |
6157 | 6271 | * azdata[i] = _rad2dg*pazi2 |
6158 | 6272 | * |
6159 | 6273 | * def _inv(self, object lons1, object lats1, object lons2, object lats2, radians=False): # <<<<<<<<<<<<<< |
6160 | 6274 | * """ |
6161 | 6275 | * inverse transformation - return forward and back azimuths, plus distance |
6162 | 6276 | */ |
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;} | |
6164 | 6278 | __Pyx_GOTREF(__pyx_t_1); |
6165 | 6279 | __pyx_k_22 = __pyx_t_1; |
6166 | 6280 | __Pyx_GIVEREF(__pyx_t_1); |
6167 | 6281 | __pyx_t_1 = 0; |
6168 | 6282 | |
6169 | /* "_proj.pyx":481 | |
6283 | /* "_proj.pyx":494 | |
6170 | 6284 | * azdata[i] = ps12 |
6171 | 6285 | * |
6172 | 6286 | * def _npts(self, double lon1, double lat1, double lon2, double lat2, int npts, radians=False): # <<<<<<<<<<<<<< |
6173 | 6287 | * """ |
6174 | 6288 | * given initial and terminus lat/lon, find npts intermediate points.""" |
6175 | 6289 | */ |
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;} | |
6177 | 6291 | __Pyx_GOTREF(__pyx_t_1); |
6178 | 6292 | __pyx_k_25 = __pyx_t_1; |
6179 | 6293 | __Pyx_GIVEREF(__pyx_t_1); |
6186 | 6300 | */ |
6187 | 6301 | __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;} |
6188 | 6302 | __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;} | |
6190 | 6304 | __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; |
6191 | 6305 | goto __pyx_L0; |
6192 | 6306 | __pyx_L1_error:; |
6225 | 6339 | } |
6226 | 6340 | #endif /* CYTHON_REFNANNY */ |
6227 | 6341 | |
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 | |
6239 | 6351 | } |
6240 | 6352 | return result; |
6241 | 6353 | } |
6448 | 6560 | } |
6449 | 6561 | value = type; |
6450 | 6562 | #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 | } | |
6461 | 6572 | #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 | } | |
6469 | 6580 | #endif |
6470 | 6581 | } |
6471 | 6582 | __Pyx_ErrRestore(type, value, tb); |
6503 | 6614 | else if (PyTuple_Check(value)) { |
6504 | 6615 | Py_INCREF(value); |
6505 | 6616 | args = value; |
6506 | } | |
6507 | else | |
6617 | } else | |
6508 | 6618 | args = PyTuple_Pack(1, value); |
6509 | 6619 | if (!args) |
6510 | 6620 | goto bad; |
6525 | 6635 | "raise: exception class must be a subclass of BaseException"); |
6526 | 6636 | goto bad; |
6527 | 6637 | } |
6638 | #if PY_VERSION_HEX >= 0x03030000 | |
6639 | if (cause) { | |
6640 | #else | |
6528 | 6641 | if (cause && cause != Py_None) { |
6642 | #endif | |
6529 | 6643 | PyObject *fixed_cause; |
6530 | if (PyExceptionClass_Check(cause)) { | |
6644 | if (cause == Py_None) { | |
6645 | fixed_cause = NULL; | |
6646 | } else if (PyExceptionClass_Check(cause)) { | |
6531 | 6647 | fixed_cause = PyObject_CallObject(cause, NULL); |
6532 | 6648 | if (fixed_cause == NULL) |
6533 | 6649 | goto bad; |
6534 | } | |
6535 | else if (PyExceptionInstance_Check(cause)) { | |
6650 | } else if (PyExceptionInstance_Check(cause)) { | |
6536 | 6651 | fixed_cause = cause; |
6537 | 6652 | Py_INCREF(fixed_cause); |
6538 | } | |
6539 | else { | |
6653 | } else { | |
6540 | 6654 | PyErr_SetString(PyExc_TypeError, |
6541 | 6655 | "exception causes must derive from " |
6542 | 6656 | "BaseException"); |
6559 | 6673 | return; |
6560 | 6674 | } |
6561 | 6675 | #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 | } | |
6562 | 6693 | |
6563 | 6694 | static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, |
6564 | 6695 | const char *name, int exact) |
6675 | 6806 | #endif |
6676 | 6807 | } |
6677 | 6808 | |
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) { | |
6680 | 6810 | PyObject *empty_list = 0; |
6681 | 6811 | PyObject *module = 0; |
6682 | 6812 | PyObject *global_dict = 0; |
6683 | 6813 | PyObject *empty_dict = 0; |
6684 | 6814 | 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__); | |
6686 | 6818 | if (!py_import) |
6687 | 6819 | goto bad; |
6820 | #endif | |
6688 | 6821 | if (from_list) |
6689 | 6822 | list = from_list; |
6690 | 6823 | else { |
6704 | 6837 | #if PY_MAJOR_VERSION >= 3 |
6705 | 6838 | if (level == -1) { |
6706 | 6839 | if (strchr(__Pyx_MODULE_NAME, '.')) { |
6707 | /* try package relative import first */ | |
6840 | #if PY_VERSION_HEX < 0x03030000 | |
6708 | 6841 | PyObject *py_level = PyInt_FromLong(1); |
6709 | 6842 | if (!py_level) |
6710 | 6843 | goto bad; |
6711 | 6844 | module = PyObject_CallFunctionObjArgs(py_import, |
6712 | 6845 | name, global_dict, empty_dict, list, py_level, NULL); |
6713 | 6846 | Py_DECREF(py_level); |
6847 | #else | |
6848 | module = PyImport_ImportModuleLevelObject( | |
6849 | name, global_dict, empty_dict, list, 1); | |
6850 | #endif | |
6714 | 6851 | if (!module) { |
6715 | 6852 | if (!PyErr_ExceptionMatches(PyExc_ImportError)) |
6716 | 6853 | goto bad; |
6721 | 6858 | } |
6722 | 6859 | #endif |
6723 | 6860 | if (!module) { |
6861 | #if PY_VERSION_HEX < 0x03030000 | |
6724 | 6862 | PyObject *py_level = PyInt_FromLong(level); |
6725 | 6863 | if (!py_level) |
6726 | 6864 | goto bad; |
6727 | 6865 | module = PyObject_CallFunctionObjArgs(py_import, |
6728 | 6866 | name, global_dict, empty_dict, list, py_level, NULL); |
6729 | 6867 | Py_DECREF(py_level); |
6868 | #else | |
6869 | module = PyImport_ImportModuleLevelObject( | |
6870 | name, global_dict, empty_dict, list, level); | |
6871 | #endif | |
6730 | 6872 | } |
6731 | 6873 | } |
6732 | 6874 | #else |
6738 | 6880 | name, global_dict, empty_dict, list, NULL); |
6739 | 6881 | #endif |
6740 | 6882 | bad: |
6883 | #if PY_VERSION_HEX < 0x03030000 | |
6884 | Py_XDECREF(py_import); | |
6885 | #endif | |
6741 | 6886 | Py_XDECREF(empty_list); |
6742 | Py_XDECREF(py_import); | |
6743 | 6887 | Py_XDECREF(empty_dict); |
6744 | 6888 | return module; |
6745 | 6889 | } |
6934 | 7078 | return (int)__Pyx_PyInt_AsLong(x); |
6935 | 7079 | } |
6936 | 7080 | |
7081 | #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7082 | #if CYTHON_USE_PYLONG_INTERNALS | |
7083 | #include "longintrepr.h" | |
7084 | #endif | |
7085 | #endif | |
6937 | 7086 | static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) { |
6938 | 7087 | const unsigned long neg_one = (unsigned long)-1, const_zero = 0; |
6939 | 7088 | const int is_unsigned = neg_one > const_zero; |
6940 | #if PY_VERSION_HEX < 0x03000000 | |
7089 | #if PY_MAJOR_VERSION < 3 | |
6941 | 7090 | if (likely(PyInt_Check(x))) { |
6942 | 7091 | long val = PyInt_AS_LONG(x); |
6943 | 7092 | if (is_unsigned && unlikely(val < 0)) { |
6950 | 7099 | #endif |
6951 | 7100 | if (likely(PyLong_Check(x))) { |
6952 | 7101 | 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 | |
6953 | 7112 | if (unlikely(Py_SIZE(x) < 0)) { |
6954 | 7113 | PyErr_SetString(PyExc_OverflowError, |
6955 | 7114 | "can't convert negative value to unsigned long"); |
6957 | 7116 | } |
6958 | 7117 | return (unsigned long)PyLong_AsUnsignedLong(x); |
6959 | 7118 | } 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 | |
6960 | 7130 | return (unsigned long)PyLong_AsLong(x); |
6961 | 7131 | } |
6962 | 7132 | } else { |
6969 | 7139 | } |
6970 | 7140 | } |
6971 | 7141 | |
7142 | #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7143 | #if CYTHON_USE_PYLONG_INTERNALS | |
7144 | #include "longintrepr.h" | |
7145 | #endif | |
7146 | #endif | |
6972 | 7147 | static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) { |
6973 | 7148 | const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0; |
6974 | 7149 | const int is_unsigned = neg_one > const_zero; |
6975 | #if PY_VERSION_HEX < 0x03000000 | |
7150 | #if PY_MAJOR_VERSION < 3 | |
6976 | 7151 | if (likely(PyInt_Check(x))) { |
6977 | 7152 | long val = PyInt_AS_LONG(x); |
6978 | 7153 | if (is_unsigned && unlikely(val < 0)) { |
6985 | 7160 | #endif |
6986 | 7161 | if (likely(PyLong_Check(x))) { |
6987 | 7162 | 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 | |
6988 | 7173 | if (unlikely(Py_SIZE(x) < 0)) { |
6989 | 7174 | PyErr_SetString(PyExc_OverflowError, |
6990 | 7175 | "can't convert negative value to unsigned PY_LONG_LONG"); |
6992 | 7177 | } |
6993 | 7178 | return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); |
6994 | 7179 | } 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 | |
6995 | 7191 | return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x); |
6996 | 7192 | } |
6997 | 7193 | } else { |
7004 | 7200 | } |
7005 | 7201 | } |
7006 | 7202 | |
7203 | #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7204 | #if CYTHON_USE_PYLONG_INTERNALS | |
7205 | #include "longintrepr.h" | |
7206 | #endif | |
7207 | #endif | |
7007 | 7208 | static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) { |
7008 | 7209 | const long neg_one = (long)-1, const_zero = 0; |
7009 | 7210 | const int is_unsigned = neg_one > const_zero; |
7010 | #if PY_VERSION_HEX < 0x03000000 | |
7211 | #if PY_MAJOR_VERSION < 3 | |
7011 | 7212 | if (likely(PyInt_Check(x))) { |
7012 | 7213 | long val = PyInt_AS_LONG(x); |
7013 | 7214 | if (is_unsigned && unlikely(val < 0)) { |
7020 | 7221 | #endif |
7021 | 7222 | if (likely(PyLong_Check(x))) { |
7022 | 7223 | 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 | |
7023 | 7234 | if (unlikely(Py_SIZE(x) < 0)) { |
7024 | 7235 | PyErr_SetString(PyExc_OverflowError, |
7025 | 7236 | "can't convert negative value to long"); |
7027 | 7238 | } |
7028 | 7239 | return (long)PyLong_AsUnsignedLong(x); |
7029 | 7240 | } 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 | |
7030 | 7252 | return (long)PyLong_AsLong(x); |
7031 | 7253 | } |
7032 | 7254 | } else { |
7039 | 7261 | } |
7040 | 7262 | } |
7041 | 7263 | |
7264 | #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7265 | #if CYTHON_USE_PYLONG_INTERNALS | |
7266 | #include "longintrepr.h" | |
7267 | #endif | |
7268 | #endif | |
7042 | 7269 | static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) { |
7043 | 7270 | const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0; |
7044 | 7271 | const int is_unsigned = neg_one > const_zero; |
7045 | #if PY_VERSION_HEX < 0x03000000 | |
7272 | #if PY_MAJOR_VERSION < 3 | |
7046 | 7273 | if (likely(PyInt_Check(x))) { |
7047 | 7274 | long val = PyInt_AS_LONG(x); |
7048 | 7275 | if (is_unsigned && unlikely(val < 0)) { |
7055 | 7282 | #endif |
7056 | 7283 | if (likely(PyLong_Check(x))) { |
7057 | 7284 | 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 | |
7058 | 7295 | if (unlikely(Py_SIZE(x) < 0)) { |
7059 | 7296 | PyErr_SetString(PyExc_OverflowError, |
7060 | 7297 | "can't convert negative value to PY_LONG_LONG"); |
7062 | 7299 | } |
7063 | 7300 | return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); |
7064 | 7301 | } 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 | |
7065 | 7313 | return (PY_LONG_LONG)PyLong_AsLongLong(x); |
7066 | 7314 | } |
7067 | 7315 | } else { |
7074 | 7322 | } |
7075 | 7323 | } |
7076 | 7324 | |
7325 | #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7326 | #if CYTHON_USE_PYLONG_INTERNALS | |
7327 | #include "longintrepr.h" | |
7328 | #endif | |
7329 | #endif | |
7077 | 7330 | static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) { |
7078 | 7331 | const signed long neg_one = (signed long)-1, const_zero = 0; |
7079 | 7332 | const int is_unsigned = neg_one > const_zero; |
7080 | #if PY_VERSION_HEX < 0x03000000 | |
7333 | #if PY_MAJOR_VERSION < 3 | |
7081 | 7334 | if (likely(PyInt_Check(x))) { |
7082 | 7335 | long val = PyInt_AS_LONG(x); |
7083 | 7336 | if (is_unsigned && unlikely(val < 0)) { |
7090 | 7343 | #endif |
7091 | 7344 | if (likely(PyLong_Check(x))) { |
7092 | 7345 | 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 | |
7093 | 7356 | if (unlikely(Py_SIZE(x) < 0)) { |
7094 | 7357 | PyErr_SetString(PyExc_OverflowError, |
7095 | 7358 | "can't convert negative value to signed long"); |
7097 | 7360 | } |
7098 | 7361 | return (signed long)PyLong_AsUnsignedLong(x); |
7099 | 7362 | } 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 | |
7100 | 7374 | return (signed long)PyLong_AsLong(x); |
7101 | 7375 | } |
7102 | 7376 | } else { |
7109 | 7383 | } |
7110 | 7384 | } |
7111 | 7385 | |
7386 | #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7387 | #if CYTHON_USE_PYLONG_INTERNALS | |
7388 | #include "longintrepr.h" | |
7389 | #endif | |
7390 | #endif | |
7112 | 7391 | static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) { |
7113 | 7392 | const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0; |
7114 | 7393 | const int is_unsigned = neg_one > const_zero; |
7115 | #if PY_VERSION_HEX < 0x03000000 | |
7394 | #if PY_MAJOR_VERSION < 3 | |
7116 | 7395 | if (likely(PyInt_Check(x))) { |
7117 | 7396 | long val = PyInt_AS_LONG(x); |
7118 | 7397 | if (is_unsigned && unlikely(val < 0)) { |
7125 | 7404 | #endif |
7126 | 7405 | if (likely(PyLong_Check(x))) { |
7127 | 7406 | 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 | |
7128 | 7417 | if (unlikely(Py_SIZE(x) < 0)) { |
7129 | 7418 | PyErr_SetString(PyExc_OverflowError, |
7130 | 7419 | "can't convert negative value to signed PY_LONG_LONG"); |
7132 | 7421 | } |
7133 | 7422 | return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x); |
7134 | 7423 | } 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 | |
7135 | 7435 | return (signed PY_LONG_LONG)PyLong_AsLongLong(x); |
7136 | 7436 | } |
7137 | 7437 | } else { |
7355 | 7655 | return 0; |
7356 | 7656 | } |
7357 | 7657 | |
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 | } | |
7361 | 7717 | static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { |
7362 | 7718 | int is_true = x == Py_True; |
7363 | 7719 | if (is_true | (x == Py_False) | (x == Py_None)) return is_true; |
7364 | 7720 | else return PyObject_IsTrue(x); |
7365 | 7721 | } |
7366 | ||
7367 | 7722 | static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { |
7368 | 7723 | PyNumberMethods *m; |
7369 | 7724 | const char *name = NULL; |
7370 | 7725 | PyObject *res = NULL; |
7371 | #if PY_VERSION_HEX < 0x03000000 | |
7726 | #if PY_MAJOR_VERSION < 3 | |
7372 | 7727 | if (PyInt_Check(x) || PyLong_Check(x)) |
7373 | 7728 | #else |
7374 | 7729 | if (PyLong_Check(x)) |
7375 | 7730 | #endif |
7376 | 7731 | return Py_INCREF(x), x; |
7377 | 7732 | m = Py_TYPE(x)->tp_as_number; |
7378 | #if PY_VERSION_HEX < 0x03000000 | |
7733 | #if PY_MAJOR_VERSION < 3 | |
7379 | 7734 | if (m && m->nb_int) { |
7380 | 7735 | name = "int"; |
7381 | 7736 | res = PyNumber_Int(x); |
7391 | 7746 | } |
7392 | 7747 | #endif |
7393 | 7748 | if (res) { |
7394 | #if PY_VERSION_HEX < 0x03000000 | |
7749 | #if PY_MAJOR_VERSION < 3 | |
7395 | 7750 | if (!PyInt_Check(res) && !PyLong_Check(res)) { |
7396 | 7751 | #else |
7397 | 7752 | if (!PyLong_Check(res)) { |
7409 | 7764 | } |
7410 | 7765 | return res; |
7411 | 7766 | } |
7412 | ||
7413 | 7767 | static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { |
7414 | 7768 | Py_ssize_t ival; |
7415 | 7769 | PyObject* x = PyNumber_Index(b); |
7418 | 7772 | Py_DECREF(x); |
7419 | 7773 | return ival; |
7420 | 7774 | } |
7421 | ||
7422 | 7775 | static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { |
7423 | 7776 | #if PY_VERSION_HEX < 0x02050000 |
7424 | 7777 | if (ival <= LONG_MAX) |
7432 | 7785 | return PyInt_FromSize_t(ival); |
7433 | 7786 | #endif |
7434 | 7787 | } |
7435 | ||
7436 | 7788 | static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) { |
7437 | 7789 | 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"); | |
7443 | 7794 | return (size_t)-1; |
7444 | 7795 | } |
7445 | 7796 | return (size_t)val; |
7 | 7 | _dg2rad = math.radians(1.) |
8 | 8 | _rad2dg = math.degrees(1.) |
9 | 9 | _doublesize = sizeof(double) |
10 | __version__ = "1.9.3" | |
10 | __version__ = "1.9.4" | |
11 | 11 | |
12 | 12 | cdef extern from "math.h": |
13 | 13 | cdef enum: |
15 | 15 | FP_NAN |
16 | 16 | |
17 | 17 | cdef extern from "geodesic.h": |
18 | struct Geodesic: | |
18 | struct geod_geodesic: | |
19 | 19 | 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,\ | |
22 | 22 | double lat1, double lon1, double azi1, double s12,\ |
23 | 23 | double* plat2, double* plon2, double* pazi2) |
24 | void Inverse(Geodesic* g,\ | |
24 | void geod_inverse(geod_geodesic* g,\ | |
25 | 25 | double lat1, double lon1, double lat2, double lon2,\ |
26 | 26 | double* ps12, double* pazi1, double* pazi2) |
27 | 27 | |
35 | 35 | projPJ pj_init_plus_ctx(projCtx, char *) |
36 | 36 | projUV pj_fwd(projUV, projPJ) |
37 | 37 | projUV pj_inv(projUV, projPJ) |
38 | projPJ pj_latlong_from_proj(projPJ) | |
38 | 39 | int pj_transform(projPJ src, projPJ dst, long point_count, int point_offset, |
39 | 40 | double *x, double *y, double *z) |
40 | 41 | int pj_is_latlong(projPJ) |
42 | char *pj_get_def( projPJ pj, int options) | |
41 | 43 | int pj_is_geocent(projPJ) |
42 | 44 | char *pj_strerrno(int) |
43 | 45 | void pj_ctx_free( projCtx ) |
53 | 55 | int PyObject_AsWriteBuffer(object, void **rbuf, Py_ssize_t *len) |
54 | 56 | |
55 | 57 | def set_datapath(datapath): |
56 | cdef char *searchpath | |
57 | 58 | bytestr = _strencode(datapath) |
58 | searchpath = bytestr | |
59 | cdef const char *searchpath = bytestr | |
59 | 60 | pj_set_searchpath(1, &searchpath) |
61 | ||
62 | def _createproj(projstring): | |
63 | return Proj(projstring) | |
60 | 64 | |
61 | 65 | cdef class Proj: |
62 | 66 | cdef projPJ projpj |
83 | 87 | """destroy projection definition""" |
84 | 88 | pj_free(self.projpj) |
85 | 89 | 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) | |
86 | 99 | |
87 | 100 | def __reduce__(self): |
88 | 101 | """special method that allows pyproj.Proj instance to be pickled""" |
350 | 363 | return pystr # already bytes? |
351 | 364 | |
352 | 365 | cdef class Geod: |
353 | cdef Geodesic _Geodesic | |
366 | cdef geod_geodesic _geod_geodesic | |
354 | 367 | cdef public object initstring |
355 | 368 | |
356 | 369 | def __cinit__(self, a, f): |
357 | 370 | 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) | |
359 | 372 | |
360 | 373 | def __reduce__(self): |
361 | 374 | """special method that allows pyproj.Geod instance to be pickled""" |
400 | 413 | lat1 = _dg2rad*latsdata[i] |
401 | 414 | az1 = _dg2rad*azdata[i] |
402 | 415 | s12 = distdata[i] |
403 | Direct(&self._Geodesic, lat1, lon1, az1, s12,\ | |
416 | geod_direct(&self._geod_geodesic, lat1, lon1, az1, s12,\ | |
404 | 417 | &plat2, &plon2, &pazi2) |
405 | 418 | # back azimuth needs to be flipped 180 degrees |
406 | 419 | # to match what proj4 geod utility produces. |
407 | 420 | if pazi2 > 0: |
408 | 421 | pazi2 = pazi2-180. |
409 | elif pazi2 < 0: | |
422 | elif pazi2 <= 0: | |
410 | 423 | pazi2 = pazi2+180. |
411 | 424 | # check for NaN. |
412 | 425 | if pazi2 != pazi2: |
459 | 472 | lat1 = latsdata[i] |
460 | 473 | lon2 = azdata[i] |
461 | 474 | lat2 = distdata[i] |
462 | Inverse(&self._Geodesic, lat1, lon1, lat2, lon2, | |
475 | geod_inverse(&self._geod_geodesic, lat1, lon1, lat2, lon2, | |
463 | 476 | &ps12, &pazi1, &pazi2) |
464 | 477 | # back azimuth needs to be flipped 180 degrees |
465 | 478 | # to match what proj4 geod utility produces. |
466 | 479 | if pazi2 > 0: |
467 | 480 | pazi2 = pazi2-180. |
468 | elif pazi2 < 0: | |
481 | elif pazi2 <= 0: | |
469 | 482 | pazi2 = pazi2+180. |
470 | 483 | if ps12 != ps12: # check for NaN |
471 | 484 | raise ValueError('undefined inverse geodesic (may be an antipodal point)') |
488 | 501 | lon2 = _rad2dg*lon2 |
489 | 502 | lat2 = _rad2dg*lat2 |
490 | 503 | # 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, | |
492 | 505 | &ps12, &pazi1, &pazi2) |
493 | 506 | # distance increment. |
494 | 507 | del_s = ps12/(npts+1) |
498 | 511 | # loop over intermediate points, compute lat/lons. |
499 | 512 | for i from 1 <= i < npts+1: |
500 | 513 | s12 = i*del_s |
501 | Direct(&self._Geodesic, lat1, lon1, pazi1, s12,\ | |
514 | geod_direct(&self._geod_geodesic, lat1, lon1, pazi1, s12,\ | |
502 | 515 | &plat2, &plon2, &pazi2) |
503 | 516 | if radians: |
504 | 517 | lats = lats + (_dg2rad*plat2,) |
14 | 14 | pyproj.Geod.inv pyproj.Geod-class.html#inv |
15 | 15 | pyproj.Geod.npts pyproj.Geod-class.html#npts |
16 | 16 | 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 | |
17 | 20 | pyproj.Proj.is_latlong pyproj.Proj-class.html#is_latlong |
18 | pyproj.Proj.__new__ pyproj.Proj-class.html#__new__ | |
19 | 21 | pyproj.Proj.is_geocent pyproj.Proj-class.html#is_geocent |
20 | pyproj.Proj.__call__ pyproj.Proj-class.html#__call__ |
97 | 97 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
98 | 98 | <tr> |
99 | 99 | <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 | |
101 | 101 | </td> |
102 | 102 | <td align="right" class="footer"> |
103 | 103 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
239 | 239 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
240 | 240 | <tr> |
241 | 241 | <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 | |
243 | 243 | </td> |
244 | 244 | <td align="right" class="footer"> |
245 | 245 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
152 | 152 | <tr> |
153 | 153 | <td width="33%" class="link-index"><a href="pyproj-module.html#test">test()</a><br /> |
154 | 154 | <span class="index-where">(in <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 <a href="pyproj.Proj-class.html">Proj</a>)</span></td> | |
155 | 157 | <td width="33%" class="link-index"><a href="pyproj-module.html#transform">transform()</a><br /> |
156 | 158 | <span class="index-where">(in <a href="pyproj-module.html">pyproj</a>)</span></td> |
157 | <td width="33%" class="link-index"> </td> | |
158 | 159 | </tr> |
159 | 160 | <tr><td class="link-index"> </td><td class="link-index"> </td><td class="link-index"> </td></tr> |
160 | 161 | </table> |
205 | 206 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
206 | 207 | <tr> |
207 | 208 | <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 | |
209 | 210 | </td> |
210 | 211 | <td align="right" class="footer"> |
211 | 212 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
66 | 66 | <p>Input coordinates can be given as python arrays, lists/tuples, scalars |
67 | 67 | or numpy/Numeric/numarray arrays. Optimized for objects that support the |
68 | 68 | 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> | |
70 | 70 | <p>Requirements: python 2.4 or higher.</p> |
71 | 71 | <p>Example scripts are in 'test' subdirectory of source distribution. The |
72 | 72 | 'test()' function will run the examples in the docstrings.</p> |
86 | 86 | |
87 | 87 | <hr /> |
88 | 88 | <div class="fields"> <p><strong>Version:</strong> |
89 | 1.9.3 | |
89 | 1.9.4 | |
90 | 90 | </p> |
91 | 91 | </div><!-- ==================== CLASSES ==================== --> |
92 | 92 | <a name="section-Classes"></a> |
213 | 213 | <td width="15%" align="right" valign="top" class="summary"> |
214 | 214 | <span class="summary-type"> </span> |
215 | 215 | </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> | |
217 | 218 | </td> |
218 | 219 | </tr> |
219 | 220 | </table> |
384 | 385 | <dl class="fields"> |
385 | 386 | <dt>Value:</dt> |
386 | 387 | <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> | |
388 | 390 | </pre></td></tr></table> |
389 | 391 | </dd> |
390 | 392 | </dl> |
417 | 419 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
418 | 420 | <tr> |
419 | 421 | <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 | |
421 | 423 | </td> |
422 | 424 | <td align="right" class="footer"> |
423 | 425 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
77 | 77 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
78 | 78 | <tr> |
79 | 79 | <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 | |
81 | 81 | </td> |
82 | 82 | <td align="right" class="footer"> |
83 | 83 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
66 | 66 | <p>Input coordinates can be given as python arrays, lists/tuples, scalars |
67 | 67 | or numpy/Numeric/numarray arrays. Optimized for objects that support the |
68 | 68 | 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> | |
70 | 70 | <p>Requirements: python 2.4 or higher.</p> |
71 | 71 | <p>Example scripts are in 'test' subdirectory of source distribution. The |
72 | 72 | 'test()' function will run the examples in the docstrings.</p> |
86 | 86 | |
87 | 87 | <hr /> |
88 | 88 | <div class="fields"> <p><strong>Version:</strong> |
89 | 1.9.3 | |
89 | 1.9.4 | |
90 | 90 | </p> |
91 | 91 | </div><!-- ==================== CLASSES ==================== --> |
92 | 92 | <a name="section-Classes"></a> |
213 | 213 | <td width="15%" align="right" valign="top" class="summary"> |
214 | 214 | <span class="summary-type"> </span> |
215 | 215 | </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> | |
217 | 218 | </td> |
218 | 219 | </tr> |
219 | 220 | </table> |
384 | 385 | <dl class="fields"> |
385 | 386 | <dt>Value:</dt> |
386 | 387 | <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> | |
388 | 390 | </pre></td></tr></table> |
389 | 391 | </dd> |
390 | 392 | </dl> |
417 | 419 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
418 | 420 | <tr> |
419 | 421 | <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 | |
421 | 423 | </td> |
422 | 424 | <td align="right" class="footer"> |
423 | 425 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
73 | 73 | <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> |
74 | 74 | <a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"><tt class="py-docstring">numpy array objects).</tt> </tt> |
75 | 75 | <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> | |
77 | 77 | <a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt> |
78 | 78 | <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> |
79 | 79 | <a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt> |
442 | 442 | <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> |
443 | 443 | <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> |
444 | 444 | </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> | |
484 | 484 | <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"> >>> # 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"> >>> # (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"> >>> 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"> >>> # 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"> >>> 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"> >>> # 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"> >>> 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"> >>> # 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"> >>> 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"> >>> '%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"> >>> '%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"> >>> '%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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> xy = x1+y1</tt> </tt> | |
508 | <a name="L457"></a><tt class="py-lineno">457</tt> <tt class="py-line"><tt class="py-docstring"> >>> '%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"> >>> xy = x2+y2</tt> </tt> | |
511 | <a name="L460"></a><tt class="py-lineno">460</tt> <tt class="py-line"><tt class="py-docstring"> >>> '%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"> >>> 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"> >>> xy = lons+lats</tt> </tt> | |
515 | <a name="L464"></a><tt class="py-lineno">464</tt> <tt class="py-line"><tt class="py-docstring"> >>> '%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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> "%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 & 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 & 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"> >>> # 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"> >>> # (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"> >>> 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"> >>> # 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"> >>> 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"> >>> # 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"> >>> 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"> >>> # 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"> >>> 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"> >>> '%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"> >>> '%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"> >>> '%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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> xy = x1+y1</tt> </tt> | |
513 | <a name="L462"></a><tt class="py-lineno">462</tt> <tt class="py-line"><tt class="py-docstring"> >>> '%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"> >>> xy = x2+y2</tt> </tt> | |
516 | <a name="L465"></a><tt class="py-lineno">465</tt> <tt class="py-line"><tt class="py-docstring"> >>> '%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"> >>> 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"> >>> xy = lons+lats</tt> </tt> | |
520 | <a name="L469"></a><tt class="py-lineno">469</tt> <tt class="py-line"><tt class="py-docstring"> >>> '%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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> "%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 & 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 & 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> | |
703 | 703 | <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"> >>> 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"> >>> 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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> # 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"> >>> # 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"> >>> 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"> >>> "%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"> >>> # 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"> >>> # 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"> >>> 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"> >>> "%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"> >>> # 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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> "%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"> >>> 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"> >>> 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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> # 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"> >>> # 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"> >>> 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"> >>> "%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"> >>> # 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"> >>> # 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"> >>> 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"> >>> "%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"> >>> # 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"> >>> # 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> >>> "%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> | |
764 | 764 | <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> | |
780 | 780 | <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"><</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"> >>> 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"> >>> 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"> >>> # 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"> >>> 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"> >>> # 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"> >>> 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"> >>> 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"> >>> # 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"> >>> 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"> >>> 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"> >>> # 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"> >>> import math</tt> </tt> | |
892 | <a name="L840"></a><tt class="py-lineno">840</tt> <tt class="py-line"><tt class="py-docstring"> >>> 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"> >>> 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"> >>> 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"> >>> 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"><</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"> >>> 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"> >>> 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"> >>> # 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"> >>> 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"> >>> # 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"> >>> 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"> >>> 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"> >>> # 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"> >>> 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"> >>> 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"> >>> # 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"> >>> import math</tt> </tt> | |
897 | <a name="L845"></a><tt class="py-lineno">845</tt> <tt class="py-line"><tt class="py-docstring"> >>> 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"> >>> 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"> >>> 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"> >>> 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"> | |
917 | 922 | <!-- |
918 | 923 | expandto(location.href); |
919 | 924 | // --> |
946 | 951 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
947 | 952 | <tr> |
948 | 953 | <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 | |
950 | 955 | </td> |
951 | 956 | <td align="right" class="footer"> |
952 | 957 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
506 | 506 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
507 | 507 | <tr> |
508 | 508 | <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 | |
510 | 510 | </td> |
511 | 511 | <td align="right" class="footer"> |
512 | 512 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
137 | 137 | returns True if projection in geographic (lon/lat) coordinates</td> |
138 | 138 | <td align="right" valign="top"> |
139 | 139 | <span class="codelink"><a href="pyproj-pysrc.html#Proj.is_latlong">source 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"> </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 code</a></span> | |
140 | 157 | |
141 | 158 | </td> |
142 | 159 | </tr> |
367 | 384 | </dl> |
368 | 385 | </td></tr></table> |
369 | 386 | </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 code</a></span> | |
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> | |
370 | 410 | <br /> |
371 | 411 | <!-- ==================== NAVIGATION BAR ==================== --> |
372 | 412 | <table class="navbar" border="0" width="100%" cellpadding="0" |
394 | 434 | <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
395 | 435 | <tr> |
396 | 436 | <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 | |
398 | 438 | </td> |
399 | 439 | <td align="right" class="footer"> |
400 | 440 | <a target="mainFrame" href="http://epydoc.sourceforge.net" |
22 | 22 | that support the Python buffer protocol (regular python and |
23 | 23 | numpy array objects). |
24 | 24 | |
25 | Download: http://code.google.com/p/pyproj/downloads/list | |
25 | Download: http://python.org/pypi/pyproj | |
26 | 26 | |
27 | 27 | Requirements: python 2.4 or higher. |
28 | 28 | |
390 | 390 | outy = _convertback(yisfloat,yislist,xistuple,iny) |
391 | 391 | return outx, outy |
392 | 392 | |
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 | ||
393 | 398 | def is_latlong(self): |
394 | 399 | """returns True if projection in geographic (lon/lat) coordinates""" |
395 | 400 | return _proj.Proj.is_latlong(self) |
302 | 302 | # Carthage |
303 | 303 | <4223> +proj=longlat +datum=carthage +no_defs <> |
304 | 304 | # 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 <> | |
306 | 306 | # 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 <> | |
308 | 308 | # Cote d'Ivoire |
309 | 309 | <4226> +proj=longlat +a=6378249.2 +b=6356515 +no_defs <> |
310 | 310 | # Deir ez Zor |
501 | 501 | <4470> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
502 | 502 | # Cadastre 1997 |
503 | 503 | <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 | |
505 | 505 | <4483> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
506 | 506 | # China Geodetic Coordinate System 2000 |
507 | 507 | <4490> +proj=longlat +ellps=GRS80 +no_defs <> |
546 | 546 | # NAD83(CSRS) |
547 | 547 | <4617> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
548 | 548 | # 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 <> | |
550 | 550 | # SWEREF99 |
551 | 551 | <4619> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
552 | 552 | # Point 58 |
735 | 735 | <4721> +proj=longlat +ellps=intl +towgs84=265.025,384.929,-194.046,0,0,0,0 +no_defs <> |
736 | 736 | # South Georgia 1968 |
737 | 737 | <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 <> | |
740 | 740 | # Diego Garcia 1969 |
741 | 741 | <4724> +proj=longlat +ellps=intl +towgs84=208,-435,-229,0,0,0,0 +no_defs <> |
742 | 742 | # Johnston Island 1961 |
743 | 743 | <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 <> | |
746 | 746 | # Midway 1961 |
747 | 747 | <4727> +proj=longlat +ellps=intl +towgs84=403,-81,277,0,0,0,0 +no_defs <> |
748 | 748 | # Pico de las Nieves 1984 |
884 | 884 | # SLD99 |
885 | 885 | <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 <> |
886 | 886 | # 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 <> | |
888 | 888 | # TUREF |
889 | 889 | <5252> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
890 | 890 | # DRUKREF 03 |
908 | 908 | # SIRGAS_ES2007.8 |
909 | 909 | <5393> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
910 | 910 | # 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 <> | |
912 | 912 | # Sibun Gorge 1922 |
913 | 913 | <5464> +proj=longlat +a=6378293.645208759 +b=6356617.987679838 +no_defs <> |
914 | 914 | # Panama-Colon 1911 |
918 | 918 | # Corrego Alegre 1961 |
919 | 919 | <5524> +proj=longlat +ellps=intl +no_defs <> |
920 | 920 | # 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 <> | |
922 | 922 | # PNG94 |
923 | 923 | <5546> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
924 | # Ukraine 2000 | |
924 | # UCS-2000 | |
925 | 925 | <5561> +proj=longlat +ellps=krass +towgs84=25,-141,-78.5,-0,0.35,0.736,0 +no_defs <> |
926 | 926 | # FEH2010 |
927 | 927 | <5593> +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs <> |
928 | 928 | # DB_REF |
929 | 929 | <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 <> | |
930 | 950 | # Anguilla 1957 / British West Indies Grid |
931 | 951 | <2000> +proj=tmerc +lat_0=0 +lon_0=-62 +k=0.9995000000000001 +x_0=400000 +y_0=0 +ellps=clrk80 +units=m +no_defs <> |
932 | 952 | # Antigua 1943 / British West Indies Grid |
2908 | 2928 | <2989> +proj=utm +zone=20 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
2909 | 2929 | # Reunion 1947 / TM Reunion (deprecated) |
2910 | 2930 | <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) | |
2912 | 2932 | <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) | |
2914 | 2934 | <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) | |
2916 | 2936 | <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) | |
2918 | 2938 | <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 <> |
2919 | 2939 | # IGN53 Mare / UTM zone 58S |
2920 | 2940 | <2995> +proj=utm +zone=58 +south +ellps=intl +towgs84=287.58,177.78,-135.41,0,0,0,0 +units=m +no_defs <> |
3645 | 3665 | <3354> +proj=utm +zone=32 +south +ellps=intl +units=m +no_defs <> |
3646 | 3666 | # Egypt Gulf of Suez S-650 TL / Red Belt |
3647 | 3667 | <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 <> | |
3652 | 3672 | # NAD83(HARN) / North Carolina |
3653 | 3673 | <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 <> |
3654 | 3674 | # NAD83(HARN) / North Carolina (ftUS) (deprecated) |
3767 | 3787 | <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 <> |
3768 | 3788 | # ETRS89 / Austria Lambert |
3769 | 3789 | <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) | |
3771 | 3791 | <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) | |
3773 | 3793 | <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) | |
3775 | 3795 | <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) | |
3777 | 3797 | <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) | |
3779 | 3799 | <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) | |
3781 | 3801 | <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) | |
3783 | 3803 | <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) | |
3785 | 3805 | <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) | |
3787 | 3807 | <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) | |
3789 | 3809 | <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) | |
3791 | 3811 | <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) | |
3793 | 3813 | <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) | |
3795 | 3815 | <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) | |
3797 | 3817 | <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) | |
3799 | 3819 | <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) | |
3801 | 3821 | <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 <> |
3802 | 3822 | # NAD83 / Arkansas North (ftUS) |
3803 | 3823 | <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 <> |
4007 | 4027 | <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 <> |
4008 | 4028 | # NAD83(NSRS2007) / Iowa North |
4009 | 4029 | <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) | |
4011 | 4031 | <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 <> |
4012 | 4032 | # NAD83(NSRS2007) / Iowa South |
4013 | 4033 | <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) | |
4015 | 4035 | <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 <> |
4016 | 4036 | # NAD83(NSRS2007) / Kansas North |
4017 | 4037 | <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) | |
4019 | 4039 | <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 <> |
4020 | 4040 | # NAD83(NSRS2007) / Kansas South |
4021 | 4041 | <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) | |
4023 | 4043 | <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 <> |
4024 | 4044 | # NAD83(NSRS2007) / Kentucky North |
4025 | 4045 | <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 <> |
4149 | 4169 | <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 <> |
4150 | 4170 | # NAD83(NSRS2007) / Nevada Central |
4151 | 4171 | <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) | |
4153 | 4173 | <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 <> |
4154 | 4174 | # NAD83(NSRS2007) / Nevada East |
4155 | 4175 | <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) | |
4157 | 4177 | <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 <> |
4158 | 4178 | # NAD83(NSRS2007) / Nevada West |
4159 | 4179 | <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) | |
4161 | 4181 | <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 <> |
4162 | 4182 | # NAD83(NSRS2007) / New Hampshire |
4163 | 4183 | <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 <> |
4165 | 4185 | <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 <> |
4166 | 4186 | # NAD83(NSRS2007) / New Jersey |
4167 | 4187 | <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) | |
4169 | 4189 | <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 <> |
4170 | 4190 | # NAD83(NSRS2007) / New Mexico Central |
4171 | 4191 | <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 <> |
4219 | 4239 | <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 <> |
4220 | 4240 | # NAD83(NSRS2007) / Oklahoma South (ftUS) |
4221 | 4241 | <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) | |
4223 | 4243 | <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) | |
4225 | 4245 | <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 <> |
4226 | 4246 | # NAD83(NSRS2007) / Oregon North |
4227 | 4247 | <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 <> |
4741 | 4761 | # RGRDC 2005 / UTM zone 35S |
4742 | 4762 | <4063> +proj=utm +zone=35 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
4743 | 4763 | # 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 <> | |
4745 | 4765 | # REGCAN95 / UTM zone 27N |
4746 | 4766 | <4082> +proj=utm +zone=27 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
4747 | 4767 | # REGCAN95 / UTM zone 28N |
4848 | 4868 | <4467> +proj=utm +zone=21 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
4849 | 4869 | # RGM04 / UTM zone 38S |
4850 | 4870 | <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) | |
4852 | 4872 | <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 | |
4854 | 4874 | <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 | |
4856 | 4876 | <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 | |
4858 | 4878 | <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 | |
4860 | 4880 | <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 | |
4862 | 4882 | <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 | |
4864 | 4884 | <4489> +proj=utm +zone=16 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
4865 | 4885 | # CGCS2000 / Gauss-Kruger zone 13 |
4866 | 4886 | <4491> +proj=tmerc +lat_0=0 +lon_0=75 +k=1 +x_0=13500000 +y_0=0 +ellps=GRS80 +units=m +no_defs <> |
5316 | 5336 | # ETRS89 / LCC Germany (E-N) |
5317 | 5337 | <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 <> |
5318 | 5338 | # 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 <> | |
5320 | 5340 | # TUREF / TM27 |
5321 | 5341 | <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 <> |
5322 | 5342 | # TUREF / TM30 |
5442 | 5462 | # SIRGAS 2000 / UTM zone 26S |
5443 | 5463 | <5396> +proj=utm +zone=26 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
5444 | 5464 | # 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 <> | |
5446 | 5466 | # 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 <> | |
5448 | 5468 | # Ocotepeque 1935 / Guatemala Norte (deprecated) |
5449 | 5469 | <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 <> |
5450 | 5470 | # 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 <> | |
5452 | 5472 | # 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 <> | |
5454 | 5474 | # 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 <> | |
5456 | 5476 | # 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 <> | |
5458 | 5478 | # 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 <> | |
5460 | 5480 | # Sibun Gorge 1922 / Colony Grid (deprecated) |
5461 | 5481 | <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 <> |
5462 | 5482 | # Panama-Colon 1911 / Panama Lambert |
5492 | 5512 | # WGS 84 / Gabon TM 2011 |
5493 | 5513 | <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 <> |
5494 | 5514 | # 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 <> | |
5496 | 5516 | # 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 <> | |
5498 | 5518 | # 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 <> | |
5500 | 5520 | # 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 <> | |
5502 | 5522 | # 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 <> | |
5504 | 5524 | # 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 <> | |
5506 | 5526 | # Corrego Alegre 1961 / UTM zone 21S |
5507 | 5527 | <5536> +proj=utm +zone=21 +south +ellps=intl +units=m +no_defs <> |
5508 | 5528 | # Corrego Alegre 1961 / UTM zone 22S |
5518 | 5538 | # PNG94 / PNGMG94 zone 56 |
5519 | 5539 | <5552> +proj=utm +zone=56 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
5520 | 5540 | # 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 | |
5523 | 5543 | <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 | |
5525 | 5545 | <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 | |
5527 | 5547 | <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 | |
5529 | 5549 | <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 | |
5531 | 5551 | <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 | |
5533 | 5553 | <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 | |
5535 | 5555 | <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 | |
5537 | 5557 | <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) | |
5539 | 5559 | <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) | |
5541 | 5561 | <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) | |
5543 | 5563 | <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) | |
5545 | 5565 | <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) | |
5547 | 5567 | <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) | |
5549 | 5569 | <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) | |
5551 | 5571 | <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) | |
5553 | 5573 | <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) | |
5555 | 5575 | <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) | |
5557 | 5577 | <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) | |
5559 | 5579 | <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) | |
5561 | 5581 | <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) | |
5563 | 5583 | <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) | |
5565 | 5585 | <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 <> |
5566 | 5586 | # NAD27 / New Brunswick Stereographic (NAD27) |
5567 | 5587 | <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 <> |
5689 | 5709 | # RGRDC 2005 / Congo TM zone 30 |
5690 | 5710 | <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 <> |
5691 | 5711 | # 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 <> | |
5693 | 6718 | # Pulkovo 1995 / Gauss-Kruger zone 4 |
5694 | 6719 | <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 <> |
5695 | 6720 | # Pulkovo 1995 / Gauss-Kruger zone 5 |
6094 | 7119 | # Carthage / Sud Tunisie |
6095 | 7120 | <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 <> |
6096 | 7121 | # 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 <> | |
6098 | 7123 | # 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 <> | |
6100 | 7125 | # 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 <> | |
6102 | 7127 | # 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 <> | |
6104 | 7129 | # 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 <> | |
6106 | 7131 | # Deir ez Zor / Levant Zone |
6107 | 7132 | <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 <> |
6108 | 7133 | # Deir ez Zor / Syria Lambert |
6607 | 7632 | <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 <> |
6608 | 7633 | # NAD Michigan / Michigan West (deprecated) |
6609 | 7634 | <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) | |
6611 | 7636 | <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) | |
6613 | 7638 | <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) | |
6615 | 7640 | <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 <> |
6616 | 7641 | # NAD83 / Maine East (ftUS) (deprecated) |
6617 | 7642 | <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 <> |
7055 | 8080 | <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 <> |
7056 | 8081 | # Pointe Noire / UTM zone 32S |
7057 | 8082 | <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 | |
7059 | 8084 | <28348> +proj=utm +zone=48 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
7060 | 8085 | # GDA94 / MGA zone 49 |
7061 | 8086 | <28349> +proj=utm +zone=49 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs <> |
7210 | 8235 | # SAD69 / Brazil Polyconic (deprecated) |
7211 | 8236 | <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 <> |
7212 | 8237 | # 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 <> | |
7214 | 8239 | # SAD69 / UTM zone 18N (deprecated) |
7215 | 8240 | <29118> +proj=utm +zone=18 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <> |
7216 | 8241 | # SAD69 / UTM zone 19N (deprecated) |
7222 | 8247 | # SAD69 / UTM zone 22N (deprecated) |
7223 | 8248 | <29122> +proj=utm +zone=22 +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <> |
7224 | 8249 | # 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 <> | |
7226 | 8251 | # 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 <> | |
7228 | 8253 | # 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 <> | |
7230 | 8255 | # 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 <> | |
7232 | 8257 | # 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 <> | |
7234 | 8259 | # SAD69 / UTM zone 17S (deprecated) |
7235 | 8260 | <29177> +proj=utm +zone=17 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <> |
7236 | 8261 | # SAD69 / UTM zone 18S (deprecated) |
7250 | 8275 | # SAD69 / UTM zone 25S (deprecated) |
7251 | 8276 | <29185> +proj=utm +zone=25 +south +ellps=GRS67 +towgs84=-57,1,-41,0,0,0,0 +units=m +no_defs <> |
7252 | 8277 | # 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 <> | |
7254 | 8279 | # 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 <> | |
7256 | 8281 | # 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 <> | |
7258 | 8283 | # 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 <> | |
7260 | 8285 | # 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 <> | |
7262 | 8287 | # 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 <> | |
7264 | 8289 | # 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 <> | |
7266 | 8291 | # 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 <> | |
7268 | 8293 | # 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 <> | |
7270 | 8295 | # Sapper Hill 1943 / UTM zone 20S |
7271 | 8296 | <29220> +proj=utm +zone=20 +south +ellps=intl +towgs84=-355,21,72,0,0,0,0 +units=m +no_defs <> |
7272 | 8297 | # Sapper Hill 1943 / UTM zone 21S |
8625 | 9650 | <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 <> |
8626 | 9651 | # WGS 84 / TM 36 SE |
8627 | 9652 | <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 <> |
0 | 0 | ############################################################## |
1 | 1 | 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 | |
6 | 6 | ############################################################## |
7 | 7 | 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 | |
10 | 10 | 111d00'00.000"W 47d30'00.000"N 0.0 111d0'2.7989"W 47d29'59.9896"N 0.000 |
34 | 34 | echo Point in the ONwinsor subgrid. >> ${OUT} |
35 | 35 | # |
36 | 36 | $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 | |
38 | 38 | 82d00'00.000"W 42d00'00.000"N 0.0 |
39 | 39 | 82d00'01.000"W 42d00'00.000"N 0.0 |
40 | 40 | 82d00'02.000"W 42d00'00.000"N 0.0 |
45 | 45 | echo Try with NTv2 and NTv1 together ... falls back to NTv1 >> ${OUT} |
46 | 46 | # |
47 | 47 | $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 | |
49 | 49 | 99d00'00.000"W 65d00'00.000"N 0.0 |
50 | 50 | 111d00'00.000"W 46d00'00.000"N 0.0 |
51 | 51 | 111d00'00.000"W 47d30'00.000"N 0.0 |
6 | 6 | |
7 | 7 | usage() |
8 | 8 | { |
9 | echo "Usage: ${0} <path to 'cs2cs' program>" | |
9 | echo "Usage: ${0} <path to 'cs2cs' program>" | |
10 | 10 | echo |
11 | 11 | exit 1 |
12 | 12 | } |
130 | 130 | #echo "#############################################################" >> ${OUT} |
131 | 131 | #echo Test conversion between geocentric latlong and geodetic latlong >> ${OUT} |
132 | 132 | # |
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. | |
135 | 135 | # |
136 | 136 | #$EXE +proj=latlong +datum=WGS84 +geoc \ |
137 | 137 | # +to +proj=latlong +datum=WGS84 \ |
191 | 191 | +to +proj=latlong +datum=WGS84 \ |
192 | 192 | -E >>${OUT} <<EOF |
193 | 193 | 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 | |
198 | 198 | EOF |
199 | 199 | # |
200 | 200 | echo "##############################################################" >> ${OUT} |
204 | 204 | +to +proj=etmerc +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \ |
205 | 205 | -E >>${OUT} <<EOF |
206 | 206 | 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 | |
211 | 211 | EOF |
212 | 212 | # |
213 | 213 | echo "##############################################################" >> ${OUT} |
217 | 217 | +to +proj=latlong +datum=WGS84 \ |
218 | 218 | -E >>${OUT} <<EOF |
219 | 219 | 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 | |
224 | 224 | EOF |
225 | 225 | # |
226 | 226 | echo "##############################################################" >> ${OUT} |
230 | 230 | +to +proj=tmerc +k=0.998 +lon_0=-20 +datum=WGS84 +x_0=10000 +y_0=20000 \ |
231 | 231 | -E >>${OUT} <<EOF |
232 | 232 | 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 | |
237 | 237 | EOF |
238 | 238 | # |
239 | 239 | echo "##############################################################" >> ${OUT} |
242 | 242 | $EXE +proj=latlong +datum=WGS84 \ |
243 | 243 | +to +proj=robin +datum=WGS84 \ |
244 | 244 | -E >>${OUT} <<EOF |
245 | -30 40 | |
245 | -30 40 | |
246 | 246 | -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} | |
250 | 258 | $EXE +proj=latlong +a=1 +lon_0=0 \ |
251 | 259 | +to +proj=healpix +a=1 +lon_0=0 -f '%.'5'f' \ |
252 | 260 | -E >>${OUT} <<EOF |
253 | 261 | 0 41.81031 |
254 | 262 | -90 0 |
255 | 263 | 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} | |
257 | 279 | $EXE +proj=latlong +a=1 +lon_0=0 \ |
258 | 280 | +to +proj=healpix +a=1 +lon_0=0 -f '%.'5'f' -I\ |
259 | 281 | -E >>${OUT} <<EOF |
260 | 282 | 0 0.7853981633974483 |
261 | 283 | -1.5707963267948966 0 |
262 | 284 | 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} | |
264 | 300 | $EXE +proj=latlong +a=1 +lon_0=0 +ellps=WGS84 \ |
265 | 301 | +to +proj=healpix +a=1 +lon_0=0 +ellps=WGS84 -f '%.'5'f' \ |
266 | 302 | -E >>${OUT} <<EOF |
267 | 303 | 0 41.937853904844985 |
268 | 304 | -90 0 |
269 | 305 | 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} | |
271 | 321 | $EXE +proj=latlong +a=1 +lon_0=0 +ellps=WGS84 \ |
272 | 322 | +to +proj=healpix +a=1 +lon_0=0 +ellps=WGS84 -f '%.'5'f' -I\ |
273 | 323 | -E >>${OUT} <<EOF |
274 | 324 | 0 0.7853981633974483 |
275 | 325 | -1.5707963267948966 0 |
276 | 326 | 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 | ||
306 | 436 | echo "##############################################################" >> ${OUT} |
307 | 437 | echo "Test geos projection" >> ${OUT} |
308 | 438 | echo "Test geos on a sphere" >> ${OUT} |
339 | 469 | EOF |
340 | 470 | echo "Test geos on a sphere with alternate sweep" >> ${OUT} |
341 | 471 | $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 | |
343 | 473 | 16d11'8" 58d35'31" |
344 | 474 | -43d11'47" -22d54'30" |
345 | 475 | 18d25'26" -33d55'31" |
347 | 477 | EOF |
348 | 478 | echo "Test geos on a ellipsoid with alternate sweep" >> ${OUT} |
349 | 479 | $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 | |
351 | 481 | 16d11'8" 58d35'31" |
352 | 482 | -43d11'47" -22d54'30" |
353 | 483 | 18d25'26" -33d55'31" |
355 | 485 | EOF |
356 | 486 | echo "Test inv geos on a sphere with alternate sweep" >> ${OUT} |
357 | 487 | $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 | |
359 | 489 | 841586.28 4961396.21 |
360 | 490 | -3772913.22 -2339604.71 |
361 | 491 | 1601377.77 -3415545.15 |
363 | 493 | EOF |
364 | 494 | echo "Test inv geos on a ellipsoid with alternate sweep" >> ${OUT} |
365 | 495 | $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 | |
367 | 497 | 844731.03 4946509.59 |
368 | 498 | -3779077.27 -2327750.87 |
369 | 499 | 1605067.15 -3400461.47 |
414 | 544 | -E >>${OUT} <<EOF |
415 | 545 | -2240096.40 -6940342.15 |
416 | 546 | 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 | |
417 | 699 | ############################################################################## |
418 | # Done! | |
700 | # Done! | |
419 | 701 | # do 'diff' with distribution results |
420 | 702 | echo "diff ${OUT} with ${OUT}.dist" |
421 | 703 | diff -b ${OUT} ${OUT}.dist |
57 | 57 | ############################################################## |
58 | 58 | Test extended transverse mercator (#97) |
59 | 59 | 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 | |
64 | 64 | ############################################################## |
65 | 65 | Test extended transverse mercator inverse (#97) |
66 | 66 | 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 | |
71 | 71 | ############################################################## |
72 | 72 | Test transverse mercator (#97) |
73 | 73 | 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 | |
78 | 78 | ############################################################## |
79 | 79 | Test transverse mercator inverse (#97) |
80 | 80 | 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 | |
85 | 85 | ############################################################## |
86 | 86 | Test robinson projection (#113) |
87 | -30 40 -2612095.95 4276351.58 0.00 | |
87 | -30 40 -2612095.95 4276351.58 0.00 | |
88 | 88 | -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 | |
91 | 95 | 0 41.81031 0.00000 0.78540 0.00000 |
92 | 96 | -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 | |
94 | 108 | 0 0.7853981633974483 0.00000 41.81031 0.00000 |
95 | 109 | -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 | |
115 | 200 | ############################################################## |
116 | 201 | Test geos projection |
117 | 202 | Test geos on a sphere |
185 | 270 | Test pconic (#148) |
186 | 271 | -70.4 -23.65 -2240096.40 -6940342.15 0.00 |
187 | 272 | -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 |
17 | 17 | incdirs.append(os.path.join(proj_dir,'include')) |
18 | 18 | |
19 | 19 | 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) | |
21 | 22 | |
22 | 23 | # over-write default data directory. |
23 | 24 | pyproj_datadir = os.path.join(os.path.join(proj_dir,'share'),'proj') |
30 | 31 | package_dirs = {'':'lib'} |
31 | 32 | |
32 | 33 | setup(name = "pyproj", |
33 | version = "1.9.3", | |
34 | version = "1.9.4", | |
34 | 35 | description = "Python interface to PROJ.4 library", |
35 | 36 | long_description = """ |
36 | 37 | Performs cartographic transformations between geographic (lat/lon) |
38 | 39 | from one map projection coordinate system to another. |
39 | 40 | Coordinates can be given as numpy arrays, python arrays, lists or scalars. |
40 | 41 | Optimized for numpy arrays.""", |
41 | url = "http://code.google.com/p/pyproj", | |
42 | url = "https://github.com/jswhit/pyproj", | |
42 | 43 | download_url = "http://python.org/pypi/pyproj", |
43 | 44 | author = "Jeff Whitaker", |
44 | 45 | author_email = "jeffrey.s.whitaker@noaa.gov", |
8 | 8 | pathout = os.path.join('lib',os.path.join('pyproj','data')) |
9 | 9 | if sys.argv[1] != 'sdist': |
10 | 10 | 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) | |
12 | 13 | cc.set_include_dirs(['src']) |
13 | 14 | objects = cc.compile(['nad2bin.c', 'src/pj_malloc.c']) |
14 | 15 | execname = 'nad2bin' |
30 | 31 | package_data = {'pyproj':datafiles} |
31 | 32 | |
32 | 33 | setup(name = "pyproj", |
33 | version = "1.9.3", | |
34 | version = "1.9.4", | |
34 | 35 | description = "Python interface to PROJ.4 library", |
35 | 36 | long_description = """ |
36 | 37 | Performs cartographic transformations between geographic (lat/lon) |
38 | 39 | from one map projection coordinate system to another. |
39 | 40 | Coordinates can be given as numpy arrays, python arrays, lists or scalars. |
40 | 41 | Optimized for numpy arrays.""", |
41 | url = "http://code.google.com/p/pyproj", | |
42 | url = "https://github.com/jswhit/pyproj", | |
42 | 43 | download_url = "http://python.org/pypi/pyproj", |
43 | 44 | author = "Jeff Whitaker", |
44 | 45 | author_email = "jeffrey.s.whitaker@noaa.gov", |
46 | 47 | license = "OSI Approved", |
47 | 48 | keywords = ["python","map projections","GIS","mapping","maps"], |
48 | 49 | classifiers = ["Development Status :: 4 - Beta", |
49 | "Intended Audience :: Science/Research", | |
50 | "License :: OSI Approved", | |
50 | "Intended Audience :: Science/Research", | |
51 | "License :: OSI Approved", | |
51 | 52 | "Topic :: Software Development :: Libraries :: Python Modules", |
52 | 53 | "Topic :: Scientific/Engineering :: GIS", |
53 | 54 | "Topic :: Scientific/Engineering :: Mathematics", |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Implementation of the aeqd (Azimuthal Equidistant) projection. |
39 | 39 | #define PJ_LIB__ |
40 | 40 | #include <projects.h> |
41 | 41 | |
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 $"); | |
43 | 43 | |
44 | 44 | PROJ_HEAD(aeqd, "Azimuthal Equidistant") "\n\tAzi, Sph&Ell\n\tlat_0 guam"; |
45 | 45 | |
209 | 209 | xy.y = (cosc - P->sinph0 * sin(lp.phi)) * c_rh; |
210 | 210 | xy.x *= sinc * P->cosph0; |
211 | 211 | } |
212 | lp.lam = xy.y == 0. ? 0. : atan2(xy.x, xy.y); | |
212 | lp.lam = atan2(xy.x, xy.y); | |
213 | 213 | } else if (P->mode == N_POLE) { |
214 | 214 | lp.phi = HALFPI - c_rh; |
215 | 215 | lp.lam = atan2(xy.x, -xy.y); |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Implementation of the aitoff (Aitoff) and wintri (Winkel Tripel) |
33 | 33 | #define PJ_LIB__ |
34 | 34 | #include <projects.h> |
35 | 35 | |
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 $"); | |
37 | 37 | |
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"; | |
40 | 40 | |
41 | 41 | FORWARD(s_forward); /* spheroid */ |
42 | 42 | 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) |
4 | 4 | ** Copyright (c) 2012 Martin Raspaud |
5 | 5 | */ |
6 | 6 | 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 $"; | |
8 | 8 | /* |
9 | 9 | ** See also (section 4.4.3.2): |
10 | 10 | ** http://www.eumetsat.int/en/area4/msg/news/us_doc/cgms_03_26.pdf |
169 | 169 | (P->sweep_axis[0] != 'x' && |
170 | 170 | P->sweep_axis[0] != 'y')) |
171 | 171 | E_ERROR(-49); |
172 | if (P->sweep_axis[0] == 'y') | |
172 | if (P->sweep_axis[0] == 'x') | |
173 | 173 | P->flip_axis = 1; |
174 | 174 | else |
175 | 175 | P->flip_axis = 0; |
1 | 1 | double w; \ |
2 | 2 | double m, rm; |
3 | 3 | #define PJ_LIB__ |
4 | # define EPS 1.0e-10 | |
5 | 4 | # include <projects.h> |
6 | 5 | PROJ_HEAD(hammer, "Hammer & Eckert-Greifendorff") |
7 | "\n\tMisc Sph, \n\tW= M="; | |
6 | "\n\tMisc Sph, no inv.\n\tW= M="; | |
8 | 7 | FORWARD(s_forward); /* spheroid */ |
9 | 8 | double cosphi, d; |
10 | 9 | |
12 | 11 | xy.x = P->m * d * cosphi * sin(lp.lam); |
13 | 12 | xy.y = P->rm * d * sin(lp.phi); |
14 | 13 | 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); | |
28 | 14 | } |
29 | 15 | FREEUP; if (P) pj_dalloc(P); } |
30 | 16 | ENTRY0(hammer) |
38 | 24 | P->m = 1.; |
39 | 25 | P->rm = 1. / P->m; |
40 | 26 | P->m /= P->w; |
41 | P->es = 0.; P->fwd = s_forward; P->inv = s_inverse; | |
27 | P->es = 0.; P->fwd = s_forward; | |
42 | 28 | 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) |
0 | 0 | /****************************************************************************** |
1 | 1 | * $Id: PJ_healpix.c 1504 2011-10-18 14:58:57Z landcare $ |
2 | 2 | * |
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. | |
8 | 10 | ****************************************************************************** |
9 | 11 | * Copyright (c) 2001, Thomas Flemming, tf@ttqv.com |
10 | 12 | * |
16 | 18 | * Software is furnished to do so, subject to the following conditions: |
17 | 19 | * |
18 | 20 | * 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. | |
20 | 22 | * |
21 | 23 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
22 | 24 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
27 | 29 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
28 | 30 | * SOFTWARE. |
29 | 31 | *****************************************************************************/ |
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__ | |
36 | 38 | # include <projects.h> |
37 | 39 | 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="; | |
39 | 41 | # 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 | |
57 | 54 | 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; | |
61 | 58 | } CapMap; |
62 | 59 | typedef struct { |
63 | double x,y; | |
60 | double x, y; | |
64 | 61 | } Point; |
65 | 62 | double rot[7][2][2] = ROT; |
66 | 63 | |
67 | 64 | /** |
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 | /** | |
75 | 65 | * Returns the sign of the double. |
76 | 66 | * @param v the parameter whose sign is returned. |
77 | 67 | * @return 1 for positive number, -1 for negative, and 0 for zero. |
78 | 68 | **/ |
79 | double sign (double v) { | |
69 | double pj_sign (double v) { | |
80 | 70 | return v > 0 ? 1 : (v < 0 ? -1 : 0); |
81 | 71 | } |
82 | 72 | /** |
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. | |
143 | 75 | */ |
144 | static int get_rotate_index(int index){ | |
145 | switch(index){ | |
76 | static int get_rotate_index(int index) { | |
77 | switch(index) { | |
146 | 78 | case 0: |
147 | 79 | return 0; |
148 | 80 | case 1: |
161 | 93 | return 0; |
162 | 94 | } |
163 | 95 | /** |
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. | |
166 | 99 | * @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; | |
176 | 104 | int counter = 0; |
177 | 105 | 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 | } | |
188 | 113 | p1.x = vert[0][0]; |
189 | 114 | 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); | |
205 | 202 | } |
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. | |
299 | 212 | **/ |
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); | |
304 | 217 | 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 | } | |
322 | 233 | return xy; |
323 | 234 | } |
324 | 235 | /** |
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(). | |
327 | 237 | **/ |
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) { | |
333 | 239 | 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; | |
354 | 260 | } |
355 | 261 | return (lp); |
356 | 262 | } |
357 | 263 | /** |
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) { | |
364 | 268 | 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) { | |
376 | 278 | 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; | |
391 | 290 | 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) { | |
410 | 308 | CapMap capmap; |
411 | 309 | double c; |
412 | ||
413 | 310 | capmap.x = x; |
414 | 311 | 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 | |
494 | 389 | * 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) { | |
507 | 398 | XY xy; |
508 | 399 | double v[2]; |
509 | 400 | double a[2]; |
510 | 401 | double vector[2]; |
511 | double tmpVect[2]; | |
512 | 402 | double v_min_c[2]; |
513 | 403 | 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; | |
521 | 409 | } |
522 | 410 | v[0] = x; |
523 | 411 | 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); | |
549 | 536 | } |
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; | |
683 | 549 | } |
684 | 550 | 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; | |
701 | 571 | } |
702 | 572 | ENDENTRY(P) |
918 | 918 | struct isea_pt v; |
919 | 919 | int sidelength; |
920 | 920 | int d, i, x, y, quad; |
921 | double oddsl; | |
922 | 921 | |
923 | 922 | quad = isea_ptdi(g, tri, pt, &v); |
924 | 923 | |
933 | 932 | /* Aperture 3 odd resolutions */ |
934 | 933 | if (g->aperture == 3 && g->resolution % 2 != 0) { |
935 | 934 | int offset = (int)(pow(3.0, g->resolution - 1) + 0.5); |
936 | ||
937 | oddsl = (pow(2.0, g->resolution) + 1.0) / 2.0; | |
938 | 935 | |
939 | 936 | d += offset * ((g->quad-1) % 5); |
940 | 937 | i += offset * ((g->quad-1) % 5); |
978 | 975 | struct isea_pt |
979 | 976 | isea_forward(struct isea_dgg *g, struct isea_geo *in) |
980 | 977 | { |
981 | int tri, downtri, quad; | |
978 | int tri, downtri; | |
982 | 979 | struct isea_pt out, coord; |
983 | 980 | |
984 | 981 | tri = isea_transform(g, in, &out); |
985 | 982 | |
986 | 983 | downtri = (((tri - 1) / 5) % 2 == 1); |
987 | quad = ((tri - 1) % 5) + ((tri - 1) / 10) * 5 + 1; | |
988 | 984 | |
989 | 985 | if (g->output == ISEA_PLANE) { |
990 | 986 | isea_tri_plane(tri, &out, g->radius); |
79 | 79 | /* copy existing header into new */ |
80 | 80 | P->es = 0.; /* force to spherical */ |
81 | 81 | P->link->params = P->params; |
82 | P->link->ctx = P->ctx; | |
82 | 83 | P->link->over = P->over; |
83 | 84 | P->link->geoc = P->geoc; |
84 | 85 | P->link->a = P->a; |
47 | 47 | F_ERROR; |
48 | 48 | v = 0.5 * P->ArB * log((1. - U)/(1. + U)); |
49 | 49 | 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 | } | |
52 | 55 | } else { |
53 | 56 | v = lp.phi > 0 ? P->v_pole_n : P->v_pole_s; |
54 | 57 | u = P->ArB * lp.phi; |
92 | 95 | } |
93 | 96 | FREEUP; if (P) pj_dalloc(P); } |
94 | 97 | 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; | |
97 | 100 | int alp, gam, no_off = 0; |
98 | 101 | |
99 | 102 | P->no_rot = pj_param(P->ctx, P->params, "tno_rot").i; |
108 | 111 | pj_param(P->ctx, P->params, "tno_off").i |
109 | 112 | /* for backward compatibility */ |
110 | 113 | || 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 | } | |
111 | 120 | } else { |
112 | 121 | lam1 = pj_param(P->ctx, P->params, "rlon_1").f; |
113 | 122 | phi1 = pj_param(P->ctx, P->params, "rlat_1").f; |
2 | 2 | #define PJ_LIB__ |
3 | 3 | # include <projects.h> |
4 | 4 | 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."; | |
6 | 6 | #define C 0.79788456 |
7 | 7 | #define RPISQ 0.1013211836 |
8 | 8 | 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) |
2 | 2 | PROJ_HEAD(robin, "Robinson") "\n\tPCyl., Sph."; |
3 | 3 | #define V(C,z) (C.c0 + z * (C.c1 + z * (C.c2 + z * C.c3))) |
4 | 4 | #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 { | |
7 | 16 | 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 | }; | |
48 | 61 | #define FXC 0.8487 |
49 | 62 | #define FYC 1.3523 |
50 | 63 | #define C1 11.45915590261646417544 |
1 | 1 | double m, rmn, q3, n; |
2 | 2 | #define PJ_LIB__ |
3 | 3 | # 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="; | |
5 | 5 | FORWARD(s_forward); /* spheroid */ |
6 | 6 | double t; |
7 | 7 |
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). |
1 | 1 | #include "geod_interface.h" |
2 | 2 | |
3 | 3 | void geod_ini(void) { |
4 | GeodesicInit(&GlobalGeodesic, geod_a, geod_f); | |
4 | geod_init(&GlobalGeodesic, geod_a, geod_f); | |
5 | 5 | } |
6 | 6 | |
7 | 7 | void geod_pre(void) { |
8 | 8 | double |
9 | 9 | degree = PI/180, |
10 | 10 | lat1 = phi1 / degree, lon1 = lam1 /degree, azi1 = al12 / degree; |
11 | GeodesicLineInit(&GlobalGeodesicLine, &GlobalGeodesic, | |
11 | geod_lineinit(&GlobalGeodesicLine, &GlobalGeodesic, | |
12 | 12 | lat1, lon1, azi1, 0U); |
13 | 13 | } |
14 | 14 | |
15 | 15 | void geod_for(void) { |
16 | 16 | 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); | |
18 | 18 | azi2 += azi2 >= 0 ? -180 : 180; /* Compute back azimuth */ |
19 | 19 | phi2 = lat2 * degree; |
20 | 20 | lam2 = lon2 * degree; |
27 | 27 | lat1 = phi1 / degree, lon1 = lam1 / degree, |
28 | 28 | lat2 = phi2 / degree, lon2 = lam2 / degree, |
29 | 29 | azi1, azi2, s12; |
30 | Inverse(&GlobalGeodesic, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2); | |
30 | geod_inverse(&GlobalGeodesic, lat1, lon1, lat2, lon2, &s12, &azi1, &azi2); | |
31 | 31 | azi2 += azi2 >= 0 ? -180 : 180; /* Compute back azimuth */ |
32 | 32 | al12 = azi1 * degree; al21 = azi2 * degree; geod_S = s12; |
33 | 33 | } |
26 | 26 | # define al21 GEODESIC.ALPHA21 |
27 | 27 | # define geod_S GEODESIC.DIST |
28 | 28 | |
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; | |
31 | 31 | GEOD_EXTERN int n_alpha, n_S; |
32 | 32 | GEOD_EXTERN double to_meter, fr_meter, del_alpha; |
33 | 33 |
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 | ||
0 | 9 | /* |
1 | 10 | * This is a C implementation of the geodesic algorithms described in |
2 | 11 | * |
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); | |
6 | 15 | * http://dx.doi.org/10.1007/s00190-012-0578-z |
7 | 16 | * Addenda: http://geographiclib.sf.net/geod-addenda.html |
8 | 17 | * |
9 | 18 | * See the comments in geodesic.h for documentation. |
10 | 19 | * |
11 | * Copyright (c) Charles Karney (2012) <charles@karney.com> and licensed | |
20 | * Copyright (c) Charles Karney (2012-2013) <charles@karney.com> and licensed | |
12 | 21 | * under the MIT/X11 License. For more information, see |
13 | 22 | * http://geographiclib.sourceforge.net/ |
14 | * | |
15 | * This file was distributed with GeographicLib 1.27. | |
16 | 23 | */ |
17 | 24 | |
18 | 25 | #include "geodesic.h" |
116 | 123 | return x < 0 ? -y : y; |
117 | 124 | } |
118 | 125 | |
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 | ||
119 | 139 | static real minx(real x, real y) |
120 | 140 | { return x < y ? x : y; } |
121 | 141 | |
136 | 156 | static real AngNormalize2(real x) |
137 | 157 | { return AngNormalize(fmod(x, (real)(360))); } |
138 | 158 | |
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 | ||
139 | 168 | static real AngRound(real x) { |
140 | const real z = (real)(0.0625); /* 1/16 */ | |
169 | const real z = 1/(real)(16); | |
141 | 170 | volatile real y = fabs(x); |
142 | 171 | /* The compiler mustn't "simplify" z - (z - y) to y */ |
143 | 172 | y = y < z ? z - (z - y) : y; |
144 | 173 | return x < 0 ? -y : y; |
145 | 174 | } |
146 | 175 | |
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); | |
150 | 179 | static real SinCosSeries(boolx sinp, |
151 | 180 | real sinx, real cosx, |
152 | 181 | const real c[], int n); |
153 | static void Lengths(const struct Geodesic* g, | |
182 | static void Lengths(const struct geod_geodesic* g, | |
154 | 183 | real eps, real sig12, |
155 | 184 | real ssig1, real csig1, real dn1, |
156 | 185 | real ssig2, real csig2, real dn2, |
160 | 189 | /* Scratch areas of the right size */ |
161 | 190 | real C1a[], real C2a[]); |
162 | 191 | static real Astroid(real x, real y); |
163 | static real InverseStart(const struct Geodesic* g, | |
192 | static real InverseStart(const struct geod_geodesic* g, | |
164 | 193 | real sbet1, real cbet1, real dn1, |
165 | 194 | real sbet2, real cbet2, real dn2, |
166 | 195 | real lam12, |
167 | 196 | real* psalp1, real* pcalp1, |
168 | 197 | /* Only updated if return val >= 0 */ |
169 | 198 | real* psalp2, real* pcalp2, |
199 | /* Only updated for short lines */ | |
200 | real* pdnm, | |
170 | 201 | /* Scratch areas of the right size */ |
171 | 202 | real C1a[], real C2a[]); |
172 | static real Lambda12(const struct Geodesic* g, | |
203 | static real Lambda12(const struct geod_geodesic* g, | |
173 | 204 | real sbet1, real cbet1, real dn1, |
174 | 205 | real sbet2, real cbet2, real dn2, |
175 | 206 | real salp1, real calp1, |
181 | 212 | boolx diffp, real* pdlam12, |
182 | 213 | /* Scratch areas of the right size */ |
183 | 214 | 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[]); | |
187 | 218 | static real A1m1f(real eps); |
188 | 219 | static void C1f(real eps, real c[]); |
189 | 220 | static void C1pf(real eps, real c[]); |
190 | 221 | static real A2m1f(real eps); |
191 | 222 | 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) { | |
194 | 231 | if (!init) Init(); |
195 | 232 | g->a = a; |
196 | 233 | g->f = f <= 1 ? f : 1/f; |
203 | 240 | (g->e2 == 0 ? 1 : |
204 | 241 | (g->e2 > 0 ? atanhx(sqrt(g->e2)) : atan(sqrt(-g->e2))) / |
205 | 242 | 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 | ||
208 | 255 | A3coeff(g); |
209 | 256 | C3coeff(g); |
210 | 257 | C4coeff(g); |
211 | 258 | } |
212 | 259 | |
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) { | |
216 | 263 | real alp1, cbet1, sbet1, phi, eps; |
217 | 264 | l->a = g->a; |
218 | 265 | l->f = g->f; |
220 | 267 | l->c2 = g->c2; |
221 | 268 | l->f1 = g->f1; |
222 | 269 | /* 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)); | |
227 | 275 | 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 | ||
240 | 276 | l->lat1 = lat1; |
241 | 277 | l->lon1 = lon1; |
242 | 278 | l->azi1 = azi1; |
244 | 280 | alp1 = azi1 * degree; |
245 | 281 | /* Enforce sin(pi) == 0 and cos(pi/2) == 0. Better to face the ensuing |
246 | 282 | * problems directly than to skirt them. */ |
247 | l->salp1 = azi1 == -180 ? 0 : sin(alp1); | |
283 | l->salp1 = azi1 == -180 ? 0 : sin(alp1); | |
248 | 284 | l->calp1 = fabs(azi1) == 90 ? 0 : cos(alp1); |
249 | 285 | phi = lat1 * degree; |
250 | 286 | /* Ensure cbet1 = +epsilon at poles */ |
311 | 347 | } |
312 | 348 | } |
313 | 349 | |
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) { | |
320 | 356 | real lat2 = 0, lon2 = 0, azi2 = 0, s12 = 0, |
321 | 357 | m12 = 0, M12 = 0, M21 = 0, S12 = 0; |
322 | 358 | /* Avoid warning about uninitialized B12. */ |
324 | 360 | real omg12, lam12, lon12; |
325 | 361 | real ssig2, csig2, sbet2, cbet2, somg2, comg2, salp2, calp2, dn2; |
326 | 362 | 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); | |
334 | 370 | |
335 | 371 | 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)) )) | |
337 | 374 | /* Uninitialized or impossible distance calculation requested */ |
338 | 375 | return NaN; |
339 | 376 | |
396 | 433 | ssig2 = l->ssig1 * csig12 + l->csig1 * ssig12; |
397 | 434 | csig2 = l->csig1 * csig12 - l->ssig1 * ssig12; |
398 | 435 | dn2 = sqrt(1 + l->k2 * sq(ssig2)); |
399 | if (outmask & (DISTANCE | REDUCEDLENGTH | GEODESICSCALE)) { | |
436 | if (outmask & (GEOD_DISTANCE | GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) { | |
400 | 437 | if (arcmode || fabs(l->f) > 0.01) |
401 | 438 | B12 = SinCosSeries(TRUE, ssig2, csig2, l->C1a, nC1); |
402 | 439 | AB1 = (1 + l->A1m1) * (B12 - l->B11); |
416 | 453 | omg12 = atan2(somg2 * l->comg1 - comg2 * l->somg1, |
417 | 454 | comg2 * l->comg1 + somg2 * l->somg1); |
418 | 455 | |
419 | if (outmask & DISTANCE) | |
456 | if (outmask & GEOD_DISTANCE) | |
420 | 457 | s12 = arcmode ? l->b * ((1 + l->A1m1) * sig12 + AB1) : s12_a12; |
421 | 458 | |
422 | if (outmask & LONGITUDE) { | |
459 | if (outmask & GEOD_LONGITUDE) { | |
423 | 460 | lam12 = omg12 + l->A3c * |
424 | 461 | ( sig12 + (SinCosSeries(TRUE, ssig2, csig2, l->C3a, nC3-1) |
425 | 462 | - l->B31)); |
430 | 467 | lon2 = AngNormalize(l->lon1 + lon12); |
431 | 468 | } |
432 | 469 | |
433 | if (outmask & LATITUDE) | |
470 | if (outmask & GEOD_LATITUDE) | |
434 | 471 | lat2 = atan2(sbet2, l->f1 * cbet2) / degree; |
435 | 472 | |
436 | if (outmask & AZIMUTH) | |
473 | if (outmask & GEOD_AZIMUTH) | |
437 | 474 | /* minus signs give range [-180, 180). 0- converts -0 to +0. */ |
438 | 475 | azi2 = 0 - atan2(-salp2, calp2) / degree; |
439 | 476 | |
440 | if (outmask & (REDUCEDLENGTH | GEODESICSCALE)) { | |
477 | if (outmask & (GEOD_REDUCEDLENGTH | GEOD_GEODESICSCALE)) { | |
441 | 478 | real |
442 | 479 | B22 = SinCosSeries(TRUE, ssig2, csig2, l->C2a, nC2), |
443 | 480 | AB2 = (1 + l->A2m1) * (B22 - l->B21), |
444 | 481 | J12 = (l->A1m1 - l->A2m1) * sig12 + (AB1 - AB2); |
445 | if (outmask & REDUCEDLENGTH) | |
482 | if (outmask & GEOD_REDUCEDLENGTH) | |
446 | 483 | /* Add parens around (csig1 * ssig2) and (ssig1 * csig2) to ensure |
447 | 484 | * accurate cancellation in the case of coincident points. */ |
448 | 485 | m12 = l->b * ((dn2 * (l->csig1 * ssig2) - l->dn1 * (l->ssig1 * csig2)) |
449 | 486 | - l->csig1 * csig2 * J12); |
450 | if (outmask & GEODESICSCALE) { | |
487 | if (outmask & GEOD_GEODESICSCALE) { | |
451 | 488 | real t = l->k2 * (ssig2 - l->ssig1) * (ssig2 + l->ssig1) / (l->dn1 + dn2); |
452 | 489 | M12 = csig12 + (t * ssig2 - csig2 * J12) * l->ssig1 / l->dn1; |
453 | 490 | M21 = csig12 - (t * l->ssig1 - l->csig1 * J12) * ssig2 / dn2; |
454 | 491 | } |
455 | 492 | } |
456 | 493 | |
457 | if (outmask & AREA) { | |
494 | if (outmask & GEOD_AREA) { | |
458 | 495 | real |
459 | 496 | B42 = SinCosSeries(FALSE, ssig2, csig2, l->C4a, nC4); |
460 | 497 | real salp12, calp12; |
487 | 524 | S12 = l->c2 * atan2(salp12, calp12) + l->A4 * (B42 - l->B41); |
488 | 525 | } |
489 | 526 | |
490 | if (outmask & LATITUDE) | |
527 | if (outmask & GEOD_LATITUDE) | |
491 | 528 | *plat2 = lat2; |
492 | if (outmask & LONGITUDE) | |
529 | if (outmask & GEOD_LONGITUDE) | |
493 | 530 | *plon2 = lon2; |
494 | if (outmask & AZIMUTH) | |
531 | if (outmask & GEOD_AZIMUTH) | |
495 | 532 | *pazi2 = azi2; |
496 | if (outmask & DISTANCE) | |
533 | if (outmask & GEOD_DISTANCE) | |
497 | 534 | *ps12 = s12; |
498 | if (outmask & REDUCEDLENGTH) | |
535 | if (outmask & GEOD_REDUCEDLENGTH) | |
499 | 536 | *pm12 = m12; |
500 | if (outmask & GEODESICSCALE) { | |
537 | if (outmask & GEOD_GEODESICSCALE) { | |
501 | 538 | if (pM12) *pM12 = M12; |
502 | 539 | if (pM21) *pM21 = M21; |
503 | 540 | } |
504 | if (outmask & AREA) | |
541 | if (outmask & GEOD_AREA) | |
505 | 542 | *pS12 = S12; |
506 | 543 | |
507 | 544 | return arcmode ? s12_a12 : sig12 / degree; |
508 | 545 | } |
509 | 546 | |
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; | |
522 | 559 | 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) { | |
550 | 587 | real s12 = 0, azi1 = 0, azi2 = 0, m12 = 0, M12 = 0, M21 = 0, S12 = 0; |
551 | 588 | real lon12; |
552 | 589 | int latsign, lonsign, swapp; |
559 | 596 | real omg12 = 0; |
560 | 597 | |
561 | 598 | 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); | |
567 | 604 | |
568 | 605 | 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. */ | |
573 | 611 | lon12 = AngRound(lon12); |
574 | 612 | /* Make longitude difference positive. */ |
575 | 613 | lonsign = lon12 >= 0 ? 1 : -1; |
576 | 614 | lon12 *= lonsign; |
577 | if (lon12 == 180) | |
578 | lonsign = 1; | |
579 | 615 | /* If really close to the equator, treat as on equator. */ |
580 | 616 | lat1 = AngRound(lat1); |
581 | 617 | lat2 = AngRound(lat2); |
636 | 672 | slam12 = lon12 == 180 ? 0 : sin(lam12); |
637 | 673 | clam12 = cos(lam12); /* lon12 == 90 isn't interesting */ |
638 | 674 | |
639 | ||
640 | 675 | meridian = lat1 == -90 || slam12 == 0; |
641 | 676 | |
642 | 677 | if (meridian) { |
659 | 694 | real dummy; |
660 | 695 | Lengths(g, g->n, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, |
661 | 696 | cbet1, cbet2, &s12x, &m12x, &dummy, |
662 | (outmask & GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a); | |
697 | (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a); | |
663 | 698 | } |
664 | 699 | /* Add the check for sig12 since zero length geodesics might yield m12 < |
665 | 700 | * 0. Test case was |
687 | 722 | s12x = g->a * lam12; |
688 | 723 | sig12 = omg12 = lam12 / g->f1; |
689 | 724 | m12x = g->b * sin(sig12); |
690 | if (outmask & GEODESICSCALE) | |
725 | if (outmask & GEOD_GEODESICSCALE) | |
691 | 726 | M12 = M21 = cos(sig12); |
692 | 727 | a12 = lon12 / g->f1; |
693 | 728 | |
697 | 732 | * meridian and geodesic is neither meridional or equatorial. */ |
698 | 733 | |
699 | 734 | /* Figure a starting point for Newton's method */ |
735 | real dnm = 0; | |
700 | 736 | sig12 = InverseStart(g, sbet1, cbet1, dn1, sbet2, cbet2, dn2, |
701 | 737 | lam12, |
702 | &salp1, &calp1, &salp2, &calp2, | |
738 | &salp1, &calp1, &salp2, &calp2, &dnm, | |
703 | 739 | C1a, C2a); |
704 | 740 | |
705 | 741 | if (sig12 >= 0) { |
706 | /* Short lines (InverseStart sets salp2, calp2) */ | |
707 | real dnm = (dn1 + dn2) / 2; | |
742 | /* Short lines (InverseStart sets salp2, calp2, dnm) */ | |
708 | 743 | s12x = sig12 * g->b * dnm; |
709 | 744 | m12x = sq(dnm) * g->b * sin(sig12 / dnm); |
710 | if (outmask & GEODESICSCALE) | |
745 | if (outmask & GEOD_GEODESICSCALE) | |
711 | 746 | M12 = M21 = cos(sig12 / dnm); |
712 | 747 | a12 = sig12 / degree; |
713 | 748 | omg12 = lam12 / (g->f1 * dnm); |
738 | 773 | &eps, &omg12, numit < maxit1, &dv, C1a, C2a, C3a) |
739 | 774 | - lam12); |
740 | 775 | /* 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; | |
742 | 778 | /* 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; } | |
748 | 783 | if (numit < maxit1 && dv > 0) { |
749 | 784 | real |
750 | 785 | dalp1 = -v/dv; |
781 | 816 | real dummy; |
782 | 817 | Lengths(g, eps, sig12, ssig1, csig1, dn1, ssig2, csig2, dn2, |
783 | 818 | cbet1, cbet2, &s12x, &m12x, &dummy, |
784 | (outmask & GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a); | |
819 | (outmask & GEOD_GEODESICSCALE) != 0U, &M12, &M21, C1a, C2a); | |
785 | 820 | } |
786 | 821 | m12x *= g->b; |
787 | 822 | s12x *= g->b; |
790 | 825 | } |
791 | 826 | } |
792 | 827 | |
793 | if (outmask & DISTANCE) | |
828 | if (outmask & GEOD_DISTANCE) | |
794 | 829 | s12 = 0 + s12x; /* Convert -0 to 0 */ |
795 | 830 | |
796 | if (outmask & REDUCEDLENGTH) | |
831 | if (outmask & GEOD_REDUCEDLENGTH) | |
797 | 832 | m12 = 0 + m12x; /* Convert -0 to 0 */ |
798 | 833 | |
799 | if (outmask & AREA) { | |
834 | if (outmask & GEOD_AREA) { | |
800 | 835 | real |
801 | 836 | /* From Lambda12: sin(alp1) * cos(bet1) = sin(alp0) */ |
802 | 837 | salp0 = salp1 * cbet1, |
859 | 894 | if (swapp < 0) { |
860 | 895 | swapx(&salp1, &salp2); |
861 | 896 | swapx(&calp1, &calp2); |
862 | if (outmask & GEODESICSCALE) | |
897 | if (outmask & GEOD_GEODESICSCALE) | |
863 | 898 | swapx(&M12, &M21); |
864 | 899 | } |
865 | 900 | |
866 | 901 | salp1 *= swapp * lonsign; calp1 *= swapp * latsign; |
867 | 902 | salp2 *= swapp * lonsign; calp2 *= swapp * latsign; |
868 | 903 | |
869 | if (outmask & AZIMUTH) { | |
904 | if (outmask & GEOD_AZIMUTH) { | |
870 | 905 | /* minus signs give range [-180, 180). 0- converts -0 to +0. */ |
871 | 906 | azi1 = 0 - atan2(-salp1, calp1) / degree; |
872 | 907 | azi2 = 0 - atan2(-salp2, calp2) / degree; |
873 | 908 | } |
874 | 909 | |
875 | if (outmask & DISTANCE) | |
910 | if (outmask & GEOD_DISTANCE) | |
876 | 911 | *ps12 = s12; |
877 | if (outmask & AZIMUTH) { | |
912 | if (outmask & GEOD_AZIMUTH) { | |
878 | 913 | if (pazi1) *pazi1 = azi1; |
879 | 914 | if (pazi2) *pazi2 = azi2; |
880 | 915 | } |
881 | if (outmask & REDUCEDLENGTH) | |
916 | if (outmask & GEOD_REDUCEDLENGTH) | |
882 | 917 | *pm12 = m12; |
883 | if (outmask & GEODESICSCALE) { | |
918 | if (outmask & GEOD_GEODESICSCALE) { | |
884 | 919 | if (pM12) *pM12 = M12; |
885 | 920 | if (pM21) *pM21 = M21; |
886 | 921 | } |
887 | if (outmask & AREA) | |
922 | if (outmask & GEOD_AREA) | |
888 | 923 | *pS12 = S12; |
889 | 924 | |
890 | 925 | /* Returned value in [0, 180] */ |
891 | 926 | return a12; |
892 | 927 | } |
893 | 928 | |
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) { | |
903 | 936 | /* Evaluate |
904 | 937 | * y = sinp ? sum(c[i] * sin( 2*i * x), i, 1, n) : |
905 | 938 | * sum(c[i] * cos((2*i+1) * x), i, 0, n-1) |
921 | 954 | : cosx * (y0 - y1); /* cos(x) * (y0 - y1) */ |
922 | 955 | } |
923 | 956 | |
924 | void Lengths(const struct Geodesic* g, | |
957 | void Lengths(const struct geod_geodesic* g, | |
925 | 958 | real eps, real sig12, |
926 | 959 | real ssig1, real csig1, real dn1, |
927 | 960 | real ssig2, real csig2, real dn2, |
1018 | 1051 | return k; |
1019 | 1052 | } |
1020 | 1053 | |
1021 | real InverseStart(const struct Geodesic* g, | |
1054 | real InverseStart(const struct geod_geodesic* g, | |
1022 | 1055 | real sbet1, real cbet1, real dn1, |
1023 | 1056 | real sbet2, real cbet2, real dn2, |
1024 | 1057 | real lam12, |
1025 | 1058 | real* psalp1, real* pcalp1, |
1026 | 1059 | /* Only updated if return val >= 0 */ |
1027 | 1060 | real* psalp2, real* pcalp2, |
1061 | /* Only updated for short lines */ | |
1062 | real* pdnm, | |
1028 | 1063 | /* Scratch areas of the right size */ |
1029 | 1064 | 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; | |
1031 | 1066 | |
1032 | 1067 | /* Return a starting point for Newton's method in salp1 and calp1 (function |
1033 | 1068 | * value is -1). If Newton's method doesn't need to be used, return also |
1055 | 1090 | real sbet12a = sbet2 * cbet1 + cbet2 * sbet1; |
1056 | 1091 | #endif |
1057 | 1092 | 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); | |
1063 | 1104 | |
1064 | 1105 | salp1 = cbet2 * somg12; |
1065 | 1106 | calp1 = comg12 >= 0 ? |
1072 | 1113 | if (shortline && ssig12 < g->etol2) { |
1073 | 1114 | /* really short lines */ |
1074 | 1115 | 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); | |
1076 | 1118 | SinCosNorm(&salp2, &calp2); |
1077 | 1119 | /* Set return value */ |
1078 | 1120 | sig12 = atan2(ssig12, csig12); |
1179 | 1221 | |
1180 | 1222 | *psalp1 = salp1; |
1181 | 1223 | *pcalp1 = calp1; |
1224 | if (shortline) | |
1225 | *pdnm = dnm; | |
1182 | 1226 | if (sig12 >= 0) { |
1183 | 1227 | *psalp2 = salp2; |
1184 | 1228 | *pcalp2 = calp2; |
1186 | 1230 | return sig12; |
1187 | 1231 | } |
1188 | 1232 | |
1189 | real Lambda12(const struct Geodesic* g, | |
1233 | real Lambda12(const struct geod_geodesic* g, | |
1190 | 1234 | real sbet1, real cbet1, real dn1, |
1191 | 1235 | real sbet2, real cbet2, real dn2, |
1192 | 1236 | real salp1, real calp1, |
1285 | 1329 | return lam12; |
1286 | 1330 | } |
1287 | 1331 | |
1288 | real A3f(const struct Geodesic* g, real eps) { | |
1332 | real A3f(const struct geod_geodesic* g, real eps) { | |
1289 | 1333 | /* Evaluate sum(A3x[k] * eps^k, k, 0, nA3x-1) by Horner's method */ |
1290 | 1334 | real v = 0; |
1291 | 1335 | int i; |
1294 | 1338 | return v; |
1295 | 1339 | } |
1296 | 1340 | |
1297 | void C3f(const struct Geodesic* g, real eps, real c[]) { | |
1341 | void C3f(const struct geod_geodesic* g, real eps, real c[]) { | |
1298 | 1342 | /* Evaluate C3 coeffs by Horner's method |
1299 | 1343 | * Elements c[1] thru c[nC3 - 1] are set */ |
1300 | 1344 | int i, j, k; |
1312 | 1356 | } |
1313 | 1357 | } |
1314 | 1358 | |
1315 | void C4f(const struct Geodesic* g, real eps, real c[]) { | |
1359 | void C4f(const struct geod_geodesic* g, real eps, real c[]) { | |
1316 | 1360 | /* Evaluate C4 coeffs by Horner's method |
1317 | 1361 | * Elements c[0] thru c[nC4 - 1] are set */ |
1318 | 1362 | int i, j, k; |
1403 | 1447 | } |
1404 | 1448 | |
1405 | 1449 | /* The scale factor A3 = mean value of (d/dsigma)I3 */ |
1406 | void A3coeff(struct Geodesic* g) { | |
1450 | void A3coeff(struct geod_geodesic* g) { | |
1407 | 1451 | g->A3x[0] = 1; |
1408 | 1452 | g->A3x[1] = (g->n-1)/2; |
1409 | 1453 | g->A3x[2] = (g->n*(3*g->n-1)-2)/8; |
1413 | 1457 | } |
1414 | 1458 | |
1415 | 1459 | /* The coefficients C3[l] in the Fourier expansion of B3 */ |
1416 | void C3coeff(struct Geodesic* g) { | |
1460 | void C3coeff(struct geod_geodesic* g) { | |
1417 | 1461 | g->C3x[0] = (1-g->n)/4; |
1418 | 1462 | g->C3x[1] = (1-g->n*g->n)/8; |
1419 | 1463 | g->C3x[2] = ((3-g->n)*g->n+3)/64; |
1434 | 1478 | /* Generated by Maxima on 2012-10-19 08:02:34-04:00 */ |
1435 | 1479 | |
1436 | 1480 | /* The coefficients C4[l] in the Fourier expansion of I4 */ |
1437 | void C4coeff(struct Geodesic* g) { | |
1481 | void C4coeff(struct geod_geodesic* g) { | |
1438 | 1482 | g->C4x[0] = (g->n*(g->n*(g->n*(g->n*(100*g->n+208)+572)+3432)-12012)+30030)/ |
1439 | 1483 | 45045; |
1440 | 1484 | g->C4x[1] = (g->n*(g->n*(g->n*(64*g->n+624)-4576)+6864)-3003)/15015; |
1458 | 1502 | g->C4x[19] = -128/(real)(135135); |
1459 | 1503 | g->C4x[20] = 128/(real)(99099); |
1460 | 1504 | } |
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 | * . | |
9 | 14 | * The principal advantages of these algorithms over previous ones (e.g., |
10 | 15 | * 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>| < 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. | |
19 | 24 | * |
20 | 25 | * 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>| < 1/50; for the | |
36 | * WGS84 ellipsoid, the errors are less than 15 nanometers. (Reasonably | |
37 | * accurate results are obtained for |<i>f</i>| < 1/5.) For a prolate | |
38 | * ellipsoid, specify \e f < 0. | |
35 | 39 | * |
36 | 40 | * 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°. | |
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 − (1 − \e M12 \e M21) \e | |
69 | * m23 / \e m12 | |
70 | * - \e M31 = \e M32 \e M21 − (1 − \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 = −\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 | * −\e S12. (This occurs when the longitude difference is near | |
82 | * ±180° for oblate ellipsoids.) | |
83 | * - \e lon2 = \e lon1 ± 180° (with neither at a pole). If | |
84 | * \e azi1 = 0° or ±180°, the geodesic is unique. | |
85 | * Otherwise there are two geodesics and the second one is obtained by | |
86 | * setting [\e azi1, \e azi2] = [−\e azi1, −\e azi2], \e | |
87 | * S12 = −\e S12. (This occurs when the \e lat2 is near | |
88 | * −\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, −\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 | |
130 | 111 | * under the MIT/X11 License. For more information, see |
131 | 112 | * http://geographiclib.sourceforge.net/ |
132 | 113 | * |
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 | **********************************************************************/ | |
135 | 117 | |
136 | 118 | #if !defined(GEODESIC_H) |
137 | 119 | #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 | |
138 | 136 | |
139 | 137 | #if defined(__cplusplus) |
140 | 138 | extern "C" { |
141 | 139 | #endif |
142 | 140 | |
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; | |
145 | 150 | double A3x[6], C3x[15], C4x[21]; |
151 | /**< @endcond */ | |
146 | 152 | }; |
147 | 153 | |
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, | |
151 | 166 | salp1, calp1, ssig1, csig1, dn1, stau1, ctau1, somg1, comg1, |
152 | 167 | A1m1, A2m1, A3c, B11, B21, B31, A4, B41; |
153 | 168 | double C1a[6+1], C1pa[6+1], C2a[6+1], C3a[6], C4a[6]; |
154 | unsigned caps; | |
169 | /**< @endcond */ | |
170 | unsigned caps; /**< the capabilities */ | |
155 | 171 | }; |
156 | 172 | |
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 [−90°, 90°]; \e lon1 and \e azi1 | |
217 | * should be in the range [−540°, 540°). | |
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 [−90°, 90°]; \e lon1 and \e azi1 | |
258 | * should be in the range [−540°, 540°). The values of \e lon2 | |
259 | * and \e azi2 returned are in the range [−180°, 180°). 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 = ±(90° − ε), and | |
265 | * taking the limit ε → 0+. An arc length greater that 180° | |
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°.) | |
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 [−90°, 90°]; \e lon1 and | |
299 | * \e lon2 should be in the range [−540°, 540°). The values of | |
300 | * \e azi1 and \e azi2 returned are in the range [−180°, 180°). | |
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 = ±(90° − ε), and | |
306 | * taking the limit ε → 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, | |
178 | 323 | 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 [−180°, 180°). 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 [−90°, 90°]; \e lon1 and \e azi1 | |
404 | * should be in the range [−540°, 540°). 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 [−90°, 90°]; \e lon1 and | |
440 | * \e lon2 should be in the range [−540°, 540°). 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 [−180°, 180°). 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 | * [−90°, 90°] and \e lon should be in the range | |
547 | * [−540°, 540°). | |
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 | * [−540°, 540°). 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°N,0°E), (0°N,90°E), (90°N,0°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 [−90°, 90°] and \e | |
646 | * lon should be in the range [−540°, 540°). | |
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 [−540°, 540°). | |
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 [−90°, 90°]; \e lons should | |
699 | * be in the range [−540°, 540°). | |
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 */ | |
199 | 738 | }; |
200 | 739 | |
201 | 740 | #if defined(__cplusplus) |
0 | 0 | #include <projects.h> |
1 | static void /* sum coefficients less than res */ | |
1 | static void /* sum coefficients less than res */ | |
2 | 2 | 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; | |
6 | 6 | |
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 | } | |
15 | 15 | } |
16 | static Tseries * /* create power series structure */ | |
16 | static Tseries * /* create power series structure */ | |
17 | 17 | makeT(int nru, int nrv) { |
18 | Tseries *T; | |
19 | int i; | |
18 | Tseries *T; | |
19 | int i; | |
20 | 20 | |
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; | |
33 | 33 | } |
34 | Tseries * | |
34 | Tseries * | |
35 | 35 | 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; | |
41 | 41 | |
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; | |
49 | 49 | |
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; | |
160 | 176 | } |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Load datum shift files into memory. |
81 | 81 | /* Load the data portion of a ctable formatted grid. */ |
82 | 82 | /************************************************************************/ |
83 | 83 | |
84 | int nad_ctable_load( projCtx ctx, struct CTABLE *ct, FILE *fid ) | |
84 | int nad_ctable_load( projCtx ctx, struct CTABLE *ct, PAFile fid ) | |
85 | 85 | |
86 | 86 | { |
87 | 87 | int a_size; |
88 | 88 | |
89 | fseek( fid, sizeof(struct CTABLE), SEEK_SET ); | |
89 | pj_ctx_fseek( ctx, fid, sizeof(struct CTABLE), SEEK_SET ); | |
90 | 90 | |
91 | 91 | /* read all the actual shift values */ |
92 | 92 | a_size = ct->lim.lam * ct->lim.phi; |
93 | 93 | ct->cvs = (FLP *) pj_malloc(sizeof(FLP) * a_size); |
94 | 94 | 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 ) | |
96 | 96 | { |
97 | 97 | pj_dalloc( ct->cvs ); |
98 | 98 | ct->cvs = NULL; |
112 | 112 | /* Read the header portion of a "ctable" format grid. */ |
113 | 113 | /************************************************************************/ |
114 | 114 | |
115 | struct CTABLE *nad_ctable_init( projCtx ctx, FILE * fid ) | |
115 | struct CTABLE *nad_ctable_init( projCtx ctx, PAFile fid ) | |
116 | 116 | { |
117 | 117 | struct CTABLE *ct; |
118 | 118 | int id_end; |
120 | 120 | /* read the table header */ |
121 | 121 | ct = (struct CTABLE *) pj_malloc(sizeof(struct CTABLE)); |
122 | 122 | if( ct == NULL |
123 | || fread( ct, sizeof(struct CTABLE), 1, fid ) != 1 ) | |
123 | || pj_ctx_fread( ctx, ct, sizeof(struct CTABLE), 1, fid ) != 1 ) | |
124 | 124 | { |
125 | 125 | pj_ctx_set_errno( ctx, -38 ); |
126 | 126 | return NULL; |
154 | 154 | /* Load the data portion of a ctable2 formatted grid. */ |
155 | 155 | /************************************************************************/ |
156 | 156 | |
157 | int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, FILE *fid ) | |
157 | int nad_ctable2_load( projCtx ctx, struct CTABLE *ct, PAFile fid ) | |
158 | 158 | |
159 | 159 | { |
160 | 160 | int a_size; |
161 | 161 | |
162 | fseek( fid, 160, SEEK_SET ); | |
162 | pj_ctx_fseek( ctx, fid, 160, SEEK_SET ); | |
163 | 163 | |
164 | 164 | /* read all the actual shift values */ |
165 | 165 | a_size = ct->lim.lam * ct->lim.phi; |
166 | 166 | ct->cvs = (FLP *) pj_malloc(sizeof(FLP) * a_size); |
167 | 167 | 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 ) | |
169 | 169 | { |
170 | 170 | pj_dalloc( ct->cvs ); |
171 | 171 | ct->cvs = NULL; |
194 | 194 | /* Read the header portion of a "ctable2" format grid. */ |
195 | 195 | /************************************************************************/ |
196 | 196 | |
197 | struct CTABLE *nad_ctable2_init( projCtx ctx, FILE * fid ) | |
197 | struct CTABLE *nad_ctable2_init( projCtx ctx, PAFile fid ) | |
198 | 198 | { |
199 | 199 | struct CTABLE *ct; |
200 | 200 | int id_end; |
201 | 201 | char header[160]; |
202 | 202 | |
203 | if( fread( header, sizeof(header), 1, fid ) != 1 ) | |
203 | if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 ) | |
204 | 204 | { |
205 | 205 | pj_ctx_set_errno( ctx, -38 ); |
206 | 206 | return NULL; |
267 | 267 | { |
268 | 268 | char fname[MAX_PATH_FILENAME+1]; |
269 | 269 | struct CTABLE *ct; |
270 | FILE *fid; | |
270 | PAFile fid; | |
271 | 271 | |
272 | 272 | ctx->last_errno = 0; |
273 | 273 | |
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
292 | fclose(fid); | |
292 | pj_ctx_fclose(ctx, fid); | |
293 | 293 | return ct; |
294 | 294 | } |
295 | 295 |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Apply datum shifts based on grid shift files (normally NAD27 to |
155 | 155 | continue; |
156 | 156 | |
157 | 157 | /* If we have child nodes, check to see if any of them apply. */ |
158 | if( gi->child != NULL ) | |
158 | while( gi->child ) | |
159 | 159 | { |
160 | 160 | PJ_GRIDINFO *child; |
161 | 161 | |
176 | 176 | break; |
177 | 177 | } |
178 | 178 | |
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; | |
185 | 187 | } |
186 | 188 | |
187 | 189 | /* load the grid shift info if we don't have it. */ |
100 | 100 | continue; |
101 | 101 | |
102 | 102 | /* If we have child nodes, check to see if any of them apply. */ |
103 | if( gi->child != NULL ) | |
103 | while( gi->child != NULL ) | |
104 | 104 | { |
105 | 105 | PJ_GRIDINFO *child; |
106 | 106 | |
116 | 116 | break; |
117 | 117 | } |
118 | 118 | |
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 ) | |
121 | 121 | { |
122 | gi = child; | |
123 | ct = child->ct; | |
122 | break; | |
124 | 123 | } |
124 | ||
125 | /* Otherwise let's try for childrens children .. */ | |
126 | gi = child; | |
127 | ct = child->ct; | |
125 | 128 | } |
126 | 129 | |
127 | 130 | /* load the grid shift info if we don't have it. */ |
32 | 32 | PJ_CVSID("$Id$"); |
33 | 33 | |
34 | 34 | static projCtx_t default_context; |
35 | static int default_context_initialized = 0; | |
35 | static volatile int default_context_initialized = 0; | |
36 | 36 | |
37 | 37 | /************************************************************************/ |
38 | 38 | /* pj_get_ctx() */ |
67 | 67 | |
68 | 68 | if( !default_context_initialized ) |
69 | 69 | { |
70 | default_context_initialized = 1; | |
71 | 70 | default_context.last_errno = 0; |
72 | 71 | default_context.debug_level = PJ_LOG_NONE; |
73 | 72 | default_context.logger = pj_stderr_logger; |
74 | 73 | default_context.app_data = NULL; |
74 | default_context.fileapi = pj_get_default_fileapi(); | |
75 | 75 | |
76 | 76 | if( getenv("PROJ_DEBUG") != NULL ) |
77 | 77 | { |
80 | 80 | else |
81 | 81 | default_context.debug_level = PJ_LOG_DEBUG_MINOR; |
82 | 82 | } |
83 | default_context_initialized = 1; | |
83 | 84 | } |
84 | 85 | |
85 | 86 | pj_release_lock(); |
175 | 176 | return ctx->app_data; |
176 | 177 | } |
177 | 178 | |
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 |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Built in datum list. |
48 | 48 | "clrk66", |
49 | 49 | "North_American_Datum_1927", |
50 | 50 | "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", | |
53 | 53 | "ire65", "towgs84=482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15", "mod_airy", "Ireland 1965", |
54 | 54 | "nzgd49", "towgs84=59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993", "intl", "New Zealand Geodetic Datum 1949", |
55 | 55 | "OSGB36", "towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894", "airy", "Airy 1830", |
18 | 18 | /* check for varying forms of ellipsoid input */ |
19 | 19 | *a = *es = 0.; |
20 | 20 | /* 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; | |
23 | 23 | else { /* probable elliptical figure */ |
24 | 24 | |
25 | 25 | /* 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) { | |
27 | 27 | char *s; |
28 | 28 | |
29 | 29 | for (start = pl; start && start->next ; start = start->next) ; |
33 | 33 | curr = curr->next = pj_mkparam(pj_ellps[i].major); |
34 | 34 | curr = curr->next = pj_mkparam(pj_ellps[i].ell); |
35 | 35 | } |
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; | |
41 | 41 | *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; | |
44 | 44 | if (!*es) { |
45 | 45 | pj_ctx_set_errno( ctx, -10); |
46 | 46 | goto bomb; |
47 | 47 | } |
48 | 48 | *es = 1./ *es; |
49 | 49 | *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; | |
52 | 52 | *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; | |
55 | 55 | *es = 1. - (b * b) / (*a * *a); |
56 | 56 | } /* else *es == 0. and sphere of radius *a */ |
57 | 57 | if (!b) |
58 | 58 | b = *a * sqrt(1. - *es); |
59 | 59 | /* 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 */ | |
61 | 61 | *a *= 1. - *es * (SIXTH + *es * (RA4 + *es * RA6)); |
62 | 62 | *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 */ | |
64 | 64 | *a *= 1. - *es * (SIXTH + *es * (RV4 + *es * RV6)); |
65 | 65 | *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 */ | |
67 | 67 | *a = .5 * (*a + b); |
68 | 68 | *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 */ | |
70 | 70 | *a = sqrt(*a * b); |
71 | 71 | *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 */ | |
73 | 73 | *a = 2. * *a * b / (*a + b); |
74 | 74 | *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 */ | |
77 | 77 | double tmp; |
78 | 78 | |
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); | |
80 | 80 | if (fabs(tmp) > HALFPI) { |
81 | 81 | pj_ctx_set_errno(ctx,-11); |
82 | 82 | goto bomb; |
18 | 18 | "bess_nam", "a=6377483.865", "rf=299.1528128", "Bessel 1841 (Namibia)", |
19 | 19 | "clrk66", "a=6378206.4", "b=6356583.8", "Clarke 1866", |
20 | 20 | "clrk80", "a=6378249.145", "rf=293.4663", "Clarke 1880 mod.", |
21 | "clrk80ign","a=6378249.2", "rf=293.4660212936269", "Clarke 1880 (IGN).", | |
21 | 22 | "CPM", "a=6375738.7", "rf=334.29", "Comm. des Poids et Mesures 1799", |
22 | 23 | "delmbr", "a=6376428.", "rf=311.5", "Delambre 1810 (Belgium)", |
23 | 24 | "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 | } |
30 | 30 | |
31 | 31 | #include <projects.h> |
32 | 32 | #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); | |
35 | 36 | static void pj_gc_sortcatalog( projCtx ctx, PJ_GridCatalog *catalog ); |
36 | 37 | |
37 | 38 | /************************************************************************/ |
42 | 43 | |
43 | 44 | PJ_GridCatalog *pj_gc_readcatalog( projCtx ctx, const char *catalog_name ) |
44 | 45 | { |
45 | FILE *fp; | |
46 | PAFile fid; | |
46 | 47 | PJ_GridCatalog *catalog; |
47 | int entry_max, err; | |
48 | int entry_max; | |
48 | 49 | char line[302]; |
49 | 50 | |
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) | |
52 | 53 | return NULL; |
53 | 54 | |
54 | 55 | /* discard title line */ |
55 | fgets(line, sizeof(line)-1, fp); | |
56 | pj_ctx_fgets(ctx, line, sizeof(line)-1, fid); | |
56 | 57 | |
57 | 58 | catalog = (PJ_GridCatalog *) calloc(1,sizeof(PJ_GridCatalog)); |
58 | 59 | if( !catalog ) |
64 | 65 | catalog->entries = (PJ_GridCatalogEntry *) |
65 | 66 | malloc(entry_max * sizeof(PJ_GridCatalogEntry)); |
66 | 67 | |
67 | while( pj_gc_readentry( ctx, fp, | |
68 | while( pj_gc_readentry( ctx, fid, | |
68 | 69 | catalog->entries+catalog->entry_count) == 0) |
69 | 70 | { |
70 | 71 | catalog->entry_count++; |
104 | 105 | /* token count. */ |
105 | 106 | /************************************************************************/ |
106 | 107 | |
107 | static int pj_gc_read_csv_line( projCtx ctx, FILE *fp, | |
108 | static int pj_gc_read_csv_line( projCtx ctx, PAFile fid, | |
108 | 109 | char **tokens, int max_tokens ) |
109 | 110 | { |
110 | 111 | char line[302]; |
111 | 112 | |
112 | while( fgets(line, sizeof(line)-1, fp) != NULL ) | |
113 | while( pj_ctx_fgets(ctx, line, sizeof(line)-1, fid) != NULL ) | |
113 | 114 | { |
114 | 115 | char *next = line; |
115 | 116 | int token_count = 0; |
179 | 180 | /* gridname,ll_long,ll_lat,ur_long,ur_lat,priority,date */ |
180 | 181 | /************************************************************************/ |
181 | 182 | |
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) | |
183 | 184 | { |
184 | 185 | #define MAX_TOKENS 30 |
185 | 186 | char *tokens[MAX_TOKENS]; |
188 | 189 | |
189 | 190 | memset( entry, 0, sizeof(PJ_GridCatalogEntry) ); |
190 | 191 | |
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 ); | |
192 | 193 | if( token_count < 5 ) |
193 | 194 | { |
194 | 195 | error = 1; /* TODO: need real error codes */ |
118 | 118 | { |
119 | 119 | long io = i * point_offset; |
120 | 120 | LP input, output_after, output_before; |
121 | int itable; | |
122 | 121 | double mix_ratio; |
123 | 122 | PJ_GRIDINFO *gi; |
124 | 123 |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Functions for handling individual PJ_GRIDINFO's. Includes |
40 | 40 | * TODO - mloskot: re-implement porting friendly assert |
41 | 41 | */ |
42 | 42 | # define assert(exp) ((void)0) |
43 | #else | |
43 | #else/ | |
44 | 44 | # include <assert.h> |
45 | 45 | #endif /* _WIN32_WCE */ |
46 | 46 | |
61 | 61 | for( word = 0; word < word_count; word++ ) |
62 | 62 | { |
63 | 63 | int i; |
64 | ||
64 | ||
65 | 65 | for( i = 0; i < word_size/2; i++ ) |
66 | 66 | { |
67 | 67 | int t; |
68 | ||
68 | ||
69 | 69 | t = data[i]; |
70 | 70 | data[i] = data[word_size-i-1]; |
71 | 71 | data[word_size-i-1] = t; |
72 | 72 | } |
73 | ||
73 | ||
74 | 74 | data += word_size; |
75 | 75 | } |
76 | 76 | } |
98 | 98 | |
99 | 99 | if( gi->ct != NULL ) |
100 | 100 | nad_free( gi->ct ); |
101 | ||
101 | ||
102 | 102 | free( gi->gridname ); |
103 | 103 | if( gi->filename != NULL ) |
104 | 104 | free( gi->filename ); |
117 | 117 | int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi ) |
118 | 118 | |
119 | 119 | { |
120 | struct CTABLE ct_tmp; | |
121 | ||
120 | 122 | if( gi == NULL || gi->ct == NULL ) |
121 | 123 | return 0; |
122 | 124 | |
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 | ||
123 | 134 | /* -------------------------------------------------------------------- */ |
124 | 135 | /* Original platform specific CTable format. */ |
125 | 136 | /* -------------------------------------------------------------------- */ |
126 | 137 | if( strcmp(gi->format,"ctable") == 0 ) |
127 | 138 | { |
128 | FILE *fid; | |
139 | PAFile fid; | |
129 | 140 | int result; |
130 | 141 | |
131 | 142 | fid = pj_open_lib( ctx, gi->filename, "rb" ); |
132 | ||
143 | ||
133 | 144 | if( fid == NULL ) |
134 | 145 | { |
135 | 146 | 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(); | |
142 | 157 | |
143 | 158 | return result; |
144 | 159 | } |
148 | 163 | /* -------------------------------------------------------------------- */ |
149 | 164 | else if( strcmp(gi->format,"ctable2") == 0 ) |
150 | 165 | { |
151 | FILE *fid; | |
166 | PAFile fid; | |
152 | 167 | int result; |
153 | 168 | |
154 | 169 | fid = pj_open_lib( ctx, gi->filename, "rb" ); |
155 | ||
170 | ||
156 | 171 | if( fid == NULL ) |
157 | 172 | { |
158 | 173 | 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(); | |
166 | 185 | return result; |
167 | 186 | } |
168 | 187 | |
177 | 196 | { |
178 | 197 | double *row_buf; |
179 | 198 | int row; |
180 | FILE *fid; | |
199 | PAFile fid; | |
181 | 200 | |
182 | 201 | fid = pj_open_lib( ctx, gi->filename, "rb" ); |
183 | ||
202 | ||
184 | 203 | if( fid == NULL ) |
185 | 204 | { |
186 | 205 | 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 ); | |
191 | 211 | |
192 | 212 | 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 | ||
200 | 221 | for( row = 0; row < gi->ct->lim.phi; row++ ) |
201 | 222 | { |
202 | 223 | int i; |
203 | 224 | FLP *cvs; |
204 | 225 | double *diff_seconds; |
205 | 226 | |
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 ) | |
207 | 229 | != 2 * gi->ct->lim.lam ) |
208 | 230 | { |
209 | 231 | pj_dalloc( row_buf ); |
210 | pj_dalloc( gi->ct->cvs ); | |
232 | pj_dalloc( ct_tmp.cvs ); | |
211 | 233 | pj_ctx_set_errno( ctx, -38 ); |
212 | 234 | return 0; |
213 | 235 | } |
220 | 242 | |
221 | 243 | for( i = 0; i < gi->ct->lim.lam; i++ ) |
222 | 244 | { |
223 | cvs = gi->ct->cvs + (row) * gi->ct->lim.lam | |
245 | cvs = ct_tmp.cvs + (row) * gi->ct->lim.lam | |
224 | 246 | + (gi->ct->lim.lam - i - 1); |
225 | 247 | |
226 | 248 | cvs->phi = *(diff_seconds++) * ((PI/180.0) / 3600.0); |
230 | 252 | |
231 | 253 | pj_dalloc( row_buf ); |
232 | 254 | |
233 | fclose( fid ); | |
255 | pj_ctx_fclose( ctx, fid ); | |
256 | ||
257 | gi->ct->cvs = ct_tmp.cvs; | |
258 | pj_release_lock(); | |
234 | 259 | |
235 | 260 | return 1; |
236 | 261 | } |
246 | 271 | { |
247 | 272 | float *row_buf; |
248 | 273 | 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, | |
252 | 277 | "NTv2 - loading grid %s", gi->ct->id ); |
253 | 278 | |
254 | 279 | fid = pj_open_lib( ctx, gi->filename, "rb" ); |
255 | ||
280 | ||
256 | 281 | if( fid == NULL ) |
257 | 282 | { |
258 | 283 | 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 ); | |
263 | 289 | |
264 | 290 | 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 | ||
272 | 299 | for( row = 0; row < gi->ct->lim.phi; row++ ) |
273 | 300 | { |
274 | 301 | int i; |
275 | 302 | FLP *cvs; |
276 | 303 | float *diff_seconds; |
277 | 304 | |
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 ) | |
279 | 307 | != 4 * gi->ct->lim.lam ) |
280 | 308 | { |
281 | 309 | pj_dalloc( row_buf ); |
282 | pj_dalloc( gi->ct->cvs ); | |
283 | gi->ct->cvs = NULL; | |
310 | pj_dalloc( ct_tmp.cvs ); | |
284 | 311 | pj_ctx_set_errno( ctx, -38 ); |
312 | pj_release_lock(); | |
285 | 313 | return 0; |
286 | 314 | } |
287 | 315 | |
288 | 316 | if( !IS_LSB ) |
289 | swap_words( (unsigned char *) row_buf, 4, | |
317 | swap_words( (unsigned char *) row_buf, 4, | |
290 | 318 | gi->ct->lim.lam*4 ); |
291 | 319 | |
292 | 320 | /* convert seconds to radians */ |
294 | 322 | |
295 | 323 | for( i = 0; i < gi->ct->lim.lam; i++ ) |
296 | 324 | { |
297 | cvs = gi->ct->cvs + (row) * gi->ct->lim.lam | |
325 | cvs = ct_tmp.cvs + (row) * gi->ct->lim.lam | |
298 | 326 | + (gi->ct->lim.lam - i - 1); |
299 | 327 | |
300 | 328 | cvs->phi = *(diff_seconds++) * ((PI/180.0) / 3600.0); |
305 | 333 | |
306 | 334 | pj_dalloc( row_buf ); |
307 | 335 | |
308 | fclose( fid ); | |
309 | ||
336 | pj_ctx_fclose( ctx, fid ); | |
337 | ||
338 | gi->ct->cvs = ct_tmp.cvs; | |
339 | ||
340 | pj_release_lock(); | |
310 | 341 | return 1; |
311 | 342 | } |
312 | 343 | |
316 | 347 | else if( strcmp(gi->format,"gtx") == 0 ) |
317 | 348 | { |
318 | 349 | int words = gi->ct->lim.lam * gi->ct->lim.phi; |
319 | FILE *fid; | |
350 | PAFile fid; | |
320 | 351 | |
321 | 352 | fid = pj_open_lib( ctx, gi->filename, "rb" ); |
322 | ||
353 | ||
323 | 354 | if( fid == NULL ) |
324 | 355 | { |
325 | 356 | 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(); | |
342 | 376 | return 0; |
343 | 377 | } |
344 | 378 | |
345 | 379 | 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(); | |
349 | 385 | return 1; |
350 | 386 | } |
351 | 387 | |
352 | 388 | else |
353 | 389 | { |
390 | pj_release_lock(); | |
354 | 391 | return 0; |
355 | 392 | } |
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; | |
356 | 415 | } |
357 | 416 | |
358 | 417 | /************************************************************************/ |
361 | 420 | /* Load a ntv2 (.gsb) file. */ |
362 | 421 | /************************************************************************/ |
363 | 422 | |
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 ) | |
366 | 424 | { |
367 | 425 | unsigned char header[11*16]; |
368 | 426 | int num_subfiles, subfile; |
380 | 438 | /* -------------------------------------------------------------------- */ |
381 | 439 | /* Read the overview header. */ |
382 | 440 | /* -------------------------------------------------------------------- */ |
383 | if( fread( header, sizeof(header), 1, fid ) != 1 ) | |
441 | if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 ) | |
384 | 442 | { |
385 | 443 | pj_ctx_set_errno( ctx, -38 ); |
386 | 444 | return 0; |
418 | 476 | /* -------------------------------------------------------------------- */ |
419 | 477 | /* Read header. */ |
420 | 478 | /* -------------------------------------------------------------------- */ |
421 | if( fread( header, sizeof(header), 1, fid ) != 1 ) | |
479 | if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 ) | |
422 | 480 | { |
423 | 481 | pj_ctx_set_errno( ctx, -38 ); |
424 | 482 | return 0; |
429 | 487 | pj_ctx_set_errno( ctx, -38 ); |
430 | 488 | return 0; |
431 | 489 | } |
432 | ||
490 | ||
433 | 491 | /* -------------------------------------------------------------------- */ |
434 | 492 | /* Byte swap interesting fields if needed. */ |
435 | 493 | /* -------------------------------------------------------------------- */ |
443 | 501 | swap_words( header+8+16*9, 8, 1 ); |
444 | 502 | swap_words( header+8+16*10, 4, 1 ); |
445 | 503 | } |
446 | ||
504 | ||
447 | 505 | /* -------------------------------------------------------------------- */ |
448 | 506 | /* Initialize a corresponding "ct" structure. */ |
449 | 507 | /* -------------------------------------------------------------------- */ |
465 | 523 | |
466 | 524 | pj_log( ctx, PJ_LOG_DEBUG_MINOR, |
467 | 525 | "NTv2 %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n", |
468 | ct->id, | |
526 | ct->id, | |
469 | 527 | ct->lim.lam, ct->lim.phi, |
470 | 528 | ct->ll.lam/3600.0, ct->ll.phi/3600.0, |
471 | 529 | ur.lam/3600.0, ur.phi/3600.0 ); |
472 | ||
530 | ||
473 | 531 | ct->ll.lam *= DEG_TO_RAD/3600.0; |
474 | 532 | ct->ll.phi *= DEG_TO_RAD/3600.0; |
475 | 533 | ct->del.lam *= DEG_TO_RAD/3600.0; |
480 | 538 | { |
481 | 539 | pj_log( ctx, PJ_LOG_ERROR, |
482 | 540 | "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, | |
484 | 542 | ct->lim.lam * ct->lim.phi ); |
485 | 543 | pj_ctx_set_errno( ctx, -38 ); |
486 | 544 | return 0; |
498 | 556 | { |
499 | 557 | gi = (PJ_GRIDINFO *) pj_malloc(sizeof(PJ_GRIDINFO)); |
500 | 558 | memset( gi, 0, sizeof(PJ_GRIDINFO) ); |
501 | ||
559 | ||
502 | 560 | gi->gridname = strdup( gilist->gridname ); |
503 | 561 | gi->filename = strdup( gilist->filename ); |
504 | 562 | gi->next = NULL; |
506 | 564 | |
507 | 565 | gi->ct = ct; |
508 | 566 | gi->format = "ntv2"; |
509 | gi->grid_offset = ftell( fid ); | |
567 | gi->grid_offset = pj_ctx_ftell( ctx, fid ); | |
510 | 568 | |
511 | 569 | /* -------------------------------------------------------------------- */ |
512 | 570 | /* Attach to the correct list or sublist. */ |
525 | 583 | else |
526 | 584 | { |
527 | 585 | 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); | |
533 | 588 | |
534 | 589 | if( gp == NULL ) |
535 | 590 | { |
536 | 591 | pj_log( ctx, PJ_LOG_ERROR, |
537 | 592 | "pj_gridinfo_init_ntv2(): " |
538 | "failed to find parent %8.8s for %s.\n", | |
593 | "failed to find parent %8.8s for %s.\n", | |
539 | 594 | (const char *) header+24, gi->ct->id ); |
540 | 595 | |
541 | for( lnk = gp; lnk->next != NULL; lnk = lnk->next ) {} | |
596 | for( lnk = gilist; lnk->next != NULL; lnk = lnk->next ) {} | |
542 | 597 | lnk->next = gi; |
543 | } | |
544 | else if( gp->child == NULL ) | |
545 | { | |
546 | gp->child = gi; | |
547 | 598 | } |
548 | 599 | else |
549 | 600 | { |
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 | } | |
552 | 610 | } |
553 | 611 | } |
554 | 612 | |
555 | 613 | /* -------------------------------------------------------------------- */ |
556 | 614 | /* Seek past the data. */ |
557 | 615 | /* -------------------------------------------------------------------- */ |
558 | fseek( fid, gs_count * 16, SEEK_CUR ); | |
616 | pj_ctx_fseek( ctx, fid, gs_count * 16, SEEK_CUR ); | |
559 | 617 | } |
560 | 618 | |
561 | 619 | return 1; |
567 | 625 | /* Load an NTv1 style Canadian grid shift file. */ |
568 | 626 | /************************************************************************/ |
569 | 627 | |
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 ) | |
571 | 629 | |
572 | 630 | { |
573 | 631 | unsigned char header[176]; |
574 | 632 | struct CTABLE *ct; |
575 | 633 | LP ur; |
576 | ||
634 | ||
577 | 635 | assert( sizeof(int) == 4 ); |
578 | 636 | assert( sizeof(double) == 8 ); |
579 | 637 | if( sizeof(int) != 4 || sizeof(double) != 8 ) |
587 | 645 | /* -------------------------------------------------------------------- */ |
588 | 646 | /* Read the header. */ |
589 | 647 | /* -------------------------------------------------------------------- */ |
590 | if( fread( header, sizeof(header), 1, fid ) != 1 ) | |
648 | if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 ) | |
591 | 649 | { |
592 | 650 | pj_ctx_set_errno( ctx, -38 ); |
593 | 651 | return 0; |
609 | 667 | |
610 | 668 | if( *((int *) (header+8)) != 12 ) |
611 | 669 | { |
612 | pj_log( ctx, PJ_LOG_ERROR, | |
670 | pj_log( ctx, PJ_LOG_ERROR, | |
613 | 671 | "NTv1 grid shift file has wrong record count, corrupt?" ); |
614 | 672 | pj_ctx_set_errno( ctx, -38 ); |
615 | 673 | return 0; |
642 | 700 | ct->cvs = NULL; |
643 | 701 | |
644 | 702 | gi->ct = ct; |
645 | gi->grid_offset = ftell( fid ); | |
703 | gi->grid_offset = pj_ctx_ftell( ctx, fid ); | |
646 | 704 | gi->format = "ntv1"; |
647 | 705 | |
648 | 706 | return 1; |
654 | 712 | /* Load a NOAA .gtx vertical datum shift file. */ |
655 | 713 | /************************************************************************/ |
656 | 714 | |
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 ) | |
658 | 716 | |
659 | 717 | { |
660 | 718 | unsigned char header[40]; |
675 | 733 | /* -------------------------------------------------------------------- */ |
676 | 734 | /* Read the header. */ |
677 | 735 | /* -------------------------------------------------------------------- */ |
678 | if( fread( header, sizeof(header), 1, fid ) != 1 ) | |
736 | if( pj_ctx_fread( ctx, header, sizeof(header), 1, fid ) != 1 ) | |
679 | 737 | { |
680 | 738 | pj_ctx_set_errno( ctx, -38 ); |
681 | 739 | return 0; |
698 | 756 | memcpy( &rows, header+32, 4 ); |
699 | 757 | memcpy( &columns, header+36, 4 ); |
700 | 758 | |
701 | if( xorigin < -360 || xorigin > 360 | |
759 | if( xorigin < -360 || xorigin > 360 | |
702 | 760 | || yorigin < -90 || yorigin > 90 ) |
703 | 761 | { |
704 | pj_log( ctx, PJ_LOG_ERROR, | |
762 | pj_log( ctx, PJ_LOG_ERROR, | |
705 | 763 | "gtx file header has invalid extents, corrupt?"); |
706 | 764 | pj_ctx_set_errno( ctx, -38 ); |
707 | 765 | return 0; |
721 | 779 | ct->lim.phi = rows; |
722 | 780 | |
723 | 781 | /* 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 | |
725 | 783 | problems with grids spanning the dateline. */ |
726 | 784 | if( ct->ll.lam >= 180.0 ) |
727 | 785 | ct->ll.lam -= 360.0; |
735 | 793 | pj_log( ctx, PJ_LOG_DEBUG_MINOR, |
736 | 794 | "GTX %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)", |
737 | 795 | ct->lim.lam, ct->lim.phi, |
738 | ct->ll.lam, ct->ll.phi, | |
796 | ct->ll.lam, ct->ll.phi, | |
739 | 797 | ct->ll.lam + (columns-1)*xstep, ct->ll.phi + (rows-1)*ystep); |
740 | ||
798 | ||
741 | 799 | ct->ll.lam *= DEG_TO_RAD; |
742 | 800 | ct->ll.phi *= DEG_TO_RAD; |
743 | 801 | ct->del.lam *= DEG_TO_RAD; |
765 | 823 | { |
766 | 824 | char fname[MAX_PATH_FILENAME+1]; |
767 | 825 | PJ_GRIDINFO *gilist; |
768 | FILE *fp; | |
826 | PAFile fp; | |
769 | 827 | char header[160]; |
770 | 828 | |
771 | 829 | errno = pj_errno = 0; |
777 | 835 | /* -------------------------------------------------------------------- */ |
778 | 836 | gilist = (PJ_GRIDINFO *) pj_malloc(sizeof(PJ_GRIDINFO)); |
779 | 837 | memset( gilist, 0, sizeof(PJ_GRIDINFO) ); |
780 | ||
838 | ||
781 | 839 | gilist->gridname = strdup( gridname ); |
782 | 840 | gilist->filename = NULL; |
783 | 841 | gilist->format = "missing"; |
795 | 853 | } |
796 | 854 | |
797 | 855 | gilist->filename = strdup(fname); |
798 | ||
856 | ||
799 | 857 | /* -------------------------------------------------------------------- */ |
800 | 858 | /* Load a header, to determine the file type. */ |
801 | 859 | /* -------------------------------------------------------------------- */ |
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 ); | |
805 | 863 | pj_ctx_set_errno( ctx, -38 ); |
806 | 864 | return gilist; |
807 | 865 | } |
808 | 866 | |
809 | fseek( fp, SEEK_SET, 0 ); | |
867 | pj_ctx_fseek( ctx, fp, SEEK_SET, 0 ); | |
810 | 868 | |
811 | 869 | /* -------------------------------------------------------------------- */ |
812 | 870 | /* Determine file type. */ |
813 | 871 | /* -------------------------------------------------------------------- */ |
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 | |
816 | 874 | && strncmp(header + 144, "TO NAD83 ", 16) == 0 ) |
817 | 875 | { |
818 | 876 | pj_gridinfo_init_ntv1( ctx, fp, gilist ); |
819 | 877 | } |
820 | ||
821 | else if( strncmp(header + 0, "NUM_OREC", 8) == 0 | |
878 | ||
879 | else if( strncmp(header + 0, "NUM_OREC", 8) == 0 | |
822 | 880 | && strncmp(header + 48, "GS_TYPE", 7) == 0 ) |
823 | 881 | { |
824 | 882 | pj_gridinfo_init_ntv2( ctx, fp, gilist ); |
825 | 883 | } |
826 | 884 | |
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 | |
829 | 887 | || strcmp(gridname+strlen(gridname)-3,"GTX") == 0) ) |
830 | 888 | { |
831 | 889 | pj_gridinfo_init_gtx( ctx, fp, gilist ); |
838 | 896 | gilist->format = "ctable2"; |
839 | 897 | gilist->ct = ct; |
840 | 898 | |
841 | pj_log( ctx, PJ_LOG_DEBUG_MAJOR, | |
899 | pj_log( ctx, PJ_LOG_DEBUG_MAJOR, | |
842 | 900 | "Ctable2 %s %dx%d: LL=(%.9g,%.9g) UR=(%.9g,%.9g)\n", |
843 | ct->id, | |
901 | ct->id, | |
844 | 902 | ct->lim.lam, ct->lim.phi, |
845 | 903 | 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, | |
847 | 905 | (ct->ll.phi + (ct->lim.phi-1)*ct->del.phi) * RAD_TO_DEG ); |
848 | 906 | } |
849 | 907 | |
850 | 908 | else |
851 | 909 | { |
852 | 910 | 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); | |
867 | 931 | |
868 | 932 | return gilist; |
869 | 933 | } |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Initialize projection object from string definition. Includes |
34 | 34 | #include <string.h> |
35 | 35 | #include <errno.h> |
36 | 36 | #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 | } | |
39 | 94 | |
40 | 95 | /************************************************************************/ |
41 | 96 | /* get_opt() */ |
42 | 97 | /************************************************************************/ |
43 | 98 | 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; | |
47 | 112 | |
48 | 113 | len = strlen(name); |
49 | 114 | *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) | |
59 | 146 | 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] == '>') | |
71 | 151 | { |
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 | } | |
76 | 211 | |
77 | 212 | if (errno == 25) |
78 | 213 | errno = 0; |
214 | ||
215 | free(state); | |
216 | ||
79 | 217 | return next; |
80 | 218 | } |
81 | 219 | |
84 | 222 | /************************************************************************/ |
85 | 223 | static paralist * |
86 | 224 | get_defaults(projCtx ctx, paralist **start, paralist *next, char *name) { |
87 | FILE *fid; | |
225 | PAFile fid; | |
88 | 226 | |
89 | 227 | 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); | |
94 | 232 | } |
95 | 233 | if (errno) |
96 | 234 | errno = 0; /* don't care if can't open file */ |
103 | 241 | /* get_init() */ |
104 | 242 | /************************************************************************/ |
105 | 243 | 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) { | |
107 | 246 | char fname[MAX_PATH_FILENAME+ID_TAG_MAX+3], *opt; |
108 | FILE *fid; | |
247 | PAFile fid; | |
109 | 248 | paralist *init_items = NULL; |
110 | 249 | const paralist *orig_next = next; |
111 | 250 | |
121 | 260 | next->next = init_items; |
122 | 261 | while( next->next != NULL ) |
123 | 262 | next = next->next; |
263 | *found_def = 1; | |
124 | 264 | return next; |
125 | 265 | } |
126 | 266 | |
132 | 272 | else { pj_ctx_set_errno(ctx,-3); return NULL; } |
133 | 273 | |
134 | 274 | 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); | |
136 | 276 | else |
137 | 277 | return NULL; |
138 | (void)fclose(fid); | |
278 | pj_ctx_fclose(ctx, fid); | |
139 | 279 | if (errno == 25) |
140 | 280 | errno = 0; /* unknown problem with some sys errno<-25 */ |
141 | 281 | |
256 | 396 | ctx->last_errno = 0; |
257 | 397 | start = NULL; |
258 | 398 | |
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 | */ | |
259 | 404 | old_locale = setlocale(LC_NUMERIC, NULL); |
260 | 405 | if (old_locale != NULL) { |
261 | 406 | if (strcmp(old_locale,"C") != 0) { |
277 | 422 | /* check if +init present */ |
278 | 423 | if (pj_param(ctx, start, "tinit").i) { |
279 | 424 | 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))) | |
282 | 430 | 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; } | |
284 | 432 | } |
285 | 433 | |
286 | 434 | /* find projection selection */ |
15 | 15 | PROJ_HEAD(bipc, "Bipolar conic of western hemisphere") |
16 | 16 | PROJ_HEAD(boggs, "Boggs Eumorphic") |
17 | 17 | PROJ_HEAD(bonne, "Bonne (Werner lat_1=90)") |
18 | PROJ_HEAD(calcofi, "Cal Coop Ocean Fish Invest Lines/Stations") | |
18 | 19 | PROJ_HEAD(cass, "Cassini") |
19 | 20 | PROJ_HEAD(cc, "Central Cylindrical") |
20 | 21 | PROJ_HEAD(cea, "Equal Area Cylindrical") |
105 | 106 | PROJ_HEAD(putp6, "Putnins P6") |
106 | 107 | PROJ_HEAD(putp6p, "Putnins P6'") |
107 | 108 | PROJ_HEAD(qua_aut, "Quartic Authalic") |
109 | PROJ_HEAD(qsc, "Quadrilateralized Spherical Cube") | |
108 | 110 | PROJ_HEAD(robin, "Robinson") |
109 | 111 | PROJ_HEAD(rouss, "Roussilhe Stereographic") |
110 | 112 | PROJ_HEAD(rpoly, "Rectangular Polyconic") |
46 | 46 | # define MUTEX_stub |
47 | 47 | #endif |
48 | 48 | |
49 | static void pj_init_lock(); | |
50 | ||
51 | 49 | /************************************************************************/ |
52 | 50 | /* ==================================================================== */ |
53 | 51 | /* stub mutex implementation */ |
95 | 93 | |
96 | 94 | #include "pthread.h" |
97 | 95 | |
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; | |
99 | 99 | |
100 | 100 | /************************************************************************/ |
101 | 101 | /* pj_acquire_lock() */ |
105 | 105 | |
106 | 106 | void pj_acquire_lock() |
107 | 107 | { |
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 | ||
108 | 131 | pthread_mutex_lock( &pj_core_lock); |
109 | 132 | } |
110 | 133 | |
139 | 162 | #include <windows.h> |
140 | 163 | |
141 | 164 | 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 | } | |
142 | 176 | |
143 | 177 | /************************************************************************/ |
144 | 178 | /* pj_acquire_lock() */ |
180 | 214 | } |
181 | 215 | } |
182 | 216 | |
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 | ||
194 | 217 | #endif // def MUTEX_win32 |
195 |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Implementation of pj_open_lib(), and pj_set_finder(). These |
35 | 35 | #include <string.h> |
36 | 36 | #include <errno.h> |
37 | 37 | |
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 $"); | |
39 | 39 | |
40 | 40 | static const char *(*pj_finder)(const char *) = NULL; |
41 | 41 | static int path_count = 0; |
97 | 97 | /* pj_open_lib() */ |
98 | 98 | /************************************************************************/ |
99 | 99 | |
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) { | |
102 | 102 | char fname[MAX_PATH_FILENAME+1]; |
103 | 103 | const char *sysname; |
104 | FILE *fid; | |
104 | PAFile fid; | |
105 | 105 | int n = 0; |
106 | 106 | int i; |
107 | 107 | #ifdef WIN32 |
144 | 144 | } else /* just try it bare bones */ |
145 | 145 | sysname = name; |
146 | 146 | |
147 | if ((fid = fopen(sysname, mode)) != NULL) | |
147 | if ((fid = pj_ctx_fopen(ctx, sysname, mode)) != NULL) | |
148 | 148 | errno = 0; |
149 | 149 | |
150 | 150 | /* If none of those work and we have a search path, try it */ |
154 | 154 | { |
155 | 155 | sprintf(fname, "%s%c%s", search_path[i], DIR_CHAR, name); |
156 | 156 | sysname = fname; |
157 | fid = fopen (sysname, mode); | |
157 | fid = pj_ctx_fopen(ctx, sysname, mode); | |
158 | 158 | } |
159 | 159 | if (fid) |
160 | 160 | errno = 0; |
1 | 1 | |
2 | 2 | #include <projects.h> |
3 | 3 | |
4 | char const pj_release[]="Rel. 4.8.0, 6 March 2012"; | |
4 | char const pj_release[]="Rel. 4.9.0, 13 September 2014"; | |
5 | 5 | |
6 | 6 | const char *pj_get_release() |
7 | 7 |
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 |
0 | 0 | /****************************************************************************** |
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 $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Public (application) include file for PROJ.4 API, and constants. |
39 | 39 | #endif |
40 | 40 | |
41 | 41 | /* Try to update this every version! */ |
42 | #define PJ_VERSION 480 | |
42 | #define PJ_VERSION 490 | |
43 | 43 | |
44 | 44 | extern char const pj_release[]; /* global release id string */ |
45 | 45 | |
61 | 61 | # define projXY XY |
62 | 62 | # define projLP LP |
63 | 63 | #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; | |
64 | 74 | |
65 | 75 | /* procedure prototypes */ |
66 | 76 | |
116 | 126 | void pj_ctx_set_logger( projCtx, void (*)(void *, int, const char *) ); |
117 | 127 | void pj_ctx_set_app_data( projCtx, void * ); |
118 | 128 | void *pj_ctx_get_app_data( projCtx ); |
129 | void pj_ctx_set_fileapi( projCtx, projFileAPI *); | |
130 | projFileAPI *pj_ctx_get_fileapi( projCtx ); | |
119 | 131 | |
120 | 132 | void pj_log( projCtx ctx, int level, const char *fmt, ... ); |
121 | 133 | 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 *); | |
122 | 146 | |
123 | 147 | #define PJ_LOG_NONE 0 |
124 | 148 | #define PJ_LOG_ERROR 1 |
36 | 36 | * Division, Kort og Matrikelstyrelsen (KMS), Copenhagen, Denmark |
37 | 37 | */ |
38 | 38 | |
39 | ||
40 | 39 | #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. */ | |
47 | 46 | |
48 | 47 | #define PROJ_LIB__ |
49 | 48 | #define PJ_LIB__ |
53 | 52 | PROJ_HEAD(etmerc, "Extended Transverse Mercator") |
54 | 53 | "\n\tCyl, Sph\n\tlat_ts=(0)\nlat_0=(0)"; |
55 | 54 | |
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 | |
62 | 86 | 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 | |
76 | 100 | 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); | |
85 | 108 | #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 | |
111 | 132 | 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 | } | |
126 | 146 | |
127 | 147 | 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); | |
137 | 157 | #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 | } | |
158 | 177 | |
159 | 178 | 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); | |
175 | 194 | #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 | } | |
192 | 210 | |
193 | 211 | FREEUP; if (P) free(P); } |
194 | 212 | |
195 | ||
196 | 213 | 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; | |
251 | 288 | ENDENTRY(P) |
0 | 0 | /****************************************************************************** |
1 | * $Id: projects.h 2219 2012-06-19 04:18:00Z warmerdam $ | |
1 | * $Id: projects.h 2356 2013-06-25 01:02:23Z warmerdam $ | |
2 | 2 | * |
3 | 3 | * Project: PROJ.4 |
4 | 4 | * Purpose: Primary (private) include file for PROJ.4 library. |
99 | 99 | #define PI 3.14159265358979323846 |
100 | 100 | #define TWOPI 6.2831853071795864769 |
101 | 101 | |
102 | /* environment parameter name */ | |
103 | #ifndef PROJ_LIB | |
104 | #define PROJ_LIB "PROJ_LIB" | |
105 | #endif | |
106 | 102 | /* maximum tag id length for +init and default files */ |
107 | 103 | #ifndef ID_TAG_MAX |
108 | 104 | #define ID_TAG_MAX 50 |
123 | 119 | #else |
124 | 120 | #define DIR_CHAR '/' |
125 | 121 | #endif |
122 | ||
123 | struct projFileAPI_t; | |
126 | 124 | |
127 | 125 | /* proj thread context */ |
128 | 126 | typedef struct { |
130 | 128 | int debug_level; |
131 | 129 | void (*logger)(void *, int, const char *); |
132 | 130 | void *app_data; |
131 | struct projFileAPI_t *fileapi; | |
133 | 132 | } projCtx_t; |
134 | 133 | |
135 | 134 | /* datum_type values */ |
420 | 419 | double pj_authlat(double, double *); |
421 | 420 | COMPLEX pj_zpoly1(COMPLEX, COMPLEX *, int); |
422 | 421 | COMPLEX pj_zpolyd1(COMPLEX, COMPLEX *, int, COMPLEX *); |
423 | FILE *pj_open_lib(projCtx, char *, char *); | |
424 | 422 | |
425 | 423 | int pj_deriv(LP, double, PJ *, struct DERIVS *); |
426 | 424 | int pj_factors(LP, PJ *, double, struct FACTORS *); |
451 | 449 | LP nad_intr(LP, struct CTABLE *); |
452 | 450 | LP nad_cvt(LP, int, struct CTABLE *); |
453 | 451 | 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 ); | |
458 | 456 | void nad_free(struct CTABLE *); |
459 | 457 | |
460 | 458 | /* 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() |