pyogrio 0.10.0__cp311-cp311-win_amd64.whl → 0.11.0__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyogrio might be problematic. Click here for more details.

Files changed (87) hide show
  1. pyogrio/__init__.py +13 -14
  2. pyogrio/_compat.py +8 -0
  3. pyogrio/_err.c +9881 -4061
  4. pyogrio/_err.cp311-win_amd64.pyd +0 -0
  5. pyogrio/_geometry.c +372 -204
  6. pyogrio/_geometry.cp311-win_amd64.pyd +0 -0
  7. pyogrio/_io.c +7119 -6034
  8. pyogrio/_io.cp311-win_amd64.pyd +0 -0
  9. pyogrio/_ogr.c +1317 -1232
  10. pyogrio/_ogr.cp311-win_amd64.pyd +0 -0
  11. pyogrio/_version.py +3 -3
  12. pyogrio/_vsi.c +417 -424
  13. pyogrio/_vsi.cp311-win_amd64.pyd +0 -0
  14. pyogrio/gdal_data/GDAL-targets.cmake +2 -2
  15. pyogrio/gdal_data/GDALConfigVersion.cmake +3 -3
  16. pyogrio/gdal_data/gdalinfo_output.schema.json +3 -3
  17. pyogrio/gdal_data/gdaltileindex.xsd +1 -17
  18. pyogrio/gdal_data/gdalvrt.xsd +48 -41
  19. pyogrio/gdal_data/nitf_spec.xml +1 -17
  20. pyogrio/gdal_data/nitf_spec.xsd +1 -17
  21. pyogrio/gdal_data/ogrvrt.xsd +1 -17
  22. pyogrio/gdal_data/osmconf.ini +3 -1
  23. pyogrio/gdal_data/pdfcomposition.xsd +1 -17
  24. pyogrio/gdal_data/template_tiles.mapml +28 -0
  25. pyogrio/gdal_data/vcpkg.spdx.json +28 -23
  26. pyogrio/gdal_data/vcpkg_abi_info.txt +29 -28
  27. pyogrio/gdal_data/vdv452.xml +1 -17
  28. pyogrio/gdal_data/vdv452.xsd +1 -17
  29. pyogrio/geopandas.py +91 -43
  30. pyogrio/proj_data/ITRF2014 +1 -1
  31. pyogrio/proj_data/ITRF2020 +91 -0
  32. pyogrio/proj_data/proj-config-version.cmake +3 -3
  33. pyogrio/proj_data/proj-config.cmake +1 -1
  34. pyogrio/proj_data/proj-targets-release.cmake +3 -2
  35. pyogrio/proj_data/proj-targets.cmake +2 -2
  36. pyogrio/proj_data/proj.db +0 -0
  37. pyogrio/proj_data/proj.ini +11 -3
  38. pyogrio/proj_data/proj4-targets-release.cmake +3 -2
  39. pyogrio/proj_data/proj4-targets.cmake +2 -2
  40. pyogrio/proj_data/usage +7 -2
  41. pyogrio/proj_data/vcpkg.spdx.json +26 -21
  42. pyogrio/proj_data/vcpkg_abi_info.txt +17 -16
  43. pyogrio/tests/conftest.py +8 -0
  44. pyogrio/tests/test_arrow.py +3 -0
  45. pyogrio/tests/test_core.py +8 -4
  46. pyogrio/tests/test_geopandas_io.py +250 -42
  47. pyogrio/tests/test_path.py +10 -0
  48. pyogrio/tests/test_raw_io.py +6 -2
  49. pyogrio/util.py +15 -2
  50. pyogrio-0.11.0.dist-info/DELVEWHEEL +2 -0
  51. {pyogrio-0.10.0.dist-info → pyogrio-0.11.0.dist-info}/METADATA +32 -37
  52. {pyogrio-0.10.0.dist-info → pyogrio-0.11.0.dist-info}/RECORD +75 -71
  53. {pyogrio-0.10.0.dist-info → pyogrio-0.11.0.dist-info}/WHEEL +1 -1
  54. pyogrio.libs/{Lerc-089e3fef3df84b17326dcddbf1dedaa4.dll → Lerc-0a4c85fb364eca6153da109568898e6c.dll} +0 -0
  55. pyogrio.libs/{gdal-debee5933f0da7bb90b4bcd009023377.dll → gdal-34e3e080255b205ef706390e097fa4dc.dll} +0 -0
  56. pyogrio.libs/geos-d8f20037634583c2efcd6ea1f4153169.dll +0 -0
  57. pyogrio.libs/geos_c-046e8885887192fced9516bda554471d.dll +0 -0
  58. pyogrio.libs/{geotiff-c8fe8a095520a4ea4e465d27e06add3a.dll → geotiff-1f2f76a5d30685a8e0497d9dbf8a79cf.dll} +0 -0
  59. pyogrio.libs/{iconv-2-27352d156a5467ca5383d3951093ea5a.dll → iconv-2-4b71ebbdf6834234e0c64cb2439b77cf.dll} +0 -0
  60. pyogrio.libs/{jpeg62-e56b6f95a95af498f4623b8da4cebd46.dll → jpeg62-bf2a75b1f2695748cd86238ddb19c65b.dll} +0 -0
  61. pyogrio.libs/json-c-4bc6781090e73c9b22d8dc057618a277.dll +0 -0
  62. pyogrio.libs/libcrypto-3-x64-c8f1692ed45cf55faecce2c448056b2e.dll +0 -0
  63. pyogrio.libs/libcurl-f3604410cd467a44d927794ebdce81b8.dll +0 -0
  64. pyogrio.libs/libexpat-385074fd54deb4b640baafa42cbb3146.dll +0 -0
  65. pyogrio.libs/liblzma-8968f0bfd463b7fe612b20d07adc3c1e.dll +0 -0
  66. pyogrio.libs/libpng16-44105208fe941d03e9f0c17bdbb952f7.dll +0 -0
  67. pyogrio.libs/libssl-3-x64-58c364315f431ab1f0e48b311b8cf105.dll +0 -0
  68. pyogrio.libs/msvcp140-99aa35e2033bb8d388bc35c8a68b77e3.dll +0 -0
  69. pyogrio.libs/proj_9-ee59474f99643c112eb02aa34a910237.dll +0 -0
  70. pyogrio.libs/{qhull_r-516897f855568caab1ab1fe37912766c.dll → qhull_r-eaac2f11a3d8241f082e54447c7504d7.dll} +0 -0
  71. pyogrio.libs/sqlite3-dc748e3452944fd41001abacdd783569.dll +0 -0
  72. pyogrio.libs/tiff-c409ddbe87b39639b83fee50d4aea318.dll +0 -0
  73. pyogrio.libs/{zlib1-e5af16a15c63f05bd82d90396807ae5b.dll → zlib1-094085b7b78666197dcc8e1fce2d835d.dll} +0 -0
  74. pyogrio-0.10.0.dist-info/DELVEWHEEL +0 -2
  75. pyogrio.libs/geos-ace4c5b5c1f569bb4213e7bbd0b0322e.dll +0 -0
  76. pyogrio.libs/geos_c-7478ca0a86136b280d9b2d245c6f6627.dll +0 -0
  77. pyogrio.libs/json-c-c84940e2654a4f8468bfcf2ce992aa93.dll +0 -0
  78. pyogrio.libs/libcurl-d69cfd4ad487d53d58743b6778ec85e7.dll +0 -0
  79. pyogrio.libs/libexpat-6576a8d02641b6a3dbad35901ec200a7.dll +0 -0
  80. pyogrio.libs/liblzma-9ee4accb476ec1ae24e924953140273d.dll +0 -0
  81. pyogrio.libs/libpng16-7c36142dda59f186f6bb683e8dae2bfe.dll +0 -0
  82. pyogrio.libs/msvcp140-98b3e5b80de1e5e9d1703b786d795623.dll +0 -0
  83. pyogrio.libs/proj-a408c5327f3fd2f5fabe8c56815beed7.dll +0 -0
  84. pyogrio.libs/sqlite3-9bc109d8536d5ed9666332fec94485fc.dll +0 -0
  85. pyogrio.libs/tiff-9b3f605fffe0bccc0a964c374ee4f820.dll +0 -0
  86. {pyogrio-0.10.0.dist-info → pyogrio-0.11.0.dist-info/licenses}/LICENSE +0 -0
  87. {pyogrio-0.10.0.dist-info → pyogrio-0.11.0.dist-info}/top_level.txt +0 -0
pyogrio/_ogr.c CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.0.11 */
1
+ /* Generated by Cython 3.0.12 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -58,10 +58,10 @@ END: Cython Metadata */
58
58
  #else
59
59
  #define __PYX_EXTRA_ABI_MODULE_NAME ""
60
60
  #endif
61
- #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
61
+ #define CYTHON_ABI "3_0_12" __PYX_EXTRA_ABI_MODULE_NAME
62
62
  #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
63
63
  #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
64
- #define CYTHON_HEX_VERSION 0x03000BF0
64
+ #define CYTHON_HEX_VERSION 0x03000CF0
65
65
  #define CYTHON_FUTURE_DIVISION 1
66
66
  #include <stddef.h>
67
67
  #ifndef offsetof
@@ -1515,6 +1515,7 @@ static const char *__pyx_filename;
1515
1515
 
1516
1516
  static const char *__pyx_f[] = {
1517
1517
  "pyogrio\\\\_ogr.pyx",
1518
+ "pyogrio\\\\_err.pxd",
1518
1519
  };
1519
1520
  /* #### Code section: utility_code_proto_before_types ### */
1520
1521
  /* ForceInitThreads.proto */
@@ -1527,9 +1528,10 @@ static const char *__pyx_f[] = {
1527
1528
  /* #### Code section: type_declarations ### */
1528
1529
 
1529
1530
  /*--- Type declarations ---*/
1531
+ struct __pyx_obj_7pyogrio_4_err_ErrorHandler;
1530
1532
  struct __pyx_opt_args_7pyogrio_4_ogr_get_string;
1531
1533
 
1532
- /* "pyogrio/_ogr.pxd":452
1534
+ /* "pyogrio/_ogr.pxd":514
1533
1535
  *
1534
1536
  *
1535
1537
  * cdef get_string(const char *c_str, str encoding=*) # <<<<<<<<<<<<<<
@@ -1538,6 +1540,28 @@ struct __pyx_opt_args_7pyogrio_4_ogr_get_string {
1538
1540
  int __pyx_n;
1539
1541
  PyObject *encoding;
1540
1542
  };
1543
+
1544
+ /* "pyogrio/_err.pxd":5
1545
+ * cdef void *check_pointer(void *ptr) except NULL
1546
+ *
1547
+ * cdef class ErrorHandler: # <<<<<<<<<<<<<<
1548
+ * cdef object error_stack
1549
+ * cdef int check_int(self, int retval, bint squash_errors) except -1
1550
+ */
1551
+ struct __pyx_obj_7pyogrio_4_err_ErrorHandler {
1552
+ PyObject_HEAD
1553
+ struct __pyx_vtabstruct_7pyogrio_4_err_ErrorHandler *__pyx_vtab;
1554
+ PyObject *error_stack;
1555
+ };
1556
+
1557
+
1558
+
1559
+ struct __pyx_vtabstruct_7pyogrio_4_err_ErrorHandler {
1560
+ int (*check_int)(struct __pyx_obj_7pyogrio_4_err_ErrorHandler *, int, int);
1561
+ void *(*check_pointer)(struct __pyx_obj_7pyogrio_4_err_ErrorHandler *, void *, int);
1562
+ void (*_handle_error_stack)(struct __pyx_obj_7pyogrio_4_err_ErrorHandler *, int);
1563
+ };
1564
+ static struct __pyx_vtabstruct_7pyogrio_4_err_ErrorHandler *__pyx_vtabptr_7pyogrio_4_err_ErrorHandler;
1541
1565
  /* #### Code section: utility_code_proto ### */
1542
1566
 
1543
1567
  /* --- Runtime support code (head) --- */
@@ -1699,7 +1723,7 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
1699
1723
  #if !CYTHON_VECTORCALL
1700
1724
  #if PY_VERSION_HEX >= 0x03080000
1701
1725
  #include "frameobject.h"
1702
- #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
1726
+ #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
1703
1727
  #ifndef Py_BUILD_CORE
1704
1728
  #define Py_BUILD_CORE 1
1705
1729
  #endif
@@ -1938,6 +1962,38 @@ static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_ve
1938
1962
  static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1939
1963
  #endif
1940
1964
 
1965
+ /* RaiseException.proto */
1966
+ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1967
+
1968
+ /* PyObjectFormatSimple.proto */
1969
+ #if CYTHON_COMPILING_IN_PYPY
1970
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1971
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1972
+ PyObject_Format(s, f))
1973
+ #elif PY_MAJOR_VERSION < 3
1974
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1975
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1976
+ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
1977
+ PyObject_Format(s, f))
1978
+ #elif CYTHON_USE_TYPE_SLOTS
1979
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1980
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1981
+ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
1982
+ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
1983
+ PyObject_Format(s, f))
1984
+ #else
1985
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1986
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1987
+ PyObject_Format(s, f))
1988
+ #endif
1989
+
1990
+ /* JoinPyUnicode.proto */
1991
+ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
1992
+ Py_UCS4 max_char);
1993
+
1994
+ /* RaiseUnexpectedTypeError.proto */
1995
+ static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
1996
+
1941
1997
  /* GetTopmostException.proto */
1942
1998
  #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
1943
1999
  static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
@@ -1987,38 +2043,6 @@ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject *
1987
2043
  static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1988
2044
  #endif
1989
2045
 
1990
- /* RaiseException.proto */
1991
- static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1992
-
1993
- /* PyObjectFormatSimple.proto */
1994
- #if CYTHON_COMPILING_IN_PYPY
1995
- #define __Pyx_PyObject_FormatSimple(s, f) (\
1996
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1997
- PyObject_Format(s, f))
1998
- #elif PY_MAJOR_VERSION < 3
1999
- #define __Pyx_PyObject_FormatSimple(s, f) (\
2000
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2001
- likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
2002
- PyObject_Format(s, f))
2003
- #elif CYTHON_USE_TYPE_SLOTS
2004
- #define __Pyx_PyObject_FormatSimple(s, f) (\
2005
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2006
- likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
2007
- likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
2008
- PyObject_Format(s, f))
2009
- #else
2010
- #define __Pyx_PyObject_FormatSimple(s, f) (\
2011
- likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
2012
- PyObject_Format(s, f))
2013
- #endif
2014
-
2015
- /* JoinPyUnicode.proto */
2016
- static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
2017
- Py_UCS4 max_char);
2018
-
2019
- /* RaiseUnexpectedTypeError.proto */
2020
- static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);
2021
-
2022
2046
  /* GetItemInt.proto */
2023
2047
  #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2024
2048
  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
@@ -2074,6 +2098,28 @@ static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2074
2098
  #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2075
2099
  #endif
2076
2100
 
2101
+ /* TypeImport.proto */
2102
+ #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_12
2103
+ #define __PYX_HAVE_RT_ImportType_proto_3_0_12
2104
+ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
2105
+ #include <stdalign.h>
2106
+ #endif
2107
+ #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
2108
+ #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) alignof(s)
2109
+ #else
2110
+ #define __PYX_GET_STRUCT_ALIGNMENT_3_0_12(s) sizeof(void*)
2111
+ #endif
2112
+ enum __Pyx_ImportType_CheckSize_3_0_12 {
2113
+ __Pyx_ImportType_CheckSize_Error_3_0_12 = 0,
2114
+ __Pyx_ImportType_CheckSize_Warn_3_0_12 = 1,
2115
+ __Pyx_ImportType_CheckSize_Ignore_3_0_12 = 2
2116
+ };
2117
+ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size);
2118
+ #endif
2119
+
2120
+ /* GetVTable.proto */
2121
+ static void* __Pyx_GetVtable(PyTypeObject *type);
2122
+
2077
2123
  /* Import.proto */
2078
2124
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2079
2125
 
@@ -2300,7 +2346,7 @@ static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt
2300
2346
  static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
2301
2347
 
2302
2348
  /* FunctionImport.proto */
2303
- static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2349
+ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
2304
2350
 
2305
2351
  /* InitStrings.proto */
2306
2352
  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
@@ -2314,9 +2360,7 @@ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2314
2360
  /* Module declarations from "libc.stdio" */
2315
2361
 
2316
2362
  /* Module declarations from "pyogrio._err" */
2317
- static int (*__pyx_f_7pyogrio_4_err_exc_wrap_int)(int); /*proto*/
2318
- static int (*__pyx_f_7pyogrio_4_err_exc_wrap_ogrerr)(int); /*proto*/
2319
- static void *(*__pyx_f_7pyogrio_4_err_exc_wrap_pointer)(void *); /*proto*/
2363
+ static void *(*__pyx_f_7pyogrio_4_err_check_pointer)(void *); /*proto*/
2320
2364
 
2321
2365
  /* Module declarations from "pyogrio._ogr" */
2322
2366
  static PyObject *__pyx_f_7pyogrio_4_ogr_get_string(char const *, struct __pyx_opt_args_7pyogrio_4_ogr_get_string *__pyx_optional_args); /*proto*/
@@ -2382,6 +2426,7 @@ static const char __pyx_k_name_b[] = "name_b";
2382
2426
  static const char __pyx_k_name_c[] = "name_c";
2383
2427
  static const char __pyx_k_path_c[] = "path_c";
2384
2428
  static const char __pyx_k_prefix[] = "prefix";
2429
+ static const char __pyx_k_retval[] = "retval";
2385
2430
  static const char __pyx_k_rstrip[] = "rstrip";
2386
2431
  static const char __pyx_k_abspath[] = "abspath";
2387
2432
  static const char __pyx_k_dirname[] = "dirname";
@@ -2409,6 +2454,7 @@ static const char __pyx_k_extensions[] = "extensions";
2409
2454
  static const char __pyx_k_gpkg_zip_2[] = "gpkg.zip";
2410
2455
  static const char __pyx_k_header_dxf[] = "header.dxf";
2411
2456
  static const char __pyx_k_metadata_c[] = "metadata_c";
2457
+ static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2412
2458
  static const char __pyx_k_startswith[] = "startswith";
2413
2459
  static const char __pyx_k_wheel_path[] = "wheel_path";
2414
2460
  static const char __pyx_k_DCAP_CREATE[] = "DCAP_CREATE";
@@ -2452,8 +2498,8 @@ static const char __pyx_k_Could_not_correctly_detect_GDAL[] = "Could not correct
2452
2498
  static const char __pyx_k_Could_not_correctly_detect_PROJ[] = "Could not correctly detect PROJ data files installed by pyogrio wheel";
2453
2499
  static const char __pyx_k_but_it_does_not_appear_to_corre[] = " but it does not appear to correctly contain GDAL data files";
2454
2500
  static const char __pyx_k_check_that_it_was_installed_cor[] = " (check that it was installed correctly into GDAL)";
2455
- static const char __pyx_k_Could_not_detect_GDAL_data_files[] = "Could not detect GDAL data files. Set GDAL_DATA environment variable to the correct path.";
2456
- static const char __pyx_k_Could_not_detect_PROJ_data_files[] = "Could not detect PROJ data files. Set PROJ_LIB environment variable to the correct path.";
2501
+ static const char __pyx_k_Could_not_detect_GDAL_data_files[] = "Could not detect GDAL data files. Set GDAL_DATA environment variable to the correct path.";
2502
+ static const char __pyx_k_Could_not_detect_PROJ_data_files[] = "Could not detect PROJ data files. Set PROJ_LIB environment variable to the correct path.";
2457
2503
  static const char __pyx_k_but_it_does_not_appear_to_corre_2[] = " but it does not appear to correctly contain PROJ data files";
2458
2504
  /* #### Code section: decls ### */
2459
2505
  static PyObject *__pyx_pf_7pyogrio_4_ogr_get_gdal_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
