Skip to content

Commit

Permalink
Fix template issues arising from missing EPSG data
Browse files Browse the repository at this point in the history
The EPSG realisation epoch and the EPSG extents were always assumed to
be present but this is not always the case.
  • Loading branch information
Homme Zwaagstra committed Dec 4, 2014
1 parent 2afff83 commit 8fb2f89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions templates/full/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -176,20 +176,24 @@ <h3>Download</h3>
<%def name="format_areaofuse(epsg)">\
<h3>Area of Use</h3>
${format_epsg(epsg)}
% if None not in (epsg.westBoundLongitude, epsg.southBoundLatitude, epsg.eastBoundLongitude, epsg.northBoundLatitude):
<div class="sibling">
Extent: <a href="${script_root}/full/catalogue?bbox=${epsg.westBoundLongitude},${epsg.southBoundLatitude},${epsg.eastBoundLongitude},${epsg.northBoundLatitude}"
title="Search for all metadata within this area">
${epsg.westBoundLongitude}&deg;, ${epsg.southBoundLatitude}&deg;,
${epsg.eastBoundLongitude}&deg;, ${epsg.northBoundLatitude}&deg;</a>
</div>
% endif
</%def>\

<%def name="format_datum(epsg)">\
<h3>Datum</h3>
${format_epsg(epsg)}
% if epsg.realizationEpoch is not None:
<div class="sibling">
Realisation epoch: ${format_date(epsg.realizationEpoch)}
</div>
% endif
% if hasattr(epsg, 'primeMeridian'):
${format_prime_meridian(epsg.primeMeridian)}
% endif
Expand Down
4 changes: 4 additions & 0 deletions templates/light/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,20 +146,24 @@
<%def name="format_areaofuse(epsg)">\
<h4>Area of Use</h4>
${format_epsg(epsg)}
% if None not in (epsg.westBoundLongitude, epsg.southBoundLatitude, epsg.eastBoundLongitude, epsg.northBoundLatitude):
<div>
Extent: <a href="${script_root}/light/catalogue?bbox=${epsg.westBoundLongitude},${epsg.southBoundLatitude},${epsg.eastBoundLongitude},${epsg.northBoundLatitude}"
title="Search for all metadata within this area">
${epsg.westBoundLongitude}°, ${epsg.southBoundLatitude}°,
${epsg.eastBoundLongitude}°, ${epsg.northBoundLatitude}°</a>
</div>
% endif
</%def>\

<%def name="format_datum(epsg)">\
<h4>Datum</h4>
${format_epsg(epsg)}
% if epsg.realizationEpoch is not None:
<div>
Realisation epoch: ${format_date(epsg.realizationEpoch)}
</div>
% endif
% if hasattr(epsg, 'primeMeridian'):
${format_prime_meridian(epsg.primeMeridian)}
% endif
Expand Down

0 comments on commit 8fb2f89

Please sign in to comment.