Commit f65c5039 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Merge branch 'bugfix/fix_static_TLS_import_error' into 'master'

Bugfix/fix static tls import error

Closes #8

See merge request !2
parents fa0b0006 5d02fbd0
Pipeline #3741 failed with stages
in 12 minutes and 27 seconds
# -*- coding: utf-8 -*-
from . import exceptions
__author__ = 'Daniel Scheffler'
__all__ = ['exceptions']
# -*- coding: utf-8 -*-
from . import object_oriented
__author__ = "Daniel Scheffler"
__all__ = ['object_oriented']
# -*- coding: utf-8 -*-
__author__ = "Daniel Scheffler"
from . import conversion
__all__ = ['conversion']
from . import raster
from . import vector
from . import coord_calc
from . import coord_trafo
from . import coord_grid
from . import map_info
from . import projection
__all__ = ['raster',
'vector',
'coord_calc',
'coord_trafo',
'coord_grid',
'map_info',
'projection']
# -*- coding: utf-8 -*-
__author__ = 'Daniel Scheffler'
# -*- coding: utf-8 -*-
__author__ = "Daniel Scheffler"
from . import conversion
from . import reproject
__all__ = ['conversion',
'reproject']
......@@ -14,10 +14,9 @@ except ImportError:
import gdal
import gdalnumeric
import rasterio
from rasterio.warp import reproject as rio_reproject
from rasterio.warp import calculate_default_transform as rio_calc_transform
from rasterio.warp import Resampling
# NOTE: In case of ImportError: dlopen: cannot load any more object with static TLS,
# one could add 'from pykdtree.kdtree import KDTree' here (before pyresample import)
from pyresample.geometry import AreaDefinition, SwathDefinition
from pyresample.utils import get_area_def
from pyresample.bilinear import resample_bilinear
......@@ -63,6 +62,16 @@ def warp_ndarray_OLD(ndarray, in_gt, in_prj, out_prj, out_gt=None, outRowsCols=N
:return out_gt: warped gdal GeoTransform
:return out_prj: warped projection as WKT string
"""
# NOTE: rasterio seems to increase the number of objects with static TLS
# There is a maximum number and if this is exceeded an ImportError is raised:
# ImportError: dlopen: cannot load any more object with static TLS
# - see also: https://gitext.gfz-potsdam.de/danschef/py_tools_ds/issues/8
# - NOTE: importing rasterio AFTER pyresample (which uses pykdtree) seems to solve that too
# => keep the rasterio import within the function locals to avoid not needed imports
import rasterio
from rasterio.warp import reproject as rio_reproject
from rasterio.warp import calculate_default_transform as rio_calc_transform
from rasterio.warp import Resampling
if not ndarray.flags['OWNDATA']:
temp = np.empty_like(ndarray)
......
# -*- coding: utf-8 -*-
from . import geometry
from . import topology
from . import conversion
__author__ = "Daniel Scheffler"
__all__ = ['geometry',
'topology',
'conversion']
# -*- coding: utf-8 -*-
from . import raster
from . import pathgen
__author__ = "Daniel Scheffler"
__all__ = ['raster',
'pathgen']
# -*- coding: utf-8 -*-
from . import array
from . import vector
__author__ = "Daniel Scheffler"
__all__ = ['array',
'vector']
# -*- coding: utf-8 -*-
from . import shell
__author__ = "Daniel Scheffler"
__all__ = ['shell']
# -*- coding: utf-8 -*-
from . import raster
__author__ = "Daniel Scheffler"
__all__ = ['raster']
__version__ = '0.14.10'
__versionalias__ = '20190219_01'
__version__ = '0.14.11'
__versionalias__ = '20190219_02'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment