diff --git a/app.py b/app.py index 9185197..84949d3 100755 --- a/app.py +++ b/app.py @@ -1187,6 +1187,10 @@ def crs_text(id, format): for r in code_result: rcode = r['code'] + # XXX One of the formats is a map (because /coordinates/ was redirect on /coordinates and then catch by ) + # make it sooner for quicker answer + if format == "map": + return redirect("/map#srs=" + rcode) rcode = r['code'] rname = r['name'].replace("ESRI: ","").strip() def_trans = r['code_trans'] @@ -1248,9 +1252,6 @@ def crs_text(id, format): ref.SetTOWGS84(*values) wkt = ref.ExportToWkt().decode('utf-8') - # XXX One of the formats is a map (because /coordinates/ was redirect on /coordinates and then catch by ) - if format == "/map": - return redirect("/map#srs=" + rcode); ref.ImportFromWkt(wkt) headers = { @@ -1312,7 +1313,8 @@ def crs_text(id, format): if request.args.get('download',1) == "": headers['Content-disposition'] = "attachment; filename=%s.gml" % rcode - elif format == 'map': + #mapfile in detail.html + elif format == 'mapfile': export = 'PROJECTION\n\t'+'\n\t'.join(['"'+l.lstrip('+')+'"' for l in ref.ExportToProj4().split()])+'\nEND' ### CSS: white-space: pre-wrap if request.args.get('download',1) == "": headers['Content-disposition'] = "attachment; filename=%s.map" % rcode diff --git a/templates/detail.html b/templates/detail.html index 29dd428..c8a3dae 100644 --- a/templates/detail.html +++ b/templates/detail.html @@ -276,7 +276,7 @@

Attributes

{% if 'datum' in item %} {% if item['datum'] != 0 and item['datum'] %} -

Datum: {{item['datum'][1]}}

+

Datum: {{item['datum'][1]}}

{% endif %} {% endif %}