Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: GIScience/orstools-qgis-plugin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.8.2
Choose a base ref
...
head repository: GIScience/orstools-qgis-plugin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on May 29, 2024

  1. fix: make extra_info work with request from two point/polyline layers

    Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
    merydian and koebi authored May 29, 2024
    Copy the full SHA
    85d4f76 View commit details
  2. chore: release v1.8.3

    koebi committed May 29, 2024
    Copy the full SHA
    2b981c1 View commit details

Commits on Jul 29, 2024

  1. fix: wrap locale reading in try/except statement

    Co-Authored-By: Amandus <23240110+TheGreatRefrigerator@users.noreply.github.com>
    merydian and TheGreatRefrigerator committed Jul 29, 2024
    Copy the full SHA
    e9731d2 View commit details
  2. Merge pull request #273 from GIScience/fix-locale-issue

    fix: wrap locale reading in try/except statement
    merydian authored Jul 29, 2024
    Copy the full SHA
    f290f81 View commit details
  3. Copy the full SHA
    6a008c4 View commit details
  4. Copy the full SHA
    86a1d55 View commit details

Commits on Jul 30, 2024

  1. chore: fix MIT licence to name copyright from original author

    - fix year of copyright application
    
    refers to:  #228
    TheGreatRefrigerator committed Jul 30, 2024
    Copy the full SHA
    2ceb0c2 View commit details
  2. Copy the full SHA
    6c0cc67 View commit details
  3. Copy the full SHA
    d5ede0c View commit details

Commits on Aug 23, 2024

  1. feat: introduce tests and CI for testing

    Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
    merydian and koebi authored Aug 23, 2024
    Copy the full SHA
    1f0e123 View commit details

