Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change isochrone renderer to QgsGraduatedSymbolRenderer to support more than 10 colors #265

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

merydian
Copy link
Collaborator

To log the correct ApiError message in the isochrone processing algorithm window, when there are more than 10 ranges inputted.

Otherwise this will be printed:

File "/home/adroit/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ORStools/proc/isochrones_layer_proc.py", line 218, in postProcessAlgorithm
self.isochrones.stylePoly(processed_layer)
File "/home/adroit/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ORStools/common/isochrones_core.py", line 208, in stylePoly
color=colors[cid], strokeColor=QColor("#000000")
KeyError: 10```

T print correct error message in processing algorithm
@merydian merydian linked an issue May 31, 2024 that may be closed by this pull request
@merydian merydian marked this pull request as ready for review May 31, 2024 11:46
@merydian merydian requested a review from koebi May 31, 2024 11:46
@koebi
Copy link
Collaborator

koebi commented Jun 6, 2024

I think the limit of 10 ranges only exists for the public API.
For this, we should see that a useful error is reported when trying more than 10 isochrones.
For everything else, we should implement some sort of cycling through colors, or using random colors when over 10.

@merydian merydian changed the title fix: extend color dict for isochrones by one to improve error logging Change isochrone renderer to QgsGraduatedSymbolRenderer to support more than 10 colors Jun 7, 2024
@merydian
Copy link
Collaborator Author

merydian commented Jun 7, 2024

Current implementation uses QgsGraduatedSymbolRenderer with Spectral color ramp. The amount of possible ranges is no longer limited like this.

20 ranges:
image

@koebi koebi added the easy fix Issues that are rather quick to be resolved label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy fix Issues that are rather quick to be resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Undocumented limit of 10 isochrone ranges (KeyError: 10)
2 participants