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

Feat bgdidic 1596 geologie rohstoffe #4284

Merged
merged 11 commits into from
Nov 16, 2023
87 changes: 46 additions & 41 deletions chsdi/models/vector/stopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,52 @@ class GeologieGeophysikTotalintensitaet(Base, Vector):
register('ch.swisstopo.geologie-geophysik-totalintensitaet', GeologieGeophysikTotalintensitaet)


class GeologieRohstoffe:
__table_args__ = ({'schema': 'geol', 'autoload': False})
id = Column('bgdi_id', Integer, primary_key=True)
type = Column('type', Unicode)
obname = Column('obname', Unicode)
cpkind = Column('cpkind', Unicode)
edkinds = Column('edkinds', Unicode)
purl = Column('purl', Unicode)
swissgeol_link = Column('swissgeol_link', Unicode)
stkind_de = Column('stkind_de', Unicode)
stkind_fr = Column('stkind_fr', Unicode)
stkind_it = Column('stkind_it', Unicode)
stkind_en = Column('stkind_en', Unicode)
ltkinds_de = Column('ltkinds_de', Unicode)
ltkinds_fr = Column('ltkinds_fr', Unicode)
ltkinds_it = Column('ltkinds_it', Unicode)
ltkinds_en = Column('ltkinds_en', Unicode)
infos_url_de = Column('infos_url_de', Unicode)
infos_url_fr = Column('infos_url_fr', Unicode)
infos_url_it = Column('infos_url_it', Unicode)
infos_url_en = Column('infos_url_en', Unicode)
the_geom = Column(Geometry2D)


class GeologieRohstoffeZementAbbauVerarbeitung(Base, GeologieRohstoffe, Vector):
__tablename__ = 'rohstoffe_zementabbauverarbeitung'
__template__ = 'templates/htmlpopup/rohstoffe_zement_abbau_verarbeitung.mako'
__bodId__ = 'ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung'
__label__ = 'obname'
info_url_de = Column('info_url_de', Unicode)
info_url_fr = Column('info_url_fr', Unicode)
info_url_it = Column('info_url_it', Unicode)
info_url_en = Column('info_url_en', Unicode)

register('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung', GeologieRohstoffeZementAbbauVerarbeitung)


class GeologieRohstoffeZiegelAbbau(Base, GeologieRohstoffe, Vector):
__tablename__ = 'rohstoffe_ziegel_abbau'
__bodId__ = 'ch.swisstopo.geologie-rohstoffe-ziegel_abbau'
__template__ = 'templates/htmlpopup/rohstoffe_ziegel_abbau.mako'
__label__ = 'obname'

register(GeologieRohstoffeZiegelAbbau.__bodId__, GeologieRohstoffeZiegelAbbau)


class GeologieRohstoffeIndustrieminerale(Base, Vector):
__tablename__ = 'rohstoffe_industriemin'
__table_args__ = ({'schema': 'geol', 'autoload': False})
Expand Down Expand Up @@ -1545,47 +1591,6 @@ class GeologieRohstoffeGipsAbbauVerarbeitung(Base, Vector):
register('ch.swisstopo.geologie-rohstoffe-gips_abbau_verarbeitung', GeologieRohstoffeGipsAbbauVerarbeitung)


class GeologieRohstoffeZementAbbauVerarbeitung(Base, Vector):
__tablename__ = 'rohstoffe_zementabbauverarbeitung'
__table_args__ = ({'schema': 'geol', 'autoload': False})
__template__ = 'templates/htmlpopup/rohstoffe_zement_abbau_verarbeitung.mako'
__bodId__ = 'ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung'
__label__ = 'obname'
id = Column('obid', Integer, primary_key=True)
obname = Column('obname', Unicode)
tckinds = Column('tckinds', Unicode)
ltkinds = Column('ltkinds', Unicode)
emkinds = Column('emkinds', Unicode)
pckind = Column('pckind', Unicode)
cpkind = Column('cpkind', Unicode)
stkind = Column('stkind', Unicode)
tlyearsformatted = Column('tlyearsformatted', Unicode)
clkind = Column('clkind', Unicode)
purl = Column('purl', Unicode)
the_geom = Column(Geometry2D)

