From 5d48821e0c89ec2baaa47a622df443ecfe90a428 Mon Sep 17 00:00:00 2001
From: anonymous <anonymous>
Date: Wed, 28 Nov 2018 16:44:33 +0100
Subject: [PATCH] fix multipolygon boundingbox

---
 ckanext/odsh/helpers.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ckanext/odsh/helpers.py b/ckanext/odsh/helpers.py
index 6c942b7b..94c0e0c1 100644
--- a/ckanext/odsh/helpers.py
+++ b/ckanext/odsh/helpers.py
@@ -71,6 +71,9 @@ def compute_bounding_box(coords):
         return None
 
     coords = [c for sublist in coords for c in sublist]
+    if type(coords[0][0]) == list:
+        ## multipolygon
+        coords = [c for sublist in coords for c in sublist]
 
     minx = min(coords, key = lambda t: t[0])[0]
     maxx = max(coords, key = lambda t: t[0])[0]
-- 
GitLab