mirror of
https://github.com/ARUP-CAS/aiscr-qgis-amcr-viewer.git
synced 2026-06-17 11:22:53 +02:00
readme update v2.0.0 (#45)
This commit is contained in:
@@ -12,8 +12,7 @@
|
||||
|
||||
## 1. Overview
|
||||
|
||||
**AMCR Viewer** is a QGIS plugin designed to facilitate direct access to the Digital Archive of the Archaeological Map of the Czech Republic (AMČR). It allows researchers to **query, retrieve, and visualize *Fieldwork events* and *Sites* data (metadata and geometry) directly within the GIS environment**, eliminating the need to manually export data from the web interface. Both *Fieldwork events* and *Sites* layers may be accompanied by a *Components* layer with additional information. **Only publicly accessible data are supported at the time** (accessibility = anonymous).
|
||||
|
||||
**AMCR Viewer** is a QGIS plugin designed to facilitate direct access to the Digital Archive of the Archaeological Map of the Czech Republic (AMČR). It allows researchers to **query, retrieve, and visualize *Fieldwork events* and *Sites* data (metadata and geometry) directly within the GIS environment**, eliminating the need to manually export data from the web interface. Both *Fieldwork events* and *Sites* layers may optionally include component-level data (period and activity area) embedded directly in the attribute table. The plugin supports both **anonymous (public) access** and **authenticated access** for users with an AMČR account.
|
||||
|
||||
### Key Features
|
||||
|
||||
@@ -21,109 +20,112 @@
|
||||
* **Advanced Attribute Filtering:** Supports multi-criteria filtering using controlled vocabularies.
|
||||
* **Dynamic Geometry Retrieval:** Automatically downloads and categorizes spatial data into Point, Line, and Polygon layers.
|
||||
* **Semantic Interoperability:** Automatically translates internal system codes into human-readable labels using the AIS CR API.
|
||||
* **Authenticated Access:** Users with an AMČR account can log in to access non-public records.
|
||||
|
||||
## 2. Installation Guide
|
||||
|
||||
**Install the plugin from QGIS plugin repository.**
|
||||
**Install the plugin from QGIS plugin repository.**
|
||||
|
||||
**OR**
|
||||
**OR**
|
||||
|
||||
*1. Obtain the [plugin distribution package](https://github.com/ARUP-CAS/aiscr-qgis-amcr-viewer/releases) (ZIP archive containing the `amcr_viewer` directory).*
|
||||
*2. Launch QGIS.*
|
||||
*3. Navigate to Plugins → Manage and Install Plugins...*
|
||||
*4. Select the Install from ZIP tab.*
|
||||
*5. Locate the source ZIP file and click Install Plugin.*
|
||||
*6. Upon successful installation, the AMCR download button (load AMCR data) will appear in the interface.*
|
||||
1. *Obtain the [plugin distribution package](https://github.com/ARUP-CAS/aiscr-qgis-amcr-viewer/releases) (ZIP archive containing the `amcr_viewer` directory).*
|
||||
2. *Launch QGIS.*
|
||||
3. *Navigate to Plugins → Manage and Install Plugins...*
|
||||
4. *Select the Install from ZIP tab.*
|
||||
5. *Locate the source ZIP file and click Install Plugin.*
|
||||
6. *Upon successful installation, the AMCR Viewer button will appear in the toolbar.*
|
||||
|
||||
## 3. User Manual
|
||||
|
||||
### 3.1 Data Retrieval
|
||||
### 3.1 Authentication (Optional)
|
||||
|
||||
To initiate a search query, click either the **Stáhnout data akcí** or the **Stáhnout data lokalit** icon from the dropdown menu. The filter dialog provides the following options. Shown options vary based on the choosed tool.
|
||||
By default, the plugin accesses only publicly available records (accessibility = anonymous). To access non-public data, log in using your AMČR account:
|
||||
|
||||
* **Spatial Filter:** *Checkbox "Limit search to current map extent":* If checked, the query is restricted to the geographical area currently visible in the QGIS canvas. If unchecked, the query searches the entire database (use with caution regarding data volume).
|
||||
* It is possible to view only those Fieldwork events with positive outcome, if "Positive findings only" is checked. Only *PIANs* marked as (or rather *PIANs* belonging to Documentation units marked as) "Type of evidence" = "positive" are rendered.
|
||||
* Click the dropdown arrow on the AMCR Viewer toolbar button and select **Přihlásit se**.
|
||||
* Enter your e-mail and password. Credentials are encrypted and stored securely in the **QGIS Authentication Manager** (DPAPI on Windows, Keychain on macOS, encrypted SQLite on Linux).
|
||||
* Stored credentials are reused automatically across sessions. To update or remove them, open the login dialog again.
|
||||
|
||||
### 3.2 Data Retrieval
|
||||
|
||||
To initiate a search query, click either the **Stáhnout data akcí** or the **Stáhnout data lokalit** option from the dropdown menu. The filter dialog provides the following options. Shown options vary based on the chosen tool.
|
||||
|
||||
* **Spatial Filter:** *Checkbox "Omezit vyhledávání rozsahem okna":* If checked, the query is restricted to the geographical area currently visible in the QGIS canvas. If unchecked, the query searches the entire database (use with caution regarding data volume).
|
||||
* **Positive findings only:** If checked, only *PIANs* belonging to Documentation units marked as "Type of evidence" = "positive" are included. *(Fieldwork events only.)*
|
||||
|
||||
* **Attribute Filters:**
|
||||
* The dialog utilizes "Picker" widgets for controlled vocabularies (common: Region, District, Cadastral area, Period, Activity Area, *PIAN* accuracy; *events* related: Organisation, Researcher, Event type; *sites* related: Site type and class, Level of confidence, State of preservation).
|
||||
* Click **Select...** to open a searchable selection window. Multiple values can be selected simultaneously (Logic: OR).
|
||||
* The dialog uses "Picker" widgets for controlled vocabularies (common: Region, District, Cadastral area, Period, Activity Area, *PIAN* accuracy, Accessibility; *events* related: Organisation, Researcher, Event type; *sites* related: Site type and class, Level of confidence, State of preservation).
|
||||
* Click **Vybrat...** to open a searchable selection window. Multiple values can be selected simultaneously (Logic: OR).
|
||||
|
||||
* **Codelists (Hesláře):**
|
||||
* Controlled vocabularies are downloaded from the AMČR OAI-PMH API and cached locally in `codelists/heslar.csv`.
|
||||
* To refresh all codelists, click the **Aktualizovat hesláře 🔄** button in the filter dialog. This runs as a background task and may take a few minutes.
|
||||
|
||||
* **Fieldwork Manager (Dynamic List):**
|
||||
* Due to the dynamic nature of the persons database, the list of Fieldwork Managers is retrieved from the AIS CR servers and needs to be updated the first time (and subsequently, if there is need).
|
||||
* To refresh the list from the server, click the **Refresh (🔄)** button next to the selection field. This downloads the latest list of researchers from the API.
|
||||
* **Components:** Check **Načíst komponenty** to include period and activity area data directly in the output layers.
|
||||
> ⚠ When components are loaded, spatial features are duplicated — each feature corresponds to one component. Spatial analyses (areas, counts) may be inaccurate.
|
||||
|
||||
* **Components:** The *components* data are downloaded as well upon checking the corresponding check box. This enriches the main (*Events* and *Sites*) layers with additional information (period and activity area).
|
||||
|
||||
* If no filter is used, all accessible Fieldwork events/PIANs are returned (although the number of Fieldwork events to be loaded is capped at 20000 records; it is advisable to set at least one filter).
|
||||
* If no filter is used, all accessible Fieldwork events/PIANs are returned (the number of records is capped at 20 000; it is advisable to set at least one filter).
|
||||
|
||||
For a more in-depth tutorial refer to the [AMČR Documentation](https://amcr-help.aiscr.cz/digiarchiv/qgis-viewer.html) (only in Czech).
|
||||
|
||||
### 3.2 Layer Structure & Attributes
|
||||
### 3.3 Layer Structure & Attributes
|
||||
|
||||
Upon successful retrieval, the plugin generates four temporary memory layers:
|
||||
Upon successful retrieval, the plugin generates up to three temporary memory layers:
|
||||
|
||||
1. **AMCR Plochy (Polygons)**
|
||||
2. **AMČR Linie (Lines)**
|
||||
3. **AMČR Body (Points)**
|
||||
4. **AMČR Komponenty (*Components*/no geometry)**
|
||||
1. **AMCR\_[Akce|Lokalita]\_Polygony**
|
||||
2. **AMCR\_[Akce|Lokalita]\_Linie**
|
||||
3. **AMCR\_[Akce|Lokalita]\_Body**
|
||||
|
||||
The Attribute Table includes standardized fields with important metadata. The components layer has no geometry on its own and depend solely on a relation with the other three layers.
|
||||
Layers are only created if the query returns features of the corresponding geometry type. All layers share the same attribute schema.
|
||||
|
||||
#### 3.2.1 Fields of the layers with geometry
|
||||
#### 3.3.1 Common fields
|
||||
|
||||
| Field | Description |
|
||||
| --- | --- |
|
||||
| PIAN | PIAN (spatial identifier) ID |
|
||||
| Přesnost | spatial deviation [in units/tens/hundreds of meters/defined by cadastre] |
|
||||
| PIAN – typ | [point/line/polygon] |
|
||||
| Dokumentační jednotka | Documentation unit ID |
|
||||
| Typ dokumentační jednotky | [trench/event part/whole event/cadastral territory] |
|
||||
| Definiční bod(y) (WGS-84) | feature centroid in WGS-84 coordinate system |
|
||||
| Akce/Lokalita | Event/Site ID |
|
||||
| Odkaz do Digitálního archivu AMČR | link to the Event/Site record in the Digital Archive |
|
||||
| Okres | district |
|
||||
| Katastr | main cadastre |
|
||||
| Další katastr | other cadastres, if the event extends beyond the main cadastre |
|
||||
| Přístupnost | record accessibility [A/B/C/D] |
|
||||
| pian | PIAN (spatial identifier) ID |
|
||||
| presnost | Spatial deviation \[units/tens/hundreds of meters/defined by cadastre\] |
|
||||
| pian\_typ | \[point/line/polygon\] |
|
||||
| dj | Documentation unit ID |
|
||||
| typ\_dj | \[trench/event part/whole event/cadastral territory\] |
|
||||
| definicni\_body | Feature centroid in WGS-84 coordinate system |
|
||||
| akce / lokalita | Fieldwork event / Site ID |
|
||||
| odkaz\_do\_digiarchivu | Link to the record in the Digital Archive |
|
||||
| okres | District |
|
||||
| katastr | Main cadastral area |
|
||||
| dalsi\_katastry | Other cadastral areas, if the event extends beyond the main cadastre |
|
||||
| Přístupnost | Record accessibility \[A/B/C/D\] |
|
||||
|
||||
> Common fields
|
||||
#### 3.3.2 Fields related to *Fieldwork events*
|
||||
|
||||
| Field | Description |
|
||||
| --- | --- |
|
||||
| Vedoucí akce | main fieldwork manager |
|
||||
| Organizace | organization conducting the research |
|
||||
| Specifikace data | [exact date/exact years/sometime in years] |
|
||||
| Datum zahájení | Event start date |
|
||||
| Datum ukončení | Event end date |
|
||||
| Hlavní typ | primary research method [total excavation/pit trench/surface collection survey/…] |
|
||||
| Vedlejší typ | secondary research method [same options as in Hlavní typ] |
|
||||
| Zjištění | did the research reveal archaeological contexts? [positive/negative] |
|
||||
| Akce – lokalizace | verbal description of the event location |
|
||||
| Akce – nahrazuje NZ | replaces a fieldwork report? [yes/no] |
|
||||
| akce\_lokalizace | Verbal description of the event location |
|
||||
| vedouci | Main fieldwork manager |
|
||||
| organizace | Organisation conducting the research |
|
||||
| specifikace\_data | \[exact date/exact years/sometime in years\] |
|
||||
| zahajeni | Event start date |
|
||||
| ukonceni | Event end date |
|
||||
| hlavni\_typ | Primary research method |
|
||||
| vedlejsi\_typ | Secondary research method |
|
||||
| zjisteni | Did the research reveal archaeological contexts? \[positive/negative\] |
|
||||
| nahrazuje\_NZ | Replaces a fieldwork report? \[yes/no\] |
|
||||
|
||||
> Fields related to *Fieldwork events*
|
||||
#### 3.3.3 Fields related to *Sites*
|
||||
|
||||
| Field | Description |
|
||||
| --- | --- |
|
||||
| nazev_lokality | site name |
|
||||
| popis_lokality | site description |
|
||||
| typ_lokality | site classification by definition method [survey polygon/heritage site/landscape] |
|
||||
| druh_lokality | site classification by the nature of identified field relics [aerial survey polygon/landscape/remains of settlement/…] |
|
||||
| zachovalost | site preservation state [buried site/ruin/aboveground remains/…] |
|
||||
| nazev\_lokality | Site name |
|
||||
| popis\_lokality | Site description |
|
||||
| typ\_lokality | Site classification by definition method |
|
||||
| druh\_lokality | Site classification by the nature of identified field relics |
|
||||
| zachovalost | Site preservation state |
|
||||
|
||||
> Fields related to *Sites*
|
||||
|
||||
#### 3.2.2 Fields of the *Components* layer
|
||||
#### 3.3.4 Component fields (only when *Načíst komponenty* is checked)
|
||||
|
||||
| Field | Description |
|
||||
| --- | --- |
|
||||
| komponenta | Component ID |
|
||||
| dj_id | parent Documentation unit ID |
|
||||
| komponenta_areal | Activity area [settlement/burial area/field/…] |
|
||||
| komponenta_obdobi | Period [Neolithic/High Middle Ages–Modern Period/Middle La Tène (LtB–C1)/…] |
|
||||
| vrstva | system value linking to a specific geometry table with the corresponding documentation unit |
|
||||
| komponenta\_areal | Activity area \[settlement/burial area/field/…\] |
|
||||
| komponenta\_obdobi | Period \[Neolithic/High Middle Ages–Modern Period/…\] |
|
||||
|
||||
## 4. Technical Architecture
|
||||
|
||||
@@ -131,40 +133,48 @@ The plugin is developed in **Python 3** using the **PyQt6** framework for the GU
|
||||
|
||||
### 4.1 File Structure
|
||||
|
||||
* `amcr_viewer.py`: Entry point; handles GUI integration and initialization.
|
||||
* `amcr_dialog.py`: Manages the UI logic, including the custom `FilterableSelectionDialog` for handling large vocabularies.
|
||||
* `amcr_tools.py`: Core logic module. Handles API requests, pagination, data parsing, and vector layer generation.
|
||||
* `amcr_codelists.py`: Manages local caching of controlled vocabularies (`codelists/*.csv`).
|
||||
* `amcr_viewer.py`: Entry point; handles GUI integration, toolbar/menu setup, and login flow.
|
||||
* `amcr_dialog.py`: Manages the UI logic, including `AmcrFilterDialog`, `FilterableSelectionDialog`, and `LoginDialog`.
|
||||
* `amcr_tools.py`: Core logic module. Handles authentication, API requests, pagination, data parsing, and vector layer generation.
|
||||
* `amcr_codelists.py`: Manages local caching of controlled vocabularies (`codelists/heslar.csv`) downloaded via OAI-PMH.
|
||||
|
||||
### 4.2 Data Flow & API Integration
|
||||
|
||||
The plugin interacts with three primary endpoints of the AIS CR infrastructure:
|
||||
The plugin interacts with the following endpoints:
|
||||
|
||||
1. **Search API (Solr):**
|
||||
* Endpoint: `https://digiarchiv.aiscr.cz/api/search/query`
|
||||
* Method: `GET`
|
||||
* Parameters: `entity=akce`, `rows/page` (pagination).
|
||||
* Logic: The plugin implements a `while True` loop to handle pagination, processing data in batches of 500 records to ensure stability.
|
||||
1. **Login API:**
|
||||
* Endpoint: `https://digiarchiv.aiscr.cz/api/user/login`
|
||||
* Method: `POST`
|
||||
* Returns a session cookie used for subsequent authenticated requests.
|
||||
* Credentials are stored in the QGIS Authentication Manager; the session is restored automatically if it expires mid-download.
|
||||
|
||||
2. **Translation API:**
|
||||
* Endpoint: `https://digiarchiv.aiscr.cz/api/assets/i18n/cs.json`
|
||||
* Function: Retrieves the mapping between system codes (e.g., `HES-xxxx`) and Czech labels. This dictionary is cached in memory during the session.
|
||||
2. **Search API (Solr):**
|
||||
* Endpoint: `https://digiarchiv.aiscr.cz/api/search/query`
|
||||
* Method: `GET`
|
||||
* Parameters: `entity=akce|lokalita|pian`, `rows/page` (pagination), `mapa=true`.
|
||||
* Logic: Paginated in batches of 500 records (metadata) and 200 records (geometries). A safety cap of 20 000 records is enforced.
|
||||
|
||||
3. **Translation API:**
|
||||
* Endpoint: `https://digiarchiv.aiscr.cz/api/assets/i18n/cs.json`
|
||||
* Function: Retrieves the mapping between system codes (e.g. `HES-xxxx`) and Czech labels. Cached in memory for the session.
|
||||
|
||||
4. **Codelists API (OAI-PMH):**
|
||||
* Endpoint: `https://api.aiscr.cz/2.2/oai`
|
||||
* Used for downloading controlled vocabularies (periods, regions, organisations, etc.) on demand.
|
||||
|
||||
### 4.3 Data Persistence
|
||||
|
||||
* **Vocabularies:** Static vocabularies (e.g., Periods, Regions) are stored in `codelists/heslar.csv`.
|
||||
* **Dynamic Data:** The list of researchers is downloaded on-demand and cached in `codelists/vedouci.csv`.
|
||||
* **Vocabularies:** Stored in `codelists/heslar.csv`; updated on user request via the background task.
|
||||
* **Layers:** Output layers are created as `memory` layers. They are non-persistent and will be lost if QGIS is closed without saving.
|
||||
|
||||
### 4.4 Constraints
|
||||
|
||||
* **Record Limit:** A safety cap of 20,000 records is enforced.
|
||||
* **Batch Processing:** Geometry fetching is batched (50 IDs per request) to comply with URL length limitations and server load balancing.
|
||||
|
||||
### 4.5 Relational Data Linking
|
||||
The plugin automatically utilizes advanced QGIS features for data relationship management, specifically Polymorphic Relations. The *Components* layer is dynamically linked within the project to the spatial layers of events and sites via the documentation unit identifier (dj_id). This allows users to immediately see all *components* belonging to a given geometry (point, line, or polygon) directly in the attribute form or the identify features tool, without the need to manually filter or join the data.
|
||||
* **Record Limit:** A safety cap of 20 000 records is enforced.
|
||||
* **Batch Processing:** Geometry fetching is batched (200 IDs per request) to comply with URL length limitations and server load balancing.
|
||||
* **Component duplication:** When components are loaded, each output feature corresponds to one component rather than one documentation unit. A single PIAN may therefore appear multiple times in the layer.
|
||||
|
||||
## 5. Links and resources
|
||||
|
||||
* [AMCR/Digiarchive Documentation](https://amcr-help.aiscr.cz/) (only in Czech).
|
||||
* [AMCR Viewer tutorial](https://amcr-help.aiscr.cz/digiarchiv/qgis-viewer.html) (only in Czech).
|
||||
* [Import/Export. Pluginy propojující QGIS s AMČR \[poster\]](https://zenodo.org/records/20504909) (only in Czech; valid for v1.3.2).
|
||||
|
||||
Reference in New Issue
Block a user