Metadata-Version: 2.1
Name: quality-result-gui
Version: 1.1.5
Summary: QGIS plugin for visualizing quality check results.
Home-page: https://github.com/nlsfi/quality-result-gui
Author: National Land Survey of Finland
Author-email: eero.hietanen@maanmittauslaitos.fi
License: GNU GPL v3.0
Project-URL: Changelog, https://github.com/nlsfi/quality-result-gui/blob/main/CHANGELOG.md
Keywords: qgis
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Software Development :: Libraries
Classifier: Typing :: Typed
Description-Content-Type: text/markdown
License-File: LICENSE

# quality-result-gui

QGIS plugin for visualizing quality check results.

## Plugin

Not implemented yet.

## Library

To use this library as an external dependency in your plugin or other Python code, install it using `pip install quality-result-gui` and use imports from the provided `quality_result_gui` package. If used in a plugin, library must be installed in the runtime QGIS environment or use [qgis-plugin-dev-tools] to bundle your plugin with runtime dependencies included.

### Minimal working example (with JSON file)

For quality dock widget to work, a subclass of QualityResultClient needs to be first implemented. Instance of the created API client class is then passed to QualityErrorsDockWidget. For a real-world application, a separate backend application is needed for checking data quality and provide the quality check results for the QGIS plugin.

Example of the expected api response can be seen in [this file](./src/quality_result_gui_plugin/dev_tools/example_quality_errors/quality_errors.json). [Example parser class](./src/quality_result_gui_plugin/dev_tools/example_quality_errors/quality_errors.json) for json response is also provided for the following example to work:

```python
import json

from qgis.utils import iface

from quality_result_gui.api.quality_api_client import QualityResultClient
from quality_result_gui.api.types.quality_error import QualityErrorsByPriority
from quality_result_gui_plugin.dev_tools.response_parser import QualityErrorResponse
from quality_result_gui.quality_error_manager import QualityResultManager


class ExampleQualityResultClient(QualityResultClient):

    def get_results(self) -> Optional[List[QualityErrorsByPriority]]:
        """
        Retrieve latest quality errors from API

        Returns:
            None: if no results available
            List[QualityErrorsByPriority]: if results available

        Raises:
            QualityResultClientError: if request fails
            QualityResultServerError: if check failed in backend
        """
        full_path_to_json = "some-path/example_quality_errors.json"
        example_response = json.loads(Path(full_path_to_json).read_text())

        return QualityErrorResponse(example_response).errors_by_priority

    def get_crs(self) -> QgsCoordinateReferenceSystem:
        return QgsCoordinateReferenceSystem("EPSG:3067")



api_client = ExampleQualityResultClient()
quality_manager = QualityResultManager(api_client, iface.mainWindow())
quality_manager.show_dock_widget()

```

## Development of quality-result-gui

See [development readme](./DEVELOPMENT.md).

## License & copyright

Licensed under GNU GPL v3.0.

This tool is part of the topographic data production system developed in National Land Survey of Finland. For further information, see:

- [Abstract for FOSS4G](https://talks.osgeo.org/foss4g-2022/talk/TDDGJ9/)
- [General news article about the project](https://www.maanmittauslaitos.fi/en/topical_issues/topographic-data-production-system-upgraded-using-open-source-solutions)

Contact details: eero.hietanen@maanmittauslaitos.fi

Copyright (C) 2022 [National Land Survey of Finland].

[National Land Survey of Finland]: https://www.maanmittauslaitos.fi/en
[qgis-plugin-dev-tools]: https://github.com/nlsfi/qgis-plugin-dev-tools

# CHANGELOG

## [1.1.5] - 2023-03-29

- Fix: Do not zoom to error when geometry is null geometry

## [1.1.4] - 2023-03-08

- Fix: Show correct error count when errors are filtered
- Fix: Remove selected error visualization from map when error is removed from list

## [1.1.3] - 2023-03-03

- Feat: Add method to hide dock widget and functionality to recreate error visualizations

## [1.1.2] - 2023-03-01

- Fix: Do not hide filter menu when a filter is selected
- Fix: Fix missing marker symbol from line type annotations
- Feat: Allow configuring quality layer styles
- Feat: Add keyboard shortcut for visualize errors on map

## [1.1.1] - 2023-02-23

- Feat: Change Show user processed filter into checkbox selection

## [1.1.0] - 2023-02-16

- Feat: Add optional extra info field to quality error. Extra info is displayed in the tooltip of error description and may contain html formatted text.
- Refactor: Remove language specific description fields from quality error and include only a single field for description.

## [1.0.0] - 2023-02-14

- Feat: Added an API to add custom filters for errors.
- Fix: Hide empty branches from quality error list when user processed errors are hidden and user processes all errors for a feature
- Fix: Error layer stays visible after minimizing QGIS.

## [0.0.4] - 2022-12-28

- Feat: Emit mouse event signal for selected error feature
- Feat: New filter to filter quality errors by error attribute value
- Feat: Add tooltip for quality error description
- Feat: Update data in tree view partially when data changes
- Fix: Minor styling fixes of tree view
- Fix: Visualize error when description is clicked

## [0.0.3] - 2022-12-15

- Fix: Use glob paths for missing build resource files

## [0.0.2] - 2022-12-14

- Fix: Fix missing ui and svg files by including them in setuptools build

## [0.0.1] - 2022-12-14

- Initial release: QGIS dock widget for visualizing quality check results

[0.0.1]: https://github.com/nlsfi/quality-result-gui/releases/tag/v0.0.1
[0.0.2]: https://github.com/nlsfi/quality-result-gui/releases/tag/v0.0.2
[0.0.3]: https://github.com/nlsfi/quality-result-gui/releases/tag/v0.0.3
[0.0.4]: https://github.com/nlsfi/quality-result-gui/releases/tag/v0.0.4
[1.0.0]: https://github.com/nlsfi/quality-result-gui/releases/tag/v1.0.0
[1.1.0]: https://github.com/nlsfi/quality-result-gui/releases/tag/v1.1.0
[1.1.1]: https://github.com/nlsfi/quality-result-gui/releases/tag/v1.1.1
[1.1.2]: https://github.com/nlsfi/quality-result-gui/releases/tag/v1.1.2
[1.1.3]: https://github.com/nlsfi/quality-result-gui/releases/tag/v1.1.3
[1.1.4]: https://github.com/nlsfi/quality-result-gui/releases/tag/v1.1.4
[1.1.5]: https://github.com/nlsfi/quality-result-gui/releases/tag/v1.1.5
