Skip to content

Commit

Permalink
Merge pull request #99 from klokantech/8.7.5
Browse files Browse the repository at this point in the history
8.7.5
  • Loading branch information
klokan committed Dec 4, 2015
2 parents fff837b + 9c5bcaa commit e51dc83
Show file tree
Hide file tree
Showing 21 changed files with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# encoding: utf-8
"""
"""
VERSION = "8.7"
VERSION = "8.7.5"
INDEX = "./index"
DATABASE = "./gml/gml.sqlite"

Expand Down Expand Up @@ -341,9 +341,10 @@ def index():
wkt = ""
url_map = ""
if r['kind'].startswith("CRS"):
ref.ImportFromEPSG(int(short_code[0]))
ref_code = ref.ImportFromEPSG(int(short_code[0]))
wkt = ref.ExportToWkt()
if wkt and r['bbox']:
# e.g. epsg::5225 has wkt with towgs84 but not function in /map and raise error in OGR => ref_code = 0 (withnout error)
if r['bbox'] and ref_code == 0:
# a = ref.ImportFromWkt(r['wkt'])
# if a == 0:
url_map = "/" + r['code']+ "/map"
Expand Down Expand Up @@ -1179,7 +1180,7 @@ def index(id, format):
for b in bbox:
mbbox.append(b)

ref.ImportFromEPSG(int(rcode))
ref_code = ref.ImportFromEPSG(int(rcode))
wkt = ref.ExportToWkt()

type_epsg = "EPSG"
Expand Down Expand Up @@ -1233,7 +1234,8 @@ def index(id, format):
wkt = ref.ExportToWkt().decode('utf-8')

# One of the formats is a map (because /coordinates/ was redirect on /coordinates and then catch by <format>)
if format == "/map":
# epsg::5225 has wkt with towgs84 but not function in map and raise error in OGR => ref_code = 0 (withnout error)
if format == "/map" and ref_code == 0:
if bbox:
n, w, s, e = bbox
center = (n-s)/2.0 + s, (e-w)/2.0 + w
Expand All @@ -1242,6 +1244,10 @@ def index(id, format):
else:
center = 0,0
return template ('./templates/map', name=rname, code=rcode, url_coords=url_coords, center=center, bbox=mbbox)
else:
error = 404
try_url= ""
return template('./templates/error', error=error, try_url=try_url, version=VERSION)

ref.ImportFromWkt(wkt)
ct = "text/plain"
Expand Down
Binary file modified gml/gml.sqlite
Binary file not shown.
Binary file not shown.
Binary file added index/MAIN_2y5hqutv7giqi84o.seg
Binary file not shown.
Binary file not shown.
Binary file added index/MAIN_4s33s5o8onqbo7g8.seg
Binary file not shown.
Binary file not shown.
Binary file added index/MAIN_aazw9ov66tc4s44k.seg
Binary file not shown.
Binary file added index/MAIN_dygqpmojwqamo6w2.seg
Binary file not shown.
Binary file not shown.
Binary file removed index/MAIN_gv945volpm0zwg02.seg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added index/MAIN_pphfucijbuom6odq.seg
Binary file not shown.
Binary file added index/MAIN_quasckkurj8qpmhj.seg
Binary file not shown.
Binary file not shown.
Binary file removed index/MAIN_s6ro1w5a5fnny1er.seg
Binary file not shown.
Binary file removed index/MAIN_sfhlli0yqwbz3m5h.seg
Binary file not shown.
Binary file removed index/MAIN_z6eody7wz7njdc2c.seg
Binary file not shown.
Binary file not shown.
Binary file renamed index/_MAIN_15155.toc → index/_MAIN_15598.toc
Binary file not shown.

0 comments on commit e51dc83

Please sign in to comment.