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 2841 tektonische karte #4395

Merged
merged 4 commits into from
Jun 21, 2024
Merged
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
68 changes: 58 additions & 10 deletions chsdi/models/vector/stopo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1568,12 +1568,20 @@ class GeologieTektonischeKarteLine(Base, Vector):
__table_args__ = ({'schema': 'geol', 'autoload': False})
__template__ = 'templates/htmlpopup/tektonische_karte_line.mako'
__bodId__ = 'ch.swisstopo.geologie-tektonische_karte'
# Translatable labels in fr
__label__ = 'type_de'
__label__ = 'kind_de'
id = Column('fid', Integer, primary_key=True)
line_id = Column('line_id', Integer)
type_de = Column('type_de', Unicode)
type_fr = Column('type_fr', Unicode)
kind_de = Column('kind_de', Unicode)
kind_fr = Column('kind_fr', Unicode)
kind_it = Column('kind_it', Unicode)
kind_en = Column('kind_en', Unicode)
name_de = Column('name_de', Unicode)
name_fr = Column('name_fr', Unicode)
name_it = Column('name_it', Unicode)
name_en = Column('name_en', Unicode)
status_de = Column('status_de', Unicode)
status_fr = Column('status_fr', Unicode)
status_it = Column('status_it', Unicode)
status_en = Column('status_en', Unicode)
the_geom = Column(Geometry2D)


Expand All @@ -1582,16 +1590,56 @@ class GeologieTektonischeKartePoly(Base, Vector):
__table_args__ = ({'schema': 'geol', 'autoload': False})
__template__ = 'templates/htmlpopup/tektonische_karte_poly.mako'
__bodId__ = 'ch.swisstopo.geologie-tektonische_karte'
# Translatable labels in fr
__label__ = 'type_de'
__label__ = 'litho_de'
id = Column('fid', Integer, primary_key=True)
t2_id = Column('t2_id', Integer)
type_de = Column('type_de', Unicode)
type_fr = Column('type_fr', Unicode)
litho_de = Column('litho_de', Unicode)
litho_fr = Column('litho_fr', Unicode)
litho_it = Column('litho_it', Unicode)
litho_en = Column('litho_en', Unicode)
the_geom = Column(Geometry2D)


class GeologieTektonischeKarteUnit(Base, Vector):
__tablename__ = 'tektonische_karte_units'
__table_args__ = ({'schema': 'geol', 'autoload': False})
__template__ = 'templates/htmlpopup/tektonische_karte_unit.mako'
__bodId__ = 'ch.swisstopo.geologie-tektonische_karte'
__label__ = 'litho_de'
id = Column('bgdi_id', Integer, primary_key=True)
tecto_1_de = Column('tecto_1_de', Unicode)
tecto_1_fr = Column('tecto_1_fr', Unicode)
tecto_1_it = Column('tecto_1_it', Unicode)
tecto_1_en = Column('tecto_1_en', Unicode)
tecto_2_de = Column('tecto_2_de', Unicode)
tecto_2_fr = Column('tecto_2_fr', Unicode)
tecto_2_it = Column('tecto_2_it', Unicode)
tecto_2_en = Column('tecto_2_en', Unicode)
tecto_3_de = Column('tecto_3_de', Unicode)
tecto_3_fr = Column('tecto_3_fr', Unicode)
tecto_3_it = Column('tecto_3_it', Unicode)
tecto_3_en = Column('tecto_3_en', Unicode)
tecto_4_de = Column('tecto_4_de', Unicode)
tecto_4_fr = Column('tecto_4_fr', Unicode)
tecto_4_it = Column('tecto_4_it', Unicode)
tecto_4_en = Column('tecto_4_en', Unicode)
litho_de = Column('litho_de', Unicode)
litho_fr = Column('litho_fr', Unicode)
litho_it = Column('litho_it', Unicode)
litho_en = Column('litho_en', Unicode)
origin_de = Column('origin_de', Unicode)
origin_fr = Column('origin_fr', Unicode)
origin_it = Column('origin_it', Unicode)
origin_en = Column('origin_en', Unicode)
notice = Column('notice', Unicode)
legende_de = Column('legende_de', Unicode)
legende_fr = Column('legende_fr', Unicode)
legende_it = Column('legende_it', Unicode)
legende_en = Column('legende_en', Unicode)
the_geom = Column(Geometry2D)