@@ -2507,6 +2553,7 @@ typedef struct {
2507
2553
  #endif
2508
2554
  #if CYTHON_USE_MODULE_STATE
2509
2555
  #endif
2556
+ PyTypeObject *__pyx_ptype_7pyogrio_4_err_ErrorHandler;
2510
2557
  #if CYTHON_USE_MODULE_STATE
2511
2558
  #endif
2512
2559
  PyObject *__pyx_n_s_CPLE_BaseError;
@@ -2601,9 +2648,11 @@ typedef struct {
2601
2648
  PyObject *__pyx_n_s_pyogrio__ogr;
2602
2649
  PyObject *__pyx_kp_s_pyogrio__ogr_pyx;
2603
2650
  PyObject *__pyx_n_s_pyogrio_errors;
2651
+ PyObject *__pyx_n_s_pyx_vtable;
2604
2652
  PyObject *__pyx_n_u_r;
2605
2653
  PyObject *__pyx_n_s_range;
2606
2654
  PyObject *__pyx_n_s_register_drivers;
2655
+ PyObject *__pyx_n_s_retval;
2607
2656
  PyObject *__pyx_n_s_revision;
2608
2657
  PyObject *__pyx_n_s_rstrip;
2609
2658
  PyObject *__pyx_n_u_rw;
@@ -2710,6 +2759,7 @@ static int __pyx_m_clear(PyObject *m) {
2710
2759
  #ifdef __Pyx_FusedFunction_USED
2711
2760
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
2712
2761
  #endif
2762
+ Py_CLEAR(clear_module_state->__pyx_ptype_7pyogrio_4_err_ErrorHandler);
2713
2763
  Py_CLEAR(clear_module_state->__pyx_n_s_CPLE_BaseError);
2714
2764
  Py_CLEAR(clear_module_state->__pyx_kp_u_Could_not_correctly_detect_GDAL);
2715
2765
  Py_CLEAR(clear_module_state->__pyx_kp_u_Could_not_correctly_detect_PROJ);
@@ -2802,9 +2852,11 @@ static int __pyx_m_clear(PyObject *m) {
2802
2852
  Py_CLEAR(clear_module_state->__pyx_n_s_pyogrio__ogr);
2803
2853
  Py_CLEAR(clear_module_state->__pyx_kp_s_pyogrio__ogr_pyx);
2804
2854
  Py_CLEAR(clear_module_state->__pyx_n_s_pyogrio_errors);
2855
+ Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
2805
2856
  Py_CLEAR(clear_module_state->__pyx_n_u_r);
2806
2857
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
2807
2858
  Py_CLEAR(clear_module_state->__pyx_n_s_register_drivers);
2859
+ Py_CLEAR(clear_module_state->__pyx_n_s_retval);
2808
2860
  Py_CLEAR(clear_module_state->__pyx_n_s_revision);
2809
2861
  Py_CLEAR(clear_module_state->__pyx_n_s_rstrip);
2810
2862
  Py_CLEAR(clear_module_state->__pyx_n_u_rw);
@@ -2889,6 +2941,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2889
2941
  #ifdef __Pyx_FusedFunction_USED
2890
2942
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
2891
2943
  #endif
2944
+ Py_VISIT(traverse_module_state->__pyx_ptype_7pyogrio_4_err_ErrorHandler);
2892
2945
  Py_VISIT(traverse_module_state->__pyx_n_s_CPLE_BaseError);
2893
2946
  Py_VISIT(traverse_module_state->__pyx_kp_u_Could_not_correctly_detect_GDAL);
2894
2947
  Py_VISIT(traverse_module_state->__pyx_kp_u_Could_not_correctly_detect_PROJ);
@@ -2981,9 +3034,11 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2981
3034
  Py_VISIT(traverse_module_state->__pyx_n_s_pyogrio__ogr);
2982
3035
  Py_VISIT(traverse_module_state->__pyx_kp_s_pyogrio__ogr_pyx);
2983
3036
  Py_VISIT(traverse_module_state->__pyx_n_s_pyogrio_errors);
3037
+ Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
2984
3038
  Py_VISIT(traverse_module_state->__pyx_n_u_r);
2985
3039
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
2986
3040
  Py_VISIT(traverse_module_state->__pyx_n_s_register_drivers);
3041
+ Py_VISIT(traverse_module_state->__pyx_n_s_retval);
2987
3042
  Py_VISIT(traverse_module_state->__pyx_n_s_revision);
2988
3043
  Py_VISIT(traverse_module_state->__pyx_n_s_rstrip);
2989
3044
  Py_VISIT(traverse_module_state->__pyx_n_u_rw);
@@ -3084,6 +3139,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
3084
3139
  #endif
3085
3140
  #if CYTHON_USE_MODULE_STATE
3086
3141
  #endif
3142
+ #define __pyx_ptype_7pyogrio_4_err_ErrorHandler __pyx_mstate_global->__pyx_ptype_7pyogrio_4_err_ErrorHandler
3087
3143
  #if CYTHON_USE_MODULE_STATE
3088
3144
  #endif
3089
3145
  #define __pyx_n_s_CPLE_BaseError __pyx_mstate_global->__pyx_n_s_CPLE_BaseError
@@ -3178,9 +3234,11 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
3178
3234
  #define __pyx_n_s_pyogrio__ogr __pyx_mstate_global->__pyx_n_s_pyogrio__ogr
3179
3235
  #define __pyx_kp_s_pyogrio__ogr_pyx __pyx_mstate_global->__pyx_kp_s_pyogrio__ogr_pyx
3180
3236
  #define __pyx_n_s_pyogrio_errors __pyx_mstate_global->__pyx_n_s_pyogrio_errors
3237
+ #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
3181
3238
  #define __pyx_n_u_r __pyx_mstate_global->__pyx_n_u_r
3182
3239
  #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
3183
3240
  #define __pyx_n_s_register_drivers __pyx_mstate_global->__pyx_n_s_register_drivers
3241
+ #define __pyx_n_s_retval __pyx_mstate_global->__pyx_n_s_retval
3184
3242
  #define __pyx_n_s_revision __pyx_mstate_global->__pyx_n_s_revision
3185
3243
  #define __pyx_n_s_rstrip __pyx_mstate_global->__pyx_n_s_rstrip
3186
3244
  #define __pyx_n_u_rw __pyx_mstate_global->__pyx_n_u_rw
@@ -3251,7 +3309,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
3251
3309
  *
3252
3310
  *
3253
3311
  * cdef get_string(const char *c_str, str encoding="UTF-8"): # <<<<<<<<<<<<<<
3254
- * """Get Python string from a char *
3312
+ * """Get Python string from a char *.
3255
3313
  *
3256
3314
  */
3257
3315
 
@@ -3326,7 +3384,7 @@ static PyObject *__pyx_f_7pyogrio_4_ogr_get_string(char const *__pyx_v_c_str, st
3326
3384
  *
3327
3385
  *
3328
3386
  * cdef get_string(const char *c_str, str encoding="UTF-8"): # <<<<<<<<<<<<<<
3329
- * """Get Python string from a char *
3387
+ * """Get Python string from a char *.
3330
3388
  *
3331
3389
  */
3332
3390
 
@@ -3703,7 +3761,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_4get_gdal_geos_version(CYTHON_UNUSED Py
3703
3761
  *
3704
3762
  * def set_gdal_config_options(dict options): # <<<<<<<<<<<<<<
3705
3763
  * for name, value in options.items():
3706
- * name_b = name.encode('utf-8')
3764
+ * name_b = name.encode("utf-8")
3707
3765
  */
3708
3766
 
3709
3767
  /* Python wrapper */
@@ -3838,7 +3896,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
3838
3896
  *
3839
3897
  * def set_gdal_config_options(dict options):
3840
3898
  * for name, value in options.items(): # <<<<<<<<<<<<<<
3841
- * name_b = name.encode('utf-8')
3899
+ * name_b = name.encode("utf-8")
3842
3900
  * name_c = name_b
3843
3901
  */
3844
3902
  __pyx_t_2 = 0;
@@ -3865,7 +3923,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
3865
3923
  /* "pyogrio/_ogr.pyx":64
3866
3924
  * def set_gdal_config_options(dict options):
3867
3925
  * for name, value in options.items():
3868
- * name_b = name.encode('utf-8') # <<<<<<<<<<<<<<
3926
+ * name_b = name.encode("utf-8") # <<<<<<<<<<<<<<
3869
3927
  * name_c = name_b
3870
3928
  *
3871
3929
  */
@@ -3898,7 +3956,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
3898
3956
 
3899
3957
  /* "pyogrio/_ogr.pyx":65
3900
3958
  * for name, value in options.items():
3901
- * name_b = name.encode('utf-8')
3959
+ * name_b = name.encode("utf-8")
3902
3960
  * name_c = name_b # <<<<<<<<<<<<<<
3903
3961
  *
3904
3962
  * # None is a special case; this is used to clear the previous value
@@ -3948,7 +4006,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
3948
4006
  *
3949
4007
  * # normalize bool to ON/OFF
3950
4008
  * if isinstance(value, bool): # <<<<<<<<<<<<<<
3951
- * value_b = b'ON' if value else b'OFF'
4009
+ * value_b = b"ON" if value else b"OFF"
3952
4010
  * else:
3953
4011
  */
3954
4012
  __pyx_t_6 = ((PyObject*)&PyBool_Type);
@@ -3960,9 +4018,9 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
3960
4018
  /* "pyogrio/_ogr.pyx":74
3961
4019
  * # normalize bool to ON/OFF
3962
4020
  * if isinstance(value, bool):
3963
- * value_b = b'ON' if value else b'OFF' # <<<<<<<<<<<<<<
4021
+ * value_b = b"ON" if value else b"OFF" # <<<<<<<<<<<<<<
3964
4022
  * else:
3965
- * value_b = str(value).encode('utf-8')
4023
+ * value_b = str(value).encode("utf-8")
3966
4024
  */
3967
4025
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 74, __pyx_L1_error)
3968
4026
  if (__pyx_t_10) {
@@ -3979,16 +4037,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
3979
4037
  *
3980
4038
  * # normalize bool to ON/OFF
3981
4039
  * if isinstance(value, bool): # <<<<<<<<<<<<<<
3982
- * value_b = b'ON' if value else b'OFF'
4040
+ * value_b = b"ON" if value else b"OFF"
3983
4041
  * else:
3984
4042
  */
3985
4043
  goto __pyx_L6;
3986
4044
  }
3987
4045
 
3988
4046
  /* "pyogrio/_ogr.pyx":76
3989
- * value_b = b'ON' if value else b'OFF'
4047
+ * value_b = b"ON" if value else b"OFF"
3990
4048
  * else:
3991
- * value_b = str(value).encode('utf-8') # <<<<<<<<<<<<<<
4049
+ * value_b = str(value).encode("utf-8") # <<<<<<<<<<<<<<
3992
4050
  *
3993
4051
  * value_c = value_b
3994
4052
  */
@@ -4004,7 +4062,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
4004
4062
  __pyx_L6:;
4005
4063
 
4006
4064
  /* "pyogrio/_ogr.pyx":78
4007
- * value_b = str(value).encode('utf-8')
4065
+ * value_b = str(value).encode("utf-8")
4008
4066
  *
4009
4067
  * value_c = value_b # <<<<<<<<<<<<<<
4010
4068
  * CPLSetConfigOption(<const char*>name_c, <const char*>value_c)
@@ -4032,7 +4090,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
4032
4090
  *
4033
4091
  * def set_gdal_config_options(dict options): # <<<<<<<<<<<<<<
4034
4092
  * for name, value in options.items():
4035
- * name_b = name.encode('utf-8')
4093
+ * name_b = name.encode("utf-8")
4036
4094
  */
4037
4095
 
4038
4096
  /* function exit code */
@@ -4061,7 +4119,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_6set_gdal_config_options(CYTHON_UNUSED
4061
4119
  *
4062
4120
  *
4063
4121
  * def get_gdal_config_option(str name): # <<<<<<<<<<<<<<
4064
- * name_b = name.encode('utf-8')
4122
+ * name_b = name.encode("utf-8")
4065
4123
  * name_c = name_b
4066
4124
  */
4067
4125
 
@@ -4187,7 +4245,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4187
4245
  /* "pyogrio/_ogr.pyx":83
4188
4246
  *
4189
4247
  * def get_gdal_config_option(str name):
4190
- * name_b = name.encode('utf-8') # <<<<<<<<<<<<<<
4248
+ * name_b = name.encode("utf-8") # <<<<<<<<<<<<<<
4191
4249
  * name_c = name_b
4192
4250
  * value = CPLGetConfigOption(<const char*>name_c, NULL)
4193
4251
  */
@@ -4202,7 +4260,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4202
4260
 
4203
4261
  /* "pyogrio/_ogr.pyx":84
4204
4262
  * def get_gdal_config_option(str name):
4205
- * name_b = name.encode('utf-8')
4263
+ * name_b = name.encode("utf-8")
4206
4264
  * name_c = name_b # <<<<<<<<<<<<<<
4207
4265
  * value = CPLGetConfigOption(<const char*>name_c, NULL)
4208
4266
  *
@@ -4211,7 +4269,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4211
4269
  __pyx_v_name_c = __pyx_v_name_b;
4212
4270
 
4213
4271
  /* "pyogrio/_ogr.pyx":85
4214
- * name_b = name.encode('utf-8')
4272
+ * name_b = name.encode("utf-8")
4215
4273
  * name_c = name_b
4216
4274
  * value = CPLGetConfigOption(<const char*>name_c, NULL) # <<<<<<<<<<<<<<
4217
4275
  *
@@ -4293,7 +4351,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4293
4351
  * if value.isdigit():
4294
4352
  * return int(value) # <<<<<<<<<<<<<<
4295
4353
  *
4296
- * if value == b'ON':
4354
+ * if value == b"ON":
4297
4355
  */
4298
4356
  __Pyx_XDECREF(__pyx_r);
4299
4357
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
@@ -4317,9 +4375,9 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4317
4375
  /* "pyogrio/_ogr.pyx":93
4318
4376
  * return int(value)
4319
4377
  *
4320
- * if value == b'ON': # <<<<<<<<<<<<<<
4378
+ * if value == b"ON": # <<<<<<<<<<<<<<
4321
4379
  * return True
4322
- * if value == b'OFF':
4380
+ * if value == b"OFF":
4323
4381
  */
4324
4382
  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
4325
4383
  __Pyx_GOTREF(__pyx_t_5);
@@ -4329,9 +4387,9 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4329
4387
 
4330
4388
  /* "pyogrio/_ogr.pyx":94
4331
4389
  *
4332
- * if value == b'ON':
4390
+ * if value == b"ON":
4333
4391
  * return True # <<<<<<<<<<<<<<
4334
- * if value == b'OFF':
4392
+ * if value == b"OFF":
4335
4393
  * return False
4336
4394
  */
4337
4395
  __Pyx_XDECREF(__pyx_r);
@@ -4342,16 +4400,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4342
4400
  /* "pyogrio/_ogr.pyx":93
4343
4401
  * return int(value)
4344
4402
  *
4345
- * if value == b'ON': # <<<<<<<<<<<<<<
4403
+ * if value == b"ON": # <<<<<<<<<<<<<<
4346
4404
  * return True
4347
- * if value == b'OFF':
4405
+ * if value == b"OFF":
4348
4406
  */
4349
4407
  }
4350
4408
 
4351
4409
  /* "pyogrio/_ogr.pyx":95
4352
- * if value == b'ON':
4410
+ * if value == b"ON":
4353
4411
  * return True
4354
- * if value == b'OFF': # <<<<<<<<<<<<<<
4412
+ * if value == b"OFF": # <<<<<<<<<<<<<<
4355
4413
  * return False
4356
4414
  *
4357
4415
  */
@@ -4363,7 +4421,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4363
4421
 
4364
4422
  /* "pyogrio/_ogr.pyx":96
4365
4423
  * return True
4366
- * if value == b'OFF':
4424
+ * if value == b"OFF":
4367
4425
  * return False # <<<<<<<<<<<<<<
4368
4426
  *
4369
4427
  * str_value = get_string(value)
@@ -4374,9 +4432,9 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4374
4432
  goto __pyx_L0;
4375
4433
 
4376
4434
  /* "pyogrio/_ogr.pyx":95
4377
- * if value == b'ON':
4435
+ * if value == b"ON":
4378
4436
  * return True
4379
- * if value == b'OFF': # <<<<<<<<<<<<<<
4437
+ * if value == b"OFF": # <<<<<<<<<<<<<<
4380
4438
  * return False
4381
4439
  *
4382
4440
  */
@@ -4410,7 +4468,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4410
4468
  *
4411
4469
  *
4412
4470
  * def get_gdal_config_option(str name): # <<<<<<<<<<<<<<
4413
- * name_b = name.encode('utf-8')
4471
+ * name_b = name.encode("utf-8")
4414
4472
  * name_c = name_b
4415
4473
  */
4416
4474
 
@@ -4435,7 +4493,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_8get_gdal_config_option(CYTHON_UNUSED P
4435
4493
  *
4436
4494
  * def ogr_driver_supports_write(driver): # <<<<<<<<<<<<<<
4437
4495
  * # check metadata for driver to see if it supports write
4438
- * if _get_driver_metadata_item(driver, "DCAP_CREATE") == 'YES':
4496
+ * if _get_driver_metadata_item(driver, "DCAP_CREATE") == "YES":
4439
4497
  */
4440
4498
 
4441
4499
  /* Python wrapper */
@@ -4550,7 +4608,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_10ogr_driver_supports_write(CYTHON_UNUS
4550
4608
  /* "pyogrio/_ogr.pyx":105
4551
4609
  * def ogr_driver_supports_write(driver):
4552
4610
  * # check metadata for driver to see if it supports write
4553
- * if _get_driver_metadata_item(driver, "DCAP_CREATE") == 'YES': # <<<<<<<<<<<<<<
4611
+ * if _get_driver_metadata_item(driver, "DCAP_CREATE") == "YES": # <<<<<<<<<<<<<<
4554
4612
  * return True
4555
4613
  *
4556
4614
  */
@@ -4584,7 +4642,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_10ogr_driver_supports_write(CYTHON_UNUS
4584
4642
 
4585
4643
  /* "pyogrio/_ogr.pyx":106
4586
4644
  * # check metadata for driver to see if it supports write
4587
- * if _get_driver_metadata_item(driver, "DCAP_CREATE") == 'YES':
4645
+ * if _get_driver_metadata_item(driver, "DCAP_CREATE") == "YES":
4588
4646
  * return True # <<<<<<<<<<<<<<
4589
4647
  *
4590
4648
  * return False
@@ -4597,7 +4655,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_10ogr_driver_supports_write(CYTHON_UNUS
4597
4655
  /* "pyogrio/_ogr.pyx":105
4598
4656
  * def ogr_driver_supports_write(driver):
4599
4657
  * # check metadata for driver to see if it supports write
4600
- * if _get_driver_metadata_item(driver, "DCAP_CREATE") == 'YES': # <<<<<<<<<<<<<<
4658
+ * if _get_driver_metadata_item(driver, "DCAP_CREATE") == "YES": # <<<<<<<<<<<<<<
4601
4659
  * return True
4602
4660
  *
4603
4661
  */
@@ -4620,7 +4678,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_10ogr_driver_supports_write(CYTHON_UNUS
4620
4678
  *
4621
4679
  * def ogr_driver_supports_write(driver): # <<<<<<<<<<<<<<
4622
4680
  * # check metadata for driver to see if it supports write
4623
- * if _get_driver_metadata_item(driver, "DCAP_CREATE") == 'YES':
4681
+ * if _get_driver_metadata_item(driver, "DCAP_CREATE") == "YES":
4624
4682
  */
4625
4683
 
4626
4684
  /* function exit code */
@@ -4641,7 +4699,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_10ogr_driver_supports_write(CYTHON_UNUS
4641
4699
  *
4642
4700
  * def ogr_driver_supports_vsi(driver): # <<<<<<<<<<<<<<
4643
4701
  * # check metadata for driver to see if it supports write
4644
- * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == 'YES':
4702
+ * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == "YES":
4645
4703
  */
4646
4704
 
4647
4705
  /* Python wrapper */
@@ -4756,7 +4814,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_12ogr_driver_supports_vsi(CYTHON_UNUSED
4756
4814
  /* "pyogrio/_ogr.pyx":113
4757
4815
  * def ogr_driver_supports_vsi(driver):
4758
4816
  * # check metadata for driver to see if it supports write
4759
- * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == 'YES': # <<<<<<<<<<<<<<
4817
+ * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == "YES": # <<<<<<<<<<<<<<
4760
4818
  * return True
4761
4819
  *
4762
4820
  */
@@ -4790,7 +4848,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_12ogr_driver_supports_vsi(CYTHON_UNUSED
4790
4848
 
4791
4849
  /* "pyogrio/_ogr.pyx":114
4792
4850
  * # check metadata for driver to see if it supports write
4793
- * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == 'YES':
4851
+ * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == "YES":
4794
4852
  * return True # <<<<<<<<<<<<<<
4795
4853
  *
4796
4854
  * return False
@@ -4803,7 +4861,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_12ogr_driver_supports_vsi(CYTHON_UNUSED
4803
4861
  /* "pyogrio/_ogr.pyx":113
4804
4862
  * def ogr_driver_supports_vsi(driver):
4805
4863
  * # check metadata for driver to see if it supports write
4806
- * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == 'YES': # <<<<<<<<<<<<<<
4864
+ * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == "YES": # <<<<<<<<<<<<<<
4807
4865
  * return True
4808
4866
  *
4809
4867
  */
@@ -4826,7 +4884,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_12ogr_driver_supports_vsi(CYTHON_UNUSED
4826
4884
  *
4827
4885
  * def ogr_driver_supports_vsi(driver): # <<<<<<<<<<<<<<
4828
4886
  * # check metadata for driver to see if it supports write
4829
- * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == 'YES':
4887
+ * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == "YES":
4830
4888
  */
4831
4889
 
4832
4890
  /* function exit code */
@@ -5406,25 +5464,10 @@ static PyObject *__pyx_pw_7pyogrio_4_ogr_21has_proj_data(PyObject *__pyx_self, C
5406
5464
 
5407
5465
  static PyObject *__pyx_pf_7pyogrio_4_ogr_20has_proj_data(CYTHON_UNUSED PyObject *__pyx_self) {
5408
5466
  OGRSpatialReferenceH __pyx_v_srs;
5467
+ OGRErr __pyx_v_retval;
5409
5468
  PyObject *__pyx_r = NULL;
5410
5469
  __Pyx_RefNannyDeclarations
5411
- PyObject *__pyx_t_1 = NULL;
5412
- PyObject *__pyx_t_2 = NULL;
5413
- PyObject *__pyx_t_3 = NULL;
5414
- int __pyx_t_4;
5415
- int __pyx_t_5;
5416
- PyObject *__pyx_t_6 = NULL;
5417
- PyObject *__pyx_t_7 = NULL;
5418
- PyObject *__pyx_t_8 = NULL;
5419
- PyObject *__pyx_t_9 = NULL;
5420
- char const *__pyx_t_10;
5421
- PyObject *__pyx_t_11 = NULL;
5422
- PyObject *__pyx_t_12 = NULL;
5423
- PyObject *__pyx_t_13 = NULL;
5424
- int __pyx_t_14;
5425
- int __pyx_lineno = 0;
5426
- const char *__pyx_filename = NULL;
5427
- int __pyx_clineno = 0;
5470
+ int __pyx_t_1;
5428
5471
  __Pyx_RefNannySetupContext("has_proj_data", 1);
5429
5472
 
5430
5473
  /* "pyogrio/_ogr.pyx":183
@@ -5432,210 +5475,90 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_20has_proj_data(CYTHON_UNUSED PyObject
5432
5475
  * """
5433
5476
  * cdef OGRSpatialReferenceH srs = OSRNewSpatialReference(NULL) # <<<<<<<<<<<<<<
5434
5477
  *
5435
- * try:
5478
+ * retval = OSRImportFromEPSG(srs, 4326)
5436
5479
  */
5437
5480
  __pyx_v_srs = OSRNewSpatialReference(NULL);
5438
5481
 
5439
5482
  /* "pyogrio/_ogr.pyx":185
5440
5483
  * cdef OGRSpatialReferenceH srs = OSRNewSpatialReference(NULL)
5441
5484
  *
5442
- * try: # <<<<<<<<<<<<<<
5443
- * exc_wrap_ogrerr(exc_wrap_int(OSRImportFromEPSG(srs, 4326)))
5444
- * except CPLE_BaseError:
5485
+ * retval = OSRImportFromEPSG(srs, 4326) # <<<<<<<<<<<<<<
5486
+ * if srs != NULL:
5487
+ * OSRRelease(srs)
5445
5488
  */
5446
- /*try:*/ {
5447
- {
5448
- __Pyx_PyThreadState_declare
5449
- __Pyx_PyThreadState_assign
5450
- __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
5451
- __Pyx_XGOTREF(__pyx_t_1);
5452
- __Pyx_XGOTREF(__pyx_t_2);
5453
- __Pyx_XGOTREF(__pyx_t_3);
5454
- /*try:*/ {
5489
+ __pyx_v_retval = OSRImportFromEPSG(__pyx_v_srs, 0x10E6);
5455
5490
 
5456
- /* "pyogrio/_ogr.pyx":186
5491
+ /* "pyogrio/_ogr.pyx":186
5457
5492
  *
5458
- * try:
5459
- * exc_wrap_ogrerr(exc_wrap_int(OSRImportFromEPSG(srs, 4326))) # <<<<<<<<<<<<<<
5460
- * except CPLE_BaseError:
5461
- * return False
5462
- */
5463
- __pyx_t_4 = __pyx_f_7pyogrio_4_err_exc_wrap_int(OSRImportFromEPSG(__pyx_v_srs, 0x10E6)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 186, __pyx_L6_error)
5464
- __pyx_t_5 = __pyx_f_7pyogrio_4_err_exc_wrap_ogrerr(__pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 186, __pyx_L6_error)
5465
-
5466
- /* "pyogrio/_ogr.pyx":185
5467
- * cdef OGRSpatialReferenceH srs = OSRNewSpatialReference(NULL)
5493
+ * retval = OSRImportFromEPSG(srs, 4326)
5494
+ * if srs != NULL: # <<<<<<<<<<<<<<
5495
+ * OSRRelease(srs)
5468
5496
  *
5469
- * try: # <<<<<<<<<<<<<<
5470
- * exc_wrap_ogrerr(exc_wrap_int(OSRImportFromEPSG(srs, 4326)))
5471
- * except CPLE_BaseError:
5472
5497
  */
5473
- }
5474
-
5475
- /* "pyogrio/_ogr.pyx":190
5476
- * return False
5477
- * else:
5478
- * return True # <<<<<<<<<<<<<<
5479
- * finally:
5480
- * if srs != NULL:
5481
- */
5482
- /*else:*/ {
5483
- __Pyx_XDECREF(__pyx_r);
5484
- __Pyx_INCREF(Py_True);
5485
- __pyx_r = Py_True;
5486
- goto __pyx_L9_except_return;
5487
- }
5488
- __pyx_L6_error:;
5498
+ __pyx_t_1 = (__pyx_v_srs != NULL);
5499
+ if (__pyx_t_1) {
5489
5500
 
5490
- /* "pyogrio/_ogr.pyx":187
5491
- * try:
5492
- * exc_wrap_ogrerr(exc_wrap_int(OSRImportFromEPSG(srs, 4326)))
5493
- * except CPLE_BaseError: # <<<<<<<<<<<<<<
5494
- * return False
5495
- * else:
5496
- */
5497
- __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
5498
- __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 187, __pyx_L8_except_error)
5499
- __Pyx_GOTREF(__pyx_t_9);
5500
- __pyx_t_5 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_6, __pyx_t_9);
5501
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5502
- __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5503
- __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0;
5504
- if (__pyx_t_5) {
5505
- __Pyx_AddTraceback("pyogrio._ogr.has_proj_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
5506
- if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(0, 187, __pyx_L8_except_error)
5507
- __Pyx_XGOTREF(__pyx_t_8);
5508
- __Pyx_XGOTREF(__pyx_t_7);
5509
- __Pyx_XGOTREF(__pyx_t_6);
5510
-
5511
- /* "pyogrio/_ogr.pyx":188
5512
- * exc_wrap_ogrerr(exc_wrap_int(OSRImportFromEPSG(srs, 4326)))
5513
- * except CPLE_BaseError:
5514
- * return False # <<<<<<<<<<<<<<
5515
- * else:
5516
- * return True
5501
+ /* "pyogrio/_ogr.pyx":187
5502
+ * retval = OSRImportFromEPSG(srs, 4326)
5503
+ * if srs != NULL:
5504
+ * OSRRelease(srs) # <<<<<<<<<<<<<<
5505
+ *
5506
+ * if retval == OGRERR_NONE:
5517
5507
  */
5518
- __Pyx_XDECREF(__pyx_r);
5519
- __Pyx_INCREF(Py_False);
5520
- __pyx_r = Py_False;
5521
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5522
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5523
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5524
- goto __pyx_L9_except_return;
5525
- }
5526
- goto __pyx_L8_except_error;
5508
+ OSRRelease(__pyx_v_srs);
5527
5509
 
5528
- /* "pyogrio/_ogr.pyx":185
5529
- * cdef OGRSpatialReferenceH srs = OSRNewSpatialReference(NULL)
5510
+ /* "pyogrio/_ogr.pyx":186
5530
5511
  *
5531
- * try: # <<<<<<<<<<<<<<
5532
- * exc_wrap_ogrerr(exc_wrap_int(OSRImportFromEPSG(srs, 4326)))
5533
- * except CPLE_BaseError:
5534
- */
5535
- __pyx_L8_except_error:;
5536
- __Pyx_XGIVEREF(__pyx_t_1);
5537
- __Pyx_XGIVEREF(__pyx_t_2);
5538
- __Pyx_XGIVEREF(__pyx_t_3);
5539
- __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5540
- goto __pyx_L4_error;
5541
- __pyx_L9_except_return:;
5542
- __Pyx_XGIVEREF(__pyx_t_1);
5543
- __Pyx_XGIVEREF(__pyx_t_2);
5544
- __Pyx_XGIVEREF(__pyx_t_3);
5545
- __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
5546
- goto __pyx_L3_return;
5547
- }
5548
- }
5549
-
5550
- /* "pyogrio/_ogr.pyx":192
5551
- * return True
5552
- * finally:
5553
- * if srs != NULL: # <<<<<<<<<<<<<<
5554
- * OSRRelease(srs)
5512
+ * retval = OSRImportFromEPSG(srs, 4326)
5513
+ * if srs != NULL: # <<<<<<<<<<<<<<
5514
+ * OSRRelease(srs)
5555
5515
  *
5556
5516
  */
5557
- /*finally:*/ {
5558
- __pyx_L4_error:;
5559
- /*exception exit:*/{
5560
- __Pyx_PyThreadState_declare
5561
- __Pyx_PyThreadState_assign
5562
- __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
5563
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5564
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5565
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5566
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5567
- if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
5568
- if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1) < 0)) __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
5569
- __Pyx_XGOTREF(__pyx_t_3);
5570
- __Pyx_XGOTREF(__pyx_t_2);
5571
- __Pyx_XGOTREF(__pyx_t_1);
5572
- __Pyx_XGOTREF(__pyx_t_11);
5573
- __Pyx_XGOTREF(__pyx_t_12);
5574
- __Pyx_XGOTREF(__pyx_t_13);
5575
- __pyx_t_5 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
5576
- {
5577
- __pyx_t_14 = (__pyx_v_srs != NULL);
5578
- if (__pyx_t_14) {
5517
+ }
5579
5518
 
5580
- /* "pyogrio/_ogr.pyx":193
5581
- * finally:
5582
- * if srs != NULL:
5583
- * OSRRelease(srs) # <<<<<<<<<<<<<<
5584
- *
5519
+ /* "pyogrio/_ogr.pyx":189
5520
+ * OSRRelease(srs)
5585
5521
  *
5522
+ * if retval == OGRERR_NONE: # <<<<<<<<<<<<<<
5523
+ * # Succesfull return, so PROJ data files are correctly found
5524
+ * return True
5586
5525
  */
5587
- OSRRelease(__pyx_v_srs);
5526
+ __pyx_t_1 = (__pyx_v_retval == OGRERR_NONE);
5527
+ if (__pyx_t_1) {
5588
5528
 
5589
- /* "pyogrio/_ogr.pyx":192
5590
- * return True
5591
- * finally:
5592
- * if srs != NULL: # <<<<<<<<<<<<<<
5593
- * OSRRelease(srs)
5594
- *
5529
+ /* "pyogrio/_ogr.pyx":191
5530
+ * if retval == OGRERR_NONE:
5531
+ * # Succesfull return, so PROJ data files are correctly found
5532
+ * return True # <<<<<<<<<<<<<<
5533
+ * else:
5534
+ * return False
5595
5535
  */
5596
- }
5597
- }
5598
- if (PY_MAJOR_VERSION >= 3) {
5599
- __Pyx_XGIVEREF(__pyx_t_11);
5600
- __Pyx_XGIVEREF(__pyx_t_12);
5601
- __Pyx_XGIVEREF(__pyx_t_13);
5602
- __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
5603
- }
5604
- __Pyx_XGIVEREF(__pyx_t_3);
5605
- __Pyx_XGIVEREF(__pyx_t_2);
5606
- __Pyx_XGIVEREF(__pyx_t_1);
5607
- __Pyx_ErrRestore(__pyx_t_3, __pyx_t_2, __pyx_t_1);
5608
- __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
5609
- __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_10;
5610
- goto __pyx_L1_error;
5611
- }
5612
- __pyx_L3_return: {
5613
- __pyx_t_13 = __pyx_r;
5614
- __pyx_r = 0;
5615
- __pyx_t_14 = (__pyx_v_srs != NULL);
5616
- if (__pyx_t_14) {
5536
+ __Pyx_XDECREF(__pyx_r);
5537
+ __Pyx_INCREF(Py_True);
5538
+ __pyx_r = Py_True;
5539
+ goto __pyx_L0;
5617
5540
 
5618
- /* "pyogrio/_ogr.pyx":193
5619
- * finally:
5620
- * if srs != NULL:
5621
- * OSRRelease(srs) # <<<<<<<<<<<<<<
5622
- *
5541
+ /* "pyogrio/_ogr.pyx":189
5542
+ * OSRRelease(srs)
5623
5543
  *
5544
+ * if retval == OGRERR_NONE: # <<<<<<<<<<<<<<
5545
+ * # Succesfull return, so PROJ data files are correctly found
5546
+ * return True
5624
5547
  */
5625
- OSRRelease(__pyx_v_srs);
5548
+ }
5626
5549
 
5627
- /* "pyogrio/_ogr.pyx":192
5550
+ /* "pyogrio/_ogr.pyx":193
5628
5551
  * return True
5629
- * finally:
5630
- * if srs != NULL: # <<<<<<<<<<<<<<
5631
- * OSRRelease(srs)
5552
+ * else:
5553
+ * return False # <<<<<<<<<<<<<<
5554
+ *
5632
5555
  *
5633
5556
  */
5634
- }
5635
- __pyx_r = __pyx_t_13;
5636
- __pyx_t_13 = 0;
5637
- goto __pyx_L0;
5638
- }
5557
+ /*else*/ {
5558
+ __Pyx_XDECREF(__pyx_r);
5559
+ __Pyx_INCREF(Py_False);
5560
+ __pyx_r = Py_False;
5561
+ goto __pyx_L0;
5639
5562
  }
5640
5563
 
5641
5564
  /* "pyogrio/_ogr.pyx":172
@@ -5647,13 +5570,6 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_20has_proj_data(CYTHON_UNUSED PyObject
5647
5570
  */
5648
5571
 
5649
5572
  /* function exit code */
5650
- __pyx_L1_error:;
5651
- __Pyx_XDECREF(__pyx_t_6);
5652
- __Pyx_XDECREF(__pyx_t_7);
5653
- __Pyx_XDECREF(__pyx_t_8);
5654
- __Pyx_XDECREF(__pyx_t_9);
5655
- __Pyx_AddTraceback("pyogrio._ogr.has_proj_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
5656
- __pyx_r = NULL;
5657
5573
  __pyx_L0:;
5658
5574
  __Pyx_XGIVEREF(__pyx_r);
5659
5575
  __Pyx_RefNannyFinishContext();
@@ -5664,13 +5580,13 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_20has_proj_data(CYTHON_UNUSED PyObject
5664
5580
  *
5665
5581
  *
5666
5582
  * def init_gdal_data(): # <<<<<<<<<<<<<<
5667
- * """Set GDAL data search directories in the following precedence:
5668
- * - wheel copy of gdal_data
5583
+ * """Set GDAL data search directories.
5584
+ *
5669
5585
  */
5670
5586
 
5671
5587
  /* Python wrapper */
5672
5588
  static PyObject *__pyx_pw_7pyogrio_4_ogr_23init_gdal_data(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5673
- PyDoc_STRVAR(__pyx_doc_7pyogrio_4_ogr_22init_gdal_data, "Set GDAL data search directories in the following precedence:\n - wheel copy of gdal_data\n - default detection by GDAL, including GDAL_DATA (detected automatically by GDAL)\n - other well-known paths under sys.prefix\n\n Adapted from Fiona (env.py, _env.pyx).\n ");
5589
+ PyDoc_STRVAR(__pyx_doc_7pyogrio_4_ogr_22init_gdal_data, "Set GDAL data search directories.\n\n They are set in the following precedence:\n - wheel copy of gdal_data\n - default detection by GDAL, including GDAL_DATA (detected automatically by GDAL)\n - other well-known paths under sys.prefix\n\n Adapted from Fiona (env.py, _env.pyx).\n ");
5674
5590
  static PyMethodDef __pyx_mdef_7pyogrio_4_ogr_23init_gdal_data = {"init_gdal_data", (PyCFunction)__pyx_pw_7pyogrio_4_ogr_23init_gdal_data, METH_NOARGS, __pyx_doc_7pyogrio_4_ogr_22init_gdal_data};
5675
5591
  static PyObject *__pyx_pw_7pyogrio_4_ogr_23init_gdal_data(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
5676
5592
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
@@ -5708,38 +5624,38 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5708
5624
  int __pyx_clineno = 0;
5709
5625
  __Pyx_RefNannySetupContext("init_gdal_data", 1);
5710
5626
 
5711
- /* "pyogrio/_ogr.pyx":206
5627
+ /* "pyogrio/_ogr.pyx":208
5712
5628
  *
5713
5629
  * # wheels are packaged to include GDAL data files at pyogrio/gdal_data
5714
5630
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "gdal_data")) # <<<<<<<<<<<<<<
5715
5631
  * if os.path.exists(wheel_path):
5716
5632
  * set_gdal_config_options({"GDAL_DATA": wheel_path})
5717
5633
  */
5718
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
5634
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
5719
5635
  __Pyx_GOTREF(__pyx_t_2);
5720
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
5636
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
5721
5637
  __Pyx_GOTREF(__pyx_t_3);
5722
5638
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5723
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
5639
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
5724
5640
  __Pyx_GOTREF(__pyx_t_2);
5725
5641
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5726
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
5642
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
5727
5643
  __Pyx_GOTREF(__pyx_t_4);
5728
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
5644
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error)
5729
5645
  __Pyx_GOTREF(__pyx_t_5);
5730
5646
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5731
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
5647
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
5732
5648
  __Pyx_GOTREF(__pyx_t_4);
5733
5649
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5734
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
5650
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
5735
5651
  __Pyx_GOTREF(__pyx_t_6);
5736
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error)
5652
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error)
5737
5653
  __Pyx_GOTREF(__pyx_t_7);
5738
5654
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5739
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
5655
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
5740
5656
  __Pyx_GOTREF(__pyx_t_6);
5741
5657
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5742
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error)
5658
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 208, __pyx_L1_error)
5743
5659
  __Pyx_GOTREF(__pyx_t_7);
5744
5660
  __pyx_t_8 = NULL;
5745
5661
  __pyx_t_9 = 0;
@@ -5760,7 +5676,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5760
5676
  __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
5761
5677
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5762
5678
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5763
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
5679
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error)
5764
5680
  __Pyx_GOTREF(__pyx_t_5);
5765
5681
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5766
5682
  }
@@ -5783,7 +5699,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5783
5699
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
5784
5700
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5785
5701
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5786
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
5702
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
5787
5703
  __Pyx_GOTREF(__pyx_t_3);
5788
5704
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5789
5705
  }
@@ -5806,26 +5722,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5806
5722
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
5807
5723
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5808
5724
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5809
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
5725
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
5810
5726
  __Pyx_GOTREF(__pyx_t_1);
5811
5727
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5812
5728
  }
5813
5729
  __pyx_v_wheel_path = __pyx_t_1;
5814
5730
  __pyx_t_1 = 0;
5815
5731
 
5816
- /* "pyogrio/_ogr.pyx":207
5732
+ /* "pyogrio/_ogr.pyx":209
5817
5733
  * # wheels are packaged to include GDAL data files at pyogrio/gdal_data
5818
5734
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "gdal_data"))
5819
5735
  * if os.path.exists(wheel_path): # <<<<<<<<<<<<<<
5820
5736
  * set_gdal_config_options({"GDAL_DATA": wheel_path})
5821
5737
  * if not has_gdal_data():
5822
5738
  */
5823
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
5739
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
5824
5740
  __Pyx_GOTREF(__pyx_t_2);
5825
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
5741
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
5826
5742
  __Pyx_GOTREF(__pyx_t_3);
5827
5743
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5828
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
5744
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
5829
5745
  __Pyx_GOTREF(__pyx_t_2);
5830
5746
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5831
5747
  __pyx_t_3 = NULL;
@@ -5846,26 +5762,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5846
5762
  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_wheel_path};
5847
5763
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
5848
5764
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5849
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
5765
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
5850
5766
  __Pyx_GOTREF(__pyx_t_1);
5851
5767
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5852
5768
  }
5853
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 207, __pyx_L1_error)
5769
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 209, __pyx_L1_error)
5854
5770
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5855
5771
  if (__pyx_t_10) {
5856
5772
 
5857
- /* "pyogrio/_ogr.pyx":208
5773
+ /* "pyogrio/_ogr.pyx":210
5858
5774
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "gdal_data"))
5859
5775
  * if os.path.exists(wheel_path):
5860
5776
  * set_gdal_config_options({"GDAL_DATA": wheel_path}) # <<<<<<<<<<<<<<
5861
5777
  * if not has_gdal_data():
5862
- * raise ValueError("Could not correctly detect GDAL data files installed by pyogrio wheel")
5778
+ * raise ValueError(
5863
5779
  */
5864
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_gdal_config_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 208, __pyx_L1_error)
5780
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_gdal_config_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 210, __pyx_L1_error)
5865
5781
  __Pyx_GOTREF(__pyx_t_2);
5866
- __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
5782
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
5867
5783
  __Pyx_GOTREF(__pyx_t_3);
5868
- if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_GDAL_DATA, __pyx_v_wheel_path) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
5784
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_GDAL_DATA, __pyx_v_wheel_path) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
5869
5785
  __pyx_t_4 = NULL;