register('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung', GeologieRohstoffeZementAbbauVerarbeitung)


class GeologieRohstoffeZiegelAbbau(Base, Vector):
__tablename__ = 'rohstoffe_ziegel_abbau'
__table_args__ = ({'schema': 'geol', 'autoload': False})
__bodId__ = 'ch.swisstopo.geologie-rohstoffe-ziegel_abbau'
__template__ = 'templates/htmlpopup/rohstoffe_ziegel_abbau.mako'
__label__ = 'obname'
id = Column('bgdi_id', Integer, primary_key=True)
obname = Column('obname', Unicode)
tckinds = Column('tckinds', Unicode)
ltkinds = Column('ltkinds', Unicode)
stkind = Column('stkind', Unicode)
tlyearsformatted = Column('tlyearsformatted', Unicode)
purl = Column('purl', Unicode)
clkind = Column('clkind', Unicode)
the_geom = Column(Geometry2D)

register(GeologieRohstoffeZiegelAbbau.__bodId__, GeologieRohstoffeZiegelAbbau)


class GeologieRohstoffeZiegelVerarbeitung(Base, Vector):
__tablename__ = 'rohstoffe_ziegel_verarbeitung'
__table_args__ = ({'schema': 'geol', 'autoload': False})
Expand Down
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.
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.
107 changes: 88 additions & 19 deletions chsdi/templates/htmlpopup/rohstoffe_zement_abbau_verarbeitung.mako
Original file line number Diff line number Diff line change
@@ -1,23 +1,92 @@
<%inherit file="base.mako"/>

<%def name="table_body(c,lang)">
<% c['stable_id'] = True %>
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.obname')}</td><td>${c['attributes']['obname'] or '-'}</td></tr>
%if c['attributes']['ltkinds']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.tckinds')}</td><td>${c['attributes']['tckinds'] or '-'}</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.ltkinds')}</td><td>${c['attributes']['ltkinds'] or '-'}</td></tr>
%endif
%if c['attributes']['emkinds']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.emkinds')}</td><td>${c['attributes']['emkinds'] or '-'}</td></tr>
%endif
%if c['attributes']['pckind']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.pckind')}</td><td>${c['attributes']['pckind'] or '-'}</td></tr>
%endif
%if c['attributes']['cpkind']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.cpkind')}</td><td>${c['attributes']['cpkind'] or '-'}</td></tr>
<%def name="table_body(c, lang)">
<%
lang = lang if lang in ('fr','it', 'en') else 'de'
stkind_text = 'stkind_%s' %lang
info_url_text = 'info_url_%s' %lang
ltkinds_text = 'ltkinds_%s' %lang
infos_url_text = 'infos_url_%s' %lang
%>

