summaryrefslogtreecommitdiff
path: root/chimere/route.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/route.py')
-rw-r--r--chimere/route.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/chimere/route.py b/chimere/route.py
index 040a7be..eaa762a 100644
--- a/chimere/route.py
+++ b/chimere/route.py
@@ -26,6 +26,7 @@ import os, re, shutil, tempfile
from BeautifulSoup import BeautifulSoup
from subprocess import Popen, PIPE
from django.contrib.gis.gdal import DataSource
+from django.contrib.gis.gdal.error import OGRException
from django.conf import settings
@@ -71,7 +72,10 @@ class RoutinoRouter(Router):
tmp_dir = tempfile.mkdtemp(prefix='chimere_') + os.sep
p = Popen(args, stdout=PIPE, cwd=tmp_dir)
p.communicate()
- ds = DataSource(tmp_dir + 'shortest-track.gpx')
+ try:
+ ds = DataSource(tmp_dir + 'shortest-track.gpx')
+ except OGRException:
+ return [], None, None
if not ds:
return [], None, None
layer = ds[0]