mirror of
https://github.com/ARUP-CAS/aiscr-qgis-amcr-viewer.git
synced 2026-10-15 07:07:38 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ab3ace310 | ||
|
|
27a0f4e9ea | ||
|
|
f4ad402f52 | ||
|
|
2fdbb15001 | ||
|
|
8248d1bcae | ||
|
|
abb06b9858 | ||
|
|
e84ee8e543 | ||
|
|
66532c108b | ||
|
|
86da8b9cf4 | ||
|
|
a95831f180 |
No files matched your search
+134
-82
@@ -9,24 +9,30 @@ from qgis.core import QgsMessageLog, Qgis
|
|||||||
# Define paths for the plugin and its codelists directory
|
# Define paths for the plugin and its codelists directory
|
||||||
PLUGIN_DIR = os.path.dirname(__file__)
|
PLUGIN_DIR = os.path.dirname(__file__)
|
||||||
CODELISTS_DIR = os.path.join(PLUGIN_DIR, 'codelists')
|
CODELISTS_DIR = os.path.join(PLUGIN_DIR, 'codelists')
|
||||||
BASE_URL = "https://api.aiscr.cz/2.2/oai"
|
BASE_URL_AMCR = "https://api.aiscr.cz/2.2/oai"
|
||||||
|
BASE_URL_DA = "https://digiarchiv.aiscr.cz/api/search/query"
|
||||||
OUTPUT_FILE = os.path.join(CODELISTS_DIR, 'heslar.csv')
|
OUTPUT_FILE = os.path.join(CODELISTS_DIR, 'heslar.csv')
|
||||||
|
|
||||||
slovnicek = {
|
slovnicek = {
|
||||||
'obdobi': 'heslo:obdobi',
|
'obdobi': (BASE_URL_AMCR, 'heslo:obdobi'),
|
||||||
'typ_akce': 'heslo:akce_typ',
|
'typ_akce': (BASE_URL_AMCR, 'heslo:akce_typ'),
|
||||||
'areal': 'heslo:areal',
|
'areal': (BASE_URL_AMCR, 'heslo:areal'),
|
||||||
'kraj': 'ruian_kraj',
|
'kraj': (BASE_URL_AMCR, 'ruian_kraj'),
|
||||||
'organizace': 'organizace',
|
'organizace': (BASE_URL_AMCR, 'organizace'),
|
||||||
'okres': 'ruian_okres',
|
'okres': (BASE_URL_AMCR, 'ruian_okres'),
|
||||||
'katastr': 'ruian_katastr',
|
'katastr': (BASE_URL_AMCR, 'ruian_katastr'),
|
||||||
'vedouci': 'osoba',
|
'pian_presnost': (BASE_URL_AMCR, 'heslo:pian_presnost'),
|
||||||
'pian_presnost': 'heslo:pian_presnost',
|
'typ_lokality': (BASE_URL_AMCR, 'heslo:lokalita_typ'),
|
||||||
'typ_lokality': 'heslo:lokalita_typ',
|
'druh_lokality': (BASE_URL_AMCR, 'heslo:lokalita_druh'),
|
||||||
'druh_lokality': 'heslo:lokalita_druh',
|
'jistota': (BASE_URL_AMCR, 'heslo:jistota_urceni'),
|
||||||
'jistota': 'heslo:jistota_urceni',
|
'lokalita_zachovalost': (BASE_URL_AMCR, 'heslo:stav_dochovani'),
|
||||||
'lokalita_zachovalost': 'heslo:stav_dochovani',
|
'pristupnost': (BASE_URL_AMCR, 'heslo:pristupnost'),
|
||||||
'pristupnost': 'heslo:pristupnost'
|
'nalez_kategorie': (BASE_URL_AMCR, 'heslo:predmet_druh_kat'),
|
||||||
|
'druh_nalezu': (BASE_URL_AMCR, 'heslo:predmet_druh'),
|
||||||
|
'specifikace': (BASE_URL_AMCR, 'heslo:predmet_specifikace'),
|
||||||
|
'nalezove_okolnosti': (BASE_URL_AMCR, 'heslo:nalezove_okolnosti'),
|
||||||
|
'vedouci': (BASE_URL_DA, 'f_vedouci'),
|
||||||
|
'nalezce': (BASE_URL_DA, 'f_nalezce'),
|
||||||
}
|
}
|
||||||
|
|
||||||
NS = {
|
NS = {
|
||||||
@@ -97,13 +103,19 @@ def load_all_data():
|
|||||||
return categorized_data
|
return categorized_data
|
||||||
|
|
||||||
|
|
||||||
def fetch_set(internal_name, api_set, task=None):
|
def fetch_set(base_url, internal_name, api_set, task=None):
|
||||||
dataset = []
|
dataset = []
|
||||||
params = {
|
params_amcr = {
|
||||||
"verb": "ListRecords",
|
"verb": "ListRecords",
|
||||||
"metadataPrefix": "oai_dc",
|
"metadataPrefix": "oai_dc",
|
||||||
"set": api_set
|
"set": api_set
|
||||||
}
|
}
|
||||||
|
params_da = {
|
||||||
|
"entity": "samostatny_nalez" if internal_name == "nalezce" else "akce",
|
||||||
|
"rows": 0,
|
||||||
|
"noFacets": "false",
|
||||||
|
"onlyFacets": "true"
|
||||||
|
}
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
# Check for cancellation at each iteration
|
# Check for cancellation at each iteration
|
||||||
@@ -111,74 +123,94 @@ def fetch_set(internal_name, api_set, task=None):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(BASE_URL, params=params, timeout=30)
|
if "digiarchiv" not in base_url:
|
||||||
response.raise_for_status()
|
response = requests.get(base_url, params=params_amcr, timeout=30)
|
||||||
root = ET.fromstring(response.content) # nosec
|
response.raise_for_status()
|
||||||
|
root = ET.fromstring(response.content) # nosec
|
||||||
|
|
||||||
records = root.findall('.//oai:record', NS)
|
records = root.findall('.//oai:record', NS)
|
||||||
for rec in records:
|
for rec in records:
|
||||||
metadata = rec.find('.//oai_dc:dc', NS)
|
metadata = rec.find('.//oai_dc:dc', NS)
|
||||||
if metadata is not None:
|
if metadata is not None:
|
||||||
# Code (identifier)
|
# Code (identifier)
|
||||||
identifier_el = metadata.find('dc:identifier', NS)
|
identifier_el = metadata.find('dc:identifier', NS)
|
||||||
kod = (
|
kod = (
|
||||||
identifier_el.text
|
identifier_el.text
|
||||||
if identifier_el is not None
|
if identifier_el is not None
|
||||||
else ""
|
else ""
|
||||||
)
|
|
||||||
|
|
||||||
# Title – filter out system labels "AMČR - ..."
|
|
||||||
titles = metadata.findall('dc:title', NS)
|
|
||||||
nazev = ""
|
|
||||||
for t in titles:
|
|
||||||
if (
|
|
||||||
t.text
|
|
||||||
and not t.text.startswith("AMČR -")
|
|
||||||
and not t.text.startswith(" AMČR -")
|
|
||||||
):
|
|
||||||
nazev = t.text
|
|
||||||
break
|
|
||||||
# If no title passed the filter, fall back
|
|
||||||
# to the first available one
|
|
||||||
if not nazev and titles:
|
|
||||||
nazev = titles[0].text
|
|
||||||
|
|
||||||
specialni_pripady = ['okres', 'katastr']
|
|
||||||
|
|
||||||
if internal_name in specialni_pripady:
|
|
||||||
kod = nazev
|
|
||||||
|
|
||||||
if internal_name == 'pristupnost':
|
|
||||||
kod = next(
|
|
||||||
(
|
|
||||||
t.text for t in titles
|
|
||||||
if t.text
|
|
||||||
and len(t.text) == 1
|
|
||||||
and t.text.isalpha()
|
|
||||||
),
|
|
||||||
None
|
|
||||||
)
|
)
|
||||||
# Skip records without a valid one-letter code –
|
|
||||||
# a None code would end up in the CSV and later
|
# Title – filter out system labels "AMČR - ..."
|
||||||
# in the API filter as the string "None"
|
titles = metadata.findall('dc:title', NS)
|
||||||
if not kod:
|
nazev = ""
|
||||||
continue
|
for t in titles:
|
||||||
|
if (
|
||||||
|
t.text
|
||||||
|
and not t.text.startswith("AMČR -")
|
||||||
|
and not t.text.startswith(" AMČR -")
|
||||||
|
):
|
||||||
|
nazev = t.text
|
||||||
|
break
|
||||||
|
# If no title passed the filter, fall back
|
||||||
|
# to the first available one
|
||||||
|
if not nazev and titles:
|
||||||
|
nazev = titles[0].text
|
||||||
|
|
||||||
|
specialni_pripady = ['okres', 'katastr']
|
||||||
|
|
||||||
|
if internal_name in specialni_pripady:
|
||||||
|
kod = nazev
|
||||||
|
|
||||||
|
if internal_name == 'pristupnost':
|
||||||
|
kod = next(
|
||||||
|
(
|
||||||
|
t.text for t in titles
|
||||||
|
if t.text
|
||||||
|
and len(t.text) == 1
|
||||||
|
and t.text.isalpha()
|
||||||
|
),
|
||||||
|
None
|
||||||
|
)
|
||||||
|
# Skip records without a valid one-letter code –
|
||||||
|
# a None code would end up in the CSV and later
|
||||||
|
# in the API filter as the string "None"
|
||||||
|
if not kod:
|
||||||
|
continue
|
||||||
|
|
||||||
|
dataset.append({
|
||||||
|
'Název': nazev,
|
||||||
|
'Kód': kod,
|
||||||
|
'Kategorie': internal_name
|
||||||
|
})
|
||||||
|
|
||||||
|
# Pagination
|
||||||
|
token = root.find('.//oai:resumptionToken', NS)
|
||||||
|
if token is not None and token.text:
|
||||||
|
params_amcr = {
|
||||||
|
"verb": "ListRecords",
|
||||||
|
"resumptionToken": token.text
|
||||||
|
}
|
||||||
|
time.sleep(0.5)
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
|
else:
|
||||||
|
response = requests.get(base_url, params=params_da, timeout=30)
|
||||||
|
response.raise_for_status()
|
||||||
|
data_json = response.json()
|
||||||
|
|
||||||
|
records = data_json['facet_counts']['facet_fields'][api_set]
|
||||||
|
|
||||||
|
for r in records:
|
||||||
|
|
||||||
|
nazev = r["name"]
|
||||||
|
|
||||||
dataset.append({
|
dataset.append({
|
||||||
'Název': nazev,
|
'Název': nazev,
|
||||||
'Kód': kod,
|
'Kód': nazev,
|
||||||
'Kategorie': internal_name
|
'Kategorie': internal_name
|
||||||
})
|
})
|
||||||
|
|
||||||
# Pagination
|
|
||||||
token = root.find('.//oai:resumptionToken', NS)
|
|
||||||
if token is not None and token.text:
|
|
||||||
params = {
|
|
||||||
"verb": "ListRecords",
|
|
||||||
"resumptionToken": token.text
|
|
||||||
}
|
|
||||||
time.sleep(0.5)
|
|
||||||
else:
|
|
||||||
break
|
break
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -195,8 +227,13 @@ def download_heslare(task=None):
|
|||||||
ensure_codelists_dir()
|
ensure_codelists_dir()
|
||||||
all_data = []
|
all_data = []
|
||||||
total_sets = len(slovnicek)
|
total_sets = len(slovnicek)
|
||||||
|
# index, (interni, api_nazev)
|
||||||
|
for index, (key, value) in enumerate(slovnicek.items()):
|
||||||
|
|
||||||
|
base_url = value[0]
|
||||||
|
interni = key
|
||||||
|
api_nazev = value[1]
|
||||||
|
|
||||||
for index, (interni, api_nazev) in enumerate(slovnicek.items()):
|
|
||||||
# Check if the user cancelled the task via the QGIS taskbar
|
# Check if the user cancelled the task via the QGIS taskbar
|
||||||
if task and task.isCanceled():
|
if task and task.isCanceled():
|
||||||
return False
|
return False
|
||||||
@@ -206,7 +243,7 @@ def download_heslare(task=None):
|
|||||||
"AMČR", Qgis.Info)
|
"AMČR", Qgis.Info)
|
||||||
|
|
||||||
# Pass the task correctly to the updated fetch function
|
# Pass the task correctly to the updated fetch function
|
||||||
data = fetch_set(interni, api_nazev, task=task)
|
data = fetch_set(base_url, interni, api_nazev, task=task)
|
||||||
|
|
||||||
if data is None:
|
if data is None:
|
||||||
return False # Cancelled mid-download
|
return False # Cancelled mid-download
|
||||||
@@ -260,6 +297,16 @@ def refresh_globals():
|
|||||||
LOKALITA_ZACHOVALOST.update(data.get('lokalita_zachovalost', {}))
|
LOKALITA_ZACHOVALOST.update(data.get('lokalita_zachovalost', {}))
|
||||||
PRISTUPNOST.clear()
|
PRISTUPNOST.clear()
|
||||||
PRISTUPNOST.update(data.get('pristupnost', {}))
|
PRISTUPNOST.update(data.get('pristupnost', {}))
|
||||||
|
NALEZ_KATEGORIE.clear()
|
||||||
|
NALEZ_KATEGORIE.update(data.get('nalez_kategorie', {}))
|
||||||
|
DRUH_NALEZU.clear()
|
||||||
|
DRUH_NALEZU.update(data.get('druh_nalezu', {}))
|
||||||
|
SPECIFIKACE.clear()
|
||||||
|
SPECIFIKACE.update(data.get('specifikace', {}))
|
||||||
|
NALEZOVE_OKOLNOSTI.clear()
|
||||||
|
NALEZOVE_OKOLNOSTI.update(data.get('nalezove_okolnosti', {}))
|
||||||
|
NALEZCE.clear()
|
||||||
|
NALEZCE.update(data.get('nalezce', {}))
|
||||||
|
|
||||||
|
|
||||||
# Initialize empty dicts that will be populated immediately below
|
# Initialize empty dicts that will be populated immediately below
|
||||||
@@ -277,5 +324,10 @@ DRUH_LOKALITY = {}
|
|||||||
JISTOTA = {}
|
JISTOTA = {}
|
||||||
LOKALITA_ZACHOVALOST = {}
|
LOKALITA_ZACHOVALOST = {}
|
||||||
PRISTUPNOST = {}
|
PRISTUPNOST = {}
|
||||||
|
NALEZ_KATEGORIE = {}
|
||||||
|
DRUH_NALEZU = {}
|
||||||
|
SPECIFIKACE = {}
|
||||||
|
NALEZOVE_OKOLNOSTI = {}
|
||||||
|
NALEZCE = {}
|
||||||
|
|
||||||
refresh_globals()
|
refresh_globals()
|
||||||
+71
-24
@@ -12,6 +12,8 @@ from .amcr_codelists import (OBDOBI, TYP_AKCE, KRAJE, AREAL, ORGANIZACE,
|
|||||||
OKRESY, KATASTRY, VEDOUCI, PIAN_PRESNOST,
|
OKRESY, KATASTRY, VEDOUCI, PIAN_PRESNOST,
|
||||||
TYP_LOKALITY, DRUH_LOKALITY, JISTOTA,
|
TYP_LOKALITY, DRUH_LOKALITY, JISTOTA,
|
||||||
LOKALITA_ZACHOVALOST, PRISTUPNOST,
|
LOKALITA_ZACHOVALOST, PRISTUPNOST,
|
||||||
|
NALEZ_KATEGORIE, DRUH_NALEZU, SPECIFIKACE,
|
||||||
|
NALEZOVE_OKOLNOSTI, NALEZCE,
|
||||||
download_heslare, refresh_globals)
|
download_heslare, refresh_globals)
|
||||||
|
|
||||||
|
|
||||||
@@ -168,6 +170,11 @@ class AmcrFilterDialog(QDialog):
|
|||||||
'druh_lokality': [],
|
'druh_lokality': [],
|
||||||
'jistota': [],
|
'jistota': [],
|
||||||
'lokalita_zachovalost': [],
|
'lokalita_zachovalost': [],
|
||||||
|
'nalez_kategorie': [],
|
||||||
|
'druh_nalezu': [],
|
||||||
|
'specifikace': [],
|
||||||
|
'nalezove_okolnosti': [],
|
||||||
|
'nalezce': [],
|
||||||
}
|
}
|
||||||
|
|
||||||
layout = QVBoxLayout()
|
layout = QVBoxLayout()
|
||||||
@@ -218,7 +225,7 @@ class AmcrFilterDialog(QDialog):
|
|||||||
|
|
||||||
# Filters valid for Akce
|
# Filters valid for Akce
|
||||||
|
|
||||||
if self.typ_dat == "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',
|
||||||
@@ -226,6 +233,7 @@ class AmcrFilterDialog(QDialog):
|
|||||||
)
|
)
|
||||||
layout.addWidget(self.picker_org)
|
layout.addWidget(self.picker_org)
|
||||||
|
|
||||||
|
if self.typ_dat == "akce":
|
||||||
self.picker_vedouci = self.setup_picker(
|
self.picker_vedouci = self.setup_picker(
|
||||||
"Vedoucí výzkumu",
|
"Vedoucí výzkumu",
|
||||||
'vedouci',
|
'vedouci',
|
||||||
@@ -278,12 +286,49 @@ 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)
|
||||||
|
|
||||||
self.picker_areal = self.setup_picker("Areál", 'areal', AREAL)
|
if self.typ_dat == "samostatny_nalez":
|
||||||
layout.addWidget(self.picker_areal)
|
self.picker_nalez_kategorie = self.setup_picker(
|
||||||
|
"Kategorie nálezu",
|
||||||
|
'nalez_kategorie',
|
||||||
|
NALEZ_KATEGORIE
|
||||||
|
)
|
||||||
|
layout.addWidget(self.picker_nalez_kategorie)
|
||||||
|
|
||||||
# Option to download related components table
|
self.picker_druh_nalezu = self.setup_picker(
|
||||||
self.chk_komponenty = QCheckBox("Načíst komponenty")
|
"Druh nálezu",
|
||||||
layout.addWidget(self.chk_komponenty)
|
'druh_nalezu',
|
||||||
|
DRUH_NALEZU
|
||||||
|
)
|
||||||
|
layout.addWidget(self.picker_druh_nalezu)
|
||||||
|
|
||||||
|
self.picker_specifikace = self.setup_picker(
|
||||||
|
"Specifikace nálezu",
|
||||||
|
'specifikace',
|
||||||
|
SPECIFIKACE
|
||||||
|
)
|
||||||
|
layout.addWidget(self.picker_specifikace)
|
||||||
|
|
||||||
|
self.picker_nalezove_okolnosti = self.setup_picker(
|
||||||
|
"Okolnosti nálezu",
|
||||||
|
'nalezove_okolnosti',
|
||||||
|
NALEZOVE_OKOLNOSTI
|
||||||
|
)
|
||||||
|
layout.addWidget(self.picker_nalezove_okolnosti)
|
||||||
|
|
||||||
|
self.picker_nalezce = self.setup_picker(
|
||||||
|
"Nálezce",
|
||||||
|
'nalezce',
|
||||||
|
NALEZCE
|
||||||
|
)
|
||||||
|
layout.addWidget(self.picker_nalezce)
|
||||||
|
|
||||||
|
if self.typ_dat != "samostatny_nalez":
|
||||||
|
self.picker_areal = self.setup_picker("Areál", 'areal', AREAL)
|
||||||
|
layout.addWidget(self.picker_areal)
|
||||||
|
|
||||||
|
# Option to download related components table
|
||||||
|
self.chk_komponenty = QCheckBox("Načíst komponenty")
|
||||||
|
layout.addWidget(self.chk_komponenty)
|
||||||
|
|
||||||
# Warning label
|
# Warning label
|
||||||
self.lbl_komponenty_warning = QLabel(
|
self.lbl_komponenty_warning = QLabel(
|
||||||
@@ -299,9 +344,10 @@ 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)
|
||||||
|
|
||||||
self.chk_komponenty.toggled.connect(
|
if self.typ_dat != "samostatny_nalez":
|
||||||
self.lbl_komponenty_warning.setVisible
|
self.chk_komponenty.toggled.connect(
|
||||||
)
|
self.lbl_komponenty_warning.setVisible
|
||||||
|
)
|
||||||
|
|
||||||
# Pushes everything above to the top
|
# Pushes everything above to the top
|
||||||
layout.addStretch(1)
|
layout.addStretch(1)
|
||||||
@@ -470,22 +516,23 @@ class AmcrFilterDialog(QDialog):
|
|||||||
filters['posevidence'] = 'true'
|
filters['posevidence'] = 'true'
|
||||||
if self.chk_proj_akce.isChecked():
|
if self.chk_proj_akce.isChecked():
|
||||||
filters['proj_akce'] = 'true'
|
filters['proj_akce'] = 'true'
|
||||||
if self.selection_cache['organizace']:
|
|
||||||
filters['f_organizace'] = self.selection_cache['organizace']
|
|
||||||
if self.selection_cache['typ_akce']:
|
|
||||||
filters['f_typ_vyzkumu'] = self.selection_cache['typ_akce']
|
|
||||||
if self.selection_cache['vedouci']:
|
|
||||||
filters['f_vedouci'] = self.selection_cache['vedouci']
|
|
||||||
|
|
||||||
if self.typ_dat == "lokalita":
|
if self.selection_cache['typ_akce']:
|
||||||
if self.selection_cache['typ_lokality']:
|
filters['f_typ_vyzkumu'] = self.selection_cache['typ_akce']
|
||||||
filters['f_typ_lokality'] = self.selection_cache['typ_lokality']
|
if self.selection_cache['vedouci']:
|
||||||
if self.selection_cache['druh_lokality']:
|
filters['f_vedouci'] = self.selection_cache['vedouci']
|
||||||
filters['f_druh_lokality'] = self.selection_cache['druh_lokality']
|
|
||||||
if self.selection_cache['jistota']:
|
if self.selection_cache['organizace']:
|
||||||
filters['f_jistota'] = self.selection_cache['jistota']
|
filters['f_organizace'] = self.selection_cache['organizace']
|
||||||
if self.selection_cache['lokalita_zachovalost']:
|
|
||||||
filters['f_lokalita_zachovalost'] = self.selection_cache['lokalita_zachovalost']
|
if self.selection_cache['typ_lokality']:
|
||||||
|
filters['f_typ_lokality'] = self.selection_cache['typ_lokality']
|
||||||
|
if self.selection_cache['druh_lokality']:
|
||||||
|
filters['f_druh_lokality'] = self.selection_cache['druh_lokality']
|
||||||
|
if self.selection_cache['jistota']:
|
||||||
|
filters['f_jistota'] = self.selection_cache['jistota']
|
||||||
|
if self.selection_cache['lokalita_zachovalost']:
|
||||||
|
filters['f_lokalita_zachovalost'] = self.selection_cache['lokalita_zachovalost']
|
||||||
|
|
||||||
return filters
|
return filters
|
||||||
|
|
||||||
|
|||||||
+265
-241
@@ -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,276 +451,289 @@ 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
|
||||||
for doc in docs:
|
if typ_dat in archeologicky_zaznam_l:
|
||||||
piani = doc.get('az_dj_pian', [])
|
for doc in docs:
|
||||||
if not piani:
|
piani = doc.get('az_dj_pian', [])
|
||||||
continue
|
if not piani:
|
||||||
|
|
||||||
if only_projektove_akce and not doc.get("akce_projekt", False):
|
|
||||||
continue
|
|
||||||
|
|
||||||
actions_with_geom += 1
|
|
||||||
|
|
||||||
# Extract protected fields ('or {}' – key may hold None)
|
|
||||||
az_chranene = doc.get('az_chranene_udaje') or {}
|
|
||||||
chranene = (
|
|
||||||
doc.get('akce_chranene_udaje')
|
|
||||||
or doc.get('lokalita_chranene_udaje')
|
|
||||||
or {}
|
|
||||||
)
|
|
||||||
|
|
||||||
# Format additional cadastral areas from nested dicts
|
|
||||||
dalsi_kat = az_chranene.get('dalsi_katastr', [])
|
|
||||||
dalsi_kat_str = ""
|
|
||||||
if isinstance(dalsi_kat, list):
|
|
||||||
items = [
|
|
||||||
x.get('value', '') if isinstance(x, dict) else str(x)
|
|
||||||
for x in dalsi_kat
|
|
||||||
]
|
|
||||||
dalsi_kat_str = ", ".join([i for i in items if i])
|
|
||||||
|
|
||||||
lokalizace = chranene.get('lokalizace_okolnosti', "")
|
|
||||||
lokalita_nazev = chranene.get('nazev', "")
|
|
||||||
lokalita_popis = chranene.get('popis', "")
|
|
||||||
|
|
||||||
# Core metadata structure
|
|
||||||
meta = {
|
|
||||||
"ident_cely": doc.get('ident_cely', ''),
|
|
||||||
"az_okres": g(doc, 'az_okres'),
|
|
||||||
"katastr": g_list(doc, 'katastr'),
|
|
||||||
"dalsi_katastr": dalsi_kat_str,
|
|
||||||
"pristupnost": g(doc, 'pristupnost'),
|
|
||||||
"loc": g_list(doc, 'loc'),
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add entity-specific metadata
|
|
||||||
if typ_dat == "akce":
|
|
||||||
meta.update({
|
|
||||||
"akce_hlavni_vedouci": g(
|
|
||||||
doc,
|
|
||||||
'akce_hlavni_vedouci'
|
|
||||||
),
|
|
||||||
"akce_organizace": tr_code(g(
|
|
||||||
doc,
|
|
||||||
'akce_organizace'
|
|
||||||
)),
|
|
||||||
"akce_specifikace_data": tr_code(g(
|
|
||||||
doc,
|
|
||||||
'akce_specifikace_data'
|
|
||||||
)),
|
|
||||||
"akce_datum_zahajeni": g(
|
|
||||||
doc,
|
|
||||||
'akce_datum_zahajeni'
|
|
||||||
),
|
|
||||||
"akce_datum_ukonceni": g(
|
|
||||||
doc,
|
|
||||||
'akce_datum_ukonceni'
|
|
||||||
),
|
|
||||||
"akce_hlavni_typ": tr_code(g(
|
|
||||||
doc,
|
|
||||||
'akce_hlavni_typ'
|
|
||||||
)),
|
|
||||||
"akce_vedlejsi_typ": g_list(
|
|
||||||
doc,
|
|
||||||
'akce_vedlejsi_typ',
|
|
||||||
translate=True
|
|
||||||
),
|
|
||||||
"lokalizace_okolnosti": (
|
|
||||||
str(lokalizace)
|
|
||||||
if lokalizace
|
|
||||||
else ""
|
|
||||||
),
|
|
||||||
"akce_je_nz": (
|
|
||||||
"Ano"
|
|
||||||
if doc.get('akce_je_nz') is True
|
|
||||||
else "Ne"
|
|
||||||
),
|
|
||||||
"projekt": g(
|
|
||||||
doc,
|
|
||||||
'akce_projekt',
|
|
||||||
""
|
|
||||||
),
|
|
||||||
})
|
|
||||||
|
|
||||||
elif typ_dat == "lokalita":
|
|
||||||
meta.update({
|
|
||||||
"lokalita_nazev": lokalita_nazev,
|
|
||||||
"lokalita_popis": lokalita_popis,
|
|
||||||
"lokalita_zachovalost": tr_code(g(
|
|
||||||
doc,
|
|
||||||
'lokalita_zachovalost'
|
|
||||||
)),
|
|
||||||
"lokalita_druh": tr_code(g(
|
|
||||||
doc,
|
|
||||||
'lokalita_druh'
|
|
||||||
)),
|
|
||||||
"lokalita_typ": tr_code(g(
|
|
||||||
doc,
|
|
||||||
'lokalita_typ_lokality'
|
|
||||||
)),
|
|
||||||
})
|
|
||||||
|
|
||||||
# Documentation units (DJ) within the record
|
|
||||||
djs = doc.get('az_dokumentacni_jednotka', [])
|
|
||||||
|
|
||||||
for dj in djs:
|
|
||||||
# Skip negative evidence units if requested
|
|
||||||
if skip_negativni and dj.get('dj_negativni_jednotka') is True:
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
komps = dj.get('dj_komponenta', [])
|
if only_projektove_akce and not doc.get("akce_projekt", False):
|
||||||
|
continue
|
||||||
|
|
||||||
if filter_areal or filter_datace:
|
actions_with_geom += 1
|
||||||
if not komps:
|
|
||||||
continue
|
|
||||||
if not any(
|
|
||||||
komp_projde_filtrem(
|
|
||||||
komp, filter_areal,
|
|
||||||
filter_datace, filters
|
|
||||||
)
|
|
||||||
for komp in komps
|
|
||||||
):
|
|
||||||
continue
|
|
||||||
|
|
||||||
dj_id = dj.get('ident_cely')
|
# Extract protected fields ('or {}' – key may hold None)
|
||||||
dj_typ = dj.get('dj_typ')
|
az_chranene = doc.get('az_chranene_udaje') or {}
|
||||||
|
chranene = (
|
||||||
|
doc.get('akce_chranene_udaje')
|
||||||
|
or doc.get('lokalita_chranene_udaje')
|
||||||
|
or {}
|
||||||
|
)
|
||||||
|
|
||||||
# Merge shared metadata with documentation unit-specific fields
|
# Format additional cadastral areas from nested dicts
|
||||||
dj_meta = {
|
dalsi_kat = az_chranene.get('dalsi_katastr', [])
|
||||||
**meta,
|
dalsi_kat_str = ""
|
||||||
'dj_id': dj_id,
|
if isinstance(dalsi_kat, list):
|
||||||
'dj_typ_value': dj_typ.get('value') if dj_typ else "",
|
items = [
|
||||||
'dj_negativni': (
|
x.get('value', '') if isinstance(x, dict) else str(x)
|
||||||
"Negativní"
|
for x in dalsi_kat
|
||||||
if dj.get('dj_negativni_jednotka') is True
|
]
|
||||||
else "Pozitivní"
|
dalsi_kat_str = ", ".join([i for i in items if i])
|
||||||
)
|
|
||||||
|
lokalizace = chranene.get('lokalizace_okolnosti', "")
|
||||||
|
lokalita_nazev = chranene.get('nazev', "")
|
||||||
|
lokalita_popis = chranene.get('popis', "")
|
||||||
|
|
||||||
|
# Core metadata structure
|
||||||
|
meta = {
|
||||||
|
"ident_cely": doc.get('ident_cely', ''),
|
||||||
|
"az_okres": g(doc, 'az_okres'),
|
||||||
|
"katastr": g_list(doc, 'katastr'),
|
||||||
|
"dalsi_katastr": dalsi_kat_str,
|
||||||
|
"pristupnost": g(doc, 'pristupnost'),
|
||||||
|
"loc": g_list(doc, 'loc'),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Link Documentation Unit to Geometry (PIAN)
|
# Add entity-specific metadata
|
||||||
dj_pian = dj.get('dj_pian')
|
if typ_dat == "akce":
|
||||||
if dj_pian:
|
meta.update({
|
||||||
dj_pian_value = dj_pian.get('id')
|
"akce_hlavni_vedouci": g(
|
||||||
if dj_pian_value:
|
doc,
|
||||||
target_pian_ids.add(dj_pian_value)
|
'akce_hlavni_vedouci'
|
||||||
if dj_pian_value not in pian_lookup:
|
),
|
||||||
pian_lookup[dj_pian_value] = []
|
"akce_organizace": tr_code(g(
|
||||||
|
doc,
|
||||||
|
'akce_organizace'
|
||||||
|
)),
|
||||||
|
"akce_specifikace_data": tr_code(g(
|
||||||
|
doc,
|
||||||
|
'akce_specifikace_data'
|
||||||
|
)),
|
||||||
|
"akce_datum_zahajeni": g(
|
||||||
|
doc,
|
||||||
|
'akce_datum_zahajeni'
|
||||||
|
),
|
||||||
|
"akce_datum_ukonceni": g(
|
||||||
|
doc,
|
||||||
|
'akce_datum_ukonceni'
|
||||||
|
),
|
||||||
|
"akce_hlavni_typ": tr_code(g(
|
||||||
|
doc,
|
||||||
|
'akce_hlavni_typ'
|
||||||
|
)),
|
||||||
|
"akce_vedlejsi_typ": g_list(
|
||||||
|
doc,
|
||||||
|
'akce_vedlejsi_typ',
|
||||||
|
translate=True
|
||||||
|
),
|
||||||
|
"lokalizace_okolnosti": (
|
||||||
|
str(lokalizace)
|
||||||
|
if lokalizace
|
||||||
|
else ""
|
||||||
|
),
|
||||||
|
"akce_je_nz": (
|
||||||
|
"Ano"
|
||||||
|
if doc.get('akce_je_nz') is True
|
||||||
|
else "Ne"
|
||||||
|
),
|
||||||
|
"projekt": g(
|
||||||
|
doc,
|
||||||
|
'akce_projekt',
|
||||||
|
""
|
||||||
|
),
|
||||||
|
})
|
||||||
|
|
||||||
if komponenty == "true":
|
elif typ_dat == "lokalita":
|
||||||
# One feature per component –
|
meta.update({
|
||||||
# all data on a single row, no relations needed
|
"lokalita_nazev": lokalita_nazev,
|
||||||
if komps:
|
"lokalita_popis": lokalita_popis,
|
||||||
for komp in komps:
|
"lokalita_zachovalost": tr_code(g(
|
||||||
if not komp_projde_filtrem(
|
doc,
|
||||||
komp, filter_areal,
|
'lokalita_zachovalost'
|
||||||
filter_datace, filters
|
)),
|
||||||
):
|
"lokalita_druh": tr_code(g(
|
||||||
|
doc,
|
||||||
|
'lokalita_druh'
|
||||||
|
)),
|
||||||
|
"lokalita_typ": tr_code(g(
|
||||||
|
doc,
|
||||||
|
'lokalita_typ_lokality'
|
||||||
|
)),
|
||||||
|
})
|
||||||
|
|
||||||
|
# Documentation units (DJ) within the record
|
||||||
|
djs = doc.get('az_dokumentacni_jednotka', [])
|
||||||
|
|
||||||
|
for dj in djs:
|
||||||
|
# Skip negative evidence units if requested
|
||||||
|
if skip_negativni and dj.get('dj_negativni_jednotka') is True:
|
||||||
|
continue
|
||||||
|
|
||||||
|
komps = dj.get('dj_komponenta', [])
|
||||||
|
|
||||||
|
if filter_areal or filter_datace:
|
||||||
|
if not komps:
|
||||||
|
continue
|
||||||
|
if not any(
|
||||||
|
komp_projde_filtrem(
|
||||||
|
komp, filter_areal,
|
||||||
|
filter_datace, filters
|
||||||
|
)
|
||||||
|
for komp in komps
|
||||||
|
):
|
||||||
|
continue
|
||||||
|
|
||||||
|
dj_id = dj.get('ident_cely')
|
||||||
|
dj_typ = dj.get('dj_typ')
|
||||||
|
|
||||||
|
# Merge shared metadata with documentation unit-specific fields
|
||||||
|
dj_meta = {
|
||||||
|
**meta,
|
||||||
|
'dj_id': dj_id,
|
||||||
|
'dj_typ_value': dj_typ.get('value') if dj_typ else "",
|
||||||
|
'dj_negativni': (
|
||||||
|
"Negativní"
|
||||||
|
if dj.get('dj_negativni_jednotka') is True
|
||||||
|
else "Pozitivní"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
# Link Documentation Unit to Geometry (PIAN)
|
||||||
|
dj_pian = dj.get('dj_pian')
|
||||||
|
if dj_pian:
|
||||||
|
dj_pian_value = dj_pian.get('id')
|
||||||
|
if dj_pian_value:
|
||||||
|
target_pian_ids.add(dj_pian_value)
|
||||||
|
if dj_pian_value not in pian_lookup:
|
||||||
|
pian_lookup[dj_pian_value] = []
|
||||||
|
|
||||||
|
if komponenty == "true":
|
||||||
|
# One feature per component –
|
||||||
|
# all data on a single row, no relations needed
|
||||||
|
if komps:
|
||||||
|
for komp in komps:
|
||||||
|
if not komp_projde_filtrem(
|
||||||
|
komp, filter_areal,
|
||||||
|
filter_datace, filters
|
||||||
|
):
|
||||||
|
continue
|
||||||
|
|
||||||
|
komp_meta = {
|
||||||
|
**dj_meta,
|
||||||
|
'komponenta_id': komp.get(
|
||||||
|
'ident_cely',
|
||||||
|
""
|
||||||
|
),
|
||||||
|
'komponenta_areal': (
|
||||||
|
komp.get('komponenta_areal')
|
||||||
|
or {}
|
||||||
|
).get('value', ""),
|
||||||
|
'komponenta_obdobi': (
|
||||||
|
komp.get('komponenta_obdobi')
|
||||||
|
or {}
|
||||||
|
).get('value', ""),
|
||||||
|
}
|
||||||
|
pian_lookup[dj_pian_value].append(komp_meta)
|
||||||
|
target_pian_ids_count += 1
|
||||||
|
else:
|
||||||
|
# DJ without components — still include
|
||||||
|
# with empty component fields
|
||||||
|
if filter_areal or filter_datace:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
komp_meta = {
|
empty_meta = {
|
||||||
**dj_meta,
|
**dj_meta,
|
||||||
'komponenta_id': komp.get(
|
'komponenta_id': "",
|
||||||
'ident_cely',
|
'komponenta_areal': "",
|
||||||
""
|
'komponenta_obdobi': "",
|
||||||
),
|
|
||||||
'komponenta_areal': (
|
|
||||||
komp.get('komponenta_areal')
|
|
||||||
or {}
|
|
||||||
).get('value', ""),
|
|
||||||
'komponenta_obdobi': (
|
|
||||||
komp.get('komponenta_obdobi')
|
|
||||||
or {}
|
|
||||||
).get('value', ""),
|
|
||||||
}
|
}
|
||||||
pian_lookup[dj_pian_value].append(komp_meta)
|
pian_lookup[dj_pian_value].append(empty_meta)
|
||||||
target_pian_ids_count += 1
|
target_pian_ids_count += 1
|
||||||
else:
|
else:
|
||||||
# DJ without components — still include
|
|
||||||
# with empty component fields
|
|
||||||
if filter_areal or filter_datace:
|
|
||||||
continue
|
|
||||||
|
|
||||||
empty_meta = {
|
|
||||||
**dj_meta,
|
|
||||||
'komponenta_id': "",
|
|
||||||
'komponenta_areal': "",
|
|
||||||
'komponenta_obdobi': "",
|
|
||||||
}
|
|
||||||
pian_lookup[dj_pian_value].append(empty_meta)
|
|
||||||
target_pian_ids_count += 1
|
target_pian_ids_count += 1
|
||||||
else:
|
pian_lookup[dj_pian_value].append(dj_meta)
|
||||||
target_pian_ids_count += 1
|
|
||||||
pian_lookup[dj_pian_value].append(dj_meta)
|
if not target_pian_ids:
|
||||||
|
iface.messageBar().pushMessage(
|
||||||
|
"AMCR",
|
||||||
|
f"Nalezeno {len(docs)} záznamů, ale žádný nemá geometrii.",
|
||||||
|
level=Qgis.MessageLevel.Warning
|
||||||
|
)
|
||||||
|
return
|
||||||
|
|
||||||
|
# ==========================================
|
||||||
|
# C) GEOMETRY FETCHING (PIAN)
|
||||||
|
# ==========================================
|
||||||
|
ids_list = list(target_pian_ids)
|
||||||
|
total_pians = len(ids_list)
|
||||||
|
docs_pian = []
|
||||||
|
# Geometry requests are batch-processed
|
||||||
|
# to stay under URL length limits:
|
||||||
|
BATCH_PIAN = 200
|
||||||
|
|
||||||
if not target_pian_ids:
|
|
||||||
iface.messageBar().pushMessage(
|
iface.messageBar().pushMessage(
|
||||||
"AMCR",
|
"AMCR",
|
||||||
f"Nalezeno {len(docs)} záznamů, ale žádný nemá geometrii.",
|
f"Záznamů: {len(docs)} (z toho {actions_with_geom} s mapou). "
|
||||||
level=Qgis.MessageLevel.Warning
|
f"Stahuji {total_pians} unikátních geometrií, "
|
||||||
|
f"vykresluji {target_pian_ids_count} geometrií...",
|
||||||
|
level=Qgis.MessageLevel.Info
|
||||||
)
|
)
|
||||||
return
|
|
||||||
|
|
||||||
# ==========================================
|
fl_pian = [
|
||||||
# C) GEOMETRY FETCHING (PIAN)
|
"ident_cely",
|
||||||
# ==========================================
|
"pian_typ",
|
||||||
ids_list = list(target_pian_ids)
|
"pian_chranene_udaje",
|
||||||
total_pians = len(ids_list)
|
"pian_presnost",
|
||||||
docs_pian = []
|
]
|
||||||
# Geometry requests are batch-processed
|
|
||||||
# to stay under URL length limits:
|
|
||||||
BATCH_PIAN = 200
|
|
||||||
|
|
||||||
iface.messageBar().pushMessage(
|
for i in range(0, total_pians, BATCH_PIAN):
|
||||||
"AMCR",
|
batch = ids_list[i: i + BATCH_PIAN]
|
||||||
f"Záznamů: {len(docs)} (z toho {actions_with_geom} s mapou). "
|
or_query = " OR ".join(batch)
|
||||||
f"Stahuji {total_pians} unikátních geometrií, "
|
fq_pian = f"ident_cely:({or_query})"
|
||||||
f"vykresluji {target_pian_ids_count} geometrií...",
|
|
||||||
level=Qgis.MessageLevel.Info
|
|
||||||
)
|
|
||||||
|
|
||||||
fl_pian = [
|
params_pian = {
|
||||||
"ident_cely",
|
"mapa": "true",
|
||||||
"pian_typ",
|
"entity": "pian",
|
||||||
"pian_chranene_udaje",
|
"q": fq_pian,
|
||||||
"pian_presnost",
|
"rows": len(batch),
|
||||||
]
|
"fl": ",".join(fl_pian),
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
QApplication.processEvents()
|
||||||
|
r_json = _api_get_json(url, params=params_pian, timeout=15)
|
||||||
|
docs_pian.extend(r_json.get('response', {}).get('docs', []))
|
||||||
|
except requests.exceptions.RequestException as e:
|
||||||
|
# Network is down – stop immediately instead of
|
||||||
|
# uselessly retrying every remaining batch
|
||||||
|
network_error = True
|
||||||
|
QgsMessageLog.logMessage(
|
||||||
|
f"Chyba sítě při stahování geometrií PIAN: {e}",
|
||||||
|
"AMČR", Qgis.MessageLevel.Critical
|
||||||
|
)
|
||||||
|
break
|
||||||
|
except Exception as e:
|
||||||
|
QgsMessageLog.logMessage(
|
||||||
|
f"Chyba PIAN: {e}",
|
||||||
|
"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 {}
|
||||||
|
|
||||||
for i in range(0, total_pians, BATCH_PIAN):
|
|
||||||
batch = ids_list[i: i + BATCH_PIAN]
|
|
||||||
or_query = " OR ".join(batch)
|
|
||||||
fq_pian = f"ident_cely:({or_query})"
|
|
||||||
|
|
||||||
params_pian = {
|
|
||||||
"mapa": "true",
|
|
||||||
"entity": "pian",
|
|
||||||
"q": fq_pian,
|
|
||||||
"rows": len(batch),
|
|
||||||
"fl": ",".join(fl_pian),
|
|
||||||
}
|
|
||||||
try:
|
|
||||||
QApplication.processEvents()
|
|
||||||
r_json = _api_get_json(url, params=params_pian, timeout=15)
|
|
||||||
docs_pian.extend(r_json.get('response', {}).get('docs', []))
|
|
||||||
except requests.exceptions.RequestException as e:
|
|
||||||
# Network is down – stop immediately instead of
|
|
||||||
# uselessly retrying every remaining batch
|
|
||||||
network_error = True
|
|
||||||
QgsMessageLog.logMessage(
|
|
||||||
f"Chyba sítě při stahování geometrií PIAN: {e}",
|
|
||||||
"AMČR", Qgis.MessageLevel.Critical
|
|
||||||
)
|
|
||||||
break
|
|
||||||
except Exception as e:
|
|
||||||
QgsMessageLog.logMessage(
|
|
||||||
f"Chyba PIAN: {e}",
|
|
||||||
"AMČR", Qgis.MessageLevel.Warning
|
|
||||||
)
|
|
||||||
|
|
||||||
# ==========================================
|
# ==========================================
|
||||||
# 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(
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ class AmcrViewer:
|
|||||||
"""
|
"""
|
||||||
# Define paths for action-specific icons
|
# Define paths for action-specific icons
|
||||||
icon_akce_path = os.path.join(self.plugin_dir, 'akce.png')
|
icon_akce_path = os.path.join(self.plugin_dir, 'akce.png')
|
||||||
|
icon_pas_path = os.path.join(self.plugin_dir, 'akce.png')
|
||||||
icon_lokality_path = os.path.join(self.plugin_dir, 'lokality.png')
|
icon_lokality_path = os.path.join(self.plugin_dir, 'lokality.png')
|
||||||
icon_amcr_help_path = os.path.join(self.plugin_dir, 'amcr-help.png')
|
icon_amcr_help_path = os.path.join(self.plugin_dir, 'amcr-help.png')
|
||||||
|
|
||||||
@@ -109,6 +110,16 @@ class AmcrViewer:
|
|||||||
)
|
)
|
||||||
self.plugin_menu.addAction(self.action_download_akce)
|
self.plugin_menu.addAction(self.action_download_akce)
|
||||||
|
|
||||||
|
self.action_download_pas = self.add_action(
|
||||||
|
icon_path=icon_pas_path,
|
||||||
|
text=self.tr(u'Stáhnout data samostatných nálezů | AMČR Viewer'),
|
||||||
|
callback=lambda checked=False: self.run_download('samostatny_nalez'),
|
||||||
|
parent=self.iface.mainWindow(),
|
||||||
|
add_to_menu=False,
|
||||||
|
add_to_toolbar=False
|
||||||
|
)
|
||||||
|
self.plugin_menu.addAction(self.action_download_pas)
|
||||||
|
|
||||||
self.action_download_lokality = self.add_action(
|
self.action_download_lokality = self.add_action(
|
||||||
icon_path=icon_lokality_path,
|
icon_path=icon_lokality_path,
|
||||||
text=self.tr(u'Stáhnout data lokalit | AMČR Viewer'),
|
text=self.tr(u'Stáhnout data lokalit | AMČR Viewer'),
|
||||||
|
|||||||
+3190
-8228
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user