5870
5786
  __pyx_t_9 = 0;
5871
5787
  #if CYTHON_UNPACK_METHODS
@@ -5885,20 +5801,20 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5885
5801
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
5886
5802
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5887
5803
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5888
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
5804
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
5889
5805
  __Pyx_GOTREF(__pyx_t_1);
5890
5806
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5891
5807
  }
5892
5808
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5893
5809
 
5894
- /* "pyogrio/_ogr.pyx":209
5810
+ /* "pyogrio/_ogr.pyx":211
5895
5811
  * if os.path.exists(wheel_path):
5896
5812
  * set_gdal_config_options({"GDAL_DATA": wheel_path})
5897
5813
  * if not has_gdal_data(): # <<<<<<<<<<<<<<
5898
- * raise ValueError("Could not correctly detect GDAL data files installed by pyogrio wheel")
5899
- * return
5814
+ * raise ValueError(
5815
+ * "Could not correctly detect GDAL data files installed by pyogrio wheel"
5900
5816
  */
5901
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_gdal_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
5817
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_gdal_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error)
5902
5818
  __Pyx_GOTREF(__pyx_t_2);
5903
5819
  __pyx_t_3 = NULL;
5904
5820
  __pyx_t_9 = 0;
@@ -5918,40 +5834,40 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5918
5834
  PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
5919
5835
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
5920
5836
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5921
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
5837
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error)
5922
5838
  __Pyx_GOTREF(__pyx_t_1);
5923
5839
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5924
5840
  }
5925
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 209, __pyx_L1_error)
5841
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 211, __pyx_L1_error)
5926
5842
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5927
5843
  __pyx_t_11 = (!__pyx_t_10);
5928
5844
  if (unlikely(__pyx_t_11)) {
5929
5845
 
5930
- /* "pyogrio/_ogr.pyx":210
5846
+ /* "pyogrio/_ogr.pyx":212
5931
5847
  * set_gdal_config_options({"GDAL_DATA": wheel_path})
5932
5848
  * if not has_gdal_data():
5933
- * raise ValueError("Could not correctly detect GDAL data files installed by pyogrio wheel") # <<<<<<<<<<<<<<
5934
- * return
5935
- *
5849
+ * raise ValueError( # <<<<<<<<<<<<<<
5850
+ * "Could not correctly detect GDAL data files installed by pyogrio wheel"
5851
+ * )
5936
5852
  */
5937
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
5853
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
5938
5854
  __Pyx_GOTREF(__pyx_t_1);
5939
5855
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5940
5856
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5941
- __PYX_ERR(0, 210, __pyx_L1_error)
5857
+ __PYX_ERR(0, 212, __pyx_L1_error)
5942
5858
 
5943
- /* "pyogrio/_ogr.pyx":209
5859
+ /* "pyogrio/_ogr.pyx":211
5944
5860
  * if os.path.exists(wheel_path):
5945
5861
  * set_gdal_config_options({"GDAL_DATA": wheel_path})
5946
5862
  * if not has_gdal_data(): # <<<<<<<<<<<<<<
5947
- * raise ValueError("Could not correctly detect GDAL data files installed by pyogrio wheel")
5948
- * return
5863
+ * raise ValueError(
5864
+ * "Could not correctly detect GDAL data files installed by pyogrio wheel"
5949
5865
  */
5950
5866
  }
5951
5867
 
5952
- /* "pyogrio/_ogr.pyx":211
5953
- * if not has_gdal_data():
5954
- * raise ValueError("Could not correctly detect GDAL data files installed by pyogrio wheel")
5868
+ /* "pyogrio/_ogr.pyx":215
5869
+ * "Could not correctly detect GDAL data files installed by pyogrio wheel"
5870
+ * )
5955
5871
  * return # <<<<<<<<<<<<<<
5956
5872
  *
5957
5873
  * # GDAL correctly found data files from GDAL_DATA or compiled-in paths
@@ -5960,7 +5876,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5960
5876
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5961
5877
  goto __pyx_L0;
5962
5878
 
5963
- /* "pyogrio/_ogr.pyx":207
5879
+ /* "pyogrio/_ogr.pyx":209
5964
5880
  * # wheels are packaged to include GDAL data files at pyogrio/gdal_data
5965
5881
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "gdal_data"))
5966
5882
  * if os.path.exists(wheel_path): # <<<<<<<<<<<<<<
@@ -5969,14 +5885,14 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5969
5885
  */
5970
5886
  }
5971
5887
 
5972
- /* "pyogrio/_ogr.pyx":214
5888
+ /* "pyogrio/_ogr.pyx":218
5973
5889
  *
5974
5890
  * # GDAL correctly found data files from GDAL_DATA or compiled-in paths
5975
5891
  * if has_gdal_data(): # <<<<<<<<<<<<<<
5976
5892
  * return
5977
5893
  *
5978
5894
  */
5979
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_gdal_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
5895
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_gdal_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
5980
5896
  __Pyx_GOTREF(__pyx_t_2);
5981
5897
  __pyx_t_3 = NULL;
5982
5898
  __pyx_t_9 = 0;
@@ -5996,26 +5912,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
5996
5912
  PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
5997
5913
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
5998
5914
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5999
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
5915
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
6000
5916
  __Pyx_GOTREF(__pyx_t_1);
6001
5917
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6002
5918
  }
6003
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 214, __pyx_L1_error)
5919
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 218, __pyx_L1_error)
6004
5920
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6005
5921
  if (__pyx_t_11) {
6006
5922
 
6007
- /* "pyogrio/_ogr.pyx":215
5923
+ /* "pyogrio/_ogr.pyx":219
6008
5924
  * # GDAL correctly found data files from GDAL_DATA or compiled-in paths
6009
5925
  * if has_gdal_data():
6010
5926
  * return # <<<<<<<<<<<<<<
6011
5927
  *
6012
- * wk_path = os.path.join(sys.prefix, 'share', 'gdal')
5928
+ * wk_path = os.path.join(sys.prefix, "share", "gdal")
6013
5929
  */
6014
5930
  __Pyx_XDECREF(__pyx_r);
6015
5931
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6016
5932
  goto __pyx_L0;
6017
5933
 
6018
- /* "pyogrio/_ogr.pyx":214
5934
+ /* "pyogrio/_ogr.pyx":218
6019
5935
  *
6020
5936
  * # GDAL correctly found data files from GDAL_DATA or compiled-in paths
6021
5937
  * if has_gdal_data(): # <<<<<<<<<<<<<<
@@ -6024,24 +5940,24 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6024
5940
  */
6025
5941
  }
6026
5942
 
6027
- /* "pyogrio/_ogr.pyx":217
5943
+ /* "pyogrio/_ogr.pyx":221
6028
5944
  * return
6029
5945
  *
6030
- * wk_path = os.path.join(sys.prefix, 'share', 'gdal') # <<<<<<<<<<<<<<
5946
+ * wk_path = os.path.join(sys.prefix, "share", "gdal") # <<<<<<<<<<<<<<
6031
5947
  * if os.path.exists(wk_path):
6032
5948
  * set_gdal_config_options({"GDAL_DATA": wk_path})
6033
5949
  */
6034
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
5950
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
6035
5951
  __Pyx_GOTREF(__pyx_t_2);
6036
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
5952
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
6037
5953
  __Pyx_GOTREF(__pyx_t_3);
6038
5954
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6039
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
5955
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
6040
5956
  __Pyx_GOTREF(__pyx_t_2);
6041
5957
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6042
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 217, __pyx_L1_error)
5958
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
6043
5959
  __Pyx_GOTREF(__pyx_t_3);
6044
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 217, __pyx_L1_error)
5960
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error)
6045
5961
  __Pyx_GOTREF(__pyx_t_4);
6046
5962
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6047
5963
  __pyx_t_3 = NULL;
@@ -6063,26 +5979,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6063
5979
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9);
6064
5980
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6065
5981
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6066
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
5982
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
6067
5983
  __Pyx_GOTREF(__pyx_t_1);
6068
5984
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6069
5985
  }
6070
5986
  __pyx_v_wk_path = __pyx_t_1;
6071
5987
  __pyx_t_1 = 0;
6072
5988
 
6073
- /* "pyogrio/_ogr.pyx":218
5989
+ /* "pyogrio/_ogr.pyx":222
6074
5990
  *
6075
- * wk_path = os.path.join(sys.prefix, 'share', 'gdal')
5991
+ * wk_path = os.path.join(sys.prefix, "share", "gdal")
6076
5992
  * if os.path.exists(wk_path): # <<<<<<<<<<<<<<
6077
5993
  * set_gdal_config_options({"GDAL_DATA": wk_path})
6078
5994
  * if not has_gdal_data():
6079
5995
  */
6080
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
5996
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
6081
5997
  __Pyx_GOTREF(__pyx_t_2);
6082
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
5998
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
6083
5999
  __Pyx_GOTREF(__pyx_t_4);
6084
6000
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6085
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
6001
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
6086
6002
  __Pyx_GOTREF(__pyx_t_2);
6087
6003
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6088
6004
  __pyx_t_4 = NULL;
@@ -6103,26 +6019,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6103
6019
  PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_wk_path};
6104
6020
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
6105
6021
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6106
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
6022
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
6107
6023
  __Pyx_GOTREF(__pyx_t_1);
6108
6024
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6109
6025
  }
6110
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 218, __pyx_L1_error)
6026
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 222, __pyx_L1_error)
6111
6027
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6112
6028
  if (__pyx_t_11) {
6113
6029
 
6114
- /* "pyogrio/_ogr.pyx":219
6115
- * wk_path = os.path.join(sys.prefix, 'share', 'gdal')
6030
+ /* "pyogrio/_ogr.pyx":223
6031
+ * wk_path = os.path.join(sys.prefix, "share", "gdal")
6116
6032
  * if os.path.exists(wk_path):
6117
6033
  * set_gdal_config_options({"GDAL_DATA": wk_path}) # <<<<<<<<<<<<<<
6118
6034
  * if not has_gdal_data():
6119
- * raise ValueError(f"Found GDAL data directory at {wk_path} but it does not appear to correctly contain GDAL data files")
6035
+ * raise ValueError(
6120
6036
  */
6121
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_gdal_config_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
6037
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_gdal_config_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
6122
6038
  __Pyx_GOTREF(__pyx_t_2);
6123
- __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 219, __pyx_L1_error)
6039
+ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
6124
6040
  __Pyx_GOTREF(__pyx_t_4);
6125
- if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_GDAL_DATA, __pyx_v_wk_path) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
6041
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_GDAL_DATA, __pyx_v_wk_path) < 0) __PYX_ERR(0, 223, __pyx_L1_error)
6126
6042
  __pyx_t_3 = NULL;
6127
6043
  __pyx_t_9 = 0;
6128
6044
  #if CYTHON_UNPACK_METHODS
@@ -6142,20 +6058,20 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6142
6058
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
6143
6059
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6144
6060
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6145
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
6061
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
6146
6062
  __Pyx_GOTREF(__pyx_t_1);
6147
6063
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6148
6064
  }
6149
6065
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6150
6066
 
6151
- /* "pyogrio/_ogr.pyx":220
6067
+ /* "pyogrio/_ogr.pyx":224
6152
6068
  * if os.path.exists(wk_path):
6153
6069
  * set_gdal_config_options({"GDAL_DATA": wk_path})
6154
6070
  * if not has_gdal_data(): # <<<<<<<<<<<<<<
6155
- * raise ValueError(f"Found GDAL data directory at {wk_path} but it does not appear to correctly contain GDAL data files")
6156
- * return
6071
+ * raise ValueError(
6072
+ * f"Found GDAL data directory at {wk_path} but it does not appear to "
6157
6073
  */
6158
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_gdal_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 220, __pyx_L1_error)
6074
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_gdal_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
6159
6075
  __Pyx_GOTREF(__pyx_t_2);
6160
6076
  __pyx_t_4 = NULL;
6161
6077
  __pyx_t_9 = 0;
@@ -6175,23 +6091,23 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6175
6091
  PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
6176
6092
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
6177
6093
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6178
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
6094
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
6179
6095
  __Pyx_GOTREF(__pyx_t_1);
6180
6096
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6181
6097
  }
6182
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 220, __pyx_L1_error)
6098
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 224, __pyx_L1_error)
6183
6099
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6184
6100
  __pyx_t_10 = (!__pyx_t_11);
6185
6101
  if (unlikely(__pyx_t_10)) {
6186
6102
 
6187
- /* "pyogrio/_ogr.pyx":221
6188
- * set_gdal_config_options({"GDAL_DATA": wk_path})
6103
+ /* "pyogrio/_ogr.pyx":226
6189
6104
  * if not has_gdal_data():
6190
- * raise ValueError(f"Found GDAL data directory at {wk_path} but it does not appear to correctly contain GDAL data files") # <<<<<<<<<<<<<<
6191
- * return
6192
- *
6105
+ * raise ValueError(
6106
+ * f"Found GDAL data directory at {wk_path} but it does not appear to " # <<<<<<<<<<<<<<
6107
+ * "correctly contain GDAL data files"
6108
+ * )
6193
6109
  */
6194
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
6110
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
6195
6111
  __Pyx_GOTREF(__pyx_t_1);
6196
6112
  __pyx_t_12 = 0;
6197
6113
  __pyx_t_13 = 127;
@@ -6199,7 +6115,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6199
6115
  __pyx_t_12 += 29;
6200
6116
  __Pyx_GIVEREF(__pyx_kp_u_Found_GDAL_data_directory_at);
6201
6117
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Found_GDAL_data_directory_at);
6202
- __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_wk_path, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
6118
+ __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_wk_path, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
6203
6119
  __Pyx_GOTREF(__pyx_t_2);
6204
6120
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_13;
6205
6121
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
@@ -6210,58 +6126,74 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6210
6126
  __pyx_t_12 += 60;
6211
6127
  __Pyx_GIVEREF(__pyx_kp_u_but_it_does_not_appear_to_corre);
6212
6128
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_but_it_does_not_appear_to_corre);
6213
- __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 221, __pyx_L1_error)
6129
+ __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
6214
6130
  __Pyx_GOTREF(__pyx_t_2);
6215
6131
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6216
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 221, __pyx_L1_error)
6132
+
6133
+ /* "pyogrio/_ogr.pyx":225
6134
+ * set_gdal_config_options({"GDAL_DATA": wk_path})
6135
+ * if not has_gdal_data():
6136
+ * raise ValueError( # <<<<<<<<<<<<<<
6137
+ * f"Found GDAL data directory at {wk_path} but it does not appear to "
6138
+ * "correctly contain GDAL data files"
6139
+ */
6140
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
6217
6141
  __Pyx_GOTREF(__pyx_t_1);
6218
6142
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6219
6143
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6220
6144
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6221
- __PYX_ERR(0, 221, __pyx_L1_error)
6145
+ __PYX_ERR(0, 225, __pyx_L1_error)
6222
6146
 
6223
- /* "pyogrio/_ogr.pyx":220
6147
+ /* "pyogrio/_ogr.pyx":224
6224
6148
  * if os.path.exists(wk_path):
6225
6149
  * set_gdal_config_options({"GDAL_DATA": wk_path})
6226
6150
  * if not has_gdal_data(): # <<<<<<<<<<<<<<
6227
- * raise ValueError(f"Found GDAL data directory at {wk_path} but it does not appear to correctly contain GDAL data files")
6228
- * return
6151
+ * raise ValueError(
6152
+ * f"Found GDAL data directory at {wk_path} but it does not appear to "
6229
6153
  */
6230
6154
  }
6231
6155
 
6232
- /* "pyogrio/_ogr.pyx":222
6233
- * if not has_gdal_data():
6234
- * raise ValueError(f"Found GDAL data directory at {wk_path} but it does not appear to correctly contain GDAL data files")
6156
+ /* "pyogrio/_ogr.pyx":229
6157
+ * "correctly contain GDAL data files"
6158
+ * )
6235
6159
  * return # <<<<<<<<<<<<<<
6236
6160
  *
6237
- * warnings.warn("Could not detect GDAL data files. Set GDAL_DATA environment variable to the correct path.", RuntimeWarning)
6161
+ * warnings.warn(
6238
6162
  */
6239
6163
  __Pyx_XDECREF(__pyx_r);
6240
6164
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6241
6165
  goto __pyx_L0;
6242
6166
 
6243
- /* "pyogrio/_ogr.pyx":218
6167
+ /* "pyogrio/_ogr.pyx":222
6244
6168
  *
6245
- * wk_path = os.path.join(sys.prefix, 'share', 'gdal')
6169
+ * wk_path = os.path.join(sys.prefix, "share", "gdal")
6246
6170
  * if os.path.exists(wk_path): # <<<<<<<<<<<<<<
6247
6171
  * set_gdal_config_options({"GDAL_DATA": wk_path})
6248
6172
  * if not has_gdal_data():
6249
6173
  */
6250
6174
  }
6251
6175
 
6252
- /* "pyogrio/_ogr.pyx":224
6176
+ /* "pyogrio/_ogr.pyx":231
6253
6177
  * return
6254
6178
  *
6255
- * warnings.warn("Could not detect GDAL data files. Set GDAL_DATA environment variable to the correct path.", RuntimeWarning) # <<<<<<<<<<<<<<
6256
- *
6257
- *
6179
+ * warnings.warn( # <<<<<<<<<<<<<<
6180
+ * "Could not detect GDAL data files. Set GDAL_DATA environment variable to the "
6181
+ * "correct path.",
6258
6182
  */
6259
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
6183
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6260
6184
  __Pyx_GOTREF(__pyx_t_1);
6261
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
6185
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
6262
6186
  __Pyx_GOTREF(__pyx_t_2);
6263
6187
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6264
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
6188
+
6189
+ /* "pyogrio/_ogr.pyx":234
6190
+ * "Could not detect GDAL data files. Set GDAL_DATA environment variable to the "
6191
+ * "correct path.",
6192
+ * RuntimeWarning # <<<<<<<<<<<<<<
6193
+ * )
6194
+ *
6195
+ */
6196
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6265
6197
  __Pyx_GOTREF(__pyx_t_1);
6266
6198
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6267
6199
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -6270,8 +6202,8 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6270
6202
  *
6271
6203
  *
6272
6204
  * def init_gdal_data(): # <<<<<<<<<<<<<<
6273
- * """Set GDAL data search directories in the following precedence:
6274
- * - wheel copy of gdal_data
6205
+ * """Set GDAL data search directories.
6206
+ *
6275
6207
  */
6276
6208
 
6277
6209
  /* function exit code */
@@ -6296,7 +6228,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_22init_gdal_data(CYTHON_UNUSED PyObject
6296
6228
  return __pyx_r;
6297
6229
  }
6298
6230
 
6299
- /* "pyogrio/_ogr.pyx":227
6231
+ /* "pyogrio/_ogr.pyx":238
6300
6232
  *
6301
6233
  *
6302
6234
  * def init_proj_data(): # <<<<<<<<<<<<<<
@@ -6344,38 +6276,38 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6344
6276
  int __pyx_clineno = 0;
6345
6277
  __Pyx_RefNannySetupContext("init_proj_data", 1);
6346
6278
 
6347
- /* "pyogrio/_ogr.pyx":237
6279
+ /* "pyogrio/_ogr.pyx":248
6348
6280
  *
6349
6281
  * # wheels are packaged to include PROJ data files at pyogrio/proj_data
6350
6282
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "proj_data")) # <<<<<<<<<<<<<<
6351
6283
  * if os.path.exists(wheel_path):
6352
6284
  * set_proj_search_path(wheel_path)
6353
6285
  */
6354
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
6286
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
6355
6287
  __Pyx_GOTREF(__pyx_t_2);
6356
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
6288
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
6357
6289
  __Pyx_GOTREF(__pyx_t_3);
6358
6290
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6359
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
6291
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
6360
6292
  __Pyx_GOTREF(__pyx_t_2);
6361
6293
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6362
- __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
6294
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
6363
6295
  __Pyx_GOTREF(__pyx_t_4);
6364
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error)
6296
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
6365
6297
  __Pyx_GOTREF(__pyx_t_5);
6366
6298
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6367
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
6299
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
6368
6300
  __Pyx_GOTREF(__pyx_t_4);
6369
6301
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6370
- __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
6302
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
6371
6303
  __Pyx_GOTREF(__pyx_t_6);
6372
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
6304
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error)
6373
6305
  __Pyx_GOTREF(__pyx_t_7);
6374
6306
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6375
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
6307
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_dirname); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
6376
6308
  __Pyx_GOTREF(__pyx_t_6);
6377
6309
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6378
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 237, __pyx_L1_error)
6310
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_file); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 248, __pyx_L1_error)
6379
6311
  __Pyx_GOTREF(__pyx_t_7);
6380
6312
  __pyx_t_8 = NULL;
6381
6313
  __pyx_t_9 = 0;
@@ -6396,7 +6328,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6396
6328
  __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
6397
6329
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6398
6330
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6399
- if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 237, __pyx_L1_error)
6331
+ if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
6400
6332
  __Pyx_GOTREF(__pyx_t_5);
6401
6333
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6402
6334
  }
@@ -6419,7 +6351,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6419
6351
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
6420
6352
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6421
6353
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6422
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
6354
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
6423
6355
  __Pyx_GOTREF(__pyx_t_3);
6424
6356
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6425
6357
  }
@@ -6442,26 +6374,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6442
6374
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
6443
6375
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6444
6376
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6445
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
6377
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error)
6446
6378
  __Pyx_GOTREF(__pyx_t_1);
6447
6379
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6448
6380
  }
6449
6381
  __pyx_v_wheel_path = __pyx_t_1;
6450
6382
  __pyx_t_1 = 0;
6451
6383
 
6452
- /* "pyogrio/_ogr.pyx":238
6384
+ /* "pyogrio/_ogr.pyx":249
6453
6385
  * # wheels are packaged to include PROJ data files at pyogrio/proj_data
6454
6386
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "proj_data"))
6455
6387
  * if os.path.exists(wheel_path): # <<<<<<<<<<<<<<
6456
6388
  * set_proj_search_path(wheel_path)
6457
6389
  * # verify that this now resolves
6458
6390
  */
6459
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
6391
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
6460
6392
  __Pyx_GOTREF(__pyx_t_2);
6461
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
6393
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
6462
6394
  __Pyx_GOTREF(__pyx_t_3);
6463
6395
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6464
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 238, __pyx_L1_error)
6396
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
6465
6397
  __Pyx_GOTREF(__pyx_t_2);
6466
6398
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6467
6399
  __pyx_t_3 = NULL;
@@ -6482,32 +6414,32 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6482
6414
  PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_wheel_path};
6483
6415
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
6484
6416
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6485
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 238, __pyx_L1_error)
6417
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
6486
6418
  __Pyx_GOTREF(__pyx_t_1);
6487
6419
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6488
6420
  }
