Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BGDIDIC-2867: add legends #4453

Draft
wants to merge 3 commits into
base: develop-2024-11-13
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions chsdi/models/vector/stopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -3227,3 +3227,62 @@ class HartsteinVorkommen(Base, Vector):
the_geom = Column(Geometry2D)

register(HartsteinVorkommen.__bodId__, HartsteinVorkommen)


class GeologieThermaleWaesser(Base, Vector):
__table_args__ = ({'schema': 'geol', 'autoload': False})
__tablename__ = 'thermale_waesser'
__bodId__ = 'ch.swisstopo.geologie-thermale_waesser'
__template__ = 'templates/htmlpopup/stopo_geologie_thermale_waesser.mako'
__extended_info__ = True
id = Column('primary_key', Integer, primary_key=True)
name = Column('name', Unicode)
sample_temp = Column('sample_temp', Unicode)
form_temp = Column('form_temp', Unicode)
discharge = Column('discharge', Unicode)
ph = Column('ph', Unicode)
ec = Column('ec', Unicode)
mineralisation_de = Column('mineralisation_de', Unicode)
mineralisation_fr = Column('mineralisation_fr', Unicode)
mineralisation_it = Column('mineralisation_it', Unicode)
mineralisation_en = Column('mineralisation_en', Unicode)
chem_type = Column('chem_type', Unicode)
use_de = Column('use_de', Unicode)
use_fr = Column('use_fr', Unicode)
use_it = Column('use_it', Unicode)
use_en = Column('use_en', Unicode)
date_measure = Column('date_measure', Unicode)
annot_de = Column('annot_de', Unicode)
annot_fr = Column('annot_fr', Unicode)
annot_it = Column('annot_it', Unicode)
annot_en = Column('annot_en', Unicode)
x_lv95 = Column('x_lv95', Integer)
y_lv95 = Column('y_lv95', Integer)
elevation = Column('elevation', Integer)
source1 = Column('source1', Unicode)
src_link = Column('src_link', Unicode)
download = Column('download', Unicode)
swissgeol = Column('swissgeol', Unicode)
assets_swissgeol = Column('assets_swissgeol', Unicode)
boreholes_swissgeol = Column('boreholes_swissgeol', Unicode)
catchwork_type_de = Column('catchwork_type_de', Unicode)
catchwork_type_fr = Column('catchwork_type_fr', Unicode)
catchwork_type_it = Column('catchwork_type_it', Unicode)
catchwork_type_en = Column('catchwork_type_en', Unicode)
rock_overlay = Column('rock_overlay', Unicode)
distance = Column('distance', Unicode)
ref_portal = Column('ref_portal', Unicode)
borehole_name = Column('borehole_name', Unicode)
sample_interval = Column('sample_interval', Unicode)
form_temp_depth = Column('form_temp_depth', Unicode)
hydrogeologic_unit_de = Column('hydrogeologic_unit_de', Unicode)
hydrogeologic_unit_fr = Column('hydrogeologic_unit_fr', Unicode)
hydrogeologic_unit_it = Column('hydrogeologic_unit_it', Unicode)
hydrogeologic_unit_en = Column('hydrogeologic_unit_en', Unicode)
category_de = Column('category_de', Unicode)
category_fr = Column('category_fr', Unicode)
category_it = Column('category_it', Unicode)
category_en = Column('category_en', Unicode)
the_geom = Column(Geometry2D)

register(GeologieThermaleWaesser.__bodId__, GeologieThermaleWaesser)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
183 changes: 183 additions & 0 deletions chsdi/templates/htmlpopup/stopo_geologie_thermale_waesser.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
<%inherit file="base.mako"/>

<%def name="table_body(c, lang)">
<%
lang = lang if lang in ('fr','it','en') else 'de'
category_text = 'category_%s' % lang
mineralisation_text = 'mineralisation_%s' % lang
use_text = 'use_%s' % lang

layer_id = c['layerBodId']
%>
<tr>
<td class="cell-left">${_(f'{layer_id}.category')}</td>
<td>${c['attributes'][category_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.name')}</td>
<td>${c['attributes']['name'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.sample_temp')}</td>
<td>${c['attributes']['sample_temp'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.form_temp')}</td>
<td>${c['attributes']['form_temp'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.discharge')}</td>
<td>${c['attributes']['discharge'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.ph')}</td>
<td>${c['attributes']['ph'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.mineralisation_')}</td>
<td>${c['attributes'][mineralisation_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.chem_type')}</td>
<td>${c['attributes']['chem_type'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.use')}</td>
<td>${c['attributes'][use_text] or '-'}</td>
</tr>
</%def>

<%def name="extended_info(c, lang)">
<%
lang = lang if lang in ('fr','it','en') else 'de'
category_text = 'category_%s' % lang
mineralisation_text = 'mineralisation_%s' % lang
use_text = 'use_%s' % lang
annot_text = 'annot_%s' % lang

layerid = c['layerBodId']
%>

<table class="table-with-border" cellpadding="5">
<tr>
<td class="cell-left">${_(f'{layer_id}.category')}</td>
<td>${c['attributes'][category_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.name')}</td>
<td>${c['attributes']['name'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.sample_temp')}</td>
<td>${c['attributes']['sample_temp'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.form_temp')}</td>
<td>${c['attributes']['form_temp'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.discharge')}</td>
<td>${c['attributes']['discharge'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.ph')}</td>
<td>${c['attributes']['ph'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.ec')}</td>
<td>${c['attributes']['ec'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.mineralisation_')}</td>
<td>${c['attributes'][mineralisation_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.chem_type')}</td>
<td>${c['attributes']['chem_type'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.use')}</td>
<td>${c['attributes'][use_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.date_measure')}</td>
<td>${c['attributes']['date_measure'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.annot')}</td>
<td>${c['attributes'][annot_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.x_lv95')}</td>
<td>${c['attributes']['x_lv95'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.y_lv95')}</td>
<td>${c['attributes']['y_lv95'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.elevation')}</td>
<td>${c['attributes']['elevation'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.source1')}</td>
<td>${c['attributes']['source1'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.src_link')}</td>
<td>${c['attributes']['src_link'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.download')}</td>
<td>${c['attributes']['download'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.swissgeol')}</td>
<td>${c['attributes']['swissgeol'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.assets_swissgeol')}</td>
<td>${c['attributes']['assets_swissgeol'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.boreholes_swissgeol')}</td>
<td>${c['attributes']['boreholes_swissgeol'] or '-'}</td>
</tr>
%if c['attributes']['category_de'] == 'Quelle':
<tr>
<td class="cell-left">${_(f'{layer_id}.catchwork_type')}</td>
<td>${c['attributes']['catchwork_type_de'] or '-'}</td>
</tr>
%else if c['attributes']['category_de'] == 'Tunnel':
<tr>
<td class="cell-left">${_(f'{layer_id}.rock_overlay')}</td>
<td>${c['attributes']['rock_overlay'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.distance')}</td>
<td>${c['attributes']['distance'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.ref_portal')}</td>
<td>${c['attributes']['ref_portal'] or '-'}</td>
</tr>
%else if c['attributes']['category_de'] == 'Borehole':
<tr>
<td class="cell-left">${_(f'{layer_id}.borehole_name')}</td>
<td>${c['attributes']['borehole_name'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.sample_interval')}</td>
<td>${c['attributes']['sample_interval'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.form_temp_depth')}</td>
<td>${c['attributes']['form_temp_depth'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_(f'{layer_id}.hydrogeologic_unit')}</td>
<td>${c['attributes']['hydrogeologic_unit_de'] or '-'}</td>
</tr>
%endif
</table>
</%def>