%if c['attributes']['type'] == 'production':
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.production_obname')}</td>
<td>${c['attributes']['obname'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.production_cpkind')}</td>
<td>${c['attributes']['cpkind'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.production_stkind')}</td>
<td>${c['attributes'][stkind_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.production_info_url')}</td>
% if 'http' not in c['attributes'][info_url_text]:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes'][info_url_text]}>${_('link')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.production_purl')}</td>
% if 'http' not in c['attributes']['purl']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['purl']}>${_('layer_url_portal_text')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.production_swissgeol_link')}</td>
% if 'http' not in c['attributes']['swissgeol_link']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['swissgeol_link']}>${_('link')}</a></td>
% endif
</tr>
% else:
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.mining_edkinds')}</td>
<td>${c['attributes']['edkinds'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.mining_cpkind')}</td>
<td>${c['attributes']['cpkind'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.mining_stkind')}</td>
<td>${c['attributes'][stkind_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.mining_ltkinds')}</td>
<td>${c['attributes'][ltkinds_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.mining_infos_url')}</td>
% if 'http' not in c['attributes'][infos_url_text]:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes'][infos_url_text]}>${_('link')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.mining_purl')}</td>
% if 'http' not in c['attributes']['purl']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['purl']}>${_('layer_url_portal_text')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.mining_swissgeol_link')}</td>
% if 'http' not in c['attributes']['swissgeol_link']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['swissgeol_link']}>${_('link')}</a></td>
% endif
</tr>
%endif
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.stkind')}</td><td>${c['attributes']['stkind'] or '-'}</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.tlyearsformatted')}</td><td>${c['attributes']['tlyearsformatted'] or '-'}</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.clkind')}</td><td>${c['attributes']['clkind'] or '-'}</td></tr>
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-zement_abbau_verarbeitung.purl')}</td><td><a target="_blank" href=${c['attributes']['purl'] or '-'}>${_('layer_url_portal_text')}</a></td></tr>

</%def>
105 changes: 85 additions & 20 deletions chsdi/templates/htmlpopup/rohstoffe_ziegel_abbau.mako
Original file line number Diff line number Diff line change
@@ -1,26 +1,91 @@
<%inherit file="base.mako"/>

<%def name="table_body(c, lang)">
<%
lang = lang if lang in ('fr','it', 'en') else 'de'
stkind_text = 'stkind_%s' %lang
ltkinds_text = 'ltkinds_%s' %lang
infos_url_text = 'infos_url_%s' %lang
%>

%if c['attributes']['obname']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.obname')}</td><td>${c['attributes']['obname'] or '-'}</td></tr>
%endif
%if c['attributes']['tckinds']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.tckinds')}</td><td>${c['attributes']['tckinds']}</td></tr>
%endif
%if c['attributes']['ltkinds']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.ltkinds')}</td><td>${c['attributes']['ltkinds'] or '-'}</td></tr>
%endif
%if c['attributes']['stkind']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.stkind')}</td><td>${c['attributes']['stkind'] or '-'}</td></tr>
%endif
%if c['attributes']['tlyearsformatted']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.tlyearsformatted')}</td><td>${c['attributes']['tlyearsformatted'] or '-'}</td></tr>
%endif
%if c['attributes']['clkind']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.clkind')}</td><td>${c['attributes']['clkind'] or '-'}</td></tr>
%endif
%if c['attributes']['purl']:
<tr><td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.purl')}</td><td><a target="_blank" href=${c['attributes']['purl'] or '-'}>${_('layer_url_portal_text')}</a></td></tr>
%if c['attributes']['type'] == 'production':
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.production_obname')}</td>
<td>${c['attributes']['obname'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.production_cpkind')}</td>
<td>${c['attributes']['cpkind'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.production_stkind')}</td>
<td>${c['attributes'][stkind_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.production_infos_url')}</td>
% if 'http' not in c['attributes'][infos_url_text]:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes'][infos_url_text]}>${_('link')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.production_purl')}</td>
% if 'http' not in c['attributes']['purl']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['purl']}>${_('layer_url_portal_text')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.production_swissgeol_link')}</td>
% if 'http' not in c['attributes']['swissgeol_link']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['swissgeol_link']}>${_('link')}</a></td>
% endif
</tr>
% else:
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.mining_edkinds')}</td>
<td>${c['attributes']['edkinds'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.mining_cpkind')}</td>
<td>${c['attributes']['cpkind'] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.mining_stkind')}</td>
<td>${c['attributes'][stkind_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.mining_ltkinds')}</td>
<td>${c['attributes'][ltkinds_text] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.mining_infos_url')}</td>
% if 'http' not in c['attributes'][infos_url_text]:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes'][infos_url_text]}>${_('link')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.mining_purl')}</td>
% if 'http' not in c['attributes']['purl']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['purl']}>${_('layer_url_portal_text')}</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-rohstoffe-ziegel_abbau.mining_swissgeol_link')}</td>
% if 'http' not in c['attributes']['swissgeol_link']:
<td>-</td>
% else:
<td><a target="_blank" href=${c['attributes']['swissgeol_link']}>${_('link')}</a></td>
% endif
</tr>
%endif

</%def>
Loading