mirror of
https://github.com/ARUP-CAS/aiscr-qgis-amcr-viewer.git
synced 2026-10-15 07:07:38 +02:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ab3ace310 | ||
|
|
27a0f4e9ea | ||
|
|
f4ad402f52 |
No files matched your search
@@ -225,7 +225,7 @@ class AmcrFilterDialog(QDialog):
|
|||||||
|
|
||||||
# Filters valid for Akce
|
# Filters valid for Akce
|
||||||
|
|
||||||
if self.typ_dat in ["pas", "akce"]:
|
if self.typ_dat in ["samostatny_nalez", "akce"]:
|
||||||
self.picker_org = self.setup_picker(
|
self.picker_org = self.setup_picker(
|
||||||
"Organizace",
|
"Organizace",
|
||||||
'organizace',
|
'organizace',
|
||||||
@@ -286,7 +286,7 @@ class AmcrFilterDialog(QDialog):
|
|||||||
self.picker_obdobi = self.setup_picker("Období", 'obdobi', OBDOBI)
|
self.picker_obdobi = self.setup_picker("Období", 'obdobi', OBDOBI)
|
||||||
layout.addWidget(self.picker_obdobi)
|
layout.addWidget(self.picker_obdobi)
|
||||||
|
|
||||||
if self.typ_dat == "pas":
|
if self.typ_dat == "samostatny_nalez":
|
||||||
self.picker_nalez_kategorie = self.setup_picker(
|
self.picker_nalez_kategorie = self.setup_picker(
|
||||||
"Kategorie nálezu",
|
"Kategorie nálezu",
|
||||||
'nalez_kategorie',
|
'nalez_kategorie',
|
||||||
@@ -322,7 +322,7 @@ class AmcrFilterDialog(QDialog):
|
|||||||
)
|
)
|
||||||
layout.addWidget(self.picker_nalezce)
|
layout.addWidget(self.picker_nalezce)
|
||||||
|
|
||||||
if self.typ_dat != "pas":
|
if self.typ_dat != "samostatny_nalez":
|
||||||
self.picker_areal = self.setup_picker("Areál", 'areal', AREAL)
|
self.picker_areal = self.setup_picker("Areál", 'areal', AREAL)
|
||||||
layout.addWidget(self.picker_areal)
|
layout.addWidget(self.picker_areal)
|
||||||
|
|
||||||
@@ -344,7 +344,7 @@ class AmcrFilterDialog(QDialog):
|
|||||||
self.lbl_komponenty_warning.setVisible(False)
|
self.lbl_komponenty_warning.setVisible(False)
|
||||||
layout.addWidget(self.lbl_komponenty_warning)
|
layout.addWidget(self.lbl_komponenty_warning)
|
||||||
|
|
||||||
if self.typ_dat != "pas":
|
if self.typ_dat != "samostatny_nalez":
|
||||||
self.chk_komponenty.toggled.connect(
|
self.chk_komponenty.toggled.connect(
|
||||||
self.lbl_komponenty_warning.setVisible
|
self.lbl_komponenty_warning.setVisible
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -26,6 +26,17 @@ LAST_LOGIN_ERROR: str | None = None
|
|||||||
# a second download while the first one is still running
|
# a second download while the first one is still running
|
||||||
_LOADING = False
|
_LOADING = False
|
||||||
|
|
||||||
|
archeologicky_zaznam_l = [
|
||||||
|
"akce",
|
||||||
|
"lokalita",
|
||||||
|
]
|
||||||
|
|
||||||
|
typ_dat_vocab = {
|
||||||
|
"akce": "Akce",
|
||||||
|
"lokalita": "Lokalita",
|
||||||
|
"samostatny_nalez": "PAS",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def _log(msg: str, level=Qgis.MessageLevel.Info):
|
def _log(msg: str, level=Qgis.MessageLevel.Info):
|
||||||
"""
|
"""
|
||||||
@@ -440,6 +451,7 @@ def load_amcr_data(canvas, bb, filters=None,
|
|||||||
return ", ".join([str(x) for x in val if x])
|
return ", ".join([str(x) for x in val if x])
|
||||||
|
|
||||||
# Process each downloaded metadata record
|
# Process each downloaded metadata record
|
||||||
|
if typ_dat in archeologicky_zaznam_l:
|
||||||
for doc in docs:
|
for doc in docs:
|
||||||
piani = doc.get('az_dj_pian', [])
|
piani = doc.get('az_dj_pian', [])
|
||||||
if not piani:
|
if not piani:
|
||||||
@@ -705,11 +717,23 @@ def load_amcr_data(canvas, bb, filters=None,
|
|||||||
"AMČR", Qgis.MessageLevel.Warning
|
"AMČR", Qgis.MessageLevel.Warning
|
||||||
)
|
)
|
||||||
|
|
||||||
|
elif typ_dat == "samostatny_nalez":
|
||||||
|
for doc in docs:
|
||||||
|
loc = g(doc, "loc", [])
|
||||||
|
if not loc:
|
||||||
|
continue
|
||||||
|
|
||||||
|
actions_with_geom += 1
|
||||||
|
|
||||||
|
sn_chranene = doc.get("samostatny_nalez_chranene_udaje") or {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# D) LAYER CREATION (QGIS Memory Layers)
|
# D) LAYER CREATION (QGIS Memory Layers)
|
||||||
# ==========================================
|
# ==========================================
|
||||||
|
|
||||||
archeologicky_zaznam = "Akce" if typ_dat == "akce" else "Lokalita"
|
archeologicky_zaznam = typ_dat_vocab[typ_dat]
|
||||||
|
|
||||||
# Initialize three layers for different geometry types (S-JTSK CRS)
|
# Initialize three layers for different geometry types (S-JTSK CRS)
|
||||||
vl_poly = QgsVectorLayer(
|
vl_poly = QgsVectorLayer(
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ class AmcrViewer:
|
|||||||
self.action_download_pas = self.add_action(
|
self.action_download_pas = self.add_action(
|
||||||
icon_path=icon_pas_path,
|
icon_path=icon_pas_path,
|
||||||
text=self.tr(u'Stáhnout data samostatných nálezů | AMČR Viewer'),
|
text=self.tr(u'Stáhnout data samostatných nálezů | AMČR Viewer'),
|
||||||
callback=lambda checked=False: self.run_download('pas'),
|
callback=lambda checked=False: self.run_download('samostatny_nalez'),
|
||||||
parent=self.iface.mainWindow(),
|
parent=self.iface.mainWindow(),
|
||||||
add_to_menu=False,
|
add_to_menu=False,
|
||||||
add_to_toolbar=False
|
add_to_toolbar=False
|
||||||
|
|||||||
Reference in new issue
Block a user