@@ -69,7 +69,9 @@ def get_authorities():
69
69
Authorities in PROJ database.
70
70
"""
71
71
cdef PJ_CONTEXT* context = pyproj_context_create()
72
- cdef PROJ_STRING_LIST proj_auth_list = proj_get_authorities_from_database(context)
72
+ cdef PROJ_STRING_LIST proj_auth_list = NULL
73
+ with nogil:
74
+ proj_auth_list = proj_get_authorities_from_database(context)
73
75
if proj_auth_list == NULL :
74
76
pyproj_context_destroy(context)
75
77
return []
@@ -108,14 +110,19 @@ def get_codes(str auth_name not None, pj_type not None, bint allow_deprecated=Fa
108
110
cdef PJ_CONTEXT* context = NULL
109
111
cdef PJ_TYPE cpj_type = get_pj_type(pj_type)
110
112
cdef PROJ_STRING_LIST proj_code_list = NULL
113
+ cdef const char * c_auth_name = NULL
114
+ cdef bytes b_auth_name
111
115
try :
112
116
context = pyproj_context_create()
113
- proj_code_list = proj_get_codes_from_database(
114
- context,
115
- cstrencode(auth_name),
116
- cpj_type,
117
- allow_deprecated,
118
- )
117
+ b_auth_name = cstrencode(auth_name)
118
+ c_auth_name = b_auth_name
119
+ with nogil:
120
+ proj_code_list = proj_get_codes_from_database(
121
+ context,
122
+ c_auth_name,
123
+ cpj_type,
124
+ allow_deprecated,
125
+ )
119
126
finally :
120
127
pyproj_context_destroy(context)
121
128
if proj_code_list == NULL :
@@ -239,11 +246,12 @@ def query_crs_info(
239
246
query_params.east_lon_degree = area_of_interest.east_lon_degree
240
247
query_params.north_lat_degree = area_of_interest.north_lat_degree
241
248
242
- crs_info_list = proj_get_crs_info_list_from_database(
243
- context,
244
- c_auth_name,
245
- query_params,
246
- & result_count)
249
+ with nogil:
250
+ crs_info_list = proj_get_crs_info_list_from_database(
251
+ context,
252
+ c_auth_name,
253
+ query_params,
254
+ & result_count)
247
255
finally :
248
256
if query_params != NULL :
249
257
proj_get_crs_list_parameters_destroy(query_params)
@@ -400,13 +408,15 @@ def get_units_map(str auth_name=None, str category=None, bint allow_deprecated=F
400
408
401
409
cdef int num_units = 0
402
410
cdef PJ_CONTEXT* context = pyproj_context_create()
403
- cdef PROJ_UNIT_INFO** db_unit_list = proj_get_units_from_database(
404
- context,
405
- c_auth_name,
406
- c_category,
407
- bool (allow_deprecated),
408
- & num_units,
409
- )
411
+ cdef PROJ_UNIT_INFO** db_unit_list = NULL
412
+ with nogil:
413
+ db_unit_list = proj_get_units_from_database(
414
+ context,
415
+ c_auth_name,
416
+ c_category,
417
+ bool (allow_deprecated),
418
+ & num_units,
419
+ )
410
420
units_map = {}
411
421
try :
412
422
for iii in range (num_units):
0 commit comments