6489
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 238, __pyx_L1_error)
6421
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 249, __pyx_L1_error)
6490
6422
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6491
6423
  if (__pyx_t_10) {
6492
6424
 
6493
- /* "pyogrio/_ogr.pyx":239
6425
+ /* "pyogrio/_ogr.pyx":250
6494
6426
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "proj_data"))
6495
6427
  * if os.path.exists(wheel_path):
6496
6428
  * set_proj_search_path(wheel_path) # <<<<<<<<<<<<<<
6497
6429
  * # verify that this now resolves
6498
6430
  * if not has_proj_data():
6499
6431
  */
6500
- if (!(likely(PyUnicode_CheckExact(__pyx_v_wheel_path))||((__pyx_v_wheel_path) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_wheel_path))) __PYX_ERR(0, 239, __pyx_L1_error)
6501
- __pyx_f_7pyogrio_4_ogr_set_proj_search_path(((PyObject*)__pyx_v_wheel_path)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error)
6432
+ if (!(likely(PyUnicode_CheckExact(__pyx_v_wheel_path))||((__pyx_v_wheel_path) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_wheel_path))) __PYX_ERR(0, 250, __pyx_L1_error)
6433
+ __pyx_f_7pyogrio_4_ogr_set_proj_search_path(((PyObject*)__pyx_v_wheel_path)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
6502
6434
 
6503
- /* "pyogrio/_ogr.pyx":241
6435
+ /* "pyogrio/_ogr.pyx":252
6504
6436
  * set_proj_search_path(wheel_path)
6505
6437
  * # verify that this now resolves
6506
6438
  * if not has_proj_data(): # <<<<<<<<<<<<<<
6507
- * raise ValueError("Could not correctly detect PROJ data files installed by pyogrio wheel")
6508
- * return
6439
+ * raise ValueError(
6440
+ * "Could not correctly detect PROJ data files installed by pyogrio wheel"
6509
6441
  */
6510
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_proj_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
6442
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_proj_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error)
6511
6443
  __Pyx_GOTREF(__pyx_t_2);
6512
6444
  __pyx_t_3 = NULL;
6513
6445
  __pyx_t_9 = 0;
@@ -6527,40 +6459,40 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6527
6459
  PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
6528
6460
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
6529
6461
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6530
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
6462
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error)
6531
6463
  __Pyx_GOTREF(__pyx_t_1);
6532
6464
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6533
6465
  }
6534
- __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 241, __pyx_L1_error)
6466
+ __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 252, __pyx_L1_error)
6535
6467
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6536
6468
  __pyx_t_11 = (!__pyx_t_10);
6537
6469
  if (unlikely(__pyx_t_11)) {
6538
6470
 
6539
- /* "pyogrio/_ogr.pyx":242
6471
+ /* "pyogrio/_ogr.pyx":253
6540
6472
  * # verify that this now resolves
6541
6473
  * if not has_proj_data():
6542
- * raise ValueError("Could not correctly detect PROJ data files installed by pyogrio wheel") # <<<<<<<<<<<<<<
6543
- * return
6544
- *
6474
+ * raise ValueError( # <<<<<<<<<<<<<<
6475
+ * "Could not correctly detect PROJ data files installed by pyogrio wheel"
6476
+ * )
6545
6477
  */
6546
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
6478
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
6547
6479
  __Pyx_GOTREF(__pyx_t_1);
6548
6480
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6549
6481
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6550
- __PYX_ERR(0, 242, __pyx_L1_error)
6482
+ __PYX_ERR(0, 253, __pyx_L1_error)
6551
6483
 
6552
- /* "pyogrio/_ogr.pyx":241
6484
+ /* "pyogrio/_ogr.pyx":252
6553
6485
  * set_proj_search_path(wheel_path)
6554
6486
  * # verify that this now resolves
6555
6487
  * if not has_proj_data(): # <<<<<<<<<<<<<<
6556
- * raise ValueError("Could not correctly detect PROJ data files installed by pyogrio wheel")
6557
- * return
6488
+ * raise ValueError(
6489
+ * "Could not correctly detect PROJ data files installed by pyogrio wheel"
6558
6490
  */
6559
6491
  }
6560
6492
 
6561
- /* "pyogrio/_ogr.pyx":243
6562
- * if not has_proj_data():
6563
- * raise ValueError("Could not correctly detect PROJ data files installed by pyogrio wheel")
6493
+ /* "pyogrio/_ogr.pyx":256
6494
+ * "Could not correctly detect PROJ data files installed by pyogrio wheel"
6495
+ * )
6564
6496
  * return # <<<<<<<<<<<<<<
6565
6497
  *
6566
6498
  * # PROJ correctly found data files from PROJ_LIB or compiled-in paths
@@ -6569,7 +6501,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6569
6501
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6570
6502
  goto __pyx_L0;
6571
6503
 
6572
- /* "pyogrio/_ogr.pyx":238
6504
+ /* "pyogrio/_ogr.pyx":249
6573
6505
  * # wheels are packaged to include PROJ data files at pyogrio/proj_data
6574
6506
  * wheel_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "proj_data"))
6575
6507
  * if os.path.exists(wheel_path): # <<<<<<<<<<<<<<
@@ -6578,14 +6510,14 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6578
6510
  */
6579
6511
  }
6580
6512
 
6581
- /* "pyogrio/_ogr.pyx":246
6513
+ /* "pyogrio/_ogr.pyx":259
6582
6514
  *
6583
6515
  * # PROJ correctly found data files from PROJ_LIB or compiled-in paths
6584
6516
  * if has_proj_data(): # <<<<<<<<<<<<<<
6585
6517
  * return
6586
6518
  *
6587
6519
  */
6588
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_proj_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error)
6520
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_proj_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 259, __pyx_L1_error)
6589
6521
  __Pyx_GOTREF(__pyx_t_2);
6590
6522
  __pyx_t_3 = NULL;
6591
6523
  __pyx_t_9 = 0;
@@ -6605,26 +6537,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6605
6537
  PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
6606
6538
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
6607
6539
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6608
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 246, __pyx_L1_error)
6540
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
6609
6541
  __Pyx_GOTREF(__pyx_t_1);
6610
6542
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6611
6543
  }
6612
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 246, __pyx_L1_error)
6544
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 259, __pyx_L1_error)
6613
6545
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6614
6546
  if (__pyx_t_11) {
6615
6547
 
6616
- /* "pyogrio/_ogr.pyx":247
6548
+ /* "pyogrio/_ogr.pyx":260
6617
6549
  * # PROJ correctly found data files from PROJ_LIB or compiled-in paths
6618
6550
  * if has_proj_data():
6619
6551
  * return # <<<<<<<<<<<<<<
6620
6552
  *
6621
- * wk_path = os.path.join(sys.prefix, 'share', 'proj')
6553
+ * wk_path = os.path.join(sys.prefix, "share", "proj")
6622
6554
  */
6623
6555
  __Pyx_XDECREF(__pyx_r);
6624
6556
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6625
6557
  goto __pyx_L0;
6626
6558
 
6627
- /* "pyogrio/_ogr.pyx":246
6559
+ /* "pyogrio/_ogr.pyx":259
6628
6560
  *
6629
6561
  * # PROJ correctly found data files from PROJ_LIB or compiled-in paths
6630
6562
  * if has_proj_data(): # <<<<<<<<<<<<<<
@@ -6633,24 +6565,24 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6633
6565
  */
6634
6566
  }
6635
6567
 
6636
- /* "pyogrio/_ogr.pyx":249
6568
+ /* "pyogrio/_ogr.pyx":262
6637
6569
  * return
6638
6570
  *
6639
- * wk_path = os.path.join(sys.prefix, 'share', 'proj') # <<<<<<<<<<<<<<
6571
+ * wk_path = os.path.join(sys.prefix, "share", "proj") # <<<<<<<<<<<<<<
6640
6572
  * if os.path.exists(wk_path):
6641
6573
  * set_proj_search_path(wk_path)
6642
6574
  */
6643
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
6575
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
6644
6576
  __Pyx_GOTREF(__pyx_t_2);
6645
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
6577
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
6646
6578
  __Pyx_GOTREF(__pyx_t_3);
6647
6579
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6648
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 249, __pyx_L1_error)
6580
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 262, __pyx_L1_error)
6649
6581
  __Pyx_GOTREF(__pyx_t_2);
6650
6582
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6651
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
6583
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
6652
6584
  __Pyx_GOTREF(__pyx_t_3);
6653
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
6585
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L1_error)
6654
6586
  __Pyx_GOTREF(__pyx_t_4);
6655
6587
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6656
6588
  __pyx_t_3 = NULL;
@@ -6672,26 +6604,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6672
6604
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9);
6673
6605
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6674
6606
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6675
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error)
6607
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
6676
6608
  __Pyx_GOTREF(__pyx_t_1);
6677
6609
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6678
6610
  }
6679
6611
  __pyx_v_wk_path = __pyx_t_1;
6680
6612
  __pyx_t_1 = 0;
6681
6613
 
6682
- /* "pyogrio/_ogr.pyx":250
6614
+ /* "pyogrio/_ogr.pyx":263
6683
6615
  *
6684
- * wk_path = os.path.join(sys.prefix, 'share', 'proj')
6616
+ * wk_path = os.path.join(sys.prefix, "share", "proj")
6685
6617
  * if os.path.exists(wk_path): # <<<<<<<<<<<<<<
6686
6618
  * set_proj_search_path(wk_path)
6687
6619
  * # verify that this now resolves
6688
6620
  */
6689
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
6621
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
6690
6622
  __Pyx_GOTREF(__pyx_t_2);
6691
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
6623
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
6692
6624
  __Pyx_GOTREF(__pyx_t_4);
6693
6625
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6694
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
6626
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
6695
6627
  __Pyx_GOTREF(__pyx_t_2);
6696
6628
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6697
6629
  __pyx_t_4 = NULL;
@@ -6712,32 +6644,32 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6712
6644
  PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_wk_path};
6713
6645
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
6714
6646
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6715
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error)
6647
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
6716
6648
  __Pyx_GOTREF(__pyx_t_1);
6717
6649
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6718
6650
  }
6719
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 250, __pyx_L1_error)
6651
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 263, __pyx_L1_error)
6720
6652
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6721
6653
  if (__pyx_t_11) {
6722
6654
 
6723
- /* "pyogrio/_ogr.pyx":251
6724
- * wk_path = os.path.join(sys.prefix, 'share', 'proj')
6655
+ /* "pyogrio/_ogr.pyx":264
6656
+ * wk_path = os.path.join(sys.prefix, "share", "proj")
6725
6657
  * if os.path.exists(wk_path):
6726
6658
  * set_proj_search_path(wk_path) # <<<<<<<<<<<<<<
6727
6659
  * # verify that this now resolves
6728
6660
  * if not has_proj_data():
6729
6661
  */
6730
- if (!(likely(PyUnicode_CheckExact(__pyx_v_wk_path))||((__pyx_v_wk_path) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_wk_path))) __PYX_ERR(0, 251, __pyx_L1_error)
6731
- __pyx_f_7pyogrio_4_ogr_set_proj_search_path(((PyObject*)__pyx_v_wk_path)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 251, __pyx_L1_error)
6662
+ if (!(likely(PyUnicode_CheckExact(__pyx_v_wk_path))||((__pyx_v_wk_path) == Py_None) || __Pyx_RaiseUnexpectedTypeError("unicode", __pyx_v_wk_path))) __PYX_ERR(0, 264, __pyx_L1_error)
6663
+ __pyx_f_7pyogrio_4_ogr_set_proj_search_path(((PyObject*)__pyx_v_wk_path)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
6732
6664
 
6733
- /* "pyogrio/_ogr.pyx":253
6665
+ /* "pyogrio/_ogr.pyx":266
6734
6666
  * set_proj_search_path(wk_path)
6735
6667
  * # verify that this now resolves
6736
6668
  * if not has_proj_data(): # <<<<<<<<<<<<<<
6737
- * raise ValueError(f"Found PROJ data directory at {wk_path} but it does not appear to correctly contain PROJ data files")
6738
- * return
6669
+ * raise ValueError(
6670
+ * f"Found PROJ data directory at {wk_path} but it does not appear to "
6739
6671
  */
6740
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_proj_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
6672
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_has_proj_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 266, __pyx_L1_error)
6741
6673
  __Pyx_GOTREF(__pyx_t_2);
6742
6674
  __pyx_t_4 = NULL;
6743
6675
  __pyx_t_9 = 0;
@@ -6757,23 +6689,23 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6757
6689
  PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
6758
6690
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 0+__pyx_t_9);
6759
6691
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
6760
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
6692
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
6761
6693
  __Pyx_GOTREF(__pyx_t_1);
6762
6694
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6763
6695
  }
6764
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 253, __pyx_L1_error)
6696
+ __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 266, __pyx_L1_error)
6765
6697
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6766
6698
  __pyx_t_10 = (!__pyx_t_11);
6767
6699
  if (unlikely(__pyx_t_10)) {
6768
6700
 
6769
- /* "pyogrio/_ogr.pyx":254
6770
- * # verify that this now resolves
6701
+ /* "pyogrio/_ogr.pyx":268
6771
6702
  * if not has_proj_data():
6772
- * raise ValueError(f"Found PROJ data directory at {wk_path} but it does not appear to correctly contain PROJ data files") # <<<<<<<<<<<<<<
6773
- * return
6774
- *
6703
+ * raise ValueError(
6704
+ * f"Found PROJ data directory at {wk_path} but it does not appear to " # <<<<<<<<<<<<<<
6705
+ * "correctly contain PROJ data files"
6706
+ * )
6775
6707
  */
6776
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
6708
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
6777
6709
  __Pyx_GOTREF(__pyx_t_1);
6778
6710
  __pyx_t_12 = 0;
6779
6711
  __pyx_t_13 = 127;
@@ -6781,7 +6713,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6781
6713
  __pyx_t_12 += 29;
6782
6714
  __Pyx_GIVEREF(__pyx_kp_u_Found_PROJ_data_directory_at);
6783
6715
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Found_PROJ_data_directory_at);
6784
- __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_wk_path, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
6716
+ __pyx_t_2 = __Pyx_PyObject_FormatSimple(__pyx_v_wk_path, __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
6785
6717
  __Pyx_GOTREF(__pyx_t_2);
6786
6718
  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_13;
6787
6719
  __pyx_t_12 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2);
@@ -6792,63 +6724,79 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6792
6724
  __pyx_t_12 += 60;
6793
6725
  __Pyx_GIVEREF(__pyx_kp_u_but_it_does_not_appear_to_corre_2);
6794
6726
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_but_it_does_not_appear_to_corre_2);
6795
- __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 254, __pyx_L1_error)
6727
+ __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 268, __pyx_L1_error)
6796
6728
  __Pyx_GOTREF(__pyx_t_2);
6797
6729
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6798
- __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
6730
+
6731
+ /* "pyogrio/_ogr.pyx":267
6732
+ * # verify that this now resolves
6733
+ * if not has_proj_data():
6734
+ * raise ValueError( # <<<<<<<<<<<<<<
6735
+ * f"Found PROJ data directory at {wk_path} but it does not appear to "
6736
+ * "correctly contain PROJ data files"
6737
+ */
6738
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
6799
6739
  __Pyx_GOTREF(__pyx_t_1);
6800
6740
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6801
6741
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6802
6742
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6803
- __PYX_ERR(0, 254, __pyx_L1_error)
6743
+ __PYX_ERR(0, 267, __pyx_L1_error)
6804
6744
 
6805
- /* "pyogrio/_ogr.pyx":253
6745
+ /* "pyogrio/_ogr.pyx":266
6806
6746
  * set_proj_search_path(wk_path)
6807
6747
  * # verify that this now resolves
6808
6748
  * if not has_proj_data(): # <<<<<<<<<<<<<<
6809
- * raise ValueError(f"Found PROJ data directory at {wk_path} but it does not appear to correctly contain PROJ data files")
6810
- * return
6749
+ * raise ValueError(
6750
+ * f"Found PROJ data directory at {wk_path} but it does not appear to "
6811
6751
  */
6812
6752
  }
6813
6753
 
6814
- /* "pyogrio/_ogr.pyx":255
6815
- * if not has_proj_data():
6816
- * raise ValueError(f"Found PROJ data directory at {wk_path} but it does not appear to correctly contain PROJ data files")
6754
+ /* "pyogrio/_ogr.pyx":271
6755
+ * "correctly contain PROJ data files"
6756
+ * )
6817
6757
  * return # <<<<<<<<<<<<<<
6818
6758
  *
6819
- * warnings.warn("Could not detect PROJ data files. Set PROJ_LIB environment variable to the correct path.", RuntimeWarning)
6759
+ * warnings.warn(
6820
6760
  */
6821
6761
  __Pyx_XDECREF(__pyx_r);
6822
6762
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6823
6763
  goto __pyx_L0;
6824
6764
 
6825
- /* "pyogrio/_ogr.pyx":250
6765
+ /* "pyogrio/_ogr.pyx":263
6826
6766
  *
6827
- * wk_path = os.path.join(sys.prefix, 'share', 'proj')
6767
+ * wk_path = os.path.join(sys.prefix, "share", "proj")
6828
6768
  * if os.path.exists(wk_path): # <<<<<<<<<<<<<<
6829
6769
  * set_proj_search_path(wk_path)
6830
6770
  * # verify that this now resolves
6831
6771
  */
6832
6772
  }
6833
6773
 
6834
- /* "pyogrio/_ogr.pyx":257
6774
+ /* "pyogrio/_ogr.pyx":273
6835
6775
  * return
6836
6776
  *
6837
- * warnings.warn("Could not detect PROJ data files. Set PROJ_LIB environment variable to the correct path.", RuntimeWarning) # <<<<<<<<<<<<<<
6838
- *
6839
- *
6777
+ * warnings.warn( # <<<<<<<<<<<<<<
6778
+ * "Could not detect PROJ data files. Set PROJ_LIB environment variable to "
6779
+ * "the correct path.", RuntimeWarning)
6840
6780
  */
6841
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
6781
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
6842
6782
  __Pyx_GOTREF(__pyx_t_1);
6843
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
6783
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error)
6844
6784
  __Pyx_GOTREF(__pyx_t_2);
6845
6785
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6846
- __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
6786
+
6787
+ /* "pyogrio/_ogr.pyx":275
6788
+ * warnings.warn(
6789
+ * "Could not detect PROJ data files. Set PROJ_LIB environment variable to "
6790
+ * "the correct path.", RuntimeWarning) # <<<<<<<<<<<<<<
6791
+ *
6792
+ *
6793
+ */
6794
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
6847
6795
  __Pyx_GOTREF(__pyx_t_1);
6848
6796
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6849
6797
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6850
6798
 
6851
- /* "pyogrio/_ogr.pyx":227
6799
+ /* "pyogrio/_ogr.pyx":238
6852
6800
  *
6853
6801
  *
6854
6802
  * def init_proj_data(): # <<<<<<<<<<<<<<
@@ -6878,7 +6826,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_24init_proj_data(CYTHON_UNUSED PyObject
6878
6826
  return __pyx_r;
6879
6827
  }
6880
6828
 
6881
- /* "pyogrio/_ogr.pyx":260
6829
+ /* "pyogrio/_ogr.pyx":278
6882
6830
  *
6883
6831
  *
6884
6832
  * def _register_drivers(): # <<<<<<<<<<<<<<
@@ -6907,7 +6855,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_26_register_drivers(CYTHON_UNUSED PyObj
6907
6855
  __Pyx_RefNannyDeclarations
6908
6856
  __Pyx_RefNannySetupContext("_register_drivers", 1);
6909
6857
 
6910
- /* "pyogrio/_ogr.pyx":262
6858
+ /* "pyogrio/_ogr.pyx":280
6911
6859
  * def _register_drivers():
6912
6860
  * # Register all drivers
6913
6861
  * GDALAllRegister() # <<<<<<<<<<<<<<
@@ -6916,7 +6864,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_26_register_drivers(CYTHON_UNUSED PyObj
6916
6864
  */
6917
6865
  GDALAllRegister();
6918
6866
 
6919
- /* "pyogrio/_ogr.pyx":260
6867
+ /* "pyogrio/_ogr.pyx":278
6920
6868
  *
6921
6869
  *
6922
6870
  * def _register_drivers(): # <<<<<<<<<<<<<<
@@ -6931,7 +6879,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_26_register_drivers(CYTHON_UNUSED PyObj
6931
6879
  return __pyx_r;
6932
6880
  }
6933
6881
 
6934
- /* "pyogrio/_ogr.pyx":265
6882
+ /* "pyogrio/_ogr.pyx":283
6935
6883
  *
6936
6884
  *
6937
6885
  * def _get_driver_metadata_item(driver, metadata_item): # <<<<<<<<<<<<<<
@@ -6996,7 +6944,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
6996
6944
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
6997
6945
  kw_args--;
6998
6946
  }
6999
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error)
6947
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error)
7000
6948
  else goto __pyx_L5_argtuple_error;
7001
6949
  CYTHON_FALLTHROUGH;
7002
6950
  case 1:
@@ -7004,14 +6952,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
7004
6952
  (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
7005
6953
  kw_args--;
7006
6954
  }
7007
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L3_error)
6955
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 283, __pyx_L3_error)
7008
6956
  else {
7009
- __Pyx_RaiseArgtupleInvalid("_get_driver_metadata_item", 1, 2, 2, 1); __PYX_ERR(0, 265, __pyx_L3_error)
6957
+ __Pyx_RaiseArgtupleInvalid("_get_driver_metadata_item", 1, 2, 2, 1); __PYX_ERR(0, 283, __pyx_L3_error)
7010
6958
  }
7011
6959
  }
7012
6960
  if (unlikely(kw_args > 0)) {
7013
6961
  const Py_ssize_t kwd_pos_args = __pyx_nargs;
7014
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_driver_metadata_item") < 0)) __PYX_ERR(0, 265, __pyx_L3_error)
6962
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_driver_metadata_item") < 0)) __PYX_ERR(0, 283, __pyx_L3_error)
7015
6963
  }
7016
6964
  } else if (unlikely(__pyx_nargs != 2)) {
7017
6965
  goto __pyx_L5_argtuple_error;
@@ -7024,7 +6972,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
7024
6972
  }
7025
6973
  goto __pyx_L6_skip;
7026
6974
  __pyx_L5_argtuple_error:;
7027
- __Pyx_RaiseArgtupleInvalid("_get_driver_metadata_item", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 265, __pyx_L3_error)
6975
+ __Pyx_RaiseArgtupleInvalid("_get_driver_metadata_item", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 283, __pyx_L3_error)
7028
6976
  __pyx_L6_skip:;
7029
6977
  goto __pyx_L4_argument_unpacking_done;
7030
6978
  __pyx_L3_error:;
@@ -7089,7 +7037,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7089
7037
  int __pyx_clineno = 0;
7090
7038
  __Pyx_RefNannySetupContext("_get_driver_metadata_item", 1);
7091
7039
 
7092
- /* "pyogrio/_ogr.pyx":281
7040
+ /* "pyogrio/_ogr.pyx":299
7093
7041
  * Metadata item
7094
7042
  * """
7095
7043
  * cdef const char* metadata_c = NULL # <<<<<<<<<<<<<<
@@ -7098,7 +7046,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7098
7046
  */
7099
7047
  __pyx_v_metadata_c = NULL;
7100
7048
 
7101
- /* "pyogrio/_ogr.pyx":282
7049
+ /* "pyogrio/_ogr.pyx":300
7102
7050
  * """
7103
7051
  * cdef const char* metadata_c = NULL
7104
7052
  * cdef void *cogr_driver = NULL # <<<<<<<<<<<<<<
@@ -7107,11 +7055,11 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7107
7055
  */
7108
7056
  __pyx_v_cogr_driver = NULL;
7109
7057
 
7110
- /* "pyogrio/_ogr.pyx":284
7058
+ /* "pyogrio/_ogr.pyx":302
7111
7059
  * cdef void *cogr_driver = NULL
7112
7060
  *
7113
7061
  * try: # <<<<<<<<<<<<<<
7114
- * cogr_driver = exc_wrap_pointer(GDALGetDriverByName(driver.encode('UTF-8')))
7062
+ * cogr_driver = check_pointer(GDALGetDriverByName(driver.encode("UTF-8")))
7115
7063
  * except NullPointerError:
7116
7064
  */
7117
7065
  {
@@ -7123,14 +7071,14 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7123
7071
  __Pyx_XGOTREF(__pyx_t_3);
7124
7072
  /*try:*/ {
7125
7073
 
7126
- /* "pyogrio/_ogr.pyx":285
7074
+ /* "pyogrio/_ogr.pyx":303
7127
7075
  *
7128
7076
  * try:
7129
- * cogr_driver = exc_wrap_pointer(GDALGetDriverByName(driver.encode('UTF-8'))) # <<<<<<<<<<<<<<
7077
+ * cogr_driver = check_pointer(GDALGetDriverByName(driver.encode("UTF-8"))) # <<<<<<<<<<<<<<
7130
7078
  * except NullPointerError:
7131
7079
  * raise DataSourceError(
7132
7080
  */
7133
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L3_error)
7081
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_driver, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 303, __pyx_L3_error)
7134
7082
  __Pyx_GOTREF(__pyx_t_5);
7135
7083
  __pyx_t_6 = NULL;
7136
7084
  __pyx_t_7 = 0;
@@ -7150,20 +7098,20 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7150
7098
  PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_UTF_8};
7151
7099
  __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
7152
7100
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7153
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L3_error)
7101
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L3_error)
7154
7102
  __Pyx_GOTREF(__pyx_t_4);
7155
7103
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7156
7104
  }
7157
- __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L3_error)
7158
- __pyx_t_9 = __pyx_f_7pyogrio_4_err_exc_wrap_pointer(GDALGetDriverByName(__pyx_t_8)); if (unlikely(__pyx_t_9 == ((void *)NULL))) __PYX_ERR(0, 285, __pyx_L3_error)
7105
+ __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) __PYX_ERR(0, 303, __pyx_L3_error)
7106
+ __pyx_t_9 = __pyx_f_7pyogrio_4_err_check_pointer(GDALGetDriverByName(__pyx_t_8)); if (unlikely(__pyx_t_9 == ((void *)NULL))) __PYX_ERR(0, 303, __pyx_L3_error)
7159
7107
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7160
7108
  __pyx_v_cogr_driver = __pyx_t_9;
7161
7109
 
7162
- /* "pyogrio/_ogr.pyx":284
7110
+ /* "pyogrio/_ogr.pyx":302
7163
7111
  * cdef void *cogr_driver = NULL
7164
7112
  *
7165
7113
  * try: # <<<<<<<<<<<<<<
7166
- * cogr_driver = exc_wrap_pointer(GDALGetDriverByName(driver.encode('UTF-8')))
7114
+ * cogr_driver = check_pointer(GDALGetDriverByName(driver.encode("UTF-8")))
7167
7115
  * except NullPointerError:
7168
7116
  */
7169
7117
  }
@@ -7176,15 +7124,15 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7176
7124
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7177
7125
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7178
7126
 
7179
- /* "pyogrio/_ogr.pyx":286
7127
+ /* "pyogrio/_ogr.pyx":304
7180
7128
  * try:
7181
- * cogr_driver = exc_wrap_pointer(GDALGetDriverByName(driver.encode('UTF-8')))
7129
+ * cogr_driver = check_pointer(GDALGetDriverByName(driver.encode("UTF-8")))
7182
7130
  * except NullPointerError: # <<<<<<<<<<<<<<
7183
7131
  * raise DataSourceError(
7184
7132
  * f"Could not obtain driver: {driver} (check that it was installed "
7185
7133
  */
7186
7134
  __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
7187
- __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NullPointerError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 286, __pyx_L5_except_error)
7135
+ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_NullPointerError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 304, __pyx_L5_except_error)
7188
7136
  __Pyx_GOTREF(__pyx_t_10);
7189
7137
  __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_10);
7190
7138
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -7192,29 +7140,29 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7192
7140
  __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
7193
7141
  if (__pyx_t_11) {
7194
7142
  __Pyx_AddTraceback("pyogrio._ogr._get_driver_metadata_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
7195
- if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 286, __pyx_L5_except_error)
7143
+ if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 304, __pyx_L5_except_error)
7196
7144
  __Pyx_XGOTREF(__pyx_t_6);
7197
7145
  __Pyx_XGOTREF(__pyx_t_5);
7198
7146
  __Pyx_XGOTREF(__pyx_t_4);
7199
7147
 
7200
- /* "pyogrio/_ogr.pyx":287
7201
- * cogr_driver = exc_wrap_pointer(GDALGetDriverByName(driver.encode('UTF-8')))
7148
+ /* "pyogrio/_ogr.pyx":305
7149
+ * cogr_driver = check_pointer(GDALGetDriverByName(driver.encode("UTF-8")))
7202
7150
  * except NullPointerError:
7203
7151
  * raise DataSourceError( # <<<<<<<<<<<<<<
7204
7152
  * f"Could not obtain driver: {driver} (check that it was installed "
7205
7153
  * "correctly into GDAL)"
7206
7154
  */