register('ch.swisstopo.geologie-tektonische_karte', GeologieTektonischeKarteLine)
register('ch.swisstopo.geologie-tektonische_karte', GeologieTektonischeKartePoly)
register('ch.swisstopo.geologie-tektonische_karte', GeologieTektonischeKarteUnit)


class GeologieEiszeitLgm(Base, Vector):
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
24 changes: 18 additions & 6 deletions chsdi/templates/htmlpopup/tektonische_karte_line.mako
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
<%inherit file="base.mako"/>

<%def name="table_body(c,lang)">
<tr><td class="cell-left" valign="top">${_('geol_f')}</td><td>${c['attributes']['line_id'] or '-'}</td></tr>
% if lang == 'de' or lang == 'rm' or lang == 'en':
<tr><td class="cell-left">${_('id_objekt')}</td><td>${c['attributes']['type_de'] or '-'}</td></tr>
% elif lang == 'fr' or lang == 'it':
<tr><td class="cell-left">${_('id_objekt')}</td><td>${c['attributes']['type_fr'] or '-'}</td></tr>
% endif
<%
lang = lang if lang in ('de', 'fr', 'it', 'en') else 'de'
kind = 'kind_%s' % lang
name = 'name_%s' % lang
status = 'status_%s' % lang
%>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Kind')}</td>
<td>${c['attributes'][kind] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Name')}</td>
<td>${c['attributes'][name] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Status')}</td>
<td>${c['attributes'][status] or '-'}</td>
</tr>
</%def>
14 changes: 8 additions & 6 deletions chsdi/templates/htmlpopup/tektonische_karte_poly.mako
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
<%inherit file="base.mako"/>

<%def name="table_body(c,lang)">
<tr><td class="cell-left" valign="top">${_('geol_f')}</td><td>${c['attributes']['t2_id'] or '-'}</td></tr>
% if lang == 'de' or lang == 'rm' or lang == 'en':
<tr><td class="cell-left">${_('id_objekt')}</td><td>${c['attributes']['type_de'] or '-'}</td></tr>
% elif lang == 'fr' or lang == 'it':
<tr><td class="cell-left">${_('id_objekt')}</td><td>${c['attributes']['type_fr'] or '-'}</td></tr>
% endif
<%
lang = lang if lang in ('de', 'fr', 'it', 'en') else 'de'
litho = 'litho_%s' % lang
%>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Litho')}</td>
<td>${c['attributes'][litho] or '-'}</td>
</tr>
</%def>

57 changes: 57 additions & 0 deletions chsdi/templates/htmlpopup/tektonische_karte_unit.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<%inherit file="base.mako"/>

<%def name="table_body(c,lang)">
<%
lang = lang if lang in ('de', 'fr', 'it', 'en') else 'de'
tecto_1 = 'tecto_1_%s' % lang
tecto_2 = 'tecto_2_%s' % lang
tecto_3 = 'tecto_3_%s' % lang
tecto_4 = 'tecto_4_%s' % lang
origin = 'origin_%s' % lang
litho = 'litho_%s' % lang
chrono = 'chrono_%s' % lang
lith = 'lith_%s' % lang
legende = 'legende_%s' % lang
%>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Tecto_1')}</td>
<td>${c['attributes'][tecto_1] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Tecto_2')}</td>
<td>${c['attributes'][tecto_2] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Tecto_3')}</td>
<td>${c['attributes'][tecto_3] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Tecto_4')}</td>
<td>${c['attributes'][tecto_4] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Litho')}</td>
<td>${c['attributes'][litho] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Origin')}</td>
<td>${c['attributes'][origin] or '-'}</td>
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Notice')}</td>
% if 'http' not in c['attributes']['notice']:
<td>${c['attributes']['notice'] or '-'}</td>
% else:
<td><a target="_blank" href=${c['attributes']['notice']}>Link</a></td>
% endif
</tr>
<tr>
<td class="cell-left">${_('ch.swisstopo.geologie-tektonische_karte.Legende')}</td>
% if 'http' not in c['attributes'][legende]:
<td>${c['attributes'][legende] or '-'}</td>
% else:
<td><a target="_blank" href=${c['attributes'][legende]}>Link</a></td>
% endif
</tr>
</%def>

Loading