diff --git a/amcr_viewer/amcr_tools.py b/amcr_viewer/amcr_tools.py index deb389c..4d30747 100644 --- a/amcr_viewer/amcr_tools.py +++ b/amcr_viewer/amcr_tools.py @@ -313,7 +313,6 @@ def load_amcr_data(canvas, bb, filters=None): # PIAN attributes pian_presnost = tr_code(str(doc.get('pian_presnost', ''))) pian_typ = tr_code(str(doc.get('pian_typ', ''))) - # dj_negativni = "Negativní" if pid in negative_dj_pian_ids else "Pozitivní" if wkt: geom = QgsGeometry.fromWkt(wkt) @@ -371,68 +370,3 @@ def load_amcr_data(canvas, bb, filters=None): iface.messageBar().pushMessage("Chyba", str(e), level=2) finally: QApplication.restoreOverrideCursor() - -# class AmcrIdentifyTool(QgsMapToolIdentifyFeature): -# def __init__(self, canvas): -# super().__init__(canvas) -# self.canvas = canvas -# self.setCursor(Qt.CrossCursor) - -# def canvasReleaseEvent(self, event): -# results = self.identify(event.x(), event.y(), self.IdentifyMode.TopDownStopAtFirst, self.VectorLayer) -# if not results: return -# feature = results[0].mFeature -# akce_id = None -# # Změna: hledáme 'ident_cely' (ID akce) -# idx = feature.fieldNameIndex('ident_cely') -# if idx != -1: -# akce_id = feature.attributes()[idx] - -# # Fallback na starší názvy polí, kdyby něco -# if not akce_id: -# for col in ['akce_id', 'ident_cely', 'pian_id']: -# if col in feature.fields().names(): -# akce_id = feature[col] -# break - -# if not akce_id: return - -# full_id = akce_id if "api.aiscr.cz" in str(akce_id) else f"https://api.aiscr.cz/id/{akce_id}" -# url = f"https://api.aiscr.cz/2.2/oai?verb=GetRecord&metadataPrefix=oai_amcr&identifier={full_id}" - -# iface.messageBar().pushMessage("AMCR", f"Detail: {akce_id}...", level=1) -# QApplication.setOverrideCursor(Qt.WaitCursor) -# try: -# r = requests.get(url, timeout=5) -# if r.status_code == 200: self.show_detail(akce_id, r.text) -# except Exception as e: -# iface.messageBar().pushMessage("Chyba", str(e), level=2) -# finally: -# QApplication.restoreOverrideCursor() - -# def show_detail(self, title, raw_xml): -# xml = re.sub(r'\sxmlns="[^"]+"', '', raw_xml, count=1) -# xml = re.sub(r'<(/?)[a-zA-Z0-9]+:', r'<\1', xml) -# info = "" -# try: -# root = ET.fromstring(xml) -# rec = root.find('.//archeologicky_zaznam') -# if not rec: info = "Zadna data." -# else: -# kat = rec.find('.//hlavni_katastr') -# info += f"