7207
- __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_DataSourceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 287, __pyx_L5_except_error)
7155
+ __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_DataSourceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 305, __pyx_L5_except_error)
7208
7156
  __Pyx_GOTREF(__pyx_t_12);
7209
7157
 
7210
- /* "pyogrio/_ogr.pyx":288
7158
+ /* "pyogrio/_ogr.pyx":306
7211
7159
  * except NullPointerError:
7212
7160
  * raise DataSourceError(
7213
7161
  * f"Could not obtain driver: {driver} (check that it was installed " # <<<<<<<<<<<<<<
7214
7162
  * "correctly into GDAL)"
7215
7163
  * )
7216
7164
  */
7217
- __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 288, __pyx_L5_except_error)
7165
+ __pyx_t_13 = PyTuple_New(3); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 306, __pyx_L5_except_error)
7218
7166
  __Pyx_GOTREF(__pyx_t_13);
7219
7167
  __pyx_t_14 = 0;
7220
7168
  __pyx_t_15 = 127;
@@ -7222,7 +7170,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7222
7170
  __pyx_t_14 += 25;
7223
7171
  __Pyx_GIVEREF(__pyx_kp_u_Could_not_obtain_driver);
7224
7172
  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_kp_u_Could_not_obtain_driver);
7225
- __pyx_t_16 = __Pyx_PyObject_FormatSimple(__pyx_v_driver, __pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 288, __pyx_L5_except_error)
7173
+ __pyx_t_16 = __Pyx_PyObject_FormatSimple(__pyx_v_driver, __pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 306, __pyx_L5_except_error)
7226
7174
  __Pyx_GOTREF(__pyx_t_16);
7227
7175
  __pyx_t_15 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) > __pyx_t_15) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16) : __pyx_t_15;
7228
7176
  __pyx_t_14 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16);
@@ -7233,7 +7181,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7233
7181
  __pyx_t_14 += 50;
7234
7182
  __Pyx_GIVEREF(__pyx_kp_u_check_that_it_was_installed_cor);
7235
7183
  PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_kp_u_check_that_it_was_installed_cor);
7236
- __pyx_t_16 = __Pyx_PyUnicode_Join(__pyx_t_13, 3, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 288, __pyx_L5_except_error)
7184
+ __pyx_t_16 = __Pyx_PyUnicode_Join(__pyx_t_13, 3, __pyx_t_14, __pyx_t_15); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 306, __pyx_L5_except_error)
7237
7185
  __Pyx_GOTREF(__pyx_t_16);
7238
7186
  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7239
7187
  __pyx_t_13 = NULL;
@@ -7255,16 +7203,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7255
7203
  __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
7256
7204
  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7257
7205
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7258
- if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 287, __pyx_L5_except_error)
7206
+ if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 305, __pyx_L5_except_error)
7259
7207
  __Pyx_GOTREF(__pyx_t_10);
7260
7208
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7261
7209
  }
7262
7210
  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7263
7211
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7264
- __PYX_ERR(0, 287, __pyx_L5_except_error)
7212
+ __PYX_ERR(0, 305, __pyx_L5_except_error)
7265
7213
  }
7266
7214
 
7267
- /* "pyogrio/_ogr.pyx":291
7215
+ /* "pyogrio/_ogr.pyx":309
7268
7216
  * "correctly into GDAL)"
7269
7217
  * )
7270
7218
  * except CPLE_BaseError as exc: # <<<<<<<<<<<<<<
@@ -7272,7 +7220,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7272
7220
  *
7273
7221
  */
7274
7222
  __Pyx_ErrFetch(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
7275
- __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 291, __pyx_L5_except_error)
7223
+ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 309, __pyx_L5_except_error)
7276
7224
  __Pyx_GOTREF(__pyx_t_10);
7277
7225
  __pyx_t_11 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_4, __pyx_t_10);
7278
7226
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -7280,7 +7228,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7280
7228
  __pyx_t_4 = 0; __pyx_t_5 = 0; __pyx_t_6 = 0;
7281
7229
  if (__pyx_t_11) {
7282
7230
  __Pyx_AddTraceback("pyogrio._ogr._get_driver_metadata_item", __pyx_clineno, __pyx_lineno, __pyx_filename);
7283
- if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 291, __pyx_L5_except_error)
7231
+ if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0) __PYX_ERR(0, 309, __pyx_L5_except_error)
7284
7232
  __Pyx_XGOTREF(__pyx_t_6);
7285
7233
  __Pyx_XGOTREF(__pyx_t_5);
7286
7234
  __Pyx_XGOTREF(__pyx_t_4);
@@ -7288,16 +7236,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7288
7236
  __pyx_v_exc = __pyx_t_5;
7289
7237
  /*try:*/ {
7290
7238
 
7291
- /* "pyogrio/_ogr.pyx":292
7239
+ /* "pyogrio/_ogr.pyx":310
7292
7240
  * )
7293
7241
  * except CPLE_BaseError as exc:
7294
7242
  * raise DataSourceError(str(exc)) # <<<<<<<<<<<<<<
7295
7243
  *
7296
- * metadata_c = GDALGetMetadataItem(cogr_driver, metadata_item.encode('UTF-8'), NULL)
7244
+ * metadata_c = GDALGetMetadataItem(cogr_driver, metadata_item.encode("UTF-8"), NULL)
7297
7245
  */
7298
- __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_DataSourceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 292, __pyx_L16_error)
7246
+ __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_DataSourceError); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 310, __pyx_L16_error)
7299
7247
  __Pyx_GOTREF(__pyx_t_12);
7300
- __pyx_t_16 = __Pyx_PyObject_Unicode(__pyx_v_exc); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 292, __pyx_L16_error)
7248
+ __pyx_t_16 = __Pyx_PyObject_Unicode(__pyx_v_exc); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 310, __pyx_L16_error)
7301
7249
  __Pyx_GOTREF(__pyx_t_16);
7302
7250
  __pyx_t_13 = NULL;
7303
7251
  __pyx_t_7 = 0;
@@ -7318,16 +7266,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7318
7266
  __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
7319
7267
  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
7320
7268
  __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7321
- if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 292, __pyx_L16_error)
7269
+ if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 310, __pyx_L16_error)
7322
7270
  __Pyx_GOTREF(__pyx_t_10);
7323
7271
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7324
7272
  }
7325
7273
  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7326
7274
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7327
- __PYX_ERR(0, 292, __pyx_L16_error)
7275
+ __PYX_ERR(0, 310, __pyx_L16_error)
7328
7276
  }
7329
7277
 
7330
- /* "pyogrio/_ogr.pyx":291
7278
+ /* "pyogrio/_ogr.pyx":309
7331
7279
  * "correctly into GDAL)"
7332
7280
  * )
7333
7281
  * except CPLE_BaseError as exc: # <<<<<<<<<<<<<<
@@ -7374,11 +7322,11 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7374
7322
  }
7375
7323
  goto __pyx_L5_except_error;
7376
7324
 
7377
- /* "pyogrio/_ogr.pyx":284
7325
+ /* "pyogrio/_ogr.pyx":302
7378
7326
  * cdef void *cogr_driver = NULL
7379
7327
  *
7380
7328
  * try: # <<<<<<<<<<<<<<
7381
- * cogr_driver = exc_wrap_pointer(GDALGetDriverByName(driver.encode('UTF-8')))
7329
+ * cogr_driver = check_pointer(GDALGetDriverByName(driver.encode("UTF-8")))
7382
7330
  * except NullPointerError:
7383
7331
  */
7384
7332
  __pyx_L5_except_error:;
@@ -7390,14 +7338,14 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7390
7338
  __pyx_L8_try_end:;
7391
7339
  }
7392
7340
 
7393
- /* "pyogrio/_ogr.pyx":294
7341
+ /* "pyogrio/_ogr.pyx":312
7394
7342
  * raise DataSourceError(str(exc))
7395
7343
  *
7396
- * metadata_c = GDALGetMetadataItem(cogr_driver, metadata_item.encode('UTF-8'), NULL) # <<<<<<<<<<<<<<
7344
+ * metadata_c = GDALGetMetadataItem(cogr_driver, metadata_item.encode("UTF-8"), NULL) # <<<<<<<<<<<<<<
7397
7345
  *
7398
7346
  * metadata = None
7399
7347
  */
7400
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata_item, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 294, __pyx_L1_error)
7348
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata_item, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 312, __pyx_L1_error)
7401
7349
  __Pyx_GOTREF(__pyx_t_5);
7402
7350
  __pyx_t_6 = NULL;
7403
7351
  __pyx_t_7 = 0;
@@ -7417,16 +7365,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7417
7365
  PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_UTF_8};
7418
7366
  __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
7419
7367
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7420
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
7368
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
7421
7369
  __Pyx_GOTREF(__pyx_t_4);
7422
7370
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7423
7371
  }
7424
- __pyx_t_25 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_25) && PyErr_Occurred())) __PYX_ERR(0, 294, __pyx_L1_error)
7372
+ __pyx_t_25 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_25) && PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
7425
7373
  __pyx_v_metadata_c = GDALGetMetadataItem(__pyx_v_cogr_driver, __pyx_t_25, NULL);
7426
7374
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7427
7375
 
7428
- /* "pyogrio/_ogr.pyx":296
7429
- * metadata_c = GDALGetMetadataItem(cogr_driver, metadata_item.encode('UTF-8'), NULL)
7376
+ /* "pyogrio/_ogr.pyx":314
7377
+ * metadata_c = GDALGetMetadataItem(cogr_driver, metadata_item.encode("UTF-8"), NULL)
7430
7378
  *
7431
7379
  * metadata = None # <<<<<<<<<<<<<<
7432
7380
  * if metadata_c != NULL:
@@ -7435,36 +7383,36 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7435
7383
  __Pyx_INCREF(Py_None);
7436
7384
  __pyx_v_metadata = Py_None;
7437
7385
 
7438
- /* "pyogrio/_ogr.pyx":297
7386
+ /* "pyogrio/_ogr.pyx":315
7439
7387
  *
7440
7388
  * metadata = None
7441
7389
  * if metadata_c != NULL: # <<<<<<<<<<<<<<
7442
7390
  * metadata = metadata_c
7443
- * metadata = metadata.decode('UTF-8')
7391
+ * metadata = metadata.decode("UTF-8")
7444
7392
  */
7445
7393
  __pyx_t_26 = (__pyx_v_metadata_c != NULL);
7446
7394
  if (__pyx_t_26) {
7447
7395
 
7448
- /* "pyogrio/_ogr.pyx":298
7396
+ /* "pyogrio/_ogr.pyx":316
7449
7397
  * metadata = None
7450
7398
  * if metadata_c != NULL:
7451
7399
  * metadata = metadata_c # <<<<<<<<<<<<<<
7452
- * metadata = metadata.decode('UTF-8')
7400
+ * metadata = metadata.decode("UTF-8")
7453
7401
  * if len(metadata) == 0:
7454
7402
  */
7455
- __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_metadata_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
7403
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_metadata_c); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
7456
7404
  __Pyx_GOTREF(__pyx_t_4);
7457
7405
  __Pyx_DECREF_SET(__pyx_v_metadata, __pyx_t_4);
7458
7406
  __pyx_t_4 = 0;
7459
7407
 
7460
- /* "pyogrio/_ogr.pyx":299
7408
+ /* "pyogrio/_ogr.pyx":317
7461
7409
  * if metadata_c != NULL:
7462
7410
  * metadata = metadata_c
7463
- * metadata = metadata.decode('UTF-8') # <<<<<<<<<<<<<<
7411
+ * metadata = metadata.decode("UTF-8") # <<<<<<<<<<<<<<
7464
7412
  * if len(metadata) == 0:
7465
7413
  * metadata = None
7466
7414
  */
7467
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 299, __pyx_L1_error)
7415
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_metadata, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
7468
7416
  __Pyx_GOTREF(__pyx_t_5);
7469
7417
  __pyx_t_6 = NULL;
7470
7418
  __pyx_t_7 = 0;
@@ -7484,26 +7432,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7484
7432
  PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_kp_u_UTF_8};
7485
7433
  __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 1+__pyx_t_7);
7486
7434
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7487
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 299, __pyx_L1_error)
7435
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
7488
7436
  __Pyx_GOTREF(__pyx_t_4);
7489
7437
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7490
7438
  }
7491
7439
  __Pyx_DECREF_SET(__pyx_v_metadata, __pyx_t_4);
7492
7440
  __pyx_t_4 = 0;
7493
7441
 
7494
- /* "pyogrio/_ogr.pyx":300
7442
+ /* "pyogrio/_ogr.pyx":318
7495
7443
  * metadata = metadata_c
7496
- * metadata = metadata.decode('UTF-8')
7444
+ * metadata = metadata.decode("UTF-8")
7497
7445
  * if len(metadata) == 0: # <<<<<<<<<<<<<<
7498
7446
  * metadata = None
7499
7447
  *
7500
7448
  */
7501
- __pyx_t_14 = PyObject_Length(__pyx_v_metadata); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 300, __pyx_L1_error)
7449
+ __pyx_t_14 = PyObject_Length(__pyx_v_metadata); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(0, 318, __pyx_L1_error)
7502
7450
  __pyx_t_26 = (__pyx_t_14 == 0);
7503
7451
  if (__pyx_t_26) {
7504
7452
 
7505
- /* "pyogrio/_ogr.pyx":301
7506
- * metadata = metadata.decode('UTF-8')
7453
+ /* "pyogrio/_ogr.pyx":319
7454
+ * metadata = metadata.decode("UTF-8")
7507
7455
  * if len(metadata) == 0:
7508
7456
  * metadata = None # <<<<<<<<<<<<<<
7509
7457
  *
@@ -7512,25 +7460,25 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7512
7460
  __Pyx_INCREF(Py_None);
7513
7461
  __Pyx_DECREF_SET(__pyx_v_metadata, Py_None);
7514
7462
 
7515
- /* "pyogrio/_ogr.pyx":300
7463
+ /* "pyogrio/_ogr.pyx":318
7516
7464
  * metadata = metadata_c
7517
- * metadata = metadata.decode('UTF-8')
7465
+ * metadata = metadata.decode("UTF-8")
7518
7466
  * if len(metadata) == 0: # <<<<<<<<<<<<<<
7519
7467
  * metadata = None
7520
7468
  *
7521
7469
  */
7522
7470
  }
7523
7471
 
7524
- /* "pyogrio/_ogr.pyx":297
7472
+ /* "pyogrio/_ogr.pyx":315
7525
7473
  *
7526
7474
  * metadata = None
7527
7475
  * if metadata_c != NULL: # <<<<<<<<<<<<<<
7528
7476
  * metadata = metadata_c
7529
- * metadata = metadata.decode('UTF-8')
7477
+ * metadata = metadata.decode("UTF-8")
7530
7478
  */
7531
7479
  }
7532
7480
 
7533
- /* "pyogrio/_ogr.pyx":303
7481
+ /* "pyogrio/_ogr.pyx":321
7534
7482
  * metadata = None
7535
7483
  *
7536
7484
  * return metadata # <<<<<<<<<<<<<<
@@ -7542,7 +7490,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7542
7490
  __pyx_r = __pyx_v_metadata;
7543
7491
  goto __pyx_L0;
7544
7492
 
7545
- /* "pyogrio/_ogr.pyx":265
7493
+ /* "pyogrio/_ogr.pyx":283
7546
7494
  *
7547
7495
  *
7548
7496
  * def _get_driver_metadata_item(driver, metadata_item): # <<<<<<<<<<<<<<
@@ -7569,7 +7517,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_28_get_driver_metadata_item(CYTHON_UNUS
7569
7517
  return __pyx_r;
7570
7518
  }
7571
7519
 
7572
- /* "pyogrio/_ogr.pyx":306
7520
+ /* "pyogrio/_ogr.pyx":324
7573
7521
  *
7574
7522
  *
7575
7523
  * def _get_drivers_for_path(path): # <<<<<<<<<<<<<<
@@ -7630,12 +7578,12 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
7630
7578
  (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
7631
7579
  kw_args--;
7632
7580
  }
7633
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 306, __pyx_L3_error)
7581
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 324, __pyx_L3_error)
7634
7582
  else goto __pyx_L5_argtuple_error;
7635
7583
  }
7636
7584
  if (unlikely(kw_args > 0)) {
7637
7585
  const Py_ssize_t kwd_pos_args = __pyx_nargs;
7638
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_drivers_for_path") < 0)) __PYX_ERR(0, 306, __pyx_L3_error)
7586
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_drivers_for_path") < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
7639
7587
  }
7640
7588
  } else if (unlikely(__pyx_nargs != 1)) {
7641
7589
  goto __pyx_L5_argtuple_error;
@@ -7646,7 +7594,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
7646
7594
  }
7647
7595
  goto __pyx_L6_skip;
7648
7596
  __pyx_L5_argtuple_error:;
7649
- __Pyx_RaiseArgtupleInvalid("_get_drivers_for_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 306, __pyx_L3_error)
7597
+ __Pyx_RaiseArgtupleInvalid("_get_drivers_for_path", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 324, __pyx_L3_error)
7650
7598
  __pyx_L6_skip:;
7651
7599
  goto __pyx_L4_argument_unpacking_done;
7652
7600
  __pyx_L3_error:;
@@ -7704,7 +7652,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7704
7652
  __Pyx_RefNannySetupContext("_get_drivers_for_path", 0);
7705
7653
  __Pyx_INCREF(__pyx_v_path);
7706
7654
 
7707
- /* "pyogrio/_ogr.pyx":307
7655
+ /* "pyogrio/_ogr.pyx":325
7708
7656
  *
7709
7657
  * def _get_drivers_for_path(path):
7710
7658
  * cdef OGRSFDriverH driver = NULL # <<<<<<<<<<<<<<
@@ -7713,16 +7661,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7713
7661
  */
7714
7662
  __pyx_v_driver = NULL;
7715
7663
 
7716
- /* "pyogrio/_ogr.pyx":311
7664
+ /* "pyogrio/_ogr.pyx":329
7717
7665
  * cdef char *name_c
7718
7666
  *
7719
7667
  * path = str(path).lower() # <<<<<<<<<<<<<<
7720
7668
  *
7721
7669
  * parts = os.path.splitext(path)
7722
7670
  */
7723
- __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 311, __pyx_L1_error)
7671
+ __pyx_t_2 = __Pyx_PyObject_Unicode(__pyx_v_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
7724
7672
  __Pyx_GOTREF(__pyx_t_2);
7725
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error)
7673
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error)
7726
7674
  __Pyx_GOTREF(__pyx_t_3);
7727
7675
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7728
7676
  __pyx_t_2 = NULL;
@@ -7743,26 +7691,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7743
7691
  PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
7744
7692
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
7745
7693
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7746
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
7694
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error)
7747
7695
  __Pyx_GOTREF(__pyx_t_1);
7748
7696
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7749
7697
  }
7750
7698
  __Pyx_DECREF_SET(__pyx_v_path, __pyx_t_1);
7751
7699
  __pyx_t_1 = 0;
7752
7700
 
7753
- /* "pyogrio/_ogr.pyx":313
7701
+ /* "pyogrio/_ogr.pyx":331
7754
7702
  * path = str(path).lower()
7755
7703
  *
7756
7704
  * parts = os.path.splitext(path) # <<<<<<<<<<<<<<
7757
7705
  * if len(parts) == 2 and len(parts[1]) > 1:
7758
7706
  * ext = parts[1][1:]
7759
7707
  */
7760
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
7708
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
7761
7709
  __Pyx_GOTREF(__pyx_t_3);
7762
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error)
7710
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
7763
7711
  __Pyx_GOTREF(__pyx_t_2);
7764
7712
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7765
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_splitext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 313, __pyx_L1_error)
7713
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_splitext); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
7766
7714
  __Pyx_GOTREF(__pyx_t_3);
7767
7715
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7768
7716
  __pyx_t_2 = NULL;
@@ -7783,52 +7731,52 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7783
7731
  PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_path};
7784
7732
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
7785
7733
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7786
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error)
7734
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
7787
7735
  __Pyx_GOTREF(__pyx_t_1);
7788
7736
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7789
7737
  }
7790
7738
  __pyx_v_parts = __pyx_t_1;
7791
7739
  __pyx_t_1 = 0;
7792
7740
 
7793
- /* "pyogrio/_ogr.pyx":314
7741
+ /* "pyogrio/_ogr.pyx":332
7794
7742
  *
7795
7743
  * parts = os.path.splitext(path)
7796
7744
  * if len(parts) == 2 and len(parts[1]) > 1: # <<<<<<<<<<<<<<
7797
7745
  * ext = parts[1][1:]
7798
7746
  * else:
7799
7747
  */
7800
- __pyx_t_6 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 314, __pyx_L1_error)
7748
+ __pyx_t_6 = PyObject_Length(__pyx_v_parts); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 332, __pyx_L1_error)
7801
7749
  __pyx_t_7 = (__pyx_t_6 == 2);
7802
7750
  if (__pyx_t_7) {
7803
7751
  } else {
7804
7752
  __pyx_t_5 = __pyx_t_7;
7805
7753
  goto __pyx_L4_bool_binop_done;
7806
7754
  }
7807
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 314, __pyx_L1_error)
7755
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
7808
7756
  __Pyx_GOTREF(__pyx_t_1);
7809
- __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 314, __pyx_L1_error)
7757
+ __pyx_t_6 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 332, __pyx_L1_error)
7810
7758
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7811
7759
  __pyx_t_7 = (__pyx_t_6 > 1);
7812
7760
  __pyx_t_5 = __pyx_t_7;
7813
7761
  __pyx_L4_bool_binop_done:;
7814
7762
  if (__pyx_t_5) {
7815
7763
 
7816
- /* "pyogrio/_ogr.pyx":315
7764
+ /* "pyogrio/_ogr.pyx":333
7817
7765
  * parts = os.path.splitext(path)
7818
7766
  * if len(parts) == 2 and len(parts[1]) > 1:
7819
7767
  * ext = parts[1][1:] # <<<<<<<<<<<<<<
7820
7768
  * else:
7821
7769
  * ext = None
7822
7770
  */
7823
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
7771
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_parts, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
7824
7772
  __Pyx_GOTREF(__pyx_t_1);
7825
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
7773
+ __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_1, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
7826
7774
  __Pyx_GOTREF(__pyx_t_3);
7827
7775
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7828
7776
  __pyx_v_ext = __pyx_t_3;
7829
7777
  __pyx_t_3 = 0;
7830
7778
 
7831
- /* "pyogrio/_ogr.pyx":314
7779
+ /* "pyogrio/_ogr.pyx":332
7832
7780
  *
7833
7781
  * parts = os.path.splitext(path)
7834
7782
  * if len(parts) == 2 and len(parts[1]) > 1: # <<<<<<<<<<<<<<
@@ -7838,12 +7786,12 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7838
7786
  goto __pyx_L3;
7839
7787
  }
7840
7788
 
7841
- /* "pyogrio/_ogr.pyx":317
7789
+ /* "pyogrio/_ogr.pyx":335
7842
7790
  * ext = parts[1][1:]
7843
7791
  * else:
7844
7792
  * ext = None # <<<<<<<<<<<<<<
7845
7793
  *
7846
- *
7794
+ * # allow specific drivers to have a .zip extension to match GDAL behavior
7847
7795
  */
7848
7796
  /*else*/ {
7849
7797
  __Pyx_INCREF(Py_None);
@@ -7851,24 +7799,24 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7851
7799
  }
7852
7800
  __pyx_L3:;
7853
7801
 
7854
- /* "pyogrio/_ogr.pyx":321
7802
+ /* "pyogrio/_ogr.pyx":338
7855
7803
  *
7856
7804
  * # allow specific drivers to have a .zip extension to match GDAL behavior
7857
- * if ext == 'zip': # <<<<<<<<<<<<<<
7858
- * if path.endswith('.shp.zip'):
7859
- * ext = 'shp.zip'
7805
+ * if ext == "zip": # <<<<<<<<<<<<<<
7806
+ * if path.endswith(".shp.zip"):
7807
+ * ext = "shp.zip"
7860
7808
  */
7861
- __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ext, __pyx_n_u_zip, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 321, __pyx_L1_error)
7809
+ __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_v_ext, __pyx_n_u_zip, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 338, __pyx_L1_error)
7862
7810
  if (__pyx_t_5) {
7863
7811
 
7864
- /* "pyogrio/_ogr.pyx":322
7812
+ /* "pyogrio/_ogr.pyx":339
7865
7813
  * # allow specific drivers to have a .zip extension to match GDAL behavior
7866
- * if ext == 'zip':
7867
- * if path.endswith('.shp.zip'): # <<<<<<<<<<<<<<
7868
- * ext = 'shp.zip'
7869
- * elif path.endswith('.gpkg.zip'):
7814
+ * if ext == "zip":
7815
+ * if path.endswith(".shp.zip"): # <<<<<<<<<<<<<<
7816
+ * ext = "shp.zip"
7817
+ * elif path.endswith(".gpkg.zip"):
7870
7818
  */
7871
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 322, __pyx_L1_error)
7819
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
7872
7820
  __Pyx_GOTREF(__pyx_t_1);
7873
7821
  __pyx_t_2 = NULL;
7874
7822
  __pyx_t_4 = 0;
@@ -7888,42 +7836,42 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7888
7836
  PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_shp_zip};
7889
7837
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
7890
7838
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7891
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
7839
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error)
7892
7840
  __Pyx_GOTREF(__pyx_t_3);
7893
7841
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7894
7842
  }
7895
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 322, __pyx_L1_error)
7843
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 339, __pyx_L1_error)
7896
7844
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7897
7845
  if (__pyx_t_5) {
7898
7846
 
7899
- /* "pyogrio/_ogr.pyx":323
7900
- * if ext == 'zip':
7901
- * if path.endswith('.shp.zip'):
7902
- * ext = 'shp.zip' # <<<<<<<<<<<<<<
7903
- * elif path.endswith('.gpkg.zip'):
7904
- * ext = 'gpkg.zip'
7847
+ /* "pyogrio/_ogr.pyx":340
7848
+ * if ext == "zip":
7849
+ * if path.endswith(".shp.zip"):
7850
+ * ext = "shp.zip" # <<<<<<<<<<<<<<
7851
+ * elif path.endswith(".gpkg.zip"):
7852
+ * ext = "gpkg.zip"
7905
7853
  */
7906
7854
  __Pyx_INCREF(__pyx_kp_u_shp_zip_2);
7907
7855
  __Pyx_DECREF_SET(__pyx_v_ext, __pyx_kp_u_shp_zip_2);
7908
7856
 
7909
- /* "pyogrio/_ogr.pyx":322
7857
+ /* "pyogrio/_ogr.pyx":339
7910
7858
  * # allow specific drivers to have a .zip extension to match GDAL behavior
7911
- * if ext == 'zip':
7912
- * if path.endswith('.shp.zip'): # <<<<<<<<<<<<<<
7913
- * ext = 'shp.zip'
7914
- * elif path.endswith('.gpkg.zip'):
7859
+ * if ext == "zip":
7860
+ * if path.endswith(".shp.zip"): # <<<<<<<<<<<<<<
7861
+ * ext = "shp.zip"
7862
+ * elif path.endswith(".gpkg.zip"):
7915
7863
  */
7916
7864
  goto __pyx_L7;
7917
7865
  }
7918
7866
 
7919
- /* "pyogrio/_ogr.pyx":324
7920
- * if path.endswith('.shp.zip'):
7921
- * ext = 'shp.zip'
7922
- * elif path.endswith('.gpkg.zip'): # <<<<<<<<<<<<<<
7923
- * ext = 'gpkg.zip'
7867
+ /* "pyogrio/_ogr.pyx":341
7868
+ * if path.endswith(".shp.zip"):
7869
+ * ext = "shp.zip"
7870
+ * elif path.endswith(".gpkg.zip"): # <<<<<<<<<<<<<<
7871
+ * ext = "gpkg.zip"
7924
7872
  *
7925
7873
  */
7926
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error)
7874
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_endswith); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
7927
7875
  __Pyx_GOTREF(__pyx_t_1);
7928
7876
  __pyx_t_2 = NULL;
7929
7877
  __pyx_t_4 = 0;
@@ -7943,56 +7891,56 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
7943
7891
  PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_kp_u_gpkg_zip};
7944
7892
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
7945
7893
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7946
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
7894
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
7947
7895
  __Pyx_GOTREF(__pyx_t_3);
7948
7896
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7949
7897
  }
