Skip to content

Commit

Permalink
Mapper: Remove deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
janezd committed Nov 22, 2024
1 parent e630e10 commit fa5efaf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
24 changes: 0 additions & 24 deletions orangecontrib/geo/mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,13 @@
log = logging.getLogger(__name__)


def is_shapely_speedups_available():
if not shapely.speedups.available:
return False
# Otherwise try shapely with speedups in a subprocess to see if shit
# is crash due to ABI-incompatible libgeos found in path on Loonix
import sys, subprocess
proc = subprocess.Popen(
sys.executable + ' -c ' + '''"import json
from shapely.geometry import shape
import shapely.speedups
shapely.speedups.enable()
shape(json.load(open('%s'))['features'][0]['geometry'])
"''' % path.join(GEOJSON_DIR, 'admin0.json'),
# Didn't return correct exit status without shell=True
shell=True)
proc.wait()
return proc.returncode == 0


GEOJSON_DIR = path.join(path.dirname(__file__), 'geojson')

ADMIN2_COUNTRIES = {path.basename(filename).split('.')[0].split('-')[1]
for filename in glob(path.join(GEOJSON_DIR, 'admin2-*.json'))}
NUL = {} # nonmapped (invalid) output region


if is_shapely_speedups_available():
shapely.speedups.enable()
log.debug('Shapely speed-ups available')


def wait_until_loaded(func):
@wraps(func)
def wrapper(*args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def compile_to_multilingual(self):
'scikit-learn',
'pandas',
'scipy>=0.17',
'shapely',
'shapely>=2',
'pyproj',
'simplejson',
'Pillow'
Expand Down

0 comments on commit fa5efaf

Please sign in to comment.