Commits on Aug 27, 2024

  1. fix: alert on duplicate points traveling salesman (#275)

    Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
    merydian and koebi authored Aug 27, 2024
    Copy the full SHA
    0131012 View commit details

Commits on Aug 30, 2024

  1. feat: use qgs settings instead of config yml (#249)

    Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
    merydian and koebi authored Aug 30, 2024
    Copy the full SHA
    e6f17f8 View commit details

Commits on Sep 5, 2024

  1. Copy the full SHA
    78064b1 View commit details

Commits on Oct 18, 2024

  1. feat: add processing algo for export endpoint (#269)

    Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
    merydian and koebi authored Oct 18, 2024
    Copy the full SHA
    8687fe3 View commit details

Commits on Oct 29, 2024

  1. fix: error with canvas when deleting selected vertices in list

    Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
    merydian and koebi authored Oct 29, 2024
    Copy the full SHA
    7cf2825 View commit details
  2. Copy the full SHA
    9b2bc63 View commit details
  3. Copy the full SHA
    29418f9 View commit details
  4. chore: release v1.9.0

    koebi committed Oct 29, 2024
    Copy the full SHA
    880dad6 View commit details

Commits on Nov 21, 2024

  1. Copy the full SHA
    8497c67 View commit details
  2. feat: exit digitization on right click and ESC button (#286)

    Co-authored-by: Jakob Schnell <Jakob.Schnell@heigit.org>
    merydian and koebi authored Nov 21, 2024
    Copy the full SHA
    42cad6c View commit details
  3. chore: release v1.10.0

    koebi committed Nov 21, 2024
    Copy the full SHA
    d497168 View commit details
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

name: Testing

on:
pull_request:

jobs:
test_3_16:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run test 3.16
run: |
docker run -v ${GITHUB_WORKSPACE}:/src -w /src qgis/qgis:release-3_16 sh -c 'apt-get -y update && apt-get -y install xvfb && export ORS_API_KEY=${{ secrets.ORS_API_KEY }} && export DISPLAY=:0.0 && pip install -U pytest && xvfb-run pytest'
env:
DOCKER_IMAGE: ${{ steps.docker-build.outputs.FULL_IMAGE_NAME }}
test_3_22:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run test 3.22
run: |
docker run -v ${GITHUB_WORKSPACE}:/src -w /src qgis/qgis:release-3_22 sh -c 'apt-get -y update && apt-get -y install xvfb && export DISPLAY=:0.0 && export ORS_API_KEY=${{ secrets.ORS_API_KEY }} && export DISPLAY=:0.0 && pip install -U pytest && xvfb-run pytest'
env:
DOCKER_IMAGE: ${{ steps.docker-build.outputs.FULL_IMAGE_NAME }}
test_latest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run test latest
run: |
docker run -v ${GITHUB_WORKSPACE}:/src -w /src qgis/qgis:latest sh -c 'apt-get -y update && apt-get -y install xvfb && export DISPLAY=:0.0 && export ORS_API_KEY=${{ secrets.ORS_API_KEY }} && apt install python3-pytest && xvfb-run pytest'
env:
DOCKER_IMAGE: ${{ steps.docker-build.outputs.FULL_IMAGE_NAME }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
tets/
docs/wiki/OSMtools.wiki/
.idea/
43 changes: 42 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -40,6 +40,39 @@ RELEASING:
14. Create new release in GitHub with tag version and release title of `vX.X.X`
-->

## [Unreleased]

## [1.10.0] - 2024-11-21

### Added
- Exit digitization on right click or Escape key press ([#285](https://github.com/GIScience/orstools-qgis-plugin/issues/285))

### Fixed:
- Error with adding waypoints after calculating routes ([#288](https://github.com/GIScience/orstools-qgis-plugin/issues/288))

## [1.9.0] - 2024-10-29

### Fixed
- Error with canvas scenes when deleting selected vertices in list ([#278](https://github.com/GIScience/orstools-qgis-plugin/pull/278))

### Added
- Processing algorithm for the Export endpoint ([#210](https://github.com/GIScience/orstools-qgis-plugin/issues/210))
- Updates to german translation ([#280](https://github.com/GIScience/orstools-qgis-plugin/pull/280))

### Changed
- Use QgsSettings instead of config.yml file to avoid deletion of providers on update ([#108](https://github.com/GIScience/orstools-qgis-plugin/issues/108))

## [1.8.4] - 2024-07-29

### Fixed
- issue with missing locale value for non-default user([#271](https://github.com/GIScience/orstools-qgis-plugin/issues/271))

## [1.8.3] - 2024-05-29

### Fixed
- Add csv\_column parameter to request made by points\_layers\_proc([#260](https://github.com/GIScience/orstools-qgis-plugin/issues/260))
- make extra\_info work with two points layers

## [1.8.2] - 2024-05-20

### Fixed
@@ -71,6 +104,10 @@ RELEASING:
- Improved type hints


# Unreleased
### Added
- Unit- and e2e-testing

## [1.7.1] - 2024-01-15

### Added
@@ -251,7 +288,11 @@ RELEASING:
- first working version of ORS Tools, after replacing OSM Tools plugin


[unreleased]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.8.2...HEAD
[unreleased]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.10.0...HEAD
[1.10.0]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.9.0...v1.10.0
[1.9.0]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.8.4...v1.9.0
[1.8.4]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.8.3...v1.8.4
[1.8.3]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.8.2...v1.8.3
[1.8.2]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.8.1...v1.8.2
[1.8.1]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.8.0...v1.8.1
[1.8.0]: https://github.com/GIScience/orstools-qgis-plugin/compare/v1.7.1...v1.8.0
3 changes: 2 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2021 HeiGIT gGmbH
Copyright (c) 2017 Nils Nolde
Copyright (c) 2019 HeiGIT gGmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
22 changes: 22 additions & 0 deletions ORStools/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
MIT License

Copyright (c) 2017 Nils Nolde
Copyright (c) 2019 HeiGIT gGmbH

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 37 additions & 8 deletions ORStools/ORStoolsPlugin.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@

from qgis.gui import QgisInterface
from qgis.core import QgsApplication, QgsSettings
from qgis.PyQt.QtCore import QTranslator, qVersion, QCoreApplication
from qgis.PyQt.QtCore import QTranslator, qVersion, QCoreApplication, QLocale
import os.path

from .gui import ORStoolsDialog
@@ -56,15 +56,24 @@ def __init__(self, iface: QgisInterface) -> None:
self.plugin_dir = os.path.dirname(__file__)

# initialize locale
locale = QgsSettings().value("locale/userLocale")[0:2]
locale_path = os.path.join(self.plugin_dir, "i18n", "orstools_{}.qm".format(locale))
try:
locale = QgsSettings().value("locale/userLocale")
if not locale:
locale = QLocale().name()
locale = locale[0:2]

if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
locale_path = os.path.join(self.plugin_dir, "i18n", "orstools_{}.qm".format(locale))

if qVersion() > "4.3.3":
QCoreApplication.installTranslator(self.translator)
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)

if qVersion() > "4.3.3":
QCoreApplication.installTranslator(self.translator)
except TypeError:
pass

self.add_default_provider_to_settings()

def initGui(self) -> None:
"""Create the menu entries and toolbar icons inside the QGIS GUI."""
@@ -76,3 +85,23 @@ def unload(self) -> None:
"""remove menu entry and toolbar icons"""
QgsApplication.processingRegistry().removeProvider(self.provider)
self.dialog.unload()

def add_default_provider_to_settings(self):
s = QgsSettings()
settings = s.value("ORStools/config")
if not settings:
def_settings = {
"providers": [
{
"ENV_VARS": {
"ORS_QUOTA": "X-Ratelimit-Limit",
"ORS_REMAINING": "X-Ratelimit-Remaining",
},
"base_url": "https://api.openrouteservice.org",
"key": "",
"name": "openrouteservice",
"timeout": 60,
}
]
}
s.setValue("ORStools/config", def_settings)
12 changes: 10 additions & 2 deletions ORStools/common/directions_core.py
Original file line number Diff line number Diff line change
@@ -81,6 +81,7 @@ def get_fields(
to_name: str = "TO_ID",
line: bool = False,
extra_info: list = [],
two_layers: bool = False,
) -> QgsFields:
"""
Builds output fields for directions response layer.
@@ -114,6 +115,8 @@ def get_fields(
fields.append(QgsField(from_name, from_type))
if not line:
fields.append(QgsField(to_name, to_type))
if two_layers:
fields.append(QgsField(from_name, from_type))
for info in extra_info:
field_type = QVariant.Int
if info in ["waytype", "surface", "waycategory", "roadaccessrestrictions", "steepness"]:
@@ -260,15 +263,16 @@ def build_default_parameters(
return params


def get_extra_info_features_directions(response: dict, extra_info_order: list[str]):
def get_extra_info_features_directions(
response: dict, extra_info_order: List[str], to_from_values: Optional[list] = None
):
extra_info_order = [
key if key != "waytype" else "waytypes" for key in extra_info_order
] # inconsistency in API
response_mini = response["features"][0]
coordinates = response_mini["geometry"]["coordinates"]
feats = list()
extra_info = response_mini["properties"]["extras"]
logger.log(str(extra_info))
extras_list = {i: [] for i in extra_info_order}
for key in extra_info_order:
try:
@@ -290,7 +294,11 @@ def get_extra_info_features_directions(response: dict, extra_info_order: list[st
extra = extras_list[j]
attr = extra[i]
attrs.append(attr)

if to_from_values: # for directions from two point layers
attrs = [to_from_values[0], to_from_values[1]] + attrs
feat.setAttributes(attrs)

feats.append(feat)

return feats
8 changes: 0 additions & 8 deletions ORStools/config.yml

This file was deleted.

Loading