7950
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 324, __pyx_L1_error)
7898
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 341, __pyx_L1_error)
7951
7899
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7952
7900
  if (__pyx_t_5) {
7953
7901
 
7954
- /* "pyogrio/_ogr.pyx":325
7955
- * ext = 'shp.zip'
7956
- * elif path.endswith('.gpkg.zip'):
7957
- * ext = 'gpkg.zip' # <<<<<<<<<<<<<<
7902
+ /* "pyogrio/_ogr.pyx":342
7903
+ * ext = "shp.zip"
7904
+ * elif path.endswith(".gpkg.zip"):
7905
+ * ext = "gpkg.zip" # <<<<<<<<<<<<<<
7958
7906
  *
7959
7907
  * drivers = []
7960
7908
  */
7961
7909
  __Pyx_INCREF(__pyx_kp_u_gpkg_zip_2);
7962
7910
  __Pyx_DECREF_SET(__pyx_v_ext, __pyx_kp_u_gpkg_zip_2);
7963
7911
 
7964
- /* "pyogrio/_ogr.pyx":324
7965
- * if path.endswith('.shp.zip'):
7966
- * ext = 'shp.zip'
7967
- * elif path.endswith('.gpkg.zip'): # <<<<<<<<<<<<<<
7968
- * ext = 'gpkg.zip'
7912
+ /* "pyogrio/_ogr.pyx":341
7913
+ * if path.endswith(".shp.zip"):
7914
+ * ext = "shp.zip"
7915
+ * elif path.endswith(".gpkg.zip"): # <<<<<<<<<<<<<<
7916
+ * ext = "gpkg.zip"
7969
7917
  *
7970
7918
  */
7971
7919
  }
7972
7920
  __pyx_L7:;
7973
7921
 
7974
- /* "pyogrio/_ogr.pyx":321
7922
+ /* "pyogrio/_ogr.pyx":338
7975
7923
  *
7976
7924
  * # allow specific drivers to have a .zip extension to match GDAL behavior
7977
- * if ext == 'zip': # <<<<<<<<<<<<<<
7978
- * if path.endswith('.shp.zip'):
7979
- * ext = 'shp.zip'
7925
+ * if ext == "zip": # <<<<<<<<<<<<<<
7926
+ * if path.endswith(".shp.zip"):
7927
+ * ext = "shp.zip"
7980
7928
  */
7981
7929
  }
7982
7930
 
7983
- /* "pyogrio/_ogr.pyx":327
7984
- * ext = 'gpkg.zip'
7931
+ /* "pyogrio/_ogr.pyx":344
7932
+ * ext = "gpkg.zip"
7985
7933
  *
7986
7934
  * drivers = [] # <<<<<<<<<<<<<<
7987
7935
  * for i in range(OGRGetDriverCount()):
7988
7936
  * driver = OGRGetDriver(i)
7989
7937
  */
7990
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 327, __pyx_L1_error)
7938
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
7991
7939
  __Pyx_GOTREF(__pyx_t_3);
7992
7940
  __pyx_v_drivers = ((PyObject*)__pyx_t_3);
7993
7941
  __pyx_t_3 = 0;
7994
7942
 
7995
- /* "pyogrio/_ogr.pyx":328
7943
+ /* "pyogrio/_ogr.pyx":345
7996
7944
  *
7997
7945
  * drivers = []
7998
7946
  * for i in range(OGRGetDriverCount()): # <<<<<<<<<<<<<<
@@ -8004,7 +7952,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8004
7952
  for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
8005
7953
  __pyx_v_i = __pyx_t_10;
8006
7954
 
8007
- /* "pyogrio/_ogr.pyx":329
7955
+ /* "pyogrio/_ogr.pyx":346
8008
7956
  * drivers = []
8009
7957
  * for i in range(OGRGetDriverCount()):
8010
7958
  * driver = OGRGetDriver(i) # <<<<<<<<<<<<<<
@@ -8013,7 +7961,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8013
7961
  */
8014
7962
  __pyx_v_driver = OGRGetDriver(__pyx_v_i);
8015
7963
 
8016
- /* "pyogrio/_ogr.pyx":330
7964
+ /* "pyogrio/_ogr.pyx":347
8017
7965
  * for i in range(OGRGetDriverCount()):
8018
7966
  * driver = OGRGetDriver(i)
8019
7967
  * name_c = <char *>OGR_Dr_GetName(driver) # <<<<<<<<<<<<<<
@@ -8022,26 +7970,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8022
7970
  */
8023
7971
  __pyx_v_name_c = ((char *)OGR_Dr_GetName(__pyx_v_driver));
8024
7972
 
8025
- /* "pyogrio/_ogr.pyx":331
7973
+ /* "pyogrio/_ogr.pyx":348
8026
7974
  * driver = OGRGetDriver(i)
8027
7975
  * name_c = <char *>OGR_Dr_GetName(driver)
8028
7976
  * name = get_string(name_c) # <<<<<<<<<<<<<<
8029
7977
  *
8030
7978
  * if not ogr_driver_supports_write(name):
8031
7979
  */
8032
- __pyx_t_3 = __pyx_f_7pyogrio_4_ogr_get_string(__pyx_v_name_c, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 331, __pyx_L1_error)
7980
+ __pyx_t_3 = __pyx_f_7pyogrio_4_ogr_get_string(__pyx_v_name_c, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
8033
7981
  __Pyx_GOTREF(__pyx_t_3);
8034
7982
  __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
8035
7983
  __pyx_t_3 = 0;
8036
7984
 
8037
- /* "pyogrio/_ogr.pyx":333
7985
+ /* "pyogrio/_ogr.pyx":350
8038
7986
  * name = get_string(name_c)
8039
7987
  *
8040
7988
  * if not ogr_driver_supports_write(name): # <<<<<<<<<<<<<<
8041
7989
  * continue
8042
7990
  *
8043
7991
  */
8044
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ogr_driver_supports_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
7992
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ogr_driver_supports_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
8045
7993
  __Pyx_GOTREF(__pyx_t_1);
8046
7994
  __pyx_t_2 = NULL;
8047
7995
  __pyx_t_4 = 0;
@@ -8061,16 +8009,16 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8061
8009
  PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_name};
8062
8010
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
8063
8011
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8064
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
8012
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
8065
8013
  __Pyx_GOTREF(__pyx_t_3);
8066
8014
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8067
8015
  }
8068
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 333, __pyx_L1_error)
8016
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 350, __pyx_L1_error)
8069
8017
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8070
8018
  __pyx_t_7 = (!__pyx_t_5);
8071
8019
  if (__pyx_t_7) {
8072
8020
 
8073
- /* "pyogrio/_ogr.pyx":334
8021
+ /* "pyogrio/_ogr.pyx":351
8074
8022
  *
8075
8023
  * if not ogr_driver_supports_write(name):
8076
8024
  * continue # <<<<<<<<<<<<<<
@@ -8079,7 +8027,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8079
8027
  */
8080
8028
  goto __pyx_L8_continue;
8081
8029
 
8082
- /* "pyogrio/_ogr.pyx":333
8030
+ /* "pyogrio/_ogr.pyx":350
8083
8031
  * name = get_string(name_c)
8084
8032
  *
8085
8033
  * if not ogr_driver_supports_write(name): # <<<<<<<<<<<<<<
@@ -8088,14 +8036,14 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8088
8036
  */
8089
8037
  }
8090
8038
 
8091
- /* "pyogrio/_ogr.pyx":338
8039
+ /* "pyogrio/_ogr.pyx":355
8092
8040
  * # extensions is a space-delimited list of supported extensions
8093
8041
  * # for driver
8094
8042
  * extensions = _get_driver_metadata_item(name, "DMD_EXTENSIONS") # <<<<<<<<<<<<<<
8095
- * if ext is not None and extensions is not None and ext in extensions.lower().split(' '):
8096
- * drivers.append(name)
8043
+ * if (
8044
+ * ext is not None
8097
8045
  */
8098
- __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_driver_metadata_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
8046
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_driver_metadata_item); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
8099
8047
  __Pyx_GOTREF(__pyx_t_1);
8100
8048
  __pyx_t_2 = NULL;
8101
8049
  __pyx_t_4 = 0;
@@ -8115,19 +8063,19 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8115
8063
  PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_name, __pyx_n_u_DMD_EXTENSIONS};
8116
8064
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
8117
8065
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8118
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 338, __pyx_L1_error)
8066
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
8119
8067
  __Pyx_GOTREF(__pyx_t_3);
8120
8068
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8121
8069
  }
8122
8070
  __Pyx_XDECREF_SET(__pyx_v_extensions, __pyx_t_3);
8123
8071
  __pyx_t_3 = 0;
8124
8072
 
8125
- /* "pyogrio/_ogr.pyx":339
8126
- * # for driver
8073
+ /* "pyogrio/_ogr.pyx":357
8127
8074
  * extensions = _get_driver_metadata_item(name, "DMD_EXTENSIONS")
8128
- * if ext is not None and extensions is not None and ext in extensions.lower().split(' '): # <<<<<<<<<<<<<<
8129
- * drivers.append(name)
8130
- * else:
8075
+ * if (
8076
+ * ext is not None # <<<<<<<<<<<<<<
8077
+ * and extensions is not None
8078
+ * and ext in extensions.lower().split(" ")
8131
8079
  */
8132
8080
  __pyx_t_5 = (__pyx_v_ext != Py_None);
8133
8081
  if (__pyx_t_5) {
@@ -8135,13 +8083,29 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8135
8083
  __pyx_t_7 = __pyx_t_5;
8136
8084
  goto __pyx_L12_bool_binop_done;
8137
8085
  }
8086
+
8087
+ /* "pyogrio/_ogr.pyx":358
8088
+ * if (
8089
+ * ext is not None
8090
+ * and extensions is not None # <<<<<<<<<<<<<<
8091
+ * and ext in extensions.lower().split(" ")
8092
+ * ):
8093
+ */
8138
8094
  __pyx_t_5 = (__pyx_v_extensions != Py_None);
8139
8095
  if (__pyx_t_5) {
8140
8096
  } else {
8141
8097
  __pyx_t_7 = __pyx_t_5;
8142
8098
  goto __pyx_L12_bool_binop_done;
8143
8099
  }
8144
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_extensions, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
8100
+
8101
+ /* "pyogrio/_ogr.pyx":359
8102
+ * ext is not None
8103
+ * and extensions is not None
8104
+ * and ext in extensions.lower().split(" ") # <<<<<<<<<<<<<<
8105
+ * ):
8106
+ * drivers.append(name)
8107
+ */
8108
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_extensions, __pyx_n_s_lower); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
8145
8109
  __Pyx_GOTREF(__pyx_t_2);
8146
8110
  __pyx_t_11 = NULL;
8147
8111
  __pyx_t_4 = 0;
@@ -8161,11 +8125,11 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8161
8125
  PyObject *__pyx_callargs[2] = {__pyx_t_11, NULL};
8162
8126
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
8163
8127
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
8164
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
8128
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
8165
8129
  __Pyx_GOTREF(__pyx_t_1);
8166
8130
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8167
8131
  }
8168
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
8132
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
8169
8133
  __Pyx_GOTREF(__pyx_t_2);
8170
8134
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8171
8135
  __pyx_t_1 = NULL;
@@ -8186,36 +8150,44 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8186
8150
  PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_kp_u__6};
8187
8151
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
8188
8152
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8189
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 339, __pyx_L1_error)
8153
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 359, __pyx_L1_error)
8190
8154
  __Pyx_GOTREF(__pyx_t_3);
8191
8155
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8192
8156
  }
8193
- __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_ext, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 339, __pyx_L1_error)
8157
+ __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_ext, __pyx_t_3, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 359, __pyx_L1_error)
8194
8158
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8195
8159
  __pyx_t_7 = __pyx_t_5;
8196
8160
  __pyx_L12_bool_binop_done:;
8197
- if (__pyx_t_7) {
8198
8161
 
8199
- /* "pyogrio/_ogr.pyx":340
8162
+ /* "pyogrio/_ogr.pyx":356
8163
+ * # for driver
8200
8164
  * extensions = _get_driver_metadata_item(name, "DMD_EXTENSIONS")
8201
- * if ext is not None and extensions is not None and ext in extensions.lower().split(' '):
8165
+ * if ( # <<<<<<<<<<<<<<
8166
+ * ext is not None
8167
+ * and extensions is not None
8168
+ */
8169
+ if (__pyx_t_7) {
8170
+
8171
+ /* "pyogrio/_ogr.pyx":361
8172
+ * and ext in extensions.lower().split(" ")
8173
+ * ):
8202
8174
  * drivers.append(name) # <<<<<<<<<<<<<<
8203
8175
  * else:
8204
8176
  * prefix = _get_driver_metadata_item(name, "DMD_CONNECTION_PREFIX")
8205
8177
  */
8206
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_drivers, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 340, __pyx_L1_error)
8178
+ __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_drivers, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 361, __pyx_L1_error)
8207
8179
 
8208
- /* "pyogrio/_ogr.pyx":339
8180
+ /* "pyogrio/_ogr.pyx":356
8209
8181
  * # for driver
8210
8182
  * extensions = _get_driver_metadata_item(name, "DMD_EXTENSIONS")
8211
- * if ext is not None and extensions is not None and ext in extensions.lower().split(' '): # <<<<<<<<<<<<<<
8212
- * drivers.append(name)
8213
- * else:
8183
+ * if ( # <<<<<<<<<<<<<<
8184
+ * ext is not None
8185
+ * and extensions is not None
8214
8186
  */
8215
8187
  goto __pyx_L11;
8216
8188
  }
8217
8189
 
8218
- /* "pyogrio/_ogr.pyx":342
8190
+ /* "pyogrio/_ogr.pyx":363
8219
8191
  * drivers.append(name)
8220
8192
  * else:
8221
8193
  * prefix = _get_driver_metadata_item(name, "DMD_CONNECTION_PREFIX") # <<<<<<<<<<<<<<
@@ -8223,7 +8195,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8223
8195
  * drivers.append(name)
8224
8196
  */
8225
8197
  /*else*/ {
8226
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_driver_metadata_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
8198
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_driver_metadata_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
8227
8199
  __Pyx_GOTREF(__pyx_t_2);
8228
8200
  __pyx_t_1 = NULL;
8229
8201
  __pyx_t_4 = 0;
@@ -8243,14 +8215,14 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8243
8215
  PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_v_name, __pyx_n_u_DMD_CONNECTION_PREFIX};
8244
8216
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
8245
8217
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8246
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
8218
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 363, __pyx_L1_error)
8247
8219
  __Pyx_GOTREF(__pyx_t_3);
8248
8220
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8249
8221
  }
8250
8222
  __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_3);
8251
8223
  __pyx_t_3 = 0;
8252
8224
 
8253
- /* "pyogrio/_ogr.pyx":343
8225
+ /* "pyogrio/_ogr.pyx":364
8254
8226
  * else:
8255
8227
  * prefix = _get_driver_metadata_item(name, "DMD_CONNECTION_PREFIX")
8256
8228
  * if prefix is not None and path.startswith(prefix.lower()): # <<<<<<<<<<<<<<
@@ -8263,9 +8235,9 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8263
8235
  __pyx_t_7 = __pyx_t_5;
8264
8236
  goto __pyx_L16_bool_binop_done;
8265
8237
  }
8266
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
8238
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error)
8267
8239
  __Pyx_GOTREF(__pyx_t_2);
8268
- __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_lower); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 343, __pyx_L1_error)
8240
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_prefix, __pyx_n_s_lower); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 364, __pyx_L1_error)
8269
8241
  __Pyx_GOTREF(__pyx_t_11);
8270
8242
  __pyx_t_13 = NULL;
8271
8243
  __pyx_t_4 = 0;
@@ -8285,7 +8257,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8285
8257
  PyObject *__pyx_callargs[2] = {__pyx_t_13, NULL};
8286
8258
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
8287
8259
  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
8288
- if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
8260
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error)
8289
8261
  __Pyx_GOTREF(__pyx_t_1);
8290
8262
  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
8291
8263
  }
@@ -8308,26 +8280,26 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8308
8280
  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
8309
8281
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
8310
8282
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8311
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
8283
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 364, __pyx_L1_error)
8312
8284
  __Pyx_GOTREF(__pyx_t_3);
8313
8285
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8314
8286
  }
8315
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 343, __pyx_L1_error)
8287
+ __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 364, __pyx_L1_error)
8316
8288
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8317
8289
  __pyx_t_7 = __pyx_t_5;
8318
8290
  __pyx_L16_bool_binop_done:;
8319
8291
  if (__pyx_t_7) {
8320
8292
 
8321
- /* "pyogrio/_ogr.pyx":344
8293
+ /* "pyogrio/_ogr.pyx":365
8322
8294
  * prefix = _get_driver_metadata_item(name, "DMD_CONNECTION_PREFIX")
8323
8295
  * if prefix is not None and path.startswith(prefix.lower()):
8324
8296
  * drivers.append(name) # <<<<<<<<<<<<<<
8325
8297
  *
8326
8298
  * return drivers
8327
8299
  */
8328
- __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_drivers, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 344, __pyx_L1_error)
8300
+ __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_drivers, __pyx_v_name); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 365, __pyx_L1_error)
8329
8301
 
8330
- /* "pyogrio/_ogr.pyx":343
8302
+ /* "pyogrio/_ogr.pyx":364
8331
8303
  * else:
8332
8304
  * prefix = _get_driver_metadata_item(name, "DMD_CONNECTION_PREFIX")
8333
8305
  * if prefix is not None and path.startswith(prefix.lower()): # <<<<<<<<<<<<<<
@@ -8340,7 +8312,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8340
8312
  __pyx_L8_continue:;
8341
8313
  }
8342
8314
 
8343
- /* "pyogrio/_ogr.pyx":346
8315
+ /* "pyogrio/_ogr.pyx":367
8344
8316
  * drivers.append(name)
8345
8317
  *
8346
8318
  * return drivers # <<<<<<<<<<<<<<
@@ -8350,7 +8322,7 @@ static PyObject *__pyx_pf_7pyogrio_4_ogr_30_get_drivers_for_path(CYTHON_UNUSED P
8350
8322
  __pyx_r = __pyx_v_drivers;
8351
8323
  goto __pyx_L0;
8352
8324
 
8353
- /* "pyogrio/_ogr.pyx":306
8325
+ /* "pyogrio/_ogr.pyx":324
8354
8326
  *
8355
8327
  *
8356
8328
  * def _get_drivers_for_path(path): # <<<<<<<<<<<<<<
@@ -8488,9 +8460,11 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
8488
8460
  {&__pyx_n_s_pyogrio__ogr, __pyx_k_pyogrio__ogr, sizeof(__pyx_k_pyogrio__ogr), 0, 0, 1, 1},
8489
8461
  {&__pyx_kp_s_pyogrio__ogr_pyx, __pyx_k_pyogrio__ogr_pyx, sizeof(__pyx_k_pyogrio__ogr_pyx), 0, 0, 1, 0},
8490
8462
  {&__pyx_n_s_pyogrio_errors, __pyx_k_pyogrio_errors, sizeof(__pyx_k_pyogrio_errors), 0, 0, 1, 1},
8463
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
8491
8464
  {&__pyx_n_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 1},
8492
8465
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
8493
8466
  {&__pyx_n_s_register_drivers, __pyx_k_register_drivers, sizeof(__pyx_k_register_drivers), 0, 0, 1, 1},
8467
+ {&__pyx_n_s_retval, __pyx_k_retval, sizeof(__pyx_k_retval), 0, 0, 1, 1},
8494
8468
  {&__pyx_n_s_revision, __pyx_k_revision, sizeof(__pyx_k_revision), 0, 0, 1, 1},
8495
8469
  {&__pyx_n_s_rstrip, __pyx_k_rstrip, sizeof(__pyx_k_rstrip), 0, 0, 1, 1},
8496
8470
  {&__pyx_n_u_rw, __pyx_k_rw, sizeof(__pyx_k_rw), 0, 1, 0, 1},
@@ -8525,8 +8499,8 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
8525
8499
  /* #### Code section: cached_builtins ### */
8526
8500
  static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
8527
8501
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 125, __pyx_L1_error)
8528
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 210, __pyx_L1_error)
8529
- __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 224, __pyx_L1_error)
8502
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 212, __pyx_L1_error)
8503
+ __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 234, __pyx_L1_error)
8530
8504
  return 0;
8531
8505
  __pyx_L1_error:;
8532
8506
  return -1;
@@ -8537,58 +8511,58 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8537
8511
  __Pyx_RefNannyDeclarations
8538
8512
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
8539
8513
 
8540
- /* "pyogrio/_ogr.pyx":210
8514
+ /* "pyogrio/_ogr.pyx":212
8541
8515
  * set_gdal_config_options({"GDAL_DATA": wheel_path})
8542
8516
  * if not has_gdal_data():
8543
- * raise ValueError("Could not correctly detect GDAL data files installed by pyogrio wheel") # <<<<<<<<<<<<<<
8544
- * return
8545
- *
8517
+ * raise ValueError( # <<<<<<<<<<<<<<
8518
+ * "Could not correctly detect GDAL data files installed by pyogrio wheel"
8519
+ * )
8546
8520
  */
8547
- __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Could_not_correctly_detect_GDAL); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 210, __pyx_L1_error)
8521
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_Could_not_correctly_detect_GDAL); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 212, __pyx_L1_error)
8548
8522
  __Pyx_GOTREF(__pyx_tuple_);
8549
8523
  __Pyx_GIVEREF(__pyx_tuple_);
8550
8524
 
8551
- /* "pyogrio/_ogr.pyx":224
8525
+ /* "pyogrio/_ogr.pyx":231
8552
8526
  * return
8553
8527
  *
8554
- * warnings.warn("Could not detect GDAL data files. Set GDAL_DATA environment variable to the correct path.", RuntimeWarning) # <<<<<<<<<<<<<<
8555
- *
8556
- *
8528
+ * warnings.warn( # <<<<<<<<<<<<<<
8529
+ * "Could not detect GDAL data files. Set GDAL_DATA environment variable to the "
8530
+ * "correct path.",
8557
8531
  */
8558
- __pyx_tuple__2 = PyTuple_Pack(2, __pyx_kp_u_Could_not_detect_GDAL_data_files, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 224, __pyx_L1_error)
8532
+ __pyx_tuple__2 = PyTuple_Pack(2, __pyx_kp_u_Could_not_detect_GDAL_data_files, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 231, __pyx_L1_error)
8559
8533
  __Pyx_GOTREF(__pyx_tuple__2);
8560
8534
  __Pyx_GIVEREF(__pyx_tuple__2);
8561
8535
 
8562
- /* "pyogrio/_ogr.pyx":242
8536
+ /* "pyogrio/_ogr.pyx":253
8563
8537
  * # verify that this now resolves
8564
8538
  * if not has_proj_data():
8565
- * raise ValueError("Could not correctly detect PROJ data files installed by pyogrio wheel") # <<<<<<<<<<<<<<
8566
- * return
8567
- *
8539
+ * raise ValueError( # <<<<<<<<<<<<<<
8540
+ * "Could not correctly detect PROJ data files installed by pyogrio wheel"
8541
+ * )
8568
8542
  */
8569
- __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Could_not_correctly_detect_PROJ); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 242, __pyx_L1_error)
8543
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Could_not_correctly_detect_PROJ); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 253, __pyx_L1_error)
8570
8544
  __Pyx_GOTREF(__pyx_tuple__3);
8571
8545
  __Pyx_GIVEREF(__pyx_tuple__3);
8572
8546
 
8573
- /* "pyogrio/_ogr.pyx":257
8547
+ /* "pyogrio/_ogr.pyx":273
8574
8548
  * return
8575
8549
  *
8576
- * warnings.warn("Could not detect PROJ data files. Set PROJ_LIB environment variable to the correct path.", RuntimeWarning) # <<<<<<<<<<<<<<
8577
- *
8578
- *
8550
+ * warnings.warn( # <<<<<<<<<<<<<<
8551
+ * "Could not detect PROJ data files. Set PROJ_LIB environment variable to "
8552
+ * "the correct path.", RuntimeWarning)
8579
8553
  */
8580
- __pyx_tuple__4 = PyTuple_Pack(2, __pyx_kp_u_Could_not_detect_PROJ_data_files, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 257, __pyx_L1_error)
8554
+ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_kp_u_Could_not_detect_PROJ_data_files, __pyx_builtin_RuntimeWarning); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 273, __pyx_L1_error)
8581
8555
  __Pyx_GOTREF(__pyx_tuple__4);
8582
8556
  __Pyx_GIVEREF(__pyx_tuple__4);
8583
8557
 
8584
- /* "pyogrio/_ogr.pyx":315
8558
+ /* "pyogrio/_ogr.pyx":333
8585
8559
  * parts = os.path.splitext(path)
8586
8560
  * if len(parts) == 2 and len(parts[1]) > 1:
8587
8561
  * ext = parts[1][1:] # <<<<<<<<<<<<<<
8588
8562
  * else:
8589
8563
  * ext = None
8590
8564
  */
8591
- __pyx_slice__5 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 315, __pyx_L1_error)
8565
+ __pyx_slice__5 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(0, 333, __pyx_L1_error)
8592
8566
  __Pyx_GOTREF(__pyx_slice__5);
8593
8567
  __Pyx_GIVEREF(__pyx_slice__5);
8594
8568
 
@@ -8633,7 +8607,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8633
8607
  *
8634
8608
  * def set_gdal_config_options(dict options): # <<<<<<<<<<<<<<
8635
8609
  * for name, value in options.items():
8636
- * name_b = name.encode('utf-8')
8610
+ * name_b = name.encode("utf-8")
8637
8611
  */
8638
8612
  __pyx_tuple__15 = PyTuple_Pack(7, __pyx_n_s_options, __pyx_n_s_name, __pyx_n_s_value, __pyx_n_s_name_b, __pyx_n_s_name_c, __pyx_n_s_value_b, __pyx_n_s_value_c); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 62, __pyx_L1_error)
8639
8613
  __Pyx_GOTREF(__pyx_tuple__15);
@@ -8644,7 +8618,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8644
8618
  *
8645
8619
  *
8646
8620
  * def get_gdal_config_option(str name): # <<<<<<<<<<<<<<
8647
- * name_b = name.encode('utf-8')
8621
+ * name_b = name.encode("utf-8")
8648
8622
  * name_c = name_b
8649
8623
  */
8650
8624
  __pyx_tuple__17 = PyTuple_Pack(5, __pyx_n_s_name, __pyx_n_s_name_b, __pyx_n_s_name_c, __pyx_n_s_value, __pyx_n_s_str_value); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 82, __pyx_L1_error)
@@ -8657,7 +8631,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8657
8631
  *
8658
8632
  * def ogr_driver_supports_write(driver): # <<<<<<<<<<<<<<
8659
8633
  * # check metadata for driver to see if it supports write
8660
- * if _get_driver_metadata_item(driver, "DCAP_CREATE") == 'YES':
8634
+ * if _get_driver_metadata_item(driver, "DCAP_CREATE") == "YES":
8661
8635
  */
8662
8636
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_driver); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 103, __pyx_L1_error)
8663
8637
  __Pyx_GOTREF(__pyx_tuple__19);
@@ -8669,7 +8643,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8669
8643
  *
8670
8644
  * def ogr_driver_supports_vsi(driver): # <<<<<<<<<<<<<<
8671
8645
  * # check metadata for driver to see if it supports write
8672
- * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == 'YES':
8646
+ * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == "YES":
8673
8647
  */
8674
8648
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_ogr_driver_supports_vsi, 111, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 111, __pyx_L1_error)
8675
8649
 
@@ -8713,64 +8687,64 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8713
8687
  * """Verify that PROJ library data files are correctly found.
8714
8688
  *
8715
8689
  */
8716
- __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_srs); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 172, __pyx_L1_error)
8690
+ __pyx_tuple__27 = PyTuple_Pack(2, __pyx_n_s_srs, __pyx_n_s_retval); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 172, __pyx_L1_error)
8717
8691
  __Pyx_GOTREF(__pyx_tuple__27);
8718
8692
  __Pyx_GIVEREF(__pyx_tuple__27);
8719
- __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_has_proj_data, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 172, __pyx_L1_error)
8693
+ __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_has_proj_data, 172, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 172, __pyx_L1_error)
8720
8694
 
8721
8695
  /* "pyogrio/_ogr.pyx":196
8722
8696
  *
8723
8697
  *
8724
8698
  * def init_gdal_data(): # <<<<<<<<<<<<<<
8725
- * """Set GDAL data search directories in the following precedence:
8726
- * - wheel copy of gdal_data
8699
+ * """Set GDAL data search directories.
8700
+ *
8727
8701
  */
8728
8702
  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_wheel_path, __pyx_n_s_wk_path); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 196, __pyx_L1_error)
8729
8703
  __Pyx_GOTREF(__pyx_tuple__29);
8730
8704
  __Pyx_GIVEREF(__pyx_tuple__29);
8731
8705
  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_init_gdal_data, 196, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 196, __pyx_L1_error)
8732
8706
 
8733
- /* "pyogrio/_ogr.pyx":227
8707
+ /* "pyogrio/_ogr.pyx":238
8734
8708
  *
8735
8709
  *
8736
8710
  * def init_proj_data(): # <<<<<<<<<<<<<<
8737
8711
  * """Set Proj search directories in the following precedence:
8738
8712
  * - wheel copy of proj_data
8739
8713
  */
8740
- __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_init_proj_data, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 227, __pyx_L1_error)
8714
+ __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_init_proj_data, 238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 238, __pyx_L1_error)
8741
8715
 
8742
- /* "pyogrio/_ogr.pyx":260
8716
+ /* "pyogrio/_ogr.pyx":278
8743
8717
  *
8744
8718
  *
8745
8719
  * def _register_drivers(): # <<<<<<<<<<<<<<
8746
8720
  * # Register all drivers
8747
8721
  * GDALAllRegister()
8748
8722
  */
8749
- __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_register_drivers, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 260, __pyx_L1_error)
8723
+ __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_register_drivers, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 278, __pyx_L1_error)
8750
8724
 
8751
- /* "pyogrio/_ogr.pyx":265
8725
+ /* "pyogrio/_ogr.pyx":283
8752
8726
  *
8753
8727
  *
8754
8728
  * def _get_driver_metadata_item(driver, metadata_item): # <<<<<<<<<<<<<<
8755
8729
  * """
8756
8730
  * Query driver metadata items.
8757
8731
  */
8758
- __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_driver, __pyx_n_s_metadata_item, __pyx_n_s_metadata_c, __pyx_n_s_cogr_driver, __pyx_n_s_exc, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 265, __pyx_L1_error)
8732
+ __pyx_tuple__33 = PyTuple_Pack(6, __pyx_n_s_driver, __pyx_n_s_metadata_item, __pyx_n_s_metadata_c, __pyx_n_s_cogr_driver, __pyx_n_s_exc, __pyx_n_s_metadata); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 283, __pyx_L1_error)
8759
8733
  __Pyx_GOTREF(__pyx_tuple__33);
8760
8734
  __Pyx_GIVEREF(__pyx_tuple__33);
8761
- __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_get_driver_metadata_item, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 265, __pyx_L1_error)
8735
+ __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_get_driver_metadata_item, 283, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 283, __pyx_L1_error)
8762
8736
 
8763
- /* "pyogrio/_ogr.pyx":306
8737
+ /* "pyogrio/_ogr.pyx":324
8764
8738
  *
8765
8739
  *
8766
8740
  * def _get_drivers_for_path(path): # <<<<<<<<<<<<<<
8767
8741
  * cdef OGRSFDriverH driver = NULL
8768
8742
  * cdef int i
8769
8743
  */
8770
- __pyx_tuple__35 = PyTuple_Pack(10, __pyx_n_s_path, __pyx_n_s_driver, __pyx_n_s_i, __pyx_n_s_name_c, __pyx_n_s_parts, __pyx_n_s_ext, __pyx_n_s_drivers, __pyx_n_s_name, __pyx_n_s_extensions, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 306, __pyx_L1_error)
8744
+ __pyx_tuple__35 = PyTuple_Pack(10, __pyx_n_s_path, __pyx_n_s_driver, __pyx_n_s_i, __pyx_n_s_name_c, __pyx_n_s_parts, __pyx_n_s_ext, __pyx_n_s_drivers, __pyx_n_s_name, __pyx_n_s_extensions, __pyx_n_s_prefix); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 324, __pyx_L1_error)
8771
8745
  __Pyx_GOTREF(__pyx_tuple__35);
8772
8746
  __Pyx_GIVEREF(__pyx_tuple__35);
8773
- __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_get_drivers_for_path, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 306, __pyx_L1_error)
8747
+ __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__ogr_pyx, __pyx_n_s_get_drivers_for_path, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 324, __pyx_L1_error)
8774
8748
  __Pyx_RefNannyFinishContext();
8775
8749
  return 0;
8776
8750
  __pyx_L1_error:;
@@ -8845,10 +8819,23 @@ static int __Pyx_modinit_type_init_code(void) {
8845
8819
 
8846
8820
  static int __Pyx_modinit_type_import_code(void) {
8847
8821
  __Pyx_RefNannyDeclarations
8822
+ PyObject *__pyx_t_1 = NULL;
8823
+ int __pyx_lineno = 0;
8824
+ const char *__pyx_filename = NULL;
8825
+ int __pyx_clineno = 0;
8848
8826
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
8849
8827
  /*--- Type import code ---*/
8828
+ __pyx_t_1 = PyImport_ImportModule("pyogrio._err"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
8829
+ __Pyx_GOTREF(__pyx_t_1);
8830
+ __pyx_ptype_7pyogrio_4_err_ErrorHandler = __Pyx_ImportType_3_0_12(__pyx_t_1, "pyogrio._err", "ErrorHandler", sizeof(struct __pyx_obj_7pyogrio_4_err_ErrorHandler), __PYX_GET_STRUCT_ALIGNMENT_3_0_12(struct __pyx_obj_7pyogrio_4_err_ErrorHandler),__Pyx_ImportType_CheckSize_Warn_3_0_12); if (!__pyx_ptype_7pyogrio_4_err_ErrorHandler) __PYX_ERR(1, 5, __pyx_L1_error)
8831
+ __pyx_vtabptr_7pyogrio_4_err_ErrorHandler = (struct __pyx_vtabstruct_7pyogrio_4_err_ErrorHandler*)__Pyx_GetVtable(__pyx_ptype_7pyogrio_4_err_ErrorHandler); if (unlikely(!__pyx_vtabptr_7pyogrio_4_err_ErrorHandler)) __PYX_ERR(1, 5, __pyx_L1_error)
8832
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8850
8833
  __Pyx_RefNannyFinishContext();
8851
8834
  return 0;
8835
+ __pyx_L1_error:;
8836
+ __Pyx_XDECREF(__pyx_t_1);
8837
+ __Pyx_RefNannyFinishContext();
8838
+ return -1;
8852
8839
  }
8853
8840
 
8854
8841
  static int __Pyx_modinit_variable_import_code(void) {
@@ -8869,9 +8856,7 @@ static int __Pyx_modinit_function_import_code(void) {
8869
8856
  /*--- Function import code ---*/
8870
8857
  __pyx_t_1 = PyImport_ImportModule("pyogrio._err"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
8871
8858
  __Pyx_GOTREF(__pyx_t_1);
8872
- if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "exc_wrap_int", (void (**)(void))&__pyx_f_7pyogrio_4_err_exc_wrap_int, "int (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8873
- if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "exc_wrap_ogrerr", (void (**)(void))&__pyx_f_7pyogrio_4_err_exc_wrap_ogrerr, "int (int)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8874
- if (__Pyx_ImportFunction_3_0_11(__pyx_t_1, "exc_wrap_pointer", (void (**)(void))&__pyx_f_7pyogrio_4_err_exc_wrap_pointer, "void *(void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8859
+ if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "check_pointer", (void (**)(void))&__pyx_f_7pyogrio_4_err_check_pointer, "void *(void *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8875
8860
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8876
8861
  __Pyx_RefNannyFinishContext();
8877
8862
  return 0;
@@ -9152,7 +9137,7 @@ if (!__Pyx_RefNanny) {
9152
9137
  (void)__Pyx_modinit_variable_export_code();
9153
9138
  if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
9154
9139
  (void)__Pyx_modinit_type_init_code();
9155
- (void)__Pyx_modinit_type_import_code();
9140
+ if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
9156
9141
  (void)__Pyx_modinit_variable_import_code();
9157
9142
  if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
9158
9143
  /*--- Execution code ---*/
@@ -9207,7 +9192,7 @@ if (!__Pyx_RefNanny) {
9207
9192
  * from uuid import uuid4
9208
9193
  * import warnings # <<<<<<<<<<<<<<
9209
9194
  *
9210
- * from pyogrio._err cimport exc_wrap_int, exc_wrap_ogrerr, exc_wrap_pointer
9195
+ * from pyogrio._err cimport check_pointer
9211
9196
  */
9212
9197
  __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
9213
9198
  __Pyx_GOTREF(__pyx_t_3);
@@ -9216,7 +9201,7 @@ if (!__Pyx_RefNanny) {
9216
9201
 
9217
9202
  /* "pyogrio/_ogr.pyx":7
9218
9203
  *
9219
- * from pyogrio._err cimport exc_wrap_int, exc_wrap_ogrerr, exc_wrap_pointer
9204
+ * from pyogrio._err cimport check_pointer
9220
9205
  * from pyogrio._err import CPLE_BaseError, NullPointerError # <<<<<<<<<<<<<<
9221
9206
  * from pyogrio.errors import DataSourceError
9222
9207
  *
@@ -9243,7 +9228,7 @@ if (!__Pyx_RefNanny) {
9243
9228
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9244
9229
 
9245
9230
  /* "pyogrio/_ogr.pyx":8
9246
- * from pyogrio._err cimport exc_wrap_int, exc_wrap_ogrerr, exc_wrap_pointer
9231
+ * from pyogrio._err cimport check_pointer
9247
9232
  * from pyogrio._err import CPLE_BaseError, NullPointerError
9248
9233
  * from pyogrio.errors import DataSourceError # <<<<<<<<<<<<<<
9249
9234
  *
@@ -9304,7 +9289,7 @@ if (!__Pyx_RefNanny) {
9304
9289
  *
9305
9290
  * def set_gdal_config_options(dict options): # <<<<<<<<<<<<<<
9306
9291
  * for name, value in options.items():
9307
- * name_b = name.encode('utf-8')
9292
+ * name_b = name.encode("utf-8")
9308
9293
  */
9309
9294
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_7set_gdal_config_options, 0, __pyx_n_s_set_gdal_config_options, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
9310
9295
  __Pyx_GOTREF(__pyx_t_3);
@@ -9315,7 +9300,7 @@ if (!__Pyx_RefNanny) {
9315
9300
  *
9316
9301
  *
9317
9302
  * def get_gdal_config_option(str name): # <<<<<<<<<<<<<<
9318
- * name_b = name.encode('utf-8')
9303
+ * name_b = name.encode("utf-8")
9319
9304
  * name_c = name_b
9320
9305
  */
9321
9306
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_9get_gdal_config_option, 0, __pyx_n_s_get_gdal_config_option, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
@@ -9328,7 +9313,7 @@ if (!__Pyx_RefNanny) {
9328
9313
  *
9329
9314
  * def ogr_driver_supports_write(driver): # <<<<<<<<<<<<<<
9330
9315
  * # check metadata for driver to see if it supports write
9331
- * if _get_driver_metadata_item(driver, "DCAP_CREATE") == 'YES':
9316
+ * if _get_driver_metadata_item(driver, "DCAP_CREATE") == "YES":
9332
9317
  */
9333
9318
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_11ogr_driver_supports_write, 0, __pyx_n_s_ogr_driver_supports_write, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 103, __pyx_L1_error)
9334
9319
  __Pyx_GOTREF(__pyx_t_3);
@@ -9340,7 +9325,7 @@ if (!__Pyx_RefNanny) {
9340
9325
  *
9341
9326
  * def ogr_driver_supports_vsi(driver): # <<<<<<<<<<<<<<
9342
9327
  * # check metadata for driver to see if it supports write
9343
- * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == 'YES':
9328
+ * if _get_driver_metadata_item(driver, "DCAP_VIRTUALIO") == "YES":
9344
9329
  */
9345
9330
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_13ogr_driver_supports_vsi, 0, __pyx_n_s_ogr_driver_supports_vsi, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 111, __pyx_L1_error)
9346
9331
  __Pyx_GOTREF(__pyx_t_3);
@@ -9399,60 +9384,60 @@ if (!__Pyx_RefNanny) {
9399
9384
  *
9400
9385
  *
9401
9386
  * def init_gdal_data(): # <<<<<<<<<<<<<<
9402
- * """Set GDAL data search directories in the following precedence:
9403
- * - wheel copy of gdal_data
9387
+ * """Set GDAL data search directories.
9388
+ *
9404
9389
  */
9405
9390
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_23init_gdal_data, 0, __pyx_n_s_init_gdal_data, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
9406
9391
  __Pyx_GOTREF(__pyx_t_3);
9407
9392
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_gdal_data, __pyx_t_3) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
9408
9393
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9409
9394
 
9410
- /* "pyogrio/_ogr.pyx":227
9395
+ /* "pyogrio/_ogr.pyx":238
9411
9396
  *
9412
9397
  *
9413
9398
  * def init_proj_data(): # <<<<<<<<<<<<<<
9414
9399
  * """Set Proj search directories in the following precedence:
9415
9400
  * - wheel copy of proj_data
9416
9401
  */
9417
- __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_25init_proj_data, 0, __pyx_n_s_init_proj_data, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
9402
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_25init_proj_data, 0, __pyx_n_s_init_proj_data, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
9418
9403
  __Pyx_GOTREF(__pyx_t_3);
9419
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_proj_data, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
9404
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_proj_data, __pyx_t_3) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
9420
9405
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9421
9406
 
9422
- /* "pyogrio/_ogr.pyx":260
9407
+ /* "pyogrio/_ogr.pyx":278
9423
9408
  *
9424
9409
  *
9425
9410
  * def _register_drivers(): # <<<<<<<<<<<<<<
9426
9411
  * # Register all drivers
9427
9412
  * GDALAllRegister()
9428
9413
  */
9429
- __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_27_register_drivers, 0, __pyx_n_s_register_drivers, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
9414
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_27_register_drivers, 0, __pyx_n_s_register_drivers, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
9430
9415
  __Pyx_GOTREF(__pyx_t_3);
9431
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_drivers, __pyx_t_3) < 0) __PYX_ERR(0, 260, __pyx_L1_error)
9416
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_drivers, __pyx_t_3) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
9432
9417
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9433
9418
 
9434
- /* "pyogrio/_ogr.pyx":265
9419
+ /* "pyogrio/_ogr.pyx":283
9435
9420
  *
9436
9421
  *
9437
9422
  * def _get_driver_metadata_item(driver, metadata_item): # <<<<<<<<<<<<<<
9438
9423
  * """
9439
9424
  * Query driver metadata items.
9440
9425
  */
9441
- __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_29_get_driver_metadata_item, 0, __pyx_n_s_get_driver_metadata_item, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
9426
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_29_get_driver_metadata_item, 0, __pyx_n_s_get_driver_metadata_item, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error)
9442
9427
  __Pyx_GOTREF(__pyx_t_3);
9443
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver_metadata_item, __pyx_t_3) < 0) __PYX_ERR(0, 265, __pyx_L1_error)
9428
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_driver_metadata_item, __pyx_t_3) < 0) __PYX_ERR(0, 283, __pyx_L1_error)
9444
9429
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9445
9430
 
9446
- /* "pyogrio/_ogr.pyx":306
9431
+ /* "pyogrio/_ogr.pyx":324
9447
9432
  *
9448
9433
  *
9449
9434
  * def _get_drivers_for_path(path): # <<<<<<<<<<<<<<
9450
9435
  * cdef OGRSFDriverH driver = NULL
9451
9436
  * cdef int i
9452
9437
  */
9453
- __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_31_get_drivers_for_path, 0, __pyx_n_s_get_drivers_for_path, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error)
9438
+ __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_ogr_31_get_drivers_for_path, 0, __pyx_n_s_get_drivers_for_path, NULL, __pyx_n_s_pyogrio__ogr, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 324, __pyx_L1_error)
9454
9439
  __Pyx_GOTREF(__pyx_t_3);
9455
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers_for_path, __pyx_t_3) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
9440
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_drivers_for_path, __pyx_t_3) < 0) __PYX_ERR(0, 324, __pyx_L1_error)
9456
9441
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9457
9442
 
9458
9443
  /* "pyogrio/_ogr.pyx":1
@@ -11096,414 +11081,67 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
11096
11081
  return __Pyx_GetBuiltinName(name);
11097
11082
  }
11098
11083
 
11099
- /* GetTopmostException */
11100
- #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
11101
- static _PyErr_StackItem *
11102
- __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11103
- {
11104
- _PyErr_StackItem *exc_info = tstate->exc_info;
11105
- while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
11106
- exc_info->previous_item != NULL)
11107
- {
11108
- exc_info = exc_info->previous_item;
11084
+ /* RaiseException */
11085
+ #if PY_MAJOR_VERSION < 3
11086
+ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11087
+ __Pyx_PyThreadState_declare
11088
+ CYTHON_UNUSED_VAR(cause);
11089
+ Py_XINCREF(type);
11090
+ if (!value || value == Py_None)
11091
+ value = NULL;
11092
+ else
11093
+ Py_INCREF(value);
11094
+ if (!tb || tb == Py_None)
11095
+ tb = NULL;
11096
+ else {
11097
+ Py_INCREF(tb);
11098
+ if (!PyTraceBack_Check(tb)) {
11099
+ PyErr_SetString(PyExc_TypeError,
11100
+ "raise: arg 3 must be a traceback or None");
11101
+ goto raise_error;
11102
+ }
11109
11103
  }
11110
- return exc_info;
11111
- }
11104
+ if (PyType_Check(type)) {
11105
+ #if CYTHON_COMPILING_IN_PYPY
11106
+ if (!value) {
11107
+ Py_INCREF(Py_None);
11108
+ value = Py_None;
11109
+ }
11112
11110
  #endif
11113
-
11114
- /* SaveResetException */
11115
- #if CYTHON_FAST_THREAD_STATE
11116
- static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11117
- #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
11118
- _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11119
- PyObject *exc_value = exc_info->exc_value;
11120
- if (exc_value == NULL || exc_value == Py_None) {
11121
- *value = NULL;
11122
- *type = NULL;
11123
- *tb = NULL;
11111
+ PyErr_NormalizeException(&type, &value, &tb);
11124
11112
  } else {
11125
- *value = exc_value;
11126
- Py_INCREF(*value);
11127
- *type = (PyObject*) Py_TYPE(exc_value);
11128
- Py_INCREF(*type);
11129
- *tb = PyException_GetTraceback(exc_value);
11130
- }
11131
- #elif CYTHON_USE_EXC_INFO_STACK
11132
- _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11133
- *type = exc_info->exc_type;
11134
- *value = exc_info->exc_value;
11135
- *tb = exc_info->exc_traceback;
11136
- Py_XINCREF(*type);
11137
- Py_XINCREF(*value);
11138
- Py_XINCREF(*tb);
11139
- #else
11140
- *type = tstate->exc_type;
11141
- *value = tstate->exc_value;
11142
- *tb = tstate->exc_traceback;
11143
- Py_XINCREF(*type);
11144
- Py_XINCREF(*value);
11145
- Py_XINCREF(*tb);
11146
- #endif
11147
- }
11148
- static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11149
- #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
11150
- _PyErr_StackItem *exc_info = tstate->exc_info;
11151
- PyObject *tmp_value = exc_info->exc_value;
11152
- exc_info->exc_value = value;
11153
- Py_XDECREF(tmp_value);
11154
- Py_XDECREF(type);
11155
- Py_XDECREF(tb);
11156
- #else
11157
- PyObject *tmp_type, *tmp_value, *tmp_tb;
11158
- #if CYTHON_USE_EXC_INFO_STACK
11159
- _PyErr_StackItem *exc_info = tstate->exc_info;
11160
- tmp_type = exc_info->exc_type;
11161
- tmp_value = exc_info->exc_value;
11162
- tmp_tb = exc_info->exc_traceback;
11163
- exc_info->exc_type = type;
11164
- exc_info->exc_value = value;
11165
- exc_info->exc_traceback = tb;
11166
- #else
11167
- tmp_type = tstate->exc_type;
11168
- tmp_value = tstate->exc_value;
11169
- tmp_tb = tstate->exc_traceback;
11170
- tstate->exc_type = type;
11171
- tstate->exc_value = value;
11172
- tstate->exc_traceback = tb;
11173
- #endif
11174
- Py_XDECREF(tmp_type);
11175
- Py_XDECREF(tmp_value);
11176
- Py_XDECREF(tmp_tb);
11177
- #endif
11178
- }
11179
- #endif
11180
-
11181
- /* FastTypeChecks */
11182
- #if CYTHON_COMPILING_IN_CPYTHON
11183
- static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
11184
- while (a) {
11185
- a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
11186
- if (a == b)
11187
- return 1;
11188
- }
11189
- return b == &PyBaseObject_Type;
11190
- }
11191
- static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
11192
- PyObject *mro;
11193
- if (a == b) return 1;
11194
- mro = a->tp_mro;
11195
- if (likely(mro)) {
11196
- Py_ssize_t i, n;
11197
- n = PyTuple_GET_SIZE(mro);
11198
- for (i = 0; i < n; i++) {
11199
- if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
11200
- return 1;
11113
+ if (value) {
11114
+ PyErr_SetString(PyExc_TypeError,
11115
+ "instance exception may not have a separate value");
11116
+ goto raise_error;
11201
11117
  }
11202
- return 0;
11203
- }
11204
- return __Pyx_InBases(a, b);
11205
- }
11206
- static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
11207
- PyObject *mro;
11208
- if (cls == a || cls == b) return 1;
11209
- mro = cls->tp_mro;
11210
- if (likely(mro)) {
11211
- Py_ssize_t i, n;
11212
- n = PyTuple_GET_SIZE(mro);
11213
- for (i = 0; i < n; i++) {
11214
- PyObject *base = PyTuple_GET_ITEM(mro, i);
11215
- if (base == (PyObject *)a || base == (PyObject *)b)
11216
- return 1;
11118
+ value = type;
11119
+ type = (PyObject*) Py_TYPE(type);
11120
+ Py_INCREF(type);
11121
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
11122
+ PyErr_SetString(PyExc_TypeError,
11123
+ "raise: exception class must be a subclass of BaseException");
11124
+ goto raise_error;
11217
11125
  }
11218
- return 0;
11219
11126
  }
11220
- return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
11221
- }
11222
- #if PY_MAJOR_VERSION == 2
11223
- static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
11224
- PyObject *exception, *value, *tb;
11225
- int res;
11226
- __Pyx_PyThreadState_declare
11227
11127
  __Pyx_PyThreadState_assign
11228
- __Pyx_ErrFetch(&exception, &value, &tb);
11229
- res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
11230
- if (unlikely(res == -1)) {
11231
- PyErr_WriteUnraisable(err);
11232
- res = 0;
11233
- }
11234
- if (!res) {
11235
- res = PyObject_IsSubclass(err, exc_type2);
11236
- if (unlikely(res == -1)) {
11237
- PyErr_WriteUnraisable(err);
11238
- res = 0;
11239
- }
11240
- }
11241
- __Pyx_ErrRestore(exception, value, tb);
11242
- return res;
11128
+ __Pyx_ErrRestore(type, value, tb);
11129
+ return;
11130
+ raise_error:
11131
+ Py_XDECREF(value);
11132
+ Py_XDECREF(type);
11133
+ Py_XDECREF(tb);
11134
+ return;
11243
11135
  }
11244
11136
  #else
11245
- static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
11246
- if (exc_type1) {
11247
- return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
11248
- } else {
11249
- return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
11250
- }
11251
- }
11252
- #endif
11253
- static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11254
- Py_ssize_t i, n;
11255
- assert(PyExceptionClass_Check(exc_type));
11256
- n = PyTuple_GET_SIZE(tuple);
11257
- #if PY_MAJOR_VERSION >= 3
11258
- for (i=0; i<n; i++) {
11259
- if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11260
- }
11261
- #endif
11262
- for (i=0; i<n; i++) {
11263
- PyObject *t = PyTuple_GET_ITEM(tuple, i);
11264
- #if PY_MAJOR_VERSION < 3
11265
- if (likely(exc_type == t)) return 1;
11266
- #endif
11267
- if (likely(PyExceptionClass_Check(t))) {
11268
- if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
11269
- } else {
11270
- }
11271
- }
11272
- return 0;
11273
- }
11274
- static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
11275
- if (likely(err == exc_type)) return 1;
11276
- if (likely(PyExceptionClass_Check(err))) {
11277
- if (likely(PyExceptionClass_Check(exc_type))) {
11278
- return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
11279
- } else if (likely(PyTuple_Check(exc_type))) {
11280
- return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
11281
- } else {
11282
- }
11283
- }
11284
- return PyErr_GivenExceptionMatches(err, exc_type);
11285
- }
11286
- static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
11287
- assert(PyExceptionClass_Check(exc_type1));
11288
- assert(PyExceptionClass_Check(exc_type2));
11289
- if (likely(err == exc_type1 || err == exc_type2)) return 1;
11290
- if (likely(PyExceptionClass_Check(err))) {
11291
- return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
11292
- }
11293
- return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
11294
- }
11295
- #endif
11296
-
11297
- /* GetException */
11298
- #if CYTHON_FAST_THREAD_STATE
11299
- static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
11300
- #else
11301
- static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
11302
- #endif
11303
- {
11304
- PyObject *local_type = NULL, *local_value, *local_tb = NULL;
11305
- #if CYTHON_FAST_THREAD_STATE
11306
- PyObject *tmp_type, *tmp_value, *tmp_tb;
11307
- #if PY_VERSION_HEX >= 0x030C00A6
11308
- local_value = tstate->current_exception;
11309
- tstate->current_exception = 0;
11310
- if (likely(local_value)) {
11311
- local_type = (PyObject*) Py_TYPE(local_value);
11312
- Py_INCREF(local_type);
11313
- local_tb = PyException_GetTraceback(local_value);
11314
- }
11315
- #else
11316
- local_type = tstate->curexc_type;
11317
- local_value = tstate->curexc_value;
11318
- local_tb = tstate->curexc_traceback;
11319
- tstate->curexc_type = 0;
11320
- tstate->curexc_value = 0;
11321
- tstate->curexc_traceback = 0;
11322
- #endif
11323
- #else
11324
- PyErr_Fetch(&local_type, &local_value, &local_tb);
11325
- #endif
11326
- PyErr_NormalizeException(&local_type, &local_value, &local_tb);
11327
- #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
11328
- if (unlikely(tstate->current_exception))
11329
- #elif CYTHON_FAST_THREAD_STATE
11330
- if (unlikely(tstate->curexc_type))
11331
- #else
11332
- if (unlikely(PyErr_Occurred()))
11333
- #endif
11334
- goto bad;
11335
- #if PY_MAJOR_VERSION >= 3
11336
- if (local_tb) {
11337
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
11338
- goto bad;
11339
- }
11340
- #endif
11341
- Py_XINCREF(local_tb);
11342
- Py_XINCREF(local_type);
11343
- Py_XINCREF(local_value);
11344
- *type = local_type;
11345
- *value = local_value;
11346
- *tb = local_tb;
11347
- #if CYTHON_FAST_THREAD_STATE
11348
- #if CYTHON_USE_EXC_INFO_STACK
11349
- {
11350
- _PyErr_StackItem *exc_info = tstate->exc_info;
11351
- #if PY_VERSION_HEX >= 0x030B00a4
11352
- tmp_value = exc_info->exc_value;
11353
- exc_info->exc_value = local_value;
11354
- tmp_type = NULL;
11355
- tmp_tb = NULL;
11356
- Py_XDECREF(local_type);
11357
- Py_XDECREF(local_tb);
11358
- #else
11359
- tmp_type = exc_info->exc_type;
11360
- tmp_value = exc_info->exc_value;
11361
- tmp_tb = exc_info->exc_traceback;
11362
- exc_info->exc_type = local_type;
11363
- exc_info->exc_value = local_value;
11364
- exc_info->exc_traceback = local_tb;
11365
- #endif
11366
- }
11367
- #else
11368
- tmp_type = tstate->exc_type;
11369
- tmp_value = tstate->exc_value;
11370
- tmp_tb = tstate->exc_traceback;
11371
- tstate->exc_type = local_type;
11372
- tstate->exc_value = local_value;
11373
- tstate->exc_traceback = local_tb;
11374
- #endif
11375
- Py_XDECREF(tmp_type);
11376
- Py_XDECREF(tmp_value);
11377
- Py_XDECREF(tmp_tb);
11378
- #else
11379
- PyErr_SetExcInfo(local_type, local_value, local_tb);
11380
- #endif
11381
- return 0;
11382
- bad:
11383
- *type = 0;
11384
- *value = 0;
11385
- *tb = 0;
11386
- Py_XDECREF(local_type);
11387
- Py_XDECREF(local_value);
11388
- Py_XDECREF(local_tb);
11389
- return -1;
11390
- }
11391
-
11392
- /* SwapException */
11393
- #if CYTHON_FAST_THREAD_STATE
11394
- static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11395
- PyObject *tmp_type, *tmp_value, *tmp_tb;
11396
- #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
11397
- _PyErr_StackItem *exc_info = tstate->exc_info;
11398
- tmp_value = exc_info->exc_value;
11399
- exc_info->exc_value = *value;
11400
- if (tmp_value == NULL || tmp_value == Py_None) {
11401
- Py_XDECREF(tmp_value);
11402
- tmp_value = NULL;
11403
- tmp_type = NULL;
11404
- tmp_tb = NULL;
11405
- } else {
11406
- tmp_type = (PyObject*) Py_TYPE(tmp_value);
11407
- Py_INCREF(tmp_type);
11408
- #if CYTHON_COMPILING_IN_CPYTHON
11409
- tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
11410
- Py_XINCREF(tmp_tb);
11411
- #else
11412
- tmp_tb = PyException_GetTraceback(tmp_value);
11413
- #endif
11414
- }
11415
- #elif CYTHON_USE_EXC_INFO_STACK
11416
- _PyErr_StackItem *exc_info = tstate->exc_info;
11417
- tmp_type = exc_info->exc_type;
11418
- tmp_value = exc_info->exc_value;
11419
- tmp_tb = exc_info->exc_traceback;
11420
- exc_info->exc_type = *type;
11421
- exc_info->exc_value = *value;
11422
- exc_info->exc_traceback = *tb;
11423
- #else
11424
- tmp_type = tstate->exc_type;
11425
- tmp_value = tstate->exc_value;
11426
- tmp_tb = tstate->exc_traceback;
11427
- tstate->exc_type = *type;
11428
- tstate->exc_value = *value;
11429
- tstate->exc_traceback = *tb;
11430
- #endif
11431
- *type = tmp_type;
11432
- *value = tmp_value;
11433
- *tb = tmp_tb;
11434
- }
11435
- #else
11436
- static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
11437
- PyObject *tmp_type, *tmp_value, *tmp_tb;
11438
- PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
11439
- PyErr_SetExcInfo(*type, *value, *tb);
11440
- *type = tmp_type;
11441
- *value = tmp_value;
11442
- *tb = tmp_tb;
11443
- }
11444
- #endif
11445
-
11446
- /* RaiseException */
11447
- #if PY_MAJOR_VERSION < 3
11448
- static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11449
- __Pyx_PyThreadState_declare
11450
- CYTHON_UNUSED_VAR(cause);
11451
- Py_XINCREF(type);
11452
- if (!value || value == Py_None)
11453
- value = NULL;
11454
- else
11455
- Py_INCREF(value);
11456
- if (!tb || tb == Py_None)
11457
- tb = NULL;
11458
- else {
11459
- Py_INCREF(tb);
11460
- if (!PyTraceBack_Check(tb)) {
11461
- PyErr_SetString(PyExc_TypeError,
11462
- "raise: arg 3 must be a traceback or None");
11463
- goto raise_error;
11464
- }
11465
- }
11466
- if (PyType_Check(type)) {
11467
- #if CYTHON_COMPILING_IN_PYPY
11468
- if (!value) {
11469
- Py_INCREF(Py_None);
11470
- value = Py_None;
11471
- }
11472
- #endif
11473
- PyErr_NormalizeException(&type, &value, &tb);
11474
- } else {
11475
- if (value) {
11476
- PyErr_SetString(PyExc_TypeError,
11477
- "instance exception may not have a separate value");
11478
- goto raise_error;
11479
- }
11480
- value = type;
11481
- type = (PyObject*) Py_TYPE(type);
11482
- Py_INCREF(type);
11483
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
11484
- PyErr_SetString(PyExc_TypeError,
11485
- "raise: exception class must be a subclass of BaseException");
11486
- goto raise_error;
11487
- }
11488
- }
11489
- __Pyx_PyThreadState_assign
11490
- __Pyx_ErrRestore(type, value, tb);
11491
- return;
11492
- raise_error:
11493
- Py_XDECREF(value);
11494
- Py_XDECREF(type);
11495
- Py_XDECREF(tb);
11496
- return;
11497
- }
11498
- #else
11499
- static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11500
- PyObject* owned_instance = NULL;
11501
- if (tb == Py_None) {
11502
- tb = 0;
11503
- } else if (tb && !PyTraceBack_Check(tb)) {
11504
- PyErr_SetString(PyExc_TypeError,
11505
- "raise: arg 3 must be a traceback or None");
11506
- goto bad;
11137
+ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
11138
+ PyObject* owned_instance = NULL;
11139
+ if (tb == Py_None) {
11140
+ tb = 0;
11141
+ } else if (tb && !PyTraceBack_Check(tb)) {
11142
+ PyErr_SetString(PyExc_TypeError,
11143
+ "raise: arg 3 must be a traceback or None");
11144
+ goto bad;
11507
11145
  }
11508
11146
  if (value == Py_None)
11509
11147
  value = 0;
@@ -11598,91 +11236,438 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject
11598
11236
  Py_XDECREF(tmp_tb);
11599
11237
  #endif
11600
11238
  }
11601
- bad:
11602
- Py_XDECREF(owned_instance);
11603
- return;
11239
+ bad:
11240
+ Py_XDECREF(owned_instance);
11241
+ return;
11242
+ }
11243
+ #endif
11244
+
11245
+ /* JoinPyUnicode */
11246
+ static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
11247
+ Py_UCS4 max_char) {
11248
+ #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11249
+ PyObject *result_uval;
11250
+ int result_ukind, kind_shift;
11251
+ Py_ssize_t i, char_pos;
11252
+ void *result_udata;
11253
+ CYTHON_MAYBE_UNUSED_VAR(max_char);
11254
+ #if CYTHON_PEP393_ENABLED
11255
+ result_uval = PyUnicode_New(result_ulength, max_char);
11256
+ if (unlikely(!result_uval)) return NULL;
11257
+ result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
11258
+ kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
11259
+ result_udata = PyUnicode_DATA(result_uval);
11260
+ #else
11261
+ result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
11262
+ if (unlikely(!result_uval)) return NULL;
11263
+ result_ukind = sizeof(Py_UNICODE);
11264
+ kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
11265
+ result_udata = PyUnicode_AS_UNICODE(result_uval);
11266
+ #endif
11267
+ assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
11268
+ char_pos = 0;
11269
+ for (i=0; i < value_count; i++) {
11270
+ int ukind;
11271
+ Py_ssize_t ulength;
11272
+ void *udata;
11273
+ PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
11274
+ if (unlikely(__Pyx_PyUnicode_READY(uval)))
11275
+ goto bad;
11276
+ ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
11277
+ if (unlikely(!ulength))
11278
+ continue;
11279
+ if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
11280
+ goto overflow;
11281
+ ukind = __Pyx_PyUnicode_KIND(uval);
11282
+ udata = __Pyx_PyUnicode_DATA(uval);
11283
+ if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
11284
+ memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
11285
+ } else {
11286
+ #if PY_VERSION_HEX >= 0x030d0000
11287
+ if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
11288
+ #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
11289
+ _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
11290
+ #else
11291
+ Py_ssize_t j;
11292
+ for (j=0; j < ulength; j++) {
11293
+ Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
11294
+ __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
11295
+ }
11296
+ #endif
11297
+ }
11298
+ char_pos += ulength;
11299
+ }
11300
+ return result_uval;
11301
+ overflow:
11302
+ PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
11303
+ bad:
11304
+ Py_DECREF(result_uval);
11305
+ return NULL;
11306
+ #else
11307
+ CYTHON_UNUSED_VAR(max_char);
11308
+ CYTHON_UNUSED_VAR(result_ulength);
11309
+ CYTHON_UNUSED_VAR(value_count);
11310
+ return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
11311
+ #endif
11312
+ }
11313
+
11314
+ /* RaiseUnexpectedTypeError */
11315
+ static int
11316
+ __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
11317
+ {
11318
+ __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
11319
+ PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
11320
+ expected, obj_type_name);
11321
+ __Pyx_DECREF_TypeName(obj_type_name);
11322
+ return 0;
11323
+ }
11324
+
11325
+ /* GetTopmostException */
11326
+ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
11327
+ static _PyErr_StackItem *
11328
+ __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11329
+ {
11330
+ _PyErr_StackItem *exc_info = tstate->exc_info;
11331
+ while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
11332
+ exc_info->previous_item != NULL)
11333
+ {
11334
+ exc_info = exc_info->previous_item;
11335
+ }
11336
+ return exc_info;
11337
+ }
11338
+ #endif
11339
+
11340
+ /* SaveResetException */
11341
+ #if CYTHON_FAST_THREAD_STATE
11342
+ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11343
+ #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
11344
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11345
+ PyObject *exc_value = exc_info->exc_value;
11346
+ if (exc_value == NULL || exc_value == Py_None) {
11347
+ *value = NULL;
11348
+ *type = NULL;
11349
+ *tb = NULL;
11350
+ } else {
11351
+ *value = exc_value;
11352
+ Py_INCREF(*value);
11353
+ *type = (PyObject*) Py_TYPE(exc_value);
11354
+ Py_INCREF(*type);
11355
+ *tb = PyException_GetTraceback(exc_value);
11356
+ }
11357
+ #elif CYTHON_USE_EXC_INFO_STACK
11358
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
11359
+ *type = exc_info->exc_type;
11360
+ *value = exc_info->exc_value;
11361
+ *tb = exc_info->exc_traceback;
11362
+ Py_XINCREF(*type);
11363
+ Py_XINCREF(*value);
11364
+ Py_XINCREF(*tb);
11365
+ #else
11366
+ *type = tstate->exc_type;
11367
+ *value = tstate->exc_value;
11368
+ *tb = tstate->exc_traceback;
11369
+ Py_XINCREF(*type);
11370
+ Py_XINCREF(*value);
11371
+ Py_XINCREF(*tb);
11372
+ #endif
11373
+ }
11374
+ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
11375
+ #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
11376
+ _PyErr_StackItem *exc_info = tstate->exc_info;
11377
+ PyObject *tmp_value = exc_info->exc_value;
11378
+ exc_info->exc_value = value;
11379
+ Py_XDECREF(tmp_value);
11380
+ Py_XDECREF(type);
11381
+ Py_XDECREF(tb);
11382
+ #else
11383
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
11384
+ #if CYTHON_USE_EXC_INFO_STACK
11385
+ _PyErr_StackItem *exc_info = tstate->exc_info;
11386
+ tmp_type = exc_info->exc_type;
11387
+ tmp_value = exc_info->exc_value;
11388
+ tmp_tb = exc_info->exc_traceback;
11389
+ exc_info->exc_type = type;
11390
+ exc_info->exc_value = value;
11391
+ exc_info->exc_traceback = tb;
11392
+ #else
11393
+ tmp_type = tstate->exc_type;
11394
+ tmp_value = tstate->exc_value;
11395
+ tmp_tb = tstate->exc_traceback;
11396
+ tstate->exc_type = type;
11397
+ tstate->exc_value = value;
11398
+ tstate->exc_traceback = tb;
11399
+ #endif
11400
+ Py_XDECREF(tmp_type);
11401
+ Py_XDECREF(tmp_value);
11402
+ Py_XDECREF(tmp_tb);
11403
+ #endif
11404
+ }
11405
+ #endif
11406
+
11407
+ /* FastTypeChecks */
11408
+ #if CYTHON_COMPILING_IN_CPYTHON
11409
+ static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
11410
+ while (a) {
11411
+ a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
11412
+ if (a == b)
11413
+ return 1;
11414
+ }
11415
+ return b == &PyBaseObject_Type;
11416
+ }
11417
+ static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
11418
+ PyObject *mro;
11419
+ if (a == b) return 1;
11420
+ mro = a->tp_mro;
11421
+ if (likely(mro)) {
11422
+ Py_ssize_t i, n;
11423
+ n = PyTuple_GET_SIZE(mro);
11424
+ for (i = 0; i < n; i++) {
11425
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
11426
+ return 1;
11427
+ }
11428
+ return 0;
11429
+ }
11430
+ return __Pyx_InBases(a, b);
11431
+ }
11432
+ static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
11433
+ PyObject *mro;
11434
+ if (cls == a || cls == b) return 1;
11435
+ mro = cls->tp_mro;
11436
+ if (likely(mro)) {
11437
+ Py_ssize_t i, n;
11438
+ n = PyTuple_GET_SIZE(mro);
11439
+ for (i = 0; i < n; i++) {
11440
+ PyObject *base = PyTuple_GET_ITEM(mro, i);
11441
+ if (base == (PyObject *)a || base == (PyObject *)b)
11442
+ return 1;
11443
+ }
11444
+ return 0;
11445
+ }
11446
+ return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
11447
+ }
11448
+ #if PY_MAJOR_VERSION == 2
11449
+ static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
11450
+ PyObject *exception, *value, *tb;
11451
+ int res;
11452
+ __Pyx_PyThreadState_declare
11453
+ __Pyx_PyThreadState_assign
11454
+ __Pyx_ErrFetch(&exception, &value, &tb);
11455
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
11456
+ if (unlikely(res == -1)) {
11457
+ PyErr_WriteUnraisable(err);
11458
+ res = 0;
11459
+ }
11460
+ if (!res) {
11461
+ res = PyObject_IsSubclass(err, exc_type2);
11462
+ if (unlikely(res == -1)) {
11463
+ PyErr_WriteUnraisable(err);
11464
+ res = 0;
11465
+ }
11466
+ }
11467
+ __Pyx_ErrRestore(exception, value, tb);
11468
+ return res;
11469
+ }
11470
+ #else
11471
+ static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
11472
+ if (exc_type1) {
11473
+ return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
11474
+ } else {
11475
+ return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
11476
+ }
11477
+ }
11478
+ #endif
11479
+ static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11480
+ Py_ssize_t i, n;
11481
+ assert(PyExceptionClass_Check(exc_type));
11482
+ n = PyTuple_GET_SIZE(tuple);
11483
+ #if PY_MAJOR_VERSION >= 3
11484
+ for (i=0; i<n; i++) {
11485
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11486
+ }
11487
+ #endif
11488
+ for (i=0; i<n; i++) {
11489
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
11490
+ #if PY_MAJOR_VERSION < 3
11491
+ if (likely(exc_type == t)) return 1;
11492
+ #endif
11493
+ if (likely(PyExceptionClass_Check(t))) {
11494
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
11495
+ } else {
11496
+ }
11497
+ }
11498
+ return 0;
11499
+ }
11500
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
11501
+ if (likely(err == exc_type)) return 1;
11502
+ if (likely(PyExceptionClass_Check(err))) {
11503
+ if (likely(PyExceptionClass_Check(exc_type))) {
11504
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
11505
+ } else if (likely(PyTuple_Check(exc_type))) {
11506
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
11507
+ } else {
11508
+ }
11509
+ }
11510
+ return PyErr_GivenExceptionMatches(err, exc_type);
11511
+ }
11512
+ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
11513
+ assert(PyExceptionClass_Check(exc_type1));
11514
+ assert(PyExceptionClass_Check(exc_type2));
11515
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
11516
+ if (likely(PyExceptionClass_Check(err))) {
11517
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
11518
+ }
11519
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
11604
11520
  }
11605
11521
  #endif
11606
11522
 
11607
- /* JoinPyUnicode */
11608
- static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
11609
- Py_UCS4 max_char) {
11610
- #if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11611
- PyObject *result_uval;
11612
- int result_ukind, kind_shift;
11613
- Py_ssize_t i, char_pos;
11614
- void *result_udata;
11615
- CYTHON_MAYBE_UNUSED_VAR(max_char);
11616
- #if CYTHON_PEP393_ENABLED
11617
- result_uval = PyUnicode_New(result_ulength, max_char);
11618
- if (unlikely(!result_uval)) return NULL;
11619
- result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
11620
- kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
11621
- result_udata = PyUnicode_DATA(result_uval);
11523
+ /* GetException */
11524
+ #if CYTHON_FAST_THREAD_STATE
11525
+ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
11622
11526
  #else
11623
- result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
11624
- if (unlikely(!result_uval)) return NULL;
11625
- result_ukind = sizeof(Py_UNICODE);
11626
- kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
11627
- result_udata = PyUnicode_AS_UNICODE(result_uval);
11527
+ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
11628
11528
  #endif
11629
- assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
11630
- char_pos = 0;
11631
- for (i=0; i < value_count; i++) {
11632
- int ukind;
11633
- Py_ssize_t ulength;
11634
- void *udata;
11635
- PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
11636
- if (unlikely(__Pyx_PyUnicode_READY(uval)))
11529
+ {
11530
+ PyObject *local_type = NULL, *local_value, *local_tb = NULL;
11531
+ #if CYTHON_FAST_THREAD_STATE
11532
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
11533
+ #if PY_VERSION_HEX >= 0x030C00A6
11534
+ local_value = tstate->current_exception;
11535
+ tstate->current_exception = 0;
11536
+ if (likely(local_value)) {
11537
+ local_type = (PyObject*) Py_TYPE(local_value);
11538
+ Py_INCREF(local_type);
11539
+ local_tb = PyException_GetTraceback(local_value);
11540
+ }
11541
+ #else
11542
+ local_type = tstate->curexc_type;
11543
+ local_value = tstate->curexc_value;
11544
+ local_tb = tstate->curexc_traceback;
11545
+ tstate->curexc_type = 0;
11546
+ tstate->curexc_value = 0;
11547
+ tstate->curexc_traceback = 0;
11548
+ #endif
11549
+ #else
11550
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
11551
+ #endif
11552
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
11553
+ #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
11554
+ if (unlikely(tstate->current_exception))
11555
+ #elif CYTHON_FAST_THREAD_STATE
11556
+ if (unlikely(tstate->curexc_type))
11557
+ #else
11558
+ if (unlikely(PyErr_Occurred()))
11559
+ #endif
11560
+ goto bad;
11561
+ #if PY_MAJOR_VERSION >= 3
11562
+ if (local_tb) {
11563
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
11637
11564
  goto bad;
11638
- ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
11639
- if (unlikely(!ulength))
11640
- continue;
11641
- if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
11642
- goto overflow;
11643
- ukind = __Pyx_PyUnicode_KIND(uval);
11644
- udata = __Pyx_PyUnicode_DATA(uval);
11645
- if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
11646
- memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
11647
- } else {
11648
- #if PY_VERSION_HEX >= 0x030d0000
11649
- if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
11650
- #elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
11651
- _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
11652
- #else
11653
- Py_ssize_t j;
11654
- for (j=0; j < ulength; j++) {
11655
- Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
11656
- __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
11657
- }
11658
- #endif
11659
- }
11660
- char_pos += ulength;
11661
11565
  }
11662
- return result_uval;
11663
- overflow:
11664
- PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
11665
- bad:
11666
- Py_DECREF(result_uval);
11667
- return NULL;
11566
+ #endif
11567
+ Py_XINCREF(local_tb);
11568
+ Py_XINCREF(local_type);
11569
+ Py_XINCREF(local_value);
11570
+ *type = local_type;
11571
+ *value = local_value;
11572
+ *tb = local_tb;
11573
+ #if CYTHON_FAST_THREAD_STATE
11574
+ #if CYTHON_USE_EXC_INFO_STACK
11575
+ {
11576
+ _PyErr_StackItem *exc_info = tstate->exc_info;
11577
+ #if PY_VERSION_HEX >= 0x030B00a4
11578
+ tmp_value = exc_info->exc_value;
11579
+ exc_info->exc_value = local_value;
11580
+ tmp_type = NULL;
11581
+ tmp_tb = NULL;
11582
+ Py_XDECREF(local_type);
11583
+ Py_XDECREF(local_tb);
11584
+ #else
11585
+ tmp_type = exc_info->exc_type;
11586
+ tmp_value = exc_info->exc_value;
11587
+ tmp_tb = exc_info->exc_traceback;
11588
+ exc_info->exc_type = local_type;
11589
+ exc_info->exc_value = local_value;
11590
+ exc_info->exc_traceback = local_tb;
11591
+ #endif
11592
+ }
11593
+ #else
11594
+ tmp_type = tstate->exc_type;
11595
+ tmp_value = tstate->exc_value;
11596
+ tmp_tb = tstate->exc_traceback;
11597
+ tstate->exc_type = local_type;
11598
+ tstate->exc_value = local_value;
11599
+ tstate->exc_traceback = local_tb;
11600
+ #endif
11601
+ Py_XDECREF(tmp_type);
11602
+ Py_XDECREF(tmp_value);
11603
+ Py_XDECREF(tmp_tb);
11668
11604
  #else
11669
- CYTHON_UNUSED_VAR(max_char);
11670
- CYTHON_UNUSED_VAR(result_ulength);
11671
- CYTHON_UNUSED_VAR(value_count);
11672
- return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
11605
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
11673
11606
  #endif
11607
+ return 0;
11608
+ bad:
11609
+ *type = 0;
11610
+ *value = 0;
11611
+ *tb = 0;
11612
+ Py_XDECREF(local_type);
11613
+ Py_XDECREF(local_value);
11614
+ Py_XDECREF(local_tb);
11615
+ return -1;
11674
11616
  }
11675
11617
 
11676
- /* RaiseUnexpectedTypeError */
11677
- static int
11678
- __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
11679
- {
11680
- __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
11681
- PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
11682
- expected, obj_type_name);
11683
- __Pyx_DECREF_TypeName(obj_type_name);
11684
- return 0;
11618
+ /* SwapException */
11619
+ #if CYTHON_FAST_THREAD_STATE
11620
+ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
11621
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
11622
+ #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
11623
+ _PyErr_StackItem *exc_info = tstate->exc_info;
11624
+ tmp_value = exc_info->exc_value;
11625
+ exc_info->exc_value = *value;
11626
+ if (tmp_value == NULL || tmp_value == Py_None) {
11627
+ Py_XDECREF(tmp_value);
11628
+ tmp_value = NULL;
11629
+ tmp_type = NULL;
11630
+ tmp_tb = NULL;
11631
+ } else {
11632
+ tmp_type = (PyObject*) Py_TYPE(tmp_value);
11633
+ Py_INCREF(tmp_type);
11634
+ #if CYTHON_COMPILING_IN_CPYTHON
11635
+ tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
11636
+ Py_XINCREF(tmp_tb);
11637
+ #else
11638
+ tmp_tb = PyException_GetTraceback(tmp_value);
11639
+ #endif
11640
+ }
11641
+ #elif CYTHON_USE_EXC_INFO_STACK
11642
+ _PyErr_StackItem *exc_info = tstate->exc_info;
11643
+ tmp_type = exc_info->exc_type;
11644
+ tmp_value = exc_info->exc_value;
11645
+ tmp_tb = exc_info->exc_traceback;
11646
+ exc_info->exc_type = *type;
11647
+ exc_info->exc_value = *value;
11648
+ exc_info->exc_traceback = *tb;
11649
+ #else
11650
+ tmp_type = tstate->exc_type;
11651
+ tmp_value = tstate->exc_value;
11652
+ tmp_tb = tstate->exc_traceback;
11653
+ tstate->exc_type = *type;
11654
+ tstate->exc_value = *value;
11655
+ tstate->exc_traceback = *tb;
11656
+ #endif
11657
+ *type = tmp_type;
11658
+ *value = tmp_value;
11659
+ *tb = tmp_tb;
11660
+ }
11661
+ #else
11662
+ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
11663
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
11664
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
11665
+ PyErr_SetExcInfo(*type, *value, *tb);
11666
+ *type = tmp_type;
11667
+ *value = tmp_value;
11668
+ *tb = tmp_tb;
11685
11669
  }
11670
+ #endif
11686
11671
 
11687
11672
  /* GetItemInt */
11688
11673
  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
@@ -11883,6 +11868,106 @@ bad:
11883
11868
  return NULL;
11884
11869
  }
11885
11870
 
11871
+ /* TypeImport */
11872
+ #ifndef __PYX_HAVE_RT_ImportType_3_0_12
11873
+ #define __PYX_HAVE_RT_ImportType_3_0_12
11874
+ static PyTypeObject *__Pyx_ImportType_3_0_12(PyObject *module, const char *module_name, const char *class_name,
11875
+ size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_12 check_size)
11876
+ {
11877
+ PyObject *result = 0;
11878
+ char warning[200];
11879
+ Py_ssize_t basicsize;
11880
+ Py_ssize_t itemsize;
11881
+ #if CYTHON_COMPILING_IN_LIMITED_API
11882
+ PyObject *py_basicsize;
11883
+ PyObject *py_itemsize;
11884
+ #endif
11885
+ result = PyObject_GetAttrString(module, class_name);
11886
+ if (!result)
11887
+ goto bad;
11888
+ if (!PyType_Check(result)) {
11889
+ PyErr_Format(PyExc_TypeError,
11890
+ "%.200s.%.200s is not a type object",
11891
+ module_name, class_name);
11892
+ goto bad;
11893
+ }
11894
+ #if !CYTHON_COMPILING_IN_LIMITED_API
11895
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
11896
+ itemsize = ((PyTypeObject *)result)->tp_itemsize;
11897
+ #else
11898
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
11899
+ if (!py_basicsize)
11900
+ goto bad;
11901
+ basicsize = PyLong_AsSsize_t(py_basicsize);
11902
+ Py_DECREF(py_basicsize);
11903
+ py_basicsize = 0;
11904
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
11905
+ goto bad;
11906
+ py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
11907
+ if (!py_itemsize)
11908
+ goto bad;
11909
+ itemsize = PyLong_AsSsize_t(py_itemsize);
11910
+ Py_DECREF(py_itemsize);
11911
+ py_itemsize = 0;
11912
+ if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
11913
+ goto bad;
11914
+ #endif
11915
+ if (itemsize) {
11916
+ if (size % alignment) {
11917
+ alignment = size % alignment;
11918
+ }
11919
+ if (itemsize < (Py_ssize_t)alignment)
11920
+ itemsize = (Py_ssize_t)alignment;
11921
+ }
11922
+ if ((size_t)(basicsize + itemsize) < size) {
11923
+ PyErr_Format(PyExc_ValueError,
11924
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
11925
+ "Expected %zd from C header, got %zd from PyObject",
11926
+ module_name, class_name, size, basicsize+itemsize);
11927
+ goto bad;
11928
+ }
11929
+ if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_12 &&
11930
+ ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
11931
+ PyErr_Format(PyExc_ValueError,
11932
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
11933
+ "Expected %zd from C header, got %zd-%zd from PyObject",
11934
+ module_name, class_name, size, basicsize, basicsize+itemsize);
11935
+ goto bad;
11936
+ }
11937
+ else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_12 && (size_t)basicsize > size) {
11938
+ PyOS_snprintf(warning, sizeof(warning),
11939
+ "%s.%s size changed, may indicate binary incompatibility. "
11940
+ "Expected %zd from C header, got %zd from PyObject",
11941
+ module_name, class_name, size, basicsize);
11942
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
11943
+ }
11944
+ return (PyTypeObject *)result;
11945
+ bad:
11946
+ Py_XDECREF(result);
11947
+ return NULL;
11948
+ }
11949
+ #endif
11950
+
11951
+ /* GetVTable */
11952
+ static void* __Pyx_GetVtable(PyTypeObject *type) {
11953
+ void* ptr;
11954
+ #if CYTHON_COMPILING_IN_LIMITED_API
11955
+ PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
11956
+ #else
11957
+ PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
11958
+ #endif
11959
+ if (!ob)
11960
+ goto bad;
11961
+ ptr = PyCapsule_GetPointer(ob, 0);
11962
+ if (!ptr && !PyErr_Occurred())
11963
+ PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
11964
+ Py_DECREF(ob);
11965
+ return ptr;
11966
+ bad:
11967
+ Py_XDECREF(ob);
11968
+ return NULL;
11969
+ }
11970
+
11886
11971
  /* Import */
11887
11972
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
11888
11973
  PyObject *module = 0;
@@ -13494,7 +13579,7 @@ static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
13494
13579
  #include "compile.h"
13495
13580
  #include "frameobject.h"
13496
13581
  #include "traceback.h"
13497
- #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
13582
+ #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
13498
13583
  #ifndef Py_BUILD_CORE
13499
13584
  #define Py_BUILD_CORE 1
13500
13585
  #endif
@@ -14477,9 +14562,9 @@ bad:
14477
14562
  }
14478
14563
 
14479
14564
  /* FunctionImport */
14480
- #ifndef __PYX_HAVE_RT_ImportFunction_3_0_11
14481
- #define __PYX_HAVE_RT_ImportFunction_3_0_11
14482
- static int __Pyx_ImportFunction_3_0_11(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
14565
+ #ifndef __PYX_HAVE_RT_ImportFunction_3_0_12
14566
+ #define __PYX_HAVE_RT_ImportFunction_3_0_12
14567
+ static int __Pyx_ImportFunction_3_0_12(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
14483
14568
  PyObject *d = 0;
14484
14569
  PyObject *cobj = 0;
14485
14570
  union {